comparison test_create/test_core.js @ 2859:d432bf25889b

Finalised test_create UI
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 27 Apr 2017 12:02:28 +0100
parents cffde1e75b2d
children 65b8d9ad75cc
comparison
equal deleted inserted replaced
2858:cffde1e75b2d 2859:d432bf25889b
54 }); 54 });
55 $s.specification = specification; 55 $s.specification = specification;
56 56
57 $s.addPage = function () { 57 $s.addPage = function () {
58 $s.specification.createNewPage(); 58 $s.specification.createNewPage();
59 } 59 };
60 }]); 60 }]);
61 61
62 AngularInterface.controller("introduction", ['$scope', '$element', '$window', function ($s, $e, $w) { 62 AngularInterface.controller("introduction", ['$scope', '$element', '$window', function ($s, $e, $w) {
63 $s.state = 0; 63 $s.state = 0;
64 $s.next = function () { 64 $s.next = function () {
253 position: undefined, 253 position: undefined,
254 text: undefined 254 text: undefined
255 }); 255 });
256 }; 256 };
257 }]); 257 }]);
258 AngularInterface.controller("page", ['$scope', '$element', '$window', function ($s, $e, $w) {}]); 258 AngularInterface.controller("page", ['$scope', '$element', '$window', function ($s, $e, $w) {
259 $s.addInterface = function () {
260 $s.page.addInterface();
261 };
262 $s.removeInterface = function (node) {
263 var index = $s.page.interfaces.findIndex(function (a) {
264 return a == node;
265 });
266 if (index === -1) {
267 throw ("Invalid node");
268 }
269 $s.page.interfaces.splice(index, 1);
270 };
271
272 $s.addCommentQuestion = function () {
273 $s.page.addCommentQuestion();
274 };
275 $s.removeCommentQuestion = function (node) {
276 var index = $s.page.commentQuestions.findIndex(function (a) {
277 return a == node;
278 });
279 if (index === -1) {
280 throw ("Invalid node");
281 }
282 $s.page.commentQuestions.splice(index, 1);
283 };
284 $s.addAudioElement = function () {
285 $s.page.addAudioElement();
286 };
287 $s.removeAudioElement = function (element) {
288 var index = $s.page.audioElements.findIndex(function (a) {
289 return a == element;
290 });
291 if (index === -1) {
292 throw ("Invalid node");
293 }
294 $s.page.audioElements.splice(index, 1);
295 };
296 }]);