Restyled by prettier
This commit is contained in:
parent
711ac93cb9
commit
2efae466ec
3 changed files with 100 additions and 97 deletions
|
@ -1,36 +1,35 @@
|
||||||
// Define an array of strings
|
// Define an array of strings
|
||||||
const neverSaid =
|
const neverSaid = [
|
||||||
[
|
"<strong>ASM:</strong> The Director liked all the props we got today.",
|
||||||
"<strong>ASM:</strong> The Director liked all the props we got today.",
|
"<strong>PM:</strong> Ah ha, a revolve. Terrific.",
|
||||||
"<strong>PM:</strong> Ah ha, a revolve. Terrific.",
|
"<strong>Chippie:</strong> I don't know, let's look at the ground plan.",
|
||||||
"<strong>Chippie:</strong> I don't know, let's look at the ground plan.",
|
"<strong>Set Designer:</strong> Well, let's just have whatever is cheaper.",
|
||||||
"<strong>Set Designer:</strong> Well, let's just have whatever is cheaper.",
|
"<strong>Sound:</strong> Better turn that down a bit. We don't want to deafen them.",
|
||||||
"<strong>Sound:</strong> Better turn that down a bit. We don't want to deafen them.",
|
"<strong>Director:</strong> Sorry, my mistake.",
|
||||||
"<strong>Director:</strong> Sorry, my mistake.",
|
"<strong>Electrics:</strong> This equipment is more complicated than we need.",
|
||||||
"<strong>Electrics:</strong> This equipment is more complicated than we need.",
|
"<strong>Performer:</strong> I really think my big scene should be cut.",
|
||||||
"<strong>Performer:</strong> I really think my big scene should be cut.",
|
"<strong>SM:</strong> Can we do that scene change again please?",
|
||||||
"<strong>SM:</strong> Can we do that scene change again please?",
|
"<strong>LX designer:</strong> Bit more light from those big chaps at the side. Yes that's right, the ones on stalks whatever they are called.",
|
||||||
"<strong>LX designer:</strong> Bit more light from those big chaps at the side. Yes that's right, the ones on stalks whatever they are called.",
|
"<strong>Electrics:</strong> All the equipment works perfectly.",
|
||||||
"<strong>Electrics:</strong> All the equipment works perfectly.",
|
"<strong>Musicians:</strong> So what if that's the end of a call. Let's just finish this bit off.",
|
||||||
"<strong>Musicians:</strong> So what if that's the end of a call. Let's just finish this bit off.",
|
"<strong>Wardrobe:</strong> Now, when exactly is the first dress rehearsal?",
|
||||||
"<strong>Wardrobe:</strong> Now, when exactly is the first dress rehearsal?",
|
"<strong>Workshop:</strong> I don't want anyone to know, but if you insist then yes, I admit it, I have just done an all-nighter.",
|
||||||
"<strong>Workshop:</strong> I don't want anyone to know, but if you insist then yes, I admit it, I have just done an all-nighter.",
|
"<strong>Performer:</strong> This costume is so comfortable.",
|
||||||
"<strong>Performer:</strong> This costume is so comfortable.",
|
"<strong>Admin:</strong> The level of overtime payments here are simply unacceptable. Our backstage staff deserve better.",
|
||||||
"<strong>Admin:</strong> The level of overtime payments here are simply unacceptable. Our backstage staff deserve better.",
|
"<strong>Box Office:</strong> Comps? No problem.",
|
||||||
"<strong>Box Office:</strong> Comps? No problem.",
|
"<strong>Set Designer:</strong> You're right, it looks dreadful.",
|
||||||
"<strong>Set Designer:</strong> You're right, it looks dreadful.",
|
"<strong>Flyman:</strong> No, my lips are sealed. What I may or may not have seen remains a secret.",
|
||||||
"<strong>Flyman:</strong> No, my lips are sealed. What I may or may not have seen remains a secret.",
|
"<strong>Electrics:</strong> That had nothing to do with the computer, it was my fault.",
|
||||||
"<strong>Electrics:</strong> That had nothing to do with the computer, it was my fault.",
|
"<strong>Crew:</strong> No, no, I'm sure that's our job.",
|
||||||
"<strong>Crew:</strong> No, no, I'm sure that's our job.",
|
"<strong>SMgt:</strong> Thanks, but I don't drink",
|
||||||
"<strong>SMgt:</strong> Thanks, but I don't drink",
|
"<strong>Performer:</strong> Let me stand down here with my back to the audience.",
|
||||||
"<strong>Performer:</strong> Let me stand down here with my back to the audience.",
|
"<strong>Chippie:</strong> I can't really manage those big fast power tools myself.",
|
||||||
"<strong>Chippie:</strong> I can't really manage those big fast power tools myself.",
|
"<strong>Chippie:</strong> I prefer to use these little hand drills.",
|
||||||
"<strong>Chippie:</strong> I prefer to use these little hand drills.",
|
"<strong>All:</strong> Let's go and ask the Production Manager. He'll know.",
|
||||||
"<strong>All:</strong> Let's go and ask the Production Manager. He'll know."
|
];
|
||||||
]
|
|
||||||
|
|
||||||
// Generate a random index into the array
|
// Generate a random index into the array
|
||||||
const randomIndex = Math.floor(Math.random() * neverSaid.length);
|
const randomIndex = Math.floor(Math.random() * neverSaid.length);
|
||||||
|
|
||||||
// Use document.write to output the random string
|
// Use document.write to output the random string
|
||||||
document.write(neverSaid[randomIndex]);
|
document.write(neverSaid[randomIndex]);
|
||||||
|
|
|
@ -1,36 +1,35 @@
|
||||||
// Define an array of strings
|
// Define an array of strings
|
||||||
const neverSaid =
|
const neverSaid = [
|
||||||
[
|
'<td style="width: 105px"><strong>ASM:</strong></td> <td>The Director liked all the props we got today.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>ASM:</strong></td> <td>The Director liked all the props we got today.</td>",
|
'<td style="width: 105px"><strong>PM:</strong></td> <td>Ah ha, a revolve. Terrific.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>PM:</strong></td> <td>Ah ha, a revolve. Terrific.</td>",
|
"<td style=\"width: 105px\"><strong>Chippie:</strong></td> <td>I don't know, let's look at the ground plan.</td>",
|
||||||
"<td style=\"width: 105px\"><strong>Chippie:</strong></td> <td>I don't know, let's look at the ground plan.</td>",
|
'<td style="width: 105px"><strong>Set Designer:</strong></td> <td>Well, let\'s just have whatever is cheaper.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Set Designer:</strong></td> <td>Well, let's just have whatever is cheaper.</td>",
|
'<td style="width: 105px"><strong>Sound:</strong></td> <td>Better turn that down a bit. We don\'t want to deafen them.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Sound:</strong></td> <td>Better turn that down a bit. We don't want to deafen them.</td>",
|
'<td style="width: 105px"><strong>Director:</strong></td> <td>Sorry, my mistake.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Director:</strong></td> <td>Sorry, my mistake.</td>",
|
'<td style="width: 105px"><strong>Electrics:</strong></td> <td>This equipment is more complicated than we need.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Electrics:</strong></td> <td>This equipment is more complicated than we need.</td>",
|
'<td style="width: 105px"><strong>Performer:</strong></td> <td>I really think my big scene should be cut.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Performer:</strong></td> <td>I really think my big scene should be cut.</td>",
|
'<td style="width: 105px"><strong>SM:</strong></td> <td>Can we doo that scene change again please?',
|
||||||
"<td style=\"width: 105px\"><strong>SM:</strong></td> <td>Can we doo that scene change again please?",
|
'<td style="width: 105px"><strong>LX designer:</strong></td> <td>Bit more light from those big chaps at the side. Yes that\'s right, the ones on stalks whatever they are called.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>LX designer:</strong></td> <td>Bit more light from those big chaps at the side. Yes that's right, the ones on stalks whatever they are called.</td>",
|
'<td style="width: 105px"><strong>Electrics:</strong></td> <td>All the equipment works perfectly.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Electrics:</strong></td> <td>All the equipment works perfectly.</td>",
|
"<td style=\"width: 105px\"><strong>Musicians:</strong></td> <td>So what if that's the end of a call. Let's just finish this bit off.</td>",
|
||||||
"<td style=\"width: 105px\"><strong>Musicians:</strong></td> <td>So what if that's the end of a call. Let's just finish this bit off.</td>",
|
'<td style="width: 105px"><strong>Wardrobe:</strong></td> <td>Now, when exactly is the first dress rehearsal?',
|
||||||
"<td style=\"width: 105px\"><strong>Wardrobe:</strong></td> <td>Now, when exactly is the first dress rehearsal?",
|
'<td style="width: 105px"><strong>Workshop:</strong></td> <td>I don\'t want anyone to know, but if you insist then yes, I admit it, I have just done an all-nighter.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Workshop:</strong></td> <td>I don't want anyone to know, but if you insist then yes, I admit it, I have just done an all-nighter.</td>",
|
'<td style="width: 105px"><strong>Performer:</strong></td> <td>This costume is so comfortable.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Performer:</strong></td> <td>This costume is so comfortable.</td>",
|
'<td style="width: 105px"><strong>Admin:</strong></td> <td>The level of overtime payments here are simply unacceptable. Our backstage staff deserve better.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Admin:</strong></td> <td>The level of overtime payments here are simply unacceptable. Our backstage staff deserve better.</td>",
|
'<td style="width: 105px"><strong>Box Office:</strong></td> <td>Comps? No problem.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Box Office:</strong></td> <td>Comps? No problem.</td>",
|
'<td style="width: 105px"><strong>Set Designer:</strong></td> <td>You\'re right, it looks dreadful.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Set Designer:</strong></td> <td>You're right, it looks dreadful.</td>",
|
'<td style="width: 105px"><strong>Flyman:</strong></td> <td>No, my lips are sealed. What I may or may not have seen remains a secret.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Flyman:</strong></td> <td>No, my lips are sealed. What I may or may not have seen remains a secret.</td>",
|
'<td style="width: 105px"><strong>Electrics:</strong></td> <td>That had nothing to do with the computer, it was my fault.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Electrics:</strong></td> <td>That had nothing to do with the computer, it was my fault.</td>",
|
"<td style=\"width: 105px\"><strong>Crew:</strong></td> <td>No, no, I'm sure that's our job.</td>",
|
||||||
"<td style=\"width: 105px\"><strong>Crew:</strong></td> <td>No, no, I'm sure that's our job.</td>",
|
'<td style="width: 105px"><strong>SMgt:</strong></td> <td>Thanks, but I don\'t drink',
|
||||||
"<td style=\"width: 105px\"><strong>SMgt:</strong></td> <td>Thanks, but I don't drink",
|
'<td style="width: 105px"><strong>Performer:</strong></td> <td>Let me stand down here with my back to the audience.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Performer:</strong></td> <td>Let me stand down here with my back to the audience.</td>",
|
'<td style="width: 105px"><strong>Chippie:</strong></td> <td>I can\'t really manage those big fast power tools myself.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Chippie:</strong></td> <td>I can't really manage those big fast power tools myself.</td>",
|
'<td style="width: 105px"><strong>Chippie:</strong></td> <td>I prefer to use these little hand drills.</td>',
|
||||||
"<td style=\"width: 105px\"><strong>Chippie:</strong></td> <td>I prefer to use these little hand drills.</td>",
|
"<td style=\"width: 105px\"><strong>All:</strong></td> <td>Let's go and ask the Production Manager. He'll know.</td>",
|
||||||
"<td style=\"width: 105px\"><strong>All:</strong></td> <td>Let's go and ask the Production Manager. He'll know.</td>"
|
];
|
||||||
]
|
|
||||||
|
|
||||||
// Generate a random index into the array
|
// Generate a random index into the array
|
||||||
const randomIndex = Math.floor(Math.random() * neverSaid.length);
|
const randomIndex = Math.floor(Math.random() * neverSaid.length);
|
||||||
|
|
||||||
// Use document.write to output the random string
|
// Use document.write to output the random string
|
||||||
document.write(neverSaid[randomIndex]);
|
document.write(neverSaid[randomIndex]);
|
||||||
|
|
|
@ -4,19 +4,19 @@
|
||||||
* @returns {string} Cookie value
|
* @returns {string} Cookie value
|
||||||
*/
|
*/
|
||||||
function getCookie(cname) {
|
function getCookie(cname) {
|
||||||
let name = cname + "=";
|
let name = cname + "=";
|
||||||
let decodedCookie = decodeURIComponent(document.cookie);
|
let decodedCookie = decodeURIComponent(document.cookie);
|
||||||
let ca = decodedCookie.split(';');
|
let ca = decodedCookie.split(";");
|
||||||
for (let i = 0; i < ca.length; i++) {
|
for (let i = 0; i < ca.length; i++) {
|
||||||
let c = ca[i];
|
let c = ca[i];
|
||||||
while (c.charAt(0) === ' ') {
|
while (c.charAt(0) === " ") {
|
||||||
c = c.substring(1);
|
c = c.substring(1);
|
||||||
|
}
|
||||||
|
if (c.indexOf(name) === 0) {
|
||||||
|
return c.substring(name.length, c.length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (c.indexOf(name) === 0) {
|
return "";
|
||||||
return c.substring(name.length, c.length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,11 +26,16 @@ function getCookie(cname) {
|
||||||
* @param {number} exdays Cookie lifespan (days)
|
* @param {number} exdays Cookie lifespan (days)
|
||||||
*/
|
*/
|
||||||
function setCookie(cname, cvalue, exdays) {
|
function setCookie(cname, cvalue, exdays) {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
|
||||||
let expires = "expires=" + d.toUTCString();
|
let expires = "expires=" + d.toUTCString();
|
||||||
document.cookie = cname + "=" + cvalue + ";" + expires +
|
document.cookie =
|
||||||
";path=/;SameSite=Strict;Domain=.diskfloppy.me";
|
cname +
|
||||||
|
"=" +
|
||||||
|
cvalue +
|
||||||
|
";" +
|
||||||
|
expires +
|
||||||
|
";path=/;SameSite=Strict;Domain=.diskfloppy.me";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,8 +44,8 @@ function setCookie(cname, cvalue, exdays) {
|
||||||
* @returns {boolean} If cookie exists or not
|
* @returns {boolean} If cookie exists or not
|
||||||
*/
|
*/
|
||||||
function cookieExists(cname) {
|
function cookieExists(cname) {
|
||||||
const cvalue = getCookie(cname);
|
const cvalue = getCookie(cname);
|
||||||
return cvalue !== "";
|
return cvalue !== "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,25 +53,25 @@ function cookieExists(cname) {
|
||||||
* @param {string} scheme Color scheme ID
|
* @param {string} scheme Color scheme ID
|
||||||
*/
|
*/
|
||||||
function swapScheme(scheme) {
|
function swapScheme(scheme) {
|
||||||
setCookie("colorscheme", scheme, 90);
|
setCookie("colorscheme", scheme, 90);
|
||||||
document.getElementById("css-colorscheme").href =
|
document.getElementById("css-colorscheme").href =
|
||||||
`/css/colorschemes/${scheme}.css`;
|
`/css/colorschemes/${scheme}.css`;
|
||||||
console.log(`Set colorscheme to ${getCookie("colorscheme")}`)
|
console.log(`Set colorscheme to ${getCookie("colorscheme")}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSchemeSelector() {
|
function setSchemeSelector() {
|
||||||
if (!cookieExists("colorscheme")) {
|
if (!cookieExists("colorscheme")) {
|
||||||
setCookie("colorscheme", "catppuccin-macchiato", 90);
|
setCookie("colorscheme", "catppuccin-macchiato", 90);
|
||||||
} else {
|
} else {
|
||||||
const scheme = getCookie("colorscheme");
|
const scheme = getCookie("colorscheme");
|
||||||
const scheme_selector = document.getElementById("scheme-selector");
|
const scheme_selector = document.getElementById("scheme-selector");
|
||||||
if (scheme && scheme_selector) {
|
if (scheme && scheme_selector) {
|
||||||
for (let option of scheme_selector.options) {
|
for (let option of scheme_selector.options) {
|
||||||
if (option.value === scheme) {
|
if (option.value === scheme) {
|
||||||
option.selected = true;
|
option.selected = true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue