diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/add-block.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/add-block.js index fae597de..fb228954 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/add-block.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/add-block.js @@ -373,7 +373,7 @@ data += ` -Your scrapbook diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/add-media-to-block.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/add-media-to-block.js index 07b0b4a5..57e022d7 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/add-media-to-block.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/add-media-to-block.js @@ -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,11 +22,19 @@ 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 wtv-expire-all: wtv-author:/preview diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/documents.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/documents.js index cc2a3d1e..d08695e5 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/documents.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/documents.js @@ -53,7 +53,7 @@ data = ` - +
`; } 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 += ` ${i % 4 === 1 ? '' : ''}` } diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/welcome.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/welcome.js new file mode 100644 index 00000000..99fe4cfb --- /dev/null +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/welcome.js @@ -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 = ''; \ No newline at end of file diff --git a/zefie_wtvp_minisrv/includes/classes/WTVAuthor.js b/zefie_wtvp_minisrv/includes/classes/WTVAuthor.js index fca96eb5..abb87738 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVAuthor.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVAuthor.js @@ -299,6 +299,7 @@ class WTVAuthor { break; case "snapshot": + case "scrapbook": if (state == "publishing") { block = this.generatePublishImageBlock(number, page) break;
diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/edit-block.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/edit-block.js index fa6a014b..7b657256 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/edit-block.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/edit-block.js @@ -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(' -` -if (blockType == "snapshot") { + ` +if (blockType == "snapshot" || blockType == "scrapbook") { data += `View this picture ` diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/get-photo.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/get-photo.js index 158dbd2f..c32cd10a 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/get-photo.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/get-photo.js @@ -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) } \ No newline at end of file diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/scrapbook.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/scrapbook.js index 4a463e99..d3451778 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/scrapbook.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-author/scrapbook.js @@ -128,8 +128,13 @@ function StorageWarning() { }
- -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 += `
@@ -164,12 +169,15 @@ if (files.length === 0) { - + - +