diff --git a/css/3rdparty/webodf/editor.css b/css/3rdparty/webodf/editor.css index 71fea4be..42f64a19 100644 --- a/css/3rdparty/webodf/editor.css +++ b/css/3rdparty/webodf/editor.css @@ -17,7 +17,7 @@ html, body, #mainContainer { #editor { border: none; - box-shadow: 0px 0px 14px black; + box-shadow: 0px 0px 14px #555; overflow: hidden; padding: 0px !important; z-index: 4; @@ -29,8 +29,9 @@ html, body, #mainContainer { #container { text-align: center; - background-color: #FAFAFA; + background-color: #ddd; overflow: auto; + position: absolute; top: 30px; bottom: 0; diff --git a/css/style.css b/css/style.css index 4cc8f8e3..af8f7edf 100755 --- a/css/style.css +++ b/css/style.css @@ -172,16 +172,11 @@ padding-top: 3em !important; } -#editor { - box-shadow: 0px 0px 14px #555 !important; -} - #toolbar { border-bottom: none !important; padding: 6px 0 !important; } #container { - background-color: #ddd !important; top: 38px !important; } diff --git a/js/3rdparty/webodf/editor/Editor.js b/js/3rdparty/webodf/editor/Editor.js index d8a8514d..78add05a 100644 --- a/js/3rdparty/webodf/editor/Editor.js +++ b/js/3rdparty/webodf/editor/Editor.js @@ -285,6 +285,12 @@ define("webodf/editor/Editor", [ }); }; + function setFocusToOdfCanvas() { + if (odfCanvas) { + odfCanvas.getElement().focus(); + } + } + // init function init() { var editorPane, memberListPane, @@ -363,6 +369,7 @@ define("webodf/editor/Editor", [ } tools = new Tools({ + onToolDone: setFocusToOdfCanvas, loadOdtFile: loadOdtFile, saveOdtFile: saveOdtFile, close: close, diff --git a/js/3rdparty/webodf/editor/MemberListView.js b/js/3rdparty/webodf/editor/MemberListView.js index ed6078fa..cbab8ec9 100644 --- a/js/3rdparty/webodf/editor/MemberListView.js +++ b/js/3rdparty/webodf/editor/MemberListView.js @@ -114,11 +114,6 @@ define("webodf/editor/MemberListView", } }; memberListDiv.appendChild(avatarDiv); - - // preset bogus data - // TODO: indicate loading state - // (instead of setting the final 'unknown identity' data) - updateAvatarButton(memberId, null); } /** diff --git a/js/3rdparty/webodf/editor/Tools.js b/js/3rdparty/webodf/editor/Tools.js index 88c32cb5..e88b59a8 100644 --- a/js/3rdparty/webodf/editor/Tools.js +++ b/js/3rdparty/webodf/editor/Tools.js @@ -52,6 +52,7 @@ define("webodf/editor/Tools", [ return function Tools(args) { var translator = document.translator, + onToolDone = args.onToolDone, loadOdtFile = args.loadOdtFile, saveOdtFile = args.saveOdtFile, close = args.close, @@ -106,6 +107,7 @@ define("webodf/editor/Tools", [ onClick: function () { if (editorSession) { editorSession.addAnnotation(); + onToolDone(); } } }); @@ -114,7 +116,7 @@ define("webodf/editor/Tools", [ // Simple Style Selector [B, I, U, S] if (args.directStylingEnabled) { - simpleStyles = new SimpleStyles(function (widget) { + simpleStyles = new SimpleStyles(onToolDone, function (widget) { widget.placeAt(toolbar); widget.startup(); }); @@ -123,7 +125,7 @@ define("webodf/editor/Tools", [ // Paragraph direct alignment buttons if (args.directStylingEnabled) { - paragraphAlignment = new ParagraphAlignment(function (widget) { + paragraphAlignment = new ParagraphAlignment(onToolDone, function (widget) { widget.placeAt(toolbar); widget.startup(); }); @@ -132,7 +134,7 @@ define("webodf/editor/Tools", [ // Paragraph Style Selector - currentStyle = new CurrentStyle(function (widget) { + currentStyle = new CurrentStyle(onToolDone, function (widget) { widget.placeAt(toolbar); widget.startup(); }); diff --git a/js/3rdparty/webodf/editor/widgets/paragraphAlignment.js b/js/3rdparty/webodf/editor/widgets/paragraphAlignment.js index efa4e049..453d60d1 100644 --- a/js/3rdparty/webodf/editor/widgets/paragraphAlignment.js +++ b/js/3rdparty/webodf/editor/widgets/paragraphAlignment.js @@ -42,7 +42,7 @@ define("webodf/editor/widgets/paragraphAlignment", [ function (ToggleButton, Button) { "use strict"; - var ParagraphAlignment = function (callback) { + var ParagraphAlignment = function (onToolDone, callback) { var widget = {}, directParagraphStyler, justifyLeft, @@ -60,6 +60,7 @@ define("webodf/editor/widgets/paragraphAlignment", [ iconClass: "dijitEditorIcon dijitEditorIconJustifyLeft", onChange: function () { directParagraphStyler.alignParagraphLeft(); + onToolDone(); } }); @@ -71,6 +72,7 @@ define("webodf/editor/widgets/paragraphAlignment", [ iconClass: "dijitEditorIcon dijitEditorIconJustifyCenter", onChange: function () { directParagraphStyler.alignParagraphCenter(); + onToolDone(); } }); @@ -82,6 +84,7 @@ define("webodf/editor/widgets/paragraphAlignment", [ iconClass: "dijitEditorIcon dijitEditorIconJustifyRight", onChange: function () { directParagraphStyler.alignParagraphRight(); + onToolDone(); } }); @@ -93,6 +96,7 @@ define("webodf/editor/widgets/paragraphAlignment", [ iconClass: "dijitEditorIcon dijitEditorIconJustifyFull", onChange: function () { directParagraphStyler.alignParagraphJustified(); + onToolDone(); } }); @@ -103,6 +107,7 @@ define("webodf/editor/widgets/paragraphAlignment", [ iconClass: "dijitEditorIcon dijitEditorIconOutdent", onClick: function () { directParagraphStyler.outdent(); + onToolDone(); } }); @@ -113,6 +118,7 @@ define("webodf/editor/widgets/paragraphAlignment", [ iconClass: "dijitEditorIcon dijitEditorIconIndent", onClick: function () { directParagraphStyler.indent(); + onToolDone(); } }); diff --git a/js/3rdparty/webodf/editor/widgets/simpleStyles.js b/js/3rdparty/webodf/editor/widgets/simpleStyles.js index ecb31d30..3afb897c 100644 --- a/js/3rdparty/webodf/editor/widgets/simpleStyles.js +++ b/js/3rdparty/webodf/editor/widgets/simpleStyles.js @@ -43,7 +43,7 @@ define("webodf/editor/widgets/simpleStyles", [ function (FontPicker, ToggleButton, NumberSpinner) { "use strict"; - var SimpleStyles = function(callback) { + var SimpleStyles = function(onToolDone, callback) { var widget = {}, directTextStyler, boldButton, @@ -62,6 +62,7 @@ define("webodf/editor/widgets/simpleStyles", [ iconClass: "dijitEditorIcon dijitEditorIconBold", onChange: function (checked) { directTextStyler.setBold(checked); + onToolDone(); } }); @@ -73,6 +74,7 @@ define("webodf/editor/widgets/simpleStyles", [ iconClass: "dijitEditorIcon dijitEditorIconItalic", onChange: function (checked) { directTextStyler.setItalic(checked); + onToolDone(); } }); @@ -84,6 +86,7 @@ define("webodf/editor/widgets/simpleStyles", [ iconClass: "dijitEditorIcon dijitEditorIconUnderline", onChange: function (checked) { directTextStyler.setHasUnderline(checked); + onToolDone(); } }); @@ -95,6 +98,7 @@ define("webodf/editor/widgets/simpleStyles", [ iconClass: "dijitEditorIcon dijitEditorIconStrikethrough", onChange: function (checked) { directTextStyler.setHasStrikethrough(checked); + onToolDone(); } }); @@ -116,6 +120,7 @@ define("webodf/editor/widgets/simpleStyles", [ fontPickerWidget.setAttribute('disabled', true); fontPickerWidget.onChange = function(value) { directTextStyler.setFontName(value); + onToolDone(); }; widget.children = [boldButton, italicButton, underlineButton, strikethroughButton, fontPickerWidget, fontSizeSpinner]; diff --git a/js/3rdparty/webodf/editor/widgets/toolbarWidgets/currentStyle.js b/js/3rdparty/webodf/editor/widgets/toolbarWidgets/currentStyle.js index 328b159c..7aa7a735 100644 --- a/js/3rdparty/webodf/editor/widgets/toolbarWidgets/currentStyle.js +++ b/js/3rdparty/webodf/editor/widgets/toolbarWidgets/currentStyle.js @@ -41,7 +41,7 @@ define("webodf/editor/widgets/toolbarWidgets/currentStyle", function (EditorSession) { "use strict"; - return function CurrentStyle(callback) { + return function CurrentStyle(onToolDone, callback) { var editorSession, paragraphStyles; @@ -56,6 +56,7 @@ define("webodf/editor/widgets/toolbarWidgets/currentStyle", function setParagraphStyle(value) { if (editorSession) { editorSession.setCurrentParagraphStyle(value); + onToolDone(); } } diff --git a/js/3rdparty/webodf/webodf-debug.js b/js/3rdparty/webodf/webodf-debug.js index 41258d4a..ddd8c63a 100644 --- a/js/3rdparty/webodf/webodf-debug.js +++ b/js/3rdparty/webodf/webodf-debug.js @@ -2993,12 +2993,12 @@ core.Utils = function Utils() { } this.hashString = hashString; function mergeObjects(destination, source) { - if(Array.isArray(source)) { + if(source && Array.isArray(source)) { destination = (destination || []).concat(source.map(function(obj) { return mergeObjects({}, obj) })) }else { - if(typeof source === "object") { + if(source && typeof source === "object") { destination = destination || {}; Object.keys(source).forEach(function(p) { destination[p] = mergeObjects(destination[p], source[p]) @@ -3340,6 +3340,17 @@ core.UnitTest.cleanupTestAreaDiv = function() { runtime.assert(!!testarea && testarea.parentNode === maindoc.body, 'Test environment broken, found no div with id "testarea" below body.'); maindoc.body.removeChild(testarea) }; +core.UnitTest.createOdtDocument = function(xml, namespaceMap) { + var xmlDoc = ""; + xmlDoc += "d?a+=String.fromCharCode(d):(e+=1,c=b[e],194<=d&&224>d?a+=String.fromCharCode((d&31)<<6|c&63):(e+=1,k=b[e],224<=d&&240>d?a+=String.fromCharCode((d&15)<<12|(c&63)<<6|k&63):(e+=1,p=b[e],240<=d&&245>d&&(d=(d&7)<<18|(c&63)<<12|(k&63)<<6|p&63,d-=65536,a+=String.fromCharCode((d>>10)+55296,(d&1023)+56320))))); -return a}var b;"utf8"===m?b=c(l):("binary"!==m&&this.log("Unsupported encoding: "+m),b=g(l));return b};Runtime.getVariable=function(l){try{return eval(l)}catch(m){}};Runtime.toJson=function(l){return JSON.stringify(l)};Runtime.fromJson=function(l){return JSON.parse(l)};Runtime.getFunctionName=function(l){return void 0===l.name?(l=/function\s+(\w+)/.exec(l))&&l[1]:l.name}; -function BrowserRuntime(l){function m(a,e){var f,d,b;void 0!==e?b=a:e=a;l?(d=l.ownerDocument,b&&(f=d.createElement("span"),f.className=b,f.appendChild(d.createTextNode(b)),l.appendChild(f),l.appendChild(d.createTextNode(" "))),f=d.createElement("span"),0k?(d[p]=k,p+=1):2048>k?(d[p]=192|k>>>6,d[p+1]=128|k&63,p+=2):(d[p]=224|k>>>12&15,d[p+1]=128|k>>>6&63,d[p+2]=128|k&63,p+=3)}else for("binary"!== -e&&c.log("unknown encoding: "+e),f=a.length,d=new c.ByteArray(f),b=0;bd.status||0===d.status?f(null):f("Status "+String(d.status)+": "+d.responseText|| -d.statusText):f("File "+a+" is empty."))};e=e.buffer&&!d.sendAsBinary?e.buffer:c.byteArrayToString(e,"binary");try{d.sendAsBinary?d.sendAsBinary(e):d.send(e)}catch(g){c.log("HUH? "+g+" "+e),f(g.message)}};this.deleteFile=function(a,e){delete b[a];var f=new XMLHttpRequest;f.open("DELETE",a,!0);f.onreadystatechange=function(){4===f.readyState&&(200>f.status&&300<=f.status?e(f.responseText):e(null))};f.send(null)};this.loadXML=function(a,e){var f=new XMLHttpRequest;f.open("GET",a,!0);f.overrideMimeType&& -f.overrideMimeType("text/xml");f.onreadystatechange=function(){4===f.readyState&&(0!==f.status||f.responseText?200===f.status||0===f.status?e(null,f.responseXML):e(f.responseText):e("File "+a+" is empty."))};try{f.send(null)}catch(d){e(d.message)}};this.isFile=function(a,e){c.getFileSize(a,function(a){e(-1!==a)})};this.getFileSize=function(a,e){var f=new XMLHttpRequest;f.open("HEAD",a,!0);f.onreadystatechange=function(){if(4===f.readyState){var d=f.getResponseHeader("Content-Length");d?e(parseInt(d, -10)):g(a,"binary",function(d,k){d?e(-1):e(k.length)})}};f.send(null)};this.log=m;this.assert=function(a,e,f){if(!a)throw m("alert","ASSERTION FAILED:\n"+e),f&&f(),e;};this.setTimeout=function(a,e){return setTimeout(function(){a()},e)};this.clearTimeout=function(a){clearTimeout(a)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(a){return(new DOMParser).parseFromString(a, +Runtime.prototype.read=function(l,m,e,c){};Runtime.prototype.readFile=function(l,m,e){};Runtime.prototype.readFileSync=function(l,m){};Runtime.prototype.loadXML=function(l,m){};Runtime.prototype.writeFile=function(l,m,e){};Runtime.prototype.isFile=function(l,m){};Runtime.prototype.getFileSize=function(l,m){};Runtime.prototype.deleteFile=function(l,m){};Runtime.prototype.log=function(l,m){};Runtime.prototype.setTimeout=function(l,m){};Runtime.prototype.clearTimeout=function(l){}; +Runtime.prototype.libraryPaths=function(){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.parseXML=function(l){};Runtime.prototype.getWindow=function(){};Runtime.prototype.assert=function(l,m,e){};var IS_COMPILED_CODE=!0; +Runtime.byteArrayToString=function(l,m){function e(b){var a="",h,f=b.length;for(h=0;hd?a+=String.fromCharCode(d):(h+=1,c=b[h],194<=d&&224>d?a+=String.fromCharCode((d&31)<<6|c&63):(h+=1,k=b[h],224<=d&&240>d?a+=String.fromCharCode((d&15)<<12|(c&63)<<6|k&63):(h+=1,q=b[h],240<=d&&245>d&&(d=(d&7)<<18|(c&63)<<12|(k&63)<<6|q&63,d-=65536,a+=String.fromCharCode((d>>10)+55296,(d&1023)+56320))))); +return a}var b;"utf8"===m?b=c(l):("binary"!==m&&this.log("Unsupported encoding: "+m),b=e(l));return b};Runtime.getVariable=function(l){try{return eval(l)}catch(m){}};Runtime.toJson=function(l){return JSON.stringify(l)};Runtime.fromJson=function(l){return JSON.parse(l)};Runtime.getFunctionName=function(l){return void 0===l.name?(l=/function\s+(\w+)/.exec(l))&&l[1]:l.name}; +function BrowserRuntime(l){function m(a,h){var f,d,b;void 0!==h?b=a:h=a;l?(d=l.ownerDocument,b&&(f=d.createElement("span"),f.className=b,f.appendChild(d.createTextNode(b)),l.appendChild(f),l.appendChild(d.createTextNode(" "))),f=d.createElement("span"),0k?(d[e]=k,e+=1):2048>k?(d[e]=192|k>>>6,d[e+1]=128|k&63,e+=2):(d[e]=224|k>>>12&15,d[e+1]=128|k>>>6&63,d[e+2]=128|k&63,e+=3)}else for("binary"!== +h&&c.log("unknown encoding: "+h),f=a.length,d=new c.ByteArray(f),b=0;bd.status||0===d.status?f(null):f("Status "+String(d.status)+": "+d.responseText|| +d.statusText):f("File "+a+" is empty."))};h=h.buffer&&!d.sendAsBinary?h.buffer:c.byteArrayToString(h,"binary");try{d.sendAsBinary?d.sendAsBinary(h):d.send(h)}catch(e){c.log("HUH? "+e+" "+h),f(e.message)}};this.deleteFile=function(a,h){delete b[a];var f=new XMLHttpRequest;f.open("DELETE",a,!0);f.onreadystatechange=function(){4===f.readyState&&(200>f.status&&300<=f.status?h(f.responseText):h(null))};f.send(null)};this.loadXML=function(a,h){var f=new XMLHttpRequest;f.open("GET",a,!0);f.overrideMimeType&& +f.overrideMimeType("text/xml");f.onreadystatechange=function(){4===f.readyState&&(0!==f.status||f.responseText?200===f.status||0===f.status?h(null,f.responseXML):h(f.responseText):h("File "+a+" is empty."))};try{f.send(null)}catch(d){h(d.message)}};this.isFile=function(a,h){c.getFileSize(a,function(a){h(-1!==a)})};this.getFileSize=function(a,h){var f=new XMLHttpRequest;f.open("HEAD",a,!0);f.onreadystatechange=function(){if(4===f.readyState){var d=f.getResponseHeader("Content-Length");d?h(parseInt(d, +10)):e(a,"binary",function(d,k){d?h(-1):h(k.length)})}};f.send(null)};this.log=m;this.assert=function(a,h,f){if(!a)throw m("alert","ASSERTION FAILED:\n"+h),f&&f(),h;};this.setTimeout=function(a,h){return setTimeout(function(){a()},h)};this.clearTimeout=function(a){clearTimeout(a)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(a){return(new DOMParser).parseFromString(a, "text/xml")};this.exit=function(a){m("Calling exit with code "+String(a)+", but exit() is not implemented.")};this.getWindow=function(){return window}} -function NodeJSRuntime(){function l(e,a,d){e=c.resolve(b,e);"binary"!==a?g.readFile(e,a,d):g.readFile(e,null,d)}var m=this,g=require("fs"),c=require("path"),b="",n,a;this.ByteArray=function(e){return new Buffer(e)};this.byteArrayFromArray=function(e){var a=new Buffer(e.length),d,b=e.length;for(d=0;d").implementation} -function RhinoRuntime(){function l(a,b){var f;void 0!==b?f=a:b=a;"alert"===f&&print("\n!!!!! ALERT !!!!!");print(b);"alert"===f&&print("!!!!! ALERT !!!!!")}var m=this,g=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),c,b,n="";g.setValidating(!1);g.setNamespaceAware(!0);g.setExpandEntityReferences(!1);g.setSchema(null);b=Packages.org.xml.sax.EntityResolver({resolveEntity:function(a,b){var f=new Packages.java.io.FileReader(b);return new Packages.org.xml.sax.InputSource(f)}});c=g.newDocumentBuilder(); -c.setEntityResolver(b);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=function(a,b){var f=[],d,c=a.length;for(d=0;d>>18],b+=q[d>>>12&63],b+=q[d>>>6&63],b+=q[d&63];k===h+1?(d=a[k]<<4,b+=q[d>>>6],b+=q[d&63],b+="=="):k===h&&(d=a[k]<<10|a[k+1]<<2,b+=q[d>>>12],b+=q[d>>>6&63],b+=q[d&63],b+="=");return b}function g(a){a=a.replace(/[^A-Za-z0-9+\/]+/g,"");var d=[],b=a.length%4,k,h=a.length,e;for(k=0;k>16,e>>8&255,e&255);d.length-=[0,0,2,1][b];return d}function c(a){var d=[],b,k=a.length,h;for(b=0;bh?d.push(h):2048>h?d.push(192|h>>>6,128|h&63):d.push(224|h>>>12&15,128|h>>>6&63,128|h&63);return d}function b(a){var d=[],b,k=a.length,h,e,f;for(b=0;bh?d.push(h):(b+=1,e=a[b],224>h?d.push((h&31)<<6|e&63):(b+=1,f=a[b],d.push((h&15)<<12|(e&63)<<6|f&63)));return d}function n(a){return m(l(a))} -function a(a){return String.fromCharCode.apply(String,g(a))}function e(a){return b(l(a))}function f(a){a=b(a);for(var d="",k=0;kd?k+=String.fromCharCode(d):(f+=1,h=a.charCodeAt(f)&255,224>d?k+=String.fromCharCode((d&31)<<6|h&63):(f+=1,e=a.charCodeAt(f)&255,k+=String.fromCharCode((d&15)<<12|(h&63)<<6|e&63)));return k}function t(a,b){function k(){var c= -f+h;c>a.length&&(c=a.length);e+=d(a,f,c);f=c;c=f===a.length;b(e,c)&&!c&&runtime.setTimeout(k,0)}var h=1E5,e="",f=0;a.length>>18],b+=p[d>>>12&63],b+=p[d>>>6&63],b+=p[d&63];k===g+1?(d=a[k]<<4,b+=p[d>>>6],b+=p[d&63],b+="=="):k===g&&(d=a[k]<<10|a[k+1]<<2,b+=p[d>>>12],b+=p[d>>>6&63],b+=p[d&63],b+="=");return b}function e(a){a=a.replace(/[^A-Za-z0-9+\/]+/g,"");var d=[],b=a.length%4,k,g=a.length,h;for(k=0;k>16,h>>8&255,h&255);d.length-=[0,0,2,1][b];return d}function c(a){var d=[],b,k=a.length,g;for(b=0;bg?d.push(g):2048>g?d.push(192|g>>>6,128|g&63):d.push(224|g>>>12&15,128|g>>>6&63,128|g&63);return d}function b(a){var d=[],b,k=a.length,g,h,f;for(b=0;bg?d.push(g):(b+=1,h=a[b],224>g?d.push((g&31)<<6|h&63):(b+=1,f=a[b],d.push((g&15)<<12|(h&63)<<6|f&63)));return d}function n(a){return m(l(a))} +function a(a){return String.fromCharCode.apply(String,e(a))}function h(a){return b(l(a))}function f(a){a=b(a);for(var d="",k=0;kd?k+=String.fromCharCode(d):(f+=1,g=a.charCodeAt(f)&255,224>d?k+=String.fromCharCode((d&31)<<6|g&63):(f+=1,h=a.charCodeAt(f)&255,k+=String.fromCharCode((d&15)<<12|(g&63)<<6|h&63)));return k}function t(a,b){function k(){var c= +f+g;c>a.length&&(c=a.length);h+=d(a,f,c);f=c;c=f===a.length;b(h,c)&&!c&&runtime.setTimeout(k,0)}var g=1E5,h="",f=0;a.length>>8):(ia(a&255),ia(a>>>8))},V=function(){v=(v<<5^h[B+3-1]&255)&8191;r=w[32768+v];w[B&32767]=r;w[32768+v]=B},Y=function(a,d){A>16-d?(u|=a<>16-A,A+=d-16):(u|=a<a;a++)h[a]=h[a+32768];M-=32768;B-=32768;y-=32768;for(a=0;8192>a;a++)d=w[32768+a],w[32768+a]=32768<=d?d-32768:0;for(a=0;32768>a;a++)d=w[a],w[a]=32768<=d?d-32768:0;b+=32768}F||(a=Ba(h,B+K,b),0>=a?F=!0:K+=a)},Ca=function(a){var d=ea,b=B,k,e=L,f=32506=qa&&(d>>=2);do if(k=a,h[k+e]===q&&h[k+e-1]===r&&h[k]===h[b]&&h[++k]===h[b+1]){b+=2;k++;do++b;while(h[b]=== -h[++k]&&h[++b]===h[++k]&&h[++b]===h[++k]&&h[++b]===h[++k]&&h[++b]===h[++k]&&h[++b]===h[++k]&&h[++b]===h[++k]&&h[++b]===h[++k]&&be){M=a;e=k;if(258<=k)break;r=h[b+e-1];q=h[b+e]}a=w[a&32767]}while(a>f&&0!==--d);return e},va=function(a,d){s[U++]=d;0===a?Z[d].fc++:(a--,Z[ca[d]+256+1].fc++,$[(256>a?ja[a]:ja[256+(a>>7)])&255].fc++,q[na++]=a,x|=la);la<<=1;0===(U&7)&&(ka[X++]=x,x=0,la=1);if(2h;h++)b+=$[h].fc*(5+ha[h]);b>>=3;if(na< -parseInt(U/2,10)&&b>=1,b<<=1;while(0<--d);return b>>1},Ea=function(a,d){var b=[];b.length=16;var k=0,h;for(h=1;15>=h;h++)k=k+J[h-1]<<1,b[h]=k;for(k=0;k<=d;k++)h=a[k].dl,0!==h&&(a[k].fc=Da(b[h]++,h))},za=function(a){var d=a.dyn_tree,b=a.static_tree,k=a.elems,h,e=-1,f=k;ba=0;fa=573;for(h= -0;hba;)h=R[++ba]=2>e?++e:0,d[h].fc=1,P[h]=0,T--,null!==b&&(oa-=b[h].dl);a.max_code=e;for(h=ba>>1;1<=h;h--)ya(d,h);do h=R[1],R[1]=R[ba--],ya(d,1),b=R[1],R[--fa]=h,R[--fa]=b,d[f].fc=d[h].fc+d[b].fc,P[f]=P[h]>P[b]+1?P[h]:P[b]+1,d[h].dl=d[b].dl=f,R[1]=f++,ya(d,1);while(2<=ba);R[--fa]=R[1];f=a.dyn_tree;h=a.extra_bits;var k=a.extra_base,b=a.max_code,c=a.max_length,r=a.static_tree,q,g,p,n,s=0;for(g=0;15>=g;g++)J[g]=0;f[R[fa]].dl=0;for(a=fa+1;573>a;a++)q= -R[a],g=f[f[q].dl].dl+1,g>c&&(g=c,s++),f[q].dl=g,q>b||(J[g]++,p=0,q>=k&&(p=h[q-k]),n=f[q].fc,T+=n*(g+p),null!==r&&(oa+=n*(r[q].dl+p)));if(0!==s){do{for(g=c-1;0===J[g];)g--;J[g]--;J[g+1]+=2;J[c]--;s-=2}while(0b||(f[h].dl!==g&&(T+=(g-f[h].dl)*f[h].fc,f[h].fc=g),q--)}Ea(d,e)},Fa=function(a,d){var b,k=-1,h,e=a[0].dl,f=0,c=7,r=4;0===e&&(c=138,r=3);a[d+1].dl=65535;for(b=0;b<=d;b++)h=e,e=a[b+1].dl,++f=f?S[17].fc++:S[18].fc++,f=0,k=h,0===e?(c=138,r=3):h===e?(c=6,r=3):(c=7,r=4))},Ga=function(){8b?ja[b]:ja[256+(b>>7)])&255,ga(c,d),r=ha[c],0!==r&&(b-=ma[c],Y(b,r))),f>>=1;while(k=f?(ga(17,S),Y(f-3,3)):(ga(18,S),Y(f-11,7));f=0;k=h;0===e?(c=138,r=3):h===e?(c=6,r=3):(c=7,r=4)}},Ja=function(){var a;for(a=0;286>a;a++)Z[a].fc=0;for(a=0;30>a;a++)$[a].fc=0;for(a=0;19>a;a++)S[a].fc=0;Z[256].fc=1;x=U=na=X=T=oa=0;la=1},wa=function(a){var d,b,k,e;e=B-y;ka[X]=x;za(O);za(H);Fa(Z,O.max_code);Fa($,H.max_code);za(I);for(k=18;3<=k&&0===S[ua[k]].dl;k--);T+=3*(k+1)+14;d=T+3+7>>3;b= -oa+3+7>>3;b<=d&&(d=b);if(e+4<=d&&0<=y)for(Y(0+a,3),Ga(),da(e),da(~e),k=0;ka.len&&(c=a.len);for(r=0;rt-k&&(c= -t-k);for(r=0;rq;q++)for(E[q]=g,c=0;c<1<q;q++)for(ma[q]=g,c=0;c<1<>=7;30>q;q++)for(ma[q]=g<<7,c=0;c<1<=c;c++)J[c]=0;for(c=0;143>=c;)Q[c++].dl=8,J[8]++;for(;255>=c;)Q[c++].dl=9,J[9]++;for(;279>=c;)Q[c++].dl=7,J[7]++;for(;287>=c;)Q[c++].dl=8,J[8]++;Ea(Q,287);for(c=0;30>c;c++)W[c].dl=5,W[c].fc=Da(c,5);Ja()}for(c=0;8192>c;c++)w[32768+c]=0;pa=aa[N].max_lazy;qa=aa[N].good_length;ea=aa[N].max_chain;y=B=0;K=Ba(h,0,65536);if(0>=K)F=!0,K=0;else{for(F=!1;262> -K&&!F;)xa();for(c=v=0;2>c;c++)v=(v<<5^h[c]&255)&8191}a=null;k=t=0;3>=N?(L=2,C=0):(C=2,G=0);p=!1}f=!0;if(0===K)return p=!0,0}c=Ka(b,d,e);if(c===e)return e;if(p)return c;if(3>=N)for(;0!==K&&null===a;){V();0!==r&&32506>=B-r&&(C=Ca(r),C>K&&(C=K));if(3<=C)if(q=va(B-M,C-3),K-=C,C<=pa){C--;do B++,V();while(0!==--C);B++}else B+=C,C=0,v=h[B]&255,v=(v<<5^h[B+1]&255)&8191;else q=va(0,h[B]&255),K--,B++;q&&(wa(0),y=B);for(;262>K&&!F;)xa()}else for(;0!==K&&null===a;){V();L=C;z=M;C=2;0!==r&&(L=B-r)&& -(C=Ca(r),C>K&&(C=K),3===C&&4096K&&!F;)xa()}0===K&&(0!==G&&va(0,h[B-1]&255),wa(1),p=!0);return c+Ka(b,c+d,e-c)};this.deflate=function(k,c){var r,g;ta=k;D=0;"undefined"===String(typeof c)&&(c=6);(r=c)?1>r?r=1:9r;r++)Z[r]=new l;$=[];$.length=61;for(r=0;61>r;r++)$[r]=new l;Q=[];Q.length=288;for(r=0;288>r;r++)Q[r]=new l;W=[];W.length=30;for(r=0;30>r;r++)W[r]=new l;S=[];S.length=39;for(r=0;39>r;r++)S[r]=new l;O=new m;H=new m;I=new m;J=[];J.length=16;R=[];R.length=573;P=[];P.length=573;ca=[];ca.length=256;ja=[];ja.length=512;E=[];E.length=29;ma=[];ma.length=30;ka=[];ka.length=1024}var p=Array(1024),u=[],t=[];for(r=La(p,0,p.length);0>>8):(ia(a&255),ia(a>>>8))},V=function(){v=(v<<5^g[B+3-1]&255)&8191;s=w[32768+v];w[B&32767]=s;w[32768+v]=B},X=function(a,d){z>16-d?(u|=a<>16-z,z+=d-16):(u|=a<a;a++)g[a]=g[a+32768];L-=32768;B-=32768;y-=32768;for(a=0;8192>a;a++)d=w[32768+a],w[32768+a]=32768<=d?d-32768:0;for(a=0;32768>a;a++)d=w[a],w[a]=32768<=d?d-32768:0;b+=32768}C||(a=Ba(g,B+K,b),0>=a?C=!0:K+=a)},Ca=function(a){var d=ea,b=B,k,h=N,f=32506=qa&&(d>>=2);do if(k=a,g[k+h]===p&&g[k+h-1]===e&&g[k]===g[b]&&g[++k]===g[b+1]){b+=2;k++;do++b;while(g[b]=== +g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&bh){L=a;h=k;if(258<=k)break;e=g[b+h-1];p=g[b+h]}a=w[a&32767]}while(a>f&&0!==--d);return h},va=function(a,d){r[U++]=d;0===a?Y[d].fc++:(a--,Y[ba[d]+256+1].fc++,Z[(256>a?ja[a]:ja[256+(a>>7)])&255].fc++,p[na++]=a,x|=la);la<<=1;0===(U&7)&&(ka[W++]=x,x=0,la=1);if(2g;g++)b+=Z[g].fc*(5+ha[g]);b>>=3;if(na< +parseInt(U/2,10)&&b>=1,b<<=1;while(0<--d);return b>>1},Ea=function(a,d){var b=[];b.length=16;var k=0,g;for(g=1;15>=g;g++)k=k+H[g-1]<<1,b[g]=k;for(k=0;k<=d;k++)g=a[k].dl,0!==g&&(a[k].fc=Da(b[g]++,g))},za=function(a){var d=a.dyn_tree,b=a.static_tree,k=a.elems,g,h=-1,f=k;ca=0;fa=573;for(g= +0;gca;)g=R[++ca]=2>h?++h:0,d[g].fc=1,O[g]=0,S--,null!==b&&(oa-=b[g].dl);a.max_code=h;for(g=ca>>1;1<=g;g--)ya(d,g);do g=R[1],R[1]=R[ca--],ya(d,1),b=R[1],R[--fa]=g,R[--fa]=b,d[f].fc=d[g].fc+d[b].fc,O[f]=O[g]>O[b]+1?O[g]:O[b]+1,d[g].dl=d[b].dl=f,R[1]=f++,ya(d,1);while(2<=ca);R[--fa]=R[1];f=a.dyn_tree;g=a.extra_bits;var k=a.extra_base,b=a.max_code,c=a.max_length,e=a.static_tree,p,s,q,n,r=0;for(s=0;15>=s;s++)H[s]=0;f[R[fa]].dl=0;for(a=fa+1;573>a;a++)p= +R[a],s=f[f[p].dl].dl+1,s>c&&(s=c,r++),f[p].dl=s,p>b||(H[s]++,q=0,p>=k&&(q=g[p-k]),n=f[p].fc,S+=n*(s+q),null!==e&&(oa+=n*(e[p].dl+q)));if(0!==r){do{for(s=c-1;0===H[s];)s--;H[s]--;H[s+1]+=2;H[c]--;r-=2}while(0b||(f[g].dl!==s&&(S+=(s-f[g].dl)*f[g].fc,f[g].fc=s),p--)}Ea(d,h)},Fa=function(a,d){var b,k=-1,g,h=a[0].dl,f=0,c=7,e=4;0===h&&(c=138,e=3);a[d+1].dl=65535;for(b=0;b<=d;b++)g=h,h=a[b+1].dl,++f=f?T[17].fc++:T[18].fc++,f=0,k=g,0===h?(c=138,e=3):g===h?(c=6,e=3):(c=7,e=4))},Ga=function(){8b?ja[b]:ja[256+(b>>7)])&255,ga(c,d),e=ha[c],0!==e&&(b-=ma[c],X(b,e))),f>>=1;while(k=f?(ga(17,T),X(f-3,3)):(ga(18,T),X(f-11,7));f=0;k=g;0===h?(c=138,e=3):g===h?(c=6,e=3):(c=7,e=4)}},Ja=function(){var a;for(a=0;286>a;a++)Y[a].fc=0;for(a=0;30>a;a++)Z[a].fc=0;for(a=0;19>a;a++)T[a].fc=0;Y[256].fc=1;x=U=na=W=S=oa=0;la=1},wa=function(a){var d,b,k,h;h=B-y;ka[W]=x;za(P);za(J);Fa(Y,P.max_code);Fa(Z,J.max_code);za(G);for(k=18;3<=k&&0===T[ua[k]].dl;k--);S+=3*(k+1)+14;d=S+3+7>>3;b= +oa+3+7>>3;b<=d&&(d=b);if(h+4<=d&&0<=y)for(X(0+a,3),Ga(),da(h),da(~h),k=0;ka.len&&(c=a.len);for(e=0;et-k&&(c= +t-k);for(e=0;ep;p++)for(F[p]=e,c=0;c<1<p;p++)for(ma[p]=e,c=0;c<1<>=7;30>p;p++)for(ma[p]=e<<7,c=0;c<1<=c;c++)H[c]=0;for(c=0;143>=c;)Q[c++].dl=8,H[8]++;for(;255>=c;)Q[c++].dl=9,H[9]++;for(;279>=c;)Q[c++].dl=7,H[7]++;for(;287>=c;)Q[c++].dl=8,H[8]++;Ea(Q,287);for(c=0;30>c;c++)$[c].dl=5,$[c].fc=Da(c,5);Ja()}for(c=0;8192>c;c++)w[32768+c]=0;pa=aa[M].max_lazy;qa=aa[M].good_length;ea=aa[M].max_chain;y=B=0;K=Ba(g,0,65536);if(0>=K)C=!0,K=0;else{for(C=!1;262> +K&&!C;)xa();for(c=v=0;2>c;c++)v=(v<<5^g[c]&255)&8191}a=null;k=t=0;3>=M?(N=2,D=0):(D=2,I=0);q=!1}f=!0;if(0===K)return q=!0,0}c=Ka(b,d,h);if(c===h)return h;if(q)return c;if(3>=M)for(;0!==K&&null===a;){V();0!==s&&32506>=B-s&&(D=Ca(s),D>K&&(D=K));if(3<=D)if(p=va(B-L,D-3),K-=D,D<=pa){D--;do B++,V();while(0!==--D);B++}else B+=D,D=0,v=g[B]&255,v=(v<<5^g[B+1]&255)&8191;else p=va(0,g[B]&255),K--,B++;p&&(wa(0),y=B);for(;262>K&&!C;)xa()}else for(;0!==K&&null===a;){V();N=D;A=L;D=2;0!==s&&(N=B-s)&& +(D=Ca(s),D>K&&(D=K),3===D&&4096K&&!C;)xa()}0===K&&(0!==I&&va(0,g[B-1]&255),wa(1),q=!0);return c+Ka(b,c+d,h-c)};this.deflate=function(k,c){var e,s;ta=k;E=0;"undefined"===String(typeof c)&&(c=6);(e=c)?1>e?e=1:9e;e++)Y[e]=new l;Z=[];Z.length=61;for(e=0;61>e;e++)Z[e]=new l;Q=[];Q.length=288;for(e=0;288>e;e++)Q[e]=new l;$=[];$.length=30;for(e=0;30>e;e++)$[e]=new l;T=[];T.length=39;for(e=0;39>e;e++)T[e]=new l;P=new m;J=new m;G=new m;H=[];H.length=16;R=[];R.length=573;O=[];O.length=573;ba=[];ba.length=256;ja=[];ja.length=512;F=[];F.length=29;ma=[];ma.length=30;ka=[];ka.length=1024}var q=Array(1024),u=[],t=[];for(e=La(q,0,q.length);0>8&255])};this.appendUInt32LE=function(c){m.appendArray([c&255,c>>8&255,c>>16&255,c>>24&255])};this.appendString=function(c){g=runtime.concatByteArrays(g, -runtime.byteArrayFromString(c,l))};this.getLength=function(){return g.length};this.getByteArray=function(){return g}}; +core.ByteArrayWriter=function(l){var m=this,e=new runtime.ByteArray(0);this.appendByteArrayWriter=function(c){e=runtime.concatByteArrays(e,c.getByteArray())};this.appendByteArray=function(c){e=runtime.concatByteArrays(e,c)};this.appendArray=function(c){e=runtime.concatByteArrays(e,runtime.byteArrayFromArray(c))};this.appendUInt16LE=function(c){m.appendArray([c&255,c>>8&255])};this.appendUInt32LE=function(c){m.appendArray([c&255,c>>8&255,c>>16&255,c>>24&255])};this.appendString=function(c){e=runtime.concatByteArrays(e, +runtime.byteArrayFromString(c,l))};this.getLength=function(){return e.length};this.getByteArray=function(){return e}}; // Input 6 -core.RawInflate=function(){var l,m,g=null,c,b,n,a,e,f,d,t,k,p,h,q,s,w,u=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],A=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],v=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],r=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],z=[16,17,18, -0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=function(){this.list=this.next=null},C=function(){this.n=this.b=this.e=0;this.t=null},L=function(a,b,d,k,h,c){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var e=Array(this.BMAX+1),f,r,q,g,p,n,s,m=Array(this.BMAX+1),l,w,u,t=new C,v=Array(this.BMAX);g=Array(this.N_MAX);var y,A=Array(this.BMAX+1),z,B,M;M=this.root=null;for(p=0;pp&&(c=p);for(z=1<(z-=e[n])){this.status=2;this.m=c;return}if(0>(z-=e[p]))this.status=2,this.m=c;else{e[p]+=z;A[1]=n=0;l=e;w=1;for(u=2;0<--p;)A[u++]=n+=l[w++];l=a;p=w=0;do 0!=(n=l[w++])&&(g[A[n]++]=p);while(++py+m[1+g];){y+=m[1+g];g++;B=(B=q-y)>c?c:B;if((r=1<<(n=s-y))>a+1)for(r-=a+1,u=s;++nf&&y>y-m[g],v[g-1][n].e=t.e,v[g-1][n].b=t.b,v[g-1][n].n=t.n,v[g-1][n].t=t.t)}t.b=s-y;w>=b?t.e=99:l[w]l[w]?16:15,t.n=l[w++]): -(t.e=h[l[w]-d],t.n=k[l[w++]-d]);r=1<>y;n>=1)p^=n;for(p^=n;(p&(1<>=b;a-=b},K=function(a,b,c){var f,r,g;if(0==c)return 0;for(g=0;;){B(h);r=k.list[M(h)];for(f=r.e;16 -c;c++)m[z[c]]=0;h=7;c=new L(m,19,19,null,null,h);if(0!=c.status)return-1;k=c.root;h=c.m;g=s+l;for(f=e=0;fc)m[f++]=e=c;else if(16==c){B(2);c=3+M(2);F(2);if(f+c>g)return-1;for(;0g)return-1;for(;0H;H++)O[H]=8;for(;256>H;H++)O[H]=9;for(;280>H;H++)O[H]=7;for(;288>H;H++)O[H]=8;b=7;H=new L(O,288,257,A,y,b);if(0!=H.status){alert("HufBuild error: "+H.status);Q=-1;break b}g=H.root;b=H.m;for(H=0;30>H;H++)O[H]=5;ea=5;H=new L(O,30,0,v,r,ea);if(1q&&(c=q);for(A=1<(A-=h[n])){this.status=2;this.m=c;return}if(0>(A-=h[q]))this.status=2,this.m=c;else{h[q]+=A;z[1]=n=0;l=h;w=1;for(u=2;0<--q;)z[u++]=n+=l[w++];l=a;q=w=0;do 0!=(n=l[w++])&&(s[z[n]++]=q);while(++qv+m[1+s];){v+=m[1+s];s++;B=(B=p-v)>c?c:B;if((e=1<<(n=r-v))>a+1)for(e-=a+1,u=r;++nf&&v>v-m[s],y[s-1][n].e=t.e,y[s-1][n].b=t.b,y[s-1][n].n=t.n,y[s-1][n].t=t.t)}t.b=r-v;w>=b?t.e=99:l[w]l[w]?16:15,t.n=l[w++]): +(t.e=g[l[w]-d],t.n=k[l[w++]-d]);e=1<>v;n>=1)q^=n;for(q^=n;(q&(1<>=b;a-=b},K=function(a,b,c){var f,e,s;if(0==c)return 0;for(s=0;;){B(g);e=k.list[L(g)];for(f=e.e;16 +f;f++)m[A[f]]=0;g=7;f=new N(m,19,19,null,null,g);if(0!=f.status)return-1;k=f.root;g=f.m;e=r+l;for(c=h=0;cf)m[c++]=h=f;else if(16==f){B(2);f=3+L(2);C(2);if(c+f>e)return-1;for(;0e)return-1;for(;0J;J++)P[J]=8;for(;256>J;J++)P[J]=9;for(;280>J;J++)P[J]=7;for(;288>J;J++)P[J]=8;b=7;J=new N(P,288,257,z,y,b);if(0!=J.status){alert("HufBuild error: "+J.status);Q=-1;break b}e=J.root;b=J.m;for(J=0;30>J;J++)P[J]=5;ea=5;J=new N(P,30,0,v,s,ea);if(1l))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0m))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; +core.LoopWatchDog=function(l,m){var e=Date.now(),c=0;this.check=function(){var b;if(l&&(b=Date.now(),b-e>l))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0m))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; // Input 8 -core.Utils=function(){function l(m,g){Array.isArray(g)?m=(m||[]).concat(g.map(function(c){return l({},c)})):"object"===typeof g?(m=m||{},Object.keys(g).forEach(function(c){m[c]=l(m[c],g[c])})):m=g;return m}this.hashString=function(m){var g=0,c,b;c=0;for(b=m.length;c=g.compareBoundaryPoints(g.START_TO_START,c)&&0<=g.compareBoundaryPoints(g.END_TO_END,c)};this.rangesIntersect=function(g,c){return 0>=g.compareBoundaryPoints(g.END_TO_START,c)&&0<=g.compareBoundaryPoints(g.START_TO_END,c)};this.getNodesInRange=function(g,c){var b=[],n,a=g.startContainer.ownerDocument.createTreeWalker(g.commonAncestorContainer,NodeFilter.SHOW_ALL,c,!1);for(n=a.currentNode=g.startContainer;n;){if(c(n)=== -NodeFilter.FILTER_ACCEPT)b.push(n);else if(c(n)===NodeFilter.FILTER_REJECT)break;n=n.parentNode}b.reverse();for(n=a.nextNode();n;)b.push(n),n=a.nextNode();return b};this.normalizeTextNodes=function(g){g&&g.nextSibling&&(g=l(g,g.nextSibling));g&&g.previousSibling&&l(g.previousSibling,g)};this.rangeContainsNode=function(g,c){var b=c.ownerDocument.createRange(),n=c.nodeType===Node.TEXT_NODE?c.length:c.childNodes.length;b.setStart(g.startContainer,g.startOffset);b.setEnd(g.endContainer,g.endOffset);n= -0===b.comparePoint(c,0)&&0===b.comparePoint(c,n);b.detach();return n};this.mergeIntoParent=function(g){for(var c=g.parentNode;g.firstChild;)c.insertBefore(g.firstChild,g);c.removeChild(g);return c};this.getElementsByTagNameNS=function(g,c,b){return Array.prototype.slice.call(g.getElementsByTagNameNS(c,b))};this.rangeIntersectsNode=function(g,c){var b=c.nodeType===Node.TEXT_NODE?c.length:c.childNodes.length;return 0>=g.comparePoint(c,0)&&0<=g.comparePoint(c,b)};this.containsNode=function(g,c){return g=== -c||g.contains(c)};(function(g){var c=runtime.getWindow();null!==c&&(c=c.navigator.appVersion.toLowerCase(),c=-1===c.indexOf("chrome")&&(-1!==c.indexOf("applewebkit")||-1!==c.indexOf("safari")))&&(g.containsNode=m)})(this)}; +core.DomUtils=function(){function l(e,c){e.nodeType===Node.TEXT_NODE&&(0===e.length?e.parentNode.removeChild(e):c.nodeType===Node.TEXT_NODE&&(e.appendData(c.data),c.parentNode.removeChild(c)));return e}function m(e,c){return e===c||Boolean(e.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY)}this.splitBoundaries=function(e){var c=[],b;if(e.startContainer.nodeType===Node.TEXT_NODE||e.endContainer.nodeType===Node.TEXT_NODE){b=e.endContainer;var n=e.endOffset;if(n=e.compareBoundaryPoints(e.START_TO_START,c)&&0<=e.compareBoundaryPoints(e.END_TO_END,c)};this.rangesIntersect=function(e,c){return 0>=e.compareBoundaryPoints(e.END_TO_START,c)&&0<=e.compareBoundaryPoints(e.START_TO_END,c)};this.getNodesInRange=function(e,c){var b=[],n,a=e.startContainer.ownerDocument.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_ALL,c,!1);for(n=a.currentNode=e.startContainer;n;){if(c(n)=== +NodeFilter.FILTER_ACCEPT)b.push(n);else if(c(n)===NodeFilter.FILTER_REJECT)break;n=n.parentNode}b.reverse();for(n=a.nextNode();n;)b.push(n),n=a.nextNode();return b};this.normalizeTextNodes=function(e){e&&e.nextSibling&&(e=l(e,e.nextSibling));e&&e.previousSibling&&l(e.previousSibling,e)};this.rangeContainsNode=function(e,c){var b=c.ownerDocument.createRange(),n=c.nodeType===Node.TEXT_NODE?c.length:c.childNodes.length;b.setStart(e.startContainer,e.startOffset);b.setEnd(e.endContainer,e.endOffset);n= +0===b.comparePoint(c,0)&&0===b.comparePoint(c,n);b.detach();return n};this.mergeIntoParent=function(e){for(var c=e.parentNode;e.firstChild;)c.insertBefore(e.firstChild,e);c.removeChild(e);return c};this.getElementsByTagNameNS=function(e,c,b){return Array.prototype.slice.call(e.getElementsByTagNameNS(c,b))};this.rangeIntersectsNode=function(e,c){var b=c.nodeType===Node.TEXT_NODE?c.length:c.childNodes.length;return 0>=e.comparePoint(c,0)&&0<=e.comparePoint(c,b)};this.containsNode=function(e,c){return e=== +c||e.contains(c)};(function(e){var c=runtime.getWindow();null!==c&&(c=c.navigator.appVersion.toLowerCase(),c=-1===c.indexOf("chrome")&&(-1!==c.indexOf("applewebkit")||-1!==c.indexOf("safari")))&&(e.containsNode=m)})(this)}; // Input 10 runtime.loadClass("core.DomUtils"); -core.Cursor=function(l,m){function g(a){a.parentNode&&(e.push(a.previousSibling),e.push(a.nextSibling),a.parentNode.removeChild(a))}function c(a,b,d){if(b.nodeType===Node.TEXT_NODE){runtime.assert(Boolean(b),"putCursorIntoTextNode: invalid container");var c=b.parentNode;runtime.assert(Boolean(c),"putCursorIntoTextNode: container without parent");runtime.assert(0<=d&&d<=b.length,"putCursorIntoTextNode: offset is out of bounds");0===d?c.insertBefore(a,b):(d!==b.length&&b.splitText(d),c.insertBefore(a, -b.nextSibling))}else if(b.nodeType===Node.ELEMENT_NODE){runtime.assert(Boolean(b),"putCursorIntoContainer: invalid container");for(c=b.firstChild;null!==c&&01/e?"-0":String(e),l(d+" should be "+a+". Was "+c+".")):l(d+" should be "+a+" (of type "+typeof a+"). Was "+e+" (of type "+typeof e+").")}var a=0,e;e=function(a,d){var c=Object.keys(a),k=Object.keys(d);c.sort();k.sort();return m(c,k)&&Object.keys(a).every(function(k){var h= -a[k],c=d[k];return b(h,c)?!0:(l(h+" should be "+c+" for key "+k),!1)})};this.areNodesEqual=c;this.shouldBeNull=function(a,b){n(a,b,"null")};this.shouldBeNonNull=function(a,b){var c,k;try{k=eval(b)}catch(e){c=e}c?l(b+" should be non-null. Threw exception "+c):null!==k?runtime.log("pass",b+" is non-null."):l(b+" should be non-null. Was "+k)};this.shouldBe=n;this.countFailedTests=function(){return a}}; -core.UnitTester=function(){function l(c,b){return""+c+""}var m=0,g={};this.runTests=function(c,b,n){function a(k){if(0===k.length)g[e]=t,m+=f.countFailedTests(),b();else{p=k[0];var c=Runtime.getFunctionName(p);runtime.log("Running "+c);q=f.countFailedTests();d.setUp();p(function(){d.tearDown();t[c]=q===f.countFailedTests();a(k.slice(1))})}}var e=Runtime.getFunctionName(c),f=new core.UnitTestRunner,d=new c(f),t={},k,p,h,q,s="BrowserRuntime"=== -runtime.type();if(g.hasOwnProperty(e))runtime.log("Test "+e+" has already run.");else{s?runtime.log("Running "+l(e,'runSuite("'+e+'");')+": "+d.description()+""):runtime.log("Running "+e+": "+d.description);h=d.tests();for(k=0;kRunning "+l(c,'runTest("'+e+'","'+c+'")')+""):runtime.log("Running "+c),q=f.countFailedTests(),d.setUp(),p(),d.tearDown(),t[c]=q===f.countFailedTests()); -a(d.asyncTests())}};this.countFailedTests=function(){return m};this.results=function(){return g}}; +core.UnitTest.cleanupTestAreaDiv=function(){var l=runtime.getWindow().document,m=l.getElementById("testarea");runtime.assert(!!m&&m.parentNode===l.body,'Test environment broken, found no div with id "testarea" below body.');l.body.removeChild(m)};core.UnitTest.createOdtDocument=function(l,m){var e="",e=e+"";return runtime.parseXML(e)}; +core.UnitTestRunner=function(){function l(b){a+=1;runtime.log("fail",b)}function m(a,b){var c;try{if(a.length!==b.length)return l("array of length "+a.length+" should be "+b.length+" long"),!1;for(c=0;c1/h?"-0":String(h),l(d+" should be "+a+". Was "+c+".")):l(d+" should be "+a+" (of type "+typeof a+"). Was "+h+" (of type "+typeof h+").")}var a=0,h;h=function(a,d){var c=Object.keys(a),k=Object.keys(d);c.sort();k.sort();return m(c,k)&&Object.keys(a).every(function(k){var g= +a[k],c=d[k];return b(g,c)?!0:(l(g+" should be "+c+" for key "+k),!1)})};this.areNodesEqual=c;this.shouldBeNull=function(a,b){n(a,b,"null")};this.shouldBeNonNull=function(a,b){var c,k;try{k=eval(b)}catch(h){c=h}c?l(b+" should be non-null. Threw exception "+c):null!==k?runtime.log("pass",b+" is non-null."):l(b+" should be non-null. Was "+k)};this.shouldBe=n;this.countFailedTests=function(){return a}}; +core.UnitTester=function(){function l(c,b){return""+c+""}var m=0,e={};this.runTests=function(c,b,n){function a(k){if(0===k.length)e[h]=t,m+=f.countFailedTests(),b();else{q=k[0];var g=Runtime.getFunctionName(q);runtime.log("Running "+g);p=f.countFailedTests();d.setUp();q(function(){d.tearDown();t[g]=p===f.countFailedTests();a(k.slice(1))})}}var h=Runtime.getFunctionName(c),f=new core.UnitTestRunner,d=new c(f),t={},k,q,g,p,r="BrowserRuntime"=== +runtime.type();if(e.hasOwnProperty(h))runtime.log("Test "+h+" has already run.");else{r?runtime.log("Running "+l(h,'runSuite("'+h+'");')+": "+d.description()+""):runtime.log("Running "+h+": "+d.description);g=d.tests();for(k=0;kRunning "+l(c,'runTest("'+h+'","'+c+'")')+""):runtime.log("Running "+c),p=f.countFailedTests(),d.setUp(),q(),d.tearDown(),t[c]=p===f.countFailedTests()); +a(d.asyncTests())}};this.countFailedTests=function(){return m};this.results=function(){return e}}; // Input 13 -core.PositionIterator=function(l,m,g,c){function b(){this.acceptNode=function(a){return a.nodeType===Node.TEXT_NODE&&0===a.length?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}function n(a){this.acceptNode=function(b){return b.nodeType===Node.TEXT_NODE&&0===b.length?NodeFilter.FILTER_REJECT:a.acceptNode(b)}}function a(){var a=f.currentNode.nodeType;d=a===Node.TEXT_NODE?f.currentNode.length-1:a===Node.ELEMENT_NODE?1:0}var e=this,f,d,t;this.nextPosition=function(){if(f.currentNode===l)return!1; +core.PositionIterator=function(l,m,e,c){function b(){this.acceptNode=function(a){return a.nodeType===Node.TEXT_NODE&&0===a.length?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}function n(a){this.acceptNode=function(b){return b.nodeType===Node.TEXT_NODE&&0===b.length?NodeFilter.FILTER_REJECT:a.acceptNode(b)}}function a(){var a=f.currentNode.nodeType;d=a===Node.TEXT_NODE?f.currentNode.length-1:a===Node.ELEMENT_NODE?1:0}var h=this,f,d,t;this.nextPosition=function(){if(f.currentNode===l)return!1; if(0===d&&f.currentNode.nodeType===Node.ELEMENT_NODE)null===f.firstChild()&&(d=1);else if(f.currentNode.nodeType===Node.TEXT_NODE&&d+1 "+a.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"), -b===a.length&&(d=void 0,f.nextSibling()?d=0:f.parentNode()&&(d=1),runtime.assert(void 0!==d,"Error in setPosition: position not valid.")),!0;c=t(a);b "+a.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"), +b===a.length&&(d=void 0,f.nextSibling()?d=0:f.parentNode()&&(d=1),runtime.assert(void 0!==d,"Error in setPosition: position not valid.")),!0;g=t(a);b>>8^k;return d^-1}function c(a){return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&15,a>>5&63,(a&31)<<1)}function b(a){var b=a.getFullYear();return 1980>b?0:b-1980<< -25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function n(a,b){var d,h,k,e,f,g,n,p=this;this.load=function(b){if(void 0!==p.data)b(null,p.data);else{var d=f+34+h+k+256;d+n>q&&(d=q-n);runtime.read(a,n,d,function(d,c){if(d||null===c)b(d,c);else a:{var h=c,k=new core.ByteArray(h),r=k.readUInt32LE(),q;if(67324752!==r)b("File entry signature is wrong."+r.toString()+" "+h.length.toString(),null);else{k.pos+=22;r=k.readUInt16LE();q=k.readUInt16LE();k.pos+=r+q; -if(e){h=h.slice(k.pos,k.pos+f);if(f!==h.length){b("The amount of compressed bytes read was "+h.length.toString()+" instead of "+f.toString()+" for "+p.filename+" in "+a+".",null);break a}h=w(h,g)}else h=h.slice(k.pos,k.pos+g);g!==h.length?b("The amount of bytes read was "+h.length.toString()+" instead of "+g.toString()+" for "+p.filename+" in "+a+".",null):(p.data=h,b(null,h))}}})}};this.set=function(a,b,d,c){p.filename=a;p.data=b;p.compressed=d;p.date=c};this.error=null;b&&(d=b.readUInt32LE(),33639248!== -d?this.error="Central directory entry has wrong signature at position "+(b.pos-4).toString()+' for file "'+a+'": '+b.data.length.toString():(b.pos+=6,e=b.readUInt16LE(),this.date=c(b.readUInt32LE()),b.readUInt32LE(),f=b.readUInt32LE(),g=b.readUInt32LE(),h=b.readUInt16LE(),k=b.readUInt16LE(),d=b.readUInt16LE(),b.pos+=8,n=b.readUInt32LE(),this.filename=runtime.byteArrayToString(b.data.slice(b.pos,b.pos+h),"utf8"),b.pos+=h+k+d))}function a(a,b){if(22!==a.length)b("Central directory length should be 22.", -u);else{var d=new core.ByteArray(a),c;c=d.readUInt32LE();101010256!==c?b("Central directory signature is wrong: "+c.toString(),u):(c=d.readUInt16LE(),0!==c?b("Zip files with non-zero disk numbers are not supported.",u):(c=d.readUInt16LE(),0!==c?b("Zip files with non-zero disk numbers are not supported.",u):(c=d.readUInt16LE(),s=d.readUInt16LE(),c!==s?b("Number of entries is inconsistent.",u):(c=d.readUInt32LE(),d=d.readUInt16LE(),d=q-22-c,runtime.read(l,d,q-d,function(a,d){if(a||null===d)b(a,u);else a:{var c= -new core.ByteArray(d),k,e;h=[];for(k=0;kq?m("File '"+l+"' cannot be read.",u):runtime.read(l,q-22,22,function(b,d){b||null===m||null===d?m(b,u):a(d,m)})})}; +2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],d,g,c=a.length,k=0,k=0;d=-1;for(g=0;g>>8^k;return d^-1}function c(a){return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&15,a>>5&63,(a&31)<<1)}function b(a){var b=a.getFullYear();return 1980>b?0:b-1980<< +25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function n(a,b){var d,g,k,h,f,e,n,r=this;this.load=function(b){if(void 0!==r.data)b(null,r.data);else{var d=f+34+g+k+256;d+n>p&&(d=p-n);runtime.read(a,n,d,function(d,g){if(d||null===g)b(d,g);else a:{var c=g,k=new core.ByteArray(c),p=k.readUInt32LE(),n;if(67324752!==p)b("File entry signature is wrong."+p.toString()+" "+c.length.toString(),null);else{k.pos+=22;p=k.readUInt16LE();n=k.readUInt16LE();k.pos+=p+n; +if(h){c=c.slice(k.pos,k.pos+f);if(f!==c.length){b("The amount of compressed bytes read was "+c.length.toString()+" instead of "+f.toString()+" for "+r.filename+" in "+a+".",null);break a}c=w(c,e)}else c=c.slice(k.pos,k.pos+e);e!==c.length?b("The amount of bytes read was "+c.length.toString()+" instead of "+e.toString()+" for "+r.filename+" in "+a+".",null):(r.data=c,b(null,c))}}})}};this.set=function(a,b,d,g){r.filename=a;r.data=b;r.compressed=d;r.date=g};this.error=null;b&&(d=b.readUInt32LE(),33639248!== +d?this.error="Central directory entry has wrong signature at position "+(b.pos-4).toString()+' for file "'+a+'": '+b.data.length.toString():(b.pos+=6,h=b.readUInt16LE(),this.date=c(b.readUInt32LE()),b.readUInt32LE(),f=b.readUInt32LE(),e=b.readUInt32LE(),g=b.readUInt16LE(),k=b.readUInt16LE(),d=b.readUInt16LE(),b.pos+=8,n=b.readUInt32LE(),this.filename=runtime.byteArrayToString(b.data.slice(b.pos,b.pos+g),"utf8"),b.pos+=g+k+d))}function a(a,b){if(22!==a.length)b("Central directory length should be 22.", +u);else{var d=new core.ByteArray(a),c;c=d.readUInt32LE();101010256!==c?b("Central directory signature is wrong: "+c.toString(),u):(c=d.readUInt16LE(),0!==c?b("Zip files with non-zero disk numbers are not supported.",u):(c=d.readUInt16LE(),0!==c?b("Zip files with non-zero disk numbers are not supported.",u):(c=d.readUInt16LE(),r=d.readUInt16LE(),c!==r?b("Number of entries is inconsistent.",u):(c=d.readUInt32LE(),d=d.readUInt16LE(),d=p-22-c,runtime.read(l,d,p-d,function(a,d){if(a||null===d)b(a,u);else a:{var c= +new core.ByteArray(d),k,h;g=[];for(k=0;kp?m("File '"+l+"' cannot be read.",u):runtime.read(l,p-22,22,function(b,d){b||null===m||null===d?m(b,u):a(d,m)})})}; // Input 18 -core.CSSUnits=function(){var l={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(m,g,c){return m*l[c]/l[g]};this.convertMeasure=function(m,g){var c,b;m&&g?(c=parseFloat(m),b=m.replace(c.toString(),""),c=this.convert(c,b,g)):c="";return c.toString()};this.getUnits=function(m){return m.substr(m.length-2,m.length)}}; +core.CSSUnits=function(){var l={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(m,e,c){return m*l[c]/l[e]};this.convertMeasure=function(m,e){var c,b;m&&e?(c=parseFloat(m),b=m.replace(c.toString(),""),c=this.convert(c,b,e)):c="";return c.toString()};this.getUnits=function(m){return m.substr(m.length-2,m.length)}}; // Input 19 xmldom.LSSerializerFilter=function(){}; // Input 20 "function"!==typeof Object.create&&(Object.create=function(l){var m=function(){};m.prototype=l;return new m}); -xmldom.LSSerializer=function(){function l(b){var c=b||{},a=function(a){var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[a[d]]=d);return b}(b),e=[c],f=[a],d=0;this.push=function(){d+=1;c=e[d]=Object.create(c);a=f[d]=Object.create(a)};this.pop=function(){e[d]=void 0;f[d]=void 0;d-=1;c=e[d];a=f[d]};this.getLocalNamespaceDefinitions=function(){return a};this.getQName=function(b){var d=b.namespaceURI,e=0,h;if(!d)return b.localName;if(h=a[d])return h+":"+b.localName;do{h||!b.prefix?(h="ns"+e,e+=1):h=b.prefix; -if(c[h]===d)break;if(!c[h]){c[h]=d;a[d]=h;break}h=null}while(null===h);return h+":"+b.localName}}function m(b){return b.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function g(b,n){var a="",e=c.filter?c.filter.acceptNode(n):NodeFilter.FILTER_ACCEPT,f;if(e===NodeFilter.FILTER_ACCEPT&&n.nodeType===Node.ELEMENT_NODE){b.push();f=b.getQName(n);var d,l=n.attributes,k,p,h,q="",s;d="<"+f;k=l.length;for(p=0;p")}if(e===NodeFilter.FILTER_ACCEPT||e===NodeFilter.FILTER_SKIP){for(e=n.firstChild;e;)a+=g(b,e),e=e.nextSibling;n.nodeValue&&(a+=m(n.nodeValue))}f&&(a+="",b.pop());return a}var c=this;this.filter=null;this.writeToString=function(b,c){if(!b)return"";var a=new l(c);return g(a,b)}}; +xmldom.LSSerializer=function(){function l(b){var c=b||{},a=function(a){var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[a[d]]=d);return b}(b),h=[c],f=[a],d=0;this.push=function(){d+=1;c=h[d]=Object.create(c);a=f[d]=Object.create(a)};this.pop=function(){h[d]=void 0;f[d]=void 0;d-=1;c=h[d];a=f[d]};this.getLocalNamespaceDefinitions=function(){return a};this.getQName=function(b){var d=b.namespaceURI,h=0,g;if(!d)return b.localName;if(g=a[d])return g+":"+b.localName;do{g||!b.prefix?(g="ns"+h,h+=1):g=b.prefix; +if(c[g]===d)break;if(!c[g]){c[g]=d;a[d]=g;break}g=null}while(null===g);return g+":"+b.localName}}function m(b){return b.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function e(b,n){var a="",h=c.filter?c.filter.acceptNode(n):NodeFilter.FILTER_ACCEPT,f;if(h===NodeFilter.FILTER_ACCEPT&&n.nodeType===Node.ELEMENT_NODE){b.push();f=b.getQName(n);var d,l=n.attributes,k,q,g,p="",r;d="<"+f;k=l.length;for(q=0;q")}if(h===NodeFilter.FILTER_ACCEPT||h===NodeFilter.FILTER_SKIP){for(h=n.firstChild;h;)a+=e(b,h),h=h.nextSibling;n.nodeValue&&(a+=m(n.nodeValue))}f&&(a+="",b.pop());return a}var c=this;this.filter=null;this.writeToString=function(b,c){if(!b)return"";var a=new l(c);return e(a,b)}}; // Input 21 -xmldom.RelaxNGParser=function(){function l(a,b){this.message=function(){b&&(a+=1===b.nodeType?" Element ":" Node ",a+=b.nodeName,b.nodeValue&&(a+=" with value '"+b.nodeValue+"'"),a+=".");return a}}function m(a){if(2>=a.e.length)return a;var b={name:a.name,e:a.e.slice(0,2)};return m({name:a.name,e:[b].concat(a.e.slice(2))})}function g(a){a=a.split(":",2);var b="",c;1===a.length?a=["",a[0]]:b=a[0];for(c in e)e[c]===b&&(a[0]=c);return a}function c(a,b){for(var k=0,e,h,f=a.name;a.e&&k=a.e.length)return a;var b={name:a.name,e:a.e.slice(0,2)};return m({name:a.name,e:[b].concat(a.e.slice(2))})}function e(a){a=a.split(":",2);var b="",c;1===a.length?a=["",a[0]]:b=a[0];for(c in h)h[c]===b&&(a[0]=c);return a}function c(a,b){for(var k=0,h,g,f=a.name;a.e&&k=c.length)return b;0===h&&(h=0);for(var k=c.item(h);k.namespaceURI===d;){h+=1;if(h>=c.length)return b;k=c.item(h)}return k=e(a,b.attDeriv(a,c.item(h)),c,h+1)}function f(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):f(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)): -f(a,b,c.e[1])}var d="http://www.w3.org/2000/xmlns/",t,k,p,h,q,s,w,u,A,y,v={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return v}},r={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return r},endTagDeriv:function(){return v}}, -z={type:"text",nullable:!0,hash:"text",textDeriv:function(){return z},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return z},endTagDeriv:function(){return v}},G,C,L;t=c("choice",function(a,b){if(a===v)return b;if(b===v||a===b)return a},function(a,c){var d={},h;b(d,{p1:a,p2:c});c=a=void 0;for(h in d)d.hasOwnProperty(h)&&(void 0===a?a=d[h]:c=void 0===c?d[h]:t(c,d[h]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, -textDeriv:function(c,d){return t(a.textDeriv(c,d),b.textDeriv(c,d))},startTagOpenDeriv:g(function(c){return t(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,d){return t(a.attDeriv(c,d),b.attDeriv(c,d))},startTagCloseDeriv:l(function(){return t(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:l(function(){return t(a.endTagDeriv(),b.endTagDeriv())})}}(a,c)});k=function(a,b,c){return function(){var d={},h=0;return function(e,k){var f=b&&b(e,k),g,r;if(void 0!==f)return f; -f=e.hash||e.toString();g=k.hash||k.toString();f=c.length)return b;0===g&&(g=0);for(var k=c.item(g);k.namespaceURI===d;){g+=1;if(g>=c.length)return b;k=c.item(g)}return k=h(a,b.attDeriv(a,c.item(g)),c,g+1)}function f(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):f(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)): +f(a,b,c.e[1])}var d="http://www.w3.org/2000/xmlns/",t,k,q,g,p,r,w,u,z,y,v={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return v}},s={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return s},endTagDeriv:function(){return v}}, +A={type:"text",nullable:!0,hash:"text",textDeriv:function(){return A},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return A},endTagDeriv:function(){return v}},I,D,N;t=c("choice",function(a,b){if(a===v)return b;if(b===v||a===b)return a},function(a,c){var d={},g;b(d,{p1:a,p2:c});c=a=void 0;for(g in d)d.hasOwnProperty(g)&&(void 0===a?a=d[g]:c=void 0===c?d[g]:t(c,d[g]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, +textDeriv:function(c,d){return t(a.textDeriv(c,d),b.textDeriv(c,d))},startTagOpenDeriv:e(function(c){return t(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,d){return t(a.attDeriv(c,d),b.attDeriv(c,d))},startTagCloseDeriv:l(function(){return t(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:l(function(){return t(a.endTagDeriv(),b.endTagDeriv())})}}(a,c)});k=function(a,b,c){return function(){var d={},g=0;return function(h,k){var f=b&&b(h,k),e,p;if(void 0!==f)return f; +f=h.hash||h.toString();e=k.hash||k.toString();fNode.ELEMENT_NODE;){if(d!==Node.COMMENT_NODE&&(d!==Node.TEXT_NODE||!/^\s+$/.test(b.currentNode.nodeValue)))return[new l("Not allowed node of type "+ -d+".")];d=(c=b.nextSibling())?c.nodeType:0}if(!c)return[new l("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(n[c.namespaceURI]+":"+c.localName))return[new l("Found "+c.nodeName+" instead of "+a.names+".",c)];if(b.firstChild()){for(g=m(a.e[1],b,c);b.nextSibling();)if(d=b.currentNode.nodeType,!(b.currentNode&&b.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(b.currentNode.nodeValue)||d===Node.COMMENT_NODE))return[new l("Spurious content.",b.currentNode)];if(b.parentNode()!==c)return[new l("Implementation error.")]}else g= -m(a.e[1],b,c);b.nextSibling();return g}var c,b,n;b=function(a,c,f,d){var n=a.name,k=null;if("text"===n)a:{for(var p=(a=c.currentNode)?a.nodeType:0;a!==f&&3!==p;){if(1===p){k=[new l("Element not allowed here.",a)];break a}p=(a=c.nextSibling())?a.nodeType:0}c.nextSibling();k=null}else if("data"===n)k=null;else if("value"===n)d!==a.text&&(k=[new l("Wrong value, should be '"+a.text+"', not '"+d+"'",f)]);else if("list"===n)k=null;else if("attribute"===n)a:{if(2!==a.e.length)throw"Attribute with wrong # of elements: "+ -a.e.length;n=a.localnames.length;for(k=0;kNode.ELEMENT_NODE;){if(d!==Node.COMMENT_NODE&&(d!==Node.TEXT_NODE||!/^\s+$/.test(b.currentNode.nodeValue)))return[new l("Not allowed node of type "+ +d+".")];d=(c=b.nextSibling())?c.nodeType:0}if(!c)return[new l("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(n[c.namespaceURI]+":"+c.localName))return[new l("Found "+c.nodeName+" instead of "+a.names+".",c)];if(b.firstChild()){for(e=m(a.e[1],b,c);b.nextSibling();)if(d=b.currentNode.nodeType,!(b.currentNode&&b.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(b.currentNode.nodeValue)||d===Node.COMMENT_NODE))return[new l("Spurious content.",b.currentNode)];if(b.parentNode()!==c)return[new l("Implementation error.")]}else e= +m(a.e[1],b,c);b.nextSibling();return e}var c,b,n;b=function(a,c,f,d){var n=a.name,k=null;if("text"===n)a:{for(var q=(a=c.currentNode)?a.nodeType:0;a!==f&&3!==q;){if(1===q){k=[new l("Element not allowed here.",a)];break a}q=(a=c.nextSibling())?a.nodeType:0}c.nextSibling();k=null}else if("data"===n)k=null;else if("value"===n)d!==a.text&&(k=[new l("Wrong value, should be '"+a.text+"', not '"+d+"'",f)]);else if("list"===n)k=null;else if("attribute"===n)a:{if(2!==a.e.length)throw"Attribute with wrong # of elements: "+ +a.e.length;n=a.localnames.length;for(k=0;k=f&&c.push(m(a.substring(b,d)))):"["===a[d]&&(0>=f&&(b=d+1),f+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};d=function(d,f,h){var g,n,m,l;for(g=0;g=f&&c.push(m(a.substring(b,d)))):"["===a[d]&&(0>=f&&(b=d+1),f+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};d=function(d,f,g){var e,n,m,l;for(e=0;e=(m.getBoundingClientRect().top-y.bottom)/u?c.style.top=Math.abs(m.getBoundingClientRect().top-y.bottom)/u+20+"px":c.style.top="0px");n.style.left=d.getBoundingClientRect().width/u+"px";var d=n.style,m=n.getBoundingClientRect().left/u,A=n.getBoundingClientRect().top/u,y=c.getBoundingClientRect().left/u,v=c.getBoundingClientRect().top/u,r=0,z= -0,r=y-m,r=r*r,z=v-A,z=z*z,m=Math.sqrt(r+z);d.width=m+"px";u=Math.asin((c.getBoundingClientRect().top-n.getBoundingClientRect().top)/(u*parseFloat(n.style.width)));n.style.transform="rotate("+u+"rad)";n.style.MozTransform="rotate("+u+"rad)";n.style.WebkitTransform="rotate("+u+"rad)";n.style.msTransform="rotate("+u+"rad)";b&&(u=t.getComputedStyle(b,":before").content)&&"none"!==u&&(u=u.substring(1,u.length-1),b.firstChild?b.firstChild.nodeValue=u:b.appendChild(f.createTextNode(u)))}}var e=[],f=m.ownerDocument, -d=new odf.OdfUtils,t=runtime.getWindow();runtime.assert(Boolean(t),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=a;this.addAnnotation=function(d){b(!0);e.push({node:d.node,end:d.end});n();var g=f.createElement("div"),h=f.createElement("div"),q=f.createElement("div"),m=f.createElement("div"),l=f.createElement("div"),u=d.node;g.className="annotationWrapper";u.parentNode.insertBefore(g,u);h.className="annotationNote";h.appendChild(u);l.className= -"annotationRemoveButton";h.appendChild(l);q.className="annotationConnector horizontal";m.className="annotationConnector angular";g.appendChild(h);g.appendChild(q);g.appendChild(m);d.end&&c(d);a()};this.forgetAnnotations=function(){for(;e.length;){var a=e[0],c=e.indexOf(a),d=a.node,g=d.parentNode.parentNode;"div"===g.localName&&(g.parentNode.insertBefore(d,g),g.parentNode.removeChild(g));a=a.node.getAttributeNS(odf.Namespaces.officens,"name");a=f.querySelectorAll('span.annotationHighlight[annotation="'+ -a+'"]');g=d=void 0;for(d=0;d=(m.getBoundingClientRect().top-y.bottom)/u?c.style.top=Math.abs(m.getBoundingClientRect().top-y.bottom)/u+20+"px":c.style.top="0px");n.style.left=d.getBoundingClientRect().width/u+"px";var d=n.style,m=n.getBoundingClientRect().left/u,z=n.getBoundingClientRect().top/u,y=c.getBoundingClientRect().left/u,v=c.getBoundingClientRect().top/u,s=0,A= +0,s=y-m,s=s*s,A=v-z,A=A*A,m=Math.sqrt(s+A);d.width=m+"px";u=Math.asin((c.getBoundingClientRect().top-n.getBoundingClientRect().top)/(u*parseFloat(n.style.width)));n.style.transform="rotate("+u+"rad)";n.style.MozTransform="rotate("+u+"rad)";n.style.WebkitTransform="rotate("+u+"rad)";n.style.msTransform="rotate("+u+"rad)";b&&(u=t.getComputedStyle(b,":before").content)&&"none"!==u&&(u=u.substring(1,u.length-1),b.firstChild?b.firstChild.nodeValue=u:b.appendChild(f.createTextNode(u)))}}var h=[],f=m.ownerDocument, +d=new odf.OdfUtils,t=runtime.getWindow();runtime.assert(Boolean(t),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=a;this.addAnnotation=function(d){b(!0);h.push({node:d.node,end:d.end});n();var e=f.createElement("div"),g=f.createElement("div"),p=f.createElement("div"),m=f.createElement("div"),l=f.createElement("div"),u=d.node;e.className="annotationWrapper";u.parentNode.insertBefore(e,u);g.className="annotationNote";g.appendChild(u);l.className= +"annotationRemoveButton";g.appendChild(l);p.className="annotationConnector horizontal";m.className="annotationConnector angular";e.appendChild(g);e.appendChild(p);e.appendChild(m);d.end&&c(d);a()};this.forgetAnnotations=function(){for(;h.length;){var a=h[0],c=h.indexOf(a),d=a.node,e=d.parentNode.parentNode;"div"===e.localName&&(e.parentNode.insertBefore(d,e),e.parentNode.removeChild(e));a=a.node.getAttributeNS(odf.Namespaces.officens,"name");a=f.querySelectorAll('span.annotationHighlight[annotation="'+ +a+'"]');e=d=void 0;for(d=0;da.value||"%"===a.unit)?null:a}function s(a){return(a=h(a))&&"%"!==a.unit?null:a}function w(a){switch(a.namespaceURI){case odf.Namespaces.drawns:case odf.Namespaces.svgns:case odf.Namespaces.dr3dns:return!1;case odf.Namespaces.textns:switch(a.localName){case "note-body":case "ruby-text":return!1}break;case odf.Namespaces.officens:switch(a.localName){case "annotation":case "binary-data":case "event-listeners":return!1}break;default:switch(a.localName){case "editinfo":return!1}}return!0} -var u="urn:oasis:names:tc:opendocument:xmlns:text:1.0",A="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",y=/^\s*$/,v=new core.DomUtils;this.isParagraph=l;this.getParagraphElement=m;this.isWithinTrackedChanges=function(a,b){for(;a&&a!==b;){if(a.namespaceURI===u&&"tracked-changes"===a.localName)return!0;a=a.parentNode}return!1};this.isListItem=function(a){return"list-item"===(a&&a.localName)&&a.namespaceURI===u};this.isODFWhitespace=g;this.isGroupingElement=c;this.isCharacterElement=b;this.firstChild= -n;this.lastChild=a;this.previousNode=e;this.nextNode=f;this.scanLeftForNonWhitespace=d;this.lookLeftForCharacter=function(a){var c;c=0;a.nodeType===Node.TEXT_NODE&&0=b.value||"%"===b.unit)?null:b;return b||s(a)};this.parseFoLineHeight=function(a){return q(a)|| -s(a)};this.getImpactedParagraphs=function(a){var b=a.commonAncestorContainer,c=[];for(b.nodeType===Node.ELEMENT_NODE&&(c=v.getElementsByTagNameNS(b,u,"p").concat(v.getElementsByTagNameNS(b,u,"h")));b&&!l(b);)b=b.parentNode;b&&c.push(b);return c.filter(function(b){return v.rangeIntersectsNode(a,b)})};this.getTextNodes=function(a,b){var c=a.startContainer.ownerDocument.createRange(),d;d=v.getNodesInRange(a,function(d){c.selectNodeContents(d);if(d.nodeType===Node.TEXT_NODE){if(b&&v.rangesIntersect(a, -c)||v.containsRange(a,c))return Boolean(m(d)&&(!g(d.textContent)||p(d,0)))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}else if(v.rangesIntersect(a,c)&&w(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});c.detach();return d};this.getTextElements=function(a,d){var e=a.startContainer.ownerDocument.createRange(),h;h=v.getNodesInRange(a,function(h){var f=h.nodeType;e.selectNodeContents(h);if(f===Node.TEXT_NODE){if(v.containsRange(a,e)&&(d||Boolean(m(h)&&(!g(h.textContent)||p(h,0)))))return NodeFilter.FILTER_ACCEPT}else if(b(h)){if(v.containsRange(a, -e))return NodeFilter.FILTER_ACCEPT}else if(w(h)||c(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});e.detach();return h};this.getParagraphElements=function(a){var b=a.startContainer.ownerDocument.createRange(),d;d=v.getNodesInRange(a,function(d){b.selectNodeContents(d);if(l(d)){if(v.rangesIntersect(a,b))return NodeFilter.FILTER_ACCEPT}else if(w(d)||c(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});b.detach();return d}}; +odf.OdfUtils=function(){function l(a){var b=a&&a.localName;return("p"===b||"h"===b)&&a.namespaceURI===u}function m(a){for(;a&&!l(a);)a=a.parentNode;return a}function e(a){return/^[ \t\r\n]+$/.test(a)}function c(a){var b=a&&a.localName;return/^(span|p|h|a|meta)$/.test(b)&&a.namespaceURI===u||"span"===b&&"annotationHighlight"===a.className?!0:!1}function b(a){var b=a&&a.localName,c,d=!1;b&&(c=a.namespaceURI,c===u?d="s"===b||"tab"===b||"line-break"===b:c===z&&(d="frame"===b&&"as-char"===a.getAttributeNS(u, +"anchor-type")));return d}function n(a){for(;null!==a.firstChild&&c(a);)a=a.firstChild;return a}function a(a){for(;null!==a.lastChild&&c(a);)a=a.lastChild;return a}function h(b){for(;!l(b)&&null===b.previousSibling;)b=b.parentNode;return l(b)?null:a(b.previousSibling)}function f(a){for(;!l(a)&&null===a.nextSibling;)a=a.parentNode;return l(a)?null:n(a.nextSibling)}function d(a){for(var c=!1;a;)if(a.nodeType===Node.TEXT_NODE)if(0===a.length)a=h(a);else return!e(a.data.substr(a.length-1,1));else b(a)? +(c=!0,a=null):a=h(a);return c}function t(a){var c=!1;for(a=a&&n(a);a;){if(a.nodeType===Node.TEXT_NODE&&0a.value||"%"===a.unit)?null:a}function r(a){return(a=g(a))&&"%"!==a.unit?null:a}function w(a){switch(a.namespaceURI){case odf.Namespaces.drawns:case odf.Namespaces.svgns:case odf.Namespaces.dr3dns:return!1;case odf.Namespaces.textns:switch(a.localName){case "note-body":case "ruby-text":return!1}break;case odf.Namespaces.officens:switch(a.localName){case "annotation":case "binary-data":case "event-listeners":return!1}break;default:switch(a.localName){case "editinfo":return!1}}return!0} +var u="urn:oasis:names:tc:opendocument:xmlns:text:1.0",z="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",y=/^\s*$/,v=new core.DomUtils;this.isParagraph=l;this.getParagraphElement=m;this.isWithinTrackedChanges=function(a,b){for(;a&&a!==b;){if(a.namespaceURI===u&&"tracked-changes"===a.localName)return!0;a=a.parentNode}return!1};this.isListItem=function(a){return"list-item"===(a&&a.localName)&&a.namespaceURI===u};this.isODFWhitespace=e;this.isGroupingElement=c;this.isCharacterElement=b;this.firstChild= +n;this.lastChild=a;this.previousNode=h;this.nextNode=f;this.scanLeftForNonWhitespace=d;this.lookLeftForCharacter=function(a){var c;c=0;a.nodeType===Node.TEXT_NODE&&0=b.value||"%"===b.unit)?null:b;return b||r(a)};this.parseFoLineHeight=function(a){return p(a)|| +r(a)};this.getImpactedParagraphs=function(a){var b=a.commonAncestorContainer,c=[];for(b.nodeType===Node.ELEMENT_NODE&&(c=v.getElementsByTagNameNS(b,u,"p").concat(v.getElementsByTagNameNS(b,u,"h")));b&&!l(b);)b=b.parentNode;b&&c.push(b);return c.filter(function(b){return v.rangeIntersectsNode(a,b)})};this.getTextNodes=function(a,b){var c=a.startContainer.ownerDocument.createRange(),d;d=v.getNodesInRange(a,function(d){c.selectNodeContents(d);if(d.nodeType===Node.TEXT_NODE){if(b&&v.rangesIntersect(a, +c)||v.containsRange(a,c))return Boolean(m(d)&&(!e(d.textContent)||q(d,0)))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}else if(v.rangesIntersect(a,c)&&w(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});c.detach();return d};this.getTextElements=function(a,d){var g=a.startContainer.ownerDocument.createRange(),f;f=v.getNodesInRange(a,function(f){var h=f.nodeType;g.selectNodeContents(f);if(h===Node.TEXT_NODE){if(v.containsRange(a,g)&&(d||Boolean(m(f)&&(!e(f.textContent)||q(f,0)))))return NodeFilter.FILTER_ACCEPT}else if(b(f)){if(v.containsRange(a, +g))return NodeFilter.FILTER_ACCEPT}else if(w(f)||c(f))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});g.detach();return f};this.getParagraphElements=function(a){var b=a.startContainer.ownerDocument.createRange(),d;d=v.getNodesInRange(a,function(d){b.selectNodeContents(d);if(l(d)){if(v.rangesIntersect(a,b))return NodeFilter.FILTER_ACCEPT}else if(w(d)||c(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});b.detach();return d}}; // Input 30 /* @@ -565,7 +565,7 @@ e))return NodeFilter.FILTER_ACCEPT}else if(w(h)||c(h))return NodeFilter.FILTER_S @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.OdfUtils"); -odf.TextSerializer=function(){function l(c){var b="",n=m.filter?m.filter.acceptNode(c):NodeFilter.FILTER_ACCEPT,a=c.nodeType,e;if(n===NodeFilter.FILTER_ACCEPT||n===NodeFilter.FILTER_SKIP)for(e=c.firstChild;e;)b+=l(e),e=e.nextSibling;n===NodeFilter.FILTER_ACCEPT&&(a===Node.ELEMENT_NODE&&g.isParagraph(c)?b+="\n":a===Node.TEXT_NODE&&c.textContent&&(b+=c.textContent));return b}var m=this,g=new odf.OdfUtils;this.filter=null;this.writeToString=function(c){return c?l(c):""}}; +odf.TextSerializer=function(){function l(c){var b="",n=m.filter?m.filter.acceptNode(c):NodeFilter.FILTER_ACCEPT,a=c.nodeType,h;if(n===NodeFilter.FILTER_ACCEPT||n===NodeFilter.FILTER_SKIP)for(h=c.firstChild;h;)b+=l(h),h=h.nextSibling;n===NodeFilter.FILTER_ACCEPT&&(a===Node.ELEMENT_NODE&&e.isParagraph(c)?b+="\n":a===Node.TEXT_NODE&&c.textContent&&(b+=c.textContent));return b}var m=this,e=new odf.OdfUtils;this.filter=null;this.writeToString=function(c){return c?l(c):""}}; // Input 31 /* @@ -602,10 +602,10 @@ odf.TextSerializer=function(){function l(c){var b="",n=m.filter?m.filter.acceptN @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.DomUtils");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.Namespaces"); -odf.TextStyleApplicator=function(l,m,g){function c(a){function b(a,c){return"object"===typeof a&&"object"===typeof c?Object.keys(a).every(function(d){return b(a[d],c[d])}):a===c}this.isStyleApplied=function(c){c=m.getAppliedStylesForElement(c);return b(a,c)}}function b(b){var c={};this.applyStyleToContainer=function(k){var n;n=k.getAttributeNS(a,"style-name");var h=k.ownerDocument;n=n||"";if(!c.hasOwnProperty(n)){var q=n,s;s=n?m.createDerivedStyleObject(n,"text",b):b;h=h.createElementNS(e,"style:style"); -m.updateStyle(h,s);h.setAttributeNS(e,"style:name",l.generateName());h.setAttributeNS(e,"style:family","text");h.setAttributeNS(f,"scope","document-content");g.appendChild(h);c[q]=h}n=c[n].getAttributeNS(e,"name");k.setAttributeNS(a,"text:style-name",n)}}var n=new core.DomUtils,a=odf.Namespaces.textns,e=odf.Namespaces.stylens,f="urn:webodf:names:scope";this.applyStyle=function(d,e,f){var g={},h,m,l,w;runtime.assert(f&&f["style:text-properties"],"applyStyle without any text properties");g["style:text-properties"]= -f["style:text-properties"];l=new b(g);w=new c(g);d.forEach(function(b){h=w.isStyleApplied(b);if(!1===h){var c=b.ownerDocument,d=b.parentNode,f,k=b,g=new core.LoopWatchDog(1E3);"span"===d.localName&&d.namespaceURI===a?(b.previousSibling&&!n.rangeContainsNode(e,b.previousSibling)?(c=d.cloneNode(!1),d.parentNode.insertBefore(c,d.nextSibling)):c=d,f=!0):(c=c.createElementNS(a,"text:span"),d.insertBefore(c,b),f=!1);for(;k&&(k===b||n.rangeContainsNode(e,k));)g.check(),d=k.nextSibling,k.parentNode!==c&& -c.appendChild(k),k=d;if(k&&f)for(b=c.cloneNode(!1),c.parentNode.insertBefore(b,c.nextSibling);k;)g.check(),d=k.nextSibling,b.appendChild(k),k=d;m=c;l.applyStyleToContainer(m)}})}}; +odf.TextStyleApplicator=function(l,m,e){function c(a){function b(a,c){return"object"===typeof a&&"object"===typeof c?Object.keys(a).every(function(d){return b(a[d],c[d])}):a===c}this.isStyleApplied=function(c){c=m.getAppliedStylesForElement(c);return b(a,c)}}function b(b){var c={};this.applyStyleToContainer=function(k){var n;n=k.getAttributeNS(a,"style-name");var g=k.ownerDocument;n=n||"";if(!c.hasOwnProperty(n)){var p=n,r;r=n?m.createDerivedStyleObject(n,"text",b):b;g=g.createElementNS(h,"style:style"); +m.updateStyle(g,r);g.setAttributeNS(h,"style:name",l.generateName());g.setAttributeNS(h,"style:family","text");g.setAttributeNS(f,"scope","document-content");e.appendChild(g);c[p]=g}n=c[n].getAttributeNS(h,"name");k.setAttributeNS(a,"text:style-name",n)}}var n=new core.DomUtils,a=odf.Namespaces.textns,h=odf.Namespaces.stylens,f="urn:webodf:names:scope";this.applyStyle=function(d,f,h){var e={},g,m,l,w;runtime.assert(h&&h["style:text-properties"],"applyStyle without any text properties");e["style:text-properties"]= +h["style:text-properties"];l=new b(e);w=new c(e);d.forEach(function(b){g=w.isStyleApplied(b);if(!1===g){var c=b.ownerDocument,d=b.parentNode,h,e=b,k=new core.LoopWatchDog(1E3);"span"===d.localName&&d.namespaceURI===a?(b.previousSibling&&!n.rangeContainsNode(f,b.previousSibling)?(c=d.cloneNode(!1),d.parentNode.insertBefore(c,d.nextSibling)):c=d,h=!0):(c=c.createElementNS(a,"text:span"),d.insertBefore(c,b),h=!1);for(;e&&(e===b||n.rangeContainsNode(f,e));)k.check(),d=e.nextSibling,e.parentNode!==c&& +c.appendChild(e),e=d;if(e&&h)for(b=c.cloneNode(!1),c.parentNode.insertBefore(b,c.nextSibling);e;)k.check(),d=e.nextSibling,b.appendChild(e),e=d;m=c;l.applyStyleToContainer(m)}})}}; // Input 32 /* @@ -642,48 +642,48 @@ c.appendChild(k),k=d;if(k&&f)for(b=c.cloneNode(!1),c.parentNode.insertBefore(b,c @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.Namespaces");runtime.loadClass("odf.OdfUtils");runtime.loadClass("xmldom.XPath");runtime.loadClass("core.CSSUnits"); -odf.Style2CSS=function(){function l(a){var b={},c,d;if(!a)return b;for(a=a.firstChild;a;){if(d=a.namespaceURI!==q||"style"!==a.localName&&"default-style"!==a.localName?a.namespaceURI===u&&"list-style"===a.localName?"list":a.namespaceURI!==q||"page-layout"!==a.localName&&"default-page-layout"!==a.localName?void 0:"page":a.getAttributeNS(q,"family"))(c=a.getAttributeNS&&a.getAttributeNS(q,"name"))||(c=""),d=b[d]=b[d]||{},d[c]=a;a=a.nextSibling}return b}function m(a,b){if(!b||!a)return null;if(a[b])return a[b]; -var c,d;for(c in a)if(a.hasOwnProperty(c)&&(d=m(a[c].derivedStyles,b)))return d;return null}function g(a,b,c){var d=b[a],e,h;d&&(e=d.getAttributeNS(q,"parent-style-name"),h=null,e&&(h=m(c,e),!h&&b[e]&&(g(e,b,c),h=b[e],b[e]=null)),h?(h.derivedStyles||(h.derivedStyles={}),h.derivedStyles[a]=d):c[a]=d)}function c(a,b){for(var c in a)a.hasOwnProperty(c)&&(g(c,a,b),a[c]=null)}function b(a,b){var c=v[a],d;if(null===c)return null;d=b?"["+c+'|style-name="'+b+'"]':"["+c+"|style-name]";"presentation"===c&& -(c="draw",d=b?'[presentation|style-name="'+b+'"]':"[presentation|style-name]");return c+"|"+r[a].join(d+","+c+"|")+d}function n(a,c,d){var e=[],h,f;e.push(b(a,c));for(h in d.derivedStyles)if(d.derivedStyles.hasOwnProperty(h))for(f in c=n(a,h,d.derivedStyles[h]),c)c.hasOwnProperty(f)&&e.push(c[f]);return e}function a(a,b,c){if(!a)return null;for(a=a.firstChild;a;){if(a.namespaceURI===b&&a.localName===c)return b=a;a=a.nextSibling}return null}function e(a,b){var c="",d,e;for(d in b)if(b.hasOwnProperty(d)&& -(d=b[d],e=a.getAttributeNS(d[0],d[1]))){e=e.trim();if(N.hasOwnProperty(d[1])){var h=e.indexOf(" "),f=void 0,k=void 0;-1!==h?(f=e.substring(0,h),k=e.substring(h)):(f=e,k="");(f=Z.parseLength(f))&&("pt"===f.unit&&0.75>f.value)&&(e="0.75pt"+k)}d[2]&&(c+=d[2]+":"+e+";")}return c}function f(b){return(b=a(b,q,"text-properties"))?Z.parseFoFontSize(b.getAttributeNS(h,"font-size")):null}function d(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,c,d){return b+b+c+c+d+d});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))? -{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function t(a,b,c,d){b='text|list[text|style-name="'+b+'"]';var e=c.getAttributeNS(u,"level"),h;c=Z.getFirstNonWhitespaceChild(c);c=Z.getFirstNonWhitespaceChild(c);var f;c&&(h=c.attributes,f=h["fo:text-indent"]?h["fo:text-indent"].value:void 0,h=h["fo:margin-left"]?h["fo:margin-left"].value:void 0);f||(f="-0.6cm");c="-"===f.charAt(0)?f.substring(1):"-"+f;for(e=e&&parseInt(e,10);1 text|list-item > text|list",e-=1;e=b+" > text|list-item > *:not(text|list):first-child"; -void 0!==h&&(h=e+"{margin-left:"+h+";}",a.insertRule(h,a.cssRules.length));d=b+" > text|list-item > *:not(text|list):first-child:before{"+d+";";d+="counter-increment:list;";d+="margin-left:"+f+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(k){throw k;}}function k(b,c,g,m){if("list"===c)for(var l=m.firstChild,r,s;l;){if(l.namespaceURI===u)if(r=l,"list-level-style-number"===l.localName){var v=r;s=v.getAttributeNS(q,"num-format");var N=v.getAttributeNS(q, -"num-suffix"),E={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},v=v.getAttributeNS(q,"num-prefix")||"",v=E.hasOwnProperty(s)?v+(" counter(list, "+E[s]+")"):s?v+("'"+s+"';"):v+" ''";N&&(v+=" '"+N+"'");s="content: "+v+";";t(b,g,r,s)}else"list-level-style-image"===l.localName?(s="content: none;",t(b,g,r,s)):"list-level-style-bullet"===l.localName&&(s="content: '"+r.getAttributeNS(u,"bullet-char")+"';",t(b,g,r,s));l=l.nextSibling}else if("page"===c)if(N=r=g="",l=m.getElementsByTagNameNS(q, -"page-layout-properties")[0],r=l.parentNode.parentNode.parentNode.masterStyles,N="",g+=e(l,ea),s=l.getElementsByTagNameNS(q,"background-image"),0h.value)&&(f="0.75pt"+e)}d[2]&&(c+=d[2]+":"+f+";")}return c}function f(b){return(b=a(b,p,"text-properties"))?Y.parseFoFontSize(b.getAttributeNS(g,"font-size")):null}function d(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,c,d){return b+b+c+c+d+d});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))? +{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function t(a,b,c,d){b='text|list[text|style-name="'+b+'"]';var f=c.getAttributeNS(u,"level"),g;c=Y.getFirstNonWhitespaceChild(c);c=Y.getFirstNonWhitespaceChild(c);var h;c&&(g=c.attributes,h=g["fo:text-indent"]?g["fo:text-indent"].value:void 0,g=g["fo:margin-left"]?g["fo:margin-left"].value:void 0);h||(h="-0.6cm");c="-"===h.charAt(0)?h.substring(1):"-"+h;for(f=f&&parseInt(f,10);1 text|list-item > text|list",f-=1;f=b+" > text|list-item > *:not(text|list):first-child"; +void 0!==g&&(g=f+"{margin-left:"+g+";}",a.insertRule(g,a.cssRules.length));d=b+" > text|list-item > *:not(text|list):first-child:before{"+d+";";d+="counter-increment:list;";d+="margin-left:"+h+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(e){throw e;}}function k(b,c,e,m){if("list"===c)for(var l=m.firstChild,r,s;l;){if(l.namespaceURI===u)if(r=l,"list-level-style-number"===l.localName){var v=r;s=v.getAttributeNS(p,"num-format");var M=v.getAttributeNS(p, +"num-suffix"),F={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},v=v.getAttributeNS(p,"num-prefix")||"",v=F.hasOwnProperty(s)?v+(" counter(list, "+F[s]+")"):s?v+("'"+s+"';"):v+" ''";M&&(v+=" '"+M+"'");s="content: "+v+";";t(b,e,r,s)}else"list-level-style-image"===l.localName?(s="content: none;",t(b,e,r,s)):"list-level-style-bullet"===l.localName&&(s="content: '"+r.getAttributeNS(u,"bullet-char")+"';",t(b,e,r,s));l=l.nextSibling}else if("page"===c)if(M=r=e="",l=m.getElementsByTagNameNS(p, +"page-layout-properties")[0],r=l.parentNode.parentNode.parentNode.masterStyles,M="",e+=h(l,ea),s=l.getElementsByTagNameNS(p,"background-image"),0c)break;e=e.nextSibling}a.insertBefore(b,e)}}}function n(a){this.OdfContainer=a}function a(a, -b,c,d){var e=this;this.size=0;this.type=null;this.name=a;this.container=c;this.onchange=this.onreadystatechange=this.document=this.mimetype=this.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){null!==d&&(this.mimetype=b,d.loadAsDataURL(a,b,function(a,b){a&&runtime.log(a);e.url=b;if(e.onchange)e.onchange(e);if(e.onstatereadychange)e.onstatereadychange(e)}))}}var e=new odf.StyleInfo,f="urn:oasis:names:tc:opendocument:xmlns:office:1.0",d="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", -t="urn:webodf:names:scope",k="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),p=(new Date).getTime()+"_webodf_",h=new core.Base64;n.prototype=new function(){};n.prototype.constructor=n;n.namespaceURI=f;n.localName="document";a.prototype.load=function(){};a.prototype.getUrl=function(){return this.data?"data:;base64,"+h.toBase64(this.data):null};odf.OdfContainer=function s(h,k){function m(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,b.nodeType===Node.ELEMENT_NODE? -m(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b),b=c}function y(a,b){for(var c=a&&a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&c.setAttributeNS(t,"scope",b),c=c.nextSibling}function v(a,b){var c=null,d,e,h;if(a)for(c=a.cloneNode(!0),d=c.firstChild;d;)e=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(h=d.getAttributeNS(t,"scope"))&&h!==b&&c.removeChild(d),d=e;return c}function r(a){var b=I.rootElement.ownerDocument,c;if(a){m(a.documentElement);try{c=b.importNode(a.documentElement, -!0)}catch(d){}}return c}function z(a){I.state=a;if(I.onchange)I.onchange(I);if(I.onstatereadychange)I.onstatereadychange(I)}function G(a){ba=null;I.rootElement=a;a.fontFaceDecls=l(a,f,"font-face-decls");a.styles=l(a,f,"styles");a.automaticStyles=l(a,f,"automatic-styles");a.masterStyles=l(a,f,"master-styles");a.body=l(a,f,"body");a.meta=l(a,f,"meta")}function C(a){a=r(a);var c=I.rootElement;a&&"document-styles"===a.localName&&a.namespaceURI===f?(c.fontFaceDecls=l(a,f,"font-face-decls"),b(c,c.fontFaceDecls), -c.styles=l(a,f,"styles"),b(c,c.styles),c.automaticStyles=l(a,f,"automatic-styles"),y(c.automaticStyles,"document-styles"),b(c,c.automaticStyles),c.masterStyles=l(a,f,"master-styles"),b(c,c.masterStyles),e.prefixStyleNames(c.automaticStyles,p,c.masterStyles)):z(s.INVALID)}function L(a){a=r(a);var c,d,e;if(a&&"document-content"===a.localName&&a.namespaceURI===f){c=I.rootElement;d=l(a,f,"font-face-decls");if(c.fontFaceDecls&&d)for(e=d.firstChild;e;)c.fontFaceDecls.appendChild(e),e=d.firstChild;else d&& -(c.fontFaceDecls=d,b(c,d));d=l(a,f,"automatic-styles");y(d,"document-content");if(c.automaticStyles&&d)for(e=d.firstChild;e;)c.automaticStyles.appendChild(e),e=d.firstChild;else d&&(c.automaticStyles=d,b(c,d));c.body=l(a,f,"body");b(c,c.body)}else z(s.INVALID)}function B(a){a=r(a);var c;a&&("document-meta"===a.localName&&a.namespaceURI===f)&&(c=I.rootElement,c.meta=l(a,f,"meta"),b(c,c.meta))}function M(a){a=r(a);var c;a&&("document-settings"===a.localName&&a.namespaceURI===f)&&(c=I.rootElement,c.settings= -l(a,f,"settings"),b(c,c.settings))}function F(a){a=r(a);var b;if(a&&"manifest"===a.localName&&a.namespaceURI===d)for(b=I.rootElement,b.manifest=a,a=b.manifest.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&("file-entry"===a.localName&&a.namespaceURI===d)&&(R[a.getAttributeNS(d,"full-path")]=a.getAttributeNS(d,"media-type")),a=a.nextSibling}function K(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],J.loadAsDOM(c,function(b,c){d(c);b||I.state===s.INVALID||K(a)})):z(s.DONE)}function ea(a){var b="";odf.Namespaces.forEachPrefix(function(a, -c){b+=" xmlns:"+a+'="'+c+'"'});return''}function pa(){var a=new xmldom.LSSerializer,b=ea("document-meta");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(I.rootElement.meta,odf.Namespaces.namespaceMap);return b+""}function N(a,b){var c=document.createElementNS(d,"manifest:file-entry");c.setAttributeNS(d,"manifest:full-path",a);c.setAttributeNS(d,"manifest:media-type",b);return c}function qa(){var a= -runtime.parseXML(''),b=l(a,d,"manifest"),c=new xmldom.LSSerializer,e;for(e in R)R.hasOwnProperty(e)&&b.appendChild(N(e,R[e]));c.filter=new odf.OdfNodeFilter;return'\n'+c.writeToString(a,odf.Namespaces.namespaceMap)}function Z(){var a=new xmldom.LSSerializer,b=ea("document-settings");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(I.rootElement.settings,odf.Namespaces.namespaceMap); -return b+""}function $(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=v(I.rootElement.automaticStyles,"document-styles"),d=I.rootElement.masterStyles&&I.rootElement.masterStyles.cloneNode(!0),h=ea("document-styles");e.removePrefixFromStyleNames(c,p,d);b.filter=new g(d,c);h+=b.writeToString(I.rootElement.fontFaceDecls,a);h+=b.writeToString(I.rootElement.styles,a);h+=b.writeToString(c,a);h+=b.writeToString(d,a);return h+""}function Q(){var a= -odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,d=v(I.rootElement.automaticStyles,"document-content"),e=ea("document-content");b.filter=new c(I.rootElement.body,d);e+=b.writeToString(d,a);e+=b.writeToString(I.rootElement.body,a);return e+""}function W(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var d=r(c);d&&"document"===d.localName&&d.namespaceURI===f?(G(d),z(s.DONE)):z(s.INVALID)}})}function S(){function a(b,c){var e;c||(c=b);e=document.createElementNS(f, -c);d[b]=e;d.appendChild(e)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),d=I.rootElement,e=document.createElementNS(f,"text");b.save("mimetype",c,!1,new Date);a("meta");a("settings");a("scripts");a("fontFaceDecls","font-face-decls");a("styles");a("automaticStyles","automatic-styles");a("masterStyles","master-styles");a("body");d.body.appendChild(e);z(s.DONE);return b}function O(){var a,b=new Date;a=runtime.byteArrayFromString(Z(),"utf8"); -J.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(pa(),"utf8");J.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString($(),"utf8");J.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(Q(),"utf8");J.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(qa(),"utf8");J.save("META-INF/manifest.xml",a,!0,b)}function H(a,b){O();J.writeAs(a,function(a){b(a)})}var I=this,J,R={},ba;this.onstatereadychange=k;this.rootElement=this.state=this.onchange=null;this.setRootElement=G;this.getContentElement= -function(){var a;ba||(a=I.rootElement.body,ba=a.getElementsByTagNameNS(f,"text")[0]||a.getElementsByTagNameNS(f,"presentation")[0]||a.getElementsByTagNameNS(f,"spreadsheet")[0]);return ba};this.getDocumentType=function(){var a=I.getContentElement();return a&&a.localName};this.getPart=function(b){return new a(b,R[b],I,J)};this.getPartData=function(a,b){J.load(a,b)};this.createByteArray=function(a,b){O();J.createByteArray(a,b)};this.saveAs=H;this.save=function(a){H(h,a)};this.getUrl=function(){return h}; -this.state=s.LOADING;this.rootElement=function(a){var b=document.createElementNS(a.namespaceURI,a.localName),c;a=new a;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}(n);J=h?new core.Zip(h,function(a,b){J=b;a?W(h,function(b){a&&(J.error=a+"\n"+b,z(s.INVALID))}):K([["styles.xml",C],["content.xml",L],["meta.xml",B],["settings.xml",M],["META-INF/manifest.xml",F]])}):S()};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING= +odf.OdfContainer=function(){function l(a,b,c){for(a=a?a.firstChild:null;a;){if(a.localName===c&&a.namespaceURI===b)return a;a=a.nextSibling}return null}function m(a){var b,c=k.length;for(b=0;bc)break;f=f.nextSibling}a.insertBefore(b,f)}}}function n(a){this.OdfContainer=a}function a(a, +b,c,d){var f=this;this.size=0;this.type=null;this.name=a;this.container=c;this.onchange=this.onreadystatechange=this.document=this.mimetype=this.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){null!==d&&(this.mimetype=b,d.loadAsDataURL(a,b,function(a,b){a&&runtime.log(a);f.url=b;if(f.onchange)f.onchange(f);if(f.onstatereadychange)f.onstatereadychange(f)}))}}var h=new odf.StyleInfo,f="urn:oasis:names:tc:opendocument:xmlns:office:1.0",d="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", +t="urn:webodf:names:scope",k="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),q=(new Date).getTime()+"_webodf_",g=new core.Base64;n.prototype=new function(){};n.prototype.constructor=n;n.namespaceURI=f;n.localName="document";a.prototype.load=function(){};a.prototype.getUrl=function(){return this.data?"data:;base64,"+g.toBase64(this.data):null};odf.OdfContainer=function r(g,k){function m(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,b.nodeType===Node.ELEMENT_NODE? +m(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b),b=c}function y(a,b){for(var c=a&&a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&c.setAttributeNS(t,"scope",b),c=c.nextSibling}function v(a,b){var c=null,d,f,g;if(a)for(c=a.cloneNode(!0),d=c.firstChild;d;)f=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(g=d.getAttributeNS(t,"scope"))&&g!==b&&c.removeChild(d),d=f;return c}function s(a){var b=G.rootElement.ownerDocument,c;if(a){m(a.documentElement);try{c=b.importNode(a.documentElement, +!0)}catch(d){}}return c}function A(a){G.state=a;if(G.onchange)G.onchange(G);if(G.onstatereadychange)G.onstatereadychange(G)}function I(a){ca=null;G.rootElement=a;a.fontFaceDecls=l(a,f,"font-face-decls");a.styles=l(a,f,"styles");a.automaticStyles=l(a,f,"automatic-styles");a.masterStyles=l(a,f,"master-styles");a.body=l(a,f,"body");a.meta=l(a,f,"meta")}function D(a){a=s(a);var c=G.rootElement;a&&"document-styles"===a.localName&&a.namespaceURI===f?(c.fontFaceDecls=l(a,f,"font-face-decls"),b(c,c.fontFaceDecls), +c.styles=l(a,f,"styles"),b(c,c.styles),c.automaticStyles=l(a,f,"automatic-styles"),y(c.automaticStyles,"document-styles"),b(c,c.automaticStyles),c.masterStyles=l(a,f,"master-styles"),b(c,c.masterStyles),h.prefixStyleNames(c.automaticStyles,q,c.masterStyles)):A(r.INVALID)}function N(a){a=s(a);var c,d,g;if(a&&"document-content"===a.localName&&a.namespaceURI===f){c=G.rootElement;d=l(a,f,"font-face-decls");if(c.fontFaceDecls&&d)for(g=d.firstChild;g;)c.fontFaceDecls.appendChild(g),g=d.firstChild;else d&& +(c.fontFaceDecls=d,b(c,d));d=l(a,f,"automatic-styles");y(d,"document-content");if(c.automaticStyles&&d)for(g=d.firstChild;g;)c.automaticStyles.appendChild(g),g=d.firstChild;else d&&(c.automaticStyles=d,b(c,d));c.body=l(a,f,"body");b(c,c.body)}else A(r.INVALID)}function B(a){a=s(a);var c;a&&("document-meta"===a.localName&&a.namespaceURI===f)&&(c=G.rootElement,c.meta=l(a,f,"meta"),b(c,c.meta))}function L(a){a=s(a);var c;a&&("document-settings"===a.localName&&a.namespaceURI===f)&&(c=G.rootElement,c.settings= +l(a,f,"settings"),b(c,c.settings))}function C(a){a=s(a);var b;if(a&&"manifest"===a.localName&&a.namespaceURI===d)for(b=G.rootElement,b.manifest=a,a=b.manifest.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&("file-entry"===a.localName&&a.namespaceURI===d)&&(R[a.getAttributeNS(d,"full-path")]=a.getAttributeNS(d,"media-type")),a=a.nextSibling}function K(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],H.loadAsDOM(c,function(b,c){d(c);b||G.state===r.INVALID||K(a)})):A(r.DONE)}function ea(a){var b="";odf.Namespaces.forEachPrefix(function(a, +c){b+=" xmlns:"+a+'="'+c+'"'});return''}function pa(){var a=new xmldom.LSSerializer,b=ea("document-meta");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(G.rootElement.meta,odf.Namespaces.namespaceMap);return b+""}function M(a,b){var c=document.createElementNS(d,"manifest:file-entry");c.setAttributeNS(d,"manifest:full-path",a);c.setAttributeNS(d,"manifest:media-type",b);return c}function qa(){var a= +runtime.parseXML(''),b=l(a,d,"manifest"),c=new xmldom.LSSerializer,f;for(f in R)R.hasOwnProperty(f)&&b.appendChild(M(f,R[f]));c.filter=new odf.OdfNodeFilter;return'\n'+c.writeToString(a,odf.Namespaces.namespaceMap)}function Y(){var a=new xmldom.LSSerializer,b=ea("document-settings");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(G.rootElement.settings,odf.Namespaces.namespaceMap); +return b+""}function Z(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=v(G.rootElement.automaticStyles,"document-styles"),d=G.rootElement.masterStyles&&G.rootElement.masterStyles.cloneNode(!0),f=ea("document-styles");h.removePrefixFromStyleNames(c,q,d);b.filter=new e(d,c);f+=b.writeToString(G.rootElement.fontFaceDecls,a);f+=b.writeToString(G.rootElement.styles,a);f+=b.writeToString(c,a);f+=b.writeToString(d,a);return f+""}function Q(){var a= +odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,d=v(G.rootElement.automaticStyles,"document-content"),f=ea("document-content");b.filter=new c(G.rootElement.body,d);f+=b.writeToString(d,a);f+=b.writeToString(G.rootElement.body,a);return f+""}function $(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var d=s(c);d&&"document"===d.localName&&d.namespaceURI===f?(I(d),A(r.DONE)):A(r.INVALID)}})}function T(){function a(b,c){var g;c||(c=b);g=document.createElementNS(f, +c);d[b]=g;d.appendChild(g)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),d=G.rootElement,g=document.createElementNS(f,"text");b.save("mimetype",c,!1,new Date);a("meta");a("settings");a("scripts");a("fontFaceDecls","font-face-decls");a("styles");a("automaticStyles","automatic-styles");a("masterStyles","master-styles");a("body");d.body.appendChild(g);A(r.DONE);return b}function P(){var a,b=new Date;a=runtime.byteArrayFromString(Y(),"utf8"); +H.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(pa(),"utf8");H.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(Z(),"utf8");H.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(Q(),"utf8");H.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(qa(),"utf8");H.save("META-INF/manifest.xml",a,!0,b)}function J(a,b){P();H.writeAs(a,function(a){b(a)})}var G=this,H,R={},ca;this.onstatereadychange=k;this.rootElement=this.state=this.onchange=null;this.setRootElement=I;this.getContentElement= +function(){var a;ca||(a=G.rootElement.body,ca=a.getElementsByTagNameNS(f,"text")[0]||a.getElementsByTagNameNS(f,"presentation")[0]||a.getElementsByTagNameNS(f,"spreadsheet")[0]);return ca};this.getDocumentType=function(){var a=G.getContentElement();return a&&a.localName};this.getPart=function(b){return new a(b,R[b],G,H)};this.getPartData=function(a,b){H.load(a,b)};this.createByteArray=function(a,b){P();H.createByteArray(a,b)};this.saveAs=J;this.save=function(a){J(g,a)};this.getUrl=function(){return g}; +this.state=r.LOADING;this.rootElement=function(a){var b=document.createElementNS(a.namespaceURI,a.localName),c;a=new a;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}(n);H=g?new core.Zip(g,function(a,b){H=b;a?$(g,function(b){a&&(H.error=a+"\n"+b,A(r.INVALID))}):K([["styles.xml",D],["content.xml",N],["meta.xml",B],["settings.xml",L],["META-INF/manifest.xml",C]])}):T()};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING= 4;odf.OdfContainer.MODIFIED=5;odf.OdfContainer.getContainer=function(a){return new odf.OdfContainer(a,null)};return odf.OdfContainer}(); // Input 34 /* @@ -721,8 +721,8 @@ this.state=s.LOADING;this.rootElement=function(a){var b=document.createElementNS @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.Base64");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.OdfContainer"); -odf.FontLoader=function(){function l(c,b,n,a,e){var f,d=0,m;for(m in c)if(c.hasOwnProperty(m)){if(d===n){f=m;break}d+=1}f?b.getPartData(c[f].href,function(d,m){if(d)runtime.log(d);else{var h="@font-face { font-family: '"+(c[f].family||f)+"'; src: url(data:application/x-font-ttf;charset=binary;base64,"+g.convertUTF8ArrayToBase64(m)+') format("truetype"); }';try{a.insertRule(h,a.cssRules.length)}catch(q){runtime.log("Problem inserting rule in CSS: "+runtime.toJson(q)+"\nRule: "+h)}}l(c,b,n+1,a,e)}): -e&&e()}var m=new xmldom.XPath,g=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(c,b){for(var g=c.rootElement.fontFaceDecls;b.cssRules.length;)b.deleteRule(b.cssRules.length-1);if(g){var a={},e,f,d,t;if(g)for(g=m.getODFElementsWithXPath(g,"style:font-face[svg:font-face-src]",odf.Namespaces.resolvePrefix),e=0;e text|list-item > *:first-child:before {";if(ga=V.getAttributeNS(r, -"style-name")){V=q[ga];x=M.getFirstNonWhitespaceChild(V);V=void 0;if(x)if("list-level-style-number"===x.localName){V=x.getAttributeNS(A,"num-format");ga=x.getAttributeNS(A,"num-suffix");var D="",D={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},F=void 0,F=x.getAttributeNS(A,"num-prefix")||"",F=D.hasOwnProperty(V)?F+(" counter(list, "+D[V]+")"):V?F+("'"+V+"';"):F+" ''";ga&&(F+=" '"+ga+"'");V=D="content: "+F+";"}else"list-level-style-image"===x.localName?V="content: none;": -"list-level-style-bullet"===x.localName&&(V="content: '"+x.getAttributeNS(r,"bullet-char")+"';");x=V}if(Y){for(V=l[Y];V;)Y=V,V=l[Y];z+="counter-increment:"+Y+";";x?(x=x.replace("list",Y),z+=x):z+="content:counter("+Y+");"}else Y="",x?(x=x.replace("list",u),z+=x):z+="content: counter("+u+");",z+="counter-increment:"+u+";",g.insertRule("text|list#"+u+" {counter-reset:"+u+"}",g.cssRules.length);z+="}";l[u]=Y;z&&g.insertRule(z,g.cssRules.length)}P.insertBefore(K,P.firstChild);y();C(f);if(!b&&(f=[J],la.hasOwnProperty("statereadychange")))for(g= -la.statereadychange,x=0;x text|list-item > *:first-child:before {";if(ga=V.getAttributeNS(s, +"style-name")){V=p[ga];C=L.getFirstNonWhitespaceChild(V);V=void 0;if(C)if("list-level-style-number"===C.localName){V=C.getAttributeNS(z,"num-format");ga=C.getAttributeNS(z,"num-suffix");var x="",x={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},E=void 0,E=C.getAttributeNS(z,"num-prefix")||"",E=x.hasOwnProperty(V)?E+(" counter(list, "+x[V]+")"):V?E+("'"+V+"';"):E+" ''";ga&&(E+=" '"+ga+"'");V=x="content: "+E+";"}else"list-level-style-image"===C.localName?V="content: none;": +"list-level-style-bullet"===C.localName&&(V="content: '"+C.getAttributeNS(s,"bullet-char")+"';");C=V}if(X){for(V=l[X];V;)X=V,V=l[X];y+="counter-increment:"+X+";";C?(C=C.replace("list",X),y+=C):y+="content:counter("+X+");"}else X="",C?(C=C.replace("list",u),y+=C):y+="content: counter("+u+");",y+="counter-increment:"+u+";",e.insertRule("text|list#"+u+" {counter-reset:"+u+"}",e.cssRules.length);y+="}";l[u]=X;y&&e.insertRule(y,e.cssRules.length)}O.insertBefore(K,O.firstChild);A();D(g);if(!b&&(g=[H],la.hasOwnProperty("statereadychange")))for(e= +la.statereadychange,C=0;Cd?-e.countBackwardSteps(-d, -f):0;a.move(d);b&&(f=0b?-e.countBackwardSteps(-b,f):0,a.move(f,!0));g.emit(ops.OdtDocument.signalCursorMoved,a);return!0};this.spec=function(){return{optype:"MoveCursor",memberid:m,timestamp:g,position:c,length:b}}}; +ops.OpMoveCursor=function(){var l=this,m,e,c,b;this.init=function(n){m=n.memberid;e=n.timestamp;c=parseInt(n.position,10);b=void 0!==n.length?parseInt(n.length,10):0};this.merge=function(n){return"MoveCursor"===n.optype&&n.memberid===m?(c=n.position,b=n.length,e=n.timestamp,!0):!1};this.transform=function(e,a){var h=e.spec(),f=c+b,d,t=[l];switch(h.optype){case "RemoveText":d=h.position+h.length;d<=c?c-=h.length:h.positiond?-h.countBackwardSteps(-d, +f):0;a.move(d);b&&(f=0b?-h.countBackwardSteps(-b,f):0,a.move(f,!0));e.emit(ops.OdtDocument.signalCursorMoved,a);return!0};this.spec=function(){return{optype:"MoveCursor",memberid:m,timestamp:e,position:c,length:b}}}; // Input 46 /* @@ -1170,11 +1170,11 @@ f):0;a.move(d);b&&(f=0b?-e.countBackwardSteps(-b,f @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.OpInsertTable=function(){function l(a,c){var d;if(1===t.length)d=t[0];else if(3===t.length)switch(a){case 0:d=t[0];break;case b-1:d=t[2];break;default:d=t[1]}else d=t[a];if(1===d.length)return d[0];if(3===d.length)switch(c){case 0:return d[0];case n-1:return d[2];default:return d[1]}return d[c]}var m=this,g,c,b,n,a,e,f,d,t;this.init=function(k){g=k.memberid;c=k.timestamp;a=parseInt(k.position,10);b=parseInt(k.initialRows,10);n=parseInt(k.initialColumns,10);e=k.tableName;f=k.tableStyleName;d=k.tableColumnStyleName; -t=k.tableCellStyleMatrix};this.transform=function(b,c){var d=b.spec(),e=[m];switch(d.optype){case "InsertTable":e=null;break;case "AddAnnotation":d.position=a.textNode.length?null:a.textNode.splitText(a.offset));for(a=a.textNode;a!==f;)if(a=a.parentNode,d=a.cloneNode(!1),k){for(l&&d.appendChild(l);k.nextSibling;)d.appendChild(k.nextSibling); -a.parentNode.insertBefore(d,a.nextSibling);k=a;l=d}else a.parentNode.insertBefore(d,a),k=d,l=a;b.isListItem(l)&&(l=l.childNodes[0]);n.fixCursorPositions(m);n.getOdfCanvas().refreshSize();n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:e,memberId:m,timeStamp:g});n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:l,memberId:m,timeStamp:g});n.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:m,timestamp:g,position:c}}}; +ops.OpSplitParagraph=function(){var l=this,m,e,c,b=new odf.OdfUtils;this.init=function(b){m=b.memberid;e=b.timestamp;c=parseInt(b.position,10)};this.transform=function(b,a){var e=b.spec(),f=[l];switch(e.optype){case "SplitParagraph":e.position=a.textNode.length?null:a.textNode.splitText(a.offset));for(a=a.textNode;a!==f;)if(a=a.parentNode,d=a.cloneNode(!1),k){for(l&&d.appendChild(l);k.nextSibling;)d.appendChild(k.nextSibling); +a.parentNode.insertBefore(d,a.nextSibling);k=a;l=d}else a.parentNode.insertBefore(d,a),k=d,l=a;b.isListItem(l)&&(l=l.childNodes[0]);n.fixCursorPositions(m);n.getOdfCanvas().refreshSize();n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:h,memberId:m,timeStamp:e});n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:l,memberId:m,timeStamp:e});n.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:m,timestamp:e,position:c}}}; // Input 50 /* @@ -1330,8 +1330,8 @@ a.parentNode.insertBefore(d,a.nextSibling);k=a;l=d}else a.parentNode.insertBefor @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.OpSetParagraphStyle=function(){var l=this,m,g,c,b;this.init=function(n){m=n.memberid;g=n.timestamp;c=n.position;b=n.styleName};this.transform=function(c,a){var e=c.spec(),f=[l];switch(e.optype){case "RemoveParagraphStyle":e.styleName===b&&(b="")}return f};this.execute=function(n){var a;if(a=n.getPositionInTextNode(c))if(a=n.getParagraphElement(a.textNode))return""!==b?a.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",b):a.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0", -"style-name"),n.getOdfCanvas().refreshSize(),n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,timeStamp:g,memberId:m}),n.getOdfCanvas().rerenderAnnotations(),!0;return!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:m,timestamp:g,position:c,styleName:b}}}; +ops.OpSetParagraphStyle=function(){var l=this,m,e,c,b;this.init=function(n){m=n.memberid;e=n.timestamp;c=n.position;b=n.styleName};this.transform=function(c,a){var e=c.spec(),f=[l];switch(e.optype){case "RemoveParagraphStyle":e.styleName===b&&(b="")}return f};this.execute=function(n){var a;if(a=n.getPositionInTextNode(c))if(a=n.getParagraphElement(a.textNode))return""!==b?a.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",b):a.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0", +"style-name"),n.getOdfCanvas().refreshSize(),n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,timeStamp:e,memberId:m}),n.getOdfCanvas().rerenderAnnotations(),!0;return!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:m,timestamp:e,position:c,styleName:b}}}; // Input 51 /* @@ -1368,11 +1368,11 @@ ops.OpSetParagraphStyle=function(){var l=this,m,g,c,b;this.init=function(n){m=n. @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.Namespaces"); -ops.OpUpdateParagraphStyle=function(){function l(a,b){var c,d,e=b?b.split(","):[];for(c=0;ck?-h.countBackwardSteps(-k,d):0,m.move(d),e.emit(ops.OdtDocument.signalCursorMoved,m));e.getOdfCanvas().addAnnotation(f);return!0};this.spec=function(){return{optype:"AddAnnotation",memberid:g,timestamp:c,position:b, +ops.OpAddAnnotation=function(){function l(a,b,c){if(c=a.getPositionInTextNode(c,e))a=c.textNode,c.offset!==a.length&&a.splitText(c.offset),a.parentNode.insertBefore(b,a.nextSibling)}var m=this,e,c,b,n,a;this.init=function(h){e=h.memberid;c=parseInt(h.timestamp,10);b=parseInt(h.position,10);n=parseInt(h.length,10)||0;a=h.name};this.transform=function(a,c){var d=a.spec(),e=b+n,k=[m];switch(d.optype){case "AddAnnotation":d.positionk?-g.countBackwardSteps(-k,d):0,m.move(d),h.emit(ops.OdtDocument.signalCursorMoved,m));h.getOdfCanvas().addAnnotation(f);return!0};this.spec=function(){return{optype:"AddAnnotation",memberid:e,timestamp:c,position:b, length:n,name:a}}}; // Input 55 /* @@ -1524,9 +1524,9 @@ length:n,name:a}}}; @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.Namespaces");runtime.loadClass("core.DomUtils"); -ops.OpRemoveAnnotation=function(){var l,m,g,c,b;this.init=function(n){l=n.memberid;m=n.timestamp;g=parseInt(n.position,10);c=parseInt(n.length,10);b=new core.DomUtils};this.transform=function(b,a){return null};this.execute=function(c){for(var a=c.getIteratorAtPosition(g).container(),e,f=null,d=null;a.namespaceURI!==odf.Namespaces.officens||"annotation"!==a.localName;)a=a.parentNode;if(null===a)return!1;f=a;(e=f.getAttributeNS(odf.Namespaces.officens,"name"))&&(d=b.getElementsByTagNameNS(c.getRootNode(), -odf.Namespaces.officens,"annotation-end").filter(function(a){return e===a.getAttributeNS(odf.Namespaces.officens,"name")})[0]||null);c.getOdfCanvas().forgetAnnotations();for(a=b.getElementsByTagNameNS(f,odf.Namespaces.webodfns+":names:cursor","cursor");a.length;)f.parentNode.insertBefore(a.pop(),f);f.parentNode.removeChild(f);d&&d.parentNode.removeChild(d);c.fixCursorPositions();c.getOdfCanvas().refreshAnnotations();return!0};this.spec=function(){return{optype:"RemoveAnnotation",memberid:l,timestamp:m, -position:g,length:c}}}; +ops.OpRemoveAnnotation=function(){var l,m,e,c,b;this.init=function(n){l=n.memberid;m=n.timestamp;e=parseInt(n.position,10);c=parseInt(n.length,10);b=new core.DomUtils};this.transform=function(b,a){return null};this.execute=function(c){for(var a=c.getIteratorAtPosition(e).container(),h,f=null,d=null;a.namespaceURI!==odf.Namespaces.officens||"annotation"!==a.localName;)a=a.parentNode;if(null===a)return!1;f=a;(h=f.getAttributeNS(odf.Namespaces.officens,"name"))&&(d=b.getElementsByTagNameNS(c.getRootNode(), +odf.Namespaces.officens,"annotation-end").filter(function(a){return h===a.getAttributeNS(odf.Namespaces.officens,"name")})[0]||null);c.getOdfCanvas().forgetAnnotations();for(a=b.getElementsByTagNameNS(f,odf.Namespaces.webodfns+":names:cursor","cursor");a.length;)f.parentNode.insertBefore(a.pop(),f);f.parentNode.removeChild(f);d&&d.parentNode.removeChild(d);c.fixCursorPositions();c.getOdfCanvas().refreshAnnotations();return!0};this.spec=function(){return{optype:"RemoveAnnotation",memberid:l,timestamp:m, +position:e,length:c}}}; // Input 56 /* @@ -1564,21 +1564,21 @@ position:g,length:c}}}; */ runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpApplyDirectStyling");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertTable");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpAddParagraphStyle");runtime.loadClass("ops.OpRemoveParagraphStyle"); runtime.loadClass("ops.OpAddAnnotation");runtime.loadClass("ops.OpRemoveAnnotation"); -ops.OperationFactory=function(){function l(g){return function(){return new g}}var m;this.register=function(g,c){m[g]=c};this.create=function(g){var c=null,b=m[g.optype];b&&(c=b(g),c.init(g));return c};m={AddCursor:l(ops.OpAddCursor),ApplyDirectStyling:l(ops.OpApplyDirectStyling),InsertTable:l(ops.OpInsertTable),InsertText:l(ops.OpInsertText),RemoveText:l(ops.OpRemoveText),SplitParagraph:l(ops.OpSplitParagraph),SetParagraphStyle:l(ops.OpSetParagraphStyle),UpdateParagraphStyle:l(ops.OpUpdateParagraphStyle), +ops.OperationFactory=function(){function l(e){return function(){return new e}}var m;this.register=function(e,c){m[e]=c};this.create=function(e){var c=null,b=m[e.optype];b&&(c=b(e),c.init(e));return c};m={AddCursor:l(ops.OpAddCursor),ApplyDirectStyling:l(ops.OpApplyDirectStyling),InsertTable:l(ops.OpInsertTable),InsertText:l(ops.OpInsertText),RemoveText:l(ops.OpRemoveText),SplitParagraph:l(ops.OpSplitParagraph),SetParagraphStyle:l(ops.OpSetParagraphStyle),UpdateParagraphStyle:l(ops.OpUpdateParagraphStyle), AddParagraphStyle:l(ops.OpAddParagraphStyle),RemoveParagraphStyle:l(ops.OpRemoveParagraphStyle),MoveCursor:l(ops.OpMoveCursor),RemoveCursor:l(ops.OpRemoveCursor),AddAnnotation:l(ops.OpAddAnnotation),RemoveAnnotation:l(ops.OpRemoveAnnotation)}}; // Input 57 runtime.loadClass("core.Cursor");runtime.loadClass("core.PositionIterator");runtime.loadClass("core.PositionFilter");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.OdfUtils"); -gui.SelectionMover=function(l,m){function g(){u.setUnfilteredPosition(l.getNode(),0);return u}function c(a,b){var c,d=null;a&&(c=b?a[a.length-1]:a[0]);c&&(d={top:c.top,left:b?c.right:c.left,bottom:c.bottom});return d}function b(a,d,e,h){var f=a.nodeType;e.setStart(a,d);e.collapse(!h);h=c(e.getClientRects(),!0===h);!h&&0a?-1:1;for(a=Math.abs(a);0n?l.previousPosition():l.nextPosition());)if(I.check(),k.acceptPosition(l)===v&&(s+=1,q=l.container(),w=b(q,l.unfilteredDomOffset(),H),w.top!==W)){if(w.top!==O&&O!==W)break;O=w.top;w=Math.abs(S-w.left);if(null===u||wa?(d=k.previousPosition,e=-1):(d=k.nextPosition,e=1);for(h=b(k.container(),k.unfilteredDomOffset(),q);d.call(k);)if(c.acceptPosition(k)===v){if(w.getParagraphElement(k.getCurrentNode())!==n)break;f=b(k.container(),k.unfilteredDomOffset(),q);if(f.bottom!==h.bottom&&(h=f.top>=h.top&&f.bottomh.bottom,!h))break;l+=e;h=f}q.detach();return l}function q(a,b){for(var c=0,d;a.parentNode!==b;)runtime.assert(null!==a.parentNode,"parent is null"), -a=a.parentNode;for(d=b.firstChild;d!==a;)c+=1,d=d.nextSibling;return c}function s(a,b,c){runtime.assert(null!==a,"SelectionMover.countStepsToPosition called with element===null");var d=g(),e=d.container(),h=d.unfilteredDomOffset(),f=0,k=new core.LoopWatchDog(1E3);d.setUnfilteredPosition(a,b);a=d.container();runtime.assert(Boolean(a),"SelectionMover.countStepsToPosition: positionIterator.container() returned null");b=d.unfilteredDomOffset();d.setUnfilteredPosition(e,h);var e=a,h=b,n=d.container(), -l=d.unfilteredDomOffset();if(e===n)e=l-h;else{var m=e.compareDocumentPosition(n);2===m?m=-1:4===m?m=1:10===m?(h=q(e,n),m=he)for(;d.nextPosition()&&(k.check(),c.acceptPosition(d)===v&&(f+=1),d.container()!==a||d.unfilteredDomOffset()!==b););else if(0a?-1:1;for(a=Math.abs(a);0n?l.previousPosition():l.nextPosition());)if(H.check(),k.acceptPosition(l)===s&&(r+=1,p=l.container(),w=b(p,l.unfilteredDomOffset(),G),w.top!==z)){if(w.top!==J&&J!==z)break;J=w.top;w=Math.abs(P-w.left);if(null===u||wa?(d=k.previousPosition,f=-1):(d=k.nextPosition,f=1);for(g=b(k.container(),k.unfilteredDomOffset(),p);d.call(k);)if(c.acceptPosition(k)===s){if(u.getParagraphElement(k.getCurrentNode())!==n)break;h=b(k.container(),k.unfilteredDomOffset(),p);if(h.bottom!==g.bottom&&(g=h.top>=g.top&&h.bottomg.bottom,!g))break;l+=f;g=h}p.detach();return l}function p(a,b){for(var c=0,d;a.parentNode!==b;)runtime.assert(null!==a.parentNode,"parent is null"), +a=a.parentNode;for(d=b.firstChild;d!==a;)c+=1,d=d.nextSibling;return c}function r(a,b,c,d){if(a===c)return d-b;var f=a.compareDocumentPosition(c);2===f?f=-1:4===f?f=1:10===f?(b=p(a,c),f=bf)for(;d.nextPosition()&&(k.check(),c.acceptPosition(d)===s&&(h+=1),d.container()!==a||d.unfilteredDomOffset()!==b););else if(0=r(a,b,d.container(),d.unfilteredDomOffset()))););return h}var u,z,y,v,s=core.PositionFilter.FilterResult.FILTER_ACCEPT;this.movePointForward=function(a,b){return n(a,b,z.nextPosition)};this.movePointBackward= +function(a,b){return n(a,b,z.previousPosition)};this.getStepCounter=function(){return{countForwardSteps:h,countBackwardSteps:t,convertForwardStepsBetweenFilters:f,convertBackwardStepsBetweenFilters:d,countLinesSteps:q,countStepsToLineBoundary:g,countStepsToPosition:w,isPositionWalkable:a,countStepsToValidPosition:k}};(function(){u=new odf.OdfUtils;z=gui.SelectionMover.createPositionIterator(m);var a=m.ownerDocument.createRange();a.setStart(z.container(),z.unfilteredDomOffset());a.collapse(!0);l.setSelectedRange(a)})()}; +gui.SelectionMover.createPositionIterator=function(l){var m=new function(){this.acceptNode=function(e){return"urn:webodf:names:cursor"===e.namespaceURI||"urn:webodf:names:editinfo"===e.namespaceURI?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}};return new core.PositionIterator(l,5,m,!1)};(function(){return gui.SelectionMover})(); // Input 58 /* @@ -1615,11 +1615,11 @@ u.unfilteredDomOffset());a.collapse(!0);l.setSelectedRange(a)})()};gui.Selection @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertTable");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpAddParagraphStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpRemoveParagraphStyle"); -ops.OperationTransformer=function(){function l(g,c){for(var b,n,a,e=[],f=[];0=b&&(e=-c.movePointBackward(-b,a));g.handleUpdate();return e};this.handleUpdate=function(){};this.getStepCounter=function(){return c.getStepCounter()};this.getMemberId=function(){return l};this.getNode=function(){return b.getNode()};this.getAnchorNode=function(){return b.getAnchorNode()};this.getSelectedRange=function(){return b.getSelectedRange()}; +ops.OdtCursor=function(l,m){var e=this,c,b;this.removeFromOdtDocument=function(){b.remove()};this.move=function(b,a){var h=0;0=b&&(h=-c.movePointBackward(-b,a));e.handleUpdate();return h};this.handleUpdate=function(){};this.getStepCounter=function(){return c.getStepCounter()};this.getMemberId=function(){return l};this.getNode=function(){return b.getNode()};this.getAnchorNode=function(){return b.getAnchorNode()};this.getSelectedRange=function(){return b.getSelectedRange()}; this.getOdtDocument=function(){return m};b=new core.Cursor(m.getDOM(),l);c=new gui.SelectionMover(b,m.getRootNode())}; // Input 60 /* @@ -1656,16 +1656,16 @@ this.getOdtDocument=function(){return m};b=new core.Cursor(m.getDOM(),l);c=new g @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.EditInfo=function(l,m){function g(){var c=[],a;for(a in b)b.hasOwnProperty(a)&&c.push({memberid:a,time:b[a].time});c.sort(function(a,b){return a.time-b.time});return c}var c,b={};this.getNode=function(){return c};this.getOdtDocument=function(){return m};this.getEdits=function(){return b};this.getSortedEdits=function(){return g()};this.addEdit=function(c,a){b[c]={time:a}};this.clearEdits=function(){b={}};this.destroy=function(b){l.removeChild(c);b()};c=m.getDOM().createElementNS("urn:webodf:names:editinfo", +ops.EditInfo=function(l,m){function e(){var c=[],a;for(a in b)b.hasOwnProperty(a)&&c.push({memberid:a,time:b[a].time});c.sort(function(a,b){return a.time-b.time});return c}var c,b={};this.getNode=function(){return c};this.getOdtDocument=function(){return m};this.getEdits=function(){return b};this.getSortedEdits=function(){return e()};this.addEdit=function(c,a){b[c]={time:a}};this.clearEdits=function(){b={}};this.destroy=function(b){l.removeChild(c);b()};c=m.getDOM().createElementNS("urn:webodf:names:editinfo", "editinfo");l.insertBefore(c,l.firstChild)}; // Input 61 -gui.Avatar=function(l,m){var g=this,c,b,n;this.setColor=function(a){b.style.borderColor=a};this.setImageUrl=function(a){g.isVisible()?b.src=a:n=a};this.isVisible=function(){return"block"===c.style.display};this.show=function(){n&&(b.src=n,n=void 0);c.style.display="block"};this.hide=function(){c.style.display="none"};this.markAsFocussed=function(a){c.className=a?"active":""};this.destroy=function(a){l.removeChild(c);a()};(function(){var a=l.ownerDocument,e=a.documentElement.namespaceURI;c=a.createElementNS(e, +gui.Avatar=function(l,m){var e=this,c,b,n;this.setColor=function(a){b.style.borderColor=a};this.setImageUrl=function(a){e.isVisible()?b.src=a:n=a};this.isVisible=function(){return"block"===c.style.display};this.show=function(){n&&(b.src=n,n=void 0);c.style.display="block"};this.hide=function(){c.style.display="none"};this.markAsFocussed=function(a){c.className=a?"active":""};this.destroy=function(a){l.removeChild(c);a()};(function(){var a=l.ownerDocument,e=a.documentElement.namespaceURI;c=a.createElementNS(e, "div");b=a.createElementNS(e,"img");b.width=64;b.height=64;c.appendChild(b);c.style.width="64px";c.style.height="70px";c.style.position="absolute";c.style.top="-80px";c.style.left="-34px";c.style.display=m?"block":"none";l.appendChild(c)})()}; // Input 62 runtime.loadClass("gui.Avatar");runtime.loadClass("ops.OdtCursor"); -gui.Caret=function(l,m,g){function c(g){e&&a.parentNode&&(!f||g)&&(g&&void 0!==d&&runtime.clearTimeout(d),f=!0,b.style.opacity=g||"0"===b.style.opacity?"1":"0",d=runtime.setTimeout(function(){f=!1;c(!1)},500))}var b,n,a,e=!1,f=!1,d;this.refreshCursorBlinking=function(){g||l.getSelectedRange().collapsed?(e=!0,c(!0)):(e=!1,b.style.opacity="0")};this.setFocus=function(){e=!0;n.markAsFocussed(!0);c(!0)};this.removeFocus=function(){e=!1;n.markAsFocussed(!1);b.style.opacity="0"};this.setAvatarImageUrl= -function(a){n.setImageUrl(a)};this.setColor=function(a){b.style.borderColor=a;n.setColor(a)};this.getCursor=function(){return l};this.getFocusElement=function(){return b};this.toggleHandleVisibility=function(){n.isVisible()?n.hide():n.show()};this.showHandle=function(){n.show()};this.hideHandle=function(){n.hide()};this.ensureVisible=function(){var a,c,d,e,f=l.getOdtDocument().getOdfCanvas().getElement().parentNode,g;d=f.offsetWidth-f.clientWidth+5;e=f.offsetHeight-f.clientHeight+5;g=b.getBoundingClientRect(); -a=g.left-d;c=g.top-e;d=g.right+d;e=g.bottom+e;g=f.getBoundingClientRect();cg.bottom&&(f.scrollTop+=e-g.bottom);ag.right&&(f.scrollLeft+=d-g.right)};this.destroy=function(c){n.destroy(function(d){d?c(d):(a.removeChild(b),c())})};(function(){var c=l.getOdtDocument().getDOM();b=c.createElementNS(c.documentElement.namespaceURI,"span");a=l.getNode();a.appendChild(b);n=new gui.Avatar(a,m)})()}; +gui.Caret=function(l,m,e){function c(e){h&&a.parentNode&&(!f||e)&&(e&&void 0!==d&&runtime.clearTimeout(d),f=!0,b.style.opacity=e||"0"===b.style.opacity?"1":"0",d=runtime.setTimeout(function(){f=!1;c(!1)},500))}var b,n,a,h=!1,f=!1,d;this.refreshCursorBlinking=function(){e||l.getSelectedRange().collapsed?(h=!0,c(!0)):(h=!1,b.style.opacity="0")};this.setFocus=function(){h=!0;n.markAsFocussed(!0);c(!0)};this.removeFocus=function(){h=!1;n.markAsFocussed(!1);b.style.opacity="0"};this.setAvatarImageUrl= +function(a){n.setImageUrl(a)};this.setColor=function(a){b.style.borderColor=a;n.setColor(a)};this.getCursor=function(){return l};this.getFocusElement=function(){return b};this.toggleHandleVisibility=function(){n.isVisible()?n.hide():n.show()};this.showHandle=function(){n.show()};this.hideHandle=function(){n.hide()};this.ensureVisible=function(){var a,c,d,f,e=l.getOdtDocument().getOdfCanvas().getElement().parentNode,h;d=e.offsetWidth-e.clientWidth+5;f=e.offsetHeight-e.clientHeight+5;h=b.getBoundingClientRect(); +a=h.left-d;c=h.top-f;d=h.right+d;f=h.bottom+f;h=e.getBoundingClientRect();ch.bottom&&(e.scrollTop+=f-h.bottom);ah.right&&(e.scrollLeft+=d-h.right)};this.destroy=function(c){n.destroy(function(d){d?c(d):(a.removeChild(b),c())})};(function(){var c=l.getOdtDocument().getDOM();b=c.createElementNS(c.documentElement.namespaceURI,"span");a=l.getNode();a.appendChild(b);n=new gui.Avatar(a,m)})()}; // Input 63 /* @@ -1701,8 +1701,8 @@ a=g.left-d;c=g.top-e;d=g.right+d;e=g.bottom+e;g=f.getBoundingClientRect();ca.length&&(a.position+=a.length,a.length=-a.length);return a}function Q(a){var b=new ops.OpRemoveText;b.init({memberid:m,position:a.position,length:a.length});return b}function W(){var a=$(x.getCursorSelection(m)), -b=null;0===a.length?0a.length&&(a.position+=a.length,a.length=-a.length);return a}function Q(a){var b=new ops.OpRemoveText;b.init({memberid:m,position:a.position,length:a.length});return b}function $(){var a=Z(x.getCursorSelection(m)), +b=null;0===a.length?0k?(g(1,0),e=g(0.5,1E4-k),f=g(0.2,2E4-k)):1E4<=k&&2E4>k?(g(0.5,0),f=g(0.2,2E4-k)):g(0.2,0)};this.getEdits= +gui.EditInfoMarker=function(l,m){function e(b,c){return runtime.getWindow().setTimeout(function(){a.style.opacity=b},c)}var c=this,b,n,a,h,f;this.addEdit=function(b,c){var k=Date.now()-c;l.addEdit(b,c);n.setEdits(l.getSortedEdits());a.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",b);if(h){var m=h;runtime.getWindow().clearTimeout(m)}f&&(m=f,runtime.getWindow().clearTimeout(m));1E4>k?(e(1,0),h=e(0.5,1E4-k),f=e(0.2,2E4-k)):1E4<=k&&2E4>k?(e(0.5,0),f=e(0.2,2E4-k)):e(0.2,0)};this.getEdits= function(){return l.getEdits()};this.clearEdits=function(){l.clearEdits();n.setEdits([]);a.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&a.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return l};this.show=function(){a.style.display="block"};this.hide=function(){c.hideHandle();a.style.display="none"};this.showHandle=function(){n.show()};this.hideHandle=function(){n.hide()};this.destroy=function(c){b.removeChild(a);n.destroy(function(a){a? c(a):l.destroy(c)})};(function(){var d=l.getOdtDocument().getDOM();a=d.createElementNS(d.documentElement.namespaceURI,"div");a.setAttribute("class","editInfoMarker");a.onmouseover=function(){c.showHandle()};a.onmouseout=function(){c.hideHandle()};b=l.getNode();b.appendChild(a);n=new gui.EditInfoHandle(b);m||c.hide()})()}; // Input 74 @@ -2077,12 +2077,12 @@ c(a):l.destroy(c)})};(function(){var d=l.getOdtDocument().getDOM();a=d.createEle @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("gui.Caret");runtime.loadClass("ops.TrivialMemberModel");runtime.loadClass("ops.EditInfo");runtime.loadClass("gui.EditInfoMarker");gui.SessionViewOptions=function(){this.caretBlinksOnRangeSelect=this.caretAvatarsInitiallyVisible=this.editInfoMarkersInitiallyVisible=!0}; -gui.SessionView=function(){return function(l,m,g){function c(a,b,c){function d(b,c,e){c=b+'[editinfo|memberid^="'+a+'"]'+e+c;a:{var h=t.firstChild;for(b=b+'[editinfo|memberid^="'+a+'"]'+e;h;){if(h.nodeType===Node.TEXT_NODE&&0===h.data.indexOf(b)){b=h;break a}h=h.nextSibling}b=null}b?b.data=c:t.appendChild(document.createTextNode(c))}d("div.editInfoMarker","{ background-color: "+c+"; }","");d("span.editInfoColor","{ background-color: "+c+"; }","");d("span.editInfoAuthor",'{ content: "'+b+'"; }',":before"); -d("dc|creator",'{ content: "'+b+'"; display: none;}',":before");d("dc|creator","{ background-color: "+c+"; }","")}function b(a){var b,c;for(c in p)p.hasOwnProperty(c)&&(b=p[c],a?b.show():b.hide())}function n(a){g.getCarets().forEach(function(b){a?b.showHandle():b.hideHandle()})}function a(a,b){var d=g.getCaret(a);b?(d&&(d.setAvatarImageUrl(b.imageurl),d.setColor(b.color)),c(a,b.fullname,b.color)):runtime.log('MemberModel sent undefined data for member "'+a+'".')}function e(b){var c=b.getMemberId(), -d=m.getMemberModel();g.registerCursor(b,q,s);a(c,null);d.getMemberDetailsAndUpdates(c,a);runtime.log("+++ View here +++ eagerly created an Caret for '"+c+"'! +++")}function f(b){var c=!1,d;for(d in p)if(p.hasOwnProperty(d)&&p[d].getEditInfo().getEdits().hasOwnProperty(b)){c=!0;break}c||m.getMemberModel().unsubscribeMemberDetailsUpdates(b,a)}function d(a){var b=a.paragraphElement,c=a.memberId;a=a.timeStamp;var d,e="",f=b.getElementsByTagNameNS(k,"editinfo")[0];f?(e=f.getAttributeNS(k,"id"),d=p[e]): -(e=Math.random().toString(),d=new ops.EditInfo(b,m.getOdtDocument()),d=new gui.EditInfoMarker(d,h),f=b.getElementsByTagNameNS(k,"editinfo")[0],f.setAttributeNS(k,"id",e),p[e]=d);d.addEdit(c,new Date(a))}var t,k="urn:webodf:names:editinfo",p={},h=void 0!==l.editInfoMarkersInitiallyVisible?Boolean(l.editInfoMarkersInitiallyVisible):!0,q=void 0!==l.caretAvatarsInitiallyVisible?Boolean(l.caretAvatarsInitiallyVisible):!0,s=void 0!==l.caretBlinksOnRangeSelect?Boolean(l.caretBlinksOnRangeSelect):!0;this.showEditInfoMarkers= -function(){h||(h=!0,b(h))};this.hideEditInfoMarkers=function(){h&&(h=!1,b(h))};this.showCaretAvatars=function(){q||(q=!0,n(q))};this.hideCaretAvatars=function(){q&&(q=!1,n(q))};this.getSession=function(){return m};this.getCaret=function(a){return g.getCaret(a)};this.destroy=function(b){var c=m.getOdtDocument(),h=m.getMemberModel(),k=Object.keys(p).map(function(a){return p[a]});c.subscribe(ops.OdtDocument.signalCursorAdded,e);c.subscribe(ops.OdtDocument.signalCursorRemoved,f);c.subscribe(ops.OdtDocument.signalParagraphChanged, -d);g.getCarets().forEach(function(b){h.unsubscribeMemberDetailsUpdates(b.getCursor().getMemberId(),a)});t.parentNode.removeChild(t);(function r(a,c){c?b(c):ab?-1:b-1})};c.slideChange=function(b){var g=c.getPages(c.odf_canvas.odfContainer().rootElement),a=-1,e=0;g.forEach(function(b){b=b[1];b.hasAttribute("slide_current")&&(a=e,b.removeAttribute("slide_current"));e+=1});b=b(a,g.length);-1===b&&(b=a);g[b][1].setAttribute("slide_current", -"1");document.getElementById("pagelist").selectedIndex=b;"cont"===c.slide_mode&&m.scrollBy(0,g[b][1].getBoundingClientRect().top-30)};c.selectSlide=function(b){c.slideChange(function(c,a){return b>=a||0>b?-1:b})};c.scrollIntoContView=function(b){var g=c.getPages(c.odf_canvas.odfContainer().rootElement);0!==g.length&&m.scrollBy(0,g[b][1].getBoundingClientRect().top-30)};c.getPages=function(b){b=b.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var c=[],a;for(a=0;ab?-1:b-1})};c.slideChange=function(b){var e=c.getPages(c.odf_canvas.odfContainer().rootElement),a=-1,h=0;e.forEach(function(b){b=b[1];b.hasAttribute("slide_current")&&(a=h,b.removeAttribute("slide_current"));h+=1});b=b(a,e.length);-1===b&&(b=a);e[b][1].setAttribute("slide_current", +"1");document.getElementById("pagelist").selectedIndex=b;"cont"===c.slide_mode&&m.scrollBy(0,e[b][1].getBoundingClientRect().top-30)};c.selectSlide=function(b){c.slideChange(function(c,a){return b>=a||0>b?-1:b})};c.scrollIntoContView=function(b){var e=c.getPages(c.odf_canvas.odfContainer().rootElement);0!==e.length&&m.scrollBy(0,e[b][1].getBoundingClientRect().top-30)};c.getPages=function(b){b=b.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var c=[],a;for(a=0;a=a.rangeCount||!q)||(a=a.getRangeAt(0),q.setPoint(a.startContainer,a.startOffset))}function n(){var a=l.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();q&&q.node()&&(b=q.node(),c=b.ownerDocument.createRange(), -c.setStart(b,q.position()),c.collapse(!0),a.addRange(c))}function a(a){var d=a.charCode||a.keyCode;if(q=null,q&&37===d)b(),q.stepBackward(),n();else if(16<=d&&20>=d||33<=d&&40>=d)return;c(a)}function e(a){c(a)}function f(a){for(var b=a.firstChild;b&&b!==a;)b.nodeType===Node.ELEMENT_NODE&&f(b),b=b.nextSibling||b.parentNode;var c,d,e,b=a.attributes;c="";for(e=b.length-1;0<=e;e-=1)d=b.item(e),c=c+" "+d.nodeName+'="'+d.nodeValue+'"';a.setAttribute("customns_name",a.nodeName);a.setAttribute("customns_atts", -c);b=a.firstChild;for(d=/^\s*$/;b&&b!==a;)c=b,b=b.nextSibling||b.parentNode,c.nodeType===Node.TEXT_NODE&&d.test(c.nodeValue)&&c.parentNode.removeChild(c)}function d(a,b){for(var c=a.firstChild,e,h,f;c&&c!==a;){if(c.nodeType===Node.ELEMENT_NODE)for(d(c,b),e=c.attributes,f=e.length-1;0<=f;f-=1)h=e.item(f),"http://www.w3.org/2000/xmlns/"!==h.namespaceURI||b[h.nodeValue]||(b[h.nodeValue]=h.localName);c=c.nextSibling||c.parentNode}}function t(){var a=l.ownerDocument.createElement("style"),b;b={};d(l,b); -var c={},e,h,f=0;for(e in b)if(b.hasOwnProperty(e)&&e){h=b[e];if(!h||c.hasOwnProperty(h)||"xmlns"===h){do h="ns"+f,f+=1;while(c.hasOwnProperty(h));b[e]=h}c[h]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+k;a.appendChild(l.ownerDocument.createTextNode(b));m=m.parentNode.replaceChild(a,m)}var k,p,h,q=null;l.id||(l.id="xml"+String(Math.random()).substring(2));p="#"+l.id+" ";k=p+"*,"+p+":visited, "+p+":link {display:block; margin: 0px; margin-left: 10px; font-size: medium; color: black; background: white; font-variant: normal; font-weight: normal; font-style: normal; font-family: sans-serif; text-decoration: none; white-space: pre-wrap; height: auto; width: auto}\n"+ -p+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+p+":after {color: blue; content: '';}\n"+p+"{overflow: auto;}\n";(function(b){g(b,"click",e);g(b,"keydown",a);g(b,"drop",c);g(b,"dragend",c);g(b,"beforepaste",c);g(b,"paste",c)})(l);this.updateCSS=t;this.setXML=function(a){a=a.documentElement||a;h=a=l.ownerDocument.importNode(a,!0);for(f(a);l.lastChild;)l.removeChild(l.lastChild);l.appendChild(a);t();q=new core.PositionIterator(a)};this.getXML= -function(){return h}}; +gui.XMLEdit=function(l,m){function e(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function c(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function b(){var a=l.ownerDocument.defaultView.getSelection();!a||(0>=a.rangeCount||!p)||(a=a.getRangeAt(0),p.setPoint(a.startContainer,a.startOffset))}function n(){var a=l.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();p&&p.node()&&(b=p.node(),c=b.ownerDocument.createRange(), +c.setStart(b,p.position()),c.collapse(!0),a.addRange(c))}function a(a){var d=a.charCode||a.keyCode;if(p=null,p&&37===d)b(),p.stepBackward(),n();else if(16<=d&&20>=d||33<=d&&40>=d)return;c(a)}function h(a){c(a)}function f(a){for(var b=a.firstChild;b&&b!==a;)b.nodeType===Node.ELEMENT_NODE&&f(b),b=b.nextSibling||b.parentNode;var c,d,e,b=a.attributes;c="";for(e=b.length-1;0<=e;e-=1)d=b.item(e),c=c+" "+d.nodeName+'="'+d.nodeValue+'"';a.setAttribute("customns_name",a.nodeName);a.setAttribute("customns_atts", +c);b=a.firstChild;for(d=/^\s*$/;b&&b!==a;)c=b,b=b.nextSibling||b.parentNode,c.nodeType===Node.TEXT_NODE&&d.test(c.nodeValue)&&c.parentNode.removeChild(c)}function d(a,b){for(var c=a.firstChild,f,e,g;c&&c!==a;){if(c.nodeType===Node.ELEMENT_NODE)for(d(c,b),f=c.attributes,g=f.length-1;0<=g;g-=1)e=f.item(g),"http://www.w3.org/2000/xmlns/"!==e.namespaceURI||b[e.nodeValue]||(b[e.nodeValue]=e.localName);c=c.nextSibling||c.parentNode}}function t(){var a=l.ownerDocument.createElement("style"),b;b={};d(l,b); +var c={},f,e,g=0;for(f in b)if(b.hasOwnProperty(f)&&f){e=b[f];if(!e||c.hasOwnProperty(e)||"xmlns"===e){do e="ns"+g,g+=1;while(c.hasOwnProperty(e));b[f]=e}c[e]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+k;a.appendChild(l.ownerDocument.createTextNode(b));m=m.parentNode.replaceChild(a,m)}var k,q,g,p=null;l.id||(l.id="xml"+String(Math.random()).substring(2));q="#"+l.id+" ";k=q+"*,"+q+":visited, "+q+":link {display:block; margin: 0px; margin-left: 10px; font-size: medium; color: black; background: white; font-variant: normal; font-weight: normal; font-style: normal; font-family: sans-serif; text-decoration: none; white-space: pre-wrap; height: auto; width: auto}\n"+ +q+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+q+":after {color: blue; content: '';}\n"+q+"{overflow: auto;}\n";(function(b){e(b,"click",h);e(b,"keydown",a);e(b,"drop",c);e(b,"dragend",c);e(b,"beforepaste",c);e(b,"paste",c)})(l);this.updateCSS=t;this.setXML=function(a){a=a.documentElement||a;g=a=l.ownerDocument.importNode(a,!0);for(f(a);l.lastChild;)l.removeChild(l.lastChild);l.appendChild(a);t();p=new core.PositionIterator(a)};this.getXML= +function(){return g}}; // Input 78 /* @@ -2212,8 +2212,8 @@ gui.UndoManager.prototype.moveForward=function(l){};gui.UndoManager.prototype.mo @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -gui.UndoStateRules=function(){function l(g){return g.spec().optype}function m(g){switch(l(g)){case "MoveCursor":case "AddCursor":case "RemoveCursor":return!1;default:return!0}}this.getOpType=l;this.isEditOperation=m;this.isPartOfOperationSet=function(g,c){if(m(g)){if(0===c.length)return!0;var b;if(b=m(c[c.length-1]))a:{b=c.filter(m);var n=l(g),a;b:switch(n){case "RemoveText":case "InsertText":a=!0;break b;default:a=!1}if(a&&n===l(b[0])){if(1===b.length){b=!0;break a}n=b[b.length-2].spec().position; -b=b[b.length-1].spec().position;a=g.spec().position;if(b===a-(b-n)){b=!0;break a}}b=!1}return b}return!0}}; +gui.UndoStateRules=function(){function l(e){return e.spec().optype}function m(e){switch(l(e)){case "MoveCursor":case "AddCursor":case "RemoveCursor":return!1;default:return!0}}this.getOpType=l;this.isEditOperation=m;this.isPartOfOperationSet=function(e,c){if(m(e)){if(0===c.length)return!0;var b;if(b=m(c[c.length-1]))a:{b=c.filter(m);var n=l(e),a;b:switch(n){case "RemoveText":case "InsertText":a=!0;break b;default:a=!1}if(a&&n===l(b[0])){if(1===b.length){b=!0;break a}n=b[b.length-2].spec().position; +b=b[b.length-1].spec().position;a=e.spec().position;if(b===a-(b-n)){b=!0;break a}}b=!1}return b}return!0}}; // Input 80 /* @@ -2250,12 +2250,12 @@ b=b[b.length-1].spec().position;a=g.spec().position;if(b===a-(b-n)){b=!0;break a @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.DomUtils");runtime.loadClass("gui.UndoManager");runtime.loadClass("gui.UndoStateRules"); -gui.TrivialUndoManager=function(l){function m(){s.emit(gui.UndoManager.signalUndoStackChanged,{undoAvailable:a.hasUndoStates(),redoAvailable:a.hasRedoStates()})}function g(){p!==d&&p!==h[h.length-1]&&h.push(p)}function c(a){var b=a.previousSibling||a.nextSibling;a.parentNode.removeChild(a);e.normalizeTextNodes(b)}function b(a){return Object.keys(a).map(function(b){return a[b]})}function n(a){function c(a){var b=a.spec();if(h[b.memberid])switch(b.optype){case "AddCursor":d[b.memberid]||(d[b.memberid]= -a,delete h[b.memberid],f-=1);break;case "MoveCursor":e[b.memberid]||(e[b.memberid]=a)}}var d={},e={},h={},f,g=a.pop();k.getCursors().forEach(function(a){h[a.getMemberId()]=!0});for(f=Object.keys(h).length;g&&0=f;f+=1){b=a.container();d=a.unfilteredDomOffset();if(b.nodeType===Node.TEXT_NODE&&" "===b.data[d]&& -e.isSignificantWhitespace(b,d)){runtime.assert(" "===b.data[d],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var g=b.ownerDocument.createElementNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:s");g.appendChild(b.ownerDocument.createTextNode(" "));b.deleteData(d,1);0= 0");1===p.acceptPosition(d)?(g=d.container(),g.nodeType===Node.TEXT_NODE&&(e=g,k=0)):b+=1;for(;0=f;f+=1){b=a.container();d=a.unfilteredDomOffset();if(b.nodeType===Node.TEXT_NODE&&" "===b.data[d]&& +h.isSignificantWhitespace(b,d)){runtime.assert(" "===b.data[d],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var e=b.ownerDocument.createElementNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:s");e.appendChild(b.ownerDocument.createTextNode(" "));b.deleteData(d,1);0= 0");1===q.acceptPosition(d)?(h=d.container(),h.nodeType===Node.TEXT_NODE&&(e=h,k=0)):b+=1;for(;0 draw|image:nth-of-type(n+2) {\n display: none;\n}\ntext|list:before {\n display: none;\n content:\"\";\n}\ntext|list {\n counter-reset: list;\n}\ntext|list-item {\n display: block;\n}\ntext|number {\n display:none;\n}\n\ntext|a {\n color: blue;\n text-decoration: underline;\n cursor: pointer;\n}\ntext|note-citation {\n vertical-align: super;\n font-size: smaller;\n}\ntext|note-body {\n display: none;\n}\ntext|note:hover text|note-citation {\n background: #dddddd;\n}\ntext|note:hover text|note-body {\n display: block;\n left:1em;\n max-width: 80%;\n position: absolute;\n background: #ffffaa;\n}\nsvg|title, svg|desc {\n display: none;\n}\nvideo {\n width: 100%;\n height: 100%\n}\n\n/* below set up the cursor */\ncursor|cursor {\n display: inline;\n width: 0px;\n height: 1em;\n /* making the position relative enables the avatar to use\n the cursor as reference for its absolute position */\n position: relative;\n z-index: 1;\n}\ncursor|cursor > span {\n display: inline;\n position: absolute;\n top: 5%; /* push down the caret; 0px can do the job, 5% looks better, 10% is a bit over */\n height: 1em;\n border-left: 2px solid black;\n outline: none;\n}\n\ncursor|cursor > div {\n padding: 3px;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n border: none !important;\n border-radius: 5px;\n opacity: 0.3;\n}\n\ncursor|cursor > div > img {\n border-radius: 5px;\n}\n\ncursor|cursor > div.active {\n opacity: 0.8;\n}\n\ncursor|cursor > div:after {\n content: ' ';\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: black transparent transparent transparent;\n\n top: 100%;\n left: 43%;\n}\n\n\n.editInfoMarker {\n position: absolute;\n width: 10px;\n height: 100%;\n left: -20px;\n opacity: 0.8;\n top: 0;\n border-radius: 5px;\n background-color: transparent;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n}\n.editInfoMarker:hover {\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);\n}\n\n.editInfoHandle {\n position: absolute;\n background-color: black;\n padding: 5px;\n border-radius: 5px;\n opacity: 0.8;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n bottom: 100%;\n margin-bottom: 10px;\n z-index: 3;\n left: -25px;\n}\n.editInfoHandle:after {\n content: ' ';\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: black transparent transparent transparent;\n\n top: 100%;\n left: 5px;\n}\n.editInfo {\n font-family: sans-serif;\n font-weight: normal;\n font-style: normal;\n text-decoration: none;\n color: white;\n width: 100%;\n height: 12pt;\n}\n.editInfoColor {\n float: left;\n width: 10pt;\n height: 10pt;\n border: 1px solid white;\n}\n.editInfoAuthor {\n float: left;\n margin-left: 5pt;\n font-size: 10pt;\n text-align: left;\n height: 12pt;\n line-height: 12pt;\n}\n.editInfoTime {\n float: right;\n margin-left: 30pt;\n font-size: 8pt;\n font-style: italic;\n color: yellow;\n height: 12pt;\n line-height: 12pt;\n}\n\n.annotationWrapper {\n display: inline;\n position: relative;\n}\n\n.annotationRemoveButton:before {\n content: '\u00d7';\n color: white;\n padding: 5px;\n line-height: 1em;\n}\n\n.annotationRemoveButton {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: black;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n position: absolute;\n top: -10px;\n left: -10px;\n z-index: 3;\n text-align: center;\n font-family: sans-serif;\n font-style: normal;\n font-weight: normal;\n text-decoration: none;\n font-size: 15px;\n}\n.annotationRemoveButton:hover {\n cursor: pointer;\n box-shadow: 0px 0px 5px rgba(0, 0, 0, 1);\n}\n\n.annotationNote {\n width: 4cm;\n position: absolute;\n display: inline;\n z-index: 10;\n}\n.annotationNote > office|annotation {\n display: block;\n text-align: left;\n}\n\n.annotationConnector {\n position: absolute;\n display: inline;\n z-index: 2;\n border-top: 1px dashed brown;\n}\n.annotationConnector.angular {\n -moz-transform-origin: left top;\n -webkit-transform-origin: left top;\n -ms-transform-origin: left top;\n transform-origin: left top;\n}\n.annotationConnector.horizontal {\n left: 0;\n}\n.annotationConnector.horizontal:before {\n content: '';\n display: inline;\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: brown transparent transparent transparent;\n top: -1px;\n left: -5px;\n}\n\noffice|annotation {\n width: 100%;\n height: 100%;\n display: none;\n background: rgb(198, 238, 184);\n background: -moz-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -webkit-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -o-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -ms-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: linear-gradient(180deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n box-shadow: 0 3px 4px -3px #ccc;\n}\n\noffice|annotation > dc|creator {\n display: block;\n font-size: 10pt;\n font-weight: normal;\n font-style: normal;\n font-family: sans-serif;\n color: white;\n background-color: brown;\n padding: 4px;\n}\noffice|annotation > dc|date {\n display: block;\n font-size: 10pt;\n font-weight: normal;\n font-style: normal;\n font-family: sans-serif;\n border: 4px solid transparent;\n}\noffice|annotation > text|list {\n display: block;\n padding: 5px;\n}\n\n/* This is very temporary CSS. This must go once\n * we start bundling webodf-default ODF styles for annotations.\n */\noffice|annotation text|p {\n font-size: 10pt;\n color: black;\n font-weight: normal;\n font-style: normal;\n text-decoration: none;\n font-family: sans-serif;\n}\n\ndc|*::selection {\n background: transparent;\n}\ndc|*::-moz-selection {\n background: transparent;\n}\n\n#annotationsPane {\n background-color: #EAEAEA;\n width: 4cm;\n height: 100%;\n display: none;\n position: absolute;\n outline: 1px solid #ccc;\n}\n\n.annotationHighlight {\n background-color: yellow;\n position: relative;\n}\n";