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