var minisrv_service_file = true; var docName = request_headers.query.docName; var page = session_data.pagestore.loadPage(docName) var site = session_data.pagestore.getPublishDomain(); if (request_headers.query.publishStage == "1") { headers = `200 OK Content-Type: text/html` data = ` Ready to publish
 
 
 
 
Ready to publish
You are about to publish your page to the World Wide Web where anyone can see it.
Mark Include in public list to have this page's address added to a public list of your Web pages, making it easier for your family and friends to find your pages.

Your public list of pages will be at:
http://${site}/${session_data.getSessionData("subscriber_username")}/

Include in public list
 
Don't Publish
Publish
` } else if (request_headers.query.publishStage == "2") { var inlist; if (request_headers.query.includeInPublicList != undefined) { inlist = true; } else { inlist = false; } var result = session_data.pagestore.publishPage(docName, inlist); if (result == true) { headers = `300 OK wtv-expire-all: wtv-author:/documents Location: wtv-author:/congrats?docName=${docName}` } else { headers = `400 ${result}` } } else if (request_headers.query.unpublish == "1") { var result = session_data.pagestore.unpublishPage(docName); if (result == true) { headers = `300 OK wtv-expire-all: wtv-author:/documents wtv-expire-all: wtv-author:/doc-info Location: wtv-author:/doc-info?docName=${docName}` } else { headers = `400 ${result}` } } else { headers = `300 OK wtv-expire-all: wtv-author:/block-preview wtv-expire-all: wtv-author:/preview wtv-expire-all: wtv-author:/show-blocks Location: wtv-author:/edit-title?docName=${docName}&publishing=true` }