# HG changeset patch # User Nicholas Jillings # Date 1456151925 0 # Node ID 6c05c36a34eaed99aa92f7e471e7b6ca66c51b52 # Parent 2b0dd74c1310b442f4e47fd3be15eee66e898b4b Bug #1607, #1608 and #1610 fixes. diff -r 2b0dd74c1310 -r 6c05c36a34ea core.js --- a/core.js Mon Feb 22 14:20:50 2016 +0000 +++ b/core.js Mon Feb 22 14:38:45 2016 +0000 @@ -147,6 +147,15 @@ r.onload = function() { loadProjectSpecCallback(r.response); }; + r.onerror = function() { + document.getElementsByTagName('body')[0].innerHTML = null; + var msg = document.createElement("h3"); + msg.textContent = "FATAL ERROR"; + var span = document.createElement("p"); + span.textContent = "There was an error when loading your XML file. Please check your path in the URL. After the path to this page, there should be '?url=path/to/your/file.xml'. Check the spelling of your filename as well. If you are still having issues, check the log of the python server or your webserver distribution for 404 codes for your file."; + document.getElementsByTagName('body')[0].appendChild(msg); + document.getElementsByTagName('body')[0].appendChild(span); + } r.send(); }; xmlhttp.send(); diff -r 2b0dd74c1310 -r 6c05c36a34ea interfaces/AB.css --- a/interfaces/AB.css Mon Feb 22 14:20:50 2016 +0000 +++ b/interfaces/AB.css Mon Feb 22 14:38:45 2016 +0000 @@ -37,7 +37,7 @@ font-size: 1.2em; } -div.comparitor-holder { +div.comparator-holder { width: 260px; height: 300px; border: black 1px solid; @@ -46,7 +46,7 @@ margin: 25px; } -div.comparitor-selector { +div.comparator-selector { width: 248px; height: 250px; border: black 1px solid; @@ -63,11 +63,11 @@ background-color: #008000; } -div.comparitor-selector span { +div.comparator-selector span { font-size: 4em; } -button.comparitor-button { +button.comparator-button { width: 250px; height: 38px; position: relative; diff -r 2b0dd74c1310 -r 6c05c36a34ea interfaces/AB.js --- a/interfaces/AB.js Mon Feb 22 14:20:50 2016 +0000 +++ b/interfaces/AB.js Mon Feb 22 14:38:45 2016 +0000 @@ -7,8 +7,8 @@ var height = window.innerHeight; interfaceContext.insertPoint.innerHTML = null; // Clear the current schema - // Custom Comparitor Object - Interface.prototype.comparitor = null; + // Custom comparator Object + Interface.prototype.comparator = null; // The injection point into the HTML page interfaceContext.insertPoint = document.getElementById("topLevelBody"); @@ -148,8 +148,8 @@ } } - // Populate the comparitor object - interfaceContext.comparitor = new Comparitor(audioHolderObject); + // Populate the comparator object + interfaceContext.comparator = new comparator(audioHolderObject); if (audioHolderObject.showElementComments) { var commentHolder = document.createElement('div'); @@ -165,25 +165,25 @@ resizeWindow(null); } -function Comparitor(audioHolderObject) +function comparator(audioHolderObject) { - this.comparitorBox = function(audioElement,id,text) + this.comparatorBox = function(audioElement,id,text) { this.parent = audioElement; this.id = id; this.value = 0; this.disabled = true; this.box = document.createElement('div'); - this.box.className = 'comparitor-holder'; + this.box.className = 'comparator-holder'; this.box.setAttribute('track-id',audioElement.id); - this.box.id = 'comparitor-'+text; + this.box.id = 'comparator-'+text; this.selector = document.createElement('div'); - this.selector.className = 'comparitor-selector disabled'; + this.selector.className = 'comparator-selector disabled'; var selectorText = document.createElement('span'); selectorText.textContent = text; this.selector.appendChild(selectorText); this.playback = document.createElement('button'); - this.playback.className = 'comparitor-button'; + this.playback.className = 'comparator-button'; this.playback.disabled = true; this.playback.textContent = "Listen"; this.box.appendChild(this.selector); @@ -202,13 +202,13 @@ console.log("Please listen to the samples before making a selection"); return; } - $(".comparitor-selector").removeClass('selected'); + $(".comparator-selector").removeClass('selected'); var id = event.currentTarget.parentElement.getAttribute('track-id'); - interfaceContext.comparitor.selected = id; + interfaceContext.comparator.selected = id; $(event.currentTarget).addClass('selected'); - for (var i=0; i