comparison test_create/test_core.js @ 2885:98209bb0fe87

Small bugfix
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Mon, 26 Jun 2017 12:52:42 +0100
parents 596e83ffc73a
children c70036f28226
comparison
equal deleted inserted replaced
2884:596e83ffc73a 2885:98209bb0fe87
1 /* globals document, angular, window, Promise, XMLHttpRequest, Specification, XMLSerializer, Blob, DOMParser, FileReader*/ 1 /* globals document, angular, window, Promise, XMLHttpRequest, Specification, XMLSerializer, Blob, DOMParser, FileReader, $*/
2 function get(url) { 2 function get(url) {
3 // Return a new promise. 3 // Return a new promise.
4 return new Promise(function (resolve, reject) { 4 return new Promise(function (resolve, reject) {
5 // Do the usual XHR stuff 5 // Do the usual XHR stuff
6 var req = new XMLHttpRequest(); 6 var req = new XMLHttpRequest();
127 if (obj) { 127 if (obj) {
128 $s.description = obj.description.en; 128 $s.description = obj.description.en;
129 } 129 }
130 }; 130 };
131 $s.initialise = function (name) { 131 $s.initialise = function (name) {
132 var obj = $s.interfaces.find(function (i) { 132 var obj = $s.testSpecifications.interfaces.find(function (i) {
133 return i.name == name; 133 return i.name == name;
134 }); 134 });
135 specification.interface = obj.interface; 135 specification.interface = obj.interface;
136 }; 136 };
137 // Get the test interface specifications 137 // Get the test interface specifications
303 $s.useScales = function (scale) { 303 $s.useScales = function (scale) {
304 $s.clearScales(); 304 $s.clearScales();
305 scale.scales.forEach(function (s) { 305 scale.scales.forEach(function (s) {
306 $s.interface.scales.push(s); 306 $s.interface.scales.push(s);
307 }); 307 });
308 $s.selectedScale = "Scale: " + scale.name 308 $s.selectedScale = "Scale: " + scale.name;
309 }; 309 };
310 $s.selectedScale = "Scale: Custom"; 310 $s.selectedScale = "Scale: Custom";
311 }]); 311 }]);
312 AngularInterface.controller("page", ['$scope', '$element', '$window', function ($s, $e, $w) { 312 AngularInterface.controller("page", ['$scope', '$element', '$window', function ($s, $e, $w) {
313 $s.addInterface = function () { 313 $s.addInterface = function () {