# HG changeset patch # User Nicholas Jillings # Date 1493294789 -3600 # Node ID b8795a6452f8b3a0bb0ed8185c9a37a68da166ed # Parent 79258b2a824512f918dd4871f7ed52456af3fccf #94 diff -r 79258b2a8245 -r b8795a6452f8 test_create.html --- a/test_create.html Thu Apr 27 12:57:31 2017 +0100 +++ b/test_create.html Thu Apr 27 13:06:29 2017 +0100 @@ -424,6 +424,7 @@

Page

+
Unique ID: diff -r 79258b2a8245 -r b8795a6452f8 test_create/test_core.js --- a/test_create/test_core.js Thu Apr 27 12:57:31 2017 +0100 +++ b/test_create/test_core.js Thu Apr 27 13:06:29 2017 +0100 @@ -1,4 +1,4 @@ -/* globals document, angular, window, Promise, XMLHttpRequest, Specification, XMLSerializer, Blob, DOMParser*/ +/* globals document, angular, window, Promise, XMLHttpRequest, Specification, XMLSerializer, Blob, DOMParser, FileReader*/ function get(url) { // Return a new promise. return new Promise(function (resolve, reject) { @@ -64,6 +64,16 @@ $s.specification.createNewPage(); }; + $s.removePage = function (page) { + var index = $s.specification.pages.findIndex(function (a) { + return a == page; + }); + if (index === -1) { + throw ("Invalid Page"); + } + $s.specification.pages.splice(index, 1); + }; + $s.exportXML = function () { var s = new XMLSerializer(); var doc = specification.encode(); @@ -130,7 +140,7 @@ var p = new DOMParser(); specification.decode(p.parseFromString(r.result, "text/xml")); $s.$apply(); - } + }; r.readAsText($s.file); }; }]);