# HG changeset patch # User www-data # Date 1492597265 -3600 # Node ID c9912c7878ecc3545c0d9fa018babd19dd5a72c3 # Parent 952e4b75d4dedbe2eb10a05481df7526232f44ce# Parent f2bb15d5f5c90fe128277526f753a7dc9d00ba36 Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool diff -r 952e4b75d4de -r c9912c7878ec interfaces/AB.js --- 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; diff -r 952e4b75d4de -r c9912c7878ec js/core.js --- 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');