Fix pagebuilder cannot create more than 2 pages

Fix pagebuilder prototype breaks usenet
Add default limit of 4 pages (configurable)
This commit is contained in:
zefie
2023-08-27 02:37:11 -04:00
parent 772e3b9ba7
commit 336fce2676
13 changed files with 4517 additions and 3075 deletions

View File

@@ -168,6 +168,22 @@ if (!String.prototype.reverse) {
} }
} }
// for some reason making this a prototype override breaks newsie
/*
if (!Array.prototype.movekey) {
Array.prototype.movekey = function (from, to) {
this.splice(to, 0, this.splice(from, 1)[0]);
return this;
};
}
*/
function moveArrayKey(array, from, to) {
array.splice(to, 0, array.splice(from, 1)[0]);
return array;
};
// add .getCaseInsensitiveKey() to all JavaScript Objects in this application { // add .getCaseInsensitiveKey() to all JavaScript Objects in this application {
// works for service vault scripts too. // works for service vault scripts too.
@@ -250,6 +266,7 @@ var runScriptInVM = function (script_data, user_contextObj = {}, privileged = fa
"sendToClient": sendToClient, "sendToClient": sendToClient,
"service_vaults": service_vaults, "service_vaults": service_vaults,
"service_deps": service_deps, "service_deps": service_deps,
"moveArrayKey": moveArrayKey,
"cwd": __dirname, // current working directory "cwd": __dirname, // current working directory
// Our prototype overrides // Our prototype overrides

View File

@@ -59,34 +59,44 @@ data = `<HTML>
<td> <td>
<td align=right height=69 width=93 href="wtv-home:/home"> <td align=right height=69 width=93 href="wtv-home:/home">
<img src="${minisrv_config.config.service_logo}" width=87 height=67> <img src="${minisrv_config.config.service_logo}" width=87 height=67>
<tr><td absheight=5>&nbsp; <tr>
<td absheight=5>&nbsp;
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="wtv-author:/documents" <table href="wtv-author:/documents" cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Index</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Index</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="wtv-guide:/help?topic=Publish&subtopic=Index&appName=Page%20Builder" <table href="wtv-guide:/help?topic=Glossary&subtopic=P&page=pagebuilder" cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Help</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Help</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td valign=bottom align=right > <img src="wtv-author:/ROMCache/pagebuilder.gif" height=124 width=78>&nbsp; <td valign=bottom align=right>
<img src="wtv-author:/ROMCache/pagebuilder.gif" height=124 width=78>&nbsp;
</table> </table>
</sidebar> </sidebar>
<body <body

View File

@@ -31,106 +31,132 @@ data = `<HTML>
<td> <td>
<td align=right height=69 width=93 href="wtv-home:/home"> <td align=right height=69 width=93 href="wtv-home:/home">
<img src="${minisrv_config.config.service_logo}" width=87 height=67> <img src="${minisrv_config.config.service_logo}" width=87 height=67>
<tr><td absheight=5>&nbsp; <tr>
<td absheight=5>&nbsp;
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="wtv-author:/templates" <table href="wtv-author:/templates" cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Create</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Create</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="wtv-author:/scrapbook" <table href="client:showalert?message=This%20feature%20is%20not%20available." cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Scrapbook</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Scrapbook</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="wtv-author:/document-cleanup" <table href="client:showalert?message=Select%20the%20document%20you%20would%20like%20to%20remove%20then%20choose%20discard%20page." cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Clean up</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Clean up</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="wtv-author:/samples_en-US/index.html" <table href="wtv-author:/samples_en-US/index.html" cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Examples</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Examples</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href=javascript:checkPageStatus() <table href=client:showalert?message=This%20feature%20is%20not%20available. cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Archive</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Archive</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="wtv-guide:/help?topic=Publish&subtopic=Index&appName=Page%20Builder" <table href="wtv-guide:/help?topic=Glossary&subtopic=P&page=pagebuilder" cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Help</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Help</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td valign=bottom align=right > <img src="wtv-author:/ROMCache/pagebuilder.gif" height=124 width=78>&nbsp; <td valign=bottom align=right>
<img src="wtv-author:/ROMCache/pagebuilder.gif" height=124 width=78>&nbsp;
</table> </table>
</sidebar> </sidebar>
<body <body bgcolor=#1e4261 background=wtv-author:/ROMCache/blue_tile_128.gif text=AEBFD1 link=B8BDC7 vlink=B8BDC7 hspace=0 vspace=0 onLoad=StorageWarning()>
bgcolor=#1e4261
background=wtv-author:/ROMCache/blue_tile_128.gif text=AEBFD1 link=B8BDC7
vlink=B8BDC7
hspace=0
vspace=0
onLoad=StorageWarning()
>
<SCRIPT> <SCRIPT>
function StorageWarning() {} function StorageWarning() {}
</SCRIPT> </SCRIPT>
<form name=onlyOnce><input type=hidden name=didIt value=0></form> <form name=onlyOnce>
<input type=hidden name=didIt value=0>
</form>
<table cellspacing=0 cellpadding=0 width=100%> <table cellspacing=0 cellpadding=0 width=100%>
<tr> <tr>
<td abswidth=22 rowspan=100><td><td abswidth=22 rowspan=100> <td abswidth=22 rowspan=100>
<td>
<td abswidth=22 rowspan=100>
<tr> <tr>
<td absheight=12> <td absheight=12>
<tr> <tr>
<td height=25 valign=top> <td height=25 valign=top>
<font size=+1 color=D1D1D1><blackface> Page Builder index </blackface></font> <font size=+1 color=D1D1D1>
<blackface> Page Builder index </blackface>
</font>
<tr> <tr>
<td height=24> <td height=24>
<font color=AEBFD1> Choose a document to change or view it </font> <font color=AEBFD1> Choose a document to change or view it </font>
<tr> <tr>
<td height=14> <td height=14>
<tr><td> <tr>
<td>
<table cellspacing=0 cellpadding=0> <table cellspacing=0 cellpadding=0>
` `
for (let i = 0; i < numofpages; i++) { for (let i = 0; i < numofpages; i++) {
@@ -164,13 +190,19 @@ data += `
<td colspan=4><img src="/ROMCache/horiz_line_bottom.gif" width=347 height=9> <td colspan=4><img src="/ROMCache/horiz_line_bottom.gif" width=347 height=9>
<td><img src="/ROMCache/right_mark.gif" width=5 height=9>` <td><img src="/ROMCache/right_mark.gif" width=5 height=9>`
} }
if (minisrv_config.services["wtv-author"].max_pages) {
data += ` data += `
</table> </table>
</table> <p>A maximum of <b>${minisrv_config.services["wtv-author"].max_pages}</b> pages can be created, regardless of publish status.
</table>`
}
data += `
<SCRIPT language=JavaScript> <SCRIPT language=JavaScript>
function checkPageStatus() { function checkPageStatus() {
location = "wtv-author:/scrapbook-serve-confirm-archive?pub=true&unpub=false"; location = "wtv-author:/scrapbook-serve-confirm-archive?pub=true&unpub=false";
} }
</SCRIPT> </SCRIPT>
</BODY> </BODY>
</HTML>`; </HTML>`;

View File

@@ -34,7 +34,7 @@ if (request_headers.query.publishing == "true") {
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26 > <td abswidth=93 absheight=26 >
<table href="wtv-guide:/help?topic=Publish&subtopic=Index" <table href="wtv-guide:/help?topic=Glossary&subtopic=P&page=pagebuilder"
cellspacing=0 cellpadding=0> cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>

View File

@@ -1,5 +1,12 @@
var minisrv_service_file = true; var minisrv_service_file = true;
var create = true;
var pagenums = session_data.pagestore.listPages().length;
if (minisrv_config.services["wtv-author"].max_pages) {
if (pagenums + 1 > minisrv_config.services["wtv-author"].max_pages) {
create = false;
}
}
if (create) {
var pagename = session_data.pagestore.createPage(request_headers.query.styleName.replace(' ', '_')); var pagename = session_data.pagestore.createPage(request_headers.query.styleName.replace(' ', '_'));
headers = `300 OK headers = `300 OK
@@ -7,3 +14,8 @@ Connection: Keep-Alive
Content-Type: text/html Content-Type: text/html
wtv-expire-all: wtv-author:/documents wtv-expire-all: wtv-author:/documents
Location: wtv-author:/show-blocks?docName=${pagename}` Location: wtv-author:/show-blocks?docName=${pagename}`
} else {
var err = wtvshared.doErrorPage(500, "You are not allowed to create more than <b>"+minisrv_config.services["wtv-author"].max_pages+"</b> pages.");
headers = err[0];
data = err[1];
}

View File

@@ -7,8 +7,62 @@ AppName = window.navigator.appName;
if (AppName.indexOf("WebTV") >= 0 ) if (AppName.indexOf("WebTV") >= 0 )
gIsWebTV = true; gIsWebTV = true;
</SCRIPT> </SCRIPT>
<TITLE>Sammy M. Surfer</TITLE> <TITLE>Examples</TITLE>
</HEAD> </HEAD>
<sidebar width=122 height=420 align=left>
<table cellspacing=0 cellpadding=0 height=385>
<TR>
<td width=3>
<td abswidth=2 bgColor=#8A99B0 rowspan=99>
<td absHEIGHT=4>&nbsp;
<td abswidth=2 bgColor=#8A99B0 rowspan=99>
<td width=4 rowspan=99>
<td backGround="wtv-author:/ROMCache/grad_tile.gif" width=16 rowspan=99>
</TR>
<tr>
<td>
<td align=right height=69 width=93 href="wtv-home:/home">
<img src="wtv-star:/ROMCache/HackTVLogoJewel.gif" width=87 height=67>
<tr>
<td absheight=5>&nbsp;
<TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr>
<td>
<td abswidth=93 absheight=26>
<table href="wtv-author:/documents" cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
<td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Index</font>
</table>
</table>
<TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr>
<td>
<td abswidth=93 absheight=26>
<table href="wtv-guide:/help?topic=Glossary&subtopic=P&page=pagebuilder" cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
<td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Help</font>
</table>
</table>
<TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr>
<td>
<td valign=bottom align=right>
<img src="wtv-author:/ROMCache/pagebuilder.gif" height=124 width=78>&nbsp;
</table>
</sidebar>
<body <body
background="/clipart/styleMedia/ExternalBackground.gif" background="/clipart/styleMedia/ExternalBackground.gif"
bgcolor=#1e4261 bgcolor=#1e4261
@@ -24,7 +78,7 @@ vspace=0
<td height=12> <td height=12>
<tr> <tr>
<td height=25 valign=top colspan=4> <td height=25 valign=top colspan=4>
<font size=+1 color=D1D1D1>Pages of Sammy M. Surfer</font> <font size=+1 color=D1D1D1>Example Pages:</font>
<tr> <tr>
<td height=14> <td height=14>
<tr><td height=10> <tr><td height=10>

View File

@@ -83,7 +83,7 @@ cellspacing=0 cellpadding=0>
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26 > <td abswidth=93 absheight=26 >
<table href="wtv-guide:/help?topic=Publish&subtopic=Index&appName=Page%20Builder" <table href="wtv-guide:/help?topic=Glossary&subtopic=P&page=pagebuilder"
cellspacing=0 cellpadding=0> cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,13 @@
var minisrv_service_file = true; var minisrv_service_file = true;
var create = true;
var pagenums = session_data.pagestore.listPages().length;
if (minisrv_config.services["wtv-author"].max_pages) {
if (pagenums + 1 > minisrv_config.services["wtv-author"].max_pages) {
create = false;
}
}
if (create) {
headers = `200 OK headers = `200 OK
Connection: Keep-Alive Connection: Keep-Alive
Content-Type: text/html` Content-Type: text/html`
@@ -23,50 +31,75 @@ data = `<HTML>
<td> <td>
<td align=right height=69 width=93 href="wtv-home:/home"> <td align=right height=69 width=93 href="wtv-home:/home">
<img src="${minisrv_config.config.service_logo}" width=87 height=67> <img src="${minisrv_config.config.service_logo}" width=87 height=67>
<tr><td absheight=5>&nbsp; <tr>
<td absheight=5>&nbsp;
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="wtv-guide:/help?topic=Publish&subtopic=Index&appName=Page%20Builder" <table href="wtv-author:/documents" cellspacing=0 cellpadding=0>
cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left><table cellspacing=0 cellpadding=0><tr><td maxlines=1><font sizerange=medium color="C2CCD7">Help</font></table> <td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Index</font>
</table>
</table> </table>
<TR> <TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp; <td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr> <tr>
<td> <td>
<td valign=bottom align=right > <img src="wtv-author:/ROMCache/pagebuilder.gif" height=124 width=78>&nbsp; <td abswidth=93 absheight=26>
<table href="wtv-guide:/help?topic=Glossary&subtopic=P&page=pagebuilder" cellspacing=0 cellpadding=0>
<tr>
<td abswidth=5>
<td abswidth=90 valign=middle align=left>
<table cellspacing=0 cellpadding=0>
<tr>
<td maxlines=1>
<font sizerange=medium color="C2CCD7">Help</font>
</table>
</table>
<TR>
<td colspan=5 absheight=2 valign=middle align=center bgcolor=#8A99B0>&nbsp;
<tr>
<td>
<td valign=bottom align=right>
<img src="wtv-author:/ROMCache/pagebuilder.gif" height=124 width=78>&nbsp;
</table> </table>
</sidebar> </sidebar>
<body <body bgcolor=#1e4261 background=wtv-author:/ROMCache/blue_tile_128.gif text=AEBFD1 link=B8BDC7 vlink=B8BDC7 hspace=0 vspace=0>
bgcolor=#1e4261
background=wtv-author:/ROMCache/blue_tile_128.gif text=AEBFD1 link=B8BDC7
vlink=B8BDC7
hspace=0
vspace=0
>
<table cellspacing=0 cellpadding=0 width=100%> <table cellspacing=0 cellpadding=0 width=100%>
<tr> <tr>
<td abswidth=10 rowspan=100> <td abswidth=10 rowspan=100>
<tr> <tr>
<td height=44 width=206 valign=middle colspan=2> <td height=44 width=206 valign=middle colspan=2>
<font size=+1 color=D1D1D1><blackface> Choose a page style </blackface></font> <font size=+1 color=D1D1D1>
<blackface> Choose a page style </blackface>
</font>
<td align=right valign=middle> <td align=right valign=middle>
<table valign=middle> <table valign=middle>
<tr> <tr>
<td> <td>
<table cellspacing=0 cellpadding=0 <table cellspacing=0 cellpadding=0>
><tr><td><img src="wtv-author:/ROMCache/minus_button_dim.gif"> <tr>
<td>
<img src="wtv-author:/ROMCache/minus_button_dim.gif">
</table> </table>
</td> </td>
<td align=center><font color=D1D1D1><B>1 of 6</B></font></td> <td align=center>
<font color=D1D1D1>
<B>1 of 1</B>
</font>
</td>
<td> <td>
<table cellspacing=0 cellpadding=0 <table cellspacing=0 cellpadding=0 ref="wtv-author:/styles?tmplClass=11&docName=&styleName=&pageNum=1#plus" id=plus>
href="wtv-author:/styles?tmplClass=11&docName=&styleName=&pageNum=1#plus" id=plus><tr><td><img src="wtv-author:/ROMCache/plus_button.gif"> <tr>
<td>
<img src="wtv-author:/ROMCache/plus_button_dim.gif">
</table> </table>
</td> </td>
</tr> </tr>
@@ -74,91 +107,88 @@ href="wtv-author:/styles?tmplClass=11&docName=&styleName=&pageNum=1#plus" id=plu
<tr> <tr>
<td absheight=5> <td absheight=5>
<tr> <tr>
<td colspan=5><font color=AEBFD1> You can change the style at any time without losing your text or images. <td colspan=5>
</font> <font color=AEBFD1> You can change the style at any time without losing your text or images. </font>
<tr> <tr>
<td absheight=10> <td absheight=10>
<tr> <tr>
<td absheight=5> <td absheight=5>
<tr> <tr>
<td> <td>
<TABLE border=0 cellpadding=0 cellspacing=0 width=137> <TABLE border=0 cellpadding=0 cellspacing=0 width=137>
<TR height=120> <TR height=120>
<TD width=128 height=120 bgcolor=#8A99B0 <TD width=128 height=120 bgcolor=#8A99B0 href="new?tmplClass=&layoutTMPL=Blue_Sands.tmpl&contentTMPL=&styleName=Blue Sands&blocksPerPage=0" name="Blue Sands">
href="new?tmplClass=
&layoutTMPL=Blue_Sands.tmpl&contentTMPL=&styleName=Blue Sands
&blocksPerPage=0"
name="Blue Sands
"
>
<spacer type=block width=4></spacer> <spacer type=block width=4></spacer>
<font color=0F283F> <font color=0F283F> Blue Sands <BR>
Blue Sands
<BR>
</font> </font>
<center> <center>
<img src=/images/styles/blue_sands.gif width="120" height="90" vspace=3> <img src=/images/styles/blue_sands.gif width="120" height="90" vspace=3>
</center> </center>
</TD> </TD>
<TD height=120><IMG height=120 width=12 src=/ROMCache/right_shadow.gif></TD> <TD height=120>
</TR> <IMG height=120 width=12 src=/ROMCache/right_shadow.gif>
<TR>
<TD width=128><IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif></TD>
<TD><IMG height=12 width=12 src=/ROMCache/corner_shadow.gif></TD>
</TR>
</TABLE>
</td>
<td>
<TABLE border=0 cellpadding=0 cellspacing=0 width=137>
<TR height=120>
<TD width=128 height=120 bgcolor=#8A99B0
href="new?tmplClass=
&layoutTMPL=Ocean.tmpl&contentTMPL=&styleName=Ocean
&blocksPerPage=0"
name="Ocean
"
>
<spacer type=block width=4></spacer>
<font color=0F283F>
Ocean
<BR>
</font>
<center>
<img src=/images/styles/oceanic.gif width="120" height="90" vspace=3>
</center>
</TD> </TD>
<TD height=120><IMG height=120 width=12 src=/ROMCache/right_shadow.gif></TD>
</TR> </TR>
<TR> <TR>
<TD width=128><IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif></TD> <TD width=128>
<TD><IMG height=12 width=12 src=/ROMCache/corner_shadow.gif></TD> <IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif>
</TD>
<TD>
<IMG height=12 width=12 src=/ROMCache/corner_shadow.gif>
</TD>
</TR> </TR>
</TABLE> </TABLE>
</td> </td>
<td> <td>
<TABLE border=0 cellpadding=0 cellspacing=0 width=137> <TABLE border=0 cellpadding=0 cellspacing=0 width=137>
<TR height=120> <TR height=120>
<TD width=128 height=120 bgcolor=#8A99B0 <TD width=128 height=120 bgcolor=#8A99B0 href="new?tmplClass=&layoutTMPL=Space.tmpl&contentTMPL=&styleName=Space&blocksPerPage=0" name="Space">
href="new?tmplClass=
&layoutTMPL=Space.tmpl&contentTMPL=&styleName=Space
&blocksPerPage=0"
name="Space
"
>
<spacer type=block width=4></spacer> <spacer type=block width=4></spacer>
<font color=0F283F> <font color=0F283F> Space <BR>
Space
<BR>
</font> </font>
<center> <center>
<img src=/images/styles/space.gif width="120" height="90" vspace=3> <img src=/images/styles/space.gif width="120" height="90" vspace=3>
</center> </center>
</TD> </TD>
<TD height=120><IMG height=120 width=12 src=/ROMCache/right_shadow.gif></TD> <TD height=120>
<IMG height=120 width=12 src=/ROMCache/right_shadow.gif>
</TD>
</TR> </TR>
<TR> <TR>
<TD width=128><IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif></TD> <TD width=128>
<TD><IMG height=12 width=12 src=/ROMCache/corner_shadow.gif></TD> <IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif>
</TD>
<TD>
<IMG height=12 width=12 src=/ROMCache/corner_shadow.gif>
</TD>
</TR>
</TABLE>
</td>
<td>
<TABLE border=0 cellpadding=0 cellspacing=0 width=137>
<TR height=120>
<TD width=128 height=120 bgcolor=#8A99B0 href="new?tmplClass=&layoutTMPL=Cats.tmpl&contentTMPL=&styleName=Cats&blocksPerPage=0" name="Cats">
<spacer type=block width=4></spacer>
<font color=0F283F> Cats <BR>
</font>
<center>
<img src=/images/styles/catz.gif width="120" height="90" vspace=3>
</center>
</TD>
<TD height=120>
<IMG height=120 width=12 src=/ROMCache/right_shadow.gif>
</TD>
</TR>
<TR>
<TD width=128>
<IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif>
</TD>
<TD>
<IMG height=12 width=12 src=/ROMCache/corner_shadow.gif>
</TD>
</TR> </TR>
</TABLE> </TABLE>
</td> </td>
@@ -166,81 +196,77 @@ Space
<td> <td>
<TABLE border=0 cellpadding=0 cellspacing=0 width=137> <TABLE border=0 cellpadding=0 cellspacing=0 width=137>
<TR height=120> <TR height=120>
<TD width=128 height=120 bgcolor=#8A99B0 <TD width=128 height=120 bgcolor=#8A99B0 href="new?tmplClass=&layoutTMPL=Blue.tmpl&contentTMPL=&styleName=Blue&blocksPerPage=0" name="Blue">
href="new?tmplClass=
&layoutTMPL=ringbinder.tmpl&contentTMPL=&styleName=Ringbinder
&blocksPerPage=0"
name="Ringbinder
"
>
<spacer type=block width=4></spacer> <spacer type=block width=4></spacer>
<font color=0F283F> <font color=0F283F> Blue <BR>
Ringbinder
<BR>
</font> </font>
<center> <center>
<img src=/images/styles/ringbinder.gif width="120" height="90" vspace=3> <img src=/images/styles/blue.gif width="120" height="90" vspace=3>
</center> </center>
</TD> </TD>
<TD height=120><IMG height=120 width=12 src=/ROMCache/right_shadow.gif></TD> <TD height=120>
<IMG height=120 width=12 src=/ROMCache/right_shadow.gif>
</TD>
</TR> </TR>
<TR> <TR>
<TD width=128><IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif></TD> <TD width=128>
<TD><IMG height=12 width=12 src=/ROMCache/corner_shadow.gif></TD> <IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif>
</TD>
<TD>
<IMG height=12 width=12 src=/ROMCache/corner_shadow.gif>
</TD>
</TR> </TR>
</TABLE> </TABLE>
</td> </td>
<td> <td>
<TABLE border=0 cellpadding=0 cellspacing=0 width=137> <TABLE border=0 cellpadding=0 cellspacing=0 width=137>
<TR height=120> <TR height=120>
<TD width=128 height=120 bgcolor=#8A99B0 <TD width=128 height=120 bgcolor=#8A99B0 href="new?tmplClass=&layoutTMPL=Red.tmpl&contentTMPL=&styleName=Red&blocksPerPage=0" name="Red">
href="new?tmplClass=
&layoutTMPL=Stone.tmpl&contentTMPL=&styleName=Stone
&blocksPerPage=0"
name="Stone
"
>
<spacer type=block width=4></spacer> <spacer type=block width=4></spacer>
<font color=0F283F> <font color=0F283F> Red <BR>
Stone
<BR>
</font> </font>
<center> <center>
<img src=/images/styles/stone.gif width="120" height="90" vspace=3> <img src=/images/styles/red.gif width="120" height="90" vspace=3>
</center> </center>
</TD> </TD>
<TD height=120><IMG height=120 width=12 src=/ROMCache/right_shadow.gif></TD> <TD height=120>
<IMG height=120 width=12 src=/ROMCache/right_shadow.gif>
</TD>
</TR> </TR>
<TR> <TR>
<TD width=128><IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif></TD> <TD width=128>
<TD><IMG height=12 width=12 src=/ROMCache/corner_shadow.gif></TD> <IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif>
</TD>
<TD>
<IMG height=12 width=12 src=/ROMCache/corner_shadow.gif>
</TD>
</TR> </TR>
</TABLE> </TABLE>
</td> </td>
<td> <td>
<TABLE border=0 cellpadding=0 cellspacing=0 width=137> <TABLE border=0 cellpadding=0 cellspacing=0 width=137>
<TR height=120> <TR height=120>
<TD width=128 height=120 bgcolor=#8A99B0 <TD width=128 height=120 bgcolor=#8A99B0 href="new?tmplClass=&layoutTMPL=Republican.tmpl&contentTMPL=&styleName=Republican&blocksPerPage=0" name="Republican">
href="new?tmplClass=
&layoutTMPL=Cats.tmpl&contentTMPL=&styleName=Cats
&blocksPerPage=0"
name="Cats
"
>
<spacer type=block width=4></spacer> <spacer type=block width=4></spacer>
<font color=0F283F> <font color=0F283F> Republican <BR>
Cats
<BR>
</font> </font>
<center> <center>
<img src=/images/styles/catz.gif width="120" height="90" vspace=3> <img src=/images/styles/republican.gif width="120" height="90" vspace=3>
</center> </center>
</TD> </TD>
<TD height=120><IMG height=120 width=12 src=/ROMCache/right_shadow.gif></TD> <TD height=120>
<IMG height=120 width=12 src=/ROMCache/right_shadow.gif>
</TD>
</TR> </TR>
<TR> <TR>
<TD width=128><IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif></TD> <TD width=128>
<TD><IMG height=12 width=12 src=/ROMCache/corner_shadow.gif></TD> <IMG height=12 width=128 src=/ROMCache/bottom_shadow.gif>
</TD>
<TD>
<IMG height=12 width=12 src=/ROMCache/corner_shadow.gif>
</TD>
</TR> </TR>
</TABLE> </TABLE>
</td> </td>
@@ -248,3 +274,8 @@ Cats
</BODY> </BODY>
</HTML> </HTML>
`; `;
} else {
var err = wtvshared.doErrorPage(500, "You are not allowed to create more than <b>"+minisrv_config.services["wtv-author"].max_pages+"</b> pages.");
headers = err[0];
data = err[1];
}

View File

@@ -88,7 +88,8 @@ class WTVAuthor {
if (pages.length == 0) { if (pages.length == 0) {
pagenum = 0; pagenum = 0;
} else { } else {
var pagelen = pages.length - 1; var pagelen = pages.length;
if (pagelen < 0) pagelen = 0;
this.debug("createPage","pages",pages) this.debug("createPage","pages",pages)
var pagenums = []; var pagenums = [];
for(let i = 0; i < pagelen; i++) { for(let i = 0; i < pagelen; i++) {
@@ -96,14 +97,16 @@ class WTVAuthor {
pagenums.push(parseInt(toarr)); pagenums.push(parseInt(toarr));
} }
pagenums = pagenums.sort() pagenums = pagenums.sort()
var pagenum = pagenums[pagelen]; this.debug("createPage", "pagenums", pagenums)
var pagenum = parseInt(pagenums[pagelen - 1]);
this.debug("createPage", "pagenum", pagenum) this.debug("createPage", "pagenum", pagenum)
this.debug("createPage", "pagelen", pagelen)
} }
if (pages.length == 0) { if (pages.length == 0) {
pagenum = 0 pagenum = 0
var pagefile = pagenum + this.pageFileExt; var pagefile = pagenum + this.pageFileExt;
} else { } else {;
var pagefile = pagenum + 1 + this.pageFileExt; var pagefile = (pagenum + 1) + this.pageFileExt;
} }
var pagefileout = this.pagestore_dir + pagefile; var pagefileout = this.pagestore_dir + pagefile;
// JSON data structure // JSON data structure
@@ -971,11 +974,6 @@ vspace=0
} }
editTextBlock(pagenum, title, caption, size, style, position, oldposition) { editTextBlock(pagenum, title, caption, size, style, position, oldposition) {
Array.prototype.move = function(from,to){
this.splice(to,0,this.splice(from,1)[0]);
return this;
};
var pagedata = this.loadPage(pagenum); var pagedata = this.loadPage(pagenum);
if (!pagedata) return false; if (!pagedata) return false;
@@ -993,7 +991,7 @@ vspace=0
pagedata.blocks[oldposition].style = style pagedata.blocks[oldposition].style = style
if (oldposition != position) if (oldposition != position)
pagedata.blocks.move(oldposition,position); moveArrayKey(pagedata.blocks,oldposition,position);
this.editPage(pagedata, pagenum); this.editPage(pagedata, pagenum);
return true; return true;
@@ -1018,10 +1016,6 @@ vspace=0
} }
editPhotoBlock(pagenum, oldposition, position, photo, type, title, caption) { editPhotoBlock(pagenum, oldposition, position, photo, type, title, caption) {
Array.prototype.move = function(from,to){
this.splice(to,0,this.splice(from,1)[0]);
return this;
};
var pagedata = this.loadPage(pagenum); var pagedata = this.loadPage(pagenum);
if (!pagedata) return false; if (!pagedata) return false;
@@ -1044,7 +1038,7 @@ vspace=0
blocks[oldposition].caption = caption blocks[oldposition].caption = caption
if (oldposition != position) { if (oldposition != position) {
blocks.move(oldposition,position); moveArrayKey(blocks, oldposition,position);
} }
this.editPage(pagedata, pagenum); this.editPage(pagedata, pagenum);
@@ -1070,10 +1064,6 @@ vspace=0
} }
editHeaderBlock(pagenum, text, size, dividerBefore, dividerAfter, position, oldposition) { editHeaderBlock(pagenum, text, size, dividerBefore, dividerAfter, position, oldposition) {
Array.prototype.move = function(from,to){
this.splice(to,0,this.splice(from,1)[0]);
return this;
};
var pagedata = this.loadPage(pagenum); var pagedata = this.loadPage(pagenum);
if (!pagedata) return false; if (!pagedata) return false;
@@ -1092,7 +1082,7 @@ vspace=0
pagedata.blocks[oldposition].dividerAfter = dividerAfter pagedata.blocks[oldposition].dividerAfter = dividerAfter
if (oldposition != position) if (oldposition != position)
pagedata.blocks.move(oldposition,position); moveArrayKey(pagedata.blocks, oldposition,position);
this.editPage(pagedata, pagenum); this.editPage(pagedata, pagenum);
return true; return true;
@@ -1115,10 +1105,6 @@ vspace=0
} }
editListBlock(pagenum, title, items, position, oldposition) { editListBlock(pagenum, title, items, position, oldposition) {
Array.prototype.move = function(from,to){
this.splice(to,0,this.splice(from,1)[0]);
return this;
};
var pagedata = this.loadPage(pagenum); var pagedata = this.loadPage(pagenum);
if (!pagedata) return false; if (!pagedata) return false;
@@ -1133,7 +1119,7 @@ vspace=0
pagedata.blocks[oldposition].items = items pagedata.blocks[oldposition].items = items
if (oldposition != position) if (oldposition != position)
pagedata.blocks.move(oldposition,position); moveArrayKey(pagedata.blocks,oldposition,position);
this.editPage(pagedata, pagenum); this.editPage(pagedata, pagenum);
return true; return true;
@@ -1173,10 +1159,6 @@ vspace=0
} }
editLinkBlock(pagenum, title, listItems, linkItems, position, oldposition) { editLinkBlock(pagenum, title, listItems, linkItems, position, oldposition) {
Array.prototype.move = function(from,to){
this.splice(to,0,this.splice(from,1)[0]);
return this;
};
var pagedata = this.loadPage(pagenum); var pagedata = this.loadPage(pagenum);
if (!pagedata) return false; if (!pagedata) return false;
@@ -1202,7 +1184,7 @@ vspace=0
pagedata.blocks[oldposition].items = items pagedata.blocks[oldposition].items = items
if (oldposition != position) if (oldposition != position)
pagedata.blocks.move(oldposition,position); moveArrayKey(pagedata.blocks,oldposition,position);
this.editPage(pagedata, pagenum); this.editPage(pagedata, pagenum);
return true; return true;
@@ -1224,16 +1206,11 @@ vspace=0
} }
editBreakBlock(pagenum, position, oldposition) { editBreakBlock(pagenum, position, oldposition) {
Array.prototype.move = function(from,to){
this.splice(to,0,this.splice(from,1)[0]);
return this;
};
var pagedata = this.loadPage(pagenum); var pagedata = this.loadPage(pagenum);
if (!pagedata) return false; if (!pagedata) return false;
if (oldposition != position) if (oldposition != position)
pagedata.blocks.move(oldposition,position); moveArrayKey(pagedata.blocks,oldposition,position);
this.editPage(pagedata, pagenum); this.editPage(pagedata, pagenum);
this.generateBreakList(pagenum); this.generateBreakList(pagenum);

View File

@@ -281,6 +281,7 @@
"port": 1643, "port": 1643,
"connections": 3, "connections": 3,
"enable_multi_query": true, "enable_multi_query": true,
"max_pages": 4,
"publish_mode": "service", // "service" or "directory" "publish_mode": "service", // "service" or "directory"
"publish_dest": "pb_services", // service name, or directory path "publish_dest": "pb_services", // service name, or directory path
"modules": [ "modules": [

File diff suppressed because it is too large Load Diff

View File

@@ -44,5 +44,8 @@
"socks-proxy-agent": "^8.0.1", "socks-proxy-agent": "^8.0.1",
"strftime": "^0.10.2", "strftime": "^0.10.2",
"uuid": "^8.3.2" "uuid": "^8.3.2"
},
"devDependencies": {
"eslint": "^8.48.0"
} }
} }