fix hyphen and sameSite warning

This commit is contained in:
plebbitor
2023-03-08 12:49:44 +01:00
parent f425b4b8c6
commit 8053276f06
6 changed files with 41 additions and 64 deletions
+9 -9
View File
@@ -260,17 +260,17 @@ const Board = ({ setBodyStyle }) => {
fontFamily: "Arial, Helvetica, sans-serif"
});
setSelectedStyle("Yotsuba");
setCookie("selectedStyle", "Yotsuba", { path: "/" });
setCookie("selectedStyle", "Yotsuba", { path: "/", sameSite: 'none', secure: true });
break;
case "Yotsuba B":
case "Yotsuba-B":
setBodyStyle({
background: "#eef2ff url(/assets/fade-blue.png) top center repeat-x",
color: "#000",
fontFamily: "Arial, Helvetica, sans-serif"
});
setSelectedStyle("Yotsuba B");
setCookie("selectedStyle", "Yotsuba B", { path: "/", sameSite: 'none', secure: true });
setSelectedStyle("Yotsuba-B");
setCookie("selectedStyle", "Yotsuba-B", { path: "/", sameSite: 'none', secure: true });
break;
case "Futaba":
@@ -327,15 +327,15 @@ const Board = ({ setBodyStyle }) => {
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
if (parts.length === 2) return parts.pop().split(";").shift();
}
useEffect(() => {
const style = getCookie("selectedStyle");
if (style) {
handleStyleChange({target: {value: style}});
handleStyleChange({ target: { value: style } });
}
}, [selectedStyle])
}, []);
return (
@@ -455,7 +455,7 @@ const Board = ({ setBodyStyle }) => {
 
<select id="style-selector" onChange={handleStyleChange} value={selectedStyle}>
<option value="Yotsuba">Yotsuba</option>
<option value="Yotsuba B">Yotsuba B</option>
<option value="Yotsuba-B">Yotsuba B</option>
<option value="Futaba">Futaba</option>
<option value="Burichan">Burichan</option>
<option value="Tomorrow">Tomorrow</option>
+8 -8
View File
@@ -225,14 +225,14 @@ const Catalog = ({ setBodyStyle }) => {
setCookie("selectedStyle", "Yotsuba", { path: "/" });
break;
case "Yotsuba B":
case "Yotsuba-B":
setBodyStyle({
background: "#eef2ff url(/assets/fade-blue.png) top center repeat-x",
color: "#000",
fontFamily: "Arial, Helvetica, sans-serif"
});
setSelectedStyle("Yotsuba B");
setCookie("selectedStyle", "Yotsuba B", { path: "/", sameSite: 'none', secure: true });
setSelectedStyle("Yotsuba-B");
setCookie("selectedStyle", "Yotsuba-B", { path: "/", sameSite: 'none', secure: true });
break;
case "Futaba":
@@ -289,15 +289,15 @@ const Catalog = ({ setBodyStyle }) => {
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
if (parts.length === 2) return parts.pop().split(";").shift();
}
useEffect(() => {
const style = getCookie("selectedStyle");
if (style) {
handleStyleChange({target: {value: style}});
handleStyleChange({ target: { value: style } });
}
}, [selectedStyle])
}, []);
@@ -418,7 +418,7 @@ const Catalog = ({ setBodyStyle }) => {
 
<select id="style-selector" onChange={handleStyleChange} value={selectedStyle}>
<option value="Yotsuba">Yotsuba</option>
<option value="Yotsuba B">Yotsuba B</option>
<option value="Yotsuba-B">Yotsuba B</option>
<option value="Futaba">Futaba</option>
<option value="Burichan">Burichan</option>
<option value="Tomorrow">Tomorrow</option>
+9 -9
View File
@@ -144,14 +144,14 @@ const Thread = ({ setBodyStyle }) => {
setCookie("selectedStyle", "Yotsuba", { path: "/" });
break;
case "Yotsuba B":
case "Yotsuba-B":
setBodyStyle({
background: "#eef2ff url(/assets/fade-blue.png) top center repeat-x",
color: "#000",
fontFamily: "Arial, Helvetica, sans-serif"
});
setSelectedStyle("Yotsuba B");
setCookie("selectedStyle", "Yotsuba B", { path: "/", sameSite: 'none', secure: true });
setSelectedStyle("Yotsuba-B");
setCookie("selectedStyle", "Yotsuba-B", { path: "/", sameSite: 'none', secure: true });
break;
case "Futaba":
@@ -208,15 +208,15 @@ const Thread = ({ setBodyStyle }) => {
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
if (parts.length === 2) return parts.pop().split(";").shift();
}
useEffect(() => {
const style = getCookie("selectedStyle");
if (style) {
handleStyleChange({target: {value: style}});
handleStyleChange({ target: { value: style } });
}
}, [selectedStyle])
}, []);
@@ -352,7 +352,7 @@ const Thread = ({ setBodyStyle }) => {
 
<select id="style-selector" onChange={handleStyleChange} value={selectedStyle}>
<option value="Yotsuba">Yotsuba</option>
<option value="Yotsuba B">Yotsuba B</option>
<option value="Yotsuba-B">Yotsuba B</option>
<option value="Futaba">Futaba</option>
<option value="Burichan">Burichan</option>
<option value="Tomorrow">Tomorrow</option>
@@ -740,7 +740,7 @@ const Thread = ({ setBodyStyle }) => {
 
<select id="style-selector" onChange={handleStyleChange} value={selectedStyle}>
<option value="Yotsuba">Yotsuba</option>
<option value="Yotsuba B">Yotsuba B</option>
<option value="Yotsuba-B">Yotsuba B</option>
<option value="Futaba">Futaba</option>
<option value="Burichan">Burichan</option>
<option value="Tomorrow">Tomorrow</option>
+10 -10
View File
@@ -106,7 +106,7 @@ export const NavBar = styled.div`
color: navy;
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `font-size: 9pt;
color: #89a;
@@ -254,7 +254,7 @@ export const Header = styled.div`
font-size: 9pt;
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `text-align: center;
clear: both;
@@ -419,7 +419,7 @@ export const Break = styled.hr`
border-top: 1px solid #d9bfb7;
height: 0;`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `width: 90%;
border: none;
border-top: 1px solid #b7c5d9;
@@ -495,7 +495,7 @@ export const PostFormLink = styled.div`
}
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `.btn-wrap {
background-color: #d6daf0;
background-image: url(/assets/buttonfade-blue.png);
@@ -694,7 +694,7 @@ export const PostFormTable = styled.table`
}
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `tbody > tr > td:first-child {
background-color: #98e;
color: #000;
@@ -1147,7 +1147,7 @@ export const PostForm = styled.div`
color: red;
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `#post-form-link {
font-size: 22px;
font-weight: 700;
@@ -1252,7 +1252,7 @@ export const TopBar = styled.div`
color: red;
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `clear: both;
hr {
border: none;
@@ -1423,7 +1423,7 @@ ${({ selectedStyle }) => {
}
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `.btn-wrap {
background-color: #d6daf0;
background-image: url(/assets/buttonfade-blue.png);
@@ -1699,7 +1699,7 @@ export const BoardForm = styled.div`
}
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `
.op-container {
background-color: #d6daf0;
@@ -2646,7 +2646,7 @@ export const BoardForm = styled.div`
height: 0;
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `.thread {
margin: 0;
clear: both;
-23
View File
@@ -57,27 +57,4 @@ export const Threads = styled.div`
display: block;
padding: 0 15px;
}
${({ selectedStyle }) => {
switch (selectedStyle) {
case 'Yotsuba':
return ``;
case 'Yotsuba B':
return ``;
case 'Futaba':
return `font-size: 12pt;`;
case 'Burichan':
return `font-size: 12pt;`;
case 'Tomorrow':
return ``;
case 'Photon':
return ``;
}
}}
`;
+5 -5
View File
@@ -64,7 +64,7 @@ export const ReplyFormLink = styled.div`
}
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `.btn-wrap {
background-color: #d6daf0;
background-image: url(/assets/buttonfade-blue.png);
@@ -253,7 +253,7 @@ export const ReplyFormTable = styled.table`
position: relative;
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `tbody > tr > td:first-child {
background-color: #98e;
color: #000;
@@ -708,7 +708,7 @@ export const TopBar = styled.div`
}
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `clear: both;
hr {
border: none;
@@ -880,7 +880,7 @@ export const TopBar = styled.div`
}
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `.btn-wrap {
background-color: #d6daf0;
background-image: url(/assets/buttonfade-blue.png);
@@ -1040,7 +1040,7 @@ export const BottomBar = styled.div`
padding-top: 5px;
}`;
case 'Yotsuba B':
case 'Yotsuba-B':
return `
a, a:visited {
color: #34345c !important;