changeset 1:5b34e5fed7bb

inactive (non-clickable) boxes in AB (e.g.: for training)
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 22 Apr 2016 02:27:04 +0100
parents d2eb0e6ccaaf
children f1744d5c6407
files core.js interfaces/AB.css interfaces/AB.js
diffstat 3 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Wed Apr 20 16:26:57 2016 +0100
+++ b/core.js	Fri Apr 22 02:27:04 2016 +0100
@@ -305,13 +305,13 @@
 		break;
 		
 		case "AB":
-		interfaceJS.setAttribute("src","interfaces/AB.js");
+		interfaceJS.setAttribute("src","interfaces/AB.js?0");
 		
 		// AB comes with a css file
 		var css = document.createElement('link');
 		css.rel = 'stylesheet';
 		css.type = 'text/css';
-		css.href = 'interfaces/AB.css';
+		css.href = 'interfaces/AB.css?'+Math.random();
 		
 		document.getElementsByTagName("head")[0].appendChild(css);
 		break;
@@ -892,7 +892,12 @@
 		if (this.stateIndex == null) {
 			this.initialise();
 		}
-        storage.update();
+		 $('#box-holders').fadeTo(200, 0.1, function(){
+			 $('#box-holders').fadeTo(200, 1);
+		});
+
+
+		storage.update();
 		if (this.stateIndex == -1) {
 			this.stateIndex++;
 			console.log('Starting test...');
--- a/interfaces/AB.css	Wed Apr 20 16:26:57 2016 +0100
+++ b/interfaces/AB.css	Fri Apr 22 02:27:04 2016 +0100
@@ -52,9 +52,12 @@
 	border: black 1px solid;
 	position: relative;
 	background-color: #FF0000;
-    border-radius: 20px;
+	border-radius: 20px;
 }
 
+div.comparator-selector.inactive{
+	background-color: yellow !important;
+}
 div.disabled {
 	background-color: #AAA;
 }
@@ -87,4 +90,4 @@
     position: absolute;
     top: 10px;
     left: 120px;
-}
\ No newline at end of file
+}
--- a/interfaces/AB.js	Wed Apr 20 16:26:57 2016 +0100
+++ b/interfaces/AB.js	Fri Apr 22 02:27:04 2016 +0100
@@ -329,6 +329,9 @@
 		var node = new this.comparatorBox(audioObject,index,label);
 		audioObject.bindInterface(node);
 		this.comparators.push(node);
+		if(element.inactive===true){
+			node.box.children[0].classList.add('inactive');
+		}
 		this.boxHolders.appendChild(node.box);
 	}
 	return this;
@@ -416,4 +419,4 @@
 	// Get the current <page> information in store (remember to appendChild your data to it)
 	// pageSpecification is the current page node configuration
 	// To create new XML nodes, use storage.document.createElement();
-}
\ No newline at end of file
+}