can now add scrapbook image to pagebuilder page
This commit is contained in:
@@ -373,7 +373,7 @@ data += `
|
||||
<tr>
|
||||
<td height=32>
|
||||
<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>
|
||||
<tr>
|
||||
<td height=32>
|
||||
|
||||
@@ -9,7 +9,7 @@ var position = request_headers.query.newBlockNum
|
||||
var oldPosition = request_headers.query.oldBlockNum
|
||||
var editing = request_headers.query.editing
|
||||
|
||||
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);
|
||||
var page = session_data.pagestore.loadPage(docName);
|
||||
headers = `300 OK
|
||||
@@ -22,10 +22,18 @@ Location: wtv-author:/show-blocks?docName=${docName}`
|
||||
} else {
|
||||
var page = session_data.pagestore.loadPage(docName);
|
||||
var blockNum = request_headers.query.blockNum;
|
||||
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");
|
||||
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)
|
||||
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");
|
||||
}
|
||||
|
||||
headers = `300 OK
|
||||
wtv-expire-all: wtv-author:/block-preview
|
||||
|
||||
@@ -53,7 +53,7 @@ data = `<HTML>
|
||||
<tr>
|
||||
<td>
|
||||
<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>
|
||||
<td abswidth=5>
|
||||
<td abswidth=90 valign=middle align=left>
|
||||
|
||||
@@ -10,8 +10,7 @@ var photo;
|
||||
var thumbnail;
|
||||
|
||||
if (pagedata.blocks[oldBlockNum].photo) {
|
||||
console.log(pagedata.blocks[oldBlockNum].photo);
|
||||
photo = wtvshared.btoa(pagedata.blocks[oldBlockNum].photo)
|
||||
photo = wtvshared.atob(pagedata.blocks[oldBlockNum].photo)
|
||||
thumbnail = photo.replace('clipart/', 'clipart/icons/');
|
||||
}
|
||||
|
||||
@@ -328,6 +327,7 @@ setTimeout(tempStr, 500);
|
||||
break;
|
||||
|
||||
case "snapshot":
|
||||
case "scrapbook":
|
||||
case "clipart":
|
||||
case "text":
|
||||
if (request_headers.query.photoBlockChangeImage) {
|
||||
@@ -461,8 +461,8 @@ function DisplayViewOption(showIt)
|
||||
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") {
|
||||
<img src=wtv-author:/ROMCache/pointer.gif align=absmiddle width=13 height=22 hspace=0> `
|
||||
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>`
|
||||
|
||||
@@ -10,5 +10,4 @@ if (!errpage) {
|
||||
headers = `200 OK
|
||||
Content-Type: image/jpeg`;
|
||||
data = new Buffer.from(page.blocks[blockNum].photo, 'base64');
|
||||
console.log(data)
|
||||
}
|
||||
@@ -128,8 +128,13 @@ function StorageWarning() { }
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<table><tr><td width=20><td width=380>
|
||||
<font color=AEBFD1>
|
||||
Choose one of your saved images to view it full size.
|
||||
<font color=AEBFD1>`;
|
||||
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>
|
||||
</table>
|
||||
<tr><td absheight=10>
|
||||
@@ -164,12 +169,15 @@ if (files.length === 0) {
|
||||
</td>`;
|
||||
} else {
|
||||
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 += `
|
||||
<td align=center valign=middle>
|
||||
<A href=
|
||||
"wtv-tricks:/view-scrapbook-image?id=${files[i]}" transition=light>
|
||||
<a href="${url}" transition=light>
|
||||
<img src="wtv-tricks:/view-scrapbook-image?id=${files[i]}&width=90" width=90>
|
||||
</A>
|
||||
</a>
|
||||
</td>
|
||||
${i % 4 === 1 ? '</tr><tr>' : ''}`
|
||||
}
|
||||
|
||||
@@ -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 = '';
|
||||
@@ -299,6 +299,7 @@ class WTVAuthor {
|
||||
break;
|
||||
|
||||
case "snapshot":
|
||||
case "scrapbook":
|
||||
if (state == "publishing") {
|
||||
block = this.generatePublishImageBlock(number, page)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user