changeset 2733:f2bb15d5f5c9

#144 #190. Better handling of 'completed' tags in <page> and <waetresult> nodes.
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Wed, 19 Apr 2017 10:58:33 +0100
parents d999a8fc26ea
children c9912c7878ec 9d31ddedae2b bc9016b5d32f
files js/core.js
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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');