comments, move functions, scrapbook progress

This commit is contained in:
zefie
2025-07-21 14:35:56 -04:00
parent e2b4aca277
commit 90522cc796
16 changed files with 756 additions and 532 deletions

View File

@@ -1,12 +1,14 @@
var minisrv_service_file = true;
var files = session_data.pagestore.listScrapbook();
var dir = session_data.pagestore.scrapbookDir()
var start = 0;
var files = session_data.listScrapbook();
var dir = session_data.scrapbookDir()
var pageNum = parseInt(request_headers.query.pageNum || 1);
var start = (pageNum - 1) * 6;
headers = `200 OK
Connection: Keep-Alive
Content-Type: text/html`
Content-Type: text/html
wtv-expire-all: wtv-author:/scrapbook`
data = `<HTML>
<HEAD>
@@ -124,7 +126,38 @@ function StorageWarning() { }
</FORM>
<tr>
<td height=44 valign=middle>
<font size=+1 color=D1D1D1><blackface> Your scrapbook </blackface></font>
<font size=+1 color=D1D1D1><blackface> Your scrapbook </blackface></font>`
if (files.length > 6) {
data += `<td align=right valign=middle>
<table valign=middle>
<tr>
<td>`;
if (pageNum > 1) {
data += `<table cellspacing=0 cellpadding=0
href="wtv-author:scrapbook?addMediaURL=&mediaCategoryID=0&pageNum=${pageNum - 1}#minus" id=minus><tr><td><img src="wtv-author:/ROMCache/minus_button.gif">`
} else {
data += `<table cellspacing=0 cellpadding=0
><tr><td><img src="wtv-author:/ROMCache/minus_button_dim.gif">`
}
data += `
</table>
</td>
<td align=center><font color=D1D1D1><B>${pageNum} of ${Math.ceil(files.length / 6)}</B></font></td>
<td>`;
if (files.length > start + 6) {
data += `<table cellspacing=0 cellpadding=0
href="wtv-author:scrapbook?addMediaURL=&mediaCategoryID=0&pageNum=${pageNum + 1}#plus" id=plus><tr><td><img src="wtv-author:/ROMCache/plus_button.gif">`
} else {
data += `<table cellspacing=0 cellpadding=0><tr><td><img src="wtv-author:/ROMCache/plus_button_dim.gif">`
}
data += `
</table>
</td>
</tr>
</table>`
}
data += `
<tr>
<td colspan=2>
<table><tr><td width=20><td width=380>
@@ -144,7 +177,7 @@ Choose <b>Help</b> for instructions.
if (request_headers.query.addMediaURL) {
data += "Choose an image to add to your web page.";
} else {
data += "Choose one of your saved images to view it full size.";
data += `You are currently using ${session_data.getScrapbookUsagePercent()}% of your scrapbook storage space. Choose one of your saved images to view it full size.`;
}
}
data += `
@@ -176,8 +209,9 @@ if (files.length > 0) {
<IMG src=wtv-author:/ROMCache/up_arrow.gif> </TD>
<TD colspan=3 rowspan=3 align=center>
<table cellspacing=24 cellpadding=1 width=372 background="/ROMCache/light_blue_tile.gif">
<tr>`
for (let i = start; i < Math.min(files.length, start + 12); i++) {
<tr>
`
for (let i = start; i < Math.min(files.length, start + 6); i++) {
url = "wtv-tricks:/view-scrapbook-image?id=" + files[i];
if (request_headers.query.addMediaURL) {
url = unescape(request_headers.query.addMediaURL) + "&scrapbookID=" + files[i];
@@ -188,8 +222,9 @@ data += `
<img src="wtv-tricks:/view-scrapbook-image?id=${files[i]}&width=90" width=90>
</a>
</td>
${i % 4 === 1 ? '</tr><tr>' : ''}`
data += `</table>
${(i - start + 1) % 3 === 0 ? '<tr>' : ''}`
}
data += `</tr></table>
</TD>
</TR>
<TR>
@@ -207,7 +242,7 @@ data += `</table>
</TR>
</TABLE>
`
}
}
data += `
</CENTER>