more optimizations, remove WTVIRC for now, upgrade test.js

This commit is contained in:
zefie
2025-08-13 21:42:22 -04:00
parent 54bb975f1a
commit 22c7229e38
162 changed files with 1002 additions and 5539 deletions

View File

@@ -25,7 +25,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body vlink="#660000" link="#180d4b" bgcolor="#eeeeee" background="clipart/styleMedia/us_flag.gif">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -34,7 +34,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -44,7 +44,7 @@ to return to editing it.
this.styledata.text +
`><b>${title}</b></font>
</center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -26,7 +26,7 @@ class PBTemplate {
</head>
<body background="clipart/styleMedia/baseballfield.gif" text="#cccc99" link="#66ff66" vlink="#ccffcc">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -38,7 +38,7 @@ to return to editing it.
<img src="clipart/styleMedia/baseball.gif" width="400" height="100" align="bottom">
&nbsp;
</center><p>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -47,7 +47,7 @@ to return to editing it.
this.styledata.text +
`>${title}</font></H1></CENTER>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -22,7 +22,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body text="#7ac2d5" bgcolor="#11144c" link="#a5a033" vlink="#25a51f">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -37,7 +37,7 @@ to return to editing it.
<tbody><tr>
<td>`;
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -47,7 +47,7 @@ to return to editing it.
`>${title}</font></td>
<td>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body vlink="#fa7474" text="#faf3ed" link="#fa9d46" background="clipart/styleMedia/tile5.gif">`;
// Do some templating here for some fucking reason
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `
<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
@@ -33,7 +33,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -43,7 +43,7 @@ to return to editing it.
this.styledata.titheader += `
${title}
</font></h1></center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -21,7 +21,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body bgcolor="#eeeeee">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -34,13 +34,13 @@ to return to editing it.
<tbody>`;
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
this.styledata.titheader += `<center>
<font size="7" color="#000000"><b>${title}</b></font></center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -50,13 +50,13 @@ to return to editing it.
</td>
<td bgcolor="#464de3" >
<center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
this.styledata.titheader += `<b><font size="7" color="#e6e1e1">${title}</font></b></center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -46,7 +46,7 @@ to return to editing it.
<td><img src="clipart/styleMedia/so00483_.gif"></td>
<td >
<center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -55,7 +55,7 @@ to return to editing it.
this.styledata.text +
`><b>${title}</b></font></center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -26,7 +26,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body bgcolor="white" link="#180d4b" vlink="#660000" background="clipart/styleMedia/stars.gif">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -35,7 +35,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -44,7 +44,7 @@ to return to editing it.
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -61,13 +61,13 @@ to return to editing it.
<td colspan=3 >
<center>
`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
this.styledata.titheader += `<font size="6" color="#000000"><b>${title}</b></font></center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body background="clipart/styleMedia/tile9.gif" text="black" link="#09021e" vlink="#2f0001">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -41,7 +41,7 @@ to return to editing it.
<font size="+3" color=` +
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -26,7 +26,7 @@ class PBTemplate {
</head>
<body text="#ccffcc" bgcolor="#003300" link="#ffcc00" vlink="#ccb699">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -42,7 +42,7 @@ to return to editing it.
</td>
<td >
<center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -51,7 +51,7 @@ to return to editing it.
<font size="6" color=` +
this.styledata.text +
`><b>${title}</b></font></center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -22,7 +22,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<BODY bgcolor=#ffffcc link=#006600 vlink=#660000>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -34,13 +34,13 @@ to return to editing it.
<TR>
<TD><IMG src=clipart/Nature/Flowers/na00140_.gif width=253 height=273 align=left> </TD>
<TD>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
this.styledata.titheader += `<FONT size=+3 color=#003300>${title}</FONT>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -26,7 +26,7 @@ class PBTemplate {
</head>
<body background="clipart/styleMedia/footballfield.gif" text="#ffffcc" bgcolor="white" link="yellow" alink="#ccffcc" vlink="#ffcc99">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -35,7 +35,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = `<img src="clipart/styleMedia/football.gif" width="283" height="55" align="bottom"><p>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -44,7 +44,7 @@ to return to editing it.
this.styledata.text +
`>${title}</font></H1>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -22,7 +22,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body text="#97e373" bgcolor="#003300" link="#ccc63f" vlink="#22cc17">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -38,7 +38,7 @@ to return to editing it.
<td>`;
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -48,7 +48,7 @@ to return to editing it.
`>${title}</font></td>
<td>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body text="#261373" link="blue" vlink="#2a6e73" background="clipart/styleMedia/tile6.gif">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -41,7 +41,7 @@ to return to editing it.
<font size="+3" color=` +
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body bgcolor="silver" text="black" link="blue" alink="red" vlink="#ff00ff">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -41,7 +41,7 @@ to return to editing it.
<font size="+3" color=` +
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -47,7 +47,7 @@ to return to editing it.
<td><img height="150" width="150" src="clipart/Animations/j0205352.gif"></td>
<td >
<center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -56,7 +56,7 @@ to return to editing it.
this.styledata.text +
`><b>${title}</b></font></center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -22,7 +22,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<BODY bgcolor="#c4dbff" link="#33309a">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -34,13 +34,13 @@ to return to editing it.
<TR>
<TD><IMG src=clipart/styleMedia/AG00318_.gif align=left> </TD>
<TD>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
this.styledata.titheader += `<FONT size=+3 color=#003300>${title}</FONT>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -22,7 +22,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<BODY bgcolor="#deb1b1" link="#4c58b6" vlink="#519eb6">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -34,13 +34,13 @@ to return to editing it.
<TR>
<TD><IMG src=clipart/styleMedia/AG00318_.gif align=left> </TD>
<TD>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
this.styledata.titheader += `<FONT size=+3 color=#003300>${title}</FONT>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body text="#7eecf7" link="#c5c1ca" vlink="#b4c1fa" background="clipart/styleMedia/tile4.gif">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -41,7 +41,7 @@ to return to editing it.
<font size="+3" color=` +
this.styledata.text +
`><b><i>${title}</i></b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body background="clipart/styleMedia/tile1.gif" text="#ffffa0" link="#fff81f" vlink="#ffa034">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -42,7 +42,7 @@ to return to editing it.
this.styledata.text +
`>${title}</font>
</H1></CENTER>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -26,7 +26,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body vlink="#CCFFFF" text="#FFFFFF" link="#00FFFF" bgcolor="#7189ae" background="clipart/styleMedia/oceantile.gif">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -35,7 +35,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -47,7 +47,7 @@ to return to editing it.
<td >
<center>
`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">`;
}
this.styledata.titheader +=
@@ -56,7 +56,7 @@ to return to editing it.
this.styledata.text +
`><b>${title}</b></font></center>
`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}
this.styledata.titheader += `

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body background="clipart/styleMedia/show-tile3.gif" text="#c8e7f1" link="#fffe67" vlink="#ff7171">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -41,7 +41,7 @@ to return to editing it.
<font size="+3" color=` +
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -22,7 +22,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body text="#cabdc7" bgcolor="#660517" link="#cac534" vlink="#c8cac5">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -38,7 +38,7 @@ to return to editing it.
<td>`;
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -48,7 +48,7 @@ to return to editing it.
`>${title}</font></td>
<td>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -26,7 +26,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body bgcolor="white" link="#180d4b" vlink="#660000" background="clipart/styleMedia/stars.gif">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -35,7 +35,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -44,7 +44,7 @@ to return to editing it.
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -22,7 +22,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body text="black" link="#552768" bgcolor="white" vlink="#333333" background="clipart/styleMedia/ringbinder.gif">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -37,13 +37,13 @@ to return to editing it.
<TD >
<CENTER>
<FONT size=7>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
this.styledata.titheader +=
`<font color=` + this.styledata.text + `><b>${title}</B>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body text="#e4ece6" link="#eceb9f" vlink="#e1903c" background="clipart/styleMedia/tile12.gif">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -41,7 +41,7 @@ to return to editing it.
<font size="+3" color=` +
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body background="clipart/styleMedia/tile11.gif" link="#2a238c" vlink="#f17075">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -41,7 +41,7 @@ to return to editing it.
<font size="+3" color=` +
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -21,7 +21,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body vlink="#ffff99" text="#cccccc" link="#ffcc00" bgcolor="#333333" background="clipart/styleMedia/spacefield.gif">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -30,7 +30,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -49,7 +49,7 @@ ${title}
</tr>
</tbody></table>
</center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body text="#ffffcc" bgcolor="white" link="#00ccff" vlink="#ccffff" background="clipart/styleMedia/stonesfield.gif">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -42,7 +42,7 @@ to return to editing it.
this.styledata.text +
`><b><i>${title}</i></b></font>
</center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body background="clipart/styleMedia/tile3.gif" text="#cccccc" link="#50caca" vlink="#47ca92">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -42,7 +42,7 @@ to return to editing it.
this.styledata.text +
`>${title}</font>
</H1></CENTER>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -23,7 +23,7 @@ class PBTemplate {
</head>
<body background="clipart/styleMedia/watertile.gif" text="white" link="aqua" alink="red" vlink="#ccffff">
<center>`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -32,7 +32,7 @@ to return to editing it.
</TABLE>`;
}
this.styledata.titheader = ``;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
@@ -41,7 +41,7 @@ to return to editing it.
<font size="+3" color=` +
this.styledata.text +
`><b>${title}</b></font>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -26,7 +26,7 @@ class PBTemplate {
<title>${title}</title>
</head>
<body bgcolor="#97bfbb" text="#3f3a89" link="#6a298c" vlink="#6a298c">`;
if (state == "previewing") {
if (state === "previewing") {
this.styledata.header += `<TABLE cellspacing=0 cellpadding=0 bgcolor=#1e4261 border=1 width=100%>
<TR><TD valign=middle align=center><FONT color=#D1D1D1>
You are previewing your page. Press <B>Back</B>
@@ -40,13 +40,13 @@ to return to editing it.
<td><img src="clipart/styleMedia/j0172489.gif" height="122" width="123"></td>
<td >
<center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `<a href="wtv-author:/edit-title?docName=${docName}&titleOnly=true">
`;
}
this.styledata.titheader += `<FONT size=+3 color=#${this.styledata.text}><b>${title}</b></FONT></center>`;
if (state == "editing") {
if (state === "editing") {
this.styledata.titheader += `</a>`;
}

View File

@@ -64,7 +64,7 @@ the page's address.
<form>
<font color=ffcf69><shadow>
<input type=button usestyle borderimage="file://ROM/Borders/ButtonBorder2.bif"`;
if (request_headers.query.goBack == "true")
if (request_headers.query.goBack === "true")
data += "action=client:goback value=Done"
else
data += "action=Print value=Continue"

View File

@@ -76,7 +76,7 @@ To add a new user now, choose this link:
<form>
<font color=ffcf69><shadow>
<input type=button usestyle borderimage="file://ROM/Borders/ButtonBorder2.bif"`;
if (request_headers.query.directLink == "true")
if (request_headers.query.directLink === "true")
data += "action=javascript:location=history.go(-1);"
else
data += "action=javascript:location=history.go(-2);"

View File

@@ -64,7 +64,7 @@ Choose the first letter of the word you are looking for.
data += `<td width=40>\n<a href="wtv-guide:/help?topic=Glossary&subtopic=${self.page_args.letters[k]}" selected><blackface>${self.page_args.letters[k]}</blackface></a>\n`
i++;
j++;
if (i == 8 && self.page_args.letters.length != (j + 1)) {
if (i === 8 && self.page_args.letters.length !== (j + 1)) {
// add new <tr> every 8 entries, but only if its not the last entry
i = 0;
data += `<tr><td height=32>\n`;

View File

@@ -63,11 +63,11 @@ Choose a word to see what it means.
// test
data += `<a href="wtv-guide:/help?topic=Glossary&subtopic=${self.page_args.letter}&page=${self.page_args.words[k].link}" selected>${self.page_args.words[k].word}</a><br>\n`
words_rendered++;
if (self.page_args.words.length % 2 != 0) {
if (self.page_args.words.length % 2 !== 0) {
// odd so split later to put extra on first row
if (words_rendered - 1 == table_split) data += `<td>`;
if (words_rendered - 1 === table_split) data += `<td>`;
} else {
if (words_rendered == table_split) data += `<td>`;
if (words_rendered === table_split) data += `<td>`;
}
});

View File

@@ -5,7 +5,7 @@ let site = "";
if (minisrv_config.services['wtv-author'].public_domain) {
site = minisrv_config.services['wtv-author'].public_domain;
} else {
if (minisrv_config.services['wtv-author'].publish_mode == "service") {
if (minisrv_config.services['wtv-author'].publish_mode === "service") {
const target_service = minisrv_config.services[minisrv_config.services['wtv-author'].publish_dest];
if (target_service) {
site = target_service.host + ":" + target_service.port;

View File

@@ -9,7 +9,7 @@ if (auth === true) {
const authheader = request_headers.authorization.split(' ');
console.log(request_headers)
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
password = password.split(':')[1];
}

View File

@@ -9,7 +9,7 @@ if (auth === true) {
const authheader = request_headers.authorization.split(' ');
console.log(request_headers)
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
let password = Buffer.from(authheader[1], 'base64').toString();
password = password.split(':')[1];
}
@@ -29,7 +29,7 @@ Content-Type: text/html`
Welcome to the zefie minisrv v${minisrv_config.version} Account Administration
</p>
`;
if (request_headers.query.cmd == "list") {
if (request_headers.query.cmd === "list") {
data += `<hr>`;
if (request_headers.query.msg) {
data += decodeURI(request_headers.query.msg) + "<hr>";
@@ -41,7 +41,7 @@ Welcome to the zefie minisrv v${minisrv_config.version} Account Administration
});
data += `</table>`;
} else if (request_headers.query.cmd == "ssid") {
} else if (request_headers.query.cmd === "ssid") {
const ssid = request_headers.query.ssid;
if (!ssid) {
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
@@ -78,7 +78,7 @@ function validateSelection(cmd, ssid, friendlymsg) {
if (Object.keys(user_info.account_users).length > 1) {
data += `<tr><td style="vertical-align: top">Additional Users:</td><td>`;
Object.keys(user_info.account_users).forEach(function (k) {
if (k == "subscriber") return;
if (k === "subscriber") return;
data += user_info.account_users[k].subscriber_username + "<br>";
})
data += `</td></tr>`
@@ -91,7 +91,7 @@ function validateSelection(cmd, ssid, friendlymsg) {
data += "The SSID does not exist in the SessionStore."
}
}
} else if (request_headers.query.cmd == "delete") {
} else if (request_headers.query.cmd === "delete") {
redirectmsg = "";
const ssid = request_headers.query.ssid;
if (ssid) {
@@ -102,7 +102,7 @@ function validateSelection(cmd, ssid, friendlymsg) {
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
}
headers = "302 OK\nLocation: /admin/?cmd=list&msg=" + encodeURI(redirectmsg);
} else if (request_headers.query.cmd == "ban") {
} else if (request_headers.query.cmd === "ban") {
redirectmsg = "";
const ssid = request_headers.query.ssid;
if (ssid) {
@@ -110,7 +110,7 @@ function validateSelection(cmd, ssid, friendlymsg) {
if (result === wtva.SUCCESS) {
reloadConfig();
redirectmsg = "The SSID is now banned.";
} else if (result == wtva.REASON_EXISTS) {
} else if (result === wtva.REASON_EXISTS) {
redirectmsg = "The SSID was already banned.";
} else {
redirectmsg = "Unknown response " + result.toString();
@@ -119,7 +119,7 @@ function validateSelection(cmd, ssid, friendlymsg) {
redirectmsg = `An SSID is required for the ${request_headers.query.cmd} command.`;
}
headers = "302 OK\nLocation: /admin/?cmd=ssid&ssid=" + encodeURI(ssid) + "&msg=" + encodeURI(redirectmsg);
} else if (request_headers.query.cmd == "unban") {
} else if (request_headers.query.cmd === "unban") {
redirectmsg = "The SSID was not banned, so it could not be unbanned.";
const ssid = request_headers.query.ssid;
if (ssid) {
@@ -127,7 +127,7 @@ function validateSelection(cmd, ssid, friendlymsg) {
if (result === wtva.SUCCESS) {
reloadConfig();
redirectmsg = "The SSID is now unbanned.";
} else if (result == wtva.REASON_EXISTS) {
} else if (result === wtva.REASON_EXISTS) {
redirectmsg = "The SSID was not banned.";
} else {
redirectmsg = "Unknown response " + result.toString();

View File

@@ -74,7 +74,7 @@ const patch_limits = {
function getPatchDataType(type, invert = false) {
let patch_data = false;
if ((type == "wtv-incarnation" && !invert) || (type == "wtv-encryption" && invert)) {
if ((type === "wtv-incarnation" && !invert) || (type === "wtv-encryption" && invert)) {
patch_data = "wtv-client-serial-number: %s\r\n"
patch_data += "wtv-user-requested-upgrade: %s\r\n";
patch_data += "wtv-system-cpuprid: %s\r\n";
@@ -87,7 +87,7 @@ function getPatchDataType(type, invert = false) {
patch_data += "wtv-system-chipversion: %s\r\n";
patch_data += "User-Agent: %s\r\n";
}
else if ((type == "wtv-encryption" && !invert) || (type == "wtv-incarnation" && invert) ) {
else if ((type === "wtv-encryption" && !invert) || (type === "wtv-incarnation" && invert) ) {
patch_data = "wtv-tourist-enabled: %s\r\n";
patch_data += "wtv-demo-enabled: %s\r\n";
patch_data += "wtv-default-client-scriptprops: %s\r\n";
@@ -106,7 +106,7 @@ function getPatchDataType(type, invert = false) {
function getResData(file) {
let res_data = null;
if (file.slice(-2, 2).toLowerCase() == "gz") {
if (file.slice(-2, 2).toLowerCase() === "gz") {
const res_gz_data = wtvshared.getServiceDep("/viewergen/" + file);
res_data = zlib.gunzipSync(res_gz_data);
} else {
@@ -227,14 +227,14 @@ function getPatchData(fname, client_data_obj, start_url = "client:GoToConn", def
const val = customized_patch_data[idx];
if (typeof val === 'string') {
// start url override
if (start_url != patch_defaults.start_url && start_url.length <= patch_limits.start_url) {
if (val.slice(0, patch_defaults.start_url.length) == patch_defaults.start_url)
if (start_url !== patch_defaults.start_url && start_url.length <= patch_limits.start_url) {
if (val.slice(0, patch_defaults.start_url.length) === patch_defaults.start_url)
customized_patch_data[idx] = start_url + "\x00";
}
// default service ip override
if (default_ip != patch_defaults.default_ip && default_ip.length <= patch_limits.default_ip) {
if (val.slice(0, patch_defaults.default_ip.length) == patch_defaults.default_ip)
if (default_ip !== patch_defaults.default_ip && default_ip.length <= patch_limits.default_ip) {
if (val.slice(0, patch_defaults.default_ip.length) === patch_defaults.default_ip)
customized_patch_data[idx] = default_ip + "\x00";
}
} else {
@@ -242,7 +242,7 @@ function getPatchData(fname, client_data_obj, start_url = "client:GoToConn", def
// not a buffer object
let patch_data_string = "";
const block_length = val['length'];
const patch_data = getPatchDataType(val['type'], (fname.slice(12, 3) != "1.1"));
const patch_data = getPatchDataType(val['type'], (fname.slice(12, 3) !== "1.1"));
if (patch_data) {
const patch_data_array = patch_data.split("\r\n");
@@ -256,7 +256,7 @@ function getPatchData(fname, client_data_obj, start_url = "client:GoToConn", def
}
});
}
if (fname.slice(12, 3) != "2.5") {
if (fname.slice(12, 3) !== "2.5") {
const length_difference = block_length - patch_data_string.length;
if (length_difference > 0)
patch_data_string += "\x00".repeat(length_difference - (val['type'].length + 1));
@@ -292,7 +292,7 @@ function patchBinary(patchDataObject) {
function generateSSID() {
const ssid_template = "91xxxxxxaeb002";
let ssid = ssid_template;
while (ssid.indexOf("x") != -1) {
while (ssid.indexOf("x") !== -1) {
// random hex char from 0-F
ssid = ssid.replace("x", Math.floor(Math.random() * 16).toString(16))
}
@@ -458,7 +458,7 @@ if (request_headers.query.viewer &&
const viewer_gz_data = wtvshared.getServiceDep("/viewergen/" + viewer_file + ".gz");
const viewer_data = zlib.gunzipSync(viewer_gz_data);
const viewer_md5 = crypto.createHash('md5').update(viewer_data).digest("hex");
if (viewer_md5 != viewer_stock_md5s[viewer_file]) {
if (viewer_md5 !== viewer_stock_md5s[viewer_file]) {
console.error(viewer_file, "md5sum error. expected:", viewer_stock_md5s[viewer_file], ", got:", viewer_md5)
const errpage = wtvshared.doErrorPage("500", null, socket.minisrv_pc_mode)
headers = errpage[0];
@@ -514,7 +514,7 @@ Content-Disposition: attachment; filename="${viewer_file.replace(".exe", ".zip")
console.log(request_headers)
let update_str = "http://" + request_headers.host + request_headers.request_url.split('?')[0] + "?ssid=" + client_ssid;
Object.keys(request_headers.query).forEach((k) => {
if (k != "random_ssid") {
if (k !== "random_ssid") {
update_str += "&" + encodeURIComponent(k) + "=" + encodeURIComponent(request_headers.query[k]);
}
});
@@ -525,7 +525,7 @@ Content-Disposition: attachment; filename="${viewer_file.replace(".exe", ".zip")
const romset_zip = new AdmZip(wtvshared.getServiceDep("/viewergen/" + viewer_file.replace(".exe", "").replace("WebTVIntel", "AppData") + ".zip", true));
const zipEntries = romset_zip.getEntries();
zipEntries.forEach(function (zipEntry) {
if (zipEntry.entryName == "Setup.bmp" && request_headers.query.logo) {
if (zipEntry.entryName === "Setup.bmp" && request_headers.query.logo) {
const logo_file = logos[parseInt(request_headers.query.logo) || 0];
if (logo_file) {
const logo_gz_data = wtvshared.getServiceDep("/viewergen/" + logo_file + ".gz");

View File

@@ -1,12 +1,12 @@
const minisrv_service_file = true;
let wtvsec_login;
if (socket.ssid != null && !session_data.get("wtvsec_login")) {
if (socket.ssid !== null && !session_data.get("wtvsec_login")) {
wtvsec_login = session_data.createWTVSecSession();
wtvsec_login.IssueChallenge();
if (request_headers["wtv-incarnation"]) wtvsec_login.set_incarnation(request_headers["wtv-incarnation"]);
session_data.set("wtvsec_login", wtvsec_login);
} else if (socket.ssid != null) {
} else if (socket.ssid !== null) {
wtvsec_login = session_data.get("wtvsec_login");
}

View File

@@ -3,9 +3,9 @@ let gourl = "wtv-head-waiter:/login?";
let file_path = null;
if (session_data) {
if (session_data.loadSessionData() == true) {
if (session_data.loadSessionData() === true) {
console.log(" * Loaded session data from disk for", wtvshared.filterSSID(socket.ssid))
session_data.setSessionData("registered", (session_data.getSessionData("registered") == true) ? true : false);
session_data.setSessionData("registered", (session_data.getSessionData("registered") === true) ? true : false);
} else {
session_data.session_data = {};
session_data.setSessionData("registered", false);
@@ -14,8 +14,8 @@ if (session_data) {
if (session_data.data_store.sockets) {
let i = 0;
session_data.data_store.sockets.forEach(function (k) {
if (typeof k != "undefined") {
if (k != socket) {
if (typeof k !== "undefined") {
if (k !== socket) {
k.destroy();
session_data.data_store.sockets.delete(k);
i++;
@@ -59,7 +59,7 @@ if (session_data.data_store.wtvsec_login) {
let send_tellyscript = (minisrv_config.services[service_name].send_tellyscripts && !request_headers.query.relogin && !bootrom !== 0);
const wtv_script_id = parseInt(session_data.get("wtv-script-id"));
const wtv_script_mod = parseInt(session_data.get("wtv-script-mod"));
if ((request_headers.query.reconnect || request_headers.query.relogin) && wtv_script_id != 0) send_tellyscript = false;
if ((request_headers.query.reconnect || request_headers.query.relogin) && wtv_script_id !== 0) send_tellyscript = false;
if (wtv_script_id !== 0 && wtv_script_mod !== 0) send_tellyscript = false;
if (!minisrv_config.services[service_name].send_tellyscript_to_mame) {
if (wtvshared.parseSSID(socket.ssid).boxType === "MAME") {
@@ -68,7 +68,7 @@ if (session_data.data_store.wtvsec_login) {
}
if (minisrv_config.services[service_name].tellyscript_ssid_blacklist) {
send_tellyscript = (minisrv_config.services[service_name].tellyscript_ssid_blacklist.findIndex(element => element == socket.ssid) == -1)
send_tellyscript = (minisrv_config.services[service_name].tellyscript_ssid_blacklist.findIndex(element => element === socket.ssid) === -1)
}
if (send_tellyscript) {
@@ -157,8 +157,8 @@ if (session_data.data_store.wtvsec_login) {
if (request_headers.query.reconnect) gourl = null;
if (file_path != null && send_tellyscript && !minisrv_config.config.debug_flags.quiet) console.log(" * Sending TellyScript", file_path, "on socket", socket.id);
if (template != null && send_tellyscript && !minisrv_config.config.debug_flags.quiet) console.log(" * Generating TellyScript on socket", socket.id);
if (file_path !== null && send_tellyscript && !minisrv_config.config.debug_flags.quiet) console.log(" * Sending TellyScript", file_path, "on socket", socket.id);
if (template !== null && send_tellyscript && !minisrv_config.config.debug_flags.quiet) console.log(" * Generating TellyScript on socket", socket.id);
headers = "200 OK\n"
@@ -181,7 +181,7 @@ if (session_data.data_store.wtvsec_login) {
headers += "wtv-boot-url: wtv-head-waiter:/login?relogin=true";
headers += "\n";
}
if (gourl != null) headers += "wtv-visit: " + gourl + "\n";
if (gourl !== null) headers += "wtv-visit: " + gourl + "\n";
if (!bf0app_update && session_data.get("wtv-open-access")) headers += "wtv-open-isp-disabled: false\n";
headers += "wtv-client-time-zone: GMT -0000\n";
headers += "wtv-client-time-dst-rule: GMT\n"

View File

@@ -7,7 +7,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}

View File

@@ -7,7 +7,7 @@ if (auth === true) {
let result, ssid, password;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
@@ -44,10 +44,10 @@ wtv-expire-all: wtv-admin:/ban`;
<input type="submit" value="Ban SSID">
</form><br><br>`
if (request_headers.query.ssid) {
if (result == wtva.REASON_SELF) {
if (result === wtva.REASON_SELF) {
data += "<strong>Cannot ban yourself.</strong>"
} else {
if (result == wtva.REASON_EXISTS) {
if (result === wtva.REASON_EXISTS) {
data += "<strong>SSID " + request_headers.query.ssid + " is already in the ban list.</strong><br><br>";
} else if (result === wtva.SUCCESS) {
reloadConfig();

View File

@@ -8,7 +8,7 @@ if (auth === true) {
let ssid_match = false;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
@@ -19,7 +19,7 @@ if (auth === true) {
user_info = wtva.getAccountInfoBySSID(ssid);
if (request_headers.query.confirm_delete) {
user_info = null;
if (ssid == socket.ssid) {
if (ssid === socket.ssid) {
ssid_match = true;
} else {
// delete
@@ -63,7 +63,7 @@ wtv-noback-all: wtv-admin:/deleteaccount`;
if (Object.keys(user_info.account_users).length > 1) {
data += `<tr><td>Additional Users:</td><td>`;
Object.keys(user_info.account_users).forEach(function (k) {
if (k == "subscriber") return;
if (k === "subscriber") return;
data += user_info.account_users[k].subscriber_username + "<br>";
})
data += `</td></tr>`

View File

@@ -12,7 +12,7 @@ if (auth === true) {
const show_box_was_unregistered = false;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
@@ -22,7 +22,7 @@ if (auth === true) {
user_info = wtva.getAccountInfo(request_headers.query.username.toLowerCase()); // username search
if (user_info) {
if (user_info.ssid == socket.ssid) {
if (user_info.ssid === socket.ssid) {
show_cannot_modify_self = true;
}
if (request_headers.query.confirm_delete) {

View File

@@ -8,7 +8,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
@@ -53,7 +53,7 @@ wtv-noback-all: wtv-admin:/findaccount`;
if (Object.keys(user_info.account_users).length > 1) {
data += `<tr><td>Additional Users:</td><td>`;
Object.keys(user_info.account_users).forEach(function (k) {
if (k == "subscriber") return;
if (k === "subscriber") return;
data += user_info.account_users[k].subscriber_username + "<br>";
})
data += `</td></tr>`

View File

@@ -20,15 +20,15 @@ function generateFormField(type, confvar, options = null) {
confvar_value = user_config.config[confvar] || minisrv_config.config[confvar];
}
if (type == "input")
if (type === "input")
return `<input bgcolor="101010" text="ee44bb" type="text" name="${confvar}" value="${confvar_value}"${(options) ? ' '+options : ''}>`
if (type == "checkbox")
if (type === "checkbox")
return `<input type="hidden" name="${confvar}" value="false">\n<input type=checkbox name="${confvar}" ${wtvshared.parseBool(confvar_value) ? "checked=checked" : ''}${(options) ? ' ' + options : ''}>`
if (type == "select") {
if (type === "select") {
let out = `<select name="${confvar}">\n`
if (options) {
Object.keys(options).forEach((k) => {
out += `<option value="${options[k].value}"${(confvar_value == options[k].value) ? ' selected' : ''}>${options[k].name}</option>\n`
out += `<option value="${options[k].value}"${(confvar_value === options[k].value) ? ' selected' : ''}>${options[k].name}</option>\n`
});
}
return out + "</select>";
@@ -39,7 +39,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}

View File

@@ -8,7 +8,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
@@ -79,7 +79,7 @@ data += `
</form><br><br>`
if (request_headers.query.username) {
if (user_info && !request_headers.query.confirm && !request_headers.query.reset) {
if (user_info.username == session_data.getSessionData("subscriber_username")) {
if (user_info.username === session_data.getSessionData("subscriber_username")) {
data += `Are you sure you want to Polyzoot <b>yourself</b>?<br>Are you a masochist?`;
} else {
data += `Are you sure you want to Polyzoot <b>${user_info.username}</b>?<br>Are you a sadist?`;

View File

@@ -8,7 +8,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}

View File

@@ -7,7 +7,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}

View File

@@ -10,7 +10,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
@@ -19,7 +19,7 @@ if (auth === true) {
if (request_headers.query.username) {
user_info = wtva.getAccountInfo(request_headers.query.username.toLowerCase()); // username search
if (user_info) {
if (user_info.ssid == socket.ssid) {
if (user_info.ssid === socket.ssid) {
show_cannot_modify_self = true;
}
const userAccount = wtva.getAccountBySSID(user_info.ssid);

View File

@@ -10,7 +10,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}
@@ -22,7 +22,7 @@ if (auth === true) {
if (!fake_config.config.ssid_block_list) fake_config.config.ssid_block_list = [];
if (typeof request_headers.query.unban_ssid === 'string') {
Object.keys(fake_config.config.ssid_block_list).forEach(function (k) {
if (fake_config.config.ssid_block_list[k] == request_headers.query.unban_ssid) {
if (fake_config.config.ssid_block_list[k] === request_headers.query.unban_ssid) {
fake_config.config.ssid_block_list.splice(k, 1);
ssids_removed.push(request_headers.query.unban_ssid)
config_changed = true;
@@ -30,9 +30,9 @@ if (auth === true) {
});
} else {
Object.keys(fake_config.config.ssid_block_list).forEach(function (k) {
Object.keys(request_headers.query.unban_ssid).forEach(function (j) {
if (fake_config.config.ssid_block_list[k] == request_headers.query.unban_ssid[j]) {
fake_config.config.ssid_block_list.splice(k,1);
Object.keys(request_headers.query.unban_ssid).forEach(function (j) {
if (fake_config.config.ssid_block_list[k] === request_headers.query.unban_ssid[j]) {
fake_config.config.ssid_block_list.splice(k, 1);
ssids_removed.push(request_headers.query.unban_ssid[j])
config_changed = true;
}

View File

@@ -8,7 +8,7 @@ if (auth === true) {
let password = null;
if (request_headers.Authorization) {
const authheader = request_headers.Authorization.split(' ');
if (authheader[0] == "Basic") {
if (authheader[0] === "Basic") {
password = Buffer.from(authheader[1], 'base64').toString();
if (password) password = password.split(':')[1];
}

View File

@@ -10,7 +10,7 @@ const oldPosition = request_headers.query.oldBlockNum;
const editing = request_headers.query.editing;
let page;
if (editing == "true"){
if (editing === "true"){
session_data.pagestore.editPhotoBlock(docName, request_headers.query.blockNum, request_headers.query.newBlockNum, null, null, request_headers.query.blockTitle, request_headers.query.photoBlockCaption);
headers = `300 OK
wtv-expire-all: wtv-author:/block-preview
@@ -22,14 +22,14 @@ Location: wtv-author:/show-blocks?docName=${docName}`
} else {
const page = session_data.pagestore.loadPage(docName);
const blockNum = request_headers.query.blockNum;
if (request_headers.query.scrapbookID != undefined) {
if (request_headers.query.scrapbookID !== undefined) {
const image = session_data.pagestore.getScrapbookImage(parseInt(request_headers.query.scrapbookID));
if (page.blocks[blockNum] != undefined)
if (page.blocks[blockNum] !== undefined)
session_data.pagestore.editPhotoBlock(docName, request_headers.query.blockNum, request_headers.query.blockNum, image, "scrapbook", null, null);
else
session_data.pagestore.createPhotoBlock(docName, image, "scrapbook");
} else {
if (page.blocks[blockNum] != undefined)
if (page.blocks[blockNum] !== undefined)
session_data.pagestore.editPhotoBlock(docName, request_headers.query.blockNum, request_headers.query.blockNum, request_headers.query.mediaPath, "clipart", null, null);
else
session_data.pagestore.createPhotoBlock(docName, request_headers.query.mediaPath, "clipart");

View File

@@ -3,7 +3,7 @@ const minisrv_service_file = true;
const pagestore_exists = session_data.pagestore.pagestoreExists();
const docName = request_headers.query.docName;
if (pagestore_exists != true)
if (pagestore_exists !== true)
{
session_data.pagestore.createPagestore();
headers = `300 OK
@@ -129,7 +129,7 @@ ${page.title}
</B></font>
<P>
<font size=2 color=AEBFD1>`
if (page.published == true)
if (page.published === true)
data += `published ${page.publishdate}`
else
data += "not published"
@@ -163,7 +163,7 @@ Change how your page is listed
<tr>
<td>
<img src=wtv-author:/ROMCache/pointer.gif align=absmiddle width=13 height=22 hspace=0> `
if (page.published != true)
if (page.published !== true)
data += `<a href=publish?docName=${docName}
><font effect=shadow><B>Publish page</B></font></a>
<BR><spacer type=block width=18 height=30 align=top>

View File

@@ -4,7 +4,7 @@ const pagestore_exists = session_data.pagestore.pagestoreExists();
const site = session_data.pagestore.getPublishDomain();
if (pagestore_exists != true)
if (pagestore_exists !== true)
session_data.pagestore.createPagestore();
const pagearray = session_data.pagestore.listPages();
@@ -163,7 +163,7 @@ data = `<HTML>
`
for (let i = 0; i < numofpages; i++) {
data += `<tr> <td rowspan=2 valign=top>`
if (i == 0)
if (i === 0)
data += `<img src="/ROMCache/left_mark.gif" width=5 height=9>
<td colspan=4><img src="/ROMCache/horiz_line_top.gif" width=347 height=9>
<td rowspan=2 valign=top><img src="/ROMCache/right_mark.gif" width=5 height=9>`
@@ -181,7 +181,7 @@ ${pagearray[i].description}
</I></font>
<P>
<font size=1 color=AEBFD1>`
if (pagearray[i].published == true)
if (pagearray[i].published === true)
data += `published ${pagearray[i].publishdate}`
else
data += "not published"

View File

@@ -203,7 +203,7 @@ Add text to your document
<TD>Text size:`
const textsize = pagedata.blocks[oldBlockNum].size
if (textsize == "-1")
if (textsize === "-1")
{
data += `<TD><INPUT type=radio value=-1 name=textBlockSize checked onClick=ReWrite()>
<font size=-1>Small</font></TD>
@@ -211,7 +211,7 @@ if (textsize == "-1")
Medium</TD>
<TD><INPUT type=radio value=+1 name=textBlockSize onClick=ReWrite()>
<font size=+1>Large</font></TD>`
} else if (textsize == "+1")
} else if (textsize === "+1")
{
data += `<TD><INPUT type=radio value=-1 name=textBlockSize onClick=ReWrite()>
<font size=-1>Small</font></TD>
@@ -233,7 +233,7 @@ data += `
<TD>Text style:`
const textstyle = pagedata.blocks[oldBlockNum].style
if (textstyle == "B")
if (textstyle === "B")
{
data += `
<TD><INPUT type=radio name=textBlockStyle onClick=ReWrite()>
@@ -243,7 +243,7 @@ Plain</TD>
<TD><INPUT type=radio value=I name=textBlockStyle onClick=ReWrite()>
<I>Italic</I></TD>
</TABLE>`
} else if (textstyle == "I") {
} else if (textstyle === "I") {
data += `
<TD><INPUT type=radio name=textBlockStyle onClick=ReWrite()>
Plain</TD>
@@ -461,11 +461,11 @@ if (showIt)
{ document.viewOptionEmbed.document.write('
<BODY text=AEBFD1 link=B8BDC7 vlink=B8BDC7>
<img src=wtv-author:/ROMCache/pointer.gif align=absmiddle width=13 height=22 hspace=0> `
if (blockType == "snapshot" || blockType == "scrapbook") {
if (blockType === "snapshot" || blockType === "scrapbook") {
data += `<a href=wtv-author:/get-photo?docName=${docName}&blockNum=${oldBlockNum}
><font effect=shadow><B>View this picture</B></font></a>
</BODY>`
} else if (blockType == "clipart")
} else if (blockType === "clipart")
data += `<a href=wtv-author:/${photo}
><font effect=shadow><B>View this picture</B></font></a>
</BODY>`
@@ -551,9 +551,9 @@ vspace=0
<table cellspacing=0 cellpadding=0>
<tr>
<td height=100 valign=middle rowspan=5>`
if (blockType == "snapshot") {
if (blockType === "snapshot") {
data += `<img src=wtv-author:/get-photo?docName=${docName}&blockNum=${oldBlockNum} width=131 height=100 border=1 onError="DisplayViewOption(false)">`
} else if (blockType == "clipart") {
} else if (blockType === "clipart") {
data += `<img src=wtv-author:/${thumbnail} width=64 height=64 border=1 onError="DisplayViewOption(false)">`
}
data += `
@@ -579,7 +579,7 @@ DisplayViewOption(true);
<tr>
<td colspan=2 absheight=28>
<input type=text name="blockTitle" id="blockTitle" value="`
if (pagedata.blocks[oldBlockNum].title != null)
if (pagedata.blocks[oldBlockNum].title !== null)
data += `${pagedata.blocks[oldBlockNum].title}`
data += `" selected width=100% text=CACA4A bgcolor=192133 font=proportional autoactivate>
<tr>
@@ -597,7 +597,7 @@ autohiragana
growable
width=100%
value="`
if (pagedata.blocks[oldBlockNum].caption != null)
if (pagedata.blocks[oldBlockNum].caption !== null)
data += `${pagedata.blocks[oldBlockNum].caption}`
data += `"
cols=45 rows=3></TEXTAREA>
@@ -837,14 +837,14 @@ Add a heading to your document
<TABLE>
<TR>
<TD>Text size:`
if (pagedata.blocks[oldBlockNum].size == "H3")
if (pagedata.blocks[oldBlockNum].size === "H3")
data += `<TD><INPUT type=radio value=H3 name=headingBlockSize checked onClick=ReWrite()>
<FONT size=-1>Small</FONT></TD>
<TD><INPUT type=radio value=H2 name=headingBlockSize onClick=ReWrite()>
Medium</TD>
<TD><INPUT type=radio value=H1 name=headingBlockSize onClick=ReWrite()>
<FONT size=+1>Large</FONT></TD>`
else if (pagedata.blocks[oldBlockNum].size == "H1")
else if (pagedata.blocks[oldBlockNum].size === "H1")
data += `<TD><INPUT type=radio value=H3 name=headingBlockSize onClick=ReWrite()>
<FONT size=-1>Small</FONT></TD>
<TD><INPUT type=radio value=H2 name=headingBlockSize onClick=ReWrite()>
@@ -862,7 +862,7 @@ data += `
<TR>
<TD>Add a divider line:</TD>
<TD colspan=3><INPUT type=checkbox name=headingBlockDividerBefore `
if (pagedata.blocks[oldBlockNum].dividerBefore == "on")
if (pagedata.blocks[oldBlockNum].dividerBefore === "on")
data += "checked"
data += `>
Before the heading</TD>
@@ -870,7 +870,7 @@ Before the heading</TD>
<TR>
<TD></TD>
<TD colspan=3><INPUT type=checkbox name=headingBlockDividerAfter `
if (pagedata.blocks[oldBlockNum].dividerAfter == "on")
if (pagedata.blocks[oldBlockNum].dividerAfter === "on")
data += "checked"
data += `>
After the heading</TD>
@@ -1204,7 +1204,7 @@ function SetListItems()
for (let i = 0; i < pagedata.blocks[oldBlockNum].items.length; i++) {
data += `ListElements[${i}] = new Object;`
if (pagedata.blocks[oldBlockNum].items[i].name == undefined)
if (typeof pagedata.blocks[oldBlockNum].items[i].name === 'undefined')
data += `ListElements[${i}].desc = "";`
else
data += `ListElements[${i}].desc = "${pagedata.blocks[oldBlockNum].items[i].name}";`

View File

@@ -7,7 +7,7 @@ headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
if (request_headers.query.publishing == "true") {
if (request_headers.query.publishing === "true") {
data = `<HTML>
<HEAD>
<DISPLAY fontsize=medium>
@@ -110,7 +110,7 @@ cols=45 rows=4 MAXLENGTH=128></TEXTAREA>
</BODY>
</HTML>
`
} else if (request_headers.query.titleOnly == "true") {
} else if (request_headers.query.titleOnly === "true") {
data = `<HTML>
<HEAD>
<DISPLAY fontsize=medium>
@@ -194,7 +194,7 @@ as well as in the list of your pages.
<tr><td colspan=2>
<input type=hidden name="hideTitle" value="">
<input type=checkbox value=${!page.showtitle} `
if (page.showtitle == true)
if (page.showtitle === true)
data += "checked"
data += `
onChange="SetHideTitle(this.checked)">

View File

@@ -4,7 +4,7 @@ const docName = request_headers.query.docName;
const page = session_data.pagestore.loadPage(docName);
const site = session_data.pagestore.getPublishDomain();
if (request_headers.query.publishStage == "1") {
if (request_headers.query.publishStage === "1") {
headers = `200 OK
Content-Type: text/html`
@@ -77,7 +77,7 @@ Your public list of pages will be at:<BR>
<tr>
<td colspan=3 valign=top>
<input type=checkbox name="includeInPublicList" value=${page.inlist} `
if (page.inlist == true)
if (page.inlist === true)
data += "checked"
data += `>
Include in public list
@@ -116,24 +116,24 @@ Include in public list
</BODY>
</HTML>
`
} else if (request_headers.query.publishStage == "2") {
} else if (request_headers.query.publishStage === "2") {
let inlist;
if (request_headers.query.includeInPublicList != undefined) {
if (typeof request_headers.query.includeInPublicList !== 'undefined') {
inlist = true;
} else {
inlist = false;
}
const result = session_data.pagestore.publishPage(docName, inlist);
if (result == true) {
if (result === true) {
headers = `300 OK
wtv-expire-all: wtv-author:/documents
Location: wtv-author:/congrats?docName=${docName}`
} else {
headers = `400 ${result}`
}
} else if (request_headers.query.unpublish == "1") {
} else if (request_headers.query.unpublish === "1") {
const result = session_data.pagestore.unpublishPage(docName);
if (result == true) {
if (result === true) {
headers = `300 OK
wtv-expire-all: wtv-author:/documents
wtv-expire-all: wtv-author:/doc-info

View File

@@ -11,9 +11,9 @@ const editing = request_headers.query.editing;
const blockClass = request_headers.query.blockClass;
switch(blockClass) {
case "23":
if (editing == "true") {
if (editing === "true") {
const photo = request_headers.query.photoBlockPhoto;
if (request_headers.query.toSnapshot == "true")
if (request_headers.query.toSnapshot === "true")
session_data.pagestore.editPhotoBlock(docName, request_headers.query.blockNum, request_headers.query.newBlockNum, photo, "snapshot", request_headers.query.blockTitle, request_headers.query.photoBlockCaption);
else
session_data.pagestore.editPhotoBlock(docName, request_headers.query.blockNum, request_headers.query.newBlockNum, null, null, request_headers.query.blockTitle, request_headers.query.photoBlockCaption);
@@ -36,14 +36,14 @@ Location: ${request_headers.query.returnPageURL + "&numOfBlocks=" + page.blocks.
}
break;
case "21":
if (caption.length == 0) {
if (caption.length === 0) {
headers = "400 You must enter a caption. Please enter a caption and try again."
} else {
if (editing == "true") {
if (size.length == 0)
if (editing === "true") {
if (size.length === 0)
size = null;
if (style.length == 0)
if (style.length === 0)
style = null;
session_data.pagestore.editTextBlock(docName, title, caption, size, style, position, oldPosition);
headers = `300 OK
@@ -53,10 +53,10 @@ Location: ${request_headers.query.returnPageURL + "&numOfBlocks=" + page.blocks.
wtv-expire-all: wtv-author:/edit-block
Location: wtv-author:/show-blocks?docName=${docName}`
} else {
if (size.length == 0)
if (size.length === 0)
size = null;
if (style.length == 0)
if (style.length === 0)
style = null;
session_data.pagestore.createTextBlock(docName, title, caption, size, style, position);
headers = `300 OK
@@ -72,10 +72,10 @@ Location: ${request_headers.query.returnPageURL + "&numOfBlocks=" + page.blocks.
size = request_headers.query.headingBlockSize
const dividerBefore = request_headers.query.headingBlockDividerBefore
const dividerAfter = request_headers.query.headingBlockDividerAfter
if (header.length == 0) {
if (header.length === 0) {
headers = "400 You must enter a header. Please enter a header and try again."
} else {
if (editing == "true") {
if (editing === "true") {
session_data.pagestore.editHeaderBlock(docName, header, size, dividerBefore, dividerAfter, position, request_headers.query.blockNum);
headers = `300 OK
wtv-expire-all: wtv-author:/block-preview
@@ -94,7 +94,7 @@ Location: wtv-author:/show-blocks?docName=${docName}`
}
break;
case "24":
if (editing == "true") {
if (editing === "true") {
const listItems = request_headers.query.listItemText.filter(function(e){ return e.replace(/(\r\n|\n|\r)/gm,"")});
session_data.pagestore.editListBlock(docName, title, listItems, position, request_headers.query.blockNum);
headers = `300 OK
@@ -114,7 +114,7 @@ Location: wtv-author:/show-blocks?docName=${docName}`
}
break;
case "25":
if (editing == "true") {
if (editing === "true") {
const listItems = request_headers.query.listItemText;
const linkItems = request_headers.query.linkItemURL;
session_data.pagestore.editLinkBlock(docName, title, listItems, linkItems, position, request_headers.query.blockNum);
@@ -137,7 +137,7 @@ Location: wtv-author:/show-blocks?docName=${docName}`
break;
case "27":
if (editing == "true") {
if (editing === "true") {
session_data.pagestore.editBreakBlock(docName, position, request_headers.query.blockNum);
headers = `300 OK
wtv-expire-all: wtv-author:/block-preview

View File

@@ -3,7 +3,7 @@ const minisrv_service_file = true;
const docName = request_headers.query.docName;
const docTitle = request_headers.query.docTitle;
if (docTitle.length == 0) {
if (docTitle.length === 0) {
headers = "400 You must enter a title for your page. Please enter a title and try again."
} else {
const pagedata = session_data.pagestore.loadPage(docName);

View File

@@ -48,7 +48,7 @@ if (!request_headers.query.mediaData && !request_headers.query.mediaPath) {
function isValidImageType(contentType, url) {
// Check content-type header or file extension
if (contentType) {
return contentType === 'image/jpeg' || contentType == 'image/jpg' || contentType === 'image/gif';
return contentType === 'image/jpeg' || contentType === 'image/jpg' || contentType === 'image/gif';
}
return url.endsWith('.jpg') || url.endsWith('.jpeg') || url.endsWith('.gif');
}

View File

@@ -109,12 +109,12 @@ Chat Home
<table>
<tr>
<td abswidth="120">Server:</td>
<td><input width="240" bgcolor=262626 text=D6D6D6 cursor=cc9933 font=proportional type="text" name="host" value="${request_headers.query.host || (minisrv_config.config.irc.enabled) ? minisrv_config.config.service_ip : "irc.libera.chat"}"></td>
<td><input width="240" bgcolor=262626 text=D6D6D6 cursor=cc9933 font=proportional type="text" name="host" value="${request_headers.query.host || "irc.libera.chat"}"></td>
</tr>
<tr>
<td>Port:</td>
<td><input width="240" bgcolor=262626 text=D6D6D6 cursor=cc9933 font=proportional type="text" name="port" value="${request_headers.query.port || (minisrv_config.config.irc.enabled) ? minisrv_config.config.irc.port : 6667}"></td>
<td><input width="240" bgcolor=262626 text=D6D6D6 cursor=cc9933 font=proportional type="text" name="port" value="${request_headers.query.port || 6667}"></td>
</tr>
<tr>

View File

@@ -12,7 +12,7 @@ let diskmap_data = {};
if (!request_headers.query.url) {
Object.keys(service_vaults).forEach(function (g) {
if (diskmap_json_file != null) return;
if (diskmap_json_file !== null) return;
diskmap_json_file = service_vaults[g] + "/" + service_name + "/" + diskmap_dir + diskmap + ".json";
if (!fs.existsSync(diskmap_json_file)) diskmap_json_file = null;
});

View File

@@ -3,12 +3,12 @@ const minisrv_service_file = true;
const diskmap = request_headers.query[wtvshared.getCaseInsensitiveKey("DiskMap", request_headers.query)];
const wtvdl = new WTVDisk(minisrv_config, service_name);
const force_update = (request_headers.query.force == "true") ? true : false;
const no_delete = (request_headers.query.dont_delete_files == "true") ? true : false;
const force_update = (request_headers.query.force === "true") ? true : false;
const no_delete = (request_headers.query.dont_delete_files === "true") ? true : false;
const content_dir = "content/"
const diskmap_dir = content_dir + "diskmaps/";
if (request_headers['wtv-request-type'] == 'download') {
if (request_headers['wtv-request-type'] === 'download') {
function generateDownloadList(diskmap_group_name, update_list, diskmap_group_data) {
wtvdl.reset();
@@ -34,7 +34,7 @@ if (request_headers['wtv-request-type'] == 'download') {
if (force_update && !no_delete) {
// don't delete Browser partition, ever, but allow deleting of Browser partition subdirs
if (!diskmap_group_data.base.match(/disk\/browser(\/)?$/i)) {
if (diskmap_group_data.client_group_data.path.toLowerCase() == diskmap_group_data.base.toLowerCase()) {
if (diskmap_group_data.client_group_data.path.toLowerCase() === diskmap_group_data.base.toLowerCase()) {
wtvdl.delete(diskmap_group_data.base, null);
} else {
wtvdl.delete(diskmap_group_data.base, diskmap_group_data.client_group_data.group);
@@ -60,7 +60,7 @@ if (request_headers['wtv-request-type'] == 'download') {
Object.keys(update_list).forEach(function (k) {
// file { "action": "delete" }
// Useful to purge files we no longer want on the client
if (update_list[k].action != "DELETE" && update_list[k].action != "DELETEONLY") {
if (update_list[k].action !== "DELETE" && update_list[k].action !== "DELETEONLY") {
// skip deleting valid files if we aren't specifically requesting their deletion
if (update_list[k].checksum_match && !force_update) return;
if (!update_list[k].invalid && !force_update) return;
@@ -75,7 +75,7 @@ if (request_headers['wtv-request-type'] == 'download') {
Object.keys(update_list).forEach(function (k) {
if (update_list[k].checksum_match && !force_update) return;
if (!update_list[k].invalid && !force_update) return;
if (update_list[k].action == "DELETEONLY") return;
if (update_list[k].action === "DELETEONLY") return;
if (update_list[k].display) wtvdl.display(update_list[k].display);
switch (update_list[k].action) {
case "PUT":
@@ -98,7 +98,7 @@ if (request_headers['wtv-request-type'] == 'download') {
Object.keys(update_list).forEach(function (k) {
if (update_list[k].checksum_match && !force_update) return;
if (!update_list[k].invalid && !force_update) return;
if (update_list[k].action == "DELETEONLY") return;
if (update_list[k].action === "DELETEONLY") return;
wtvdl.rename(update_list[k].file.replace(diskmap_group_data.base, ""), update_list[k].file.replace(diskmap_group_data.base, ""), diskmap_group_name, diskmap_group_name, update_list[k].rename || update_list[k].original_filename || null);
});
@@ -143,7 +143,7 @@ if (request_headers['wtv-request-type'] == 'download') {
let post_data_current_checksum = false;
let post_data_last_checkup_time = 0;
Object.keys(post_data).forEach(function (k) {
if (post_data[k].slice(0, 7) == "file://") {
if (post_data[k].slice(0, 7) === "file://") {
entry_type = "folder";
post_data_current_file = false;
post_data_current_version = false;
@@ -185,13 +185,13 @@ if (request_headers['wtv-request-type'] == 'download') {
break;
}
} else {
if (!entry_type && post_data[k] != "") {
if (!entry_type && post_data[k] !== "") {
entry_type = "file";
post_data_current_file = post_data[k];
}
if (post_data[k] == "" && entry_type) {
const post_data_current_path = ((entry_type == "file") ? (post_data_current_directory + post_data_current_file) : post_data_current_directory);
if (post_data[k] === "" && entry_type) {
const post_data_current_path = ((entry_type === "file") ? (post_data_current_directory + post_data_current_file) : post_data_current_directory);
const index = post_data_current_path.replace(/[\:\/]/g, "_").toLowerCase() + "_" + post_data_current_group;
if (index.match(/\/$/)) entry_type = "folder";
if (!post_data_fileinfo[index]) post_data_fileinfo[index] = {};
@@ -215,7 +215,7 @@ if (request_headers['wtv-request-type'] == 'download') {
if (!diskmap_group_data.files[k].location) diskmap_group_data.files[k].location = wtvshared.makeSafePath(diskmap_group_data.location,diskmap_group_data.files[k].file.replace(diskmap_group_data.base, ""), true);
let diskmap_data_file = null;
Object.keys(service_vaults).forEach(function (g) {
if (diskmap_data_file != null) return;
if (diskmap_data_file !== null) return;
diskmap_data_file = service_vaults[g] + "/" + service_name + "/" + diskmap_group_data.files[k].location;
if (!fs.existsSync(diskmap_data_file) || !fs.lstatSync(diskmap_data_file).isFile()) diskmap_data_file = null;
});
@@ -232,7 +232,7 @@ if (request_headers['wtv-request-type'] == 'download') {
diskmap_group_data.files[k].action = (diskmap_group_data.files[k].action) ? diskmap_group_data.files[k].action.toUpperCase() : "GET";
// we need the checksum of the uncompressed data
if (wtvshared.getFileExt(diskmap_data_file).toLowerCase() == "gz") {
if (wtvshared.getFileExt(diskmap_data_file).toLowerCase() === "gz") {
const diskmap_data_filename = path.basename(diskmap_data_file);
const gunzipped = zlib.gunzipSync(diskmap_file_data);
diskmap_group_data.files[k].checksum = CryptoJS.MD5(CryptoJS.lib.WordArray.create(gunzipped)).toString(CryptoJS.enc.Hex).toLowerCase();
@@ -256,14 +256,14 @@ if (request_headers['wtv-request-type'] == 'download') {
Object.keys(wtv_download_list).forEach(function (k) {
wtv_download_list[k].version = newest_file_epoch;
Object.keys(post_data_fileinfo).forEach(function (g) {
if (post_data_fileinfo[g].file == wtv_download_list[k].file || post_data_fileinfo[g].file == wtv_download_list[k].base) {
if (post_data_fileinfo[g].file === wtv_download_list[k].file || post_data_fileinfo[g].file === wtv_download_list[k].base) {
diskmap_group_data.group_exists = true;
if (wtv_download_list[k].checksum && wtv_download_list[k].checksum.toLowerCase() == post_data_fileinfo[g].checksum) wtv_download_list[k].invalid = false;
else if (post_data_fileinfo[g].version == wtv_download_list[k].version && post_data_fileinfo[g].state !== "invalid") wtv_download_list[k].invalid = false;
if (wtv_download_list[k].checksum && wtv_download_list[k].checksum.toLowerCase() === post_data_fileinfo[g].checksum) wtv_download_list[k].invalid = false;
else if (post_data_fileinfo[g].version === wtv_download_list[k].version && post_data_fileinfo[g].state !== "invalid") wtv_download_list[k].invalid = false;
}
});
});
const diskmap_group_name = (diskmap_subgroup == null) ? diskmap_primary_group : diskmap_primary_group + "-" + diskmap_subgroup;
const diskmap_group_name = (diskmap_subgroup === null) ? diskmap_primary_group : diskmap_primary_group + "-" + diskmap_subgroup;
diskmap_group_data.client_group_data = client_group_data[diskmap_group_name] || null;
output_data = generateDownloadList(diskmap_group_name, wtv_download_list, diskmap_group_data);
return output_data;
@@ -272,12 +272,12 @@ if (request_headers['wtv-request-type'] == 'download') {
if (diskmap && request_headers.query.group) {
let diskmap_json_file = null;
Object.keys(service_vaults).forEach(function (g) {
if (diskmap_json_file != null) return;
if (diskmap_json_file !== null) return;
diskmap_json_file = service_vaults[g] + "/" + service_name + "/" + diskmap_dir + diskmap + ".json";
if (!fs.existsSync(diskmap_json_file)) diskmap_json_file = null;
});
if (diskmap_json_file != null) {
if (diskmap_json_file !== null) {
try {
// read diskmap
const json_stats = fs.lstatSync(diskmap_json_file);

View File

@@ -24,7 +24,7 @@ if (request_headers.post_data) {
function getTitle(url) {
return new Promise(function (resolve, reject) {
let page_title = "Web Page";
const request_type = (url.slice(0, 5) == "https") ? "https" : "http";
const request_type = (url.slice(0, 5) === "https") ? "https" : "http";
let proxy_agent = null;
switch (request_type) {
case "https":
@@ -40,7 +40,7 @@ function getTitle(url) {
}
const request = proxy_agent.get(url, options, (response) => {
let req_data = '';
if (response.statusCode == 301 || response.statusCode == 302) {
if (response.statusCode === 301 || response.statusCode === 302) {
redirects++;
if (redirects < max_redirects) resolve(getTitle(response.headers.location));
else reject(`Too many redirects. Max: ${max_redirects}, Current: ${redirects}`);
@@ -107,7 +107,7 @@ async function saveFavorite(favstore, title, folder, imagetype, favurl) {
image = "canned/favorite_default.gif"
}
if (favoritenum == minisrv_config.services[service_name].max_favorites_per_folder) {
if (favoritenum === minisrv_config.services[service_name].max_favorites_per_folder) {
headers = `400 You can only have ${minisrv_config.services[service_name].max_favorites_per_folder} favorites in a folder. Discard some favorites or choose a different folder, then try again.`
} else {

View File

@@ -6,11 +6,11 @@ const query = request_headers.query
const discardAll = request_headers.query.DiscardAll
let strName;
if (discardAll != "Discard All")
if (discardAll !== "Discard All")
{
for(strName in query)
{
if (strName != "favorite_folder_name")
if (strName !== "favorite_folder_name")
break;
}
@@ -24,7 +24,7 @@ if (request_headers.query.ForwardToBrowser)
Connection: Keep-Alive
Content-Type: text/html
Location: wtv-favorite:/serve-browser?favorite_folder_name=${folder}`
} else if (strName != "getCaseInsensitiveKey") {
} else if (strName !== "getCaseInsensitiveKey") {
const favorite = session_data.favstore.getFavorite(folder, strName);
if (errpage) {
@@ -33,7 +33,7 @@ Location: wtv-favorite:/serve-browser?favorite_folder_name=${folder}`
} else {
if (!request_headers.query.confirm_remove) {
let message, removeurl;
if (discardAll == "Discard All")
if (discardAll === "Discard All")
{
message = `Are you sure you want to discard all favorites in this folder?`;
removeurl = request_headers.request_url + "&confirm_remove=true&DiscardAll=Discard All";
@@ -58,7 +58,7 @@ Location: ${confirmAlert}`
} else {
const gourl = `wtv-favorite:/serve-discard-favorites?favorite_folder_name=${folder}`;
if (discardAll == "Discard All")
if (discardAll === "Discard All")
{
session_data.favstore.clearFolder(folder);
} else {

View File

@@ -33,7 +33,7 @@ Location: wtv-favorite:/favorite`
} else {
if (!request_headers.query.confirm_remove) {
let message = '';
if (numoffavorites == 0) {
if (numoffavorites === 0) {
message = `Are you sure you want to remove <b>${folder}</b>?`;
} else {
message = `Removing <b>${folder}</b> will also remove the ${numoffavorites} favorites it contains.`;

View File

@@ -12,14 +12,14 @@ else {
// one favorite
const favid = request_headers.query.favoriteid;
const favfolder = request_headers.query.favoritefolder;
if (folder != favfolder) session_data.favstore.moveFavorite(folder, favfolder, favid);
if (folder !== favfolder) session_data.favstore.moveFavorite(folder, favfolder, favid);
} else {
if (request_headers.query.favoriteid.length == request_headers.query.favoritefolder.length) {
// both queries should have the same number of entries
if (request_headers.query.favoriteid.length === request_headers.query.favoritefolder.length) {
// both queries should have the same number of entries
Object.keys(request_headers.query.favoriteid).forEach(function (k) {
const favid = request_headers.query.favoriteid[k];
const favfolder = request_headers.query.favoritefolder[k];
if (folder != favfolder) session_data.favstore.moveFavorite(folder, favfolder, favid);
if (folder !== favfolder) session_data.favstore.moveFavorite(folder, favfolder, favid);
})
} else {
error_occured = true;

View File

@@ -13,23 +13,22 @@ totalfavorites = folder_array.length;
if (totalfavorites < 14)
{
if (createFun == "true")
if (createFun === "true")
session_data.favstore.createTemplateFolder("Fun");
if (createMoney == "true")
if (createMoney === "true")
session_data.favstore.createTemplateFolder("Money");
if (createMovies == "true")
if (createMovies === "true")
session_data.favstore.createTemplateFolder("Movies");
if (createNews == "true")
if (createNews === "true")
session_data.favstore.createTemplateFolder("News");
if (createRecommended == "true")
if (createRecommended === "true")
session_data.favstore.createTemplateFolder("Recommended");
console.log("FUGHFVJSGHJFDGIJUFDSHGFJDSKHJKLGFHJKHDJKHJKLGF " + createRecommended)
if (createReference == "true")
if (createReference === "true")
session_data.favstore.createTemplateFolder("Reference");
headers = `300 OK

View File

@@ -2,7 +2,7 @@ const minisrv_service_file = true;
const favstore_exists = session_data.favstore.favstoreExists();
if (favstore_exists != true)
if (favstore_exists !== true)
{
session_data.favstore.createFavstore();
headers = `300 OK
@@ -13,7 +13,7 @@ const folder_array = session_data.favstore.getFolders();
const url = request_headers.request;
const key = url.split('?')[1]
const scfav = session_data.favstore.getShortcutKey(key);
if (!scfav.id || scfav.id == "none") {
if (!scfav.id || scfav.id === "none") {
headers = `400 You have not assigned a favorite to ${key}`
} else {
const fav = session_data.favstore.getFavorite(scfav.folder, scfav.id);

View File

@@ -2,16 +2,15 @@ const minisrv_service_file = true;
const favstore_exists = session_data.favstore.favstoreExists();
if (favstore_exists != true)
if (favstore_exists !== true)
{
session_data.favstore.createFavstore();
headers = `300 OK
wtv-expire-all: wtv-favorite:/favorite
Location: wtv-favorite:/favorite`
} else {
const folder_array = session_data.favstore.getFolders();
const totalfavorites = folder_array.length;
const stopdrawing = false;
headers = `200 OK
Connection: Keep-Alive
@@ -151,8 +150,8 @@ for ${session_data.getSessionData("subscriber_username") || "You"}
let kval = 0;
// process evens
Object.keys(folder_array).forEach(function (k) {
if (k == 0) return; // skip 0 since it was processed above
if (parseInt(k) % 2 == 0) {
if (parseInt(k)=== 0) return; // skip 0 since it was processed above
if (parseInt(k) % 2 === 0) {
// even
// Left Middle
data += `</td></tr><tr><td width="225" valign="middle" height="42" background="ROMCache/LeftMiddle.gif" align="center">
@@ -171,7 +170,7 @@ for ${session_data.getSessionData("subscriber_username") || "You"}
// process end if total is even
if (folder_array.length > 1) {
if (folder_array.length % 2 == 0) {
if (folder_array.length % 2 === 0) {
data += `</td></tr><tr><td width="225" valign="middle" height="42" background="ROMCache/LeftBottom.gif" align="center">
<table width="50%" cellspacing="0" cellpadding="0">
<tr><td width="40" height="20">
@@ -182,7 +181,7 @@ for ${session_data.getSessionData("subscriber_username") || "You"}
}
// process middle (folder 2 (id 1))
if (folder_array.length == 1) {
if (folder_array.length === 1) {
// no folder 2
data += `<tr><td><table cellspacing="0" cellpadding="0">
<tr><td width="6" height="12"><img src="wtv-home:/ROMCache/Spacer.gif" width="1" height="1">
@@ -223,8 +222,8 @@ for ${session_data.getSessionData("subscriber_username") || "You"}
// process odds
Object.keys(folder_array).forEach(function (k) {
if (k == 1) return; // skip 1 since it was processed above
if (parseInt(k) % 2 != 0) {
if (parseInt(k) === 1) return; // skip 1 since it was processed above
if (parseInt(k) % 2 !== 0) {
// odd
// Right Middle
data += `</td></tr><tr><td width="225" valign="middle" height="42" background="ROMCache/RightMiddle.gif" align="center">
@@ -242,7 +241,7 @@ for ${session_data.getSessionData("subscriber_username") || "You"}
// process end if total is odd
if (folder_array.length > 1) {
if (folder_array.length % 2 != 0) {
if (folder_array.length % 2 !== 0) {
data += `</td></tr><tr><td width="225" valign="middle" height="42" background="ROMCache/RightBottom.gif" align="center">
<table width="50%" cellspacing="0" cellpadding="0">
<tr><td width="5" height="20">

View File

@@ -188,7 +188,7 @@ by name only.
<td valign=top>
<input type=hidden name=autosubmit autosubmit=onleave>
<INPUT TYPE="checkbox" NAME="with_pictures" `
if (session_data.getSessionData("subscriber_fav_images") == "true")
if (session_data.getSessionData("subscriber_fav_images") === "true")
console.log("SELECTED")
data += "checked"
data += ` selected>

View File

@@ -207,7 +207,7 @@ Object.keys(favarray).forEach(function (k) {
data += `</td><td abswidth="139" valign="top">
<table href="${url}" bgcolor="191919">
<tbody><tr><td abswidth="139" align="center">`;
if (favarray[k].imagetype == "url")
if (favarray[k].imagetype === "url")
data += `<img src="${favarray[k].image}" width="70" vspace="5" height="52"><br>`;
else
data += `<img src="get-thumbnail?folder=${favarray[k].folder}&id=${favarray[k].id}" width="70" vspace="5" height="52"><br>`;
@@ -218,7 +218,7 @@ ${favarray[k].title}
</font>
</td></tr></tbody></table>
</td></tr></tbody></table>`;
if ((parseInt(k) + 1) % 3 == 0) {
if ((parseInt(k) + 1) % 3 === 0) {
// every 3 objects
data += `</td></tr></tbody></table>
<table cellspacing="0" cellpadding="0">

View File

@@ -112,7 +112,7 @@ let fav;
for (let i = 1; i <= 8; i++) {
const key = "F" + i;
const scfav = session_data.favstore.getShortcutKey(key);
if (scfav && scfav.id != "none") {
if (scfav && scfav.id !== "none") {
fav = session_data.favstore.getFavorite(scfav.folder, scfav.id);
} else {
fav = { image: "wtv-home:/ROMCache/Spacer.gif", title: "Not assigned" };
@@ -135,7 +135,7 @@ ${fav.title}<br>
</td><td>
<font size="-2" color="#F1F1F1">`;
if (fav.title != favoritedata.title) {
if (fav.title !== favoritedata.title) {
data += `<input type="radio" NAME="Choose" VALUE=${key} > &nbsp;${key}`
}

View File

@@ -125,7 +125,7 @@ Discard favorites
<input type=hidden name=favorite_folder_name value="${foldername}">
<tbody><tr><spacer type=block WIDTH=199 HEIGHT=0><td width="5" height="13"><img src="wtv-home:/ROMCache/Spacer.gif" width="199" height="1">
</td></tr></tbody></table></table>`
if (favoritenum == 0)
if (favoritenum === 0)
{
data += "<font size=2>&nbsp;&nbsp;&nbsp;<i>There are no favorites to discard in this folder.</i></font>";
} else {
@@ -133,7 +133,7 @@ for (let i = 0; i < favoritenum; i++) {
data += `<tr><table cellspacing=0 cellpadding=0>
<td abswidth=15><img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<td abswidth=75 height=52 align=center valign=center>`
if (favarray[i].imagetype == "url")
if (favarray[i].imagetype === "url")
data += `<img src="${favarray[i].image}" width="70" vspace="5" height="52"><br>`
else
data += `<img src="get-thumbnail?folder=${favarray[i].folder}&id=${favarray[i].id}" width="70" vspace="5" height="52"><br>`
@@ -190,7 +190,7 @@ data += `
<td align=right valign=center>
<td valign=center>
<font color="#E7CE4A" size=-1><shadow>`
if (favoritenum != 0)
if (favoritenum !== 0)
{
data += `
<input

View File

@@ -120,7 +120,7 @@ data += `<tr><td width=225>
</table>
</table>`
}
if (totalfavorites == 1)
if (totalfavorites === 1)
data += `<tr><td align=left valign=top> </table>
<td valign=top align=left>
<table cellspacing=0 cellpadding=0 width=115><tr><td width=227 height=20 bgcolor=#2b2b2b>
@@ -175,7 +175,7 @@ data += `
</table>
</table>
</form>`
if (totalfavorites == 1)
if (totalfavorites === 1)
data += "<i>&nbsp;&nbsp;&nbsp;You cannot delete your last folder.</i>"
data += `
<hr width=420>

View File

@@ -12,7 +12,7 @@ let folderlist = `<select name="newfolder" width=140>
<option value="${foldername}" selected="">${foldername}</option>
`
for (let i = 0; i < foldernum; i++) {
if (folder_array[i] == foldername)
if (folder_array[i] === foldername)
{
} else {
folderlist += `<option value="${folder_array[i]}">${folder_array[i]}</option>
@@ -140,7 +140,7 @@ Move favorites
<input type=hidden name=favorite_folder_name value="${foldername}">
<tbody><tr><spacer type=block WIDTH=199 HEIGHT=0><td width="5" height="13"><img src="wtv-home:/ROMCache/Spacer.gif" width="199" height="1">
</td></tr></tbody></table></table>`
if (favoritenum == 0)
if (favoritenum === 0)
{
data += "<font size=2>&nbsp;&nbsp;&nbsp;<i>There are no favorites to move in this folder.</i></font>";
} else {
@@ -148,7 +148,7 @@ for (let i = 0; i < favoritenum; i++) {
data += `<tr><table cellspacing=0 cellpadding=0>
<td abswidth=15><img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<td abswidth=75 height=52 align=center valign=center>`
if (favarray[i].imagetype == "url")
if (favarray[i].imagetype === "url")
data += `<img src="${favarray[i].image}" width="70" vspace="5" height="52"><br>`
else
data += `<img src="get-thumbnail?folder=${favarray[i].folder}&id=${favarray[i].id}" width="70" vspace="5" height="52"><br>`
@@ -165,7 +165,7 @@ data += `<select name="favoritefolder" width=140>
<option value="${foldername}" selected="">${foldername}</option>
`
for (let i = 0; i < foldernum; i++) {
if (folder_array[i] == foldername)
if (folder_array[i] === foldername)
{
} else {
data += `<option value="${folder_array[i]}">${folder_array[i]}</option>

View File

@@ -126,7 +126,7 @@ Rename favorites
<input type=hidden name=favorite_folder_name value="${foldername}">
<tbody><tr><spacer type=block WIDTH=199 HEIGHT=0><td width="5" height="13"><img src="wtv-home:/ROMCache/Spacer.gif" width="199" height="1">
</td></tr></tbody></table></table>`
if (favoritenum == 0)
if (favoritenum === 0)
{
data += "<font size=2>&nbsp;&nbsp;&nbsp;<i>There are no favorites to rename in this folder.</i></font>";
} else {
@@ -134,7 +134,7 @@ for (let i = 0; i < favoritenum; i++) {
data += `<tr><table cellspacing=0 cellpadding=0>
<td abswidth=15><img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
<td abswidth=75 height=52 align=center valign=center>`
if (favarray[i].imagetype == "url")
if (favarray[i].imagetype === "url")
data += `<img src="${favarray[i].image}" width="70" vspace="5" height="52"><br>`
else
data += `<img src="get-thumbnail?folder=${favarray[i].folder}&id=${favarray[i].id}" width="70" vspace="5" height="52"><br>`

View File

@@ -104,7 +104,7 @@ by going to the folder and choosing <b>Organize</b>.<br>
<td width=25>
<tr>
<td width=25>`
if (session_data.favstore.folderExists("Fun") == true)
if (session_data.favstore.folderExists("Fun") === true)
{
data += `
<td width=50% absheight=30 align=left valign=middle>
@@ -124,7 +124,7 @@ if (session_data.favstore.folderExists("Fun") == true)
<input type="checkbox" name="Fun" value="true"> &nbsp;Fun
</font>`
}
if (session_data.favstore.folderExists("Money") == true)
if (session_data.favstore.folderExists("Money") === true)
{
data += `
<td width=50% absheight=30 align=left valign=middle>
@@ -147,7 +147,7 @@ if (session_data.favstore.folderExists("Money") == true)
<td width=25>
<tr>
<td width=25>`
if (session_data.favstore.folderExists("Movies") == true)
if (session_data.favstore.folderExists("Movies") === true)
{
data += `
<td width=50% absheight=30 align=left valign=middle>
@@ -167,7 +167,7 @@ if (session_data.favstore.folderExists("Movies") == true)
<input type="checkbox" name="Movies" value="true"> &nbsp;Movies
</font>`
}
if (session_data.favstore.folderExists("News") == true)
if (session_data.favstore.folderExists("News") === true)
{
data += `
<td width=50% absheight=30 align=left valign=middle>
@@ -191,7 +191,7 @@ data += `
<td width=25>
<tr>
<td width=25>`
if (session_data.favstore.folderExists("Recommended") == true)
if (session_data.favstore.folderExists("Recommended") === true)
{
data += `
<td width=50% absheight=30 align=left valign=middle>
@@ -211,7 +211,7 @@ if (session_data.favstore.folderExists("Recommended") == true)
<input type="checkbox" name="Recommended" value="true"> &nbsp;Recommended
</font>`
}
if (session_data.favstore.folderExists("Reference") == true)
if (session_data.favstore.folderExists("Reference") === true)
{
data += `
<td width=50% absheight=30 align=left valign=middle>

View File

@@ -77,7 +77,7 @@ let fav;
for (let i = 1; i <= 8; i++) {
const key = "F" + i;
const scfav = session_data.favstore.getShortcutKey(key);
if (scfav && scfav.id != "none") {
if (scfav && scfav.id !== "none") {
fav = session_data.favstore.getFavorite(scfav.folder, scfav.id);
} else {
fav = { image: "wtv-home:/ROMCache/Spacer.gif", title: "Not assigned" };

View File

@@ -113,7 +113,7 @@ Assign shortcut to favorite
</td></tr><tr><td width="15">
</td><td valign="middle" align="left">
<font size="-1" color="#42BC52">`
if (favoritenum == 0)
if (favoritenum === 0)
{
data += "<font size=2>&nbsp;&nbsp;&nbsp;<i>There are no favorites to move in this folder.</i></font>";
} else {
@@ -141,7 +141,7 @@ for (let i = 0; i < favoritenum; i++) {
<table bgcolor="191919">
<tbody><tr><td abswidth="70" valign="center" align="center">
`
if (favarray[i].imagetype == "url")
if (favarray[i].imagetype === "url")
data += `<img src="${favarray[i].image}" width="70" vspace="5" height="52"><br>`
else
data += `<img src="get-thumbnail?folder=${favarray[i].folder}&id=${favarray[i].id}" width="70" vspace="5" height="52"><br>`

View File

@@ -6,7 +6,7 @@ const request_path = request_headers.request_url.replace(service_name + ":/", ""
const romtype = session_data.get("wtv-client-rom-type");
const bootver = session_data.get("wtv-client-bootrom-version")
if ((romtype == "bf0app" || !romtype) && (bootver == "105" || !bootver)) {
if ((romtype === "bf0app" || !romtype) && (bootver === "105" || !bootver)) {
// assume old classic in flash mode, override user setting and send tellyscript
// because it is required to proceed in flash mode
bf0app_update = true;

View File

@@ -15,7 +15,7 @@ let bf0app_update = true;
if (request_headers.query.path) request_path = request_headers.query.path;
else request_path = default_build_to_send;
if (session_data.get("wtv-client-rom-type") == "bf0app" && session_data.get("wtv-client-bootrom-version") == "105") {
if (session_data.get("wtv-client-rom-type") === "bf0app" && session_data.get("wtv-client-bootrom-version") === "105") {
// assume old classic in flash mode, override user setting and send tellyscript
// because it is required to proceed in flash mode
bf0app_update = true;

View File

@@ -7,7 +7,7 @@ const request_path = request_headers.query.path;
const romtype = session_data.get("wtv-client-rom-type");
const bootver = session_data.get("wtv-client-bootrom-version");
if ((romtype == "bf0app" || !romtype) && (bootver == "105" || !bootver)) {
if ((romtype === "bf0app" || !romtype) && (bootver === "105" || !bootver)) {
// assume old classic in flash mode, override user setting and send tellyscript
// because it is required to proceed in flash mode
bf0app_update = true;

View File

@@ -7,7 +7,7 @@ if (!request_headers.query.path) {
headers = errpage[0];
data = errpage[1];
} else {
if (request_headers.Referer == service_name + ":/lc2-download-complete?") {
if (request_headers.Referer === service_name + ":/lc2-download-complete?") {
headers = `200 OK
Content-type: text/html
minisrv-no-mail-count: true
@@ -34,7 +34,7 @@ async function processLC2DownloadPage(flashrom_info, headers, numparts = null) {
sendToClient(socket, headers, data);
return false;
}
if (numparts != null) flashrom_info.part_count = parseInt(numparts);
if (numparts !== null) flashrom_info.part_count = parseInt(numparts);
if (!flashrom_info.part_count) flashrom_info.part_count = parseInt(flashrom_info.message.slice(flashrom_info.message.length - 4).replace(/\D/g, ''));
if (parseInt(flashrom_info.part_number) >= 0 && flashrom_info.rompath && flashrom_info.next_rompath) {
if (!flashrom_info.message && flashrom_info.is_bootrom) {
@@ -129,7 +129,7 @@ Your ${session_data.getBoxName()} is being<br>updated automatically.
<p> <font size=+1>
This will take about ${downloadTime} minutes and<br>then you can use your ${session_data.getBoxName()} again.
`;
if (flashrom_info.is_bootrom && flashrom_info.part_number == (flashrom_info.part_count - 1)) {
if (flashrom_info.is_bootrom && flashrom_info.part_number === (flashrom_info.part_count - 1)) {
data += `<p>
The system will pause for about 30 seconds at the end of this
update. Please <strong>do not</strong> interrupt the system

View File

@@ -3,7 +3,7 @@ const minisrv_service_file = true;
if (request_headers.query.path) {
let url = service_name + ":/get-lc2-page?path=" + encodeURIComponent(request_headers.query.path);
const romtype = session_data.get("wtv-client-rom-type");
if (romtype == "bf0app") {
if (romtype === "bf0app") {
url = "client:updateflash?ipaddr=" + minisrv_config.services[service_name].host + "&port=" + minisrv_config.services[service_name].port + "&path=" + encodeURIComponent(service_name + ":/" + request_headers.query.path);
if (request_headers.query.numparts) url += encodeURIComponent("?numparts=" + request_headers.query.numparts);
} else {

View File

@@ -15,7 +15,7 @@ const bf0app_update = true;
if (request_headers.query.path) request_path = request_headers.query.path;
else request_path = default_build_to_send;
if (session_data.get("wtv-client-rom-type") == "bf0app" && session_data.get("wtv-client-bootrom-version") == "105") {
if (session_data.get("wtv-client-rom-type") === "bf0app" && session_data.get("wtv-client-bootrom-version") === "105") {
// assume old classic in flash mode, override user setting and send tellyscript
// because it is required to proceed in flash mode
session_data.set("bf0app_update", bf0app_update);

View File

@@ -5,7 +5,7 @@ let challenge_response, gourl, wtvsec_login;
const hasPendingTransfer = session_data.hasPendingTransfer()
if (hasPendingTransfer) {
if (hasPendingTransfer.type == "target") {
if (hasPendingTransfer.type === "target") {
const xferSession = new WTVClientSessionData(minisrv_config, hasPendingTransfer.ssid);
xferSession.user_id = 0
const primary_username = xferSession.listPrimaryAccountUsers()['subscriber']['subscriber_username'];
@@ -21,7 +21,7 @@ if (hasPendingTransfer) {
const errpage = wtvshared.doRedirect(transferPendingDest);
headers = errpage[0];
data = errpage[1];
} else if (hasPendingTransfer.type == "source") {
} else if (hasPendingTransfer.type === "source") {
const transferPendingSrc = new clientShowAlert({
'image': minisrv_config.config.service_logo,
'message': "There is a pending transfer of this account to <b>" + hasPendingTransfer.ssid + "</b>. In order to use this box, you need to complete or cancel the transfer.",
@@ -58,11 +58,11 @@ wtv-visit: client:hangupphone`
}
let errpage;
if (socket.ssid !== null) {
if (wtvsec_login.ticket_b64 == null) {
if (wtvsec_login.ticket_b64 === null) {
challenge_response = wtvsec_login.challenge_response;
client_challenge_response = request_headers["wtv-challenge-response"] || null;
if (challenge_response && client_challenge_response) {
if (challenge_response.toString(CryptoJS.enc.Base64) == client_challenge_response) {
if (challenge_response.toString(CryptoJS.enc.Base64) === client_challenge_response) {
console.log(" * wtv-challenge-response success for " + wtvshared.filterSSID(socket.ssid));
wtvsec_login.PrepareTicket();
gourl = "wtv-head-waiter:/login-stage-two?";
@@ -84,8 +84,8 @@ wtv-visit: client:hangupphone`
}
}
if (!errpage) {
if (user_id != null && !request_headers.query.initial_login && !request_headers.query.user_login && !request_headers.query.relogin && !request_headers.query.reconnect) {
if (request_headers.query.password == "") {
if (user_id !== null && !request_headers.query.initial_login && !request_headers.query.user_login && !request_headers.query.relogin && !request_headers.query.reconnect) {
if (request_headers.query.password === "") {
headers = `403 Please enter your password and try again
minisrv-no-mail-count: true`;
} else if (session_data.validateUserPassword(request_headers.query.password)) {

View File

@@ -82,10 +82,10 @@ let accounts_listed = 0;
for (const [key, value] of Object.entries(accounts)) {
let user_id;
data += "<td absheight=37><td valign=middle abswidth=50% maxlines=1>";
if (key == "subscriber") user_id = 0;
if (key === "subscriber") user_id = 0;
else user_id = key.replace("user", '');
data += `<a href=/ValidateLogin?user_id=${user_id}&user_login=true nocancel>`;
if (key == "subscriber") data += `<font size=+1><b>${value['subscriber_username']}</b></font></a>`;
if (key === "subscriber") data += `<font size=+1><b>${value['subscriber_username']}</b></font></a>`;
else data += `<font size=+1>${value['subscriber_username']}</font>`
data += "<td width=15><td nowrap> <font color=42BD52>";
const userSession = new WTVClientSessionData(minisrv_config, socket.ssid);

View File

@@ -7,7 +7,7 @@ if (socket.ssid && session_data) {
socket_sessions[socket.id].wtvsec.ticket_b64 = request_headers["wtv-ticket"];
//socket_sessions[socket.id].secure == true;
}
} else if (socket_sessions[socket.id].wtvsec.ticket_b64 == null) {
} else if (socket_sessions[socket.id].wtvsec.ticket_b64 === null) {
// TODO: client should have a ticket and send it back by now, if not we should handle this correctly
}
}

View File

@@ -54,7 +54,7 @@ else {
if (session_data.getSessionData("subscriber_smtp_password") === null) {
session_data.setUserSMTPPassword(wtvshared.generatePassword(16));
}
if (session_data.user_id == 0) {
if (session_data.user_id === 0) {
const accounts = session_data.listPrimaryAccountUsers();
let offline_user_list_str = "<user-list>\n";
let i = 0;
@@ -167,7 +167,7 @@ wtv-inactive-timeout: 1440
headers += "wtv-home-url: " + home_url + "\n";
}
if (session_data.get('wtv-need-upgrade') != 'true' && !request_headers.query.reconnect && !limitedLogin && !limitedLoginRegistered)
if (session_data.get('wtv-need-upgrade') !== 'true' && !request_headers.query.reconnect && !limitedLogin && !limitedLoginRegistered)
headers += "wtv-settings-url: wtv-setup:/get\n";
if (!limitedLogin && !limitedLoginRegistered) {

View File

@@ -14,7 +14,7 @@ let send_to_relogin = true;
if (session_data) {
if (request_headers["wtv-ticket"]) {
if (session_data.data_store.wtvsec_login.ticket_b64 == null) {
if (session_data.data_store.wtvsec_login.ticket_b64 === null) {
if (request_headers["wtv-ticket"].length > 8) {
session_data.data_store.wtvsec_login.DecodeTicket(request_headers["wtv-ticket"]);
session_data.data_store.wtvsec_login.ticket_b64 = request_headers["wtv-ticket"];
@@ -25,7 +25,7 @@ if (session_data) {
if (session_data.data_store.wtvsec_login) {
const client_challenge_response = request_headers["wtv-challenge-response"] || null;
if (challenge_response && client_challenge_response) {
if (challenge_response.toString(CryptoJS.enc.Base64).slice(0, 85) == client_challenge_response.slice(0, 85)) {
if (challenge_response.toString(CryptoJS.enc.Base64).slice(0, 85) === client_challenge_response.slice(0, 85)) {
console.log(" * wtv-challenge-response success for " + socket.ssid);
session_data.data_store.wtvsec_login.PrepareTicket();
send_to_relogin = false;
@@ -50,7 +50,7 @@ Expires: Wed, 09 Oct 1991 22:00:00 GMT
wtv-expire-all: wtv-head-waiter:
`+ getServiceString('wtv-log') + `
wtv-log-url: wtv-log:/log`;
if (challenge_header != "") headers += "\n" + challenge_header;
if (challenge_header !== "") headers += "\n" + challenge_header;
headers += `
wtv-country: US
wtv-language-header: en-US,en

View File

@@ -4,7 +4,7 @@ const action = request_headers.query.action;
let address_book = null
address_book = session_data.getSessionData("address_book")
if (address_book == null) {
if (address_book === null) {
session_data.setSessionData("address_book", [])
address_book = [];
}
@@ -625,9 +625,9 @@ text="E7CE4A"
font=proportional
name="nickname"
value="`;
if (action == 'editfromheader') {
if (action === 'editfromheader') {
data += request_headers.query.nickname
} else if (action == 'edit' && request_headers.query.id) {
} else if (action === 'edit' && request_headers.query.id) {
data += address_book[request_headers.query.id].name
}
data += `"
@@ -652,9 +652,9 @@ font=proportional
nosoftbreaks nohardbreaks
name="address"
value="`;
if (action == 'editfromheader') {
if (action === 'editfromheader') {
data += request_headers.query.address
} else if (action == 'edit' && request_headers.query.id) {
} else if (action === 'edit' && request_headers.query.id) {
data += address_book[request_headers.query.id].address
}
data += `"
@@ -784,7 +784,7 @@ Location: wtv-mail:/addressbook`;
break;
case "discard":
if (address_book.length == 1) {
if (address_book.length === 1) {
address_book = []
} else {
address_book.splice(request_headers.query.id, 1)

View File

@@ -8,7 +8,7 @@ minisrv-no-mail-count: true`;
const address_book = session_data.getSessionData("address_book")
if (session_data.getSessionData("address_book") != null) {
if (session_data.getSessionData("address_book") !== null) {
data = ``
for (let i = 0; i < address_book.length; i++) {
data += address_book[i].name + '\0' + address_book[i].address + '\0'

View File

@@ -2,8 +2,8 @@ const minisrv_service_file = true;
let errpage, message;
const messageid = request_headers.query.message_id;
const attachment_id = request_headers.query.attachment_id;
if (!attachment_id && attachment_id != 0) errpage = wtvshared.doErrorPage(400, "Attachment ID required.");
const attachment_id = parseInt(request_headers.query.attachment_id);
if (!attachment_id && attachment_id !== 0) errpage = wtvshared.doErrorPage(400, "Attachment ID required.");
else {
message = session_data.mailstore.getMessageByID(messageid);
if (!message) errpage = wtvshared.doErrorPage(400, "Invalid Message ID");

View File

@@ -58,14 +58,14 @@ if (!intro_seen && !request_headers.query.intro_seen) {
const total_unread_message_count = session_data.mailstore.countUnreadMessages(mailbox);
let message_list_string = null;
if (total_message_count == 0) {
if (total_message_count === 0) {
message_list_string = "No new mail messages for ";
} else {
if (total_unread_message_count > 0) {
message_list_string = total_unread_message_count + " new mail message" + ((total_message_count != 1) ? 's' : '');
if (total_message_count - total_unread_message_count > 0) message_list_string += ", " + (total_message_count - total_unread_message_count) + " mail message" + (((total_message_count - total_unread_message_count) != 1) ? 's' : '') + " for ";
} else {
message_list_string = total_message_count + " mail message" + ((total_message_count != 1) ? 's' : '') + " for ";
message_list_string = total_unread_message_count + " new mail message" + ((total_message_count !== 1) ? 's' : '');
if (total_message_count - total_unread_message_count > 0) message_list_string += ", " + (total_message_count - total_unread_message_count) + " mail message" + (((total_message_count - total_unread_message_count) !== 1) ? 's' : '') + " for ";
} else {
message_list_string = total_message_count + " mail message" + ((total_message_count !== 1) ? 's' : '') + " for ";
}
}
@@ -281,7 +281,7 @@ ${username}@${minisrv_config.config.service_name}
`;
Object.keys(message_list).forEach(function (k) {
const message = message_list[k];
if (typeof message.subject == "object" && message.subject) message.subject = wtvshared.decodeBufferText(message.subject);
if (typeof message.subject === "object" && message.subject) message.subject = wtvshared.decodeBufferText(message.subject);
message.known_sender = session_data.isAddressInAddressBook(message.from_addr);
let message_font_open = "<font color=#7A9FCC>";
let message_font_close = "</font>";
@@ -319,7 +319,7 @@ ${message_font_close}
});
} else {
data += `
<font sizerange=medium> No ${(mailbox_name == "Inbox") ? `new e-mail messages for<table cellspacing=0 cellpadding=0 border=0>
<font sizerange=medium> No ${(mailbox_name === "Inbox") ? `new e-mail messages for<table cellspacing=0 cellpadding=0 border=0>
<TR><TD maxlines="1">
${username}@${minisrv_config.config.service_name}
</TD></TR>

View File

@@ -47,7 +47,7 @@ Content-type: text/html`;
}
if (message.signature) message_colors = session_data.mailstore.getSignatureColors(message.signature);
if (typeof message.subject == "object" && message.subject) message.subject = wtvshared.decodeBufferText(message.subject);
if (typeof message.subject === "object" && message.subject) message.subject = wtvshared.decodeBufferText(message.subject);
data = `<wtvnoscript>
<sendpanel
action = "wtv-mail:/sendmail?message_forward_id=14&mailbox_name=inbox"
@@ -243,7 +243,7 @@ E-mail message
From:
<td width=10>
<td>`;
if (message.from_name != message.from_addr) {
if (message.from_name !== message.from_addr) {
data += `${wtvshared.htmlEntitize(message.from_addr)} <a href="client:showalert?sound=none&message=To%20add%20%3Cblackface%3E${encodeURIComponent(encodeURIComponent(message.from_name))}%3C%2Fblackface%3E%20to%20your%20Address%20book,%20choose%20%3Cb%3EAdd%3C%2Fb%3E.&buttonlabel2=Cancel&buttonaction2=client:donothing&buttonlabel1=Add&buttonaction1=wtv-mail:/addressbook%3Faction%3Deditfromheader%26noresponse%3Dtrue%26nickname%3D${encodeURIComponent(encodeURIComponent(message.from_name))}%26address%3D${encodeURIComponent(encodeURIComponent(message.from_addr))}%26new_address%3Dtrue">(${wtvshared.htmlEntitize(message.from_name)})</a>`;
} else {
data += `${wtvshared.htmlEntitize(message.from_addr)}`;

Some files were not shown because too many files have changed in this diff Show More