changeset 2734:c9912c7878ec

Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author www-data <www-data@sucuk.dcs.qmul.ac.uk>
date Wed, 19 Apr 2017 11:21:05 +0100
parents 952e4b75d4de (current diff) f2bb15d5f5c9 (diff)
children 4af2d531be4e
files
diffstat 2 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/interfaces/AB.js	Wed Apr 19 10:21:57 2017 +0100
+++ b/interfaces/AB.js	Wed Apr 19 11:21:05 2017 +0100
@@ -288,7 +288,7 @@
             if (this.parent.specification.parent.playOne || specification.playOne) {
                 $('.comparator-button').text('Wait');
                 $('.comparator-button').attr("disabled", "true");
-                $(this.playback).css("disabled", "false");
+                $(this.playback).removeAttr("disabled");
             } else {
                 $('.comparator-button').text('Listen');
             }
@@ -298,9 +298,13 @@
         };
         this.stopPlayback = function () {
             if (this.playback.getAttribute("playstate") == "playing") {
-                $('.comparator-button').text('Listen');
-                $('.comparator-button').removeAttr("disabled");
+                $(this.playback).text('Listen');
+                $(this.playback).removeAttr("disabled");
                 this.playback.setAttribute("playstate", "ready");
+                if (this.parent.specification.parent.playOne || specification.playOne) {
+                    $('.comparator-button').text('Listen');
+                    $('.comparator-button').removeAttr("disabled");
+                }
             }
             var box = interfaceContext.commentBoxes.boxes.find(function (a) {
                 return a.id === audioElement.id;
--- a/js/core.js	Wed Apr 19 10:21:57 2017 +0100
+++ b/js/core.js	Wed Apr 19 11:21:05 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');