From 93c774d81e0a94f6da52955461bce71a08ca8cc9 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Fri, 27 Sep 2013 20:53:40 +0200 Subject: [PATCH] Update to latest WebODF pullbox branch Noticable changes: * no more freezing on closing a document where edited paragraphs had been removed --- js/3rdparty/webodf/webodf-debug.js | 223 +++--- js/3rdparty/webodf/webodf.js | 1154 ++++++++++++++-------------- 2 files changed, 729 insertions(+), 648 deletions(-) diff --git a/js/3rdparty/webodf/webodf-debug.js b/js/3rdparty/webodf/webodf-debug.js index fc180be7..9bb44d86 100644 --- a/js/3rdparty/webodf/webodf-debug.js +++ b/js/3rdparty/webodf/webodf-debug.js @@ -7268,7 +7268,7 @@ odf.Style2CSS = function Style2CSS() { fontName = props.getAttributeNS(stylens, "font-name") || props.getAttributeNS(fons, "font-family"); if(fontName) { value = fontFaceDeclsMap[fontName]; - rule += "font-family: " + (value || fontName) + ", sans-serif;" + rule += "font-family: " + (value || fontName) + ";" } parentStyle = props.parentNode; fontSize = getFontSize((parentStyle)); @@ -12132,7 +12132,9 @@ ops.EditInfo = function EditInfo(container, odtDocument) { editHistory = {} }; this.destroy = function(callback) { - container.removeChild(editInfoNode); + if(container.parentNode) { + container.removeChild(editInfoNode) + } callback() }; function init() { @@ -12845,6 +12847,116 @@ gui.DirectParagraphStyler.paragraphStylingChanged = "paragraphStyling/changed"; (function() { return gui.DirectParagraphStyler })(); +/* + + Copyright (C) 2013 KO GmbH + + @licstart + The JavaScript code in this page is free software: you can redistribute it + and/or modify it under the terms of the GNU Affero General Public License + (GNU AGPL) as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. The code is distributed + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. + + As additional permission under GNU AGPL version 3 section 7, you + may distribute non-source (e.g., minimized or compacted) forms of + that code without the copy of the GNU GPL normally required by + section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + As a special exception to the AGPL, any HTML file which merely makes function + calls to this code, and for that purpose includes it by reference shall be + deemed a separate work for copyright law purposes. In addition, the copyright + holders of this code give you permission to combine this code with free + software libraries that are released under the GNU LGPL. You may copy and + distribute such a system following the terms of the GNU AGPL for this code + and the LGPL for the libraries. If you modify this code, you may extend this + exception to your version of the code, but you are not obligated to do so. + If you do not wish to do so, delete this exception statement from your + version. + + This license applies to this entire compilation. + @licend + @source: http://www.webodf.org/ + @source: http://gitorious.org/webodf/webodf/ +*/ +gui.TextManipulator = function TextManipulator(session, inputMemberId) { + var odtDocument = session.getOdtDocument(); + function createOpRemoveSelection(selection) { + var op = new ops.OpRemoveText; + op.init({memberid:inputMemberId, position:selection.position, length:selection.length}); + return op + } + function toForwardSelection(selection) { + if(selection.length < 0) { + selection.position += selection.length; + selection.length = -selection.length + } + return selection + } + this.enqueueParagraphSplittingOps = function() { + var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op; + if(selection.length > 0) { + op = createOpRemoveSelection(selection); + session.enqueue(op) + } + op = new ops.OpSplitParagraph; + op.init({memberid:inputMemberId, position:selection.position}); + session.enqueue(op); + return true + }; + this.removeTextByBackspaceKey = function() { + var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op = null; + if(selection.length === 0) { + if(selection.position > 0 && odtDocument.getPositionInTextNode(selection.position - 1)) { + op = new ops.OpRemoveText; + op.init({memberid:inputMemberId, position:selection.position - 1, length:1}); + session.enqueue(op) + } + }else { + op = createOpRemoveSelection(selection); + session.enqueue(op) + } + return op !== null + }; + this.removeTextByDeleteKey = function() { + var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op = null; + if(selection.length === 0) { + if(odtDocument.getPositionInTextNode(selection.position + 1)) { + op = new ops.OpRemoveText; + op.init({memberid:inputMemberId, position:selection.position, length:1}); + session.enqueue(op) + } + }else { + op = createOpRemoveSelection(selection); + session.enqueue(op) + } + return op !== null + }; + this.removeCurrentSelection = function() { + var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op; + if(selection.length !== 0) { + op = createOpRemoveSelection(selection); + session.enqueue(op) + } + return true + }; + function insertText(text) { + var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op = null; + if(selection.length > 0) { + op = createOpRemoveSelection(selection); + session.enqueue(op) + } + op = new ops.OpInsertText; + op.init({memberid:inputMemberId, position:selection.position, text:text}); + session.enqueue(op) + } + this.insertText = insertText +}; +(function() { + return gui.TextManipulator +})(); runtime.loadClass("core.DomUtils"); runtime.loadClass("core.Utils"); runtime.loadClass("odf.OdfUtils"); @@ -12860,11 +12972,12 @@ runtime.loadClass("gui.Clipboard"); runtime.loadClass("gui.KeyboardHandler"); runtime.loadClass("gui.DirectTextStyler"); runtime.loadClass("gui.DirectParagraphStyler"); +runtime.loadClass("gui.TextManipulator"); gui.SessionController = function() { var FILTER_ACCEPT = core.PositionFilter.FilterResult.FILTER_ACCEPT; gui.SessionController = function SessionController(session, inputMemberId, args) { var window = (runtime.getWindow()), odtDocument = session.getOdtDocument(), utils = new core.Utils, domUtils = new core.DomUtils, odfUtils = new odf.OdfUtils, clipboard = new gui.Clipboard, keyDownHandler = new gui.KeyboardHandler, keyPressHandler = new gui.KeyboardHandler, keyboardMovementsFilter = new core.PositionFilterChain, baseFilter = odtDocument.getPositionFilter(), clickStartedWithinContainer = false, styleNameGenerator = new odf.StyleNameGenerator("auto" + utils.hashString(inputMemberId) + - "_", odtDocument.getFormatting()), undoManager = null, directTextStyler = args && args.directStylingEnabled ? new gui.DirectTextStyler(session, inputMemberId) : null, directParagraphStyler = args && args.directStylingEnabled ? new gui.DirectParagraphStyler(session, inputMemberId, styleNameGenerator) : null; + "_", odtDocument.getFormatting()), undoManager = null, textManipulator = new gui.TextManipulator(session, inputMemberId), directTextStyler = args && args.directStylingEnabled ? new gui.DirectTextStyler(session, inputMemberId) : null, directParagraphStyler = args && args.directStylingEnabled ? new gui.DirectParagraphStyler(session, inputMemberId, styleNameGenerator) : null; runtime.assert(window !== null, "Expected to be run in an environment which has a global window, like a browser."); keyboardMovementsFilter.addFilter("BaseFilter", baseFilter); keyboardMovementsFilter.addFilter("RootFilter", odtDocument.createRootFilter(inputMemberId)); @@ -13268,74 +13381,6 @@ gui.SessionController = function() { session.enqueue(createOpMoveCursor(0, steps)); return true } - function toForwardSelection(selection) { - if(selection.length < 0) { - selection.position += selection.length; - selection.length = -selection.length - } - return selection - } - function createOpRemoveSelection(selection) { - var op = new ops.OpRemoveText; - op.init({memberid:inputMemberId, position:selection.position, length:selection.length}); - return op - } - function removeTextByBackspaceKey() { - var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op = null; - if(selection.length === 0) { - if(selection.position > 0 && odtDocument.getPositionInTextNode(selection.position - 1)) { - op = new ops.OpRemoveText; - op.init({memberid:inputMemberId, position:selection.position - 1, length:1}); - session.enqueue(op) - } - }else { - op = createOpRemoveSelection(selection); - session.enqueue(op) - } - return true - } - function removeTextByDeleteKey() { - var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op = null; - if(selection.length === 0) { - if(odtDocument.getPositionInTextNode(selection.position + 1)) { - op = new ops.OpRemoveText; - op.init({memberid:inputMemberId, position:selection.position, length:1}); - session.enqueue(op) - } - }else { - op = createOpRemoveSelection(selection); - session.enqueue(op) - } - return op !== null - } - function removeTextByClearKey() { - var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)); - if(selection.length !== 0) { - session.enqueue(createOpRemoveSelection(selection)) - } - return true - } - function insertText(text) { - var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op = null; - if(selection.length > 0) { - op = createOpRemoveSelection(selection); - session.enqueue(op) - } - op = new ops.OpInsertText; - op.init({memberid:inputMemberId, position:selection.position, text:text}); - session.enqueue(op) - } - function enqueueParagraphSplittingOps() { - var selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op; - if(selection.length > 0) { - op = createOpRemoveSelection(selection); - session.enqueue(op) - } - op = new ops.OpSplitParagraph; - op.init({memberid:inputMemberId, position:selection.position}); - session.enqueue(op); - return true - } function maintainCursorSelection() { var cursor = odtDocument.getCursor(inputMemberId), selection = window.getSelection(); if(cursor) { @@ -13353,15 +13398,12 @@ gui.SessionController = function() { return null } function handleCut(e) { - var cursor = odtDocument.getCursor(inputMemberId), selectedRange = cursor.getSelectedRange(), selection, op; + var cursor = odtDocument.getCursor(inputMemberId), selectedRange = cursor.getSelectedRange(); if(selectedRange.collapsed) { return } if(clipboard.setDataFromRange(e, cursor.getSelectedRange())) { - op = new ops.OpRemoveText; - selection = toForwardSelection(session.getOdtDocument().getCursorSelection(inputMemberId)); - op.init({memberid:inputMemberId, position:selection.position, length:selection.length}); - session.enqueue(op) + textManipulator.removeCurrentSelection() }else { runtime.log("Cut operation failed") } @@ -13389,7 +13431,7 @@ gui.SessionController = function() { } } if(plainText) { - insertText(plainText); + textManipulator.insertText(plainText); cancelEvent(e) } } @@ -13508,6 +13550,9 @@ gui.SessionController = function() { this.getDirectParagraphStyler = function() { return directParagraphStyler }; + this.getTextManipulator = function() { + return textManipulator + }; this.destroy = function(callback) { var destroyDirectTextStyler = directTextStyler ? directTextStyler.destroy : function(cb) { cb() @@ -13525,15 +13570,15 @@ gui.SessionController = function() { function init() { var isMacOS = window.navigator.appVersion.toLowerCase().indexOf("mac") !== -1, modifier = gui.KeyboardHandler.Modifier, keyCode = gui.KeyboardHandler.KeyCode; keyDownHandler.bind(keyCode.Tab, modifier.None, function() { - insertText("\t"); + textManipulator.insertText("\t"); return true }); keyDownHandler.bind(keyCode.Left, modifier.None, moveCursorToLeft); keyDownHandler.bind(keyCode.Right, modifier.None, moveCursorToRight); keyDownHandler.bind(keyCode.Up, modifier.None, moveCursorUp); keyDownHandler.bind(keyCode.Down, modifier.None, moveCursorDown); - keyDownHandler.bind(keyCode.Backspace, modifier.None, removeTextByBackspaceKey); - keyDownHandler.bind(keyCode.Delete, modifier.None, removeTextByDeleteKey); + keyDownHandler.bind(keyCode.Backspace, modifier.None, textManipulator.removeTextByBackspaceKey); + keyDownHandler.bind(keyCode.Delete, modifier.None, textManipulator.removeTextByDeleteKey); keyDownHandler.bind(keyCode.Left, modifier.Shift, extendSelectionToLeft); keyDownHandler.bind(keyCode.Right, modifier.Shift, extendSelectionToRight); keyDownHandler.bind(keyCode.Up, modifier.Shift, extendSelectionUp); @@ -13549,7 +13594,7 @@ gui.SessionController = function() { keyDownHandler.bind(keyCode.Home, modifier.CtrlShift, extendSelectionToDocumentStart); keyDownHandler.bind(keyCode.End, modifier.CtrlShift, extendSelectionToDocumentEnd); if(isMacOS) { - keyDownHandler.bind(keyCode.Clear, modifier.None, removeTextByClearKey); + keyDownHandler.bind(keyCode.Clear, modifier.None, textManipulator.removeCurrentSelection); keyDownHandler.bind(keyCode.Left, modifier.Meta, moveCursorToLineStart); keyDownHandler.bind(keyCode.Right, modifier.Meta, moveCursorToLineEnd); keyDownHandler.bind(keyCode.Home, modifier.Meta, moveCursorToDocumentStart); @@ -13593,12 +13638,12 @@ gui.SessionController = function() { keyPressHandler.setDefault(function(e) { var text = stringFromKeyPress(e); if(text && !(e.altKey || e.ctrlKey || e.metaKey)) { - insertText(text); + textManipulator.insertText(text); return true } return false }); - keyPressHandler.bind(keyCode.Enter, modifier.None, enqueueParagraphSplittingOps) + keyPressHandler.bind(keyCode.Enter, modifier.None, textManipulator.enqueueParagraphSplittingOps) } init() }; @@ -14061,7 +14106,7 @@ gui.SessionView = function() { } editInfoMarker.addEdit(memberId, new Date(timestamp)) } - function setEditInfoMarkerVisbility(visible) { + function setEditInfoMarkerVisibility(visible) { var editInfoMarker, keyname; for(keyname in editInfoMap) { if(editInfoMap.hasOwnProperty(keyname)) { @@ -14088,14 +14133,14 @@ gui.SessionView = function() { return } showEditInfoMarkers = true; - setEditInfoMarkerVisbility(showEditInfoMarkers) + setEditInfoMarkerVisibility(showEditInfoMarkers) }; this.hideEditInfoMarkers = function() { if(!showEditInfoMarkers) { return } showEditInfoMarkers = false; - setEditInfoMarkerVisbility(showEditInfoMarkers) + setEditInfoMarkerVisibility(showEditInfoMarkers) }; this.showCaretAvatars = function() { if(showCaretAvatars) { @@ -14155,9 +14200,9 @@ gui.SessionView = function() { var odtDocument = session.getOdtDocument(), memberModel = session.getMemberModel(), editInfoArray = Object.keys(editInfoMap).map(function(keyname) { return editInfoMap[keyname] }); - odtDocument.subscribe(ops.OdtDocument.signalCursorAdded, onCursorAdded); - odtDocument.subscribe(ops.OdtDocument.signalCursorRemoved, onCursorRemoved); - odtDocument.subscribe(ops.OdtDocument.signalParagraphChanged, onParagraphChanged); + odtDocument.unsubscribe(ops.OdtDocument.signalCursorAdded, onCursorAdded); + odtDocument.unsubscribe(ops.OdtDocument.signalCursorRemoved, onCursorRemoved); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphChanged, onParagraphChanged); caretManager.getCarets().forEach(function(caret) { memberModel.unsubscribeMemberDetailsUpdates(caret.getCursor().getMemberId(), renderMemberData) }); diff --git a/js/3rdparty/webodf/webodf.js b/js/3rdparty/webodf/webodf.js index c5a5f6f7..f82e23aa 100644 --- a/js/3rdparty/webodf/webodf.js +++ b/js/3rdparty/webodf/webodf.js @@ -36,79 +36,79 @@ */ var core={},gui={},xmldom={},odf={},ops={}; // Input 1 -function Runtime(){}Runtime.ByteArray=function(l){};Runtime.prototype.getVariable=function(l){};Runtime.prototype.toJson=function(l){};Runtime.prototype.fromJson=function(l){};Runtime.ByteArray.prototype.slice=function(l,m){};Runtime.ByteArray.prototype.length=0;Runtime.prototype.byteArrayFromArray=function(l){};Runtime.prototype.byteArrayFromString=function(l,m){};Runtime.prototype.byteArrayToString=function(l,m){};Runtime.prototype.concatByteArrays=function(l,m){}; -Runtime.prototype.read=function(l,m,h,a){};Runtime.prototype.readFile=function(l,m,h){};Runtime.prototype.readFileSync=function(l,m){};Runtime.prototype.loadXML=function(l,m){};Runtime.prototype.writeFile=function(l,m,h){};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,h){};var IS_COMPILED_CODE=!0; -Runtime.byteArrayToString=function(l,m){function h(a){var g="",d,b=a.length;for(d=0;dc?g+=String.fromCharCode(c):(d+=1,q=a[d],194<=c&&224>c?g+=String.fromCharCode((c&31)<<6|q&63):(d+=1,k=a[d],224<=c&&240>c?g+=String.fromCharCode((c&15)<<12|(q&63)<<6|k&63):(d+=1,f=a[d],240<=c&&245>c&&(c=(c&7)<<18|(q&63)<<12|(k&63)<<6|f&63,c-=65536,g+=String.fromCharCode((c>>10)+55296,(c&1023)+56320))))); -return g}var b;"utf8"===m?b=a(l):("binary"!==m&&this.log("Unsupported encoding: "+m),b=h(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(g,d){var a,c,b;void 0!==d?b=g:d=g;l?(c=l.ownerDocument,b&&(a=c.createElement("span"),a.className=b,a.appendChild(c.createTextNode(b)),l.appendChild(a),l.appendChild(c.createTextNode(" "))),a=c.createElement("span"),0k?(c[f]=k,f+=1):2048>k?(c[f]=192|k>>>6,c[f+1]=128|k&63,f+=2):(c[f]=224|k>>>12&15,c[f+1]=128|k>>>6&63,c[f+2]=128|k&63,f+=3)}else for("binary"!== -d&&a.log("unknown encoding: "+d),b=g.length,c=new a.ByteArray(b),e=0;ec.status||0===c.status?e(null):e("Status "+String(c.status)+": "+c.responseText|| -c.statusText):e("File "+g+" is empty."))};d=d.buffer&&!c.sendAsBinary?d.buffer:a.byteArrayToString(d,"binary");try{c.sendAsBinary?c.sendAsBinary(d):c.send(d)}catch(h){a.log("HUH? "+h+" "+d),e(h.message)}};this.deleteFile=function(g,d){delete b[g];var a=new XMLHttpRequest;a.open("DELETE",g,!0);a.onreadystatechange=function(){4===a.readyState&&(200>a.status&&300<=a.status?d(a.responseText):d(null))};a.send(null)};this.loadXML=function(a,d){var b=new XMLHttpRequest;b.open("GET",a,!0);b.overrideMimeType&& -b.overrideMimeType("text/xml");b.onreadystatechange=function(){4===b.readyState&&(0!==b.status||b.responseText?200===b.status||0===b.status?d(null,b.responseXML):d(b.responseText):d("File "+a+" is empty."))};try{b.send(null)}catch(c){d(c.message)}};this.isFile=function(g,d){a.getFileSize(g,function(a){d(-1!==a)})};this.getFileSize=function(a,d){var b=new XMLHttpRequest;b.open("HEAD",a,!0);b.onreadystatechange=function(){if(4===b.readyState){var c=b.getResponseHeader("Content-Length");c?d(parseInt(c, -10)):h(a,"binary",function(c,k){c?d(-1):d(k.length)})}};b.send(null)};this.log=m;this.assert=function(a,d,b){if(!a)throw m("alert","ASSERTION FAILED:\n"+d),b&&b(),d;};this.setTimeout=function(a,d){return setTimeout(function(){a()},d)};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, +function Runtime(){}Runtime.ByteArray=function(h){};Runtime.prototype.getVariable=function(h){};Runtime.prototype.toJson=function(h){};Runtime.prototype.fromJson=function(h){};Runtime.ByteArray.prototype.slice=function(h,m){};Runtime.ByteArray.prototype.length=0;Runtime.prototype.byteArrayFromArray=function(h){};Runtime.prototype.byteArrayFromString=function(h,m){};Runtime.prototype.byteArrayToString=function(h,m){};Runtime.prototype.concatByteArrays=function(h,m){}; +Runtime.prototype.read=function(h,m,f,a){};Runtime.prototype.readFile=function(h,m,f){};Runtime.prototype.readFileSync=function(h,m){};Runtime.prototype.loadXML=function(h,m){};Runtime.prototype.writeFile=function(h,m,f){};Runtime.prototype.isFile=function(h,m){};Runtime.prototype.getFileSize=function(h,m){};Runtime.prototype.deleteFile=function(h,m){};Runtime.prototype.log=function(h,m){};Runtime.prototype.setTimeout=function(h,m){};Runtime.prototype.clearTimeout=function(h){}; +Runtime.prototype.libraryPaths=function(){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.parseXML=function(h){};Runtime.prototype.getWindow=function(){};Runtime.prototype.assert=function(h,m,f){};var IS_COMPILED_CODE=!0; +Runtime.byteArrayToString=function(h,m){function f(a){var b="",k,c=a.length;for(k=0;ke?b+=String.fromCharCode(e):(k+=1,s=a[k],194<=e&&224>e?b+=String.fromCharCode((e&31)<<6|s&63):(k+=1,n=a[k],224<=e&&240>e?b+=String.fromCharCode((e&15)<<12|(s&63)<<6|n&63):(k+=1,g=a[k],240<=e&&245>e&&(e=(e&7)<<18|(s&63)<<12|(n&63)<<6|g&63,e-=65536,b+=String.fromCharCode((e>>10)+55296,(e&1023)+56320))))); +return b}var c;"utf8"===m?c=a(h):("binary"!==m&&this.log("Unsupported encoding: "+m),c=f(h));return c};Runtime.getVariable=function(h){try{return eval(h)}catch(m){}};Runtime.toJson=function(h){return JSON.stringify(h)};Runtime.fromJson=function(h){return JSON.parse(h)};Runtime.getFunctionName=function(h){return void 0===h.name?(h=/function\s+(\w+)/.exec(h))&&h[1]:h.name}; +function BrowserRuntime(h){function m(b,k){var a,e,c;void 0!==k?c=b:k=b;h?(e=h.ownerDocument,c&&(a=e.createElement("span"),a.className=c,a.appendChild(e.createTextNode(c)),h.appendChild(a),h.appendChild(e.createTextNode(" "))),a=e.createElement("span"),0n?(e[g]=n,g+=1):2048>n?(e[g]=192|n>>>6,e[g+1]=128|n&63,g+=2):(e[g]=224|n>>>12&15,e[g+1]=128|n>>>6&63,e[g+2]=128|n&63,g+=3)}else for("binary"!== +k&&a.log("unknown encoding: "+k),c=b.length,e=new a.ByteArray(c),d=0;de.status||0===e.status?d(null):d("Status "+String(e.status)+": "+e.responseText|| +e.statusText):d("File "+b+" is empty."))};k=k.buffer&&!e.sendAsBinary?k.buffer:a.byteArrayToString(k,"binary");try{e.sendAsBinary?e.sendAsBinary(k):e.send(k)}catch(f){a.log("HUH? "+f+" "+k),d(f.message)}};this.deleteFile=function(b,k){delete c[b];var a=new XMLHttpRequest;a.open("DELETE",b,!0);a.onreadystatechange=function(){4===a.readyState&&(200>a.status&&300<=a.status?k(a.responseText):k(null))};a.send(null)};this.loadXML=function(b,k){var a=new XMLHttpRequest;a.open("GET",b,!0);a.overrideMimeType&& +a.overrideMimeType("text/xml");a.onreadystatechange=function(){4===a.readyState&&(0!==a.status||a.responseText?200===a.status||0===a.status?k(null,a.responseXML):k(a.responseText):k("File "+b+" is empty."))};try{a.send(null)}catch(e){k(e.message)}};this.isFile=function(b,k){a.getFileSize(b,function(b){k(-1!==b)})};this.getFileSize=function(b,a){var c=new XMLHttpRequest;c.open("HEAD",b,!0);c.onreadystatechange=function(){if(4===c.readyState){var e=c.getResponseHeader("Content-Length");e?a(parseInt(e, +10)):f(b,"binary",function(e,b){e?a(-1):a(b.length)})}};c.send(null)};this.log=m;this.assert=function(b,a,c){if(!b)throw m("alert","ASSERTION FAILED:\n"+a),c&&c(),a;};this.setTimeout=function(b,a){return setTimeout(function(){b()},a)};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(d,g,c){d=a.resolve(b,d);"binary"!==g?h.readFile(d,g,c):h.readFile(d,null,c)}var m=this,h=require("fs"),a=require("path"),b="",e,g;this.ByteArray=function(a){return new Buffer(a)};this.byteArrayFromArray=function(a){var b=new Buffer(a.length),c,g=a.length;for(c=0;c").implementation} -function RhinoRuntime(){function l(a,b){var e;void 0!==b?e=a:b=a;"alert"===e&&print("\n!!!!! ALERT !!!!!");print(b);"alert"===e&&print("!!!!! ALERT !!!!!")}var m=this,h=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),a,b,e="";h.setValidating(!1);h.setNamespaceAware(!0);h.setExpandEntityReferences(!1);h.setSchema(null);b=Packages.org.xml.sax.EntityResolver({resolveEntity:function(a,b){var e=new Packages.java.io.FileReader(b);return new Packages.org.xml.sax.InputSource(e)}});a=h.newDocumentBuilder(); -a.setEntityResolver(b);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=function(a,b){var e=[],c,h=a.length;for(c=0;c").implementation} +function RhinoRuntime(){function h(b,a){var c;void 0!==a?c=b:a=b;"alert"===c&&print("\n!!!!! ALERT !!!!!");print(a);"alert"===c&&print("!!!!! ALERT !!!!!")}var m=this,f=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),a,c,d="";f.setValidating(!1);f.setNamespaceAware(!0);f.setExpandEntityReferences(!1);f.setSchema(null);c=Packages.org.xml.sax.EntityResolver({resolveEntity:function(b,a){var c=new Packages.java.io.FileReader(a);return new Packages.org.xml.sax.InputSource(c)}});a=f.newDocumentBuilder(); +a.setEntityResolver(c);this.ByteArray=function(b){return[b]};this.byteArrayFromArray=function(b){return b};this.byteArrayFromString=function(b,a){var c=[],e,d=b.length;for(e=0;e>>18],b+=u[c>>>12&63],b+=u[c>>>6&63],b+=u[c&63];f===k+1?(c=a[f]<<4,b+=u[c>>>6],b+=u[c&63],b+="=="):f===k&&(c=a[f]<<10|a[f+1]<<2,b+=u[c>>>12],b+=u[c>>>6&63],b+=u[c&63],b+="=");return b}function h(a){a=a.replace(/[^A-Za-z0-9+\/]+/g,"");var c=[],b=a.length%4,f,k=a.length,n;for(f=0;f>16,n>>8&255,n&255);c.length-=[0,0,2,1][b];return c}function a(a){var c=[],b,f=a.length,k;for(b=0;bk?c.push(k):2048>k?c.push(192|k>>>6,128|k&63):c.push(224|k>>>12&15,128|k>>>6&63,128|k&63);return c}function b(a){var c=[],b,f=a.length,k,n,g;for(b=0;bk?c.push(k):(b+=1,n=a[b],224>k?c.push((k&31)<<6|n&63):(b+=1,g=a[b],c.push((k&15)<<12|(n&63)<<6|g&63)));return c}function e(a){return m(l(a))} -function g(a){return String.fromCharCode.apply(String,h(a))}function d(a){return b(l(a))}function p(a){a=b(a);for(var c="",f=0;fc?f+=String.fromCharCode(c):(g+=1,k=a.charCodeAt(g)&255,224>c?f+=String.fromCharCode((c&31)<<6|k&63):(g+=1,n=a.charCodeAt(g)&255,f+=String.fromCharCode((c&15)<<12|(k&63)<<6|n&63)));return f}function q(a,b){function f(){var d= -g+k;d>a.length&&(d=a.length);n+=c(a,g,d);g=d;d=g===a.length;b(n,d)&&!d&&runtime.setTimeout(f,0)}var k=1E5,n="",g=0;a.length>>18],b+=u[e>>>12&63],b+=u[e>>>6&63],b+=u[e&63];c===g+1?(e=a[c]<<4,b+=u[e>>>6],b+=u[e&63],b+="=="):c===g&&(e=a[c]<<10|a[c+1]<<2,b+=u[e>>>12],b+=u[e>>>6&63],b+=u[e&63],b+="=");return b}function f(a){a=a.replace(/[^A-Za-z0-9+\/]+/g,"");var b=[],e=a.length%4,c,g=a.length,n;for(c=0;c>16,n>>8&255,n&255);b.length-=[0,0,2,1][e];return b}function a(a){var b=[],e,c=a.length,g;for(e=0;eg?b.push(g):2048>g?b.push(192|g>>>6,128|g&63):b.push(224|g>>>12&15,128|g>>>6&63,128|g&63);return b}function c(a){var b=[],e,c=a.length,g,n,l;for(e=0;eg?b.push(g):(e+=1,n=a[e],224>g?b.push((g&31)<<6|n&63):(e+=1,l=a[e],b.push((g&15)<<12|(n&63)<<6|l&63)));return b}function d(a){return m(h(a))} +function b(a){return String.fromCharCode.apply(String,f(a))}function k(a){return c(h(a))}function p(a){a=c(a);for(var b="",e=0;eb?c+=String.fromCharCode(b):(l+=1,g=a.charCodeAt(l)&255,224>b?c+=String.fromCharCode((b&31)<<6|g&63):(l+=1,n=a.charCodeAt(l)&255,c+=String.fromCharCode((b&15)<<12|(g&63)<<6|n&63)));return c}function s(a,b){function c(){var d= +l+g;d>a.length&&(d=a.length);n+=e(a,l,d);l=d;d=l===a.length;b(n,d)&&!d&&runtime.setTimeout(c,0)}var g=1E5,n="",l=0;a.length>>8):(W(a&255),W(a>>>8))},ba=function(){w=(w<<5^n[A+3-1]&255)&8191;v=x[32768+w];x[A&32767]=v;x[32768+w]=A},ca=function(a,c){y>16-c?(r|=a<>16-y,y+=c-16):(r|=a<a;a++)n[a]=n[a+32768];P-=32768;A-=32768;t-=32768;for(a=0;8192>a;a++)c=x[32768+a],x[32768+a]=32768<=c?c-32768:0;for(a=0;32768>a;a++)c=x[a],x[a]=32768<=c?c-32768:0;b+=32768}G||(a=Ba(n,A+M,b),0>=a?G=!0:M+=a)},Ca=function(a){var c=ea,b=A,f,k=L,g=32506=oa&&(c>>=2);do if(f=a,n[f+k]===v&&n[f+k-1]===e&&n[f]===n[b]&&n[++f]===n[b+1]){b+=2;f++;do++b; -while(n[b]===n[++f]&&n[++b]===n[++f]&&n[++b]===n[++f]&&n[++b]===n[++f]&&n[++b]===n[++f]&&n[++b]===n[++f]&&n[++b]===n[++f]&&n[++b]===n[++f]&&bk){P=a;k=f;if(258<=f)break;e=n[b+k-1];v=n[b+k]}a=x[a&32767]}while(a>g&&0!==--c);return k},va=function(a,b){s[D++]=b;0===a?V[b].fc++:(a--,V[U[b]+256+1].fc++,Z[(256>a?ha[a]:ha[256+(a>>7)])&255].fc++,u[ja++]=a,aa|=C);C<<=1;0===(D&7)&&(ia[ka++]=aa,aa=0,C=1);if(2k;k++)c+=Z[k].fc*(5+pa[k]); -c>>=3;if(ja>=1,c<<=1;while(0<--b);return c>>1},Ea=function(a,c){var b=[];b.length=16;var f=0,k;for(k=1;15>=k;k++)f=f+X[k-1]<<1,b[k]=f;for(f=0;f<=c;f++)k=a[f].dl,0!==k&&(a[f].fc=Da(b[k]++,k))},za=function(a){var b=a.dyn_tree,c=a.static_tree,f=a.elems,k,n=-1,g=f;Q=0; -Y=573;for(k=0;kQ;)k=R[++Q]=2>n?++n:0,b[k].fc=1,$[k]=0,ma--,null!==c&&(la-=c[k].dl);a.max_code=n;for(k=Q>>1;1<=k;k--)ya(b,k);do k=R[1],R[1]=R[Q--],ya(b,1),c=R[1],R[--Y]=k,R[--Y]=c,b[g].fc=b[k].fc+b[c].fc,$[g]=$[k]>$[c]+1?$[k]:$[c]+1,b[k].dl=b[c].dl=g,R[1]=g++,ya(b,1);while(2<=Q);R[--Y]=R[1];g=a.dyn_tree;k=a.extra_bits;var f=a.extra_base,c=a.max_code,d=a.max_length,e=a.static_tree,v,h,s,l,m=0;for(h=0;15>=h;h++)X[h]=0;g[R[Y]].dl=0;for(a=Y+1;573> -a;a++)v=R[a],h=g[g[v].dl].dl+1,h>d&&(h=d,m++),g[v].dl=h,v>c||(X[h]++,s=0,v>=f&&(s=k[v-f]),l=g[v].fc,ma+=l*(h+s),null!==e&&(la+=l*(e[v].dl+s)));if(0!==m){do{for(h=d-1;0===X[h];)h--;X[h]--;X[h+1]+=2;X[d]--;m-=2}while(0c||(g[k].dl!==h&&(ma+=(h-g[k].dl)*g[k].fc,g[k].fc=h),v--)}Ea(b,n)},Fa=function(a,b){var c,f=-1,k,n=a[0].dl,g=0,d=7,e=4;0===n&&(d=138,e=3);a[b+1].dl=65535;for(c=0;c<=b;c++)k=n,n=a[c+1].dl,++g=g?B[17].fc++:B[18].fc++,g=0,f=k,0===n?(d=138,e=3):k===n?(d=6,e=3):(d=7,e=4))},Ga=function(){8c?ha[c]:ha[256+(c>>7)])&255,da(d,b),e=pa[d],0!==e&&(c-=ga[d],ca(c,e))),g>>=1;while(f=g?(da(17,B),ca(g-3,3)):(da(18,B),ca(g-11,7));g=0;f=k;0===n?(d=138,e=3):k===n?(d=6,e=3):(d=7,e=4)}},Ja=function(){var a;for(a=0;286>a;a++)V[a].fc=0;for(a=0;30>a;a++)Z[a].fc=0;for(a=0;19>a;a++)B[a].fc=0;V[256].fc=1;aa=D=ja=ka=ma=la=0;C=1},wa=function(a){var c,b,f,k;k=A-t;ia[ka]=aa;za(H);za(E);Fa(V,H.max_code);Fa(Z,E.max_code);za(T);for(f=18;3<=f&&0===B[ra[f]].dl;f--);ma+=3*(f+1)+ -14;c=ma+3+7>>3;b=la+3+7>>3;b<=c&&(c=b);if(k+4<=c&&0<=t)for(ca(0+a,3),Ga(),fa(k),fa(~k),f=0;fg.len&&(d=g.len);for(v=0;vq-k&&(d=q-k);for(v=0;vh;h++)for(K[h]=e,d=0;d< -1<h;h++)for(ga[h]=e,d=0;d<1<>=7;30>h;h++)for(ga[h]=e<<7,d=0;d<1<=d;d++)X[d]=0;for(d=0;143>=d;)O[d++].dl=8,X[8]++;for(;255>=d;)O[d++].dl=9,X[9]++;for(;279>=d;)O[d++].dl=7,X[7]++;for(;287>=d;)O[d++].dl=8,X[8]++;Ea(O,287);for(d=0;30>d;d++)S[d].dl=5,S[d].fc=Da(d,5);Ja()}for(d=0;8192>d;d++)x[32768+d]=0;na=ta[N].max_lazy;oa=ta[N].good_length;ea=ta[N].max_chain;t=A=0;M=Ba(n,0,65536);if(0>=M)G=!0,M=0; -else{for(G=!1;262>M&&!G;)xa();for(d=w=0;2>d;d++)w=(w<<5^n[d]&255)&8191}g=null;k=q=0;3>=N?(L=2,z=0):(z=2,J=0);f=!1}p=!0;if(0===M)return f=!0,0}d=Ka(a,c,b);if(d===b)return b;if(f)return d;if(3>=N)for(;0!==M&&null===g;){ba();0!==v&&32506>=A-v&&(z=Ca(v),z>M&&(z=M));if(3<=z)if(h=va(A-P,z-3),M-=z,z<=na){z--;do A++,ba();while(0!==--z);A++}else A+=z,z=0,w=n[A]&255,w=(w<<5^n[A+1]&255)&8191;else h=va(0,n[A]&255),M--,A++;h&&(wa(0),t=A);for(;262>M&&!G;)xa()}else for(;0!==M&&null===g;){ba();L=z;F=P;z=2;0!==v&& -(L=A-v)&&(z=Ca(v),z>M&&(z=M),3===z&&4096M&&!G;)xa()}0===M&&(0!==J&&va(0,n[A-1]&255),wa(1),f=!0);return d+Ka(a,d+c,b-d)};this.deflate=function(a,f){var k,v;sa=a;ua=0;"undefined"===String(typeof f)&&(f=6);(k=f)?1>k?k=1:9k;k++)V[k]=new l;Z=[];Z.length=61;for(k=0;61>k;k++)Z[k]=new l;O=[];O.length=288;for(k=0;288>k;k++)O[k]=new l;S=[];S.length=30;for(k=0;30>k;k++)S[k]=new l;B=[];B.length=39;for(k=0;39>k;k++)B[k]=new l;H=new m;E=new m;T=new m;X=[];X.length=16;R=[];R.length=573;$=[];$.length=573;U=[];U.length=256;ha=[];ha.length=512;K=[];K.length=29;ga=[];ga.length=30;ia=[];ia.length=1024}var h=Array(1024),t=[],r=[];for(k=La(h,0,h.length);0>>8):(ta(a&255),ta(a>>>8))},ua=function(){w=(w<<5^l[B+3-1]&255)&8191;v=x[32768+w];x[B&32767]=v;x[32768+w]=B},la=function(a,b){y>16-b?(r|=a<>16-y,y+=b-16):(r|=a<a;a++)l[a]=l[a+32768];N-=32768;B-=32768;t-=32768;for(a=0;8192>a;a++)b=x[32768+a],x[32768+a]=32768<=b?b-32768:0;for(a=0;32768>a;a++)b=x[a],x[a]=32768<=b?b-32768:0;e+=32768}H||(a=Aa(l,B+L,e),0>=a?H=!0:L+=a)},Ba=function(a){var b=fa,e=B,c,g=K,n=32506=pa&&(b>>=2);do if(c=a,l[c+g]===v&&l[c+g-1]===k&&l[c]===l[e]&&l[++c]===l[e+1]){e+= +2;c++;do++e;while(l[e]===l[++c]&&l[++e]===l[++c]&&l[++e]===l[++c]&&l[++e]===l[++c]&&l[++e]===l[++c]&&l[++e]===l[++c]&&l[++e]===l[++c]&&l[++e]===l[++c]&&eg){N=a;g=c;if(258<=c)break;k=l[e+g-1];v=l[e+g]}a=x[a&32767]}while(a>n&&0!==--b);return g},ra=function(a,b){q[I++]=b;0===a?W[b].fc++:(a--,W[U[b]+256+1].fc++,aa[(256>a?V[a]:V[256+(a>>7)])&255].fc++,u[ia++]=a,na|=ja);ja<<=1;0===(I&7)&&(da[A++]=na,na=0,ja=1);if(2g;g++)e+=aa[g].fc* +(5+ba[g]);e>>=3;if(ia>=1,e<<=1;while(0<--b);return e>>1},Da=function(a,b){var e=[];e.length=16;var c=0,g;for(g=1;15>=g;g++)c=c+X[g-1]<<1,e[g]=c;for(c=0;c<=b;c++)g=a[c].dl,0!==g&&(a[c].fc=Ca(e[g]++,g))},ya=function(a){var b=a.dyn_tree,e=a.static_tree,c=a.elems,g,n=-1, +l=c;P=0;$=573;for(g=0;gP;)g=Q[++P]=2>n?++n:0,b[g].fc=1,ca[g]=0,ea--,null!==e&&(oa-=e[g].dl);a.max_code=n;for(g=P>>1;1<=g;g--)xa(b,g);do g=Q[1],Q[1]=Q[P--],xa(b,1),e=Q[1],Q[--$]=g,Q[--$]=e,b[l].fc=b[g].fc+b[e].fc,ca[l]=ca[g]>ca[e]+1?ca[g]:ca[e]+1,b[g].dl=b[e].dl=l,Q[1]=l++,xa(b,1);while(2<=P);Q[--$]=Q[1];l=a.dyn_tree;g=a.extra_bits;var c=a.extra_base,e=a.max_code,d=a.max_length,k=a.static_tree,v,f,q,h,m=0;for(f=0;15>=f;f++)X[f]=0;l[Q[$]].dl= +0;for(a=$+1;573>a;a++)v=Q[a],f=l[l[v].dl].dl+1,f>d&&(f=d,m++),l[v].dl=f,v>e||(X[f]++,q=0,v>=c&&(q=g[v-c]),h=l[v].fc,ea+=h*(f+q),null!==k&&(oa+=h*(k[v].dl+q)));if(0!==m){do{for(f=d-1;0===X[f];)f--;X[f]--;X[f+1]+=2;X[d]--;m-=2}while(0e||(l[g].dl!==f&&(ea+=(f-l[g].dl)*l[g].fc,l[g].fc=f),v--)}Da(b,n)},Ea=function(a,b){var e,c=-1,g,n=a[0].dl,l=0,d=7,k=4;0===n&&(d=138,k=3);a[b+1].dl=65535;for(e=0;e<=b;e++)g=n,n=a[e+1].dl,++l=l?F[17].fc++:F[18].fc++,l=0,c=g,0===n?(d=138,k=3):g===n?(d=6,k=3):(d=7,k=4))},Fa=function(){8b?V[b]:V[256+(b>>7)])&255,qa(d,e),k=ba[d],0!==k&&(b-=ga[d],la(b,k))),l>>=1;while(c=l?(qa(17,F),la(l-3,3)):(qa(18,F),la(l-11,7));l=0;c=g;0===n?(d=138,k=3):g===n?(d=6,k=3):(d=7,k=4)}},Ia=function(){var a;for(a=0;286>a;a++)W[a].fc=0;for(a=0;30>a;a++)aa[a].fc=0;for(a=0;19>a;a++)F[a].fc=0;W[256].fc=1;na=I=ia=A=ea=oa=0;ja=1},va=function(a){var b,e,c,g;g=B-t;da[A]=na;ya(G);ya(D);Ea(W,G.max_code);Ea(aa,D.max_code);ya(T);for(c=18;3<=c&&0===F[S[c]].dl;c--); +ea+=3*(c+1)+14;b=ea+3+7>>3;e=oa+3+7>>3;e<=b&&(b=e);if(g+4<=b&&0<=t)for(la(0+a,3),Fa(),Z(g),Z(~g),c=0;cb.len&&(k=b.len);for(v=0;vs-n&&(k=s-n);for(v=0;vf;f++)for(z[f]= +k,d=0;d<1<f;f++)for(ga[f]=k,d=0;d<1<>=7;30>f;f++)for(ga[f]=k<<7,d=0;d<1<=d;d++)X[d]=0;for(d=0;143>=d;)O[d++].dl=8,X[8]++;for(;255>=d;)O[d++].dl=9,X[9]++;for(;279>=d;)O[d++].dl=7,X[7]++;for(;287>=d;)O[d++].dl=8,X[8]++;Da(O,287);for(d=0;30>d;d++)R[d].dl=5,R[d].fc=Ca(d,5);Ia()}for(d=0;8192>d;d++)x[32768+d]=0;ma=sa[M].max_lazy;pa=sa[M].good_length;fa=sa[M].max_chain;t=B=0;L=Aa(l,0,65536);if(0>=L)H= +!0,L=0;else{for(H=!1;262>L&&!H;)wa();for(d=w=0;2>d;d++)w=(w<<5^l[d]&255)&8191}b=null;n=s=0;3>=M?(K=2,E=0):(E=2,J=0);g=!1}p=!0;if(0===L)return g=!0,0}d=Ja(a,e,c);if(d===c)return c;if(g)return d;if(3>=M)for(;0!==L&&null===b;){ua();0!==v&&32506>=B-v&&(E=Ba(v),E>L&&(E=L));if(3<=E)if(f=ra(B-N,E-3),L-=E,E<=ma){E--;do B++,ua();while(0!==--E);B++}else B+=E,E=0,w=l[B]&255,w=(w<<5^l[B+1]&255)&8191;else f=ra(0,l[B]&255),L--,B++;f&&(va(0),t=B);for(;262>L&&!H;)wa()}else for(;0!==L&&null===b;){ua();K=E;C=N;E=2; +0!==v&&(K=B-v)&&(E=Ba(v),E>L&&(E=L),3===E&&4096L&&!H;)wa()}0===L&&(0!==J&&ra(0,l[B-1]&255),va(1),g=!0);return d+Ja(a,d+e,c-d)};this.deflate=function(a,g){var n,v;Y=a;ka=0;"undefined"===String(typeof g)&&(g=6);(n=g)?1>n?n=1:9n;n++)W[n]=new h;aa=[];aa.length=61;for(n=0;61>n;n++)aa[n]=new h;O=[];O.length=288;for(n=0;288>n;n++)O[n]=new h;R=[];R.length=30;for(n=0;30>n;n++)R[n]=new h;F=[];F.length=39;for(n=0;39>n;n++)F[n]=new h;G=new m;D=new m;T=new m;X=[];X.length=16;Q=[];Q.length=573;ca=[];ca.length=573;U=[];U.length=256;V=[];V.length=512;z=[];z.length=29;ga=[];ga.length=30;da=[];da.length=1024}var f=Array(1024),t=[],r=[];for(n=Ka(f,0,f.length);0< +n;){r.length=n;for(v=0;v>8&255])};this.appendUInt32LE=function(a){m.appendArray([a&255,a>>8&255,a>>16&255,a>>24&255])};this.appendString=function(a){h=runtime.concatByteArrays(h, -runtime.byteArrayFromString(a,l))};this.getLength=function(){return h.length};this.getByteArray=function(){return h}}; +core.ByteArrayWriter=function(h){var m=this,f=new runtime.ByteArray(0);this.appendByteArrayWriter=function(a){f=runtime.concatByteArrays(f,a.getByteArray())};this.appendByteArray=function(a){f=runtime.concatByteArrays(f,a)};this.appendArray=function(a){f=runtime.concatByteArrays(f,runtime.byteArrayFromArray(a))};this.appendUInt16LE=function(a){m.appendArray([a&255,a>>8&255])};this.appendUInt32LE=function(a){m.appendArray([a&255,a>>8&255,a>>16&255,a>>24&255])};this.appendString=function(a){f=runtime.concatByteArrays(f, +runtime.byteArrayFromString(a,h))};this.getLength=function(){return f.length};this.getByteArray=function(){return f}}; // Input 6 -core.RawInflate=function(){var l,m,h=null,a,b,e,g,d,p,c,q,k,f,n,u,s,x,r=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],y=[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],t=[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],w=[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],v=[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],F=[16,17,18, -0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=function(){this.list=this.next=null},z=function(){this.n=this.b=this.e=0;this.t=null},L=function(a,c,b,f,k,d){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var n=Array(this.BMAX+1),g,e,v,h,s,l,m,t=Array(this.BMAX+1),x,p,u,r=new z,q=Array(this.BMAX);h=Array(this.N_MAX);var y,w=Array(this.BMAX+1),A,F,L;L=this.root=null;for(s=0;ss&&(d=s);for(A=1<(A-=n[l])){this.status=2;this.m=d;return}if(0>(A-=n[s]))this.status=2,this.m=d;else{n[s]+=A;w[1]=l=0;x=n;p=1;for(u=2;0<--s;)w[u++]=l+=x[p++];x=a;s=p=0;do 0!=(l=x[p++])&&(h[w[l]++]=s);while(++sy+t[1+h];){y+=t[1+h];h++;F=(F=v-y)>d?d:F;if((e=1<<(l=m-y))>a+1)for(e-=a+1,u=m;++lg&&y>y-t[h],q[h-1][l].e=r.e,q[h-1][l].b=r.b,q[h-1][l].n=r.n,q[h-1][l].t=r.t)}r.b=m-y;p>=c?r.e=99:x[p]x[p]?16:15,r.n=x[p++]): -(r.e=k[x[p]-b],r.n=f[x[p++]-b]);e=1<>y;l>=1)s^=l;for(s^=l;(s&(1<>=a;g-=a},M=function(a,b,g){var e,v,h;if(0==g)return 0;for(h=0;;){A(n);v=k.list[P(n)];for(e=v.e;16 -e;e++)p[F[e]]=0;n=7;e=new L(p,19,19,null,null,n);if(0!=e.status)return-1;k=e.root;n=e.m;h=l+m;for(d=g=0;de)p[d++]=g=e;else if(16==e){A(2);e=3+P(2);G(2);if(d+e>h)return-1;for(;0h)return-1;for(;0E;E++)H[E]=8;for(;256>E;E++)H[E]=9;for(;280>E;E++)H[E]=7;for(;288>E;E++)H[E]=8;b=7;E=new L(H,288,257,y,t,b);if(0!=E.status){alert("HufBuild error: "+E.status);O=-1;break b}h=E.root;b=E.m;for(E=0;30>E;E++)H[E]=5;ea=5;E=new L(H,30,0,w,v,ea);if(1h&&(n=h);for(B=1<(B-=d[q])){this.status=2;this.m=n;return}if(0>(B-=d[h]))this.status=2,this.m=n;else{d[h]+=B;w[1]=q=0;x=d;p=1;for(u=2;0<--h;)w[u++]=q+=x[p++];x=a;h=p=0;do 0!=(q=x[p++])&&(f[w[q]++]=h);while(++hy+t[1+f];){y+=t[1+f];f++;C=(C=v-y)>n?n:C;if((k=1<<(q=m-y))>a+1)for(k-=a+1,u=m;++ql&&y>y-t[f],s[f-1][q].e=r.e,s[f-1][q].b=r.b,s[f-1][q].n=r.n,s[f-1][q].t=r.t)}r.b=m-y;p>=b?r.e=99:x[p]x[p]?16:15,r.n=x[p++]): +(r.e=g[x[p]-e],r.n=c[x[p++]-e]);k=1<>y;q>=1)h^=q;for(h^=q;(h&(1<>=a;b-=a},L=function(a,b,c){var d,v,f;if(0==c)return 0;for(f=0;;){B(l);v=n.list[N(l)];for(d=v.e;16 +d;d++)p[C[d]]=0;l=7;d=new K(p,19,19,null,null,l);if(0!=d.status)return-1;n=d.root;l=d.m;f=q+m;for(c=k=0;cd)p[c++]=k=d;else if(16==d){B(2);d=3+N(2);H(2);if(c+d>f)return-1;for(;0f)return-1;for(;0D;D++)G[D]=8;for(;256>D;D++)G[D]=9;for(;280>D;D++)G[D]=7;for(;288>D;D++)G[D]=8;c=7;D=new K(G,288,257,y,t,c);if(0!=D.status){alert("HufBuild error: "+D.status);O=-1;break b}f=D.root;c=D.m;for(D=0;30>D;D++)G[D]=5;fa=5;D=new K(G,30,0,w,v,fa);if(1l))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0m))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; +core.LoopWatchDog=function(h,m){var f=Date.now(),a=0;this.check=function(){var c;if(h&&(c=Date.now(),c-f>h))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,h){h&&Array.isArray(h)?m=(m||[]).concat(h.map(function(a){return l({},a)})):h&&"object"===typeof h?(m=m||{},Object.keys(h).forEach(function(a){m[a]=l(m[a],h[a])})):m=h;return m}this.hashString=function(l){var h=0,a,b;a=0;for(b=l.length;a=a.compareBoundaryPoints(a.START_TO_START,b)&&0<=a.compareBoundaryPoints(a.END_TO_END,b)};this.rangesIntersect=function(a,b){return 0>=a.compareBoundaryPoints(a.END_TO_START,b)&&0<=a.compareBoundaryPoints(a.START_TO_END,b)}; -this.getNodesInRange=function(a,b){var e=[],g,d=a.startContainer.ownerDocument.createTreeWalker(a.commonAncestorContainer,NodeFilter.SHOW_ALL,b,!1);for(g=d.currentNode=a.startContainer;g;){if(b(g)===NodeFilter.FILTER_ACCEPT)e.push(g);else if(b(g)===NodeFilter.FILTER_REJECT)break;g=g.parentNode}e.reverse();for(g=d.nextNode();g;)e.push(g),g=d.nextNode();return e};this.normalizeTextNodes=function(a){a&&a.nextSibling&&(a=l(a,a.nextSibling));a&&a.previousSibling&&l(a.previousSibling,a)};this.rangeContainsNode= -function(a,b){var e=b.ownerDocument.createRange(),g=b.nodeType===Node.TEXT_NODE?b.length:b.childNodes.length;e.setStart(a.startContainer,a.startOffset);e.setEnd(a.endContainer,a.endOffset);g=0===e.comparePoint(b,0)&&0===e.comparePoint(b,g);e.detach();return g};this.mergeIntoParent=function(a){for(var b=a.parentNode;a.firstChild;)b.insertBefore(a.firstChild,a);b.removeChild(a);return b};this.getElementsByTagNameNS=function(a,b,e){return Array.prototype.slice.call(a.getElementsByTagNameNS(b,e))};this.rangeIntersectsNode= -function(a,b){var e=b.nodeType===Node.TEXT_NODE?b.length:b.childNodes.length;return 0>=a.comparePoint(b,0)&&0<=a.comparePoint(b,e)};this.containsNode=function(a,b){return a===b||a.contains(b)};this.comparePoints=function(a,b,e,g){if(a===e)return g-b;var d=a.compareDocumentPosition(e);2===d?d=-1:4===d?d=1:10===d?(b=m(a,e),d=b=a.compareBoundaryPoints(a.START_TO_START,c)&&0<=a.compareBoundaryPoints(a.END_TO_END,c)};this.rangesIntersect=function(a,c){return 0>=a.compareBoundaryPoints(a.END_TO_START,c)&&0<=a.compareBoundaryPoints(a.START_TO_END,c)}; +this.getNodesInRange=function(a,c){var d=[],b,k=a.startContainer.ownerDocument.createTreeWalker(a.commonAncestorContainer,NodeFilter.SHOW_ALL,c,!1);for(b=k.currentNode=a.startContainer;b;){if(c(b)===NodeFilter.FILTER_ACCEPT)d.push(b);else if(c(b)===NodeFilter.FILTER_REJECT)break;b=b.parentNode}d.reverse();for(b=k.nextNode();b;)d.push(b),b=k.nextNode();return d};this.normalizeTextNodes=function(a){a&&a.nextSibling&&(a=h(a,a.nextSibling));a&&a.previousSibling&&h(a.previousSibling,a)};this.rangeContainsNode= +function(a,c){var d=c.ownerDocument.createRange(),b=c.nodeType===Node.TEXT_NODE?c.length:c.childNodes.length;d.setStart(a.startContainer,a.startOffset);d.setEnd(a.endContainer,a.endOffset);b=0===d.comparePoint(c,0)&&0===d.comparePoint(c,b);d.detach();return b};this.mergeIntoParent=function(a){for(var c=a.parentNode;a.firstChild;)c.insertBefore(a.firstChild,a);c.removeChild(a);return c};this.getElementsByTagNameNS=function(a,c,d){return Array.prototype.slice.call(a.getElementsByTagNameNS(c,d))};this.rangeIntersectsNode= +function(a,c){var d=c.nodeType===Node.TEXT_NODE?c.length:c.childNodes.length;return 0>=a.comparePoint(c,0)&&0<=a.comparePoint(c,d)};this.containsNode=function(a,c){return a===c||a.contains(c)};this.comparePoints=function(a,c,d,b){if(a===d)return b-c;var k=a.compareDocumentPosition(d);2===k?k=-1:4===k?k=1:10===k?(c=m(a,d),k=c";return runtime.parseXML(h)}; -core.UnitTestRunner=function(){function l(a){g+=1;runtime.log("fail",a)}function m(a,c){var b;try{if(a.length!==c.length)return l("array of length "+a.length+" should be "+c.length+" long"),!1;for(b=0;b1/f?"-0":String(f),l(c+" should be "+a+". Was "+d+".")):l(c+" should be "+a+" (of type "+typeof a+"). Was "+f+" (of type "+typeof f+").")}var g=0,d;d=function(a,c){var d=Object.keys(a),k=Object.keys(c);d.sort();k.sort();return m(d,k)&&Object.keys(a).every(function(f){var k= -a[f],d=c[f];return b(k,d)?!0:(l(k+" should be "+d+" for key "+f),!1)})};this.areNodesEqual=a;this.shouldBeNull=function(a,b){e(a,b,"null")};this.shouldBeNonNull=function(a,b){var d,k;try{k=eval(b)}catch(f){d=f}d?l(b+" should be non-null. Threw exception "+d):null!==k?runtime.log("pass",b+" is non-null."):l(b+" should be non-null. Was "+k)};this.shouldBe=e;this.countFailedTests=function(){return g}}; -core.UnitTester=function(){function l(a,b){return""+a+""}var m=0,h={};this.runTests=function(a,b,e){function g(a){if(0===a.length)h[d]=q,m+=p.countFailedTests(),b();else{f=a[0];var k=Runtime.getFunctionName(f);runtime.log("Running "+k);u=p.countFailedTests();c.setUp();f(function(){c.tearDown();q[k]=u===p.countFailedTests();g(a.slice(1))})}}var d=Runtime.getFunctionName(a),p=new core.UnitTestRunner,c=new a(p),q={},k,f,n,u,s="BrowserRuntime"=== -runtime.type();if(h.hasOwnProperty(d))runtime.log("Test "+d+" has already run.");else{s?runtime.log("Running "+l(d,'runSuite("'+d+'");')+": "+c.description()+""):runtime.log("Running "+d+": "+c.description);n=c.tests();for(k=0;kRunning "+l(a,'runTest("'+d+'","'+a+'")')+""):runtime.log("Running "+a),u=p.countFailedTests(),c.setUp(),f(),c.tearDown(),q[a]=u===p.countFailedTests()); -g(c.asyncTests())}};this.countFailedTests=function(){return m};this.results=function(){return h}}; +core.UnitTest.provideTestAreaDiv=function(){var h=runtime.getWindow().document,m=h.getElementById("testarea");runtime.assert(!m,'Unclean test environment, found a div with id "testarea".');m=h.createElement("div");m.setAttribute("id","testarea");h.body.appendChild(m);return m}; +core.UnitTest.cleanupTestAreaDiv=function(){var h=runtime.getWindow().document,m=h.getElementById("testarea");runtime.assert(!!m&&m.parentNode===h.body,'Test environment broken, found no div with id "testarea" below body.');h.body.removeChild(m)};core.UnitTest.createOdtDocument=function(h,m){var f="",f=f+"";return runtime.parseXML(f)}; +core.UnitTestRunner=function(){function h(a){b+=1;runtime.log("fail",a)}function m(a,b){var c;try{if(a.length!==b.length)return h("array of length "+a.length+" should be "+b.length+" long"),!1;for(c=0;c1/g?"-0":String(g),h(b+" should be "+a+". Was "+d+".")):h(b+" should be "+a+" (of type "+typeof a+"). Was "+g+" (of type "+typeof g+").")}var b=0,k;k=function(a,b){var d=Object.keys(a),n=Object.keys(b);d.sort();n.sort();return m(d,n)&&Object.keys(a).every(function(d){var n= +a[d],k=b[d];return c(n,k)?!0:(h(n+" should be "+k+" for key "+d),!1)})};this.areNodesEqual=a;this.shouldBeNull=function(a,b){d(a,b,"null")};this.shouldBeNonNull=function(a,b){var c,d;try{d=eval(b)}catch(g){c=g}c?h(b+" should be non-null. Threw exception "+c):null!==d?runtime.log("pass",b+" is non-null."):h(b+" should be non-null. Was "+d)};this.shouldBe=d;this.countFailedTests=function(){return b}}; +core.UnitTester=function(){function h(a,c){return""+a+""}var m=0,f={};this.runTests=function(a,c,d){function b(a){if(0===a.length)f[k]=s,m+=p.countFailedTests(),c();else{g=a[0];var d=Runtime.getFunctionName(g);runtime.log("Running "+d);u=p.countFailedTests();e.setUp();g(function(){e.tearDown();s[d]=u===p.countFailedTests();b(a.slice(1))})}}var k=Runtime.getFunctionName(a),p=new core.UnitTestRunner,e=new a(p),s={},n,g,l,u,q="BrowserRuntime"=== +runtime.type();if(f.hasOwnProperty(k))runtime.log("Test "+k+" has already run.");else{q?runtime.log("Running "+h(k,'runSuite("'+k+'");')+": "+e.description()+""):runtime.log("Running "+k+": "+e.description);l=e.tests();for(n=0;nRunning "+h(a,'runTest("'+k+'","'+a+'")')+""):runtime.log("Running "+a),u=p.countFailedTests(),e.setUp(),g(),e.tearDown(),s[a]=u===p.countFailedTests()); +b(e.asyncTests())}};this.countFailedTests=function(){return m};this.results=function(){return f}}; // Input 13 -core.PositionIterator=function(l,m,h,a){function b(){this.acceptNode=function(a){return a.nodeType===Node.TEXT_NODE&&0===a.length?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}function e(a){this.acceptNode=function(b){return b.nodeType===Node.TEXT_NODE&&0===b.length?NodeFilter.FILTER_REJECT:a.acceptNode(b)}}function g(){var a=p.currentNode.nodeType;c=a===Node.TEXT_NODE?p.currentNode.length-1:a===Node.ELEMENT_NODE?1:0}var d=this,p,c,q;this.nextPosition=function(){if(p.currentNode===l)return!1; -if(0===c&&p.currentNode.nodeType===Node.ELEMENT_NODE)null===p.firstChild()&&(c=1);else if(p.currentNode.nodeType===Node.TEXT_NODE&&c+1 "+a.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"),b===a.length&&(c=void 0,p.nextSibling()?c=0:p.parentNode()&&(c=1),runtime.assert(void 0!==c,"Error in setPosition: position not valid.")),!0;e=q(a);for(g=a.parentNode;g&&g!==l&&e===NodeFilter.FILTER_ACCEPT;)e= -q(g),e!==NodeFilter.FILTER_ACCEPT&&(p.currentNode=g),g=g.parentNode;b "+a.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"),b===a.length&&(e=void 0,p.nextSibling()?e=0:p.parentNode()&&(e=1),runtime.assert(void 0!==e,"Error in setPosition: position not valid.")),!0;c=s(a);for(d=a.parentNode;d&&d!==h&&c===NodeFilter.FILTER_ACCEPT;)c= +s(d),c!==NodeFilter.FILTER_ACCEPT&&(p.currentNode=d),d=d.parentNode;b>>8^d;return c^-1}function a(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 e(b,c){var f,k,d,e,g,n,h,s=this;this.load=function(a){if(void 0!==s.data)a(null,s.data);else{var c=g+34+k+d+256;c+h>u&&(c=u-h);runtime.read(b,h,c,function(c,f){if(c||null===f)a(c,f);else a:{var k=f,d=new core.ByteArray(k),h=d.readUInt32LE(),v;if(67324752!==h)a("File entry signature is wrong."+h.toString()+" "+k.length.toString(),null);else{d.pos+=22;h=d.readUInt16LE();v=d.readUInt16LE();d.pos+=h+v; -if(e){k=k.slice(d.pos,d.pos+g);if(g!==k.length){a("The amount of compressed bytes read was "+k.length.toString()+" instead of "+g.toString()+" for "+s.filename+" in "+b+".",null);break a}k=x(k,n)}else k=k.slice(d.pos,d.pos+n);n!==k.length?a("The amount of bytes read was "+k.length.toString()+" instead of "+n.toString()+" for "+s.filename+" in "+b+".",null):(s.data=k,a(null,k))}}})}};this.set=function(a,b,c,f){s.filename=a;s.data=b;s.compressed=c;s.date=f};this.error=null;c&&(f=c.readUInt32LE(),33639248!== -f?this.error="Central directory entry has wrong signature at position "+(c.pos-4).toString()+' for file "'+b+'": '+c.data.length.toString():(c.pos+=6,e=c.readUInt16LE(),this.date=a(c.readUInt32LE()),c.readUInt32LE(),g=c.readUInt32LE(),n=c.readUInt32LE(),k=c.readUInt16LE(),d=c.readUInt16LE(),f=c.readUInt16LE(),c.pos+=8,h=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.slice(c.pos,c.pos+k),"utf8"),c.pos+=k+d+f))}function g(a,b){if(22!==a.length)b("Central directory length should be 22.", -r);else{var c=new core.ByteArray(a),f;f=c.readUInt32LE();101010256!==f?b("Central directory signature is wrong: "+f.toString(),r):(f=c.readUInt16LE(),0!==f?b("Zip files with non-zero disk numbers are not supported.",r):(f=c.readUInt16LE(),0!==f?b("Zip files with non-zero disk numbers are not supported.",r):(f=c.readUInt16LE(),s=c.readUInt16LE(),f!==s?b("Number of entries is inconsistent.",r):(f=c.readUInt32LE(),c=c.readUInt16LE(),c=u-22-f,runtime.read(l,c,u-c,function(a,c){if(a||null===c)b(a,r);else a:{var f= -new core.ByteArray(c),k,d;n=[];for(k=0;ku?m("File '"+l+"' cannot be read.",r):runtime.read(l,u-22,22,function(a,b){a||null===m||null===b?m(a,r):g(b,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],c,e,d=a.length,g=0,g=0;c=-1;for(e=0;e>>8^g;return c^-1}function a(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 c(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 d(b,c){var e,d,g,l,k,n,f,h=this;this.load=function(a){if(void 0!==h.data)a(null,h.data);else{var c=k+34+d+g+256;c+f>u&&(c=u-f);runtime.read(b,f,c,function(c,e){if(c||null===e)a(c,e);else a:{var d=e,g=new core.ByteArray(d),v=g.readUInt32LE(),f;if(67324752!==v)a("File entry signature is wrong."+v.toString()+" "+d.length.toString(),null);else{g.pos+=22;v=g.readUInt16LE();f=g.readUInt16LE();g.pos+=v+f; +if(l){d=d.slice(g.pos,g.pos+k);if(k!==d.length){a("The amount of compressed bytes read was "+d.length.toString()+" instead of "+k.toString()+" for "+h.filename+" in "+b+".",null);break a}d=x(d,n)}else d=d.slice(g.pos,g.pos+n);n!==d.length?a("The amount of bytes read was "+d.length.toString()+" instead of "+n.toString()+" for "+h.filename+" in "+b+".",null):(h.data=d,a(null,d))}}})}};this.set=function(a,b,c,e){h.filename=a;h.data=b;h.compressed=c;h.date=e};this.error=null;c&&(e=c.readUInt32LE(),33639248!== +e?this.error="Central directory entry has wrong signature at position "+(c.pos-4).toString()+' for file "'+b+'": '+c.data.length.toString():(c.pos+=6,l=c.readUInt16LE(),this.date=a(c.readUInt32LE()),c.readUInt32LE(),k=c.readUInt32LE(),n=c.readUInt32LE(),d=c.readUInt16LE(),g=c.readUInt16LE(),e=c.readUInt16LE(),c.pos+=8,f=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.slice(c.pos,c.pos+d),"utf8"),c.pos+=d+g+e))}function b(a,b){if(22!==a.length)b("Central directory length should be 22.", +r);else{var c=new core.ByteArray(a),e;e=c.readUInt32LE();101010256!==e?b("Central directory signature is wrong: "+e.toString(),r):(e=c.readUInt16LE(),0!==e?b("Zip files with non-zero disk numbers are not supported.",r):(e=c.readUInt16LE(),0!==e?b("Zip files with non-zero disk numbers are not supported.",r):(e=c.readUInt16LE(),q=c.readUInt16LE(),e!==q?b("Number of entries is inconsistent.",r):(e=c.readUInt32LE(),c=c.readUInt16LE(),c=u-22-e,runtime.read(h,c,u-c,function(a,c){if(a||null===c)b(a,r);else a:{var e= +new core.ByteArray(c),g,k;l=[];for(g=0;gu?m("File '"+h+"' cannot be read.",r):runtime.read(h,u-22,22,function(a,c){a||null===m||null===c?m(a,r):b(c,m)})})}; // Input 18 -core.CSSUnits=function(){var l={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(m,h,a){return m*l[a]/l[h]};this.convertMeasure=function(l,h){var a,b;l&&h?(a=parseFloat(l),b=l.replace(a.toString(),""),a=this.convert(a,b,h)):a="";return a.toString()};this.getUnits=function(l){return l.substr(l.length-2,l.length)}}; +core.CSSUnits=function(){var h={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(m,f,a){return m*h[a]/h[f]};this.convertMeasure=function(h,f){var a,c;h&&f?(a=parseFloat(h),c=h.replace(a.toString(),""),a=this.convert(a,c,f)):a="";return a.toString()};this.getUnits=function(h){return h.substr(h.length-2,h.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(a){var e=a||{},g=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}(a),d=[e],h=[g],c=0;this.push=function(){c+=1;e=d[c]=Object.create(e);g=h[c]=Object.create(g)};this.pop=function(){d[c]=void 0;h[c]=void 0;c-=1;e=d[c];g=h[c]};this.getLocalNamespaceDefinitions=function(){return g};this.getQName=function(a){var b=a.namespaceURI,c=0,d;if(!b)return a.localName;if(d=g[b])return d+":"+a.localName;do{d||!a.prefix?(d="ns"+c,c+=1):d=a.prefix; -if(e[d]===b)break;if(!e[d]){e[d]=b;g[b]=d;break}d=null}while(null===d);return d+":"+a.localName}}function m(a){return a.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function h(b,e){var g="",d=a.filter?a.filter.acceptNode(e):NodeFilter.FILTER_ACCEPT,l;if(d===NodeFilter.FILTER_ACCEPT&&e.nodeType===Node.ELEMENT_NODE){b.push();l=b.getQName(e);var c,q=e.attributes,k,f,n,u="",s;c="<"+l;k=q.length;for(f=0;f")}if(d===NodeFilter.FILTER_ACCEPT||d===NodeFilter.FILTER_SKIP){for(d=e.firstChild;d;)g+=h(b,d),d=d.nextSibling;e.nodeValue&&(g+=m(e.nodeValue))}l&&(g+="",b.pop());return g}var a=this;this.filter=null;this.writeToString=function(a,e){if(!a)return"";var g=new l(e);return h(g,a)}}; +"function"!==typeof Object.create&&(Object.create=function(h){var m=function(){};m.prototype=h;return new m}); +xmldom.LSSerializer=function(){function h(a){var d=a||{},b=function(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}(a),k=[d],f=[b],e=0;this.push=function(){e+=1;d=k[e]=Object.create(d);b=f[e]=Object.create(b)};this.pop=function(){k[e]=void 0;f[e]=void 0;e-=1;d=k[e];b=f[e]};this.getLocalNamespaceDefinitions=function(){return b};this.getQName=function(a){var c=a.namespaceURI,e=0,l;if(!c)return a.localName;if(l=b[c])return l+":"+a.localName;do{l||!a.prefix?(l="ns"+e,e+=1):l=a.prefix; +if(d[l]===c)break;if(!d[l]){d[l]=c;b[c]=l;break}l=null}while(null===l);return l+":"+a.localName}}function m(a){return a.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function f(c,d){var b="",k=a.filter?a.filter.acceptNode(d):NodeFilter.FILTER_ACCEPT,h;if(k===NodeFilter.FILTER_ACCEPT&&d.nodeType===Node.ELEMENT_NODE){c.push();h=c.getQName(d);var e,s=d.attributes,n,g,l,u="",q;e="<"+h;n=s.length;for(g=0;g")}if(k===NodeFilter.FILTER_ACCEPT||k===NodeFilter.FILTER_SKIP){for(k=d.firstChild;k;)b+=f(c,k),k=k.nextSibling;d.nodeValue&&(b+=m(d.nodeValue))}h&&(b+="",c.pop());return b}var a=this;this.filter=null;this.writeToString=function(a,d){if(!a)return"";var b=new h(d);return f(b,a)}}; // 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 h(a){a=a.split(":",2);var b="",k;1===a.length?a=["",a[0]]:b=a[0];for(k in d)d[k]===b&&(a[0]=k);return a}function a(b,d){for(var k=0,f,e,g=b.name;b.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 f(a){a=a.split(":",2);var b="",c;1===a.length?a=["",a[0]]:b=a[0];for(c in k)k[c]===b&&(a[0]=c);return a}function a(b,c){for(var d=0,g,l,k=b.name;b.e&&d=f.length)return b;0===k&&(k=0);for(var e=f.item(k);e.namespaceURI===c;){k+=1;if(k>=f.length)return b;e=f.item(k)}return e=d(a,b.attDeriv(a,f.item(k)),f,k+1)}function p(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):p(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)): -p(a,b,c.e[1])}var c="http://www.w3.org/2000/xmlns/",q,k,f,n,u,s,x,r,y,t,w={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return w},startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return w},endTagDeriv:function(){return w}},v={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return w},startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return w}}, -F={type:"text",nullable:!0,hash:"text",textDeriv:function(){return F},startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return F},endTagDeriv:function(){return w}},J,z,L;q=a("choice",function(a,b){if(a===w)return b;if(b===w||a===b)return a},function(a,c){var f={},k;b(f,{p1:a,p2:c});c=a=void 0;for(k in f)f.hasOwnProperty(k)&&(void 0===a?a=f[k]:c=void 0===c?f[k]:q(c,f[k]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, -textDeriv:function(c,f){return q(a.textDeriv(c,f),b.textDeriv(c,f))},startTagOpenDeriv:h(function(c){return q(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,f){return q(a.attDeriv(c,f),b.attDeriv(c,f))},startTagCloseDeriv:l(function(){return q(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:l(function(){return q(a.endTagDeriv(),b.endTagDeriv())})}}(a,c)});k=function(a,b,c){return function(){var f={},k=0;return function(d,e){var g=b&&b(d,e),n,h;if(void 0!==g)return g; -g=d.hash||d.toString();n=e.hash||e.toString();g=c.length)return b;0===d&&(d=0);for(var g=c.item(d);g.namespaceURI===e;){d+=1;if(d>=c.length)return b;g=c.item(d)}return g=k(a,b.attDeriv(a,c.item(d)),c,d+1)}function p(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):p(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)): +p(a,b,c.e[1])}var e="http://www.w3.org/2000/xmlns/",s,n,g,l,u,q,x,r,y,t,w={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return w},startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return w},endTagDeriv:function(){return w}},v={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return w},startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return w}}, +C={type:"text",nullable:!0,hash:"text",textDeriv:function(){return C},startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return C},endTagDeriv:function(){return w}},J,E,K;s=a("choice",function(a,b){if(a===w)return b;if(b===w||a===b)return a},function(a,b){var d={},e;c(d,{p1:a,p2:b});b=a=void 0;for(e in d)d.hasOwnProperty(e)&&(void 0===a?a=d[e]:b=void 0===b?d[e]:s(b,d[e]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, +textDeriv:function(c,d){return s(a.textDeriv(c,d),b.textDeriv(c,d))},startTagOpenDeriv:f(function(c){return s(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,d){return s(a.attDeriv(c,d),b.attDeriv(c,d))},startTagCloseDeriv:h(function(){return s(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:h(function(){return s(a.endTagDeriv(),b.endTagDeriv())})}}(a,b)});n=function(a,b,c){return function(){var d={},e=0;return function(g,l){var k=b&&b(g,l),n,f;if(void 0!==k)return k; +k=g.hash||g.toString();n=l.hash||l.toString();kNode.ELEMENT_NODE;){if(c!==Node.COMMENT_NODE&&(c!==Node.TEXT_NODE||!/^\s+$/.test(b.currentNode.nodeValue)))return[new l("Not allowed node of type "+ -c+".")];c=(h=b.nextSibling())?h.nodeType:0}if(!h)return[new l("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(e[h.namespaceURI]+":"+h.localName))return[new l("Found "+h.nodeName+" instead of "+a.names+".",h)];if(b.firstChild()){for(q=m(a.e[1],b,h);b.nextSibling();)if(c=b.currentNode.nodeType,!(b.currentNode&&b.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(b.currentNode.nodeValue)||c===Node.COMMENT_NODE))return[new l("Spurious content.",b.currentNode)];if(b.parentNode()!==h)return[new l("Implementation error.")]}else q= -m(a.e[1],b,h);b.nextSibling();return q}var a,b,e;b=function(a,d,e,c){var q=a.name,k=null;if("text"===q)a:{for(var f=(a=d.currentNode)?a.nodeType:0;a!==e&&3!==f;){if(1===f){k=[new l("Element not allowed here.",a)];break a}f=(a=d.nextSibling())?a.nodeType:0}d.nextSibling();k=null}else if("data"===q)k=null;else if("value"===q)c!==a.text&&(k=[new l("Wrong value, should be '"+a.text+"', not '"+c+"'",e)]);else if("list"===q)k=null;else if("attribute"===q)a:{if(2!==a.e.length)throw"Attribute with wrong # of elements: "+ -a.e.length;q=a.localnames.length;for(k=0;kNode.ELEMENT_NODE;){if(e!==Node.COMMENT_NODE&&(e!==Node.TEXT_NODE||!/^\s+$/.test(c.currentNode.nodeValue)))return[new h("Not allowed node of type "+ +e+".")];e=(f=c.nextSibling())?f.nodeType:0}if(!f)return[new h("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(d[f.namespaceURI]+":"+f.localName))return[new h("Found "+f.nodeName+" instead of "+a.names+".",f)];if(c.firstChild()){for(s=m(a.e[1],c,f);c.nextSibling();)if(e=c.currentNode.nodeType,!(c.currentNode&&c.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(c.currentNode.nodeValue)||e===Node.COMMENT_NODE))return[new h("Spurious content.",c.currentNode)];if(c.parentNode()!==f)return[new h("Implementation error.")]}else s= +m(a.e[1],c,f);c.nextSibling();return s}var a,c,d;c=function(a,d,p,e){var s=a.name,n=null;if("text"===s)a:{for(var g=(a=d.currentNode)?a.nodeType:0;a!==p&&3!==g;){if(1===g){n=[new h("Element not allowed here.",a)];break a}g=(a=d.nextSibling())?a.nodeType:0}d.nextSibling();n=null}else if("data"===s)n=null;else if("value"===s)e!==a.text&&(n=[new h("Wrong value, should be '"+a.text+"', not '"+e+"'",p)]);else if("list"===s)n=null;else if("attribute"===s)a:{if(2!==a.e.length)throw"Attribute with wrong # of elements: "+ +a.e.length;s=a.localnames.length;for(n=0;n=g&&c.push(m(a.substring(b,d)))):"["===a[d]&&(0>=g&&(b=d+1),g+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};c=function(c,f,e){var h,l,m,r;for(h=0;h=k&&c.push(m(a.substring(b,d)))):"["===a[d]&&(0>=k&&(b=d+1),k+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};e=function(d,e,l){var f,h,m,r;for(f=0;f=(m.getBoundingClientRect().top-t.bottom)/r?c.style.top=Math.abs(m.getBoundingClientRect().top-t.bottom)/r+20+"px":c.style.top="0px");g.style.left=e.getBoundingClientRect().width/r+"px";var e=g.style,m=g.getBoundingClientRect().left/r,y=g.getBoundingClientRect().top/r,t=c.getBoundingClientRect().left/r,w=c.getBoundingClientRect().top/r,v=0,F= -0,v=t-m,v=v*v,F=w-y,F=F*F,m=Math.sqrt(v+F);e.width=m+"px";r=Math.asin((c.getBoundingClientRect().top-g.getBoundingClientRect().top)/(r*parseFloat(g.style.width)));g.style.transform="rotate("+r+"rad)";g.style.MozTransform="rotate("+r+"rad)";g.style.WebkitTransform="rotate("+r+"rad)";g.style.msTransform="rotate("+r+"rad)";b&&(r=q.getComputedStyle(b,":before").content)&&"none"!==r&&(r=r.substring(1,r.length-1),b.firstChild?b.firstChild.nodeValue=r:b.appendChild(p.createTextNode(r)))}}var d=[],p=m.ownerDocument, -c=new odf.OdfUtils,q=runtime.getWindow();runtime.assert(Boolean(q),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=g;this.addAnnotation=function(c){b(!0);d.push({node:c.node,end:c.end});e();var f=p.createElement("div"),h=p.createElement("div"),l=p.createElement("div"),m=p.createElement("div"),x=p.createElement("div"),r=c.node;f.className="annotationWrapper";r.parentNode.insertBefore(f,r);h.className="annotationNote";h.appendChild(r);x.className= -"annotationRemoveButton";h.appendChild(x);l.className="annotationConnector horizontal";m.className="annotationConnector angular";f.appendChild(h);f.appendChild(l);f.appendChild(m);c.end&&a(c);g()};this.forgetAnnotations=function(){for(;d.length;){var a=d[0],c=d.indexOf(a),e=a.node,g=e.parentNode.parentNode;"div"===g.localName&&(g.parentNode.insertBefore(e,g),g.parentNode.removeChild(g));a=a.node.getAttributeNS(odf.Namespaces.officens,"name");a=p.querySelectorAll('span.annotationHighlight[annotation="'+ -a+'"]');g=e=void 0;for(e=0;e=(m.getBoundingClientRect().top-t.bottom)/r?c.style.top=Math.abs(m.getBoundingClientRect().top-t.bottom)/r+20+"px":c.style.top="0px");e.style.left=d.getBoundingClientRect().width/r+"px";var d=e.style,m=e.getBoundingClientRect().left/r,y=e.getBoundingClientRect().top/r,t=c.getBoundingClientRect().left/r,w=c.getBoundingClientRect().top/r,v=0,C= +0,v=t-m,v=v*v,C=w-y,C=C*C,m=Math.sqrt(v+C);d.width=m+"px";r=Math.asin((c.getBoundingClientRect().top-e.getBoundingClientRect().top)/(r*parseFloat(e.style.width)));e.style.transform="rotate("+r+"rad)";e.style.MozTransform="rotate("+r+"rad)";e.style.WebkitTransform="rotate("+r+"rad)";e.style.msTransform="rotate("+r+"rad)";b&&(r=s.getComputedStyle(b,":before").content)&&"none"!==r&&(r=r.substring(1,r.length-1),b.firstChild?b.firstChild.nodeValue=r:b.appendChild(p.createTextNode(r)))}}var k=[],p=m.ownerDocument, +e=new odf.OdfUtils,s=runtime.getWindow();runtime.assert(Boolean(s),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=b;this.addAnnotation=function(e){c(!0);k.push({node:e.node,end:e.end});d();var g=p.createElement("div"),l=p.createElement("div"),f=p.createElement("div"),h=p.createElement("div"),m=p.createElement("div"),r=e.node;g.className="annotationWrapper";r.parentNode.insertBefore(g,r);l.className="annotationNote";l.appendChild(r);m.className= +"annotationRemoveButton";l.appendChild(m);f.className="annotationConnector horizontal";h.className="annotationConnector angular";g.appendChild(l);g.appendChild(f);g.appendChild(h);e.end&&a(e);b()};this.forgetAnnotations=function(){for(;k.length;){var a=k[0],b=k.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=p.querySelectorAll('span.annotationHighlight[annotation="'+ +a+'"]');e=d=void 0;for(d=0;da.value||"%"===a.unit)?null:a}function s(a){return(a=n(a))&&"%"!==a.unit?null:a}function x(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 r=odf.Namespaces.textns,y=odf.Namespaces.drawns,t=/^\s*$/,w=new core.DomUtils;this.isParagraph=l;this.getParagraphElement=m;this.isWithinTrackedChanges=function(a,b){for(;a&&a!==b;){if(a.namespaceURI===r&&"tracked-changes"===a.localName)return!0;a=a.parentNode}return!1};this.isListItem=function(a){return"list-item"===(a&&a.localName)&&a.namespaceURI===r};this.isODFWhitespace=h;this.isGroupingElement=a;this.isCharacterElement=b;this.firstChild=e;this.lastChild=g;this.previousNode=d;this.nextNode= -p;this.scanLeftForNonWhitespace=c;this.lookLeftForCharacter=function(a){var f;f=0;a.nodeType===Node.TEXT_NODE&&0=b.value|| -"%"===b.unit)?null:b;return b||s(a)};this.parseFoLineHeight=function(a){return u(a)||s(a)};this.getImpactedParagraphs=function(a){var b=a.commonAncestorContainer,c=[];for(b.nodeType===Node.ELEMENT_NODE&&(c=w.getElementsByTagNameNS(b,r,"p").concat(w.getElementsByTagNameNS(b,r,"h")));b&&!l(b);)b=b.parentNode;b&&c.push(b);return c.filter(function(b){return w.rangeIntersectsNode(a,b)})};this.getTextNodes=function(a,b){var c=a.startContainer.ownerDocument.createRange(),d;d=w.getNodesInRange(a,function(d){c.selectNodeContents(d); -if(d.nodeType===Node.TEXT_NODE){if(b&&w.rangesIntersect(a,c)||w.containsRange(a,c))return Boolean(m(d)&&(!h(d.textContent)||f(d,0)))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}else if(w.rangesIntersect(a,c)&&x(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});c.detach();return d};this.getTextElements=function(c,d){var e=c.startContainer.ownerDocument.createRange(),k;k=w.getNodesInRange(c,function(k){var g=k.nodeType;e.selectNodeContents(k);if(g===Node.TEXT_NODE){if(w.containsRange(c, -e)&&(d||Boolean(m(k)&&(!h(k.textContent)||f(k,0)))))return NodeFilter.FILTER_ACCEPT}else if(b(k)){if(w.containsRange(c,e))return NodeFilter.FILTER_ACCEPT}else if(x(k)||a(k))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});e.detach();return k};this.getParagraphElements=function(b){var c=b.startContainer.ownerDocument.createRange(),d;d=w.getNodesInRange(b,function(d){c.selectNodeContents(d);if(l(d)){if(w.rangesIntersect(b,c))return NodeFilter.FILTER_ACCEPT}else if(x(d)||a(d))return NodeFilter.FILTER_SKIP; -return NodeFilter.FILTER_REJECT});c.detach();return d}}; +odf.OdfUtils=function(){function h(a){var c=a&&a.localName;return("p"===c||"h"===c)&&a.namespaceURI===r}function m(a){for(;a&&!h(a);)a=a.parentNode;return a}function f(a){return/^[ \t\r\n]+$/.test(a)}function a(a){var c=a&&a.localName;return/^(span|p|h|a|meta)$/.test(c)&&a.namespaceURI===r||"span"===c&&"annotationHighlight"===a.className?!0:!1}function c(a){var c=a&&a.localName,b,d=!1;c&&(b=a.namespaceURI,b===r?d="s"===c||"tab"===c||"line-break"===c:b===y&&(d="frame"===c&&"as-char"===a.getAttributeNS(r, +"anchor-type")));return d}function d(c){for(;null!==c.firstChild&&a(c);)c=c.firstChild;return c}function b(c){for(;null!==c.lastChild&&a(c);)c=c.lastChild;return c}function k(a){for(;!h(a)&&null===a.previousSibling;)a=a.parentNode;return h(a)?null:b(a.previousSibling)}function p(a){for(;!h(a)&&null===a.nextSibling;)a=a.parentNode;return h(a)?null:d(a.nextSibling)}function e(a){for(var b=!1;a;)if(a.nodeType===Node.TEXT_NODE)if(0===a.length)a=k(a);else return!f(a.data.substr(a.length-1,1));else c(a)? +(b=!0,a=null):a=k(a);return b}function s(a){var b=!1;for(a=a&&d(a);a;){if(a.nodeType===Node.TEXT_NODE&&0a.value||"%"===a.unit)?null:a}function q(a){return(a=l(a))&&"%"!==a.unit?null:a}function x(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 r=odf.Namespaces.textns,y=odf.Namespaces.drawns,t=/^\s*$/,w=new core.DomUtils;this.isParagraph=h;this.getParagraphElement=m;this.isWithinTrackedChanges=function(a,c){for(;a&&a!==c;){if(a.namespaceURI===r&&"tracked-changes"===a.localName)return!0;a=a.parentNode}return!1};this.isListItem=function(a){return"list-item"===(a&&a.localName)&&a.namespaceURI===r};this.isODFWhitespace=f;this.isGroupingElement=a;this.isCharacterElement=c;this.firstChild=d;this.lastChild=b;this.previousNode=k;this.nextNode= +p;this.scanLeftForNonWhitespace=e;this.lookLeftForCharacter=function(a){var b;b=0;a.nodeType===Node.TEXT_NODE&&0=c.value|| +"%"===c.unit)?null:c;return c||q(a)};this.parseFoLineHeight=function(a){return u(a)||q(a)};this.getImpactedParagraphs=function(a){var c=a.commonAncestorContainer,b=[];for(c.nodeType===Node.ELEMENT_NODE&&(b=w.getElementsByTagNameNS(c,r,"p").concat(w.getElementsByTagNameNS(c,r,"h")));c&&!h(c);)c=c.parentNode;c&&b.push(c);return b.filter(function(c){return w.rangeIntersectsNode(a,c)})};this.getTextNodes=function(a,c){var b=a.startContainer.ownerDocument.createRange(),d;d=w.getNodesInRange(a,function(d){b.selectNodeContents(d); +if(d.nodeType===Node.TEXT_NODE){if(c&&w.rangesIntersect(a,b)||w.containsRange(a,b))return Boolean(m(d)&&(!f(d.textContent)||g(d,0)))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}else if(w.rangesIntersect(a,b)&&x(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});b.detach();return d};this.getTextElements=function(b,d){var e=b.startContainer.ownerDocument.createRange(),k;k=w.getNodesInRange(b,function(k){var l=k.nodeType;e.selectNodeContents(k);if(l===Node.TEXT_NODE){if(w.containsRange(b, +e)&&(d||Boolean(m(k)&&(!f(k.textContent)||g(k,0)))))return NodeFilter.FILTER_ACCEPT}else if(c(k)){if(w.containsRange(b,e))return NodeFilter.FILTER_ACCEPT}else if(x(k)||a(k))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});e.detach();return k};this.getParagraphElements=function(c){var b=c.startContainer.ownerDocument.createRange(),d;d=w.getNodesInRange(c,function(d){b.selectNodeContents(d);if(h(d)){if(w.rangesIntersect(c,b))return NodeFilter.FILTER_ACCEPT}else if(x(d)||a(d))return NodeFilter.FILTER_SKIP; +return NodeFilter.FILTER_REJECT});b.detach();return d}}; // Input 30 /* @@ -603,7 +603,7 @@ return NodeFilter.FILTER_REJECT});c.detach();return d}}; @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.OdfUtils"); -odf.TextSerializer=function(){function l(a){var b="",e=m.filter?m.filter.acceptNode(a):NodeFilter.FILTER_ACCEPT,g=a.nodeType,d;if(e===NodeFilter.FILTER_ACCEPT||e===NodeFilter.FILTER_SKIP)for(d=a.firstChild;d;)b+=l(d),d=d.nextSibling;e===NodeFilter.FILTER_ACCEPT&&(g===Node.ELEMENT_NODE&&h.isParagraph(a)?b+="\n":g===Node.TEXT_NODE&&a.textContent&&(b+=a.textContent));return b}var m=this,h=new odf.OdfUtils;this.filter=null;this.writeToString=function(a){return a?l(a):""}}; +odf.TextSerializer=function(){function h(a){var c="",d=m.filter?m.filter.acceptNode(a):NodeFilter.FILTER_ACCEPT,b=a.nodeType,k;if(d===NodeFilter.FILTER_ACCEPT||d===NodeFilter.FILTER_SKIP)for(k=a.firstChild;k;)c+=h(k),k=k.nextSibling;d===NodeFilter.FILTER_ACCEPT&&(b===Node.ELEMENT_NODE&&f.isParagraph(a)?c+="\n":b===Node.TEXT_NODE&&a.textContent&&(c+=a.textContent));return c}var m=this,f=new odf.OdfUtils;this.filter=null;this.writeToString=function(a){return a?h(a):""}}; // Input 31 /* @@ -640,10 +640,10 @@ odf.TextSerializer=function(){function l(a){var b="",e=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,h){function a(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(d){d=m.getAppliedStylesForElement(d);return b(a,d)}}function b(a){var b={};this.applyStyleToContainer=function(e){var f;f=e.getAttributeNS(d,"style-name");var g=e.ownerDocument;f=f||"";if(!b.hasOwnProperty(f)){var u=f,s;s=f?m.createDerivedStyleObject(f,"text",a):a;g=g.createElementNS(p,"style:style"); -m.updateStyle(g,s);g.setAttributeNS(p,"style:name",l.generateName());g.setAttributeNS(p,"style:family","text");g.setAttributeNS("urn:webodf:names:scope","scope","document-content");h.appendChild(g);b[u]=g}f=b[f].getAttributeNS(p,"name");e.setAttributeNS(d,"text:style-name",f)}}function e(a,b){var e=a.ownerDocument,f=a.parentNode,h,l,m=new core.LoopWatchDog(1E3);l=[];"span"!==f.localName||f.namespaceURI!==d?(h=e.createElementNS(d,"text:span"),f.insertBefore(h,a),f=!1):(a.previousSibling&&!g.rangeContainsNode(b, -f.firstChild)?(h=f.cloneNode(!1),f.parentNode.insertBefore(h,f.nextSibling)):h=f,f=!0);l.push(a);for(e=a.nextSibling;e&&g.rangeContainsNode(b,e);)m.check(),l.push(e),e=e.nextSibling;l.forEach(function(a){a.parentNode!==h&&h.appendChild(a)});if(e&&f)for(l=h.cloneNode(!1),h.parentNode.insertBefore(l,h.nextSibling);e;)m.check(),f=e.nextSibling,l.appendChild(e),e=f;return h}var g=new core.DomUtils,d=odf.Namespaces.textns,p=odf.Namespaces.stylens;this.applyStyle=function(c,d,g){var f={},h,l,m,x;runtime.assert(g&& -g["style:text-properties"],"applyStyle without any text properties");f["style:text-properties"]=g["style:text-properties"];m=new b(f);x=new a(f);c.forEach(function(a){h=x.isStyleApplied(a);!1===h&&(l=e(a,d),m.applyStyleToContainer(l))})}}; +odf.TextStyleApplicator=function(h,m,f){function a(a){function c(a,b){return"object"===typeof a&&"object"===typeof b?Object.keys(a).every(function(d){return c(a[d],b[d])}):a===b}this.isStyleApplied=function(b){b=m.getAppliedStylesForElement(b);return c(a,b)}}function c(a){var c={};this.applyStyleToContainer=function(b){var d;d=b.getAttributeNS(k,"style-name");var l=b.ownerDocument;d=d||"";if(!c.hasOwnProperty(d)){var u=d,q;q=d?m.createDerivedStyleObject(d,"text",a):a;l=l.createElementNS(p,"style:style"); +m.updateStyle(l,q);l.setAttributeNS(p,"style:name",h.generateName());l.setAttributeNS(p,"style:family","text");l.setAttributeNS("urn:webodf:names:scope","scope","document-content");f.appendChild(l);c[u]=l}d=c[d].getAttributeNS(p,"name");b.setAttributeNS(k,"text:style-name",d)}}function d(a,c){var d=a.ownerDocument,g=a.parentNode,l,f,h=new core.LoopWatchDog(1E3);f=[];"span"!==g.localName||g.namespaceURI!==k?(l=d.createElementNS(k,"text:span"),g.insertBefore(l,a),g=!1):(a.previousSibling&&!b.rangeContainsNode(c, +g.firstChild)?(l=g.cloneNode(!1),g.parentNode.insertBefore(l,g.nextSibling)):l=g,g=!0);f.push(a);for(d=a.nextSibling;d&&b.rangeContainsNode(c,d);)h.check(),f.push(d),d=d.nextSibling;f.forEach(function(a){a.parentNode!==l&&l.appendChild(a)});if(d&&g)for(f=l.cloneNode(!1),l.parentNode.insertBefore(f,l.nextSibling);d;)h.check(),g=d.nextSibling,f.appendChild(d),d=g;return l}var b=new core.DomUtils,k=odf.Namespaces.textns,p=odf.Namespaces.stylens;this.applyStyle=function(b,k,f){var g={},l,h,m,p;runtime.assert(f&& +f["style:text-properties"],"applyStyle without any text properties");g["style:text-properties"]=f["style:text-properties"];m=new c(g);p=new a(g);b.forEach(function(a){l=p.isStyleApplied(a);!1===l&&(h=d(a,k),m.applyStyleToContainer(h))})}}; // Input 32 /* @@ -680,29 +680,29 @@ g["style:text-properties"],"applyStyle without any text properties");f["style:te @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!==u||"style"!==a.localName&&"default-style"!==a.localName?a.namespaceURI===r&&"list-style"===a.localName?"list":a.namespaceURI!==u||"page-layout"!==a.localName&&"default-page-layout"!==a.localName?void 0:"page":a.getAttributeNS(u,"family"))(c=a.getAttributeNS&&a.getAttributeNS(u,"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 h(a,b,c){var d=b[a],f,e;d&&(f=d.getAttributeNS(u,"parent-style-name"),e=null,f&&(e=m(c,f),!e&&b[f]&&(h(f,b,c),e=b[f],b[f]=null)),e?(e.derivedStyles||(e.derivedStyles={}),e.derivedStyles[a]=d):c[a]=d)}function a(a,b){for(var c in a)a.hasOwnProperty(c)&&(h(c,a,b),a[c]=null)}function b(a,b){var c=w[a],d;if(null===c)return null;d=b?"["+c+'|style-name="'+b+'"]':"";"presentation"===c&&(c="draw",d=b?'[presentation|style-name="'+ -b+'"]':"");return c+"|"+v[a].join(d+","+c+"|")+d}function e(a,c,d){var f=[],g,k;f.push(b(a,c));for(g in d.derivedStyles)if(d.derivedStyles.hasOwnProperty(g))for(k in c=e(a,g,d.derivedStyles[g]),c)c.hasOwnProperty(k)&&f.push(c[k]);return f}function g(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 d(a,b){var c="",d,f;for(d in b)if(b.hasOwnProperty(d)&&(d=b[d],f=a.getAttributeNS(d[0],d[1]))){f=f.trim();if(N.hasOwnProperty(d[1])){var e= -f.indexOf(" "),g=void 0,k=void 0;-1!==e?(g=f.substring(0,e),k=f.substring(e)):(g=f,k="");(g=V.parseLength(g))&&("pt"===g.unit&&0.75>g.value)&&(f="0.75pt"+k)}d[2]&&(c+=d[2]+":"+f+";")}return c}function p(a){return(a=g(a,u,"text-properties"))?V.parseFoFontSize(a.getAttributeNS(n,"font-size")):null}function c(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 q(a,b,c,d){b='text|list[text|style-name="'+b+'"]';var f=c.getAttributeNS(r,"level"),e;c=V.getFirstNonWhitespaceChild(c);c=V.getFirstNonWhitespaceChild(c);var g;c&&(e=c.attributes,g=e["fo:text-indent"]?e["fo:text-indent"].value:void 0,e=e["fo:margin-left"]?e["fo:margin-left"].value:void 0);g||(g="-0.6cm");c="-"===g.charAt(0)?g.substring(1):"-"+g;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!==e&& -(e=f+"{margin-left:"+e+";}",a.insertRule(e,a.cssRules.length));d=b+" > text|list-item > *:not(text|list):first-child:before{"+d+";";d+="counter-increment:list;";d+="margin-left:"+g+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(k){throw k;}}function k(a,b,h,l){if("list"===b)for(var m=l.firstChild,s,v;m;){if(m.namespaceURI===r)if(s=m,"list-level-style-number"===m.localName){var w=s;v=w.getAttributeNS(u,"num-format");var N=w.getAttributeNS(u,"num-suffix"), -K={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},w=w.getAttributeNS(u,"num-prefix")||"",w=K.hasOwnProperty(v)?w+(" counter(list, "+K[v]+")"):v?w+("'"+v+"';"):w+" ''";N&&(w+=" '"+N+"'");v="content: "+w+";";q(a,h,s,v)}else"list-level-style-image"===m.localName?(v="content: none;",q(a,h,s,v)):"list-level-style-bullet"===m.localName&&(v="content: '"+s.getAttributeNS(r,"bullet-char")+"';",q(a,h,s,v));m=m.nextSibling}else if("page"===b)if(N=s=h="",m=l.getElementsByTagNameNS(u, -"page-layout-properties")[0],s=m.parentNode.parentNode.parentNode.masterStyles,N="",h+=d(m,ea),v=m.getElementsByTagNameNS(u,"background-image"),0k.value)&&(e="0.75pt"+l)}d[2]&&(c+=d[2]+":"+e+";")}return c}function p(a){return(a=b(a,u,"text-properties"))?W.parseFoFontSize(a.getAttributeNS(l,"font-size")):null}function e(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 s(a,b,c,d){b='text|list[text|style-name="'+b+'"]';var e=c.getAttributeNS(r,"level"),g;c=W.getFirstNonWhitespaceChild(c);c=W.getFirstNonWhitespaceChild(c);var k;c&&(g=c.attributes,k=g["fo:text-indent"]?g["fo:text-indent"].value:void 0,g=g["fo:margin-left"]?g["fo:margin-left"].value:void 0);k||(k="-0.6cm");c="-"===k.charAt(0)?k.substring(1):"-"+k;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!==g&& +(g=e+"{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:"+k+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(l){throw l;}}function n(a,c,f,h){if("list"===c)for(var m=h.firstChild,q,v;m;){if(m.namespaceURI===r)if(q=m,"list-level-style-number"===m.localName){var w=q;v=w.getAttributeNS(u,"num-format");var M=w.getAttributeNS(u,"num-suffix"), +z={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},w=w.getAttributeNS(u,"num-prefix")||"",w=z.hasOwnProperty(v)?w+(" counter(list, "+z[v]+")"):v?w+("'"+v+"';"):w+" ''";M&&(w+=" '"+M+"'");v="content: "+w+";";s(a,f,q,v)}else"list-level-style-image"===m.localName?(v="content: none;",s(a,f,q,v)):"list-level-style-bullet"===m.localName&&(v="content: '"+q.getAttributeNS(r,"bullet-char")+"';",s(a,f,q,v));m=m.nextSibling}else if("page"===c)if(M=q=f="",m=h.getElementsByTagNameNS(u, +"page-layout-properties")[0],q=m.parentNode.parentNode.parentNode.masterStyles,M="",f+=k(m,fa),v=m.getElementsByTagNameNS(u,"background-image"),0c)break;e=e.nextSibling}a.insertBefore(b,e)}}}function e(a){this.OdfContainer= -a}function g(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 d=new odf.StyleInfo,p="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "), -c=(new Date).getTime()+"_webodf_",q=new core.Base64;e.prototype=new function(){};e.prototype.constructor=e;e.namespaceURI="urn:oasis:names:tc:opendocument:xmlns:office:1.0";e.localName="document";g.prototype.load=function(){};g.prototype.getUrl=function(){return this.data?"data:;base64,"+q.toBase64(this.data):null};odf.OdfContainer=function f(n,m){function s(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,b.nodeType===Node.ELEMENT_NODE?s(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b), -b=c}function x(a,b){for(var c=a&&a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&c.setAttributeNS("urn:webodf:names:scope","scope",b),c=c.nextSibling}function r(a,b){var c=null,d,e,f;if(a)for(c=a.cloneNode(!0),d=c.firstChild;d;)e=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(f=d.getAttributeNS("urn:webodf:names:scope","scope"))&&f!==b&&c.removeChild(d),d=e;return c}function y(a){var b=B.rootElement.ownerDocument,c;if(a){s(a.documentElement);try{c=b.importNode(a.documentElement,!0)}catch(d){}}return c} -function t(a){B.state=a;if(B.onchange)B.onchange(B);if(B.onstatereadychange)B.onstatereadychange(B)}function p(a){T=null;B.rootElement=a;a.fontFaceDecls=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");a.styles=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles");a.automaticStyles=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");a.masterStyles=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles");a.body=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0", -"body");a.meta=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta")}function v(a){a=y(a);var e=B.rootElement;a&&"document-styles"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI?(e.fontFaceDecls=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls"),b(e,e.fontFaceDecls),e.styles=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles"),b(e,e.styles),e.automaticStyles=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"), -x(e.automaticStyles,"document-styles"),b(e,e.automaticStyles),e.masterStyles=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),b(e,e.masterStyles),d.prefixStyleNames(e.automaticStyles,c,e.masterStyles)):t(f.INVALID)}function q(a){a=y(a);var c,d,e;if(a&&"document-content"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI){c=B.rootElement;d=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","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,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");x(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,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");b(c,c.body)}else t(f.INVALID)}function J(a){a=y(a);var c;a&&("document-meta"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI)&& -(c=B.rootElement,c.meta=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta"),b(c,c.meta))}function z(a){a=y(a);var c;a&&("document-settings"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI)&&(c=B.rootElement,c.settings=l(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","settings"),b(c,c.settings))}function L(a){a=y(a);var b;if(a&&"manifest"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"===a.namespaceURI)for(b=B.rootElement,b.manifest= -a,a=b.manifest.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&("file-entry"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"===a.namespaceURI)&&(E[a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","full-path")]=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","media-type")),a=a.nextSibling}function A(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],H.loadAsDOM(c,function(b,c){d(c);b||B.state===f.INVALID||A(a)})):t(f.DONE)}function P(a){var b="";odf.Namespaces.forEachPrefix(function(a, -c){b+=" xmlns:"+a+'="'+c+'"'});return''}function G(){var a=new xmldom.LSSerializer,b=P("document-meta");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(B.rootElement.meta,odf.Namespaces.namespaceMap);return b+""}function M(a,b){var c=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:file-entry");c.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", -"manifest:full-path",a);c.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:media-type",b);return c}function ea(){var a=runtime.parseXML(''),b=l(a,"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest"),c=new xmldom.LSSerializer,d;for(d in E)E.hasOwnProperty(d)&&b.appendChild(M(d,E[d]));c.filter=new odf.OdfNodeFilter;return'\n'+ -c.writeToString(a,odf.Namespaces.namespaceMap)}function na(){var a=new xmldom.LSSerializer,b=P("document-settings");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(B.rootElement.settings,odf.Namespaces.namespaceMap);return b+""}function N(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,e=r(B.rootElement.automaticStyles,"document-styles"),f=B.rootElement.masterStyles&&B.rootElement.masterStyles.cloneNode(!0),g=P("document-styles");d.removePrefixFromStyleNames(e, -c,f);b.filter=new h(f,e);g+=b.writeToString(B.rootElement.fontFaceDecls,a);g+=b.writeToString(B.rootElement.styles,a);g+=b.writeToString(e,a);g+=b.writeToString(f,a);return g+""}function oa(){var b=odf.Namespaces.namespaceMap,c=new xmldom.LSSerializer,d=r(B.rootElement.automaticStyles,"document-content"),e=P("document-content");c.filter=new a(B.rootElement.body,d);e+=c.writeToString(d,b);e+=c.writeToString(B.rootElement.body,b);return e+""}function V(a, -b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var d=y(c);d&&"document"===d.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===d.namespaceURI?(p(d),t(f.DONE)):t(f.INVALID)}})}function Z(){function a(b,c){var e;c||(c=b);e=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0",c);d[b]=e;d.appendChild(e)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),d=B.rootElement,e=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0", -"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);t(f.DONE);return b}function O(){var a,b=new Date;a=runtime.byteArrayFromString(na(),"utf8");H.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(G(),"utf8");H.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(N(),"utf8");H.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(oa(), -"utf8");H.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(ea(),"utf8");H.save("META-INF/manifest.xml",a,!0,b)}function S(a,b){O();H.writeAs(a,function(a){b(a)})}var B=this,H,E={},T;this.onstatereadychange=m;this.rootElement=this.state=this.onchange=null;this.setRootElement=p;this.getContentElement=function(){var a;T||(a=B.rootElement.body,T=a.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","text")[0]||a.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0", -"presentation")[0]||a.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","spreadsheet")[0]);return T};this.getDocumentType=function(){var a=B.getContentElement();return a&&a.localName};this.getPart=function(a){return new g(a,E[a],B,H)};this.getPartData=function(a,b){H.load(a,b)};this.createByteArray=function(a,b){O();H.createByteArray(a,b)};this.saveAs=S;this.save=function(a){S(n,a)};this.getUrl=function(){return n};this.state=f.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}(e);H=n?new core.Zip(n,function(a,b){H=b;a?V(n,function(b){a&&(H.error=a+"\n"+b,t(f.INVALID))}):A([["styles.xml",v],["content.xml",q],["meta.xml",J],["settings.xml",z],["META-INF/manifest.xml",L]])}):Z()};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, +odf.OdfContainer=function(){function h(a,c,b){for(a=a?a.firstChild:null;a;){if(a.localName===b&&a.namespaceURI===c)return a;a=a.nextSibling}return null}function m(a){var c,b=p.length;for(c=0;cb)break;e=e.nextSibling}a.insertBefore(c,e)}}}function d(a){this.OdfContainer= +a}function b(a,c,b,d){var e=this;this.size=0;this.type=null;this.name=a;this.container=b;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=c,d.loadAsDataURL(a,c,function(a,c){a&&runtime.log(a);e.url=c;if(e.onchange)e.onchange(e);if(e.onstatereadychange)e.onstatereadychange(e)}))}}var k=new odf.StyleInfo,p="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "), +e=(new Date).getTime()+"_webodf_",s=new core.Base64;d.prototype=new function(){};d.prototype.constructor=d;d.namespaceURI="urn:oasis:names:tc:opendocument:xmlns:office:1.0";d.localName="document";b.prototype.load=function(){};b.prototype.getUrl=function(){return this.data?"data:;base64,"+s.toBase64(this.data):null};odf.OdfContainer=function g(l,m){function q(a){for(var c=a.firstChild,b;c;)b=c.nextSibling,c.nodeType===Node.ELEMENT_NODE?q(c):c.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(c), +c=b}function p(a,c){for(var b=a&&a.firstChild;b;)b.nodeType===Node.ELEMENT_NODE&&b.setAttributeNS("urn:webodf:names:scope","scope",c),b=b.nextSibling}function r(a,c){var b=null,d,e,g;if(a)for(b=a.cloneNode(!0),d=b.firstChild;d;)e=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(g=d.getAttributeNS("urn:webodf:names:scope","scope"))&&g!==c&&b.removeChild(d),d=e;return b}function y(a){var c=F.rootElement.ownerDocument,b;if(a){q(a.documentElement);try{b=c.importNode(a.documentElement,!0)}catch(d){}}return b} +function t(a){F.state=a;if(F.onchange)F.onchange(F);if(F.onstatereadychange)F.onstatereadychange(F)}function s(a){T=null;F.rootElement=a;a.fontFaceDecls=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");a.styles=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles");a.automaticStyles=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");a.masterStyles=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles");a.body=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"body");a.meta=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta")}function v(a){a=y(a);var b=F.rootElement;a&&"document-styles"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI?(b.fontFaceDecls=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls"),c(b,b.fontFaceDecls),b.styles=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles"),c(b,b.styles),b.automaticStyles=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"), +p(b.automaticStyles,"document-styles"),c(b,b.automaticStyles),b.masterStyles=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),c(b,b.masterStyles),k.prefixStyleNames(b.automaticStyles,e,b.masterStyles)):t(g.INVALID)}function C(a){a=y(a);var b,d,e;if(a&&"document-content"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI){b=F.rootElement;d=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");if(b.fontFaceDecls&&d)for(e=d.firstChild;e;)b.fontFaceDecls.appendChild(e), +e=d.firstChild;else d&&(b.fontFaceDecls=d,c(b,d));d=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");p(d,"document-content");if(b.automaticStyles&&d)for(e=d.firstChild;e;)b.automaticStyles.appendChild(e),e=d.firstChild;else d&&(b.automaticStyles=d,c(b,d));b.body=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");c(b,b.body)}else t(g.INVALID)}function J(a){a=y(a);var b;a&&("document-meta"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI)&& +(b=F.rootElement,b.meta=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta"),c(b,b.meta))}function E(a){a=y(a);var b;a&&("document-settings"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI)&&(b=F.rootElement,b.settings=h(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","settings"),c(b,b.settings))}function K(a){a=y(a);var b;if(a&&"manifest"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"===a.namespaceURI)for(b=F.rootElement,b.manifest= +a,a=b.manifest.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&("file-entry"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"===a.namespaceURI)&&(D[a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","full-path")]=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","media-type")),a=a.nextSibling}function B(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],G.loadAsDOM(c,function(b,c){d(c);b||F.state===g.INVALID||B(a)})):t(g.DONE)}function N(a){var b="";odf.Namespaces.forEachPrefix(function(a, +c){b+=" xmlns:"+a+'="'+c+'"'});return''}function H(){var a=new xmldom.LSSerializer,b=N("document-meta");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(F.rootElement.meta,odf.Namespaces.namespaceMap);return b+""}function L(a,b){var c=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:file-entry");c.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", +"manifest:full-path",a);c.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:media-type",b);return c}function fa(){var a=runtime.parseXML(''),b=h(a,"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest"),c=new xmldom.LSSerializer,d;for(d in D)D.hasOwnProperty(d)&&b.appendChild(L(d,D[d]));c.filter=new odf.OdfNodeFilter;return'\n'+ +c.writeToString(a,odf.Namespaces.namespaceMap)}function ma(){var a=new xmldom.LSSerializer,b=N("document-settings");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(F.rootElement.settings,odf.Namespaces.namespaceMap);return b+""}function M(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=r(F.rootElement.automaticStyles,"document-styles"),d=F.rootElement.masterStyles&&F.rootElement.masterStyles.cloneNode(!0),g=N("document-styles");k.removePrefixFromStyleNames(c, +e,d);b.filter=new f(d,c);g+=b.writeToString(F.rootElement.fontFaceDecls,a);g+=b.writeToString(F.rootElement.styles,a);g+=b.writeToString(c,a);g+=b.writeToString(d,a);return g+""}function pa(){var b=odf.Namespaces.namespaceMap,c=new xmldom.LSSerializer,d=r(F.rootElement.automaticStyles,"document-content"),e=N("document-content");c.filter=new a(F.rootElement.body,d);e+=c.writeToString(d,b);e+=c.writeToString(F.rootElement.body,b);return e+""}function W(a, +b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var d=y(c);d&&"document"===d.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===d.namespaceURI?(s(d),t(g.DONE)):t(g.INVALID)}})}function aa(){function a(b,c){var e;c||(c=b);e=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0",c);d[b]=e;d.appendChild(e)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),d=F.rootElement,e=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"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);t(g.DONE);return b}function O(){var a,b=new Date;a=runtime.byteArrayFromString(ma(),"utf8");G.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(H(),"utf8");G.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(M(),"utf8");G.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(pa(), +"utf8");G.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(fa(),"utf8");G.save("META-INF/manifest.xml",a,!0,b)}function R(a,b){O();G.writeAs(a,function(a){b(a)})}var F=this,G,D={},T;this.onstatereadychange=m;this.rootElement=this.state=this.onchange=null;this.setRootElement=s;this.getContentElement=function(){var a;T||(a=F.rootElement.body,T=a.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","text")[0]||a.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"presentation")[0]||a.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","spreadsheet")[0]);return T};this.getDocumentType=function(){var a=F.getContentElement();return a&&a.localName};this.getPart=function(a){return new b(a,D[a],F,G)};this.getPartData=function(a,b){G.load(a,b)};this.createByteArray=function(a,b){O();G.createByteArray(a,b)};this.saveAs=R;this.save=function(a){R(l,a)};this.getUrl=function(){return l};this.state=g.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}(d);G=l?new core.Zip(l,function(a,b){G=b;a?W(l,function(b){a&&(G.error=a+"\n"+b,t(g.INVALID))}):B([["styles.xml",v],["content.xml",C],["meta.xml",J],["settings.xml",E],["META-INF/manifest.xml",K]])}):aa()};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 /* @@ -796,9 +796,9 @@ null)};return odf.OdfContainer}(); @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.Base64");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.OdfContainer"); -odf.FontLoader=function(){function l(a,b,e,g,d){var m,c=0,q;for(q in a)if(a.hasOwnProperty(q)){if(c===e){m=q;break}c+=1}m?b.getPartData(a[m].href,function(c,f){if(c)runtime.log(c);else{var n="@font-face { font-family: '"+(a[m].family||m)+"'; src: url(data:application/x-font-ttf;charset=binary;base64,"+h.convertUTF8ArrayToBase64(f)+') format("truetype"); }';try{g.insertRule(n,g.cssRules.length)}catch(q){runtime.log("Problem inserting rule in CSS: "+runtime.toJson(q)+"\nRule: "+n)}}l(a,b,e+1,g,d)}): -d&&d()}var m=new xmldom.XPath,h=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(a,b){for(var e=a.rootElement.fontFaceDecls;b.cssRules.length;)b.deleteRule(b.cssRules.length-1);if(e){var g={},d,h,c,q;if(e)for(e=m.getODFElementsWithXPath(e,"style:font-face[svg:font-face-src]",odf.Namespaces.resolvePrefix),d=0;d text|list-item > *:first-child:before {";if(C=z.getAttributeNS(v,"style-name")){z= -r[C];D=P.getFirstNonWhitespaceChild(z);z=void 0;if(D)if("list-level-style-number"===D.localName){z=D.getAttributeNS(y,"num-format");C=D.getAttributeNS(y,"num-suffix");var ca="",ca={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},da=void 0,da=D.getAttributeNS(y,"num-prefix")||"",da=ca.hasOwnProperty(z)?da+(" counter(list, "+ca[z]+")"):z?da+("'"+z+"';"):da+" ''";C&&(da+=" '"+C+"'");z=ca="content: "+da+";"}else"list-level-style-image"===D.localName?z="content: none;":"list-level-style-bullet"=== -D.localName&&(z="content: '"+D.getAttributeNS(v,"bullet-char")+"';");D=z}if(G){for(z=m[G];z;)G=z,z=m[G];B+="counter-increment:"+G+";";D?(D=D.replace("list",G),B+=D):B+="content:counter("+G+");"}else G="",D?(D=D.replace("list",u),B+=D):B+="content: counter("+u+");",B+="counter-increment:"+u+";",l.insertRule("text|list#"+u+" {counter-reset:"+u+"}",l.cssRules.length);B+="}";m[u]=G;B&&l.insertRule(B,l.cssRules.length)}Q.insertBefore(M,Q.firstChild);t();F(h);if(!b&&(h=[E],ja.hasOwnProperty("statereadychange")))for(l= -ja.statereadychange,D=0;D text|list-item > *:first-child:before {";if(H=S.getAttributeNS(v,"style-name")){S= +r[H];A=N.getFirstNonWhitespaceChild(S);S=void 0;if(A)if("list-level-style-number"===A.localName){S=A.getAttributeNS(y,"num-format");H=A.getAttributeNS(y,"num-suffix");var F="",F={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},I=void 0,I=A.getAttributeNS(y,"num-prefix")||"",I=F.hasOwnProperty(S)?I+(" counter(list, "+F[S]+")"):S?I+("'"+S+"';"):I+" ''";H&&(I+=" '"+H+"'");S=F="content: "+I+";"}else"list-level-style-image"===A.localName?S="content: none;":"list-level-style-bullet"=== +A.localName&&(S="content: '"+A.getAttributeNS(v,"bullet-char")+"';");A=S}if(C){for(S=m[C];S;)C=S,S=m[C];Z+="counter-increment:"+C+";";A?(A=A.replace("list",C),Z+=A):Z+="content:counter("+C+");"}else C="",A?(A=A.replace("list",u),Z+=A):Z+="content: counter("+u+");",Z+="counter-increment:"+u+";",l.insertRule("text|list#"+u+" {counter-reset:"+u+"}",l.cssRules.length);Z+="}";m[u]=C;Z&&l.insertRule(Z,l.cssRules.length)}P.insertBefore(L,P.firstChild);t();E(f);if(!c&&(f=[D],ia.hasOwnProperty("statereadychange")))for(l= +ia.statereadychange,A=0;Ac?-d.countBackwardSteps(-c, -h):0;g.move(c);b&&(h=0b?-d.countBackwardSteps(-b,h):0,g.move(h,!0));e.emit(ops.OdtDocument.signalCursorMoved,g);return!0};this.spec=function(){return{optype:"MoveCursor",memberid:m,timestamp:h,position:a,length:b}}}; +ops.OpMoveCursor=function(){var h=this,m,f,a,c;this.init=function(d){m=d.memberid;f=d.timestamp;a=parseInt(d.position,10);c=void 0!==d.length?parseInt(d.length,10):0};this.merge=function(d){return"MoveCursor"===d.optype&&d.memberid===m?(a=d.position,c=d.length,f=d.timestamp,!0):!1};this.transform=function(d,b){var k=d.spec(),f=a+c,e,s=[h];switch(k.optype){case "RemoveText":e=k.position+k.length;e<=a?a-=k.length:k.positione?-k.countBackwardSteps(-e, +f):0;b.move(e);c&&(f=0c?-k.countBackwardSteps(-c,f):0,b.move(f,!0));d.emit(ops.OdtDocument.signalCursorMoved,b);return!0};this.spec=function(){return{optype:"MoveCursor",memberid:m,timestamp:f,position:a,length:c}}}; // Input 46 /* @@ -1244,11 +1244,11 @@ h):0;g.move(c);b&&(h=0b?-d.countBackwardSteps(-b,h @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.OpInsertTable=function(){function l(a,c){var d;if(1===q.length)d=q[0];else if(3===q.length)switch(a){case 0:d=q[0];break;case b-1:d=q[2];break;default:d=q[1]}else d=q[a];if(1===d.length)return d[0];if(3===d.length)switch(c){case 0:return d[0];case e-1:return d[2];default:return d[1]}return d[c]}var m=this,h,a,b,e,g,d,p,c,q;this.init=function(k){h=k.memberid;a=k.timestamp;g=parseInt(k.position,10);b=parseInt(k.initialRows,10);e=parseInt(k.initialColumns,10);d=k.tableName;p=k.tableStyleName;c=k.tableColumnStyleName; -q=k.tableCellStyleMatrix};this.transform=function(a,b){var c=a.spec(),d=[m];switch(c.optype){case "InsertTable":d=null;break;case "AddAnnotation":c.position=g.textNode.length?null:g.textNode.splitText(g.offset));for(c=g.textNode;c!==l;)if(c=c.parentNode,q=c.cloneNode(!1),f){for(k&&q.appendChild(k);f.nextSibling;)q.appendChild(f.nextSibling); -c.parentNode.insertBefore(q,c.nextSibling);f=c;k=q}else c.parentNode.insertBefore(q,c),f=q,k=c;b.isListItem(k)&&(k=k.childNodes[0]);0===g.textNode.length&&g.textNode.parentNode.removeChild(g.textNode);e.fixCursorPositions(m);e.getOdfCanvas().refreshSize();e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:d,memberId:m,timeStamp:h});e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:k,memberId:m,timeStamp:h});e.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph", -memberid:m,timestamp:h,position:a}}}; +ops.OpSplitParagraph=function(){var h=this,m,f,a,c=new odf.OdfUtils;this.init=function(c){m=c.memberid;f=c.timestamp;a=parseInt(c.position,10)};this.transform=function(c,b){var f=c.spec(),m=[h];switch(f.optype){case "SplitParagraph":f.position=b.textNode.length?null:b.textNode.splitText(b.offset));for(e=b.textNode;e!==h;)if(e=e.parentNode,s=e.cloneNode(!1),g){for(n&&s.appendChild(n);g.nextSibling;)s.appendChild(g.nextSibling); +e.parentNode.insertBefore(s,e.nextSibling);g=e;n=s}else e.parentNode.insertBefore(s,e),g=s,n=e;c.isListItem(n)&&(n=n.childNodes[0]);0===b.textNode.length&&b.textNode.parentNode.removeChild(b.textNode);d.fixCursorPositions(m);d.getOdfCanvas().refreshSize();d.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:k,memberId:m,timeStamp:f});d.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:n,memberId:m,timeStamp:f});d.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph", +memberid:m,timestamp:f,position:a}}}; // Input 50 /* @@ -1404,8 +1404,8 @@ memberid:m,timestamp:h,position:a}}}; @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.OpSetParagraphStyle=function(){var l=this,m,h,a,b;this.init=function(e){m=e.memberid;h=e.timestamp;a=e.position;b=e.styleName};this.transform=function(a,g){var d=a.spec(),h=[l];switch(d.optype){case "RemoveStyle":d.styleName===b&&"paragraph"===d.styleFamily&&(b="")}return h};this.execute=function(e){var g;g=e.getIteratorAtPosition(a);return(g=e.getParagraphElement(g.container()))?(""!==b?g.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",b):g.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0", -"style-name"),e.getOdfCanvas().refreshSize(),e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:g,timeStamp:h,memberId:m}),e.getOdfCanvas().rerenderAnnotations(),!0):!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:m,timestamp:h,position:a,styleName:b}}}; +ops.OpSetParagraphStyle=function(){var h=this,m,f,a,c;this.init=function(d){m=d.memberid;f=d.timestamp;a=d.position;c=d.styleName};this.transform=function(a,b){var f=a.spec(),m=[h];switch(f.optype){case "RemoveStyle":f.styleName===c&&"paragraph"===f.styleFamily&&(c="")}return m};this.execute=function(d){var b;b=d.getIteratorAtPosition(a);return(b=d.getParagraphElement(b.container()))?(""!==c?b.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",c):b.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0", +"style-name"),d.getOdfCanvas().refreshSize(),d.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:b,timeStamp:f,memberId:m}),d.getOdfCanvas().rerenderAnnotations(),!0):!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:m,timestamp:f,position:a,styleName:c}}}; // Input 51 /* @@ -1442,11 +1442,11 @@ ops.OpSetParagraphStyle=function(){var l=this,m,h,a,b;this.init=function(e){m=e. @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?-n.countBackwardSteps(-k,c):0,q.move(c),d.emit(ops.OdtDocument.signalCursorMoved,q));d.getOdfCanvas().addAnnotation(m);return!0};this.spec=function(){return{optype:"AddAnnotation", -memberid:h,timestamp:a,position:b,length:e,name:g}}}; +ops.OpAddAnnotation=function(){function h(a,b,c){var d=a.getPositionInTextNode(c,f);d&&(a=d.textNode,c=a.parentNode,d.offset!==a.length&&a.splitText(d.offset),c.insertBefore(b,a.nextSibling),0===a.length&&c.removeChild(a))}var m=this,f,a,c,d,b;this.init=function(k){f=k.memberid;a=parseInt(k.timestamp,10);c=parseInt(k.position,10);d=parseInt(k.length,10)||0;b=k.name};this.transform=function(a,b){var e=a.spec(),f=c+d,h=[m];switch(e.optype){case "AddAnnotation":e.positionn?-l.countBackwardSteps(-n,e):0,s.move(e),k.emit(ops.OdtDocument.signalCursorMoved,s));k.getOdfCanvas().addAnnotation(m);return!0};this.spec=function(){return{optype:"AddAnnotation", +memberid:f,timestamp:a,position:c,length:d,name:b}}}; // Input 55 /* @@ -1599,9 +1599,9 @@ memberid:h,timestamp:a,position:b,length:e,name:g}}}; @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.Namespaces");runtime.loadClass("core.DomUtils"); -ops.OpRemoveAnnotation=function(){var l,m,h,a,b;this.init=function(e){l=e.memberid;m=e.timestamp;h=parseInt(e.position,10);a=parseInt(e.length,10);b=new core.DomUtils};this.transform=function(a,b){return null};this.execute=function(a){for(var g=a.getIteratorAtPosition(h).container(),d,l=null,c=null;g.namespaceURI!==odf.Namespaces.officens||"annotation"!==g.localName;)g=g.parentNode;if(null===g)return!1;l=g;(d=l.getAttributeNS(odf.Namespaces.officens,"name"))&&(c=b.getElementsByTagNameNS(a.getRootNode(), -odf.Namespaces.officens,"annotation-end").filter(function(a){return d===a.getAttributeNS(odf.Namespaces.officens,"name")})[0]||null);a.getOdfCanvas().forgetAnnotations();for(g=b.getElementsByTagNameNS(l,odf.Namespaces.webodfns+":names:cursor","cursor");g.length;)l.parentNode.insertBefore(g.pop(),l);l.parentNode.removeChild(l);c&&c.parentNode.removeChild(c);a.fixCursorPositions();a.getOdfCanvas().refreshAnnotations();return!0};this.spec=function(){return{optype:"RemoveAnnotation",memberid:l,timestamp:m, -position:h,length:a}}}; +ops.OpRemoveAnnotation=function(){var h,m,f,a,c;this.init=function(d){h=d.memberid;m=d.timestamp;f=parseInt(d.position,10);a=parseInt(d.length,10);c=new core.DomUtils};this.transform=function(a,b){return null};this.execute=function(a){for(var b=a.getIteratorAtPosition(f).container(),k,h=null,e=null;b.namespaceURI!==odf.Namespaces.officens||"annotation"!==b.localName;)b=b.parentNode;if(null===b)return!1;h=b;(k=h.getAttributeNS(odf.Namespaces.officens,"name"))&&(e=c.getElementsByTagNameNS(a.getRootNode(), +odf.Namespaces.officens,"annotation-end").filter(function(a){return k===a.getAttributeNS(odf.Namespaces.officens,"name")})[0]||null);a.getOdfCanvas().forgetAnnotations();for(b=c.getElementsByTagNameNS(h,odf.Namespaces.webodfns+":names:cursor","cursor");b.length;)h.parentNode.insertBefore(b.pop(),h);h.parentNode.removeChild(h);e&&e.parentNode.removeChild(e);a.fixCursorPositions();a.getOdfCanvas().refreshAnnotations();return!0};this.spec=function(){return{optype:"RemoveAnnotation",memberid:h,timestamp:m, +position:f,length:a}}}; // Input 56 /* @@ -1639,21 +1639,21 @@ position:h,length:a}}}; */ 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.OpAddStyle");runtime.loadClass("ops.OpRemoveStyle");runtime.loadClass("ops.OpAddAnnotation"); runtime.loadClass("ops.OpRemoveAnnotation"); -ops.OperationFactory=function(){function l(h){return function(){return new h}}var m;this.register=function(h,a){m[h]=a};this.create=function(h){var a=null,b=m[h.optype];b&&(a=b(h),a.init(h));return a};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), -AddStyle:l(ops.OpAddStyle),RemoveStyle:l(ops.OpRemoveStyle),MoveCursor:l(ops.OpMoveCursor),RemoveCursor:l(ops.OpRemoveCursor),AddAnnotation:l(ops.OpAddAnnotation),RemoveAnnotation:l(ops.OpRemoveAnnotation)}}; +ops.OperationFactory=function(){function h(f){return function(){return new f}}var m;this.register=function(f,a){m[f]=a};this.create=function(f){var a=null,c=m[f.optype];c&&(a=c(f),a.init(f));return a};m={AddCursor:h(ops.OpAddCursor),ApplyDirectStyling:h(ops.OpApplyDirectStyling),InsertTable:h(ops.OpInsertTable),InsertText:h(ops.OpInsertText),RemoveText:h(ops.OpRemoveText),SplitParagraph:h(ops.OpSplitParagraph),SetParagraphStyle:h(ops.OpSetParagraphStyle),UpdateParagraphStyle:h(ops.OpUpdateParagraphStyle), +AddStyle:h(ops.OpAddStyle),RemoveStyle:h(ops.OpRemoveStyle),MoveCursor:h(ops.OpMoveCursor),RemoveCursor:h(ops.OpRemoveCursor),AddAnnotation:h(ops.OpAddAnnotation),RemoveAnnotation:h(ops.OpRemoveAnnotation)}}; // Input 57 runtime.loadClass("core.Cursor");runtime.loadClass("core.DomUtils");runtime.loadClass("core.PositionIterator");runtime.loadClass("core.PositionFilter");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.OdfUtils"); -gui.SelectionMover=function(l,m){function h(){r.setUnfilteredPosition(l.getNode(),0);return r}function a(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(c,d,e,f){var g=c.nodeType;e.setStart(c,d);e.collapse(!f);f=a(e.getClientRects(),!0===f);!f&&0a?-1:1;for(a=Math.abs(a);0l?n.previousPosition():n.nextPosition());)if(T.check(),k.acceptPosition(n)===w&&(s+=1,r=n.container(),t=b(r,n.unfilteredDomOffset(),E),t.top!==S)){if(t.top!==H&&H!==S)break;H=t.top;t=Math.abs(B-t.left);if(null===x||ta?(d=k.previousPosition,e=-1):(d=k.nextPosition,e=1);for(f=b(k.container(),k.unfilteredDomOffset(),r);d.call(k);)if(c.acceptPosition(k)===w){if(s.getParagraphElement(k.getCurrentNode())!==l)break;g=b(k.container(),k.unfilteredDomOffset(),r);if(g.bottom!==f.bottom&&(f=g.top>=f.top&&g.bottomf.bottom,!f))break;n+=e;f=g}r.detach();return n}function u(a,b,c){runtime.assert(null!==a,"SelectionMover.countStepsToPosition called with element===null"); -var d=h(),e=d.container(),f=d.unfilteredDomOffset(),g=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,f);e=x.comparePoints(a,b,d.container(),d.unfilteredDomOffset());if(0>e)for(;d.nextPosition()&&(k.check(),c.acceptPosition(d)===w&&(g+=1),d.container()!==a||d.unfilteredDomOffset()!==b););else if(0=x.comparePoints(a,b,d.container(),d.unfilteredDomOffset()))););return g}var s,x,r,y,t,w=core.PositionFilter.FilterResult.FILTER_ACCEPT;this.movePointForward=function(a,b){return e(a,b,r.nextPosition)};this.movePointBackward=function(a,b){return e(a,b,r.previousPosition)};this.getStepCounter=function(){return{countForwardSteps:d,countBackwardSteps:q,convertForwardStepsBetweenFilters:p,convertBackwardStepsBetweenFilters:c,countLinesSteps:f,countStepsToLineBoundary:n, -countStepsToPosition:u,isPositionWalkable:g,countStepsToValidPosition:k}};(function(){s=new odf.OdfUtils;x=new core.DomUtils;r=gui.SelectionMover.createPositionIterator(m);var a=m.ownerDocument.createRange();a.setStart(r.container(),r.unfilteredDomOffset());a.collapse(!0);l.setSelectedRange(a)})()}; -gui.SelectionMover.createPositionIterator=function(l){var m=new function(){this.acceptNode=function(h){return"urn:webodf:names:cursor"===h.namespaceURI||"urn:webodf:names:editinfo"===h.namespaceURI?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}};return new core.PositionIterator(l,5,m,!1)};(function(){return gui.SelectionMover})(); +gui.SelectionMover=function(h,m){function f(){r.setUnfilteredPosition(h.getNode(),0);return r}function a(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 c(b,d,e,f){var g=b.nodeType;e.setStart(b,d);e.collapse(!f);f=a(e.getClientRects(),!0===f);!f&&0a?-1:1;for(a=Math.abs(a);0l?q.previousPosition():q.nextPosition());)if(T.check(),h.acceptPosition(q)===w&&(n+=1,r=q.container(),t=c(r,q.unfilteredDomOffset(),D),t.top!==R)){if(t.top!==G&&G!==R)break;G=t.top;t=Math.abs(F-t.left);if(null===x||ta?(d=h.previousPosition,e=-1):(d=h.nextPosition,e=1);for(g=c(h.container(),h.unfilteredDomOffset(),n);d.call(h);)if(b.acceptPosition(h)===w){if(q.getParagraphElement(h.getCurrentNode())!==l)break;k=c(h.container(),h.unfilteredDomOffset(),n);if(k.bottom!==g.bottom&&(g=k.top>=g.top&&k.bottomg.bottom,!g))break;r+=e;g=k}n.detach();return r}function u(a,b,c){runtime.assert(null!==a,"SelectionMover.countStepsToPosition called with element===null"); +var d=f(),e=d.container(),g=d.unfilteredDomOffset(),k=0,h=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,g);e=x.comparePoints(a,b,d.container(),d.unfilteredDomOffset());if(0>e)for(;d.nextPosition()&&(h.check(),c.acceptPosition(d)===w&&(k+=1),d.container()!==a||d.unfilteredDomOffset()!==b););else if(0=x.comparePoints(a,b,d.container(),d.unfilteredDomOffset()))););return k}var q,x,r,y,t,w=core.PositionFilter.FilterResult.FILTER_ACCEPT;this.movePointForward=function(a,b){return d(a,b,r.nextPosition)};this.movePointBackward=function(a,b){return d(a,b,r.previousPosition)};this.getStepCounter=function(){return{countForwardSteps:k,countBackwardSteps:s,convertForwardStepsBetweenFilters:p,convertBackwardStepsBetweenFilters:e,countLinesSteps:g,countStepsToLineBoundary:l, +countStepsToPosition:u,isPositionWalkable:b,countStepsToValidPosition:n}};(function(){q=new odf.OdfUtils;x=new core.DomUtils;r=gui.SelectionMover.createPositionIterator(m);var a=m.ownerDocument.createRange();a.setStart(r.container(),r.unfilteredDomOffset());a.collapse(!0);h.setSelectedRange(a)})()}; +gui.SelectionMover.createPositionIterator=function(h){var m=new function(){this.acceptNode=function(f){return"urn:webodf:names:cursor"===f.namespaceURI||"urn:webodf:names:editinfo"===f.namespaceURI?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}};return new core.PositionIterator(h,5,m,!1)};(function(){return gui.SelectionMover})(); // Input 58 /* @@ -1690,12 +1690,12 @@ gui.SelectionMover.createPositionIterator=function(l){var m=new function(){this. @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.OpAddStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpRemoveStyle"); -ops.OperationTransformer=function(){function l(h,a){for(var b,e,g,d=[],p=[];0=b&&(d=-a.movePointBackward(-b,g));h.handleUpdate();return d};this.handleUpdate=function(){};this.getStepCounter=function(){return a.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);a=new gui.SelectionMover(b,m.getRootNode())}; +ops.OdtCursor=function(h,m){var f=this,a,c;this.removeFromOdtDocument=function(){c.remove()};this.move=function(c,b){var k=0;0=c&&(k=-a.movePointBackward(-c,b));f.handleUpdate();return k};this.handleUpdate=function(){};this.getStepCounter=function(){return a.getStepCounter()};this.getMemberId=function(){return h};this.getNode=function(){return c.getNode()};this.getAnchorNode=function(){return c.getAnchorNode()};this.getSelectedRange=function(){return c.getSelectedRange()}; +this.getOdtDocument=function(){return m};c=new core.Cursor(m.getDOM(),h);a=new gui.SelectionMover(c,m.getRootNode())}; // Input 60 /* @@ -1731,17 +1731,17 @@ this.getOdtDocument=function(){return m};b=new core.Cursor(m.getDOM(),l);a=new g @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.EditInfo=function(l,m){function h(){var a=[],g;for(g in b)b.hasOwnProperty(g)&&a.push({memberid:g,time:b[g].time});a.sort(function(a,b){return a.time-b.time});return a}var a,b={};this.getNode=function(){return a};this.getOdtDocument=function(){return m};this.getEdits=function(){return b};this.getSortedEdits=function(){return h()};this.addEdit=function(a,g){b[a]={time:g}};this.clearEdits=function(){b={}};this.destroy=function(b){l.removeChild(a);b()};a=m.getDOM().createElementNS("urn:webodf:names:editinfo", -"editinfo");l.insertBefore(a,l.firstChild)}; +ops.EditInfo=function(h,m){function f(){var a=[],b;for(b in c)c.hasOwnProperty(b)&&a.push({memberid:b,time:c[b].time});a.sort(function(a,b){return a.time-b.time});return a}var a,c={};this.getNode=function(){return a};this.getOdtDocument=function(){return m};this.getEdits=function(){return c};this.getSortedEdits=function(){return f()};this.addEdit=function(a,b){c[a]={time:b}};this.clearEdits=function(){c={}};this.destroy=function(c){h.parentNode&&h.removeChild(a);c()};a=m.getDOM().createElementNS("urn:webodf:names:editinfo", +"editinfo");h.insertBefore(a,h.firstChild)}; // Input 61 -gui.Avatar=function(l,m){var h=this,a,b,e;this.setColor=function(a){b.style.borderColor=a};this.setImageUrl=function(a){h.isVisible()?b.src=a:e=a};this.isVisible=function(){return"block"===a.style.display};this.show=function(){e&&(b.src=e,e=void 0);a.style.display="block"};this.hide=function(){a.style.display="none"};this.markAsFocussed=function(b){a.className=b?"active":""};this.destroy=function(b){l.removeChild(a);b()};(function(){var e=l.ownerDocument,d=e.documentElement.namespaceURI;a=e.createElementNS(d, -"div");b=e.createElementNS(d,"img");b.width=64;b.height=64;a.appendChild(b);a.style.width="64px";a.style.height="70px";a.style.position="absolute";a.style.top="-80px";a.style.left="-34px";a.style.display=m?"block":"none";l.appendChild(a)})()}; +gui.Avatar=function(h,m){var f=this,a,c,d;this.setColor=function(a){c.style.borderColor=a};this.setImageUrl=function(a){f.isVisible()?c.src=a:d=a};this.isVisible=function(){return"block"===a.style.display};this.show=function(){d&&(c.src=d,d=void 0);a.style.display="block"};this.hide=function(){a.style.display="none"};this.markAsFocussed=function(b){a.className=b?"active":""};this.destroy=function(b){h.removeChild(a);b()};(function(){var b=h.ownerDocument,d=b.documentElement.namespaceURI;a=b.createElementNS(d, +"div");c=b.createElementNS(d,"img");c.width=64;c.height=64;a.appendChild(c);a.style.width="64px";a.style.height="70px";a.style.position="absolute";a.style.top="-80px";a.style.left="-34px";a.style.display=m?"block":"none";h.appendChild(a)})()}; // Input 62 runtime.loadClass("gui.Avatar");runtime.loadClass("ops.OdtCursor"); -gui.Caret=function(l,m,h){function a(e){d&&g.parentNode&&(!p||e)&&(e&&void 0!==c&&runtime.clearTimeout(c),p=!0,b.style.opacity=e||"0"===b.style.opacity?"1":"0",c=runtime.setTimeout(function(){p=!1;a(!1)},500))}var b,e,g,d=!1,p=!1,c;this.refreshCursorBlinking=function(){h||l.getSelectedRange().collapsed?(d=!0,a(!0)):(d=!1,b.style.opacity="0")};this.setFocus=function(){d=!0;e.markAsFocussed(!0);a(!0)};this.removeFocus=function(){d=!1;e.markAsFocussed(!1);b.style.opacity="1"};this.show=function(){b.style.visibility= -"visible";e.markAsFocussed(!0)};this.hide=function(){b.style.visibility="hidden";e.markAsFocussed(!1)};this.setAvatarImageUrl=function(a){e.setImageUrl(a)};this.setColor=function(a){b.style.borderColor=a;e.setColor(a)};this.getCursor=function(){return l};this.getFocusElement=function(){return b};this.toggleHandleVisibility=function(){e.isVisible()?e.hide():e.show()};this.showHandle=function(){e.show()};this.hideHandle=function(){e.hide()};this.ensureVisible=function(){var a,c,d,e,g=l.getOdtDocument().getOdfCanvas().getElement().parentNode, -h;d=g.offsetWidth-g.clientWidth+5;e=g.offsetHeight-g.clientHeight+5;h=b.getBoundingClientRect();a=h.left-d;c=h.top-e;d=h.right+d;e=h.bottom+e;h=g.getBoundingClientRect();ch.bottom&&(g.scrollTop+=e-h.bottom);ah.right&&(g.scrollLeft+=d-h.right)};this.destroy=function(a){e.destroy(function(c){c?a(c):(g.removeChild(b),a())})};(function(){var a=l.getOdtDocument().getDOM();b=a.createElementNS(a.documentElement.namespaceURI,"span");g=l.getNode(); -g.appendChild(b);e=new gui.Avatar(g,m)})()}; +gui.Caret=function(h,m,f){function a(d){k&&b.parentNode&&(!p||d)&&(d&&void 0!==e&&runtime.clearTimeout(e),p=!0,c.style.opacity=d||"0"===c.style.opacity?"1":"0",e=runtime.setTimeout(function(){p=!1;a(!1)},500))}var c,d,b,k=!1,p=!1,e;this.refreshCursorBlinking=function(){f||h.getSelectedRange().collapsed?(k=!0,a(!0)):(k=!1,c.style.opacity="0")};this.setFocus=function(){k=!0;d.markAsFocussed(!0);a(!0)};this.removeFocus=function(){k=!1;d.markAsFocussed(!1);c.style.opacity="1"};this.show=function(){c.style.visibility= +"visible";d.markAsFocussed(!0)};this.hide=function(){c.style.visibility="hidden";d.markAsFocussed(!1)};this.setAvatarImageUrl=function(a){d.setImageUrl(a)};this.setColor=function(a){c.style.borderColor=a;d.setColor(a)};this.getCursor=function(){return h};this.getFocusElement=function(){return c};this.toggleHandleVisibility=function(){d.isVisible()?d.hide():d.show()};this.showHandle=function(){d.show()};this.hideHandle=function(){d.hide()};this.ensureVisible=function(){var a,b,d,e,f=h.getOdtDocument().getOdfCanvas().getElement().parentNode, +k;d=f.offsetWidth-f.clientWidth+5;e=f.offsetHeight-f.clientHeight+5;k=c.getBoundingClientRect();a=k.left-d;b=k.top-e;d=k.right+d;e=k.bottom+e;k=f.getBoundingClientRect();bk.bottom&&(f.scrollTop+=e-k.bottom);ak.right&&(f.scrollLeft+=d-k.right)};this.destroy=function(a){d.destroy(function(d){d?a(d):(b.removeChild(c),a())})};(function(){var a=h.getOdtDocument().getDOM();c=a.createElementNS(a.documentElement.namespaceURI,"span");b=h.getNode(); +b.appendChild(c);d=new gui.Avatar(b,m)})()}; // Input 63 /* @@ -1777,8 +1777,8 @@ g.appendChild(b);e=new gui.Avatar(g,m)})()}; @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -gui.KeyboardHandler=function(){function l(a,e){e||(e=m.None);return a+":"+e}var m=gui.KeyboardHandler.Modifier,h=null,a={};this.setDefault=function(a){h=a};this.bind=function(b,e,g){b=l(b,e);runtime.assert(!1===a.hasOwnProperty(b),"tried to overwrite the callback handler of key combo: "+b);a[b]=g};this.unbind=function(b,e){var g=l(b,e);delete a[g]};this.reset=function(){h=null;a={}};this.handleEvent=function(b){var e=b.keyCode,g=m.None;b.metaKey&&(g|=m.Meta);b.ctrlKey&&(g|=m.Ctrl);b.altKey&&(g|=m.Alt); -b.shiftKey&&(g|=m.Shift);e=l(e,g);e=a[e];g=!1;e?g=e():null!==h&&(g=h(b));g&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}};gui.KeyboardHandler.Modifier={None:0,Meta:1,Ctrl:2,Alt:4,Shift:8,MetaShift:9,CtrlShift:10,AltShift:12};gui.KeyboardHandler.KeyCode={Backspace:8,Tab:9,Clear:12,Enter:13,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Delete:46,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90};(function(){return gui.KeyboardHandler})(); +gui.KeyboardHandler=function(){function h(a,d){d||(d=m.None);return a+":"+d}var m=gui.KeyboardHandler.Modifier,f=null,a={};this.setDefault=function(a){f=a};this.bind=function(c,d,b){c=h(c,d);runtime.assert(!1===a.hasOwnProperty(c),"tried to overwrite the callback handler of key combo: "+c);a[c]=b};this.unbind=function(c,d){var b=h(c,d);delete a[b]};this.reset=function(){f=null;a={}};this.handleEvent=function(c){var d=c.keyCode,b=m.None;c.metaKey&&(b|=m.Meta);c.ctrlKey&&(b|=m.Ctrl);c.altKey&&(b|=m.Alt); +c.shiftKey&&(b|=m.Shift);d=h(d,b);d=a[d];b=!1;d?b=d():null!==f&&(b=f(c));b&&(c.preventDefault?c.preventDefault():c.returnValue=!1)}};gui.KeyboardHandler.Modifier={None:0,Meta:1,Ctrl:2,Alt:4,Shift:8,MetaShift:9,CtrlShift:10,AltShift:12};gui.KeyboardHandler.KeyCode={Backspace:8,Tab:9,Clear:12,Enter:13,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Delete:46,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90};(function(){return gui.KeyboardHandler})(); // Input 64 /* @@ -1815,8 +1815,8 @@ b.shiftKey&&(g|=m.Shift);e=l(e,g);e=a[e];g=!1;e?g=e():null!==h&&(g=h(b));g&&(b.p @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.Namespaces");runtime.loadClass("xmldom.LSSerializer");runtime.loadClass("odf.OdfNodeFilter");runtime.loadClass("odf.TextSerializer"); -gui.Clipboard=function(){var l,m,h;this.setDataFromRange=function(a,b){var e=!0,g,d=a.clipboardData;g=runtime.getWindow();var h=b.startContainer.ownerDocument;!d&&g&&(d=g.clipboardData);d?(h=h.createElement("span"),h.appendChild(b.cloneContents()),g=d.setData("text/plain",m.writeToString(h)),e=e&&g,g=d.setData("text/html",l.writeToString(h,odf.Namespaces.namespaceMap)),e=e&&g,a.preventDefault()):e=!1;return e};l=new xmldom.LSSerializer;m=new odf.TextSerializer;h=new odf.OdfNodeFilter;l.filter=h;m.filter= -h}; +gui.Clipboard=function(){var h,m,f;this.setDataFromRange=function(a,c){var d=!0,b,f=a.clipboardData;b=runtime.getWindow();var p=c.startContainer.ownerDocument;!f&&b&&(f=b.clipboardData);f?(p=p.createElement("span"),p.appendChild(c.cloneContents()),b=f.setData("text/plain",m.writeToString(p)),d=d&&b,b=f.setData("text/html",h.writeToString(p,odf.Namespaces.namespaceMap)),d=d&&b,a.preventDefault()):d=!1;return d};h=new xmldom.LSSerializer;m=new odf.TextSerializer;f=new odf.OdfNodeFilter;h.filter=f;m.filter= +f}; // Input 65 /* @@ -1853,12 +1853,12 @@ h}; @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.EventNotifier");runtime.loadClass("ops.OpApplyDirectStyling");runtime.loadClass("gui.StyleHelper"); -gui.DirectTextStyler=function(l,m){function h(a,b){for(var c=0,d=b[c];d&&a;)a=a[d],c+=1,d=b[c];return b.length===c?a:void 0}function a(a,b){var c=h(a[0],b);return a.every(function(a){return c===h(a,b)})?c:void 0}function b(){function b(a,c,d){a!==c&&(void 0===e&&(e={}),e[d]=c);return c}var c=x.getCursor(m),d=c&&c.getSelectedRange(),c=d&&r.getAppliedStyles(d),e;t=b(t,d?r.isBold(d):!1,"isBold");w=b(w,d?r.isItalic(d):!1,"isItalic");v=b(v,d?r.hasUnderline(d):!1,"hasUnderline");F=b(F,d?r.hasStrikeThrough(d): -!1,"hasStrikeThrough");d=c&&a(c,["style:text-properties","fo:font-size"]);J=b(J,d&&parseFloat(d),"fontSize");z=b(z,c&&a(c,["style:text-properties","style:font-name"]),"fontName");e&&y.emit(gui.DirectTextStyler.textStylingChanged,e)}function e(a){a.getMemberId()===m&&b()}function g(a){a===m&&b()}function d(a){a.getMemberId()===m&&b()}function p(){b()}function c(a){var c=x.getCursor(m);c&&x.getParagraphElement(c.getNode())===a.paragraphElement&&b()}function q(a,b){var c=x.getCursor(m);if(!c)return!1; -b(!a(c.getSelectedRange()));return!0}function k(a,b){var c=x.getCursorSelection(m),d=new ops.OpApplyDirectStyling,e={};e[a]=b;d.init({memberid:m,position:c.position,length:c.length,setProperties:{"style:text-properties":e}});l.enqueue(d)}function f(a){k("fo:font-weight",a?"bold":"normal")}function n(a){k("fo:font-style",a?"italic":"normal")}function u(a){k("style:text-underline-style",a?"solid":"none")}function s(a){k("style:text-line-through-style",a?"solid":"none")}var x=l.getOdtDocument(),r=new gui.StyleHelper(x.getFormatting()), -y=new core.EventNotifier([gui.DirectTextStyler.textStylingChanged]),t=!1,w=!1,v=!1,F=!1,J,z;this.setBold=f;this.setItalic=n;this.setHasUnderline=u;this.setHasStrikethrough=s;this.setFontSize=function(a){k("fo:font-size",a+"pt")};this.setFontName=function(a){k("style:font-name",a)};this.toggleBold=q.bind(this,r.isBold,f);this.toggleItalic=q.bind(this,r.isItalic,n);this.toggleUnderline=q.bind(this,r.hasUnderline,u);this.toggleStrikethrough=q.bind(this,r.hasStrikeThrough,s);this.isBold=function(){return t}; -this.isItalic=function(){return w};this.hasUnderline=function(){return v};this.hasStrikeThrough=function(){return F};this.fontSize=function(){return J};this.fontName=function(){return z};this.subscribe=function(a,b){y.subscribe(a,b)};this.unsubscribe=function(a,b){y.unsubscribe(a,b)};this.destroy=function(a){x.unsubscribe(ops.OdtDocument.signalCursorAdded,e);x.unsubscribe(ops.OdtDocument.signalCursorRemoved,g);x.unsubscribe(ops.OdtDocument.signalCursorMoved,d);x.unsubscribe(ops.OdtDocument.signalParagraphStyleModified, -p);x.unsubscribe(ops.OdtDocument.signalParagraphChanged,c);a()};x.subscribe(ops.OdtDocument.signalCursorAdded,e);x.subscribe(ops.OdtDocument.signalCursorRemoved,g);x.subscribe(ops.OdtDocument.signalCursorMoved,d);x.subscribe(ops.OdtDocument.signalParagraphStyleModified,p);x.subscribe(ops.OdtDocument.signalParagraphChanged,c);b()};gui.DirectTextStyler.textStylingChanged="textStyling/changed";(function(){return gui.DirectTextStyler})(); +gui.DirectTextStyler=function(h,m){function f(a,b){for(var c=0,d=b[c];d&&a;)a=a[d],c+=1,d=b[c];return b.length===c?a:void 0}function a(a,b){var c=f(a[0],b);return a.every(function(a){return c===f(a,b)})?c:void 0}function c(){function b(a,c,d){a!==c&&(void 0===e&&(e={}),e[d]=c);return c}var c=x.getCursor(m),d=c&&c.getSelectedRange(),c=d&&r.getAppliedStyles(d),e;t=b(t,d?r.isBold(d):!1,"isBold");w=b(w,d?r.isItalic(d):!1,"isItalic");v=b(v,d?r.hasUnderline(d):!1,"hasUnderline");C=b(C,d?r.hasStrikeThrough(d): +!1,"hasStrikeThrough");d=c&&a(c,["style:text-properties","fo:font-size"]);J=b(J,d&&parseFloat(d),"fontSize");E=b(E,c&&a(c,["style:text-properties","style:font-name"]),"fontName");e&&y.emit(gui.DirectTextStyler.textStylingChanged,e)}function d(a){a.getMemberId()===m&&c()}function b(a){a===m&&c()}function k(a){a.getMemberId()===m&&c()}function p(){c()}function e(a){var b=x.getCursor(m);b&&x.getParagraphElement(b.getNode())===a.paragraphElement&&c()}function s(a,b){var c=x.getCursor(m);if(!c)return!1; +b(!a(c.getSelectedRange()));return!0}function n(a,b){var c=x.getCursorSelection(m),d=new ops.OpApplyDirectStyling,e={};e[a]=b;d.init({memberid:m,position:c.position,length:c.length,setProperties:{"style:text-properties":e}});h.enqueue(d)}function g(a){n("fo:font-weight",a?"bold":"normal")}function l(a){n("fo:font-style",a?"italic":"normal")}function u(a){n("style:text-underline-style",a?"solid":"none")}function q(a){n("style:text-line-through-style",a?"solid":"none")}var x=h.getOdtDocument(),r=new gui.StyleHelper(x.getFormatting()), +y=new core.EventNotifier([gui.DirectTextStyler.textStylingChanged]),t=!1,w=!1,v=!1,C=!1,J,E;this.setBold=g;this.setItalic=l;this.setHasUnderline=u;this.setHasStrikethrough=q;this.setFontSize=function(a){n("fo:font-size",a+"pt")};this.setFontName=function(a){n("style:font-name",a)};this.toggleBold=s.bind(this,r.isBold,g);this.toggleItalic=s.bind(this,r.isItalic,l);this.toggleUnderline=s.bind(this,r.hasUnderline,u);this.toggleStrikethrough=s.bind(this,r.hasStrikeThrough,q);this.isBold=function(){return t}; +this.isItalic=function(){return w};this.hasUnderline=function(){return v};this.hasStrikeThrough=function(){return C};this.fontSize=function(){return J};this.fontName=function(){return E};this.subscribe=function(a,b){y.subscribe(a,b)};this.unsubscribe=function(a,b){y.unsubscribe(a,b)};this.destroy=function(a){x.unsubscribe(ops.OdtDocument.signalCursorAdded,d);x.unsubscribe(ops.OdtDocument.signalCursorRemoved,b);x.unsubscribe(ops.OdtDocument.signalCursorMoved,k);x.unsubscribe(ops.OdtDocument.signalParagraphStyleModified, +p);x.unsubscribe(ops.OdtDocument.signalParagraphChanged,e);a()};x.subscribe(ops.OdtDocument.signalCursorAdded,d);x.subscribe(ops.OdtDocument.signalCursorRemoved,b);x.subscribe(ops.OdtDocument.signalCursorMoved,k);x.subscribe(ops.OdtDocument.signalParagraphStyleModified,p);x.subscribe(ops.OdtDocument.signalParagraphChanged,e);c()};gui.DirectTextStyler.textStylingChanged="textStyling/changed";(function(){return gui.DirectTextStyler})(); // Input 66 /* @@ -1895,46 +1895,16 @@ p);x.unsubscribe(ops.OdtDocument.signalParagraphChanged,c);a()};x.subscribe(ops. @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.EventNotifier");runtime.loadClass("core.Utils");runtime.loadClass("odf.OdfUtils");runtime.loadClass("ops.OpAddStyle");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("gui.StyleHelper"); -gui.DirectParagraphStyler=function(l,m,h){function a(){function a(b,d,e){b!==d&&(void 0===c&&(c={}),c[e]=d);return d}var b=n.getCursor(m),b=b&&b.getSelectedRange(),c;y=a(y,b?x.isAlignedLeft(b):!1,"isAlignedLeft");t=a(t,b?x.isAlignedCenter(b):!1,"isAlignedCenter");w=a(w,b?x.isAlignedRight(b):!1,"isAlignedRight");v=a(v,b?x.isAlignedJustified(b):!1,"isAlignedJustified");c&&r.emit(gui.DirectParagraphStyler.paragraphStylingChanged,c)}function b(b){b.getMemberId()===m&&a()}function e(b){b===m&&a()}function g(b){b.getMemberId()=== -m&&a()}function d(){a()}function p(b){var c=n.getCursor(m);c&&n.getParagraphElement(c.getNode())===b.paragraphElement&&a()}function c(a){var b=n.getCursor(m).getSelectedRange(),c=n.getCursorPosition(m),b=s.getParagraphElements(b),d=n.getFormatting();b.forEach(function(b){var e=c+n.getDistanceFromCursor(m,b,0),f=b.getAttributeNS(odf.Namespaces.textns,"style-name");b=h.generateName();var g,e=e+1;f&&(g=d.createDerivedStyleObject(f,"paragraph",{}));g=a(g||{});f=new ops.OpAddStyle;f.init({memberid:m,styleName:b, -styleFamily:"paragraph",isAutomaticStyle:!0,setProperties:g});g=new ops.OpSetParagraphStyle;g.init({memberid:m,styleName:b,position:e});l.enqueue(f);l.enqueue(g)})}function q(a){c(function(b){return u.mergeObjects(b,a)})}function k(a){q({"style:paragraph-properties":{"fo:text-align":a}})}function f(a,b){var c=n.getFormatting().getDefaultTabStopDistance(),d=b["style:paragraph-properties"],d=(d=d&&d["fo:margin-left"])&&s.parseLength(d);return u.mergeObjects(b,{"style:paragraph-properties":{"fo:margin-left":d&& -d.unit===c.unit?d.value+a*c.value+d.unit:a*c.value+c.unit}})}var n=l.getOdtDocument(),u=new core.Utils,s=new odf.OdfUtils,x=new gui.StyleHelper(n.getFormatting()),r=new core.EventNotifier([gui.DirectParagraphStyler.paragraphStylingChanged]),y,t,w,v;this.isAlignedLeft=function(){return y};this.isAlignedCenter=function(){return t};this.isAlignedRight=function(){return w};this.isAlignedJustified=function(){return v};this.alignParagraphLeft=function(){k("left");return!0};this.alignParagraphCenter=function(){k("center"); -return!0};this.alignParagraphRight=function(){k("right");return!0};this.alignParagraphJustified=function(){k("justify");return!0};this.indent=function(){c(f.bind(null,1));return!0};this.outdent=function(){c(f.bind(null,-1));return!0};this.subscribe=function(a,b){r.subscribe(a,b)};this.unsubscribe=function(a,b){r.unsubscribe(a,b)};this.destroy=function(a){n.unsubscribe(ops.OdtDocument.signalCursorAdded,b);n.unsubscribe(ops.OdtDocument.signalCursorRemoved,e);n.unsubscribe(ops.OdtDocument.signalCursorMoved, -g);n.unsubscribe(ops.OdtDocument.signalParagraphStyleModified,d);n.unsubscribe(ops.OdtDocument.signalParagraphChanged,p);a()};n.subscribe(ops.OdtDocument.signalCursorAdded,b);n.subscribe(ops.OdtDocument.signalCursorRemoved,e);n.subscribe(ops.OdtDocument.signalCursorMoved,g);n.subscribe(ops.OdtDocument.signalParagraphStyleModified,d);n.subscribe(ops.OdtDocument.signalParagraphChanged,p);a()};gui.DirectParagraphStyler.paragraphStylingChanged="paragraphStyling/changed";(function(){return gui.DirectParagraphStyler})(); +gui.DirectParagraphStyler=function(h,m,f){function a(){function a(b,d,e){b!==d&&(void 0===c&&(c={}),c[e]=d);return d}var b=l.getCursor(m),b=b&&b.getSelectedRange(),c;y=a(y,b?x.isAlignedLeft(b):!1,"isAlignedLeft");t=a(t,b?x.isAlignedCenter(b):!1,"isAlignedCenter");w=a(w,b?x.isAlignedRight(b):!1,"isAlignedRight");v=a(v,b?x.isAlignedJustified(b):!1,"isAlignedJustified");c&&r.emit(gui.DirectParagraphStyler.paragraphStylingChanged,c)}function c(b){b.getMemberId()===m&&a()}function d(b){b===m&&a()}function b(b){b.getMemberId()=== +m&&a()}function k(){a()}function p(b){var c=l.getCursor(m);c&&l.getParagraphElement(c.getNode())===b.paragraphElement&&a()}function e(a){var b=l.getCursor(m).getSelectedRange(),c=l.getCursorPosition(m),b=q.getParagraphElements(b),d=l.getFormatting();b.forEach(function(b){var e=c+l.getDistanceFromCursor(m,b,0),g=b.getAttributeNS(odf.Namespaces.textns,"style-name");b=f.generateName();var k,e=e+1;g&&(k=d.createDerivedStyleObject(g,"paragraph",{}));k=a(k||{});g=new ops.OpAddStyle;g.init({memberid:m,styleName:b, +styleFamily:"paragraph",isAutomaticStyle:!0,setProperties:k});k=new ops.OpSetParagraphStyle;k.init({memberid:m,styleName:b,position:e});h.enqueue(g);h.enqueue(k)})}function s(a){e(function(b){return u.mergeObjects(b,a)})}function n(a){s({"style:paragraph-properties":{"fo:text-align":a}})}function g(a,b){var c=l.getFormatting().getDefaultTabStopDistance(),d=b["style:paragraph-properties"],d=(d=d&&d["fo:margin-left"])&&q.parseLength(d);return u.mergeObjects(b,{"style:paragraph-properties":{"fo:margin-left":d&& +d.unit===c.unit?d.value+a*c.value+d.unit:a*c.value+c.unit}})}var l=h.getOdtDocument(),u=new core.Utils,q=new odf.OdfUtils,x=new gui.StyleHelper(l.getFormatting()),r=new core.EventNotifier([gui.DirectParagraphStyler.paragraphStylingChanged]),y,t,w,v;this.isAlignedLeft=function(){return y};this.isAlignedCenter=function(){return t};this.isAlignedRight=function(){return w};this.isAlignedJustified=function(){return v};this.alignParagraphLeft=function(){n("left");return!0};this.alignParagraphCenter=function(){n("center"); +return!0};this.alignParagraphRight=function(){n("right");return!0};this.alignParagraphJustified=function(){n("justify");return!0};this.indent=function(){e(g.bind(null,1));return!0};this.outdent=function(){e(g.bind(null,-1));return!0};this.subscribe=function(a,b){r.subscribe(a,b)};this.unsubscribe=function(a,b){r.unsubscribe(a,b)};this.destroy=function(a){l.unsubscribe(ops.OdtDocument.signalCursorAdded,c);l.unsubscribe(ops.OdtDocument.signalCursorRemoved,d);l.unsubscribe(ops.OdtDocument.signalCursorMoved, +b);l.unsubscribe(ops.OdtDocument.signalParagraphStyleModified,k);l.unsubscribe(ops.OdtDocument.signalParagraphChanged,p);a()};l.subscribe(ops.OdtDocument.signalCursorAdded,c);l.subscribe(ops.OdtDocument.signalCursorRemoved,d);l.subscribe(ops.OdtDocument.signalCursorMoved,b);l.subscribe(ops.OdtDocument.signalParagraphStyleModified,k);l.subscribe(ops.OdtDocument.signalParagraphChanged,p);a()};gui.DirectParagraphStyler.paragraphStylingChanged="paragraphStyling/changed";(function(){return gui.DirectParagraphStyler})(); // Input 67 -runtime.loadClass("core.DomUtils");runtime.loadClass("core.Utils");runtime.loadClass("odf.OdfUtils");runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpRemoveAnnotation");runtime.loadClass("gui.Clipboard");runtime.loadClass("gui.KeyboardHandler");runtime.loadClass("gui.DirectTextStyler"); -runtime.loadClass("gui.DirectParagraphStyler"); -gui.SessionController=function(){var l=core.PositionFilter.FilterResult.FILTER_ACCEPT;gui.SessionController=function(m,h,a){function b(a,b,c,d){var e="on"+b,f=!1;a.attachEvent&&(f=a.attachEvent(e,c));!f&&a.addEventListener&&(a.addEventListener(b,c,!1),f=!0);f&&!d||!a.hasOwnProperty(e)||(a[e]=c)}function e(a,b,c){var d="on"+b;a.detachEvent&&a.detachEvent(d,c);a.removeEventListener&&a.removeEventListener(b,c,!1);a[d]===c&&(a[d]=null)}function g(a){a.preventDefault?a.preventDefault():a.returnValue=!1} -function d(a,b){var c=new ops.OpMoveCursor;c.init({memberid:h,position:a,length:b||0});return c}function p(a,b){var c=gui.SelectionMover.createPositionIterator(C.getRootNode()),d=C.getOdfCanvas().getElement(),e;e=a;if(!e)return null;for(;e!==d&&!("urn:webodf:names:cursor"===e.namespaceURI&&"cursor"===e.localName||"urn:webodf:names:editinfo"===e.namespaceURI&&"editinfo"===e.localName);)if(e=e.parentNode,!e)return null;e!==d&&a!==e&&(a=e.parentNode,b=Array.prototype.indexOf.call(a.childNodes,e));c.setUnfilteredPosition(a, -b);return C.getDistanceFromCursor(h,c.container(),c.unfilteredDomOffset())}function c(a){var b=C.getOdfCanvas().getElement(),c=C.getRootNode(),d=0;b.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING||(a=gui.SelectionMover.createPositionIterator(c),a.moveToEnd(),c=a.container(),d=a.unfilteredDomOffset());return{node:c,offset:d}}function q(a){runtime.setTimeout(function(){var b;a:{var e=C.getOdfCanvas().getElement();b=aa.getSelection();b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset, -focusNode:b.focusNode,focusOffset:b.focusOffset};var f=a.detail,g,k;if(null===b.anchorNode&&null===b.focusNode){k=a.clientX;g=a.clientY;var l=C.getDOM();l.caretRangeFromPoint?(k=l.caretRangeFromPoint(k,g),k={container:k.startContainer,offset:k.startOffset}):l.caretPositionFromPoint?(k=l.caretPositionFromPoint(k,g),k={container:k.offsetNode,offset:k.offset}):k=null;if(!k){b=null;break a}b.anchorNode=k.container;b.anchorOffset=k.offset;b.focusNode=b.anchorNode;b.focusOffset=b.anchorOffset}runtime.assert(null!== -b.anchorNode&&null!==b.focusNode,"anchorNode is null or focusNode is null");g=la.containsNode(e,b.anchorNode);k=la.containsNode(e,b.focusNode);if(g||k){g||(g=c(b.anchorNode),b.anchorNode=g.node,b.anchorOffset=g.offset);k||(g=c(b.focusNode),b.focusNode=g.node,b.focusOffset=g.offset);if(2===f){var n=/[A-Za-z0-9]/,r=gui.SelectionMover.createPositionIterator(C.getRootNode()),s=0a.length&&(a.position+=a.length,a.length=-a.length);return a}function S(a){var b=new ops.OpRemoveText;b.init({memberid:h,position:a.position,length:a.length});return b}function B(){var a=O(C.getCursorSelection(h)),b=null;0===a.length?0 + Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it @@ -1966,7 +1936,37 @@ I.bind(c.Z,b.Ctrl,ia),I.bind(c.Z,b.CtrlShift,D));pa.setDefault(function(a){var b @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.MemberModel=function(){};ops.MemberModel.prototype.getMemberDetailsAndUpdates=function(l,m){};ops.MemberModel.prototype.unsubscribeMemberDetailsUpdates=function(l,m){};ops.MemberModel.prototype.close=function(l){}; +gui.TextManipulator=function(h,m){function f(a){var b=new ops.OpRemoveText;b.init({memberid:m,position:a.position,length:a.length});return b}function a(a){0>a.length&&(a.position+=a.length,a.length=-a.length);return a}var c=h.getOdtDocument();this.enqueueParagraphSplittingOps=function(){var d=a(c.getCursorSelection(m)),b;0 - - @licstart - The JavaScript code in this page is free software: you can redistribute it - and/or modify it under the terms of the GNU Affero General Public License - (GNU AGPL) as published by the Free Software Foundation, either version 3 of - the License, or (at your option) any later version. The code is distributed - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. - - As additional permission under GNU AGPL version 3 section 7, you - may distribute non-source (e.g., minimized or compacted) forms of - that code without the copy of the GNU GPL normally required by - section 4, provided you include this license notice and a URL - through which recipients can access the Corresponding Source. - - As a special exception to the AGPL, any HTML file which merely makes function - calls to this code, and for that purpose includes it by reference shall be - deemed a separate work for copyright law purposes. In addition, the copyright - holders of this code give you permission to combine this code with free - software libraries that are released under the GNU LGPL. You may copy and - distribute such a system following the terms of the GNU AGPL for this code - and the LGPL for the libraries. If you modify this code, you may extend this - exception to your version of the code, but you are not obligated to do so. - If you do not wish to do so, delete this exception statement from your - version. - - This license applies to this entire compilation. - @licend - @source: http://www.webodf.org/ - @source: http://gitorious.org/webodf/webodf/ -*/ -ops.OperationRouter=function(){};ops.OperationRouter.prototype.setOperationFactory=function(l){};ops.OperationRouter.prototype.setPlaybackFunction=function(l){};ops.OperationRouter.prototype.push=function(l){};ops.OperationRouter.prototype.close=function(l){};ops.OperationRouter.prototype.getHasLocalUnsyncedOpsAndUpdates=function(l){};ops.OperationRouter.prototype.unsubscribeHasLocalUnsyncedOpsUpdates=function(l){}; -// Input 71 -/* - - Copyright (C) 2012 KO GmbH - - @licstart - The JavaScript code in this page is free software: you can redistribute it - and/or modify it under the terms of the GNU Affero General Public License - (GNU AGPL) as published by the Free Software Foundation, either version 3 of - the License, or (at your option) any later version. The code is distributed - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. - - As additional permission under GNU AGPL version 3 section 7, you - may distribute non-source (e.g., minimized or compacted) forms of - that code without the copy of the GNU GPL normally required by - section 4, provided you include this license notice and a URL - through which recipients can access the Corresponding Source. - - As a special exception to the AGPL, any HTML file which merely makes function - calls to this code, and for that purpose includes it by reference shall be - deemed a separate work for copyright law purposes. In addition, the copyright - holders of this code give you permission to combine this code with free - software libraries that are released under the GNU LGPL. You may copy and - distribute such a system following the terms of the GNU AGPL for this code - and the LGPL for the libraries. If you modify this code, you may extend this - exception to your version of the code, but you are not obligated to do so. - If you do not wish to do so, delete this exception statement from your - version. - - This license applies to this entire compilation. - @licend - @source: http://www.webodf.org/ - @source: http://gitorious.org/webodf/webodf/ -*/ -ops.TrivialOperationRouter=function(){var l,m;this.setOperationFactory=function(h){l=h};this.setPlaybackFunction=function(h){m=h};this.push=function(h){h=h.spec();h.timestamp=(new Date).getTime();h=l.create(h);m(h)};this.close=function(h){h()};this.getHasLocalUnsyncedOpsAndUpdates=function(h){h(!0)};this.unsubscribeHasLocalUnsyncedOpsUpdates=function(h){}}; -// Input 72 -gui.EditInfoHandle=function(l){var m=[],h,a=l.ownerDocument,b=a.documentElement.namespaceURI;this.setEdits=function(e){m=e;var g,d,l,c;h.innerHTML="";for(e=0;e @@ -2113,10 +2038,82 @@ c=a.createElementNS(b,"span"),c.className="editInfoTime",c.setAttributeNS("urn:w @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -runtime.loadClass("ops.EditInfo");runtime.loadClass("gui.EditInfoHandle"); -gui.EditInfoMarker=function(l,m){function h(a,b){return runtime.getWindow().setTimeout(function(){g.style.opacity=a},b)}var a=this,b,e,g,d,p;this.addEdit=function(a,b){var k=Date.now()-b;l.addEdit(a,b);e.setEdits(l.getSortedEdits());g.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",a);if(d){var f=d;runtime.getWindow().clearTimeout(f)}p&&(f=p,runtime.getWindow().clearTimeout(f));1E4>k?(h(1,0),d=h(0.5,1E4-k),p=h(0.2,2E4-k)):1E4<=k&&2E4>k?(h(0.5,0),p=h(0.2,2E4-k)):h(0.2,0)};this.getEdits= -function(){return l.getEdits()};this.clearEdits=function(){l.clearEdits();e.setEdits([]);g.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&g.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return l};this.show=function(){g.style.display="block"};this.hide=function(){a.hideHandle();g.style.display="none"};this.showHandle=function(){e.show()};this.hideHandle=function(){e.hide()};this.destroy=function(a){b.removeChild(g);e.destroy(function(b){b? -a(b):l.destroy(a)})};(function(){var c=l.getOdtDocument().getDOM();g=c.createElementNS(c.documentElement.namespaceURI,"div");g.setAttribute("class","editInfoMarker");g.onmouseover=function(){a.showHandle()};g.onmouseout=function(){a.hideHandle()};b=l.getNode();b.appendChild(g);e=new gui.EditInfoHandle(b);m||a.hide()})()}; +ops.TrivialMemberModel=function(){this.getMemberDetailsAndUpdates=function(h,m){m(h,{memberid:h,fullname:"Unknown",color:"black",imageurl:"avatar-joe.png"})};this.unsubscribeMemberDetailsUpdates=function(h,m){};this.close=function(h){h()}}; +// Input 71 +/* + + Copyright (C) 2013 KO GmbH + + @licstart + The JavaScript code in this page is free software: you can redistribute it + and/or modify it under the terms of the GNU Affero General Public License + (GNU AGPL) as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. The code is distributed + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. + + As additional permission under GNU AGPL version 3 section 7, you + may distribute non-source (e.g., minimized or compacted) forms of + that code without the copy of the GNU GPL normally required by + section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + As a special exception to the AGPL, any HTML file which merely makes function + calls to this code, and for that purpose includes it by reference shall be + deemed a separate work for copyright law purposes. In addition, the copyright + holders of this code give you permission to combine this code with free + software libraries that are released under the GNU LGPL. You may copy and + distribute such a system following the terms of the GNU AGPL for this code + and the LGPL for the libraries. If you modify this code, you may extend this + exception to your version of the code, but you are not obligated to do so. + If you do not wish to do so, delete this exception statement from your + version. + + This license applies to this entire compilation. + @licend + @source: http://www.webodf.org/ + @source: http://gitorious.org/webodf/webodf/ +*/ +ops.OperationRouter=function(){};ops.OperationRouter.prototype.setOperationFactory=function(h){};ops.OperationRouter.prototype.setPlaybackFunction=function(h){};ops.OperationRouter.prototype.push=function(h){};ops.OperationRouter.prototype.close=function(h){};ops.OperationRouter.prototype.getHasLocalUnsyncedOpsAndUpdates=function(h){};ops.OperationRouter.prototype.unsubscribeHasLocalUnsyncedOpsUpdates=function(h){}; +// Input 72 +/* + + Copyright (C) 2012 KO GmbH + + @licstart + The JavaScript code in this page is free software: you can redistribute it + and/or modify it under the terms of the GNU Affero General Public License + (GNU AGPL) as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. The code is distributed + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. + + As additional permission under GNU AGPL version 3 section 7, you + may distribute non-source (e.g., minimized or compacted) forms of + that code without the copy of the GNU GPL normally required by + section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + As a special exception to the AGPL, any HTML file which merely makes function + calls to this code, and for that purpose includes it by reference shall be + deemed a separate work for copyright law purposes. In addition, the copyright + holders of this code give you permission to combine this code with free + software libraries that are released under the GNU LGPL. You may copy and + distribute such a system following the terms of the GNU AGPL for this code + and the LGPL for the libraries. If you modify this code, you may extend this + exception to your version of the code, but you are not obligated to do so. + If you do not wish to do so, delete this exception statement from your + version. + + This license applies to this entire compilation. + @licend + @source: http://www.webodf.org/ + @source: http://gitorious.org/webodf/webodf/ +*/ +ops.TrivialOperationRouter=function(){var h,m;this.setOperationFactory=function(f){h=f};this.setPlaybackFunction=function(f){m=f};this.push=function(f){f=f.spec();f.timestamp=(new Date).getTime();f=h.create(f);m(f)};this.close=function(f){f()};this.getHasLocalUnsyncedOpsAndUpdates=function(f){f(!0)};this.unsubscribeHasLocalUnsyncedOpsUpdates=function(f){}}; +// Input 73 +gui.EditInfoHandle=function(h){var m=[],f,a=h.ownerDocument,c=a.documentElement.namespaceURI;this.setEdits=function(d){m=d;var b,k,h,e;f.innerHTML="";for(d=0;dm?(f(1,0),k=f(0.5,1E4-m),p=f(0.2,2E4-m)):1E4<=m&&2E4>m?(f(0.5,0),p=f(0.2,2E4-m)):f(0.2,0)};this.getEdits= +function(){return h.getEdits()};this.clearEdits=function(){h.clearEdits();d.setEdits([]);b.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&b.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return h};this.show=function(){b.style.display="block"};this.hide=function(){a.hideHandle();b.style.display="none"};this.showHandle=function(){d.show()};this.hideHandle=function(){d.hide()};this.destroy=function(a){c.removeChild(b);d.destroy(function(b){b? +a(b):h.destroy(a)})};(function(){var e=h.getOdtDocument().getDOM();b=e.createElementNS(e.documentElement.namespaceURI,"div");b.setAttribute("class","editInfoMarker");b.onmouseover=function(){a.showHandle()};b.onmouseout=function(){a.hideHandle()};c=h.getNode();c.appendChild(b);d=new gui.EditInfoHandle(c);m||a.hide()})()}; // Input 75 /* @@ -2195,32 +2188,18 @@ q.type="text/css";q.media="screen, print, handheld, projection";q.appendChild(do @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -runtime.loadClass("gui.Caret"); -gui.CaretManager=function(l){function m(a){return k.hasOwnProperty(a)?k[a]:null}function h(){return Object.keys(k).map(function(a){return k[a]})}function a(){return l.getSession().getOdtDocument().getOdfCanvas().getElement()}function b(b){b===l.getInputMemberId()&&a().removeAttribute("tabindex");delete k[b]}function e(a){a=a.getMemberId();a===l.getInputMemberId()&&(a=m(a))&&a.refreshCursorBlinking()}function g(a){a.memberId===l.getInputMemberId()&&(a=m(a.memberId))&&a.ensureVisible()}function d(){var a= -m(l.getInputMemberId());a&&a.setFocus()}function p(){var a=m(l.getInputMemberId());a&&a.removeFocus()}function c(){var a=m(l.getInputMemberId());a&&a.show()}function q(){var a=m(l.getInputMemberId());a&&a.hide()}var k={},f=runtime.getWindow();this.registerCursor=function(b,c,d){var e=b.getMemberId(),f=a();c=new gui.Caret(b,c,d);k[e]=c;e===l.getInputMemberId()&&(runtime.log("Starting to track input on new cursor of "+e),b.handleUpdate=c.ensureVisible,f.setAttribute("tabindex",0),f.focus());return c}; -this.getCaret=m;this.getCarets=h;this.destroy=function(k){var m=l.getSession().getOdtDocument(),s=a(),x=h();m.unsubscribe(ops.OdtDocument.signalParagraphChanged,g);m.unsubscribe(ops.OdtDocument.signalCursorMoved,e);m.unsubscribe(ops.OdtDocument.signalCursorRemoved,b);s.removeEventListener("focus",d,!1);s.removeEventListener("blur",p,!1);f.removeEventListener("focus",c,!1);f.removeEventListener("blur",q,!1);(function y(a,b){b?k(b):aa?-1:a-1})};a.slideChange=function(b){var e=a.getPages(a.odf_canvas.odfContainer().rootElement),g=-1,d=0;e.forEach(function(a){a=a[1];a.hasAttribute("slide_current")&&(g=d,a.removeAttribute("slide_current"));d+=1});b=b(g,e.length);-1===b&&(b=g);e[b][1].setAttribute("slide_current", -"1");document.getElementById("pagelist").selectedIndex=b;"cont"===a.slide_mode&&m.scrollBy(0,e[b][1].getBoundingClientRect().top-30)};a.selectSlide=function(b){a.slideChange(function(a,g){return b>=g||0>b?-1:b})};a.scrollIntoContView=function(b){var e=a.getPages(a.odf_canvas.odfContainer().rootElement);0!==e.length&&m.scrollBy(0,e[b][1].getBoundingClientRect().top-30)};a.getPages=function(a){a=a.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var e=[],g;for(g=0;g=a.rangeCount||!u)||(a=a.getRangeAt(0),u.setPoint(a.startContainer,a.startOffset))}function e(){var a=l.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();u&&u.node()&&(b=u.node(),c=b.ownerDocument.createRange(), -c.setStart(b,u.position()),c.collapse(!0),a.addRange(c))}function g(c){var d=c.charCode||c.keyCode;if(u=null,u&&37===d)b(),u.stepBackward(),e();else if(16<=d&&20>=d||33<=d&&40>=d)return;a(c)}function d(b){a(b)}function p(a){for(var b=a.firstChild;b&&b!==a;)b.nodeType===Node.ELEMENT_NODE&&p(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 c(a,b){for(var d=a.firstChild,e,f,g;d&&d!==a;){if(d.nodeType===Node.ELEMENT_NODE)for(c(d,b),e=d.attributes,g=e.length-1;0<=g;g-=1)f=e.item(g),"http://www.w3.org/2000/xmlns/"!==f.namespaceURI||b[f.nodeValue]||(b[f.nodeValue]=f.localName);d=d.nextSibling||d.parentNode}}function q(){var a=l.ownerDocument.createElement("style"),b;b={};c(l,b); -var d={},e,f,g=0;for(e in b)if(b.hasOwnProperty(e)&&e){f=b[e];if(!f||d.hasOwnProperty(f)||"xmlns"===f){do f="ns"+g,g+=1;while(d.hasOwnProperty(f));b[e]=f}d[f]=!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,f,n,u=null;l.id||(l.id="xml"+String(Math.random()).substring(2));f="#"+l.id+" ";k=f+"*,"+f+":visited, "+f+":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"+ -f+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+f+":after {color: blue; content: '';}\n"+f+"{overflow: auto;}\n";(function(b){h(b,"click",d);h(b,"keydown",g);h(b,"drop",a);h(b,"dragend",a);h(b,"beforepaste",a);h(b,"paste",a)})(l);this.updateCSS=q;this.setXML=function(a){a=a.documentElement||a;n=a=l.ownerDocument.importNode(a,!0);for(p(a);l.lastChild;)l.removeChild(l.lastChild);l.appendChild(a);q();u=new core.PositionIterator(a)};this.getXML= -function(){return n}}; -// Input 78 /* - Copyright (C) 2013 KO GmbH + Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it @@ -2252,8 +2231,28 @@ function(){return n}}; @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -gui.UndoManager=function(){};gui.UndoManager.prototype.subscribe=function(l,m){};gui.UndoManager.prototype.unsubscribe=function(l,m){};gui.UndoManager.prototype.setOdtDocument=function(l){};gui.UndoManager.prototype.saveInitialState=function(){};gui.UndoManager.prototype.resetInitialState=function(){};gui.UndoManager.prototype.setPlaybackFunction=function(l){};gui.UndoManager.prototype.hasUndoStates=function(){};gui.UndoManager.prototype.hasRedoStates=function(){}; -gui.UndoManager.prototype.moveForward=function(l){};gui.UndoManager.prototype.moveBackward=function(l){};gui.UndoManager.prototype.onOperationExecuted=function(l){};gui.UndoManager.signalUndoStackChanged="undoStackChanged";gui.UndoManager.signalUndoStateCreated="undoStateCreated";gui.UndoManager.signalUndoStateModified="undoStateModified";(function(){return gui.UndoManager})(); +runtime.loadClass("gui.Caret"); +gui.CaretManager=function(h){function m(a){return n.hasOwnProperty(a)?n[a]:null}function f(){return Object.keys(n).map(function(a){return n[a]})}function a(){return h.getSession().getOdtDocument().getOdfCanvas().getElement()}function c(b){b===h.getInputMemberId()&&a().removeAttribute("tabindex");delete n[b]}function d(a){a=a.getMemberId();a===h.getInputMemberId()&&(a=m(a))&&a.refreshCursorBlinking()}function b(a){a.memberId===h.getInputMemberId()&&(a=m(a.memberId))&&a.ensureVisible()}function k(){var a= +m(h.getInputMemberId());a&&a.setFocus()}function p(){var a=m(h.getInputMemberId());a&&a.removeFocus()}function e(){var a=m(h.getInputMemberId());a&&a.show()}function s(){var a=m(h.getInputMemberId());a&&a.hide()}var n={},g=runtime.getWindow();this.registerCursor=function(b,c,d){var e=b.getMemberId(),g=a();c=new gui.Caret(b,c,d);n[e]=c;e===h.getInputMemberId()&&(runtime.log("Starting to track input on new cursor of "+e),b.handleUpdate=c.ensureVisible,g.setAttribute("tabindex",0),g.focus());return c}; +this.getCaret=m;this.getCarets=f;this.destroy=function(l){var m=h.getSession().getOdtDocument(),q=a(),n=f();m.unsubscribe(ops.OdtDocument.signalParagraphChanged,b);m.unsubscribe(ops.OdtDocument.signalCursorMoved,d);m.unsubscribe(ops.OdtDocument.signalCursorRemoved,c);q.removeEventListener("focus",k,!1);q.removeEventListener("blur",p,!1);g.removeEventListener("focus",e,!1);g.removeEventListener("blur",s,!1);(function y(a,b){b?l(b):aa?-1:a-1})};a.slideChange=function(c){var d=a.getPages(a.odf_canvas.odfContainer().rootElement),b=-1,f=0;d.forEach(function(a){a=a[1];a.hasAttribute("slide_current")&&(b=f,a.removeAttribute("slide_current"));f+=1});c=c(b,d.length);-1===c&&(c=b);d[c][1].setAttribute("slide_current", +"1");document.getElementById("pagelist").selectedIndex=c;"cont"===a.slide_mode&&m.scrollBy(0,d[c][1].getBoundingClientRect().top-30)};a.selectSlide=function(c){a.slideChange(function(a,b){return c>=b||0>c?-1:c})};a.scrollIntoContView=function(c){var d=a.getPages(a.odf_canvas.odfContainer().rootElement);0!==d.length&&m.scrollBy(0,d[c][1].getBoundingClientRect().top-30)};a.getPages=function(a){a=a.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var d=[],b;for(b=0;b=a.rangeCount||!u)||(a=a.getRangeAt(0),u.setPoint(a.startContainer,a.startOffset))}function d(){var a=h.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();u&&u.node()&&(b=u.node(),c=b.ownerDocument.createRange(), +c.setStart(b,u.position()),c.collapse(!0),a.addRange(c))}function b(b){var e=b.charCode||b.keyCode;if(u=null,u&&37===e)c(),u.stepBackward(),d();else if(16<=e&&20>=e||33<=e&&40>=e)return;a(b)}function k(b){a(b)}function p(a){for(var b=a.firstChild;b&&b!==a;)b.nodeType===Node.ELEMENT_NODE&&p(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 e(a,b){for(var c=a.firstChild,d,f,g;c&&c!==a;){if(c.nodeType===Node.ELEMENT_NODE)for(e(c,b),d=c.attributes,g=d.length-1;0<=g;g-=1)f=d.item(g),"http://www.w3.org/2000/xmlns/"!==f.namespaceURI||b[f.nodeValue]||(b[f.nodeValue]=f.localName);c=c.nextSibling||c.parentNode}}function s(){var a=h.ownerDocument.createElement("style"),b;b={};e(h,b); +var c={},d,f,g=0;for(d in b)if(b.hasOwnProperty(d)&&d){f=b[d];if(!f||c.hasOwnProperty(f)||"xmlns"===f){do f="ns"+g,g+=1;while(c.hasOwnProperty(f));b[d]=f}c[f]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+n;a.appendChild(h.ownerDocument.createTextNode(b));m=m.parentNode.replaceChild(a,m)}var n,g,l,u=null;h.id||(h.id="xml"+String(Math.random()).substring(2));g="#"+h.id+" ";n=g+"*,"+g+":visited, "+g+":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"+ +g+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+g+":after {color: blue; content: '';}\n"+g+"{overflow: auto;}\n";(function(c){f(c,"click",k);f(c,"keydown",b);f(c,"drop",a);f(c,"dragend",a);f(c,"beforepaste",a);f(c,"paste",a)})(h);this.updateCSS=s;this.setXML=function(a){a=a.documentElement||a;l=a=h.ownerDocument.importNode(a,!0);for(p(a);h.lastChild;)h.removeChild(h.lastChild);h.appendChild(a);s();u=new core.PositionIterator(a)};this.getXML= +function(){return l}}; // Input 79 /* @@ -2289,8 +2288,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(h){return h.spec().optype}function m(h){switch(l(h)){case "MoveCursor":case "AddCursor":case "RemoveCursor":return!1;default:return!0}}this.getOpType=l;this.isEditOperation=m;this.isPartOfOperationSet=function(h,a){if(m(h)){if(0===a.length)return!0;var b;if(b=m(a[a.length-1]))a:{b=a.filter(m);var e=l(h),g;b:switch(e){case "RemoveText":case "InsertText":g=!0;break b;default:g=!1}if(g&&e===l(b[0])){if(1===b.length){b=!0;break a}e=b[b.length-2].spec().position; -b=b[b.length-1].spec().position;g=h.spec().position;if(b===g-(b-e)){b=!0;break a}}b=!1}return b}return!0}}; +gui.UndoManager=function(){};gui.UndoManager.prototype.subscribe=function(h,m){};gui.UndoManager.prototype.unsubscribe=function(h,m){};gui.UndoManager.prototype.setOdtDocument=function(h){};gui.UndoManager.prototype.saveInitialState=function(){};gui.UndoManager.prototype.resetInitialState=function(){};gui.UndoManager.prototype.setPlaybackFunction=function(h){};gui.UndoManager.prototype.hasUndoStates=function(){};gui.UndoManager.prototype.hasRedoStates=function(){}; +gui.UndoManager.prototype.moveForward=function(h){};gui.UndoManager.prototype.moveBackward=function(h){};gui.UndoManager.prototype.onOperationExecuted=function(h){};gui.UndoManager.signalUndoStackChanged="undoStackChanged";gui.UndoManager.signalUndoStateCreated="undoStateCreated";gui.UndoManager.signalUndoStateModified="undoStateModified";(function(){return gui.UndoManager})(); // Input 80 /* @@ -2326,17 +2325,12 @@ b=b[b.length-1].spec().position;g=h.spec().position;if(b===g-(b-e)){b=!0;break a @source: http://www.webodf.org/ @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:g.hasUndoStates(),redoAvailable:g.hasRedoStates()})}function h(){f!==c&&f!==n[n.length-1]&&n.push(f)}function a(a){var b=a.previousSibling||a.nextSibling;a.parentNode.removeChild(a);d.normalizeTextNodes(b)}function b(a){return Object.keys(a).map(function(b){return a[b]})}function e(a){function c(a){var b=a.spec();if(f[b.memberid])switch(b.optype){case "AddCursor":d[b.memberid]||(d[b.memberid]= -a,delete f[b.memberid],g-=1);break;case "MoveCursor":e[b.memberid]||(e[b.memberid]=a)}}var d={},e={},f={},g,h=a.pop();k.getCursors().forEach(function(a){f[a.getMemberId()]=!0});for(g=Object.keys(f).length;h&&0 + Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it @@ -2368,24 +2362,13 @@ b.refreshCSS(),f=n[n.length-1]||c,m());return e}};gui.TrivialUndoManager.signalD @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -runtime.loadClass("core.EventNotifier");runtime.loadClass("core.DomUtils");runtime.loadClass("odf.OdfUtils");runtime.loadClass("odf.Namespaces");runtime.loadClass("gui.SelectionMover");runtime.loadClass("gui.StyleHelper");runtime.loadClass("core.PositionFilterChain"); -ops.OdtDocument=function(l){function m(){var a=l.odfContainer().getContentElement(),b=a&&a.localName;runtime.assert("text"===b,"Unsupported content element type '"+b+"'for OdtDocument");return a}function h(a){function b(a){for(;!(a.namespaceURI===odf.Namespaces.officens&&"text"===a.localName||a.namespaceURI===odf.Namespaces.officens&&"annotation"===a.localName);)a=a.parentNode;return a}this.acceptPosition=function(c){c=c.container();var d=q[a].getNode();return b(c)===b(d)?f:n}}function a(a){var b= -gui.SelectionMover.createPositionIterator(m());for(a+=1;0=e;e+=1){c=b.container();d=b.unfilteredDomOffset();if(c.nodeType===Node.TEXT_NODE&& -" "===c.data[d]&&p.isSignificantWhitespace(c,d)){runtime.assert(" "===c.data[d],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var f=c.ownerDocument.createElementNS(odf.Namespaces.textns,"text:s");f.appendChild(c.ownerDocument.createTextNode(" "));c.deleteData(d,1);0= 0");u.acceptPosition(c)===f?(g=c.container(),g.nodeType===Node.TEXT_NODE&&(e=g,h=0)):a+=1;for(;0=e;e+=1){c=b.container();d=b.unfilteredDomOffset();if(c.nodeType===Node.TEXT_NODE&& +" "===c.data[d]&&p.isSignificantWhitespace(c,d)){runtime.assert(" "===c.data[d],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var f=c.ownerDocument.createElementNS(odf.Namespaces.textns,"text:s");f.appendChild(c.ownerDocument.createTextNode(" "));c.deleteData(d,1);0= 0");u.acceptPosition(c)===g?(e=c.container(),e.nodeType===Node.TEXT_NODE&&(d=e,f=0)):a+=1;for(;0 + + @licstart + The JavaScript code in this page is free software: you can redistribute it + and/or modify it under the terms of the GNU Affero General Public License + (GNU AGPL) as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. The code is distributed + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. + + As additional permission under GNU AGPL version 3 section 7, you + may distribute non-source (e.g., minimized or compacted) forms of + that code without the copy of the GNU GPL normally required by + section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + As a special exception to the AGPL, any HTML file which merely makes function + calls to this code, and for that purpose includes it by reference shall be + deemed a separate work for copyright law purposes. In addition, the copyright + holders of this code give you permission to combine this code with free + software libraries that are released under the GNU LGPL. You may copy and + distribute such a system following the terms of the GNU AGPL for this code + and the LGPL for the libraries. If you modify this code, you may extend this + exception to your version of the code, but you are not obligated to do so. + If you do not wish to do so, delete this exception statement from your + version. + + This license applies to this entire compilation. + @licend + @source: http://www.webodf.org/ + @source: http://gitorious.org/webodf/webodf/ +*/ +runtime.loadClass("ops.TrivialMemberModel");runtime.loadClass("ops.TrivialOperationRouter");runtime.loadClass("ops.OperationFactory");runtime.loadClass("ops.OdtDocument"); +ops.Session=function(h){var m=new ops.OperationFactory,f=new ops.OdtDocument(h),a=new ops.TrivialMemberModel,c=null;this.setMemberModel=function(c){a=c};this.setOperationFactory=function(a){m=a;c&&c.setOperationFactory(m)};this.setOperationRouter=function(a){c=a;a.setPlaybackFunction(function(a){a.execute(f);f.emit(ops.OdtDocument.signalOperationExecuted,a)});a.setOperationFactory(m)};this.getMemberModel=function(){return a};this.getOperationFactory=function(){return m};this.getOdtDocument=function(){return f}; +this.enqueue=function(a){c.push(a)};this.close=function(d){c.close(function(b){b?d(b):a.close(function(a){a?d(a):f.close(d)})})};this.destroy=function(a){f.destroy(a)};this.setOperationRouter(new ops.TrivialOperationRouter)}; +// Input 84 var webodf_css="@namespace draw url(urn:oasis:names:tc:opendocument:xmlns:drawing:1.0);\n@namespace fo url(urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0);\n@namespace office url(urn:oasis:names:tc:opendocument:xmlns:office:1.0);\n@namespace presentation url(urn:oasis:names:tc:opendocument:xmlns:presentation:1.0);\n@namespace style url(urn:oasis:names:tc:opendocument:xmlns:style:1.0);\n@namespace svg url(urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0);\n@namespace table url(urn:oasis:names:tc:opendocument:xmlns:table:1.0);\n@namespace text url(urn:oasis:names:tc:opendocument:xmlns:text:1.0);\n@namespace runtimens url(urn:webodf); /* namespace for runtime only */\n@namespace cursor url(urn:webodf:names:cursor);\n@namespace editinfo url(urn:webodf:names:editinfo);\n@namespace annotation url(urn:webodf:names:annotation);\n@namespace dc url(http://purl.org/dc/elements/1.1/);\n\noffice|document > *, office|document-content > * {\n display: none;\n}\noffice|body, office|document {\n display: inline-block;\n position: relative;\n}\n\ntext|p, text|h {\n display: block;\n padding: 0;\n margin: 0;\n line-height: normal;\n position: relative;\n min-height: 1.3em; /* prevent empty paragraphs and headings from collapsing if they are empty */\n}\n*[runtimens|containsparagraphanchor] {\n position: relative;\n}\ntext|s {\n white-space: pre;\n}\ntext|tab {\n display: inline;\n white-space: pre;\n}\ntext|line-break {\n content: \" \";\n display: block;\n}\ntext|tracked-changes {\n /*Consumers that do not support change tracking, should ignore changes.*/\n display: none;\n}\noffice|binary-data {\n display: none;\n}\noffice|text {\n display: block;\n text-align: left;\n overflow: visible;\n word-wrap: break-word;\n}\n\noffice|text::selection {\n /** Let's not draw selection highlight that overflows into the office|text\n * node when selecting content across several paragraphs\n */\n background: transparent;\n}\noffice|text * draw|text-box {\n /** only for text documents */\n display: block;\n border: 1px solid #d3d3d3;\n}\noffice|spreadsheet {\n display: block;\n border-collapse: collapse;\n empty-cells: show;\n font-family: sans-serif;\n font-size: 10pt;\n text-align: left;\n page-break-inside: avoid;\n overflow: hidden;\n}\noffice|presentation {\n display: inline-block;\n text-align: left;\n}\n#shadowContent {\n display: inline-block;\n text-align: left;\n}\ndraw|page {\n display: block;\n position: relative;\n overflow: hidden;\n}\npresentation|notes, presentation|footer-decl, presentation|date-time-decl {\n display: none;\n}\n@media print {\n draw|page {\n border: 1pt solid black;\n page-break-inside: avoid;\n }\n presentation|notes {\n /*TODO*/\n }\n}\noffice|spreadsheet text|p {\n border: 0px;\n padding: 1px;\n margin: 0px;\n}\noffice|spreadsheet table|table {\n margin: 3px;\n}\noffice|spreadsheet table|table:after {\n /* show sheet name the end of the sheet */\n /*content: attr(table|name);*/ /* gives parsing error in opera */\n}\noffice|spreadsheet table|table-row {\n counter-increment: row;\n}\noffice|spreadsheet table|table-row:before {\n width: 3em;\n background: #cccccc;\n border: 1px solid black;\n text-align: center;\n content: counter(row);\n display: table-cell;\n}\noffice|spreadsheet table|table-cell {\n border: 1px solid #cccccc;\n}\ntable|table {\n display: table;\n}\ndraw|frame table|table {\n width: 100%;\n height: 100%;\n background: white;\n}\ntable|table-header-rows {\n display: table-header-group;\n}\ntable|table-row {\n display: table-row;\n}\ntable|table-column {\n display: table-column;\n}\ntable|table-cell {\n width: 0.889in;\n display: table-cell;\n word-break: break-all; /* prevent long words from extending out the table cell */\n}\ndraw|frame {\n display: block;\n}\ndraw|image {\n display: block;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n -moz-background-size: 100% 100%;\n}\n/* only show the first image in frame */\ndraw|frame > 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";