comparison core.js @ 1039:db70840ba8bb

Added check type 'scalerange' with min max attributes to enforce use of the scale.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Fri, 19 Jun 2015 16:31:14 +0100
parents c42d2086eec7
children afcb4ed5a26f
comparison
equal deleted inserted replaced
1038:c42d2086eec7 1039:db70840ba8bb
1244 this.commonInterface = new function() { 1244 this.commonInterface = new function() {
1245 this.OptionNode = function(child) { 1245 this.OptionNode = function(child) {
1246 this.type = child.nodeName; 1246 this.type = child.nodeName;
1247 if (this.type == 'check') { 1247 if (this.type == 'check') {
1248 this.check = child.getAttribute('name'); 1248 this.check = child.getAttribute('name');
1249 if (this.check == 'scalerange') {
1250 this.min = child.getAttribute('min');
1251 this.max = child.getAttribute('max');
1252 if (this.min == null) {this.min = 1;}
1253 else if (Number(this.min) > 1 && this.min != null) {
1254 this.min = Number(this.min)/100;
1255 } else {
1256 this.min = Number(this.min);
1257 }
1258 if (this.max == null) {this.max = 0;}
1259 else if (Number(this.max) > 1 && this.max != null) {
1260 this.max = Number(this.max)/100;
1261 } else {
1262 this.max = Number(this.max);
1263 }
1264 }
1249 } else if (this.type == 'anchor' || this.type == 'reference') { 1265 } else if (this.type == 'anchor' || this.type == 'reference') {
1250 this.value = Number(child.textContent); 1266 this.value = Number(child.textContent);
1251 } 1267 }
1252 }; 1268 };
1253 this.options = []; 1269 this.options = [];
1343 this.type = 'audioHolder'; 1359 this.type = 'audioHolder';
1344 this.interfaceNode = function(DOM) { 1360 this.interfaceNode = function(DOM) {
1345 var title = DOM.getElementsByTagName('title'); 1361 var title = DOM.getElementsByTagName('title');
1346 if (title.length == 0) {this.title = null;} 1362 if (title.length == 0) {this.title = null;}
1347 else {this.title = title[0].textContent;} 1363 else {this.title = title[0].textContent;}
1348 1364 this.options = parent.commonInterface.options;
1349 var scale = DOM.getElementsByTagName('scale'); 1365 var scale = DOM.getElementsByTagName('scale');
1350 this.scale = []; 1366 this.scale = [];
1351 for (var i=0; i<scale.length; i++) { 1367 for (var i=0; i<scale.length; i++) {
1352 var arr = [null, null]; 1368 var arr = [null, null];
1353 arr[0] = scale[i].getAttribute('position'); 1369 arr[0] = scale[i].getAttribute('position');