Mercurial > hg > webaudioevaluationtool
comparison test_create/test_core.js @ 3108:1ae8c03dd6a6
Merge branch 'master' into vnext
# Conflicts:
# test_create.html
# test_create/test_core.js
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Tue, 10 Apr 2018 10:22:34 +0100 |
parents | fc9718756d55 f99b888f57e9 |
children | 3dcdada1058f |
comparison
equal
deleted
inserted
replaced
3106:171706465aa9 | 3108:1ae8c03dd6a6 |
---|---|
113 | 113 |
114 $s.globalSchema = undefined; | 114 $s.globalSchema = undefined; |
115 get("xml/test-schema.xsd").then(function (text) { | 115 get("xml/test-schema.xsd").then(function (text) { |
116 specification.processSchema(text); | 116 specification.processSchema(text); |
117 $s.globalSchema = specification.getSchema(); | 117 $s.globalSchema = specification.getSchema(); |
118 $s.$apply(); | |
118 }); | 119 }); |
119 $s.availableInterfaceModules = []; | 120 $s.availableInterfaceModules = []; |
120 get("interfaces/interfaces.json").then(JSON.parse).then(function (d) { | 121 get("interfaces/interfaces.json").then(JSON.parse).then(function (d) { |
121 $s.availableInterfaceModules = d.interfaces; | 122 $s.availableInterfaceModules = d.interfaces; |
122 $s.$apply(); | 123 $s.$apply(); |
209 $s.selected = undefined; | 210 $s.selected = undefined; |
210 $s.close = function () { | 211 $s.close = function () { |
211 $($e[0]).modal('hide'); | 212 $($e[0]).modal('hide'); |
212 } | 213 } |
213 $s.next = function () { | 214 $s.next = function () { |
214 if (($s.state === 0 && $s.file) || $s.state === 1) { | 215 if (($s.state === 1 && $s.file) || $s.state === 2) { |
215 $s.initialise($s.selected); | 216 $s.initialise($s.selected); |
216 if ($s.selected != "AB" && $s.selected != "ABX") { | 217 if ($s.selected != "AB" && $s.selected != "ABX") { |
217 $s.close(); | 218 $s.close(); |
218 } | 219 } |
219 } else if ($s.state === 2 && $s.audioFragments.length > 0) { | 220 } else if ($s.state === 3 && $s.audioFragments.length > 0) { |
220 // Populate the audio pages by creating a pairwise set of pairs | 221 // Populate the audio pages by creating a pairwise set of pairs |
221 $s.populatePages((function (a) { | 222 $s.populatePages((function (a) { |
222 var b = []; | 223 var b = []; |
223 a.forEach(function (e1, i1, a) { | 224 a.forEach(function (e1, i1, a) { |
224 a.forEach(function (e2, i2) { | 225 a.forEach(function (e2, i2) { |
229 }); | 230 }); |
230 }); | 231 }); |
231 return b; | 232 return b; |
232 })($s.audioFragments)); | 233 })($s.audioFragments)); |
233 $s.close(); | 234 $s.close(); |
234 } else if ($s.state > 2) { | 235 } else if ($s.state > 3) { |
235 $s.close(); | 236 $s.close(); |
236 } | 237 } |
237 $s.state++; | 238 $s.state++; |
238 console.log("Modal state " + $s.state); | 239 console.log("Modal state " + $s.state); |
239 }; | 240 }; |
241 $s.close(); | 242 $s.close(); |
242 } | 243 } |
243 $s.back = function () { | 244 $s.back = function () { |
244 $s.state--; | 245 $s.state--; |
245 }; | 246 }; |
247 | |
248 $s.$watch(function () { | |
249 return ($s.globalSchema !== undefined) | |
250 }, function () { | |
251 if ($s.globalSchema !== undefined && $s.state === 0) { | |
252 $s.state = 1; | |
253 } | |
254 }) | |
255 | |
246 $s.mouseover = function (name) { | 256 $s.mouseover = function (name) { |
247 var obj = $s.testSpecifications.interfaces.find(function (i) { | 257 var obj = $s.testSpecifications.interfaces.find(function (i) { |
248 return i.name == name; | 258 return i.name == name; |
249 }); | 259 }); |
250 if (obj) { | 260 if (obj) { |