const minisrv_service_file = true; const pagestore_exists = session_data.pagestore.pagestoreExists(); const docName = request_headers.query.docName; if (pagestore_exists !== true) { session_data.pagestore.createPagestore(); headers = `300 OK Location: wtv-author:/documents` } else { const page = session_data.pagestore.loadPage(docName) const discardAlert = function (docName) { return new clientShowAlert({ 'image': this.minisrv_config.config.service_logo, 'message': "Would you like to permanently discard this document and all of its contents?", 'buttonlabel1': "Don't Discard", 'buttonaction1': "client:donothing", 'buttonlabel2': "Discard", 'buttonaction2': "delete-doc?docName=" + docName, 'sound': false, 'noback': true, }).getURL(); } const unpublishAlert = function (docName) { return new clientShowAlert({ 'image': this.minisrv_config.config.service_logo, 'message': "Would you like to unpublish this document? You can republish it later.", 'buttonlabel1': "Don't Unpublish", 'buttonaction1': "client:donothing", 'buttonlabel2': "Unpublish", 'buttonaction2': "publish?docName=" + docName + "&unpublish=1", 'sound': false, 'noback': true, }).getURL(); } headers = `200 OK Connection: Keep-Alive Content-Type: text/html` data = ` Page Settings
 
 
 
Index
 
Help
 
 
Page settings
${page.title}

` if (page.published === true) data += `published ${page.publishdate}` else data += "not published" data += `

Change page
Change the contents of your page
Change public listing
Change how your page is listed
` if (page.published !== true) data += `Publish page
Make your page available to others on the Web` else data += `Unpublish page
Hide your page from others on the Web` data += `
Discard page
Permanently erase your entire page
`; }