# HG changeset patch # User Nicholas Jillings # Date 1492595913 -3600 # Node ID f2bb15d5f5c90fe128277526f753a7dc9d00ba36 # Parent d999a8fc26ea3299248896d8b95cf8baf093a5be #144 #190. Better handling of 'completed' tags in and nodes. diff -r d999a8fc26ea -r f2bb15d5f5c9 js/core.js --- a/js/core.js Wed Apr 19 10:26:56 2017 +0100 +++ b/js/core.js Wed Apr 19 10:58:33 2017 +0100 @@ -389,7 +389,7 @@ // Save the data from interface into XML and send to destURL // If destURL is null then download XML in client // Now time to render file locally - var xmlDoc = interfaceXMLSave(); + var xmlDoc = storage.finish(); var parent = document.createElement("div"); parent.appendChild(xmlDoc); var file = [parent.innerHTML]; @@ -3393,7 +3393,7 @@ this.document = null; this.root = null; this.state = 0; - var pFilenamePrefix = ""; + var pFilenamePrefix = "save"; this.initialise = function (existingStore) { if (existingStore === undefined) { @@ -3504,8 +3504,13 @@ var hold = document.createElement("div"); var clone = this.parent.root.cloneNode(true); hold.appendChild(clone); + var saveURL = specification.returnURL + "php/save.php?key=" + this.key + "&saveFilenamePrefix="; + if (this.parent.filenamePrefix.length == 0) { + saveURL += "save"; + } else { + saveURL += this.parent.filenamePrefix; + } return new Promise(function (resolve, reject) { - var saveURL = specification.returnURL + "php/save.php?key=" + this.key + "&saveFilenamePrefix=" + this.parent.filenamePrefix; var xmlhttp = new XMLHttpRequest(); xmlhttp.open("POST", saveURL); xmlhttp.setRequestHeader('Content-Type', 'text/xml');