comparison test_create/test_core.js @ 2986:f99b888f57e9

Possible fix for #272
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 10 Apr 2018 10:18:25 +0100
parents 1593792ae742
children 1ae8c03dd6a6
comparison
equal deleted inserted replaced
2985:1e5a9d92daa0 2986:f99b888f57e9
83 }; 83 };
84 $s.globalSchema = undefined; 84 $s.globalSchema = undefined;
85 get("xml/test-schema.xsd").then(function (text) { 85 get("xml/test-schema.xsd").then(function (text) {
86 specification.processSchema(text); 86 specification.processSchema(text);
87 $s.globalSchema = specification.getSchema(); 87 $s.globalSchema = specification.getSchema();
88 $s.$apply();
88 }); 89 });
89 $s.availableInterfaceModules = []; 90 $s.availableInterfaceModules = [];
90 get("interfaces/interfaces.json").then(JSON.parse).then(function (d) { 91 get("interfaces/interfaces.json").then(JSON.parse).then(function (d) {
91 $s.availableInterfaceModules = d.interfaces; 92 $s.availableInterfaceModules = d.interfaces;
92 $s.$apply(); 93 $s.$apply();
177 AngularInterface.controller("introduction", ['$scope', '$element', '$window', function ($s, $e, $w) { 178 AngularInterface.controller("introduction", ['$scope', '$element', '$window', function ($s, $e, $w) {
178 $s.state = 0; 179 $s.state = 0;
179 $s.selected = undefined; 180 $s.selected = undefined;
180 $s.next = function () { 181 $s.next = function () {
181 $s.state++; 182 $s.state++;
182 if ($s.state > 1 || $s.file) { 183 if ($s.state > 2 || $s.file) {
183 $s.hidePopup(); 184 $s.hidePopup();
184 $s.initialise($s.selected); 185 $s.initialise($s.selected);
185 } 186 }
186 }; 187 };
187 $s.back = function () { 188 $s.back = function () {
188 $s.state--; 189 $s.state--;
189 }; 190 };
191
192 $s.$watch(function () {
193 return ($s.globalSchema !== undefined)
194 }, function () {
195 if ($s.globalSchema !== undefined && $s.state === 0) {
196 $s.state = 1;
197 }
198 })
199
190 $s.mouseover = function (name) { 200 $s.mouseover = function (name) {
191 var obj = $s.testSpecifications.interfaces.find(function (i) { 201 var obj = $s.testSpecifications.interfaces.find(function (i) {
192 return i.name == name; 202 return i.name == name;
193 }); 203 });
194 if (obj) { 204 if (obj) {
209 } else { 219 } else {
210 $s.setTestPrototype(obj); 220 $s.setTestPrototype(obj);
211 } 221 }
212 }; 222 };
213 $s.select = function (name) { 223 $s.select = function (name) {
214 $s.selected = name; 224 $s.selected = name;
215 } 225 }
216 // Get the test interface specifications 226 // Get the test interface specifications
217 $s.file = undefined; 227 $s.file = undefined;
218 $s.description = ""; 228 $s.description = "";
219 229
220 $s.parseFile = function (f) { 230 $s.parseFile = function (f) {
221 var p = new DOMParser(); 231 var p = new DOMParser();