can now add scrapbook image to pagebuilder page

This commit is contained in:
zefie
2025-07-14 12:55:23 -04:00
parent 1e26ffcf9d
commit d7680c6644
8 changed files with 40 additions and 18 deletions

View File

@@ -373,7 +373,7 @@ data += `
<tr> <tr>
<td height=32> <td height=32>
<img src=wtv-author:/ROMCache/pointer.gif align=absmiddle width=13 height=22 hspace=0> <img src=wtv-author:/ROMCache/pointer.gif align=absmiddle width=13 height=22 hspace=0>
<a href=wtv-author:/scrapbook?addMediaURL=wtv-author%3A%2Fadd-media-to-block%3FdocName%3D${docName}%26blockNum%3D9%26blockClass%3D23 <a href=wtv-author:/scrapbook?addMediaURL=wtv-author%3A%2Fadd-media-to-block%3FdocName%3D${docName}%26blockNum%3D${blockNum - 1}%26blockClass%3D23
><font effect=shadow><B>Your scrapbook</B></font></a> ><font effect=shadow><B>Your scrapbook</B></font></a>
<tr> <tr>
<td height=32> <td height=32>

View File

@@ -22,10 +22,18 @@ Location: wtv-author:/show-blocks?docName=${docName}`
} else { } else {
var page = session_data.pagestore.loadPage(docName); var page = session_data.pagestore.loadPage(docName);
var blockNum = request_headers.query.blockNum; var blockNum = request_headers.query.blockNum;
if (request_headers.query.scrapbookID != undefined) {
var image = session_data.pagestore.getScrapbookImage(parseInt(request_headers.query.scrapbookID));
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); session_data.pagestore.editPhotoBlock(docName, request_headers.query.blockNum, request_headers.query.blockNum, request_headers.query.mediaPath, "clipart", null, null);
else else
session_data.pagestore.createPhotoBlock(docName, request_headers.query.mediaPath, "clipart"); session_data.pagestore.createPhotoBlock(docName, request_headers.query.mediaPath, "clipart");
}
headers = `300 OK headers = `300 OK
wtv-expire-all: wtv-author:/block-preview wtv-expire-all: wtv-author:/block-preview

View File

@@ -53,7 +53,7 @@ data = `<HTML>
<tr> <tr>
<td> <td>
<td abswidth=93 absheight=26> <td abswidth=93 absheight=26>
<table href="client:showalert?message=This%20feature%20is%20not%20available." cellspacing=0 cellpadding=0> <table href="wtv-author:/scrapbook" cellspacing=0 cellpadding=0>
<tr> <tr>
<td abswidth=5> <td abswidth=5>
<td abswidth=90 valign=middle align=left> <td abswidth=90 valign=middle align=left>

View File

@@ -10,8 +10,7 @@ var photo;
var thumbnail; var thumbnail;
if (pagedata.blocks[oldBlockNum].photo) { if (pagedata.blocks[oldBlockNum].photo) {
console.log(pagedata.blocks[oldBlockNum].photo); photo = wtvshared.atob(pagedata.blocks[oldBlockNum].photo)
photo = wtvshared.btoa(pagedata.blocks[oldBlockNum].photo)
thumbnail = photo.replace('clipart/', 'clipart/icons/'); thumbnail = photo.replace('clipart/', 'clipart/icons/');
} }
@@ -328,6 +327,7 @@ setTimeout(tempStr, 500);
break; break;
case "snapshot": case "snapshot":
case "scrapbook":
case "clipart": case "clipart":
case "text": case "text":
if (request_headers.query.photoBlockChangeImage) { if (request_headers.query.photoBlockChangeImage) {
@@ -462,7 +462,7 @@ if (showIt)
{ document.viewOptionEmbed.document.write(' { document.viewOptionEmbed.document.write('
<BODY text=AEBFD1 link=B8BDC7 vlink=B8BDC7> <BODY text=AEBFD1 link=B8BDC7 vlink=B8BDC7>
<img src=wtv-author:/ROMCache/pointer.gif align=absmiddle width=13 height=22 hspace=0> ` <img src=wtv-author:/ROMCache/pointer.gif align=absmiddle width=13 height=22 hspace=0> `
if (blockType == "snapshot") { if (blockType == "snapshot" || blockType == "scrapbook") {
data += `<a href=wtv-author:/get-photo?docName=${docName}&blockNum=${oldBlockNum} data += `<a href=wtv-author:/get-photo?docName=${docName}&blockNum=${oldBlockNum}
><font effect=shadow><B>View this picture</B></font></a> ><font effect=shadow><B>View this picture</B></font></a>
</BODY>` </BODY>`

View File

@@ -10,5 +10,4 @@ if (!errpage) {
headers = `200 OK headers = `200 OK
Content-Type: image/jpeg`; Content-Type: image/jpeg`;
data = new Buffer.from(page.blocks[blockNum].photo, 'base64'); data = new Buffer.from(page.blocks[blockNum].photo, 'base64');
console.log(data)
} }

View File

@@ -128,8 +128,13 @@ function StorageWarning() { }
<tr> <tr>
<td colspan=2> <td colspan=2>
<table><tr><td width=20><td width=380> <table><tr><td width=20><td width=380>
<font color=AEBFD1> <font color=AEBFD1>`;
Choose one of your saved images to view it full size. 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 += `
</font> </font>
</table> </table>
<tr><td absheight=10> <tr><td absheight=10>
@@ -164,12 +169,15 @@ if (files.length === 0) {
</td>`; </td>`;
} else { } else {
for (let i = start; i < Math.min(files.length, start + 12); i++) { for (let i = start; i < Math.min(files.length, start + 12); i++) {
url = "wtv-tricks:/view-scrapbook-image?id=" + files[i];
if (request_headers.query.addMediaURL) {
url = unescape(request_headers.query.addMediaURL) + "&scrapbookID=" + files[i];
}
data += ` data += `
<td align=center valign=middle> <td align=center valign=middle>
<A href= <a href="${url}" transition=light>
"wtv-tricks:/view-scrapbook-image?id=${files[i]}" transition=light>
<img src="wtv-tricks:/view-scrapbook-image?id=${files[i]}&width=90" width=90> <img src="wtv-tricks:/view-scrapbook-image?id=${files[i]}&width=90" width=90>
</A> </a>
</td> </td>
${i % 4 === 1 ? '</tr><tr>' : ''}` ${i % 4 === 1 ? '</tr><tr>' : ''}`
} }

View File

@@ -0,0 +1,6 @@
minisrv_service_file = true;
headers = `300 OK
Content-Type: text/html
Location: wtv-author:/documents
wtv-visit: wtv-author:/documents`
data = '';

View File

@@ -299,6 +299,7 @@ class WTVAuthor {
break; break;
case "snapshot": case "snapshot":
case "scrapbook":
if (state == "publishing") { if (state == "publishing") {
block = this.generatePublishImageBlock(number, page) block = this.generatePublishImageBlock(number, page)
break; break;