# HG changeset patch # User Nicholas Jillings # Date 1492595989 -3600 # Node ID bc9016b5d32f943aa94b099d323b7e27b4e314c4 # Parent 23868d69c452b178af98b330bcd8a5aee4b8f26a# Parent f2bb15d5f5c90fe128277526f753a7dc9d00ba36 Merge branch 'master' into vnext diff -r 23868d69c452 -r bc9016b5d32f js/core.js --- a/js/core.js Wed Apr 19 10:27:32 2017 +0100 +++ b/js/core.js Wed Apr 19 10:59:49 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');