diff --git a/js/3rdparty/webodf/webodf-debug.js b/js/3rdparty/webodf/webodf-debug.js index bbce700b..2cd831b2 100644 --- a/js/3rdparty/webodf/webodf-debug.js +++ b/js/3rdparty/webodf/webodf-debug.js @@ -1,4 +1,4 @@ -var webodf_version = "0.4.2-2039-gdbdc4e9"; +var webodf_version = "0.4.2-2041-g9de1ecc"; function Runtime() { } Runtime.prototype.getVariable = function(name) { @@ -1548,6 +1548,16 @@ core.CSSUnits = function CSSUnits() { } return browserQuirks } + function getDirectChild(parent, ns, name) { + var node = parent ? parent.firstElementChild : null; + while(node) { + if(node.localName === name && node.namespaceURI === ns) { + return(node) + } + node = node.nextElementSibling + } + return null + } core.DomUtils = function DomUtils() { var sharedRange = null; function getSharedRange(doc) { @@ -1873,6 +1883,7 @@ core.CSSUnits = function CSSUnits() { }) } this.mapObjOntoNode = mapObjOntoNode; + this.getDirectChild = getDirectChild; function init(self) { var appVersion, webKitOrSafari, ie, window = runtime.getWindow(); if(window === null) { @@ -4894,16 +4905,6 @@ xmldom.LSSerializer = function LSSerializer() { (function() { var styleInfo = new odf.StyleInfo, domUtils = new core.DomUtils, officens = "urn:oasis:names:tc:opendocument:xmlns:office:1.0", manifestns = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", webodfns = "urn:webodf:names:scope", stylens = odf.Namespaces.stylens, nodeorder = ["meta", "settings", "scripts", "font-face-decls", "styles", "automatic-styles", "master-styles", "body"], automaticStylePrefix = (new Date).getTime() + "_webodf_", base64 = new core.Base64, documentStylesScope = "document-styles", documentContentScope = "document-content"; - function getDirectChild(node, ns, name) { - node = node ? node.firstChild : null; - while(node) { - if(node.localName === name && node.namespaceURI === ns) { - return(node) - } - node = node.nextSibling - } - return null - } function getNodePosition(child) { var i, l = nodeorder.length; for(i = 0;i < l;i += 1) { @@ -5197,7 +5198,7 @@ xmldom.LSSerializer = function LSSerializer() { if(xmldoc) { removeProcessingInstructions(xmldoc.documentElement); try { - node = doc.importNode(xmldoc.documentElement, true) + node = (doc.importNode(xmldoc.documentElement, true)) }catch(ignore) { } } @@ -5215,12 +5216,12 @@ xmldom.LSSerializer = function LSSerializer() { function setRootElement(root) { contentElement = null; self.rootElement = (root); - root.fontFaceDecls = getDirectChild(root, officens, "font-face-decls"); - root.styles = getDirectChild(root, officens, "styles"); - root.automaticStyles = getDirectChild(root, officens, "automatic-styles"); - root.masterStyles = getDirectChild(root, officens, "master-styles"); - root.body = getDirectChild(root, officens, "body"); - root.meta = getDirectChild(root, officens, "meta"); + root.fontFaceDecls = domUtils.getDirectChild(root, officens, "font-face-decls"); + root.styles = domUtils.getDirectChild(root, officens, "styles"); + root.automaticStyles = domUtils.getDirectChild(root, officens, "automatic-styles"); + root.masterStyles = domUtils.getDirectChild(root, officens, "master-styles"); + root.body = domUtils.getDirectChild(root, officens, "body"); + root.meta = domUtils.getDirectChild(root, officens, "meta"); linkAnnotationStartAndEndElements(root) } function handleFlatXml(xmldoc) { @@ -5238,16 +5239,16 @@ xmldom.LSSerializer = function LSSerializer() { setState(OdfContainer.INVALID); return } - root.fontFaceDecls = getDirectChild(node, officens, "font-face-decls"); + root.fontFaceDecls = domUtils.getDirectChild(node, officens, "font-face-decls"); setChild(root, root.fontFaceDecls); - n = getDirectChild(node, officens, "styles"); + n = domUtils.getDirectChild(node, officens, "styles"); root.styles = n || xmldoc.createElementNS(officens, "styles"); setChild(root, root.styles); - n = getDirectChild(node, officens, "automatic-styles"); + n = domUtils.getDirectChild(node, officens, "automatic-styles"); root.automaticStyles = n || xmldoc.createElementNS(officens, "automatic-styles"); setAutomaticStylesScope(root.automaticStyles, documentStylesScope); setChild(root, root.automaticStyles); - node = getDirectChild(node, officens, "master-styles"); + node = domUtils.getDirectChild(node, officens, "master-styles"); root.masterStyles = node || xmldoc.createElementNS(officens, "master-styles"); setChild(root, root.masterStyles); styleInfo.prefixStyleNames(root.automaticStyles, automaticStylePrefix, root.masterStyles) @@ -5259,7 +5260,7 @@ xmldom.LSSerializer = function LSSerializer() { return } root = self.rootElement; - fontFaceDecls = getDirectChild(node, officens, "font-face-decls"); + fontFaceDecls = domUtils.getDirectChild(node, officens, "font-face-decls"); if(root.fontFaceDecls && fontFaceDecls) { fontFaceNameChangeMap = mergeFontFaceDecls(root.fontFaceDecls, fontFaceDecls) }else { @@ -5268,7 +5269,7 @@ xmldom.LSSerializer = function LSSerializer() { setChild(root, fontFaceDecls) } } - automaticStyles = getDirectChild(node, officens, "automatic-styles"); + automaticStyles = domUtils.getDirectChild(node, officens, "automatic-styles"); setAutomaticStylesScope(automaticStyles, documentContentScope); if(fontFaceNameChangeMap) { styleInfo.changeFontFaceNames(automaticStyles, fontFaceNameChangeMap) @@ -5285,7 +5286,7 @@ xmldom.LSSerializer = function LSSerializer() { setChild(root, automaticStyles) } } - node = getDirectChild(node, officens, "body"); + node = domUtils.getDirectChild(node, officens, "body"); if(node === null) { throw" tag is mising."; } @@ -5298,7 +5299,7 @@ xmldom.LSSerializer = function LSSerializer() { return } root = self.rootElement; - root.meta = getDirectChild(node, officens, "meta"); + root.meta = domUtils.getDirectChild(node, officens, "meta"); setChild(root, root.meta) } function handleSettingsXml(xmldoc) { @@ -5307,7 +5308,7 @@ xmldom.LSSerializer = function LSSerializer() { return } root = self.rootElement; - root.settings = getDirectChild(node, officens, "settings"); + root.settings = domUtils.getDirectChild(node, officens, "settings"); setChild(root, root.settings) } function handleManifestXml(xmldoc) { @@ -5366,7 +5367,7 @@ xmldom.LSSerializer = function LSSerializer() { return element } function serializeManifestXml() { - var header = '\n', xml = '', manifest = (runtime.parseXML(xml)), manifestRoot = getDirectChild(manifest, manifestns, "manifest"), serializer = new xmldom.LSSerializer, fullPath; + var header = '\n', xml = '', manifest = (runtime.parseXML(xml)), manifestRoot = manifest.documentElement, serializer = new xmldom.LSSerializer, fullPath; for(fullPath in partMimetypes) { if(partMimetypes.hasOwnProperty(fullPath)) { manifestRoot.appendChild(createManifestEntry(fullPath, partMimetypes[fullPath])) @@ -5432,7 +5433,7 @@ xmldom.LSSerializer = function LSSerializer() { var body; if(!contentElement) { body = self.rootElement.body; - contentElement = getDirectChild(body, officens, "text") || (getDirectChild(body, officens, "presentation") || getDirectChild(body, officens, "spreadsheet")) + contentElement = domUtils.getDirectChild(body, officens, "text") || (domUtils.getDirectChild(body, officens, "presentation") || domUtils.getDirectChild(body, officens, "spreadsheet")) } if(!contentElement) { throw"Could not find content element in ."; @@ -6696,16 +6697,6 @@ odf.Formatting = function Formatting() { this.setOdfContainer = function(odfcontainer) { odfContainer = odfcontainer }; - function getDirectChild(node, ns, name) { - var e = node && node.firstElementChild; - while(e) { - if(e.namespaceURI === ns && e.localName === name) { - break - } - e = e.nextElementSibling - } - return e - } function getFontMap() { var fontFaceDecls = odfContainer.rootElement.fontFaceDecls, fontFaceDeclsMap = {}, node, name, family; node = fontFaceDecls && fontFaceDecls.firstElementChild; @@ -7002,9 +6993,9 @@ odf.Formatting = function Formatting() { var pageLayoutElement, props, printOrientation, defaultOrientedPageWidth, defaultOrientedPageHeight, pageWidth, pageHeight, margin, marginLeft, marginRight, marginTop, marginBottom, padding, paddingLeft, paddingRight, paddingTop, paddingBottom; pageLayoutElement = getPageLayoutStyleElement(styleName, styleFamily); if(!pageLayoutElement) { - pageLayoutElement = getDirectChild(odfContainer.rootElement.styles, stylens, "default-page-layout") + pageLayoutElement = domUtils.getDirectChild(odfContainer.rootElement.styles, stylens, "default-page-layout") } - props = getDirectChild(pageLayoutElement, stylens, "page-layout-properties"); + props = domUtils.getDirectChild(pageLayoutElement, stylens, "page-layout-properties"); if(props) { printOrientation = props.getAttributeNS(stylens, "print-orientation") || "portrait"; if(printOrientation === "portrait") { @@ -7080,17 +7071,17 @@ odf.StyleTreeNode = function StyleTreeNode(element) { this.element = element }; odf.Style2CSS = function Style2CSS() { - var drawns = odf.Namespaces.drawns, fons = odf.Namespaces.fons, officens = odf.Namespaces.officens, stylens = odf.Namespaces.stylens, svgns = odf.Namespaces.svgns, tablens = odf.Namespaces.tablens, textns = odf.Namespaces.textns, xlinkns = odf.Namespaces.xlinkns, presentationns = odf.Namespaces.presentationns, familynamespaceprefixes = {"graphic":"draw", "drawing-page":"draw", "paragraph":"text", "presentation":"presentation", "ruby":"text", "section":"text", "table":"table", "table-cell":"table", - "table-column":"table", "table-row":"table", "text":"text", "list":"text", "page":"office"}, familytagnames = {"graphic":["circle", "connected", "control", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], "paragraph":["alphabetical-index-entry-template", "h", "illustration-index-entry-template", "index-source-style", "object-index-entry-template", "p", "table-index-entry-template", "table-of-content-entry-template", - "user-index-entry-template"], "presentation":["caption", "circle", "connector", "control", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], "drawing-page":["caption", "circle", "connector", "control", "page", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], "ruby":["ruby", "ruby-text"], "section":["alphabetical-index", "bibliography", - "illustration-index", "index-title", "object-index", "section", "table-of-content", "table-index", "user-index"], "table":["background", "table"], "table-cell":["body", "covered-table-cell", "even-columns", "even-rows", "first-column", "first-row", "last-column", "last-row", "odd-columns", "odd-rows", "table-cell"], "table-column":["table-column"], "table-row":["table-row"], "text":["a", "index-entry-chapter", "index-entry-link-end", "index-entry-link-start", "index-entry-page-number", "index-entry-span", - "index-entry-tab-stop", "index-entry-text", "index-title-template", "linenumbering-configuration", "list-level-style-number", "list-level-style-bullet", "outline-level-style", "span"], "list":["list-item"]}, textPropertySimpleMapping = [[fons, "color", "color"], [fons, "background-color", "background-color"], [fons, "font-weight", "font-weight"], [fons, "font-style", "font-style"]], bgImageSimpleMapping = [[stylens, "repeat", "background-repeat"]], paragraphPropertySimpleMapping = [[fons, "background-color", - "background-color"], [fons, "text-align", "text-align"], [fons, "text-indent", "text-indent"], [fons, "padding", "padding"], [fons, "padding-left", "padding-left"], [fons, "padding-right", "padding-right"], [fons, "padding-top", "padding-top"], [fons, "padding-bottom", "padding-bottom"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"], [fons, "margin", "margin"], [fons, "margin-left", "margin-left"], - [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"], [fons, "border", "border"]], graphicPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "min-height", "min-height"], [drawns, "stroke", "border"], [svgns, "stroke-color", "border-color"], [svgns, "stroke-width", "border-width"], [fons, "border", "border"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", - "border-top"], [fons, "border-bottom", "border-bottom"]], tablecellPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"], [fons, "border", "border"]], tablecolumnPropertySimpleMapping = [[stylens, "column-width", "width"]], tablerowPropertySimpleMapping = [[stylens, "row-height", "height"], [fons, "keep-together", null]], tablePropertySimpleMapping = - [[stylens, "width", "width"], [fons, "margin-left", "margin-left"], [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"]], pageContentPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "padding", "padding"], [fons, "padding-left", "padding-left"], [fons, "padding-right", "padding-right"], [fons, "padding-top", "padding-top"], [fons, "padding-bottom", "padding-bottom"], [fons, "border", "border"], [fons, - "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"], [fons, "margin", "margin"], [fons, "margin-left", "margin-left"], [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"]], pageSizePropertySimpleMapping = [[fons, "page-width", "width"], [fons, "page-height", "height"]], borderPropertyMap = {"border":true, "border-left":true, "border-right":true, - "border-top":true, "border-bottom":true, "stroke-width":true}, fontFaceDeclsMap = {}, utils = new odf.OdfUtils, documentType, odfRoot, defaultFontSize, xpath = xmldom.XPath, cssUnits = new core.CSSUnits; + var drawns = odf.Namespaces.drawns, fons = odf.Namespaces.fons, officens = odf.Namespaces.officens, stylens = odf.Namespaces.stylens, svgns = odf.Namespaces.svgns, tablens = odf.Namespaces.tablens, textns = odf.Namespaces.textns, xlinkns = odf.Namespaces.xlinkns, presentationns = odf.Namespaces.presentationns, domUtils = new core.DomUtils, familynamespaceprefixes = {"graphic":"draw", "drawing-page":"draw", "paragraph":"text", "presentation":"presentation", "ruby":"text", "section":"text", "table":"table", + "table-cell":"table", "table-column":"table", "table-row":"table", "text":"text", "list":"text", "page":"office"}, familytagnames = {"graphic":["circle", "connected", "control", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], "paragraph":["alphabetical-index-entry-template", "h", "illustration-index-entry-template", "index-source-style", "object-index-entry-template", "p", "table-index-entry-template", + "table-of-content-entry-template", "user-index-entry-template"], "presentation":["caption", "circle", "connector", "control", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], "drawing-page":["caption", "circle", "connector", "control", "page", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], "ruby":["ruby", "ruby-text"], + "section":["alphabetical-index", "bibliography", "illustration-index", "index-title", "object-index", "section", "table-of-content", "table-index", "user-index"], "table":["background", "table"], "table-cell":["body", "covered-table-cell", "even-columns", "even-rows", "first-column", "first-row", "last-column", "last-row", "odd-columns", "odd-rows", "table-cell"], "table-column":["table-column"], "table-row":["table-row"], "text":["a", "index-entry-chapter", "index-entry-link-end", "index-entry-link-start", + "index-entry-page-number", "index-entry-span", "index-entry-tab-stop", "index-entry-text", "index-title-template", "linenumbering-configuration", "list-level-style-number", "list-level-style-bullet", "outline-level-style", "span"], "list":["list-item"]}, textPropertySimpleMapping = [[fons, "color", "color"], [fons, "background-color", "background-color"], [fons, "font-weight", "font-weight"], [fons, "font-style", "font-style"]], bgImageSimpleMapping = [[stylens, "repeat", "background-repeat"]], + paragraphPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "text-align", "text-align"], [fons, "text-indent", "text-indent"], [fons, "padding", "padding"], [fons, "padding-left", "padding-left"], [fons, "padding-right", "padding-right"], [fons, "padding-top", "padding-top"], [fons, "padding-bottom", "padding-bottom"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"], + [fons, "margin", "margin"], [fons, "margin-left", "margin-left"], [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"], [fons, "border", "border"]], graphicPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "min-height", "min-height"], [drawns, "stroke", "border"], [svgns, "stroke-color", "border-color"], [svgns, "stroke-width", "border-width"], [fons, "border", "border"], [fons, "border-left", "border-left"], + [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"]], tablecellPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"], [fons, "border", "border"]], tablecolumnPropertySimpleMapping = [[stylens, "column-width", "width"]], tablerowPropertySimpleMapping = [[stylens, + "row-height", "height"], [fons, "keep-together", null]], tablePropertySimpleMapping = [[stylens, "width", "width"], [fons, "margin-left", "margin-left"], [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"]], pageContentPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "padding", "padding"], [fons, "padding-left", "padding-left"], [fons, "padding-right", "padding-right"], [fons, "padding-top", "padding-top"], + [fons, "padding-bottom", "padding-bottom"], [fons, "border", "border"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"], [fons, "margin", "margin"], [fons, "margin-left", "margin-left"], [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"]], pageSizePropertySimpleMapping = [[fons, "page-width", "width"], [fons, "page-height", + "height"]], borderPropertyMap = {"border":true, "border-left":true, "border-right":true, "border-top":true, "border-bottom":true, "stroke-width":true}, fontFaceDeclsMap = {}, utils = new odf.OdfUtils, documentType, odfRoot, defaultFontSize, xpath = xmldom.XPath, cssUnits = new core.CSSUnits; function getStyleMap(stylesnode) { var node, name, family, style, stylemap = {}; if(!stylesnode) { @@ -7204,16 +7195,6 @@ odf.Style2CSS = function Style2CSS() { } return selectors } - function getDirectChild(node, ns, name) { - var e = node && node.firstElementChild; - while(e) { - if(e.namespaceURI === ns && e.localName === name) { - break - } - e = e.nextElementSibling - } - return e - } function fixBorderWidth(value) { var index = value.indexOf(" "), width, theRestOfBorderAttributes; if(index !== -1) { @@ -7247,7 +7228,7 @@ odf.Style2CSS = function Style2CSS() { return rule } function getFontSize(styleNode) { - var props = getDirectChild(styleNode, stylens, "text-properties"); + var props = domUtils.getDirectChild(styleNode, stylens, "text-properties"); if(props) { return utils.parseFoFontSize(props.getAttributeNS(fons, "font-size")) } @@ -7313,7 +7294,7 @@ odf.Style2CSS = function Style2CSS() { function getParagraphProperties(props) { var rule = "", bgimage, url, lineHeight; rule += applySimpleMapping(props, paragraphPropertySimpleMapping); - bgimage = getDirectChild(props, stylens, "background-image"); + bgimage = domUtils.getDirectChild(props, stylens, "background-image"); if(bgimage) { url = bgimage.getAttributeNS(xlinkns, "href"); if(url) { @@ -7405,35 +7386,35 @@ odf.Style2CSS = function Style2CSS() { } function addStyleRule(sheet, family, name, node) { var selectors = getSelectors(family, name, node), selector = selectors.join(","), rule = "", properties; - properties = getDirectChild(node.element, stylens, "text-properties"); + properties = domUtils.getDirectChild(node.element, stylens, "text-properties"); if(properties) { rule += getTextProperties(properties) } - properties = getDirectChild(node.element, stylens, "paragraph-properties"); + properties = domUtils.getDirectChild(node.element, stylens, "paragraph-properties"); if(properties) { rule += getParagraphProperties(properties) } - properties = getDirectChild(node.element, stylens, "graphic-properties"); + properties = domUtils.getDirectChild(node.element, stylens, "graphic-properties"); if(properties) { rule += getGraphicProperties(properties) } - properties = getDirectChild(node.element, stylens, "drawing-page-properties"); + properties = domUtils.getDirectChild(node.element, stylens, "drawing-page-properties"); if(properties) { rule += getDrawingPageProperties(properties) } - properties = getDirectChild(node.element, stylens, "table-cell-properties"); + properties = domUtils.getDirectChild(node.element, stylens, "table-cell-properties"); if(properties) { rule += getTableCellProperties(properties) } - properties = getDirectChild(node.element, stylens, "table-row-properties"); + properties = domUtils.getDirectChild(node.element, stylens, "table-row-properties"); if(properties) { rule += getTableRowProperties(properties) } - properties = getDirectChild(node.element, stylens, "table-column-properties"); + properties = domUtils.getDirectChild(node.element, stylens, "table-column-properties"); if(properties) { rule += getTableColumnProperties(properties) } - properties = getDirectChild(node.element, stylens, "table-properties"); + properties = domUtils.getDirectChild(node.element, stylens, "table-properties"); if(properties) { rule += getTableProperties(properties) } @@ -7471,7 +7452,7 @@ odf.Style2CSS = function Style2CSS() { return"content: '" + bulletChar + "';" } function addListStyleRule(sheet, name, node, itemrule) { - var selector = 'text|list[text|style-name="' + name + '"]', level = node.getAttributeNS(textns, "level"), itemSelector, listItemRule, listLevelProps = getDirectChild(node, stylens, "list-level-properties"), listLevelLabelAlign = getDirectChild(listLevelProps, stylens, "list-level-label-alignment"), bulletIndent, listIndent, bulletWidth, rule; + var selector = 'text|list[text|style-name="' + name + '"]', level = node.getAttributeNS(textns, "level"), itemSelector, listItemRule, listLevelProps = domUtils.getDirectChild(node, stylens, "list-level-properties"), listLevelLabelAlign = domUtils.getDirectChild(listLevelProps, stylens, "list-level-label-alignment"), bulletIndent, listIndent, bulletWidth, rule; if(listLevelLabelAlign) { bulletIndent = listLevelLabelAlign.getAttributeNS(fons, "text-indent"); listIndent = listLevelLabelAlign.getAttributeNS(fons, "margin-left") @@ -7514,13 +7495,13 @@ odf.Style2CSS = function Style2CSS() { } } function addPageStyleRules(sheet, node) { - var rule = "", imageProps, url, contentLayoutRule = "", pageSizeRule = "", props = getDirectChild(node, stylens, "page-layout-properties"), stylename, masterStyles, e, masterStyleName; + var rule = "", imageProps, url, contentLayoutRule = "", pageSizeRule = "", props = domUtils.getDirectChild(node, stylens, "page-layout-properties"), stylename, masterStyles, e, masterStyleName; if(!props) { return } stylename = node.getAttributeNS(stylens, "name"); rule += applySimpleMapping(props, pageContentPropertySimpleMapping); - imageProps = getDirectChild(props, stylens, "background-image"); + imageProps = domUtils.getDirectChild(props, stylens, "background-image"); if(imageProps) { url = imageProps.getAttributeNS(xlinkns, "href"); if(url) { @@ -7529,7 +7510,7 @@ odf.Style2CSS = function Style2CSS() { } } if(documentType === "presentation") { - masterStyles = getDirectChild((node.parentNode.parentNode), officens, "master-styles"); + masterStyles = domUtils.getDirectChild((node.parentNode.parentNode), officens, "master-styles"); e = masterStyles && masterStyles.firstElementChild; while(e) { if(e.namespaceURI === stylens && (e.localName === "master-page" && e.getAttributeNS(stylens, "page-layout-name") === stylename)) { diff --git a/js/3rdparty/webodf/webodf.js b/js/3rdparty/webodf/webodf.js index 69580804..f37a1cbd 100644 --- a/js/3rdparty/webodf/webodf.js +++ b/js/3rdparty/webodf/webodf.js @@ -1,57 +1,57 @@ // Input 0 -var webodf_version="0.4.2-2039-gdbdc4e9"; +var webodf_version="0.4.2-2041-g9de1ecc"; // Input 1 -function Runtime(){}Runtime.prototype.getVariable=function(k){};Runtime.prototype.toJson=function(k){};Runtime.prototype.fromJson=function(k){};Runtime.prototype.byteArrayFromString=function(k,h){};Runtime.prototype.byteArrayToString=function(k,h){};Runtime.prototype.read=function(k,h,b,p){};Runtime.prototype.readFile=function(k,h,b){};Runtime.prototype.readFileSync=function(k,h){};Runtime.prototype.loadXML=function(k,h){};Runtime.prototype.writeFile=function(k,h,b){}; -Runtime.prototype.isFile=function(k,h){};Runtime.prototype.getFileSize=function(k,h){};Runtime.prototype.deleteFile=function(k,h){};Runtime.prototype.log=function(k,h){};Runtime.prototype.setTimeout=function(k,h){};Runtime.prototype.clearTimeout=function(k){};Runtime.prototype.libraryPaths=function(){};Runtime.prototype.currentDirectory=function(){};Runtime.prototype.setCurrentDirectory=function(k){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){}; -Runtime.prototype.parseXML=function(k){};Runtime.prototype.exit=function(k){};Runtime.prototype.getWindow=function(){};Runtime.prototype.requestAnimationFrame=function(k){};Runtime.prototype.cancelAnimationFrame=function(k){};Runtime.prototype.assert=function(k,h,b){};var IS_COMPILED_CODE=!0; -Runtime.byteArrayToString=function(k,h){function b(b){var g="",q,d=b.length;for(q=0;qf?l.push(f):(q+=1,c=b[q],194<=f&&224>f?l.push((f&31)<<6|c&63):(q+=1,a=b[q],224<=f&&240>f?l.push((f&15)<<12|(c&63)<<6|a&63):(q+=1,m=b[q],240<=f&&245>f&&(f=(f&7)<<18|(c&63)<<12|(a&63)<<6|m&63,f-=65536,l.push((f>>10)+55296,(f&1023)+56320))))),1E3===l.length&&(g+=String.fromCharCode.apply(null, -l),l.length=0);return g+String.fromCharCode.apply(null,l)}var d;"utf8"===h?d=p(k):("binary"!==h&&this.log("Unsupported encoding: "+h),d=b(k));return d};Runtime.getVariable=function(k){try{return eval(k)}catch(h){}};Runtime.toJson=function(k){return JSON.stringify(k)};Runtime.fromJson=function(k){return JSON.parse(k)};Runtime.getFunctionName=function(k){return void 0===k.name?(k=/function\s+(\w+)/.exec(k))&&k[1]:k.name}; -function BrowserRuntime(k){function h(f){var c=f.length,a,m,e=0;for(a=0;am&&(e+=1,a+=1);return e}function b(f,c,a){var m=f.length,e,b;c=new Uint8Array(new ArrayBuffer(c));a?(c[0]=239,c[1]=187,c[2]=191,b=3):b=0;for(a=0;ae?(c[b]=e,b+=1):2048>e?(c[b]=192|e>>>6,c[b+1]=128|e&63,b+=2):55040>=e||57344<=e?(c[b]=224|e>>>12&15,c[b+1]=128|e>>>6&63,c[b+2]=128|e&63,b+=3):(a+=1,e=(e-55296<<10|f.charCodeAt(a)-56320)+65536, -c[b]=240|e>>>18&7,c[b+1]=128|e>>>12&63,c[b+2]=128|e>>>6&63,c[b+3]=128|e&63,b+=4);return c}function p(f){var c=f.length,a=new Uint8Array(new ArrayBuffer(c)),m;for(m=0;mm.status||0===m.status?a(null):a("Status "+String(m.status)+": "+m.responseText||m.statusText):a("File "+f+" is empty."))};e=c.buffer&&!m.sendAsBinary?c.buffer:r.byteArrayToString(c,"binary");try{m.sendAsBinary?m.sendAsBinary(e):m.send(e)}catch(b){r.log("HUH? "+b+" "+c),a(b.message)}};this.deleteFile=function(f,c){delete l[f];var a=new XMLHttpRequest;a.open("DELETE",f,!0);a.onreadystatechange= -function(){4===a.readyState&&(200>a.status&&300<=a.status?c(a.responseText):c(null))};a.send(null)};this.loadXML=function(f,c){var a=new XMLHttpRequest;a.open("GET",f,!0);a.overrideMimeType&&a.overrideMimeType("text/xml");a.onreadystatechange=function(){4===a.readyState&&(0!==a.status||a.responseText?200===a.status||0===a.status?c(null,a.responseXML):c(a.responseText,null):c("File "+f+" is empty.",null))};try{a.send(null)}catch(m){c(m.message,null)}};this.isFile=function(f,c){r.getFileSize(f,function(a){c(-1!== -a)})};this.getFileSize=function(f,c){if(l.hasOwnProperty(f)&&"string"!==typeof l[f])c(l[f].length);else{var a=new XMLHttpRequest;a.open("HEAD",f,!0);a.onreadystatechange=function(){if(4===a.readyState){var m=a.getResponseHeader("Content-Length");m?c(parseInt(m,10)):q(f,"binary",function(a,f){a?c(-1):c(f.length)})}};a.send(null)}};this.log=d;this.assert=function(f,c,a){if(!f)throw d("alert","ASSERTION FAILED:\n"+c),a&&a(),c;};this.setTimeout=function(f,c){return setTimeout(function(){f()},c)};this.clearTimeout= -function(f){clearTimeout(f)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.currentDirectory=function(){return""};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(f){return(new DOMParser).parseFromString(f,"text/xml")};this.exit=function(f){d("Calling exit with code "+String(f)+", but exit() is not implemented.")};this.getWindow=function(){return window};this.requestAnimationFrame= -function(f){var c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,a=0;if(c)c.bind(window),a=c(f);else return setTimeout(f,15);return a};this.cancelAnimationFrame=function(f){var c=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame;c?(c.bind(window),c(f)):clearTimeout(f)}} -function NodeJSRuntime(){function k(b){var l=b.length,f,c=new Uint8Array(new ArrayBuffer(l));for(f=0;f").implementation} -function RhinoRuntime(){function k(b,g){var l;void 0!==g?l=b:g=b;"alert"===l&&print("\n!!!!! ALERT !!!!!");print(g);"alert"===l&&print("!!!!! ALERT !!!!!")}var h=this,b={},p=b.javax.xml.parsers.DocumentBuilderFactory.newInstance(),d,n,g="";p.setValidating(!1);p.setNamespaceAware(!0);p.setExpandEntityReferences(!1);p.setSchema(null);n=b.org.xml.sax.EntityResolver({resolveEntity:function(q,g){var l=new b.java.io.FileReader(g);return new b.org.xml.sax.InputSource(l)}});d=p.newDocumentBuilder();d.setEntityResolver(n); -this.byteArrayFromString=function(b,g){var l,f=b.length,c=new Uint8Array(new ArrayBuffer(f));for(l=0;lr?f.push(r):(l+=1,a=b[l],194<=r&&224>r?f.push((r&31)<<6|a&63):(l+=1,c=b[l],224<=r&&240>r?f.push((r&15)<<12|(a&63)<<6|c&63):(l+=1,k=b[l],240<=r&&245>r&&(r=(r&7)<<18|(a&63)<<12|(c&63)<<6|k&63,r-=65536,f.push((r>>10)+55296,(r&1023)+56320))))),1E3===f.length&&(d+=String.fromCharCode.apply(null, +f),f.length=0);return d+String.fromCharCode.apply(null,f)}var d;"utf8"===h?d=g(m):("binary"!==h&&this.log("Unsupported encoding: "+h),d=b(m));return d};Runtime.getVariable=function(m){try{return eval(m)}catch(h){}};Runtime.toJson=function(m){return JSON.stringify(m)};Runtime.fromJson=function(m){return JSON.parse(m)};Runtime.getFunctionName=function(m){return void 0===m.name?(m=/function\s+(\w+)/.exec(m))&&m[1]:m.name}; +function BrowserRuntime(m){function h(r){var a=r.length,c,k,e=0;for(c=0;ck&&(e+=1,c+=1);return e}function b(r,a,c){var k=r.length,e,b;a=new Uint8Array(new ArrayBuffer(a));c?(a[0]=239,a[1]=187,a[2]=191,b=3):b=0;for(c=0;ce?(a[b]=e,b+=1):2048>e?(a[b]=192|e>>>6,a[b+1]=128|e&63,b+=2):55040>=e||57344<=e?(a[b]=224|e>>>12&15,a[b+1]=128|e>>>6&63,a[b+2]=128|e&63,b+=3):(c+=1,e=(e-55296<<10|r.charCodeAt(c)-56320)+65536, +a[b]=240|e>>>18&7,a[b+1]=128|e>>>12&63,a[b+2]=128|e>>>6&63,a[b+3]=128|e&63,b+=4);return a}function g(b){var a=b.length,c=new Uint8Array(new ArrayBuffer(a)),k;for(k=0;kk.status||0===k.status?c(null):c("Status "+String(k.status)+": "+k.responseText||k.statusText):c("File "+b+" is empty."))};e=a.buffer&&!k.sendAsBinary?a.buffer:q.byteArrayToString(a,"binary");try{k.sendAsBinary?k.sendAsBinary(e):k.send(e)}catch(l){q.log("HUH? "+l+" "+a),c(l.message)}};this.deleteFile=function(b,a){delete f[b];var c=new XMLHttpRequest;c.open("DELETE",b,!0);c.onreadystatechange= +function(){4===c.readyState&&(200>c.status&&300<=c.status?a(c.responseText):a(null))};c.send(null)};this.loadXML=function(b,a){var c=new XMLHttpRequest;c.open("GET",b,!0);c.overrideMimeType&&c.overrideMimeType("text/xml");c.onreadystatechange=function(){4===c.readyState&&(0!==c.status||c.responseText?200===c.status||0===c.status?a(null,c.responseXML):a(c.responseText,null):a("File "+b+" is empty.",null))};try{c.send(null)}catch(k){a(k.message,null)}};this.isFile=function(b,a){q.getFileSize(b,function(c){a(-1!== +c)})};this.getFileSize=function(b,a){if(f.hasOwnProperty(b)&&"string"!==typeof f[b])a(f[b].length);else{var c=new XMLHttpRequest;c.open("HEAD",b,!0);c.onreadystatechange=function(){if(4===c.readyState){var k=c.getResponseHeader("Content-Length");k?a(parseInt(k,10)):l(b,"binary",function(c,k){c?a(-1):a(k.length)})}};c.send(null)}};this.log=d;this.assert=function(b,a,c){if(!b)throw d("alert","ASSERTION FAILED:\n"+a),c&&c(),a;};this.setTimeout=function(b,a){return setTimeout(function(){b()},a)};this.clearTimeout= +function(b){clearTimeout(b)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.currentDirectory=function(){return""};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(b){return(new DOMParser).parseFromString(b,"text/xml")};this.exit=function(b){d("Calling exit with code "+String(b)+", but exit() is not implemented.")};this.getWindow=function(){return window};this.requestAnimationFrame= +function(b){var a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,c=0;if(a)a.bind(window),c=a(b);else return setTimeout(b,15);return c};this.cancelAnimationFrame=function(b){var a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame;a?(a.bind(window),a(b)):clearTimeout(b)}} +function NodeJSRuntime(){function m(b){var f=b.length,l,a=new Uint8Array(new ArrayBuffer(f));for(l=0;l").implementation} +function RhinoRuntime(){function m(b,d){var f;void 0!==d?f=b:d=b;"alert"===f&&print("\n!!!!! ALERT !!!!!");print(d);"alert"===f&&print("!!!!! ALERT !!!!!")}var h=this,b={},g=b.javax.xml.parsers.DocumentBuilderFactory.newInstance(),d,p,n="";g.setValidating(!1);g.setNamespaceAware(!0);g.setExpandEntityReferences(!1);g.setSchema(null);p=b.org.xml.sax.EntityResolver({resolveEntity:function(l,d){var f=new b.java.io.FileReader(d);return new b.org.xml.sax.InputSource(f)}});d=g.newDocumentBuilder();d.setEntityResolver(p); +this.byteArrayFromString=function(b,d){var f,n=b.length,a=new Uint8Array(new ArrayBuffer(n));for(f=0;f>>18],e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>12&63],e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6&63],e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c& -63];f===b+1?(c=a[f]<<4,e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6],e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c&63],e+="=="):f===b&&(c=a[f]<<10|a[f+1]<<2,e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>12],e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6&63],e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c&63],e+="=");return e}function b(a){a=a.replace(/[^A-Za-z0-9+\/]+/g, -"");var c=a.length,f=new Uint8Array(new ArrayBuffer(3*c)),b=a.length%4,m=0,d,g;for(d=0;d>16,f[m+1]=g>>8&255,f[m+2]=g&255,m+=3;c=3*c-[0,0,2,1][b];return f.subarray(0,c)}function p(a){var c,e,f=a.length,b=0,m=new Uint8Array(new ArrayBuffer(3*f));for(c=0;ce?m[b++]=e:(2048>e?m[b++]=192|e>>>6:(m[b++]=224|e>>>12&15,m[b++]=128|e>>>6&63),m[b++]=128|e&63);return m.subarray(0, -b)}function d(a){var c,e,f,b,m=a.length,d=new Uint8Array(new ArrayBuffer(m)),g=0;for(c=0;ce?d[g++]=e:(c+=1,f=a[c],224>e?d[g++]=(e&31)<<6|f&63:(c+=1,b=a[c],d[g++]=(e&15)<<12|(f&63)<<6|b&63));return d.subarray(0,g)}function n(a){return h(k(a))}function g(a){return String.fromCharCode.apply(String,b(a))}function q(a){return d(k(a))}function r(a){a=d(a);for(var c="",e=0;ec?d+=String.fromCharCode(c):(m+=1,f=a.charCodeAt(m)&255,224>c?d+=String.fromCharCode((c&31)<<6|f&63):(m+=1,b=a.charCodeAt(m)&255,d+=String.fromCharCode((c&15)<<12|(f&63)<<6|b&63)));return d}function f(a,c){function e(){var m=b+1E5;m>a.length&&(m=a.length);f+=l(a,b,m);b=m;m=b===a.length;c(f,m)&&!m&&runtime.setTimeout(e,0)}var f="",b=0;1E5>a.length?c(l(a,0,a.length),!0):("string"!==typeof a&&(a=a.slice()),e())}function c(a){return p(k(a))}function a(a){return String.fromCharCode.apply(String, -p(a))}function m(a){return String.fromCharCode.apply(String,p(k(a)))}var e=function(a){var c={},e,f;e=0;for(f=a.length;e>>18],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>12&63],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6&63],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c& +63];b===e+1?(c=a[b]<<4,k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c&63],k+="=="):b===e&&(c=a[b]<<10|a[b+1]<<2,k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>12],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6&63],k+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c&63],k+="=");return k}function b(a){a=a.replace(/[^A-Za-z0-9+\/]+/g, +"");var c=a.length,k=new Uint8Array(new ArrayBuffer(3*c)),b=a.length%4,d=0,f,g;for(f=0;f>16,k[d+1]=g>>8&255,k[d+2]=g&255,d+=3;c=3*c-[0,0,2,1][b];return k.subarray(0,c)}function g(a){var c,k,b=a.length,e=0,d=new Uint8Array(new ArrayBuffer(3*b));for(c=0;ck?d[e++]=k:(2048>k?d[e++]=192|k>>>6:(d[e++]=224|k>>>12&15,d[e++]=128|k>>>6&63),d[e++]=128|k&63);return d.subarray(0, +e)}function d(a){var c,k,b,e,d=a.length,f=new Uint8Array(new ArrayBuffer(d)),g=0;for(c=0;ck?f[g++]=k:(c+=1,b=a[c],224>k?f[g++]=(k&31)<<6|b&63:(c+=1,e=a[c],f[g++]=(k&15)<<12|(b&63)<<6|e&63));return f.subarray(0,g)}function p(a){return h(m(a))}function n(a){return String.fromCharCode.apply(String,b(a))}function l(a){return d(m(a))}function q(a){a=d(a);for(var c="",k=0;kc?f+=String.fromCharCode(c):(d+=1,b=a.charCodeAt(d)&255,224>c?f+=String.fromCharCode((c&31)<<6|b&63):(d+=1,e=a.charCodeAt(d)&255,f+=String.fromCharCode((c&15)<<12|(b&63)<<6|e&63)));return f}function r(a,c){function k(){var d=e+1E5;d>a.length&&(d=a.length);b+=f(a,e,d);e=d;d=e===a.length;c(b,d)&&!d&&runtime.setTimeout(k,0)}var b="",e=0;1E5>a.length?c(f(a,0,a.length),!0):("string"!==typeof a&&(a=a.slice()),k())}function a(a){return g(m(a))}function c(a){return String.fromCharCode.apply(String, +g(a))}function k(a){return String.fromCharCode.apply(String,g(m(a)))}var e=function(a){var c={},k,b;k=0;for(b=a.length;kd-p&&(d=Math.max(2*d,p+b),b=new Uint8Array(new ArrayBuffer(d)),b.set(n),n=b)}var b=this,p=0,d=1024,n=new Uint8Array(new ArrayBuffer(d));this.appendByteArrayWriter=function(d){b.appendByteArray(d.getByteArray())};this.appendByteArray=function(b){var d=b.length;h(d);n.set(b,p);p+=d};this.appendArray=function(b){var d=b.length;h(d);n.set(b,p);p+=d};this.appendUInt16LE=function(d){b.appendArray([d&255,d>>8&255])};this.appendUInt32LE=function(d){b.appendArray([d& -255,d>>8&255,d>>16&255,d>>24&255])};this.appendString=function(d){b.appendByteArray(runtime.byteArrayFromString(d,k))};this.getLength=function(){return p};this.getByteArray=function(){var b=new Uint8Array(new ArrayBuffer(p));b.set(n.subarray(0,p));return b}}; +core.ByteArrayWriter=function(m){function h(b){b>d-g&&(d=Math.max(2*d,g+b),b=new Uint8Array(new ArrayBuffer(d)),b.set(p),p=b)}var b=this,g=0,d=1024,p=new Uint8Array(new ArrayBuffer(d));this.appendByteArrayWriter=function(d){b.appendByteArray(d.getByteArray())};this.appendByteArray=function(b){var d=b.length;h(d);p.set(b,g);g+=d};this.appendArray=function(b){var d=b.length;h(d);p.set(b,g);g+=d};this.appendUInt16LE=function(d){b.appendArray([d&255,d>>8&255])};this.appendUInt32LE=function(d){b.appendArray([d& +255,d>>8&255,d>>16&255,d>>24&255])};this.appendString=function(d){b.appendByteArray(runtime.byteArrayFromString(d,m))};this.getLength=function(){return g};this.getByteArray=function(){var b=new Uint8Array(new ArrayBuffer(g));b.set(p.subarray(0,g));return b}}; // Input 6 -core.CSSUnits=function(){var k=this,h={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(b,k,d){return b*h[d]/h[k]};this.convertMeasure=function(b,h){var d,n;b&&h?(d=parseFloat(b),n=b.replace(d.toString(),""),d=k.convert(d,n,h).toString()):d="";return d};this.getUnits=function(b){return b.substr(b.length-2,b.length)}}; +core.CSSUnits=function(){var m=this,h={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(b,g,d){return b*h[d]/h[g]};this.convertMeasure=function(b,g){var d,h;b&&g?(d=parseFloat(b),h=b.replace(d.toString(),""),d=m.convert(d,h,g).toString()):d="";return d};this.getUnits=function(b){return b.substr(b.length-2,b.length)}}; // Input 7 /* @@ -90,24 +90,24 @@ core.CSSUnits=function(){var k=this,h={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this. @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -(function(){function k(){var b,k,d,n,g,q,r,l,f;void 0===h&&(k=(b=runtime.getWindow())&&b.document,q=k.documentElement,r=k.body,h={rangeBCRIgnoresElementBCR:!1,unscaledRangeClientRects:!1,elementBCRIgnoresBodyScroll:!1},k&&(n=k.createElement("div"),n.style.position="absolute",n.style.left="-99999px",n.style.transform="scale(2)",n.style["-webkit-transform"]="scale(2)",g=k.createElement("div"),n.appendChild(g),r.appendChild(n),b=k.createRange(),b.selectNode(g),h.rangeBCRIgnoresElementBCR=0===b.getClientRects().length, -g.appendChild(k.createTextNode("Rect transform test")),k=g.getBoundingClientRect(),d=b.getBoundingClientRect(),h.unscaledRangeClientRects=2=f.compareBoundaryPoints(Range.START_TO_START,c)&&0<=f.compareBoundaryPoints(Range.END_TO_END, -c)}function d(f,c){var a=null;f.nodeType===Node.TEXT_NODE&&(0===f.length?(f.parentNode.removeChild(f),c.nodeType===Node.TEXT_NODE&&(a=c)):(c.nodeType===Node.TEXT_NODE&&(f.appendData(c.data),c.parentNode.removeChild(c)),a=f));return a}function n(f){for(var c=f.parentNode;f.firstChild;)c.insertBefore(f.firstChild,f);c.removeChild(f);return c}function g(f,c){for(var a=f.parentNode,b=f.firstChild,e;b;)e=b.nextSibling,g(b,c),b=e;a&&c(f)&&n(f);return a}function q(b,c){return b===c||Boolean(b.compareDocumentPosition(c)& -Node.DOCUMENT_POSITION_CONTAINED_BY)}function r(b,c,a){Object.keys(c).forEach(function(m){var e=m.split(":"),d=e[1],l=a(e[0]),e=c[m],g=typeof e;"object"===g?Object.keys(e).length&&(m=l?b.getElementsByTagNameNS(l,d)[0]||b.ownerDocument.createElementNS(l,m):b.getElementsByTagName(d)[0]||b.ownerDocument.createElement(m),b.appendChild(m),r(m,e,a)):l&&(runtime.assert("number"===g||"string"===g,"attempting to map unsupported type '"+g+"' (key: "+m+")"),b.setAttributeNS(l,m,String(e)))})}var l=null;this.splitBoundaries= -function(f){var c,a=[],m,e,d;if(f.startContainer.nodeType===Node.TEXT_NODE||f.endContainer.nodeType===Node.TEXT_NODE){m=f.endContainer;e=f.endContainer.nodeType!==Node.TEXT_NODE?f.endOffset===f.endContainer.childNodes.length:!1;d=f.endOffset;c=f.endContainer;if(d=b.compareBoundaryPoints(Range.END_TO_START, -c)&&0<=b.compareBoundaryPoints(Range.START_TO_END,c)};this.getNodesInRange=function(b,c,a){var m=[],e=b.commonAncestorContainer;a=b.startContainer.ownerDocument.createTreeWalker(e.nodeType===Node.TEXT_NODE?e.parentNode:e,a,c,!1);var d;b.endContainer.childNodes[b.endOffset-1]?(e=b.endContainer.childNodes[b.endOffset-1],d=Node.DOCUMENT_POSITION_PRECEDING|Node.DOCUMENT_POSITION_CONTAINED_BY):(e=b.endContainer,d=Node.DOCUMENT_POSITION_PRECEDING);b.startContainer.childNodes[b.startOffset]?(b=b.startContainer.childNodes[b.startOffset], -a.currentNode=b):b.startOffset===(b.startContainer.nodeType===Node.TEXT_NODE?b.startContainer.length:b.startContainer.childNodes.length)?(b=b.startContainer,a.currentNode=b,a.lastChild(),b=a.nextNode()):(b=b.startContainer,a.currentNode=b);b&&c(b)===NodeFilter.FILTER_ACCEPT&&m.push(b);for(b=a.nextNode();b;){c=e.compareDocumentPosition(b);if(0!==c&&0===(c&d))break;m.push(b);b=a.nextNode()}return m};this.normalizeTextNodes=function(b){b&&b.nextSibling&&(b=d(b,b.nextSibling));b&&b.previousSibling&&d(b.previousSibling, -b)};this.rangeContainsNode=function(b,c){var a=c.ownerDocument.createRange(),m=c.ownerDocument.createRange(),e;a.setStart(b.startContainer,b.startOffset);a.setEnd(b.endContainer,b.endOffset);m.selectNodeContents(c);e=h(a,m);a.detach();m.detach();return e};this.mergeIntoParent=n;this.removeUnwantedNodes=g;this.getElementsByTagNameNS=function(b,c,a){var m=[];b=b.getElementsByTagNameNS(c,a);m.length=a=b.length;for(c=0;c=a.compareBoundaryPoints(Range.START_TO_START,c)&&0<=a.compareBoundaryPoints(Range.END_TO_END,c)}function p(a,c){var k=null;a.nodeType===Node.TEXT_NODE&&(0===a.length?(a.parentNode.removeChild(a),c.nodeType===Node.TEXT_NODE&&(k=c)):(c.nodeType===Node.TEXT_NODE&&(a.appendData(c.data),c.parentNode.removeChild(c)),k=a));return k}function n(a){for(var c=a.parentNode;a.firstChild;)c.insertBefore(a.firstChild,a);c.removeChild(a);return c}function l(a, +c){for(var k=a.parentNode,b=a.firstChild,d;b;)d=b.nextSibling,l(b,c),b=d;k&&c(a)&&n(a);return k}function q(a,c){return a===c||Boolean(a.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY)}function f(a,c,b){Object.keys(c).forEach(function(e){var d=e.split(":"),g=d[1],l=b(d[0]),d=c[e],h=typeof d;"object"===h?Object.keys(d).length&&(e=l?a.getElementsByTagNameNS(l,g)[0]||a.ownerDocument.createElementNS(l,e):a.getElementsByTagName(g)[0]||a.ownerDocument.createElement(e),a.appendChild(e),f(e, +d,b)):l&&(runtime.assert("number"===h||"string"===h,"attempting to map unsupported type '"+h+"' (key: "+e+")"),a.setAttributeNS(l,e,String(d)))})}var r=null;this.splitBoundaries=function(a){var c,k=[],e,d,f;if(a.startContainer.nodeType===Node.TEXT_NODE||a.endContainer.nodeType===Node.TEXT_NODE){e=a.endContainer;d=a.endContainer.nodeType!==Node.TEXT_NODE?a.endOffset===a.endContainer.childNodes.length:!1;f=a.endOffset;c=a.endContainer;if(f=a.compareBoundaryPoints(Range.END_TO_START,c)&&0<=a.compareBoundaryPoints(Range.START_TO_END,c)};this.getNodesInRange=function(a,c,b){var e=[],d=a.commonAncestorContainer;b=a.startContainer.ownerDocument.createTreeWalker(d.nodeType===Node.TEXT_NODE?d.parentNode:d,b,c,!1);var f;a.endContainer.childNodes[a.endOffset-1]?(d=a.endContainer.childNodes[a.endOffset- +1],f=Node.DOCUMENT_POSITION_PRECEDING|Node.DOCUMENT_POSITION_CONTAINED_BY):(d=a.endContainer,f=Node.DOCUMENT_POSITION_PRECEDING);a.startContainer.childNodes[a.startOffset]?(a=a.startContainer.childNodes[a.startOffset],b.currentNode=a):a.startOffset===(a.startContainer.nodeType===Node.TEXT_NODE?a.startContainer.length:a.startContainer.childNodes.length)?(a=a.startContainer,b.currentNode=a,b.lastChild(),a=b.nextNode()):(a=a.startContainer,b.currentNode=a);a&&c(a)===NodeFilter.FILTER_ACCEPT&&e.push(a); +for(a=b.nextNode();a;){c=d.compareDocumentPosition(a);if(0!==c&&0===(c&f))break;e.push(a);a=b.nextNode()}return e};this.normalizeTextNodes=function(a){a&&a.nextSibling&&(a=p(a,a.nextSibling));a&&a.previousSibling&&p(a.previousSibling,a)};this.rangeContainsNode=function(a,c){var b=c.ownerDocument.createRange(),e=c.ownerDocument.createRange(),f;b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset);e.selectNodeContents(c);f=d(b,e);b.detach();e.detach();return f};this.mergeIntoParent= +n;this.removeUnwantedNodes=l;this.getElementsByTagNameNS=function(a,c,b){var e=[];a=a.getElementsByTagNameNS(c,b);e.length=b=a.length;for(c=0;ck))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0h))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; +core.LoopWatchDog=function(m,h){var b=Date.now(),g=0;this.check=function(){var d;if(m&&(d=Date.now(),d-b>m))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0h))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; // Input 12 -core.PositionIterator=function(k,h,b,p){function d(){this.acceptNode=function(a){return!a||a.nodeType===m&&0===a.length?w:t}}function n(a){this.acceptNode=function(c){return!c||c.nodeType===m&&0===c.length?w:a.acceptNode(c)}}function g(){var a=f.currentNode,b=a.nodeType;c=b===m?a.length-1:b===e?1:0}function q(){if(null===f.previousSibling()){if(!f.parentNode()||f.currentNode===k)return f.firstChild(),!1;c=0}else g();return!0}function r(){var b=f.currentNode,e;e=a(b);if(b!==k)for(b=b.parentNode;b&& -b!==k;)a(b)===w&&(f.currentNode=b,e=w),b=b.parentNode;e===w?(c=1,b=l.nextPosition()):b=e===t?!0:l.nextPosition();b&&runtime.assert(a(f.currentNode)===t,"moveToAcceptedNode did not result in walker being on an accepted node");return b}var l=this,f,c,a,m=Node.TEXT_NODE,e=Node.ELEMENT_NODE,t=NodeFilter.FILTER_ACCEPT,w=NodeFilter.FILTER_REJECT;this.nextPosition=function(){var a=f.currentNode,b=a.nodeType;if(a===k)return!1;if(0===c&&b===e)null===f.firstChild()&&(c=1);else if(b===m&&c+1 "+a.length), -runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"),b===a.length&&(f.nextSibling()?c=0:f.parentNode()?c=1:runtime.assert(!1,"Error in setUnfilteredPosition: position not valid.")),!0;b "+c.length), +runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"),b===c.length&&(r.nextSibling()?a=0:r.parentNode()?a=1:runtime.assert(!1,"Error in setUnfilteredPosition: position not valid.")),!0;bA&&(f=A);for(D=1<D){this.status=2;this.m=f;return}D-=d[A];if(0>D)this.status=2,this.m=f;else{d[A]+=D;G[1]=n=0;F=d;t=1;for(r=2;0<--A;)n+=F[t++],G[r++]=n;F=a;A=t=0;do n=F[t++],0!==n&&(k[G[n]++]=A);while(++Av+p[1+k];){v+= -p[1+k];k++;u=h-v;u=u>f?f:u;n=q-v;g=1<a+1)for(g-=a+1,r=q;++nl&&v>v-p[k],J[k-1][n].e=s.e,J[k-1][n].b=s.b,J[k-1][n].n=s.n,J[k-1][n].t=s.t)}s.b=q-v;t>=c?s.e=99:F[t]F[t]?16:15,s.n=F[t++]):(s.e=m[F[t]-b],s.n=e[F[t++]- -b]);g=1<>v;n>=1)A^=n;for(A^=n;(A&(1<>=b;a-=b}function d(a,c,e){var f,d,l;if(0===e)return 0;for(l=0;;){h(v);d=z.list[b(v)];for(f=d.e;16f;f++)t[K[f]]=0;v= -7;f=new k(t,19,19,null,null,v);if(0!==f.status)return-1;z=f.root;v=f.m;g=n+q;for(m=l=0;mf)t[m++]=l=f;else if(16===f){h(2);f=3+b(2);p(2);if(m+f>g)return-1;for(;0g)return-1;for(;0I;I++)R[I]=8;for(I=144;256>I;I++)R[I]=9;for(I=256;280>I;I++)R[I]=7;for(I=280;288>I;I++)R[I]=8;f=7;I=new k(R,288,257,G,D,f);if(0!==I.status){alert("HufBuild error: "+I.status);y=-1;break b}r=I.root;f=I.m;for(I=0;30>I;I++)R[I]= -5;Z=5;I=new k(R,30,0,F,O,Z);if(1p&&(d=p);for(w=1<w){this.status=2;this.m=d;return}w-=f[p];if(0>w)this.status=2,this.m=d;else{f[p]+=w;H[1]=m=0;F=f;s=1;for(u=2;0<--p;)m+=F[s++],H[u++]=m;F=a;p=s=0;do m=F[s++],0!==m&&(n[H[m]++]=p);while(++pI+r[1+n];){I+= +r[1+n];n++;v=h-I;v=v>d?d:v;m=C-I;g=1<a+1)for(g-=a+1,u=C;++ml&&I>I-r[n],t[n-1][m].e=q.e,t[n-1][m].b=q.b,t[n-1][m].n=q.n,t[n-1][m].t=q.t)}q.b=C-I;s>=c?q.e=99:F[s]F[s]?16:15,q.n=F[s++]):(q.e=e[F[s]-b],q.n=k[F[s++]- +b]);g=1<>I;m>=1)p^=m;for(p^=m;(p&(1<>=b;c-=b}function d(a,c,e){var d,f,p;if(0===e)return 0;for(p=0;;){h(t);f=z.list[b(t)];for(d=f.e;16f;f++)s[K[f]]=0;t= +7;f=new m(s,19,19,null,null,t);if(0!==f.status)return-1;z=f.root;t=f.m;p=C+r;for(e=l=0;ef)s[e++]=l=f;else if(16===f){h(2);f=3+b(2);g(2);if(e+f>p)return-1;for(;0p)return-1;for(;0J;J++)R[J]=8;for(J=144;256>J;J++)R[J]=9;for(J=256;280>J;J++)R[J]=7;for(J=280;288>J;J++)R[J]=8;r=7;J=new m(R,288,257,H,D,r);if(0!==J.status){alert("HufBuild error: "+J.status);y=-1;break b}q=J.root;r=J.m;for(J=0;30>J;J++)R[J]= +5;Z=5;J=new m(R,30,0,F,O,Z);if(1";return runtime.parseXML(b)}; -core.UnitTestLogger=function(){var k=[],h=0,b=0,p="",d="";this.startTest=function(n,g){k=[];h=0;p=n;d=g;b=(new Date).getTime()};this.endTest=function(){var n=(new Date).getTime();return{description:d,suite:[p,d],success:0===h,log:k,time:n-b}};this.debug=function(b){k.push({category:"debug",message:b})};this.fail=function(b){h+=1;k.push({category:"fail",message:b})};this.pass=function(b){k.push({category:"pass",message:b})}}; -core.UnitTestRunner=function(k,h){function b(a){r+=1;c?h.debug(a):h.fail(a)}function p(a,c){var e;try{if(a.length!==c.length)return b("array of length "+a.length+" should be "+c.length+" long"),!1;for(e=0;e1/d?"-0":String(d),b(c+" should be "+a+". Was "+e+".")):b(c+" should be "+a+" (of type "+typeof a+"). Was "+d+" (of type "+typeof d+").")}var r=0,l,f,c=!1;this.resourcePrefix=function(){return k};this.beginExpectFail=function(){l=r;c=!0};this.endExpectFail=function(){var a=l===r;c=!1;r=l;a&&(r+=1,h.fail("Expected at least one failed test, but none registered."))};f=function(a,c){var e=Object.keys(a),f=Object.keys(c);e.sort(); -f.sort();return p(e,f)&&Object.keys(a).every(function(e){var f=a[e],d=c[e];return g(f,d)?!0:(b(f+" should be "+d+" for key "+e),!1)})};this.areNodesEqual=n;this.shouldBeNull=function(a,c){q(a,c,"null")};this.shouldBeNonNull=function(a,c){var e,f;try{f=eval(c)}catch(d){e=d}e?b(c+" should be non-null. Threw exception "+e):null!==f?h.pass(c+" is non-null."):b(c+" should be non-null. Was "+f)};this.shouldBe=q;this.testFailed=b;this.countFailedTests=function(){return r};this.name=function(a){var c,b,f= -[],d=a.length;f.length=d;for(c=0;c"+b+""}function h(d){b.reporter&&b.reporter(d)}var b=this,p=0,d=new core.UnitTestLogger,n={},g="BrowserRuntime"===runtime.type();this.resourcePrefix="";this.reporter=function(b){var d,l;g?runtime.log("Running "+k(b.description,'runTest("'+b.suite[0]+'","'+b.description+'")')+""):runtime.log("Running "+b.description);if(!b.success)for(d=0;dRunning "+k(c,'runSuite("'+c+'");')+": "+m.description()+""):runtime.log("Running "+c+": "+m.description);z=m.tests();for(t=0;t";return runtime.parseXML(b)}; +core.UnitTestLogger=function(){var m=[],h=0,b=0,g="",d="";this.startTest=function(p,n){m=[];h=0;g=p;d=n;b=(new Date).getTime()};this.endTest=function(){var p=(new Date).getTime();return{description:d,suite:[g,d],success:0===h,log:m,time:p-b}};this.debug=function(b){m.push({category:"debug",message:b})};this.fail=function(b){h+=1;m.push({category:"fail",message:b})};this.pass=function(b){m.push({category:"pass",message:b})}}; +core.UnitTestRunner=function(m,h){function b(c){q+=1;a?h.debug(c):h.fail(c)}function g(a,k){var e;try{if(a.length!==k.length)return b("array of length "+a.length+" should be "+k.length+" long"),!1;for(e=0;e1/f?"-0":String(f),b(k+" should be "+a+". Was "+e+".")):b(k+" should be "+a+" (of type "+typeof a+"). Was "+f+" (of type "+typeof f+").")}var q=0,f,r,a=!1;this.resourcePrefix=function(){return m};this.beginExpectFail=function(){f=q;a=!0};this.endExpectFail=function(){var c=f===q;a=!1;q=f;c&&(q+=1,h.fail("Expected at least one failed test, but none registered."))};r=function(a,k){var e=Object.keys(a),d=Object.keys(k);e.sort(); +d.sort();return g(e,d)&&Object.keys(a).every(function(e){var d=a[e],f=k[e];return n(d,f)?!0:(b(d+" should be "+f+" for key "+e),!1)})};this.areNodesEqual=p;this.shouldBeNull=function(a,b){l(a,b,"null")};this.shouldBeNonNull=function(a,k){var e,d;try{d=eval(k)}catch(f){e=f}e?b(k+" should be non-null. Threw exception "+e):null!==d?h.pass(k+" is non-null."):b(k+" should be non-null. Was "+d)};this.shouldBe=l;this.testFailed=b;this.countFailedTests=function(){return q};this.name=function(a){var b,e,d= +[],f=a.length;d.length=f;for(b=0;b"+b+""}function h(d){b.reporter&&b.reporter(d)}var b=this,g=0,d=new core.UnitTestLogger,p={},n="BrowserRuntime"===runtime.type();this.resourcePrefix="";this.reporter=function(b){var d,f;n?runtime.log("Running "+m(b.description,'runTest("'+b.suite[0]+'","'+b.description+'")')+""):runtime.log("Running "+b.description);if(!b.success)for(d=0;dRunning "+m(a,'runSuite("'+a+'");')+": "+k.description()+""):runtime.log("Running "+a+": "+k.description);z=k.tests();for(u=0;u>>8^d;return b^-1}function p(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 d(a){var c=a.getFullYear();return 1980>c?0:c-1980<< -25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function n(a,c){var b,f,d,m,l,g,n,k=this;this.load=function(c){if(null!==k.data)c(null,k.data);else{var b=l+34+f+d+256;b+n>e&&(b=e-n);runtime.read(a,n,b,function(b,e){if(b||null===e)c(b,e);else a:{var f=e,d=new core.ByteArray(f),n=d.readUInt32LE(),h;if(67324752!==n)c("File entry signature is wrong."+n.toString()+" "+f.length.toString(),null);else{d.pos+=22;n=d.readUInt16LE();h=d.readUInt16LE();d.pos+=n+h;if(m){f= -f.subarray(d.pos,d.pos+l);if(l!==f.length){c("The amount of compressed bytes read was "+f.length.toString()+" instead of "+l.toString()+" for "+k.filename+" in "+a+".",null);break a}f=w(f,g)}else f=f.subarray(d.pos,d.pos+g);g!==f.length?c("The amount of bytes read was "+f.length.toString()+" instead of "+g.toString()+" for "+k.filename+" in "+a+".",null):(k.data=f,c(null,f))}}})}};this.set=function(a,c,b,e){k.filename=a;k.data=c;k.compressed=b;k.date=e};this.error=null;c&&(b=c.readUInt32LE(),33639248!== -b?this.error="Central directory entry has wrong signature at position "+(c.pos-4).toString()+' for file "'+a+'": '+c.data.length.toString():(c.pos+=6,m=c.readUInt16LE(),this.date=p(c.readUInt32LE()),c.readUInt32LE(),l=c.readUInt32LE(),g=c.readUInt32LE(),f=c.readUInt16LE(),d=c.readUInt16LE(),b=c.readUInt16LE(),c.pos+=8,n=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.subarray(c.pos,c.pos+f),"utf8"),this.data=null,c.pos+=f+d+b))}function g(a,c){if(22!==a.length)c("Central directory length should be 22.", -z);else{var b=new core.ByteArray(a),f;f=b.readUInt32LE();101010256!==f?c("Central directory signature is wrong: "+f.toString(),z):(f=b.readUInt16LE(),0!==f?c("Zip files with non-zero disk numbers are not supported.",z):(f=b.readUInt16LE(),0!==f?c("Zip files with non-zero disk numbers are not supported.",z):(f=b.readUInt16LE(),t=b.readUInt16LE(),f!==t?c("Number of entries is inconsistent.",z):(f=b.readUInt32LE(),b=b.readUInt16LE(),b=e-22-f,runtime.read(k,b,e-b,function(a,b){if(a||null===b)c(a,z);else a:{var e= -new core.ByteArray(b),f,d;m=[];for(f=0;fe?h("File '"+k+"' cannot be read.",z):runtime.read(k,e-22,22,function(a,c){a||null===h||null===c?h(a,z): -g(c,h)})})}; +2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],b,e,d=a.length,k=0,k=0;b=-1;for(e=0;e>>8^k;return b^-1}function g(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 d(a){var c=a.getFullYear();return 1980>c?0:c-1980<< +25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function p(a,c){var b,d,k,f,l,p,n,h=this;this.load=function(c){if(null!==h.data)c(null,h.data);else{var b=l+34+d+k+256;b+n>e&&(b=e-n);runtime.read(a,n,b,function(b,e){if(b||null===e)c(b,e);else a:{var d=e,k=new core.ByteArray(d),g=k.readUInt32LE(),n;if(67324752!==g)c("File entry signature is wrong."+g.toString()+" "+d.length.toString(),null);else{k.pos+=22;g=k.readUInt16LE();n=k.readUInt16LE();k.pos+=g+n;if(f){d= +d.subarray(k.pos,k.pos+l);if(l!==d.length){c("The amount of compressed bytes read was "+d.length.toString()+" instead of "+l.toString()+" for "+h.filename+" in "+a+".",null);break a}d=w(d,p)}else d=d.subarray(k.pos,k.pos+p);p!==d.length?c("The amount of bytes read was "+d.length.toString()+" instead of "+p.toString()+" for "+h.filename+" in "+a+".",null):(h.data=d,c(null,d))}}})}};this.set=function(a,c,b,e){h.filename=a;h.data=c;h.compressed=b;h.date=e};this.error=null;c&&(b=c.readUInt32LE(),33639248!== +b?this.error="Central directory entry has wrong signature at position "+(c.pos-4).toString()+' for file "'+a+'": '+c.data.length.toString():(c.pos+=6,f=c.readUInt16LE(),this.date=g(c.readUInt32LE()),c.readUInt32LE(),l=c.readUInt32LE(),p=c.readUInt32LE(),d=c.readUInt16LE(),k=c.readUInt16LE(),b=c.readUInt16LE(),c.pos+=8,n=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.subarray(c.pos,c.pos+d),"utf8"),this.data=null,c.pos+=d+k+b))}function n(a,c){if(22!==a.length)c("Central directory length should be 22.", +z);else{var b=new core.ByteArray(a),d;d=b.readUInt32LE();101010256!==d?c("Central directory signature is wrong: "+d.toString(),z):(d=b.readUInt16LE(),0!==d?c("Zip files with non-zero disk numbers are not supported.",z):(d=b.readUInt16LE(),0!==d?c("Zip files with non-zero disk numbers are not supported.",z):(d=b.readUInt16LE(),u=b.readUInt16LE(),d!==u?c("Number of entries is inconsistent.",z):(d=b.readUInt32LE(),b=b.readUInt16LE(),b=e-22-d,runtime.read(m,b,e-b,function(a,b){if(a||null===b)c(a,z);else a:{var d= +new core.ByteArray(b),e,f;k=[];for(e=0;ee?h("File '"+m+"' cannot be read.",z):runtime.read(m,e-22,22,function(a,c){a||null===h||null===c?h(a,z): +n(c,h)})})}; // Input 21 -xmldom.LSSerializerFilter=function(){};xmldom.LSSerializerFilter.prototype.acceptNode=function(k){}; +xmldom.LSSerializerFilter=function(){};xmldom.LSSerializerFilter.prototype.acceptNode=function(m){}; // Input 22 /* @@ -378,7 +378,7 @@ xmldom.LSSerializerFilter=function(){};xmldom.LSSerializerFilter.prototype.accep @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -odf.OdfNodeFilter=function(){this.acceptNode=function(k){return"http://www.w3.org/1999/xhtml"===k.namespaceURI?NodeFilter.FILTER_SKIP:k.namespaceURI&&k.namespaceURI.match(/^urn:webodf:/)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}; +odf.OdfNodeFilter=function(){this.acceptNode=function(m){return"http://www.w3.org/1999/xhtml"===m.namespaceURI?NodeFilter.FILTER_SKIP:m.namespaceURI&&m.namespaceURI.match(/^urn:webodf:/)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}; // Input 23 /* @@ -421,16 +421,16 @@ odf.Namespaces={namespaceMap:{db:"urn:oasis:names:tc:opendocument:xmlns:database office:"urn:oasis:names:tc:opendocument:xmlns:office:1.0",presentation:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",style:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",svg:"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",table:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",text:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},prefixMap:{},dbns:"urn:oasis:names:tc:opendocument:xmlns:database:1.0", dcns:"http://purl.org/dc/elements/1.1/",dr3dns:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",drawns:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",chartns:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0",fons:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",formns:"urn:oasis:names:tc:opendocument:xmlns:form:1.0",metans:"urn:oasis:names:tc:opendocument:xmlns:meta:1.0",numberns:"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",officens:"urn:oasis:names:tc:opendocument:xmlns:office:1.0", presentationns:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",stylens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",svgns:"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",tablens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",textns:"urn:oasis:names:tc:opendocument:xmlns:text:1.0",xlinkns:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/XML/1998/namespace"}; -(function(){var k=odf.Namespaces.namespaceMap,h=odf.Namespaces.prefixMap,b;for(b in k)k.hasOwnProperty(b)&&(h[k[b]]=b)})();odf.Namespaces.forEachPrefix=function(k){var h=odf.Namespaces.namespaceMap,b;for(b in h)h.hasOwnProperty(b)&&k(b,h[b])};odf.Namespaces.lookupNamespaceURI=function(k){var h=null;odf.Namespaces.namespaceMap.hasOwnProperty(k)&&(h=odf.Namespaces.namespaceMap[k]);return h};odf.Namespaces.lookupPrefix=function(k){var h=odf.Namespaces.prefixMap;return h.hasOwnProperty(k)?h[k]:null}; +(function(){var m=odf.Namespaces.namespaceMap,h=odf.Namespaces.prefixMap,b;for(b in m)m.hasOwnProperty(b)&&(h[m[b]]=b)})();odf.Namespaces.forEachPrefix=function(m){var h=odf.Namespaces.namespaceMap,b;for(b in h)h.hasOwnProperty(b)&&m(b,h[b])};odf.Namespaces.lookupNamespaceURI=function(m){var h=null;odf.Namespaces.namespaceMap.hasOwnProperty(m)&&(h=odf.Namespaces.namespaceMap[m]);return h};odf.Namespaces.lookupPrefix=function(m){var h=odf.Namespaces.prefixMap;return h.hasOwnProperty(m)?h[m]:null}; odf.Namespaces.lookupNamespaceURI.lookupNamespaceURI=odf.Namespaces.lookupNamespaceURI; // Input 24 xmldom.XPathIterator=function(){};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){}; -function createXPathSingleton(){function k(b,c,a){return-1!==b&&(b=g&&a.push(h(b.substring(c,d)))):"["===b[d]&&(0>=g&&(c=d+1),g+=1),d+=1;return d};r=function(b,c,a){var m,e,l,n;for(m=0;m=f&&c.push(h(b.substring(a,d)))):"["===b[d]&&(0>=f&&(a=d+1),f+=1),d+=1;return d};q=function(b,a,c){var f,e,p,h;for(f=0;f/g,">").replace(/'/g,"'").replace(/"/g,""")}function b(d,n){var g="",k=p.filter?p.filter.acceptNode(n):NodeFilter.FILTER_ACCEPT,r;if(k===NodeFilter.FILTER_ACCEPT&&n.nodeType===Node.ELEMENT_NODE){d.push();r=d.getQName(n);var l,f=n.attributes,c,a,m,e="",t;l="<"+r;c=f.length;for(a=0;a")}if(k===NodeFilter.FILTER_ACCEPT||k===NodeFilter.FILTER_SKIP){for(k=n.firstChild;k;)g+=b(d,k),k=k.nextSibling;n.nodeValue&&(g+=h(n.nodeValue))}r&&(g+="",d.pop());return g}var p=this;this.filter=null;this.writeToString=function(d,n){if(!d)return"";var g=new k(n);return b(g,d)}}; +"function"!==typeof Object.create&&(Object.create=function(m){var h=function(){};h.prototype=m;return new h}); +xmldom.LSSerializer=function(){function m(b){var g=b||{},n=function(b){var a={},c;for(c in b)b.hasOwnProperty(c)&&(a[b[c]]=c);return a}(b),l=[g],h=[n],f=0;this.push=function(){f+=1;g=l[f]=Object.create(g);n=h[f]=Object.create(n)};this.pop=function(){l.pop();h.pop();f-=1;g=l[f];n=h[f]};this.getLocalNamespaceDefinitions=function(){return n};this.getQName=function(b){var a=b.namespaceURI,c=0,d;if(!a)return b.localName;if(d=n[a])return d+":"+b.localName;do{d||!b.prefix?(d="ns"+c,c+=1):d=b.prefix;if(g[d]=== +a)break;if(!g[d]){g[d]=a;n[a]=d;break}d=null}while(null===d);return d+":"+b.localName}}function h(b){return b.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function b(d,p){var n="",l=g.filter?g.filter.acceptNode(p):NodeFilter.FILTER_ACCEPT,m;if(l===NodeFilter.FILTER_ACCEPT&&p.nodeType===Node.ELEMENT_NODE){d.push();m=d.getQName(p);var f,r=p.attributes,a,c,k,e="",u;f="<"+m;a=r.length;for(c=0;c")}if(l===NodeFilter.FILTER_ACCEPT||l===NodeFilter.FILTER_SKIP){for(l=p.firstChild;l;)n+=b(d,l),l=l.nextSibling;p.nodeValue&&(n+=h(p.nodeValue))}m&&(n+="",d.pop());return n}var g=this;this.filter=null;this.writeToString=function(d,g){if(!d)return"";var n=new m(g);return b(n,d)}}; // Input 27 /* @@ -541,35 +541,35 @@ r+">",d.pop());return g}var p=this;this.filter=null;this.writeToString=function( @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -(function(){function k(c,a,b){for(c=c?c.firstChild:null;c;){if(c.localName===b&&c.namespaceURI===a)return c;c=c.nextSibling}return null}function h(c){var a,b=r.length;for(a=0;ab)break;d=d.nextSibling}c.insertBefore(a,d)}}}var n=new odf.StyleInfo, -g=new core.DomUtils,q=odf.Namespaces.stylens,r="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),l=(new Date).getTime()+"_webodf_",f=new core.Base64;odf.ODFElement=function(){};odf.ODFDocumentElement=function(){};odf.ODFDocumentElement.prototype=new odf.ODFElement;odf.ODFDocumentElement.prototype.constructor=odf.ODFDocumentElement;odf.ODFDocumentElement.prototype.fontFaceDecls=null;odf.ODFDocumentElement.prototype.manifest=null;odf.ODFDocumentElement.prototype.settings= -null;odf.ODFDocumentElement.namespaceURI="urn:oasis:names:tc:opendocument:xmlns:office:1.0";odf.ODFDocumentElement.localName="document";odf.AnnotationElement=function(){};odf.OdfPart=function(c,a,b,e){var d=this;this.size=0;this.type=null;this.name=c;this.container=b;this.url=null;this.mimetype=a;this.onstatereadychange=this.document=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.data="";this.load=function(){null!==e&&(this.mimetype=a,e.loadAsDataURL(c,a,function(a,c){a&& -runtime.log(a);d.url=c;if(d.onchange)d.onchange(d);if(d.onstatereadychange)d.onstatereadychange(d)}))}};odf.OdfPart.prototype.load=function(){};odf.OdfPart.prototype.getUrl=function(){return this.data?"data:;base64,"+f.toBase64(this.data):null};odf.OdfContainer=function a(m,e){function h(a){for(var b=a.firstChild,e;b;)e=b.nextSibling,b.nodeType===Node.ELEMENT_NODE?h(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b),b=e}function r(a){var b={},e,d,f=a.ownerDocument.createNodeIterator(a, -NodeFilter.SHOW_ELEMENT,null,!1);for(a=f.nextNode();a;)"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&("annotation"===a.localName?(e=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","name"))&&(b.hasOwnProperty(e)?runtime.log("Warning: annotation name used more than once with : '"+e+"'"):b[e]=a):"annotation-end"===a.localName&&((e=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","name"))?b.hasOwnProperty(e)?(d=b[e],d.annotationEndElement? -runtime.log("Warning: annotation name used more than once with : '"+e+"'"):d.annotationEndElement=a):runtime.log("Warning: annotation end without an annotation start, name: '"+e+"'"):runtime.log("Warning: annotation end without a name found"))),a=f.nextNode()}function z(a,b){for(var e=a&&a.firstChild;e;)e.nodeType===Node.ELEMENT_NODE&&e.setAttributeNS("urn:webodf:names:scope","scope",b),e=e.nextSibling}function x(a){var b={},e;for(a=a.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&& -a.namespaceURI===q&&"font-face"===a.localName&&(e=a.getAttributeNS(q,"name"),b[e]=a),a=a.nextSibling;return b}function v(a,b){var e=null,d,f,m;if(a)for(e=a.cloneNode(!0),d=e.firstElementChild;d;)f=d.nextElementSibling,(m=d.getAttributeNS("urn:webodf:names:scope","scope"))&&m!==b&&e.removeChild(d),d=f;return e}function u(a,b){var e,d,f,m=null,g={};if(a)for(b.forEach(function(a){n.collectUsedFontFaces(g,a)}),m=a.cloneNode(!0),e=m.firstElementChild;e;)d=e.nextElementSibling,f=e.getAttributeNS(q,"name"), -g[f]||m.removeChild(e),e=d;return m}function s(a){var b=M.rootElement.ownerDocument,e;if(a){h(a.documentElement);try{e=b.importNode(a.documentElement,!0)}catch(d){}}return e}function A(a){M.state=a;if(M.onchange)M.onchange(M);if(M.onstatereadychange)M.onstatereadychange(M)}function J(a){U=null;M.rootElement=a;a.fontFaceDecls=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");a.styles=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles");a.automaticStyles=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0", -"automatic-styles");a.masterStyles=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles");a.body=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");a.meta=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta");r(a)}function G(b){var e=s(b),f=M.rootElement,m;e&&"document-styles"===e.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===e.namespaceURI?(f.fontFaceDecls=k(e,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls"),d(f,f.fontFaceDecls), -m=k(e,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles"),f.styles=m||b.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles"),d(f,f.styles),m=k(e,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"),f.automaticStyles=m||b.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"),z(f.automaticStyles,"document-styles"),d(f,f.automaticStyles),e=k(e,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),f.masterStyles= -e||b.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),d(f,f.masterStyles),n.prefixStyleNames(f.automaticStyles,l,f.masterStyles)):A(a.INVALID)}function D(b){b=s(b);var e,f,m,g;if(b&&"document-content"===b.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===b.namespaceURI){e=M.rootElement;m=k(b,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");if(e.fontFaceDecls&&m){g=e.fontFaceDecls;var l,h,p,r,F={};f=x(g);r=x(m);for(m=m.firstElementChild;m;){l= -m.nextElementSibling;if(m.namespaceURI===q&&"font-face"===m.localName)if(h=m.getAttributeNS(q,"name"),f.hasOwnProperty(h)){if(!m.isEqualNode(f[h])){p=h;for(var t=f,H=r,J=0,G=void 0,G=p=p.replace(/\d+$/,"");t.hasOwnProperty(G)||H.hasOwnProperty(G);)J+=1,G=p+J;p=G;m.setAttributeNS(q,"style:name",p);g.appendChild(m);f[p]=m;delete r[h];F[h]=p}}else g.appendChild(m),f[h]=m,delete r[h];m=l}g=F}else m&&(e.fontFaceDecls=m,d(e,m));f=k(b,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"); -z(f,"document-content");g&&n.changeFontFaceNames(f,g);if(e.automaticStyles&&f)for(g=f.firstChild;g;)e.automaticStyles.appendChild(g),g=f.firstChild;else f&&(e.automaticStyles=f,d(e,f));b=k(b,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");if(null===b)throw" tag is mising.";e.body=b;d(e,e.body)}else A(a.INVALID)}function F(a){a=s(a);var b;a&&"document-meta"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&(b=M.rootElement,b.meta=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0", -"meta"),d(b,b.meta))}function O(a){a=s(a);var b;a&&"document-settings"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&(b=M.rootElement,b.settings=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","settings"),d(b,b.settings))}function K(a){a=s(a);var b;if(a&&"manifest"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"===a.namespaceURI)for(b=M.rootElement,b.manifest=a,a=b.manifest.firstElementChild;a;)"file-entry"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"=== -a.namespaceURI&&(S[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.nextElementSibling}function Z(b){var e=b.shift();e?E.loadAsDOM(e.path,function(d,f){e.handler(f);d||M.state===a.INVALID||Z(b)}):(r(M.rootElement),A(a.DONE))}function Q(a){var b="";odf.Namespaces.forEachPrefix(function(a,e){b+=" xmlns:"+a+'="'+e+'"'});return''}function W(){var a=new xmldom.LSSerializer,b=Q("document-meta");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(M.rootElement.meta,odf.Namespaces.namespaceMap);return b+""}function H(a,b){var e=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:file-entry");e.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:full-path",a);e.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", -"manifest:media-type",b);return e}function T(){var a=runtime.parseXML(''),b=k(a,"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest"),e=new xmldom.LSSerializer,d;for(d in S)S.hasOwnProperty(d)&&b.appendChild(H(d,S[d]));e.filter=new odf.OdfNodeFilter;return'\n'+e.writeToString(a,odf.Namespaces.namespaceMap)} -function y(){var a=new xmldom.LSSerializer,b=Q("document-settings");a.filter=new odf.OdfNodeFilter;M.rootElement.settings.firstElementChild&&(b+=a.writeToString(M.rootElement.settings,odf.Namespaces.namespaceMap));return b+""}function aa(){var a,e,d,f=odf.Namespaces.namespaceMap,m=new xmldom.LSSerializer,g=Q("document-styles");e=v(M.rootElement.automaticStyles,"document-styles");d=M.rootElement.masterStyles.cloneNode(!0);a=u(M.rootElement.fontFaceDecls,[d,M.rootElement.styles, -e]);n.removePrefixFromStyleNames(e,l,d);m.filter=new b(d,e);g+=m.writeToString(a,f);g+=m.writeToString(M.rootElement.styles,f);g+=m.writeToString(e,f);g+=m.writeToString(d,f);return g+""}function N(){var a,b,e=odf.Namespaces.namespaceMap,d=new xmldom.LSSerializer,f=Q("document-content");b=v(M.rootElement.automaticStyles,"document-content");a=u(M.rootElement.fontFaceDecls,[b]);d.filter=new p(M.rootElement.body,b);f+=d.writeToString(a,e);f+=d.writeToString(b,e);f+=d.writeToString(M.rootElement.body, -e);return f+""}function R(b,e){runtime.loadXML(b,function(b,d){if(b)e(b);else{var f=s(d);f&&"document"===f.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===f.namespaceURI?(J(f),A(a.DONE)):A(a.INVALID)}})}function I(a,b){var e;e=M.rootElement;var f=e.meta;f||(e.meta=f=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta"),d(e,f));e=f;a&&g.mapKeyValObjOntoNode(e,a,odf.Namespaces.lookupNamespaceURI);b&&g.removeKeyElementsFromNode(e, -b,odf.Namespaces.lookupNamespaceURI)}function ca(){function b(a,e){var d;e||(e=a);d=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0",e);f[a]=d;f.appendChild(d)}var e=new core.Zip("",null),d=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),f=M.rootElement,m=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","text");e.save("mimetype",d,!1,new Date);b("meta");b("settings");b("scripts");b("fontFaceDecls","font-face-decls"); -b("styles");b("automaticStyles","automatic-styles");b("masterStyles","master-styles");b("body");f.body.appendChild(m);S["/"]="application/vnd.oasis.opendocument.text";S["settings.xml"]="text/xml";S["meta.xml"]="text/xml";S["styles.xml"]="text/xml";S["content.xml"]="text/xml";A(a.DONE);return e}function ia(){var a,b=new Date,e=runtime.getWindow();a="WebODF/"+("undefined"!==String(typeof webodf_version)?webodf_version:"FromSource");e&&(a=a+" "+e.navigator.userAgent);I({"meta:generator":a},null);a=runtime.byteArrayFromString(y(), -"utf8");E.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(W(),"utf8");E.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(aa(),"utf8");E.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(N(),"utf8");E.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(T(),"utf8");E.save("META-INF/manifest.xml",a,!0,b)}function Y(a,b){ia();E.writeAs(a,function(a){b(a)})}var M=this,E,S={},U;this.onstatereadychange=e;this.state=this.onchange=null;this.setRootElement=J;this.getContentElement= -function(){var a;U||(a=M.rootElement.body,U=k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","text")||k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","presentation")||k(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","spreadsheet"));if(!U)throw"Could not find content element in .";return U};this.getDocumentType=function(){var a=M.getContentElement();return a&&a.localName};this.getPart=function(a){return new odf.OdfPart(a,S[a],M,E)};this.getPartData=function(a,b){E.load(a, -b)};this.setMetadata=I;this.incrementEditingCycles=function(){var a;for(a=(a=M.rootElement.meta)&&a.firstChild;a&&(a.namespaceURI!==odf.Namespaces.metans||"editing-cycles"!==a.localName);)a=a.nextSibling;for(a=a&&a.firstChild;a&&a.nodeType!==Node.TEXT_NODE;)a=a.nextSibling;a=a?a.data:null;a=a?parseInt(a,10):0;isNaN(a)&&(a=0);I({"meta:editing-cycles":a+1},null)};this.createByteArray=function(a,b){ia();E.createByteArray(a,b)};this.saveAs=Y;this.save=function(a){Y(m,a)};this.getUrl=function(){return m}; -this.setBlob=function(a,b,e){e=f.convertBase64ToByteArray(e);E.save(a,e,!1,new Date);S.hasOwnProperty(a)&&runtime.log(a+" has been overwritten.");S[a]=b};this.removeBlob=function(a){var b=E.remove(a);runtime.assert(b,"file is not found: "+a);delete S[a]};this.state=a.LOADING;this.rootElement=function(a){var b=document.createElementNS(a.namespaceURI,a.localName),e;a=new a.Type;for(e in a)a.hasOwnProperty(e)&&(b[e]=a[e]);return b}({Type:odf.ODFDocumentElement,namespaceURI:odf.ODFDocumentElement.namespaceURI, -localName:odf.ODFDocumentElement.localName});E=m?new core.Zip(m,function(b,e){E=e;b?R(m,function(e){b&&(E.error=b+"\n"+e,A(a.INVALID))}):Z([{path:"styles.xml",handler:G},{path:"content.xml",handler:D},{path:"meta.xml",handler:F},{path:"settings.xml",handler:O},{path:"META-INF/manifest.xml",handler:K}])}):ca()};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})(); +(function(){function m(b){var a,c=l.length;for(a=0;ac)break;e=e.nextSibling}b.insertBefore(a,e)}}}var d=new odf.StyleInfo,p=new core.DomUtils,n=odf.Namespaces.stylens,l="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "), +q=(new Date).getTime()+"_webodf_",f=new core.Base64;odf.ODFElement=function(){};odf.ODFDocumentElement=function(){};odf.ODFDocumentElement.prototype=new odf.ODFElement;odf.ODFDocumentElement.prototype.constructor=odf.ODFDocumentElement;odf.ODFDocumentElement.prototype.fontFaceDecls=null;odf.ODFDocumentElement.prototype.manifest=null;odf.ODFDocumentElement.prototype.settings=null;odf.ODFDocumentElement.namespaceURI="urn:oasis:names:tc:opendocument:xmlns:office:1.0";odf.ODFDocumentElement.localName= +"document";odf.AnnotationElement=function(){};odf.OdfPart=function(b,a,c,d){var e=this;this.size=0;this.type=null;this.name=b;this.container=c;this.url=null;this.mimetype=a;this.onstatereadychange=this.document=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.data="";this.load=function(){null!==d&&(this.mimetype=a,d.loadAsDataURL(b,a,function(a,c){a&&runtime.log(a);e.url=c;if(e.onchange)e.onchange(e);if(e.onstatereadychange)e.onstatereadychange(e)}))}};odf.OdfPart.prototype.load= +function(){};odf.OdfPart.prototype.getUrl=function(){return this.data?"data:;base64,"+f.toBase64(this.data):null};odf.OdfContainer=function a(c,k){function e(a){for(var c=a.firstChild,b;c;)b=c.nextSibling,c.nodeType===Node.ELEMENT_NODE?e(c):c.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(c),c=b}function l(a){var c={},b,d,e=a.ownerDocument.createNodeIterator(a,NodeFilter.SHOW_ELEMENT,null,!1);for(a=e.nextNode();a;)"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&("annotation"=== +a.localName?(b=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","name"))&&(c.hasOwnProperty(b)?runtime.log("Warning: annotation name used more than once with : '"+b+"'"):c[b]=a):"annotation-end"===a.localName&&((b=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","name"))?c.hasOwnProperty(b)?(d=c[b],d.annotationEndElement?runtime.log("Warning: annotation name used more than once with : '"+b+"'"):d.annotationEndElement= +a):runtime.log("Warning: annotation end without an annotation start, name: '"+b+"'"):runtime.log("Warning: annotation end without a name found"))),a=e.nextNode()}function m(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 z(a){var c={},b;for(a=a.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&a.namespaceURI===n&&"font-face"===a.localName&&(b=a.getAttributeNS(n,"name"),c[b]=a),a=a.nextSibling;return c}function x(a, +c){var b=null,d,e,f;if(a)for(b=a.cloneNode(!0),d=b.firstElementChild;d;)e=d.nextElementSibling,(f=d.getAttributeNS("urn:webodf:names:scope","scope"))&&f!==c&&b.removeChild(d),d=e;return b}function t(a,c){var b,e,f,k=null,g={};if(a)for(c.forEach(function(a){d.collectUsedFontFaces(g,a)}),k=a.cloneNode(!0),b=k.firstElementChild;b;)e=b.nextElementSibling,f=b.getAttributeNS(n,"name"),g[f]||k.removeChild(b),b=e;return k}function v(a){var c=N.rootElement.ownerDocument,b;if(a){e(a.documentElement);try{b= +c.importNode(a.documentElement,!0)}catch(d){}}return b}function s(a){N.state=a;if(N.onchange)N.onchange(N);if(N.onstatereadychange)N.onstatereadychange(N)}function C(a){U=null;N.rootElement=a;a.fontFaceDecls=p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");a.styles=p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles");a.automaticStyles=p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");a.masterStyles= +p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles");a.body=p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");a.meta=p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta");l(a)}function I(c){var b=v(c),e=N.rootElement,f;b&&"document-styles"===b.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===b.namespaceURI?(e.fontFaceDecls=p.getDirectChild(b,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls"), +g(e,e.fontFaceDecls),f=p.getDirectChild(b,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles"),e.styles=f||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles"),g(e,e.styles),f=p.getDirectChild(b,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"),e.automaticStyles=f||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"),m(e.automaticStyles,"document-styles"),g(e,e.automaticStyles),b=p.getDirectChild(b,"urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"master-styles"),e.masterStyles=b||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),g(e,e.masterStyles),d.prefixStyleNames(e.automaticStyles,q,e.masterStyles)):s(a.INVALID)}function H(c){c=v(c);var b,e,f,k;if(c&&"document-content"===c.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===c.namespaceURI){b=N.rootElement;f=p.getDirectChild(c,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");if(b.fontFaceDecls&&f){k=b.fontFaceDecls;var l, +h,C,q,F={};e=z(k);q=z(f);for(f=f.firstElementChild;f;){l=f.nextElementSibling;if(f.namespaceURI===n&&"font-face"===f.localName)if(h=f.getAttributeNS(n,"name"),e.hasOwnProperty(h)){if(!f.isEqualNode(e[h])){C=h;for(var u=e,I=q,G=0,H=void 0,H=C=C.replace(/\d+$/,"");u.hasOwnProperty(H)||I.hasOwnProperty(H);)G+=1,H=C+G;C=H;f.setAttributeNS(n,"style:name",C);k.appendChild(f);e[C]=f;delete q[h];F[h]=C}}else k.appendChild(f),e[h]=f,delete q[h];f=l}k=F}else f&&(b.fontFaceDecls=f,g(b,f));e=p.getDirectChild(c, +"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");m(e,"document-content");k&&d.changeFontFaceNames(e,k);if(b.automaticStyles&&e)for(k=e.firstChild;k;)b.automaticStyles.appendChild(k),k=e.firstChild;else e&&(b.automaticStyles=e,g(b,e));c=p.getDirectChild(c,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");if(null===c)throw" tag is mising.";b.body=c;g(b,b.body)}else s(a.INVALID)}function D(a){a=v(a);var c;a&&"document-meta"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"=== +a.namespaceURI&&(c=N.rootElement,c.meta=p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta"),g(c,c.meta))}function F(a){a=v(a);var c;a&&"document-settings"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&(c=N.rootElement,c.settings=p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","settings"),g(c,c.settings))}function O(a){a=v(a);var c;if(a&&"manifest"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"=== +a.namespaceURI)for(c=N.rootElement,c.manifest=a,a=c.manifest.firstElementChild;a;)"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.nextElementSibling}function K(c){var b=c.shift();b?T.loadAsDOM(b.path,function(d,e){b.handler(e);d||N.state===a.INVALID||K(c)}):(l(N.rootElement), +s(a.DONE))}function Z(a){var c="";odf.Namespaces.forEachPrefix(function(a,b){c+=" xmlns:"+a+'="'+b+'"'});return''}function Q(){var a=new xmldom.LSSerializer,c=Z("document-meta");a.filter=new odf.OdfNodeFilter;c+=a.writeToString(N.rootElement.meta,odf.Namespaces.namespaceMap);return c+""}function X(a,c){var b=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:file-entry"); +b.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:full-path",a);b.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:media-type",c);return b}function G(){var a=runtime.parseXML(''),c=a.documentElement,b=new xmldom.LSSerializer,d;for(d in E)E.hasOwnProperty(d)&&c.appendChild(X(d,E[d]));b.filter=new odf.OdfNodeFilter; +return'\n'+b.writeToString(a,odf.Namespaces.namespaceMap)}function S(){var a=new xmldom.LSSerializer,c=Z("document-settings");a.filter=new odf.OdfNodeFilter;N.rootElement.settings.firstElementChild&&(c+=a.writeToString(N.rootElement.settings,odf.Namespaces.namespaceMap));return c+""}function y(){var a,c,b,e=odf.Namespaces.namespaceMap,f=new xmldom.LSSerializer,k=Z("document-styles");c=x(N.rootElement.automaticStyles, +"document-styles");b=N.rootElement.masterStyles.cloneNode(!0);a=t(N.rootElement.fontFaceDecls,[b,N.rootElement.styles,c]);d.removePrefixFromStyleNames(c,q,b);f.filter=new h(b,c);k+=f.writeToString(a,e);k+=f.writeToString(N.rootElement.styles,e);k+=f.writeToString(c,e);k+=f.writeToString(b,e);return k+""}function aa(){var a,c,d=odf.Namespaces.namespaceMap,e=new xmldom.LSSerializer,f=Z("document-content");c=x(N.rootElement.automaticStyles,"document-content");a=t(N.rootElement.fontFaceDecls, +[c]);e.filter=new b(N.rootElement.body,c);f+=e.writeToString(a,d);f+=e.writeToString(c,d);f+=e.writeToString(N.rootElement.body,d);return f+""}function M(c,b){runtime.loadXML(c,function(c,d){if(c)b(c);else{var e=v(d);e&&"document"===e.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===e.namespaceURI?(C(e),s(a.DONE)):s(a.INVALID)}})}function R(a,c){var b;b=N.rootElement;var d=b.meta;d||(b.meta=d=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"meta"),g(b,d));b=d;a&&p.mapKeyValObjOntoNode(b,a,odf.Namespaces.lookupNamespaceURI);c&&p.removeKeyElementsFromNode(b,c,odf.Namespaces.lookupNamespaceURI)}function J(){function c(a,b){var d;b||(b=a);d=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0",b);e[a]=d;e.appendChild(d)}var b=new core.Zip("",null),d=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),e=N.rootElement,f=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"text");b.save("mimetype",d,!1,new Date);c("meta");c("settings");c("scripts");c("fontFaceDecls","font-face-decls");c("styles");c("automaticStyles","automatic-styles");c("masterStyles","master-styles");c("body");e.body.appendChild(f);E["/"]="application/vnd.oasis.opendocument.text";E["settings.xml"]="text/xml";E["meta.xml"]="text/xml";E["styles.xml"]="text/xml";E["content.xml"]="text/xml";s(a.DONE);return b}function ba(){var a,c=new Date,b=runtime.getWindow();a="WebODF/"+("undefined"!==String(typeof webodf_version)? +webodf_version:"FromSource");b&&(a=a+" "+b.navigator.userAgent);R({"meta:generator":a},null);a=runtime.byteArrayFromString(S(),"utf8");T.save("settings.xml",a,!0,c);a=runtime.byteArrayFromString(Q(),"utf8");T.save("meta.xml",a,!0,c);a=runtime.byteArrayFromString(y(),"utf8");T.save("styles.xml",a,!0,c);a=runtime.byteArrayFromString(aa(),"utf8");T.save("content.xml",a,!0,c);a=runtime.byteArrayFromString(G(),"utf8");T.save("META-INF/manifest.xml",a,!0,c)}function ia(a,c){ba();T.writeAs(a,function(a){c(a)})} +var N=this,T,E={},U;this.onstatereadychange=k;this.state=this.onchange=null;this.setRootElement=C;this.getContentElement=function(){var a;U||(a=N.rootElement.body,U=p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","text")||p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","presentation")||p.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","spreadsheet"));if(!U)throw"Could not find content element in .";return U};this.getDocumentType= +function(){var a=N.getContentElement();return a&&a.localName};this.getPart=function(a){return new odf.OdfPart(a,E[a],N,T)};this.getPartData=function(a,c){T.load(a,c)};this.setMetadata=R;this.incrementEditingCycles=function(){var a;for(a=(a=N.rootElement.meta)&&a.firstChild;a&&(a.namespaceURI!==odf.Namespaces.metans||"editing-cycles"!==a.localName);)a=a.nextSibling;for(a=a&&a.firstChild;a&&a.nodeType!==Node.TEXT_NODE;)a=a.nextSibling;a=a?a.data:null;a=a?parseInt(a,10):0;isNaN(a)&&(a=0);R({"meta:editing-cycles":a+ +1},null)};this.createByteArray=function(a,c){ba();T.createByteArray(a,c)};this.saveAs=ia;this.save=function(a){ia(c,a)};this.getUrl=function(){return c};this.setBlob=function(a,c,b){b=f.convertBase64ToByteArray(b);T.save(a,b,!1,new Date);E.hasOwnProperty(a)&&runtime.log(a+" has been overwritten.");E[a]=c};this.removeBlob=function(a){var c=T.remove(a);runtime.assert(c,"file is not found: "+a);delete E[a]};this.state=a.LOADING;this.rootElement=function(a){var c=document.createElementNS(a.namespaceURI, +a.localName),b;a=new a.Type;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c}({Type:odf.ODFDocumentElement,namespaceURI:odf.ODFDocumentElement.namespaceURI,localName:odf.ODFDocumentElement.localName});T=c?new core.Zip(c,function(b,d){T=d;b?M(c,function(c){b&&(T.error=b+"\n"+c,s(a.INVALID))}):K([{path:"styles.xml",handler:I},{path:"content.xml",handler:H},{path:"meta.xml",handler:D},{path:"settings.xml",handler:F},{path:"META-INF/manifest.xml",handler:O}])}):J()};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 28 /* @@ -608,19 +608,19 @@ null)};return odf.OdfContainer})(); @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -odf.OdfUtils=function(){function k(a){return"image"===(a&&a.localName)&&a.namespaceURI===K}function h(a){return null!==a&&a.nodeType===Node.ELEMENT_NODE&&"frame"===a.localName&&a.namespaceURI===K&&"as-char"===a.getAttributeNS(O,"anchor-type")}function b(a){var c;(c="annotation"===(a&&a.localName)&&a.namespaceURI===odf.Namespaces.officens)||(c="div"===(a&&a.localName)&&"annotationWrapper"===a.className);return c}function p(a){return"a"===(a&&a.localName)&&a.namespaceURI===O}function d(a){var c=a&& -a.localName;return("p"===c||"h"===c)&&a.namespaceURI===O}function n(a){for(;a&&!d(a);)a=a.parentNode;return a}function g(a){return/^[ \t\r\n]+$/.test(a)}function q(a){if(null===a||a.nodeType!==Node.ELEMENT_NODE)return!1;var c=a.localName;return/^(span|p|h|a|meta)$/.test(c)&&a.namespaceURI===O||"span"===c&&"annotationHighlight"===a.className}function r(a){var c=a&&a.localName,b=!1;c&&(a=a.namespaceURI,a===O&&(b="s"===c||"tab"===c||"line-break"===c));return b}function l(a){return r(a)||h(a)||b(a)}function f(a){var c= -a&&a.localName,b=!1;c&&(a=a.namespaceURI,a===O&&(b="s"===c));return b}function c(a){for(;null!==a.firstChild&&q(a);)a=a.firstChild;return a}function a(a){for(;null!==a.lastChild&&q(a);)a=a.lastChild;return a}function m(c){for(;!d(c)&&null===c.previousSibling;)c=c.parentNode;return d(c)?null:a(c.previousSibling)}function e(a){for(;!d(a)&&null===a.nextSibling;)a=a.parentNode;return d(a)?null:c(a.nextSibling)}function t(a){for(var c=!1;a;)if(a.nodeType===Node.TEXT_NODE)if(0===a.length)a=m(a);else return!g(a.data.substr(a.length- -1,1));else l(a)?(c=!1===f(a),a=null):a=m(a);return c}function w(a){var b=!1,d;for(a=a&&c(a);a;){d=a.nodeType===Node.TEXT_NODE?a.length:0;if(0a.value||"%"===a.unit)?null:a}function s(a){return(a=v(a))&&"%"!==a.unit?null:a}function A(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 "cursor":case "editinfo":return!1}}return!0} -function J(a,c){for(;0=c.value||"%"===c.unit)?null:c;return c||s(a)};this.parseFoLineHeight=function(a){return u(a)||s(a)};this.isTextContentContainingNode=A;this.getTextNodes=function(a,c){var b;b=W.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_REJECT;a.nodeType===Node.TEXT_NODE?Boolean(n(a)&&(!g(a.textContent)||x(a,0)))&&(c=NodeFilter.FILTER_ACCEPT): -A(a)&&(c=NodeFilter.FILTER_SKIP);return c},NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);c||J(a,b);return b};this.getTextElements=G;this.getParagraphElements=function(a){var c;c=W.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_REJECT;if(d(a))c=NodeFilter.FILTER_ACCEPT;else if(A(a)||q(a))c=NodeFilter.FILTER_SKIP;return c},NodeFilter.SHOW_ELEMENT);D(a.startContainer,c,d);return c};this.getImageElements=function(a){var c;c=W.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_SKIP;k(a)&&(c= -NodeFilter.FILTER_ACCEPT);return c},NodeFilter.SHOW_ELEMENT);D(a.startContainer,c,k);return c};this.getHyperlinkElements=function(a){var c=[],b=a.cloneRange();a.collapsed&&a.endContainer.nodeType===Node.ELEMENT_NODE&&(a=F(a.endContainer,a.endOffset),a.nodeType===Node.TEXT_NODE&&b.setEnd(a,1));G(b,!0,!1).forEach(function(a){for(a=a.parentNode;!d(a);){if(p(a)&&-1===c.indexOf(a)){c.push(a);break}a=a.parentNode}});b.detach();return c}}; +odf.OdfUtils=function(){function m(a){return"image"===(a&&a.localName)&&a.namespaceURI===K}function h(a){return null!==a&&a.nodeType===Node.ELEMENT_NODE&&"frame"===a.localName&&a.namespaceURI===K&&"as-char"===a.getAttributeNS(O,"anchor-type")}function b(a){var c;(c="annotation"===(a&&a.localName)&&a.namespaceURI===odf.Namespaces.officens)||(c="div"===(a&&a.localName)&&"annotationWrapper"===a.className);return c}function g(a){return"a"===(a&&a.localName)&&a.namespaceURI===O}function d(a){var c=a&& +a.localName;return("p"===c||"h"===c)&&a.namespaceURI===O}function p(a){for(;a&&!d(a);)a=a.parentNode;return a}function n(a){return/^[ \t\r\n]+$/.test(a)}function l(a){if(null===a||a.nodeType!==Node.ELEMENT_NODE)return!1;var c=a.localName;return/^(span|p|h|a|meta)$/.test(c)&&a.namespaceURI===O||"span"===c&&"annotationHighlight"===a.className}function q(a){var c=a&&a.localName,b=!1;c&&(a=a.namespaceURI,a===O&&(b="s"===c||"tab"===c||"line-break"===c));return b}function f(a){return q(a)||h(a)||b(a)}function r(a){var c= +a&&a.localName,b=!1;c&&(a=a.namespaceURI,a===O&&(b="s"===c));return b}function a(a){for(;null!==a.firstChild&&l(a);)a=a.firstChild;return a}function c(a){for(;null!==a.lastChild&&l(a);)a=a.lastChild;return a}function k(a){for(;!d(a)&&null===a.previousSibling;)a=a.parentNode;return d(a)?null:c(a.previousSibling)}function e(c){for(;!d(c)&&null===c.nextSibling;)c=c.parentNode;return d(c)?null:a(c.nextSibling)}function u(a){for(var c=!1;a;)if(a.nodeType===Node.TEXT_NODE)if(0===a.length)a=k(a);else return!n(a.data.substr(a.length- +1,1));else f(a)?(c=!1===r(a),a=null):a=k(a);return c}function w(c){var b=!1,d;for(c=c&&a(c);c;){d=c.nodeType===Node.TEXT_NODE?c.length:0;if(0a.value||"%"===a.unit)?null:a}function s(a){return(a=t(a))&&"%"!==a.unit?null:a}function C(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 "cursor":case "editinfo":return!1}}return!0} +function I(a,c){for(;0=c.value||"%"===c.unit)?null:c;return c||s(a)};this.parseFoLineHeight=function(a){return v(a)||s(a)};this.isTextContentContainingNode=C;this.getTextNodes=function(a,c){var b;b=X.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_REJECT;a.nodeType===Node.TEXT_NODE?Boolean(p(a)&&(!n(a.textContent)||x(a,0)))&&(c=NodeFilter.FILTER_ACCEPT): +C(a)&&(c=NodeFilter.FILTER_SKIP);return c},NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);c||I(a,b);return b};this.getTextElements=H;this.getParagraphElements=function(a){var c;c=X.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_REJECT;if(d(a))c=NodeFilter.FILTER_ACCEPT;else if(C(a)||l(a))c=NodeFilter.FILTER_SKIP;return c},NodeFilter.SHOW_ELEMENT);D(a.startContainer,c,d);return c};this.getImageElements=function(a){var c;c=X.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_SKIP;m(a)&&(c= +NodeFilter.FILTER_ACCEPT);return c},NodeFilter.SHOW_ELEMENT);D(a.startContainer,c,m);return c};this.getHyperlinkElements=function(a){var c=[],b=a.cloneRange();a.collapsed&&a.endContainer.nodeType===Node.ELEMENT_NODE&&(a=F(a.endContainer,a.endOffset),a.nodeType===Node.TEXT_NODE&&b.setEnd(a,1));H(b,!0,!1).forEach(function(a){for(a=a.parentNode;!d(a);){if(g(a)&&-1===c.indexOf(a)){c.push(a);break}a=a.parentNode}});b.detach();return c}}; // Input 29 /* @@ -660,13 +660,13 @@ NodeFilter.FILTER_ACCEPT);return c},NodeFilter.SHOW_ELEMENT);D(a.startContainer, @source: https://github.com/kogmbh/WebODF/ */ gui.AnnotatableCanvas=function(){};gui.AnnotatableCanvas.prototype.refreshSize=function(){};gui.AnnotatableCanvas.prototype.getZoomLevel=function(){};gui.AnnotatableCanvas.prototype.getSizer=function(){}; -gui.AnnotationViewManager=function(k,h,b,p){function d(a){var c=a.annotationEndElement,b=l.createRange(),d=a.getAttributeNS(odf.Namespaces.officens,"name");c&&(b.setStart(a,a.childNodes.length),b.setEnd(c,0),a=f.getTextNodes(b,!1),a.forEach(function(a){var c=l.createElement("span");c.className="annotationHighlight";c.setAttribute("annotation",d);a.parentNode.insertBefore(c,a);c.appendChild(a)}));b.detach()}function n(a){var d=k.getSizer();a?(b.style.display="inline-block",d.style.paddingRight=c.getComputedStyle(b).width): -(b.style.display="none",d.style.paddingRight=0);k.refreshSize()}function g(){r.sort(function(a,c){return 0!==(a.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_FOLLOWING)?-1:1})}function q(){var a;for(a=0;a=(g.getBoundingClientRect().top-n.bottom)/c?e.style.top=Math.abs(g.getBoundingClientRect().top-n.bottom)/c+20+"px":e.style.top="0px");f.style.left=d.getBoundingClientRect().width/c+"px";var d=f.style,g=f.getBoundingClientRect().left/c,l=f.getBoundingClientRect().top/c,n=e.getBoundingClientRect().left/c,h=e.getBoundingClientRect().top/c,q=0,A=0,q=n-g,q=q*q,A=h-l,A=A*A,g=Math.sqrt(q+A);d.width=g+"px";l=Math.asin((e.getBoundingClientRect().top- -f.getBoundingClientRect().top)/(c*parseFloat(f.style.width)));f.style.transform="rotate("+l+"rad)";f.style.MozTransform="rotate("+l+"rad)";f.style.WebkitTransform="rotate("+l+"rad)";f.style.msTransform="rotate("+l+"rad)"}}var r=[],l=h.ownerDocument,f=new odf.OdfUtils,c=runtime.getWindow();runtime.assert(Boolean(c),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=q;this.getMinimumHeightForAnnotationPane=function(){return"none"!==b.style.display&& -0=(l.getBoundingClientRect().top-p.bottom)/d?e.style.top=Math.abs(l.getBoundingClientRect().top-p.bottom)/d+20+"px":e.style.top="0px");g.style.left=f.getBoundingClientRect().width/d+"px";var f=g.style,l=g.getBoundingClientRect().left/d,h=g.getBoundingClientRect().top/d,p=e.getBoundingClientRect().left/d,n=e.getBoundingClientRect().top/d,r=0,C=0,r=p-l,r=r*r,C=n-h,C=C*C,l=Math.sqrt(r+C);f.width=l+"px";h=Math.asin((e.getBoundingClientRect().top- +g.getBoundingClientRect().top)/(d*parseFloat(g.style.width)));g.style.transform="rotate("+h+"rad)";g.style.MozTransform="rotate("+h+"rad)";g.style.WebkitTransform="rotate("+h+"rad)";g.style.msTransform="rotate("+h+"rad)"}}var q=[],f=h.ownerDocument,r=new odf.OdfUtils,a=runtime.getWindow();runtime.assert(Boolean(a),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=l;this.getMinimumHeightForAnnotationPane=function(){return"none"!==b.style.display&& +0m.value&&(f="0.75pt"+l)}d[2]&&(b+=d[2]+":"+f+";")}return b}function q(c){return(c=n(c,e,"text-properties"))?y.parseFoFontSize(c.getAttributeNS(a,"font-size")):null}function r(a,c,b,e){return c+c+b+b+e+e}function l(c,b,d,f){b='text|list[text|style-name="'+b+'"]';var g=d.getAttributeNS(z,"level");d=n(d,e,"list-level-properties");d=n(d,e,"list-level-label-alignment");var m,l;d&&(m=d.getAttributeNS(a,"text-indent"),l=d.getAttributeNS(a, -"margin-left"));m||(m="-0.6cm");d="-"===m.charAt(0)?m.substring(1):"-"+m;for(g=g&&parseInt(g,10);1 text|list-item > text|list",g-=1;if(l){g=b+" > text|list-item > *:not(text|list):first-child";g+="{";g=g+("margin-left:"+l+";")+"}";try{c.insertRule(g,c.cssRules.length)}catch(h){runtime.log("cannot load rule: "+g)}}f=b+" > text|list-item > *:not(text|list):first-child:before{"+f+";";f=f+"counter-increment:list;"+("margin-left:"+m+";");f+="width:"+d+";";f+="display:inline-block}";try{c.insertRule(f, -c.cssRules.length)}catch(k){runtime.log("cannot load rule: "+f)}}function f(b,h,k,p){if("list"===h)for(var t=p.element.firstChild,s,u;t;){if(t.namespaceURI===z)if(s=t,"list-level-style-number"===t.localName){var H=s;u=H.getAttributeNS(e,"num-format");var P=H.getAttributeNS(e,"num-suffix")||"",H=H.getAttributeNS(e,"num-prefix")||"",X={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},V="";H&&(V+=' "'+H+'"');V=X.hasOwnProperty(u)?V+(" counter(list, "+X[u]+")"):u?V+(' "'+u+ -'"'):V+" ''";u="content:"+V+' "'+P+'"';l(b,k,s,u)}else"list-level-style-image"===t.localName?(u="content: none;",l(b,k,s,u)):"list-level-style-bullet"===t.localName&&(u="content: '"+s.getAttributeNS(z,"bullet-char")+"';",l(b,k,s,u));t=t.nextSibling}else if("page"===h){if(u=p.element,H=P=k="",t=n(u,e,"page-layout-properties"))if(s=u.getAttributeNS(e,"name"),k+=g(t,Q),(P=n(t,e,"background-image"))&&(H=P.getAttributeNS(x,"href"))&&(k=k+("background-image: url('odfkit:"+H+"');")+g(P,J)),"presentation"=== -aa)for(u=(u=n(u.parentNode.parentNode,m,"master-styles"))&&u.firstElementChild;u;){if(u.namespaceURI===e&&"master-page"===u.localName&&u.getAttributeNS(e,"page-layout-name")===s){H=u.getAttributeNS(e,"name");P="draw|page[draw|master-page-name="+H+"] {"+k+"}";H="office|body, draw|page[draw|master-page-name="+H+"] {"+g(t,W)+" }";try{b.insertRule(P,b.cssRules.length),b.insertRule(H,b.cssRules.length)}catch(ga){throw ga;}}u=u.nextElementSibling}else if("text"===aa){P="office|text {"+k+"}";H="office|body {width: "+ -t.getAttributeNS(a,"page-width")+";}";try{b.insertRule(P,b.cssRules.length),b.insertRule(H,b.cssRules.length)}catch(ha){throw ha;}}}else{k=d(h,k,p).join(",");t="";if(s=n(p.element,e,"text-properties")){H=s;u=V="";P=1;s=""+g(H,A);X=H.getAttributeNS(e,"text-underline-style");"solid"===X&&(V+=" underline");X=H.getAttributeNS(e,"text-line-through-style");"solid"===X&&(V+=" line-through");V.length&&(s+="text-decoration:"+V+";");if(V=H.getAttributeNS(e,"font-name")||H.getAttributeNS(a,"font-family"))X= -T[V],s+="font-family: "+(X||V)+";";X=H.parentNode;if(H=q(X)){for(;X;){if(H=q(X)){if("%"!==H.unit){u="font-size: "+H.value*P+H.unit+";";break}P*=H.value/100}H=X;V=X="";X=null;"default-style"===H.localName?X=null:(X=H.getAttributeNS(e,"parent-style-name"),V=H.getAttributeNS(e,"family"),X=I.getODFElementsWithXPath(N,X?"//style:*[@style:name='"+X+"'][@style:family='"+V+"']":"//style:default-style[@style:family='"+V+"']",odf.Namespaces.lookupNamespaceURI)[0])}u||(u="font-size: "+parseFloat(R)*P+ca.getUnits(R)+ -";");s+=u}t+=s}if(s=n(p.element,e,"paragraph-properties"))u=s,s=""+g(u,G),(P=n(u,e,"background-image"))&&(H=P.getAttributeNS(x,"href"))&&(s=s+("background-image: url('odfkit:"+H+"');")+g(P,J)),(u=u.getAttributeNS(a,"line-height"))&&"normal"!==u&&(u=y.parseFoLineHeight(u),s="%"!==u.unit?s+("line-height: "+u.value+u.unit+";"):s+("line-height: "+u.value/100+";")),t+=s;if(s=n(p.element,e,"graphic-properties"))H=s,s=""+g(H,D),u=H.getAttributeNS(c,"opacity"),P=H.getAttributeNS(c,"fill"),H=H.getAttributeNS(c, -"fill-color"),"solid"===P||"hatch"===P?H&&"none"!==H?(u=isNaN(parseFloat(u))?1:parseFloat(u)/100,P=H.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r),(H=(P=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(P))?{r:parseInt(P[1],16),g:parseInt(P[2],16),b:parseInt(P[3],16)}:null)&&(s+="background-color: rgba("+H.r+","+H.g+","+H.b+","+u+");")):s+="background: none;":"none"===P&&(s+="background: none;"),t+=s;if(s=n(p.element,e,"drawing-page-properties"))u=""+g(s,D),"true"===s.getAttributeNS(v,"background-visible")&& -(u+="background: none;"),t+=u;if(s=n(p.element,e,"table-cell-properties"))s=""+g(s,F),t+=s;if(s=n(p.element,e,"table-row-properties"))s=""+g(s,K),t+=s;if(s=n(p.element,e,"table-column-properties"))s=""+g(s,O),t+=s;if(s=n(p.element,e,"table-properties"))u=s,s=""+g(u,Z),u=u.getAttributeNS(w,"border-model"),"collapsing"===u?s+="border-collapse:collapse;":"separating"===u&&(s+="border-collapse:separate;"),t+=s;if(0!==t.length)try{b.insertRule(k+"{"+t+"}",b.cssRules.length)}catch($){throw $;}}for(var ea in p.derivedStyles)p.derivedStyles.hasOwnProperty(ea)&& -f(b,h,ea,p.derivedStyles[ea])}var c=odf.Namespaces.drawns,a=odf.Namespaces.fons,m=odf.Namespaces.officens,e=odf.Namespaces.stylens,t=odf.Namespaces.svgns,w=odf.Namespaces.tablens,z=odf.Namespaces.textns,x=odf.Namespaces.xlinkns,v=odf.Namespaces.presentationns,u={graphic:"draw","drawing-page":"draw",paragraph:"text",presentation:"presentation",ruby:"text",section:"text",table:"table","table-cell":"table","table-column":"table","table-row":"table",text:"text",list:"text",page:"office"},s={graphic:"circle connected control custom-shape ellipse frame g line measure page page-thumbnail path polygon polyline rect regular-polygon".split(" "), -paragraph:"alphabetical-index-entry-template h illustration-index-entry-template index-source-style object-index-entry-template p table-index-entry-template table-of-content-entry-template user-index-entry-template".split(" "),presentation:"caption circle connector control custom-shape ellipse frame g line measure page-thumbnail path polygon polyline rect regular-polygon".split(" "),"drawing-page":"caption circle connector control page custom-shape ellipse frame g line measure page-thumbnail path polygon polyline rect regular-polygon".split(" "), -ruby:["ruby","ruby-text"],section:"alphabetical-index bibliography illustration-index index-title object-index section table-of-content table-index user-index".split(" "),table:["background","table"],"table-cell":"body covered-table-cell even-columns even-rows first-column first-row last-column last-row odd-columns odd-rows table-cell".split(" "),"table-column":["table-column"],"table-row":["table-row"],text:"a index-entry-chapter index-entry-link-end index-entry-link-start index-entry-page-number index-entry-span index-entry-tab-stop index-entry-text index-title-template linenumbering-configuration list-level-style-number list-level-style-bullet outline-level-style span".split(" "), -list:["list-item"]},A=[[a,"color","color"],[a,"background-color","background-color"],[a,"font-weight","font-weight"],[a,"font-style","font-style"]],J=[[e,"repeat","background-repeat"]],G=[[a,"background-color","background-color"],[a,"text-align","text-align"],[a,"text-indent","text-indent"],[a,"padding","padding"],[a,"padding-left","padding-left"],[a,"padding-right","padding-right"],[a,"padding-top","padding-top"],[a,"padding-bottom","padding-bottom"],[a,"border-left","border-left"],[a,"border-right", -"border-right"],[a,"border-top","border-top"],[a,"border-bottom","border-bottom"],[a,"margin","margin"],[a,"margin-left","margin-left"],[a,"margin-right","margin-right"],[a,"margin-top","margin-top"],[a,"margin-bottom","margin-bottom"],[a,"border","border"]],D=[[a,"background-color","background-color"],[a,"min-height","min-height"],[c,"stroke","border"],[t,"stroke-color","border-color"],[t,"stroke-width","border-width"],[a,"border","border"],[a,"border-left","border-left"],[a,"border-right","border-right"], -[a,"border-top","border-top"],[a,"border-bottom","border-bottom"]],F=[[a,"background-color","background-color"],[a,"border-left","border-left"],[a,"border-right","border-right"],[a,"border-top","border-top"],[a,"border-bottom","border-bottom"],[a,"border","border"]],O=[[e,"column-width","width"]],K=[[e,"row-height","height"],[a,"keep-together",null]],Z=[[e,"width","width"],[a,"margin-left","margin-left"],[a,"margin-right","margin-right"],[a,"margin-top","margin-top"],[a,"margin-bottom","margin-bottom"]], +odf.StyleTreeNode=function(m){this.derivedStyles={};this.element=m}; +odf.Style2CSS=function(){function m(a){var c,b,d,e={};if(!a)return e;for(a=a.firstElementChild;a;){if(b=a.namespaceURI!==k||"style"!==a.localName&&"default-style"!==a.localName?a.namespaceURI===w&&"list-style"===a.localName?"list":a.namespaceURI!==k||"page-layout"!==a.localName&&"default-page-layout"!==a.localName?void 0:"page":a.getAttributeNS(k,"family"))(c=a.getAttributeNS(k,"name"))||(c=""),e.hasOwnProperty(b)?d=e[b]:e[b]=d={},d[c]=a;a=a.nextElementSibling}return e}function h(a,c){if(a.hasOwnProperty(c))return a[c]; +var b,d=null;for(b in a)if(a.hasOwnProperty(b)&&(d=h(a[b].derivedStyles,c)))break;return d}function b(a,c,d){var e,f,g;if(!c.hasOwnProperty(a))return null;e=new odf.StyleTreeNode(c[a]);f=e.element.getAttributeNS(k,"parent-style-name");g=null;f&&(g=h(d,f)||b(f,c,d));g?g.derivedStyles[a]=e:d[a]=e;delete c[a];return e}function g(a,c){for(var d in a)a.hasOwnProperty(d)&&b(d,a,c)}function d(a,c,b){var e=[];b=b.derivedStyles;var f;var k=v[a],g;void 0===k?c=null:(g=c?"["+k+'|style-name="'+c+'"]':"","presentation"=== +k&&(k="draw",g=c?'[presentation|style-name="'+c+'"]':""),c=k+"|"+s[a].join(g+","+k+"|")+g);null!==c&&e.push(c);for(f in b)b.hasOwnProperty(f)&&(c=d(a,f,b[f]),e=e.concat(c));return e}function p(a,c){var b="",d,e,f;for(d=0;dg.value&&(f="0.75pt"+l)}e[2]&&(b+=e[2]+":"+f+";")}return b} +function n(c){return(c=t.getDirectChild(c,k,"text-properties"))?y.parseFoFontSize(c.getAttributeNS(a,"font-size")):null}function l(a,c,b,d){return c+c+b+b+d+d}function q(c,b,d,e){b='text|list[text|style-name="'+b+'"]';var f=d.getAttributeNS(w,"level");d=t.getDirectChild(d,k,"list-level-properties");d=t.getDirectChild(d,k,"list-level-label-alignment");var g,l;d&&(g=d.getAttributeNS(a,"text-indent"),l=d.getAttributeNS(a,"margin-left"));g||(g="-0.6cm");d="-"===g.charAt(0)?g.substring(1):"-"+g;for(f= +f&&parseInt(f,10);1 text|list-item > text|list",f-=1;if(l){f=b+" > text|list-item > *:not(text|list):first-child";f+="{";f=f+("margin-left:"+l+";")+"}";try{c.insertRule(f,c.cssRules.length)}catch(h){runtime.log("cannot load rule: "+f)}}e=b+" > text|list-item > *:not(text|list):first-child:before{"+e+";";e=e+"counter-increment:list;"+("margin-left:"+g+";");e+="width:"+d+";";e+="display:inline-block}";try{c.insertRule(e,c.cssRules.length)}catch(p){runtime.log("cannot load rule: "+e)}}function f(b, +e,g,h){if("list"===e)for(var m=h.element.firstChild,s,v;m;){if(m.namespaceURI===w)if(s=m,"list-level-style-number"===m.localName){var G=s;v=G.getAttributeNS(k,"num-format");var P=G.getAttributeNS(k,"num-suffix")||"",G=G.getAttributeNS(k,"num-prefix")||"",Y={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},V="";G&&(V+=' "'+G+'"');V=Y.hasOwnProperty(v)?V+(" counter(list, "+Y[v]+")"):v?V+(' "'+v+'"'):V+" ''";v="content:"+V+' "'+P+'"';q(b,g,s,v)}else"list-level-style-image"=== +m.localName?(v="content: none;",q(b,g,s,v)):"list-level-style-bullet"===m.localName&&(v="content: '"+s.getAttributeNS(w,"bullet-char")+"';",q(b,g,s,v));m=m.nextSibling}else if("page"===e){if(v=h.element,G=P=g="",m=t.getDirectChild(v,k,"page-layout-properties"))if(s=v.getAttributeNS(k,"name"),g+=p(m,Q),(P=t.getDirectChild(m,k,"background-image"))&&(G=P.getAttributeNS(z,"href"))&&(g=g+("background-image: url('odfkit:"+G+"');")+p(P,I)),"presentation"===aa)for(v=(v=t.getDirectChild(v.parentNode.parentNode, +c,"master-styles"))&&v.firstElementChild;v;){if(v.namespaceURI===k&&"master-page"===v.localName&&v.getAttributeNS(k,"page-layout-name")===s){G=v.getAttributeNS(k,"name");P="draw|page[draw|master-page-name="+G+"] {"+g+"}";G="office|body, draw|page[draw|master-page-name="+G+"] {"+p(m,X)+" }";try{b.insertRule(P,b.cssRules.length),b.insertRule(G,b.cssRules.length)}catch(ga){throw ga;}}v=v.nextElementSibling}else if("text"===aa){P="office|text {"+g+"}";G="office|body {width: "+m.getAttributeNS(a,"page-width")+ +";}";try{b.insertRule(P,b.cssRules.length),b.insertRule(G,b.cssRules.length)}catch(ha){throw ha;}}}else{g=d(e,g,h).join(",");m="";if(s=t.getDirectChild(h.element,k,"text-properties")){G=s;v=V="";P=1;s=""+p(G,C);Y=G.getAttributeNS(k,"text-underline-style");"solid"===Y&&(V+=" underline");Y=G.getAttributeNS(k,"text-line-through-style");"solid"===Y&&(V+=" line-through");V.length&&(s+="text-decoration:"+V+";");if(V=G.getAttributeNS(k,"font-name")||G.getAttributeNS(a,"font-family"))Y=S[V],s+="font-family: "+ +(Y||V)+";";Y=G.parentNode;if(G=n(Y)){for(;Y;){if(G=n(Y)){if("%"!==G.unit){v="font-size: "+G.value*P+G.unit+";";break}P*=G.value/100}G=Y;V=Y="";Y=null;"default-style"===G.localName?Y=null:(Y=G.getAttributeNS(k,"parent-style-name"),V=G.getAttributeNS(k,"family"),Y=J.getODFElementsWithXPath(M,Y?"//style:*[@style:name='"+Y+"'][@style:family='"+V+"']":"//style:default-style[@style:family='"+V+"']",odf.Namespaces.lookupNamespaceURI)[0])}v||(v="font-size: "+parseFloat(R)*P+ba.getUnits(R)+";");s+=v}m+=s}if(s= +t.getDirectChild(h.element,k,"paragraph-properties"))v=s,s=""+p(v,H),(P=t.getDirectChild(v,k,"background-image"))&&(G=P.getAttributeNS(z,"href"))&&(s=s+("background-image: url('odfkit:"+G+"');")+p(P,I)),(v=v.getAttributeNS(a,"line-height"))&&"normal"!==v&&(v=y.parseFoLineHeight(v),s="%"!==v.unit?s+("line-height: "+v.value+v.unit+";"):s+("line-height: "+v.value/100+";")),m+=s;if(s=t.getDirectChild(h.element,k,"graphic-properties"))G=s,s=""+p(G,D),v=G.getAttributeNS(r,"opacity"),P=G.getAttributeNS(r, +"fill"),G=G.getAttributeNS(r,"fill-color"),"solid"===P||"hatch"===P?G&&"none"!==G?(v=isNaN(parseFloat(v))?1:parseFloat(v)/100,P=G.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,l),(G=(P=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(P))?{r:parseInt(P[1],16),g:parseInt(P[2],16),b:parseInt(P[3],16)}:null)&&(s+="background-color: rgba("+G.r+","+G.g+","+G.b+","+v+");")):s+="background: none;":"none"===P&&(s+="background: none;"),m+=s;if(s=t.getDirectChild(h.element,k,"drawing-page-properties"))v=""+p(s, +D),"true"===s.getAttributeNS(x,"background-visible")&&(v+="background: none;"),m+=v;if(s=t.getDirectChild(h.element,k,"table-cell-properties"))s=""+p(s,F),m+=s;if(s=t.getDirectChild(h.element,k,"table-row-properties"))s=""+p(s,K),m+=s;if(s=t.getDirectChild(h.element,k,"table-column-properties"))s=""+p(s,O),m+=s;if(s=t.getDirectChild(h.element,k,"table-properties"))v=s,s=""+p(v,Z),v=v.getAttributeNS(u,"border-model"),"collapsing"===v?s+="border-collapse:collapse;":"separating"===v&&(s+="border-collapse:separate;"), +m+=s;if(0!==m.length)try{b.insertRule(g+"{"+m+"}",b.cssRules.length)}catch($){throw $;}}for(var ea in h.derivedStyles)h.derivedStyles.hasOwnProperty(ea)&&f(b,e,ea,h.derivedStyles[ea])}var r=odf.Namespaces.drawns,a=odf.Namespaces.fons,c=odf.Namespaces.officens,k=odf.Namespaces.stylens,e=odf.Namespaces.svgns,u=odf.Namespaces.tablens,w=odf.Namespaces.textns,z=odf.Namespaces.xlinkns,x=odf.Namespaces.presentationns,t=new core.DomUtils,v={graphic:"draw","drawing-page":"draw",paragraph:"text",presentation:"presentation", +ruby:"text",section:"text",table:"table","table-cell":"table","table-column":"table","table-row":"table",text:"text",list:"text",page:"office"},s={graphic:"circle connected control custom-shape ellipse frame g line measure page page-thumbnail path polygon polyline rect regular-polygon".split(" "),paragraph:"alphabetical-index-entry-template h illustration-index-entry-template index-source-style object-index-entry-template p table-index-entry-template table-of-content-entry-template user-index-entry-template".split(" "), +presentation:"caption circle connector control custom-shape ellipse frame g line measure page-thumbnail path polygon polyline rect regular-polygon".split(" "),"drawing-page":"caption circle connector control page custom-shape ellipse frame g line measure page-thumbnail path polygon polyline rect regular-polygon".split(" "),ruby:["ruby","ruby-text"],section:"alphabetical-index bibliography illustration-index index-title object-index section table-of-content table-index user-index".split(" "),table:["background", +"table"],"table-cell":"body covered-table-cell even-columns even-rows first-column first-row last-column last-row odd-columns odd-rows table-cell".split(" "),"table-column":["table-column"],"table-row":["table-row"],text:"a index-entry-chapter index-entry-link-end index-entry-link-start index-entry-page-number index-entry-span index-entry-tab-stop index-entry-text index-title-template linenumbering-configuration list-level-style-number list-level-style-bullet outline-level-style span".split(" "), +list:["list-item"]},C=[[a,"color","color"],[a,"background-color","background-color"],[a,"font-weight","font-weight"],[a,"font-style","font-style"]],I=[[k,"repeat","background-repeat"]],H=[[a,"background-color","background-color"],[a,"text-align","text-align"],[a,"text-indent","text-indent"],[a,"padding","padding"],[a,"padding-left","padding-left"],[a,"padding-right","padding-right"],[a,"padding-top","padding-top"],[a,"padding-bottom","padding-bottom"],[a,"border-left","border-left"],[a,"border-right", +"border-right"],[a,"border-top","border-top"],[a,"border-bottom","border-bottom"],[a,"margin","margin"],[a,"margin-left","margin-left"],[a,"margin-right","margin-right"],[a,"margin-top","margin-top"],[a,"margin-bottom","margin-bottom"],[a,"border","border"]],D=[[a,"background-color","background-color"],[a,"min-height","min-height"],[r,"stroke","border"],[e,"stroke-color","border-color"],[e,"stroke-width","border-width"],[a,"border","border"],[a,"border-left","border-left"],[a,"border-right","border-right"], +[a,"border-top","border-top"],[a,"border-bottom","border-bottom"]],F=[[a,"background-color","background-color"],[a,"border-left","border-left"],[a,"border-right","border-right"],[a,"border-top","border-top"],[a,"border-bottom","border-bottom"],[a,"border","border"]],O=[[k,"column-width","width"]],K=[[k,"row-height","height"],[a,"keep-together",null]],Z=[[k,"width","width"],[a,"margin-left","margin-left"],[a,"margin-right","margin-right"],[a,"margin-top","margin-top"],[a,"margin-bottom","margin-bottom"]], Q=[[a,"background-color","background-color"],[a,"padding","padding"],[a,"padding-left","padding-left"],[a,"padding-right","padding-right"],[a,"padding-top","padding-top"],[a,"padding-bottom","padding-bottom"],[a,"border","border"],[a,"border-left","border-left"],[a,"border-right","border-right"],[a,"border-top","border-top"],[a,"border-bottom","border-bottom"],[a,"margin","margin"],[a,"margin-left","margin-left"],[a,"margin-right","margin-right"],[a,"margin-top","margin-top"],[a,"margin-bottom","margin-bottom"]], -W=[[a,"page-width","width"],[a,"page-height","height"]],H={border:!0,"border-left":!0,"border-right":!0,"border-top":!0,"border-bottom":!0,"stroke-width":!0},T={},y=new odf.OdfUtils,aa,N,R,I=xmldom.XPath,ca=new core.CSSUnits;this.style2css=function(a,c,b,e,d){for(var g,m,l,h;c.cssRules.length;)c.deleteRule(c.cssRules.length-1);g=null;e&&(g=e.ownerDocument,N=e.parentNode);d&&(g=d.ownerDocument,N=d.parentNode);if(g)for(h in odf.Namespaces.forEachPrefix(function(a,b){m="@namespace "+a+" url("+b+");"; -try{c.insertRule(m,c.cssRules.length)}catch(e){}}),T=b,aa=a,R=runtime.getWindow().getComputedStyle(document.body,null).getPropertyValue("font-size")||"12pt",a=k(e),e=k(d),d={},u)if(u.hasOwnProperty(h))for(l in b=d[h]={},p(a[h],b),p(e[h],b),b)b.hasOwnProperty(l)&&f(c,h,l,b[l])}}; +X=[[a,"page-width","width"],[a,"page-height","height"]],G={border:!0,"border-left":!0,"border-right":!0,"border-top":!0,"border-bottom":!0,"stroke-width":!0},S={},y=new odf.OdfUtils,aa,M,R,J=xmldom.XPath,ba=new core.CSSUnits;this.style2css=function(a,c,b,d,e){for(var k,l,h,p;c.cssRules.length;)c.deleteRule(c.cssRules.length-1);k=null;d&&(k=d.ownerDocument,M=d.parentNode);e&&(k=e.ownerDocument,M=e.parentNode);if(k)for(p in odf.Namespaces.forEachPrefix(function(a,b){l="@namespace "+a+" url("+b+");"; +try{c.insertRule(l,c.cssRules.length)}catch(d){}}),S=b,aa=a,R=runtime.getWindow().getComputedStyle(document.body,null).getPropertyValue("font-size")||"12pt",a=m(d),d=m(e),e={},v)if(v.hasOwnProperty(p))for(h in b=e[p]={},g(a[p],b),g(d[p],b),b)b.hasOwnProperty(h)&&f(c,p,h,b[h])}}; // Input 34 /* @@ -928,34 +929,34 @@ ops.Canvas=function(){};ops.Canvas.prototype.getZoomLevel=function(){};ops.Canva @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -(function(){function k(){function a(e){b=!0;runtime.setTimeout(function(){try{e()}catch(d){runtime.log(String(d))}b=!1;0 text|list-item > *:first-child:before {"; -if(E=I.getAttributeNS(J,"style-name")){I=G[E];Q=Z.getFirstNonWhitespaceChild(I);I=void 0;if(Q)if("list-level-style-number"===Q.localName){I=Q.getAttributeNS(u,"num-format");E=Q.getAttributeNS(u,"num-suffix")||"";var R="",R={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},L=void 0,L=Q.getAttributeNS(u,"num-prefix")||"",L=R.hasOwnProperty(I)?L+(" counter(list, "+R[I]+")"):I?L+("'"+I+"';"):L+" ''";E&&(L+=" '"+E+"'");I=R="content: "+L+";"}else"list-level-style-image"===Q.localName? -I="content: none;":"list-level-style-bullet"===Q.localName&&(I="content: '"+Q.getAttributeNS(J,"bullet-char")+"';");Q=I}if(C){for(I=w[C];I;)I=w[I];N+="counter-increment:"+C+";";Q?(Q=Q.replace("list",C),N+=Q):N+="content:counter("+C+");"}else C="",Q?(Q=Q.replace("list",B),N+=Q):N+="content: counter("+B+");",N+="counter-increment:"+B+";",h.insertRule("text|list#"+B+" {counter-reset:"+B+"}",h.cssRules.length);N+="}";w[B]=C;N&&h.insertRule(N,h.cssRules.length)}S.insertBefore($,S.firstChild);ba.setZoomableElement(S); -aa(l);if(!e&&(l=[Y],ea.hasOwnProperty("statereadychange")))for(h=ea.statereadychange,Q=0;Q text|list-item > *:first-child:before {"; +if(E=J.getAttributeNS(I,"style-name")){J=H[E];Q=Z.getFirstNonWhitespaceChild(J);J=void 0;if(Q)if("list-level-style-number"===Q.localName){J=Q.getAttributeNS(v,"num-format");E=Q.getAttributeNS(v,"num-suffix")||"";var R="",R={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},L=void 0,L=Q.getAttributeNS(v,"num-prefix")||"",L=R.hasOwnProperty(J)?L+(" counter(list, "+R[J]+")"):J?L+("'"+J+"';"):L+" ''";E&&(L+=" '"+E+"'");J=R="content: "+L+";"}else"list-level-style-image"===Q.localName? +J="content: none;":"list-level-style-bullet"===Q.localName&&(J="content: '"+Q.getAttributeNS(I,"bullet-char")+"';");Q=J}if(B){for(J=w[B];J;)J=w[J];M+="counter-increment:"+B+";";Q?(Q=Q.replace("list",B),M+=Q):M+="content:counter("+B+");"}else B="",Q?(Q=Q.replace("list",A),M+=Q):M+="content: counter("+A+");",M+="counter-increment:"+A+";",h.insertRule("text|list#"+A+" {counter-reset:"+A+"}",h.cssRules.length);M+="}";w[A]=B;M&&h.insertRule(M,h.cssRules.length)}U.insertBefore($,U.firstChild);ca.setZoomableElement(U); +aa(k);if(!e&&(k=[N],ea.hasOwnProperty("statereadychange")))for(h=ea.statereadychange,Q=0;Q=c?f=d(a,c-1,b,!0):a.nodeType===Node.TEXT_NODE&& -0a?-1:1;for(a=Math.abs(a);0q?p.previousPosition():p.nextPosition());)if(H.check(),n.acceptPosition(p)===c&&(A+=1,r=p.container(),F=d(r,p.unfilteredDomOffset(),W),F.top!==K)){if(F.top!==Q&&Q!==K)break;Q=F.top;F=Math.abs(Z-F.left);if(null===J||Fa?(e=q.previousPosition, -g=-1):(e=q.nextPosition,g=1);for(k=d(q.container(),q.unfilteredDomOffset(),s);e.call(q);)if(f.acceptPosition(q)===c){if(l.getParagraphElement(q.getCurrentNode())!==p)break;n=d(q.container(),q.unfilteredDomOffset(),s);if(n.bottom!==k.bottom&&(k=n.top>=k.top&&n.bottomk.bottom,!k))break;r+=g;k=n}s.detach();return r}var l=new odf.OdfUtils,f,c=core.PositionFilter.FilterResult.FILTER_ACCEPT;this.getStepCounter=function(){return{convertForwardStepsBetweenFilters:n,convertBackwardStepsBetweenFilters:g, -countLinesSteps:q,countStepsToLineBoundary:r}};(function(){f=gui.SelectionMover.createPositionIterator(h);var a=h.ownerDocument.createRange();a.setStart(f.container(),f.unfilteredDomOffset());a.collapse(!0);k.setSelectedRange(a)})()}; -gui.SelectionMover.createPositionIterator=function(k){var h=new function(){this.acceptNode=function(b){return b&&"urn:webodf:names:cursor"!==b.namespaceURI&&"urn:webodf:names:editinfo"!==b.namespaceURI?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}};return new core.PositionIterator(k,5,h,!1)};(function(){return gui.SelectionMover})(); +gui.SelectionMover=function(m,h){function b(){r.setUnfilteredPosition(m.getNode(),0);return r}function g(a,b){var d,f=null;a&&0=b?f=d(a,b-1,e,!0):a.nodeType===Node.TEXT_NODE&& +0c?-1:1;for(c=Math.abs(c);0n?q.previousPosition():q.nextPosition());)if(G.check(),m.acceptPosition(q)===a&&(C+=1,r=q.container(),F=d(r,q.unfilteredDomOffset(),X),F.top!==K)){if(F.top!==Q&&Q!==K)break;Q=F.top;F=Math.abs(Z-F.left);if(null===I||Fc?(e=m.previousPosition, +g=-1):(e=m.nextPosition,g=1);for(l=d(m.container(),m.unfilteredDomOffset(),r);e.call(m);)if(k.acceptPosition(m)===a){if(f.getParagraphElement(m.getCurrentNode())!==n)break;p=d(m.container(),m.unfilteredDomOffset(),r);if(p.bottom!==l.bottom&&(l=p.top>=l.top&&p.bottoml.bottom,!l))break;q+=g;l=p}r.detach();return q}var f=new odf.OdfUtils,r,a=core.PositionFilter.FilterResult.FILTER_ACCEPT;this.getStepCounter=function(){return{convertForwardStepsBetweenFilters:p,convertBackwardStepsBetweenFilters:n, +countLinesSteps:l,countStepsToLineBoundary:q}};(function(){r=gui.SelectionMover.createPositionIterator(h);var a=h.ownerDocument.createRange();a.setStart(r.container(),r.unfilteredDomOffset());a.collapse(!0);m.setSelectedRange(a)})()}; +gui.SelectionMover.createPositionIterator=function(m){var h=new function(){this.acceptNode=function(b){return b&&"urn:webodf:names:cursor"!==b.namespaceURI&&"urn:webodf:names:editinfo"!==b.namespaceURI?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}};return new core.PositionIterator(m,5,h,!1)};(function(){return gui.SelectionMover})(); // Input 38 /* @@ -1067,12 +1068,12 @@ gui.SelectionMover.createPositionIterator=function(k){var h=new function(){this. @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -ops.Document=function(){};ops.Document.prototype.getMemberIds=function(){};ops.Document.prototype.removeCursor=function(k){};ops.Document.prototype.getDocumentElement=function(){};ops.Document.prototype.getRootNode=function(){};ops.Document.prototype.getDOMDocument=function(){};ops.Document.prototype.cloneDocumentElement=function(){};ops.Document.prototype.setDocumentElement=function(k){};ops.Document.prototype.subscribe=function(k,h){};ops.Document.prototype.unsubscribe=function(k,h){}; -ops.Document.prototype.getCanvas=function(){};ops.Document.prototype.createRootFilter=function(k){};ops.Document.signalCursorAdded="cursor/added";ops.Document.signalCursorRemoved="cursor/removed";ops.Document.signalCursorMoved="cursor/moved";ops.Document.signalMemberAdded="member/added";ops.Document.signalMemberUpdated="member/updated";ops.Document.signalMemberRemoved="member/removed"; +ops.Document=function(){};ops.Document.prototype.getMemberIds=function(){};ops.Document.prototype.removeCursor=function(m){};ops.Document.prototype.getDocumentElement=function(){};ops.Document.prototype.getRootNode=function(){};ops.Document.prototype.getDOMDocument=function(){};ops.Document.prototype.cloneDocumentElement=function(){};ops.Document.prototype.setDocumentElement=function(m){};ops.Document.prototype.subscribe=function(m,h){};ops.Document.prototype.unsubscribe=function(m,h){}; +ops.Document.prototype.getCanvas=function(){};ops.Document.prototype.createRootFilter=function(m){};ops.Document.signalCursorAdded="cursor/added";ops.Document.signalCursorRemoved="cursor/removed";ops.Document.signalCursorMoved="cursor/moved";ops.Document.signalMemberAdded="member/added";ops.Document.signalMemberUpdated="member/updated";ops.Document.signalMemberRemoved="member/removed"; // Input 39 -ops.OdtCursor=function(k,h){var b=this,p={},d,n,g,q=new core.EventNotifier([ops.OdtCursor.signalCursorUpdated]);this.removeFromDocument=function(){g.remove()};this.subscribe=function(b,d){q.subscribe(b,d)};this.unsubscribe=function(b,d){q.unsubscribe(b,d)};this.getStepCounter=function(){return n.getStepCounter()};this.getMemberId=function(){return k};this.getNode=function(){return g.getNode()};this.getAnchorNode=function(){return g.getAnchorNode()};this.getSelectedRange=function(){return g.getSelectedRange()}; -this.setSelectedRange=function(d,l){g.setSelectedRange(d,l);q.emit(ops.OdtCursor.signalCursorUpdated,b)};this.hasForwardSelection=function(){return g.hasForwardSelection()};this.getDocument=function(){return h};this.getSelectionType=function(){return d};this.setSelectionType=function(b){p.hasOwnProperty(b)?d=b:runtime.log("Invalid selection type: "+b)};this.resetSelectionType=function(){b.setSelectionType(ops.OdtCursor.RangeSelection)};g=new core.Cursor(h.getDOMDocument(),k);n=new gui.SelectionMover(g, -h.getRootNode());p[ops.OdtCursor.RangeSelection]=!0;p[ops.OdtCursor.RegionSelection]=!0;b.resetSelectionType()};ops.OdtCursor.RangeSelection="Range";ops.OdtCursor.RegionSelection="Region";ops.OdtCursor.signalCursorUpdated="cursorUpdated";(function(){return ops.OdtCursor})(); +ops.OdtCursor=function(m,h){var b=this,g={},d,p,n,l=new core.EventNotifier([ops.OdtCursor.signalCursorUpdated]);this.removeFromDocument=function(){n.remove()};this.subscribe=function(b,d){l.subscribe(b,d)};this.unsubscribe=function(b,d){l.unsubscribe(b,d)};this.getStepCounter=function(){return p.getStepCounter()};this.getMemberId=function(){return m};this.getNode=function(){return n.getNode()};this.getAnchorNode=function(){return n.getAnchorNode()};this.getSelectedRange=function(){return n.getSelectedRange()}; +this.setSelectedRange=function(d,f){n.setSelectedRange(d,f);l.emit(ops.OdtCursor.signalCursorUpdated,b)};this.hasForwardSelection=function(){return n.hasForwardSelection()};this.getDocument=function(){return h};this.getSelectionType=function(){return d};this.setSelectionType=function(b){g.hasOwnProperty(b)?d=b:runtime.log("Invalid selection type: "+b)};this.resetSelectionType=function(){b.setSelectionType(ops.OdtCursor.RangeSelection)};n=new core.Cursor(h.getDOMDocument(),m);p=new gui.SelectionMover(n, +h.getRootNode());g[ops.OdtCursor.RangeSelection]=!0;g[ops.OdtCursor.RegionSelection]=!0;b.resetSelectionType()};ops.OdtCursor.RangeSelection="Range";ops.OdtCursor.RegionSelection="Region";ops.OdtCursor.signalCursorUpdated="cursorUpdated";(function(){return ops.OdtCursor})(); // Input 40 /* @@ -1111,7 +1112,7 @@ h.getRootNode());p[ops.OdtCursor.RangeSelection]=!0;p[ops.OdtCursor.RegionSelect @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -ops.Operation=function(){};ops.Operation.prototype.init=function(k){};ops.Operation.prototype.execute=function(k){};ops.Operation.prototype.spec=function(){}; +ops.Operation=function(){};ops.Operation.prototype.init=function(m){};ops.Operation.prototype.execute=function(m){};ops.Operation.prototype.spec=function(){}; // Input 41 /* @@ -1137,14 +1138,14 @@ ops.Operation=function(){};ops.Operation.prototype.init=function(k){};ops.Operat @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -(function(){var k=0;ops.StepsCache=function(h,b,p){function d(a,c,e){this.nodeId=a;this.steps=c;this.node=e;this.previousBookmark=this.nextBookmark=null;this.setIteratorPosition=function(a){a.setPositionBeforeElement(e);do if(b.acceptPosition(a)===u)break;while(a.nextPosition())}}function n(a,c,e){this.nodeId=a;this.steps=c;this.node=e;this.previousBookmark=this.nextBookmark=null;this.setIteratorPosition=function(a){a.setUnfilteredPosition(e,0);do if(b.acceptPosition(a)===u)break;while(a.nextPosition())}} -function g(a,c){var b="["+a.nodeId;c&&(b+=" => "+c.nodeId);return b+"]"}function q(){for(var a=x,c,b,e,d=new core.LoopWatchDog(0,1E5);a;){d.check();(c=a.previousBookmark)?runtime.assert(c.nextBookmark===a,"Broken bookmark link to previous @"+g(c,a)):(runtime.assert(a===x,"Broken bookmark link @"+g(a)),runtime.assert(void 0===v||x.steps<=v,"Base point is damaged @"+g(a)));(b=a.nextBookmark)&&runtime.assert(b.previousBookmark===a,"Broken bookmark link to next @"+g(a,b));if(void 0===v||a.steps<=v)runtime.assert(z.containsNode(h, -a.node),"Disconnected node is being reported as undamaged @"+g(a)),c&&(e=a.node.compareDocumentPosition(c.node),runtime.assert(0===e||0!==(e&Node.DOCUMENT_POSITION_PRECEDING),"Bookmark order with previous does not reflect DOM order @"+g(c,a))),b&&z.containsNode(h,b.node)&&(e=a.node.compareDocumentPosition(b.node),runtime.assert(0===e||0!==(e&Node.DOCUMENT_POSITION_FOLLOWING),"Bookmark order with next does not reflect DOM order @"+g(a,b)));a=a.nextBookmark}}function r(a){var c="";a.nodeType===Node.ELEMENT_NODE&& -(c=a.getAttributeNS(m,"nodeId"));return c}function l(a){var c=k.toString();a.setAttributeNS(m,"nodeId",c);k+=1;return c}function f(a){var c,b,d=new core.LoopWatchDog(0,1E4);void 0!==v&&a>v&&(a=v);for(c=Math.floor(a/p)*p;!b&&0!==c;)b=e[c],c-=p;for(b=b||x;b.nextBookmark&&b.nextBookmark.steps<=a;)d.check(),b=b.nextBookmark;return b}function c(a){a.previousBookmark&&(a.previousBookmark.nextBookmark=a.nextBookmark);a.nextBookmark&&(a.nextBookmark.previousBookmark=a.previousBookmark)}function a(a){for(var c, -b=null;!b&&a&&a!==h;)(c=r(a))&&(b=t[c])&&b.node!==a&&(runtime.log("Cloned node detected. Creating new bookmark"),b=null,a.removeAttributeNS(m,"nodeId")),a=a.parentNode;return b}var m="urn:webodf:names:steps",e={},t={},w=new odf.OdfUtils,z=new core.DomUtils,x,v,u=core.PositionFilter.FilterResult.FILTER_ACCEPT,s;this.updateCache=function(a,b,g){var m;m=b.getCurrentNode();if(b.isBeforeNode()&&w.isParagraph(m)){g||(a+=1);b=a;var k,n,q;if(void 0!==v&&vb.steps)e[a]=m;s()}}; -this.setToClosestStep=function(a,c){var b;s();b=f(a);b.setIteratorPosition(c);return b.steps};this.setToClosestDomPoint=function(c,b,d){var g,m;s();if(c===h&&0===b)g=x;else if(c===h&&b===h.childNodes.length)for(m in g=x,e)e.hasOwnProperty(m)&&(c=e[m],c.steps>g.steps&&(g=c));else if(g=a(c.childNodes.item(b)||c),!g)for(d.setUnfilteredPosition(c,b);!g&&d.previousNode();)g=a(d.getCurrentNode());g=g||x;void 0!==v&&g.steps>v&&(g=f(v));g.setIteratorPosition(d);return g.steps};this.damageCacheAfterStep=function(a){0> -a&&(a=0);void 0===v?v=a:at&&(a=t);for(c=Math.floor(a/g)*g;!b&&0!==c;)b=e[c],c-=g;for(b=b||x;b.nextBookmark&&b.nextBookmark.steps<=a;)d.check(),b=b.nextBookmark;return b}function a(a){a.previousBookmark&&(a.previousBookmark.nextBookmark=a.nextBookmark);a.nextBookmark&&(a.nextBookmark.previousBookmark=a.previousBookmark)}function c(a){for(var c, +b=null;!b&&a&&a!==h;)(c=q(a))&&(b=u[c])&&b.node!==a&&(runtime.log("Cloned node detected. Creating new bookmark"),b=null,a.removeAttributeNS(k,"nodeId")),a=a.parentNode;return b}var k="urn:webodf:names:steps",e={},u={},w=new odf.OdfUtils,z=new core.DomUtils,x,t,v=core.PositionFilter.FilterResult.FILTER_ACCEPT,s;this.updateCache=function(c,b,k){var l;l=b.getCurrentNode();if(b.isBeforeNode()&&w.isParagraph(l)){k||(c+=1);b=c;var m,p,n;if(void 0!==t&&tb.steps)e[c]=l;s()}}; +this.setToClosestStep=function(a,c){var b;s();b=r(a);b.setIteratorPosition(c);return b.steps};this.setToClosestDomPoint=function(a,b,d){var f,k;s();if(a===h&&0===b)f=x;else if(a===h&&b===h.childNodes.length)for(k in f=x,e)e.hasOwnProperty(k)&&(a=e[k],a.steps>f.steps&&(f=a));else if(f=c(a.childNodes.item(b)||a),!f)for(d.setUnfilteredPosition(a,b);!f&&d.previousNode();)f=c(d.getCurrentNode());f=f||x;void 0!==t&&f.steps>t&&(f=r(t));f.setIteratorPosition(d);return f.steps};this.damageCacheAfterStep=function(a){0> +a&&(a=0);void 0===t?t=a:ac)throw new RangeError("Requested steps is negative ("+c+")");d();for(a=q.setToClosestStep(c,l);ar.comparePoints(g,0,c,a),c=g,a=a?0:g.childNodes.length);l.setUnfilteredPosition(c,a);n(l,m)||l.setUnfilteredPosition(c,a);m=l.container();a=l.unfilteredDomOffset();c=q.setToClosestDomPoint(m,a,l);if(0>r.comparePoints(l.container(),l.unfilteredDomOffset(),m,a))return 0a)throw new RangeError("Requested steps is negative ("+a+")");d();for(c=l.setToClosestStep(a,f);cq.comparePoints(n,0,a,c),a=n,c=c?0:n.childNodes.length);f.setUnfilteredPosition(a,c);p(f,k)||f.setUnfilteredPosition(a,c);k=f.container();c=f.unfilteredDomOffset();a=l.setToClosestDomPoint(k,c,f);if(0>q.comparePoints(f.container(),f.unfilteredDomOffset(),k,c))return 0=d;d+=1){b=c.container();e=c.unfilteredDomOffset();if(b.nodeType===Node.TEXT_NODE&&" "===b.data[e]&&a.isSignificantWhitespace(b,e)){runtime.assert(" "===b.data[e],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var f=b.ownerDocument.createElementNS(odf.Namespaces.textns, -"text:s"),m=b.parentNode,l=b;f.appendChild(b.ownerDocument.createTextNode(" "));1===b.length?m.replaceChild(f,b):(b.deleteData(e,1),0=e;e+=1){b=a.container();d=a.unfilteredDomOffset();if(b.nodeType===Node.TEXT_NODE&&" "===b.data[d]&&c.isSignificantWhitespace(b,d)){runtime.assert(" "===b.data[d],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var f=b.ownerDocument.createElementNS(odf.Namespaces.textns, +"text:s"),k=b.parentNode,g=b;f.appendChild(b.ownerDocument.createTextNode(" "));1===b.length?k.replaceChild(f,b):(b.deleteData(d,1),0= -g.textNode.length?null:g.textNode.splitText(g.offset));for(l=g.textNode;l!==r;){l=l.parentNode;f=l.cloneNode(!1);c&&f.appendChild(c);if(a)for(;a&&a.nextSibling;)f.appendChild(a.nextSibling);else for(;l.firstChild;)f.appendChild(l.firstChild);l.parentNode.insertBefore(f,l.nextSibling);a=l;c=f}d.isListItem(c)&&(c=c.childNodes.item(0));0===g.textNode.length&&g.textNode.parentNode.removeChild(g.textNode);n.emit(ops.OdtDocument.signalStepsInserted,{position:b,length:1});m&&p&&(n.moveCursor(k,b+1,0),n.emit(ops.Document.signalCursorMoved, -m));n.fixCursorPositions();n.getOdfCanvas().refreshSize();n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:q,memberId:k,timeStamp:h});n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:c,memberId:k,timeStamp:h});n.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:k,timestamp:h,position:b,moveCursor:p}}}; +ops.OpSplitParagraph=function(){var m,h,b,g,d;this.init=function(p){m=p.memberid;h=p.timestamp;b=p.position;g="true"===p.moveCursor||!0===p.moveCursor;d=new odf.OdfUtils};this.isEdit=!0;this.group=void 0;this.execute=function(p){var n,l,q,f,r,a,c,k=p.getCursor(m);p.upgradeWhitespacesAtPosition(b);n=p.getTextNodeAtStep(b);if(!n)return!1;l=p.getParagraphElement(n.textNode);if(!l)return!1;q=d.isListItem(l.parentNode)?l.parentNode:l;0===n.offset?(c=n.textNode.previousSibling,a=null):(c=n.textNode,a=n.offset>= +n.textNode.length?null:n.textNode.splitText(n.offset));for(f=n.textNode;f!==q;){f=f.parentNode;r=f.cloneNode(!1);a&&r.appendChild(a);if(c)for(;c&&c.nextSibling;)r.appendChild(c.nextSibling);else for(;f.firstChild;)r.appendChild(f.firstChild);f.parentNode.insertBefore(r,f.nextSibling);c=f;a=r}d.isListItem(a)&&(a=a.childNodes.item(0));0===n.textNode.length&&n.textNode.parentNode.removeChild(n.textNode);p.emit(ops.OdtDocument.signalStepsInserted,{position:b,length:1});k&&g&&(p.moveCursor(m,b+1,0),p.emit(ops.Document.signalCursorMoved, +k));p.fixCursorPositions();p.getOdfCanvas().refreshSize();p.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:l,memberId:m,timeStamp:h});p.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,memberId:m,timeStamp:h});p.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:m,timestamp:h,position:b,moveCursor:g}}}; // Input 67 /* @@ -2174,8 +2175,8 @@ m));n.fixCursorPositions();n.getOdfCanvas().refreshSize();n.emit(ops.OdtDocument @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -ops.OpUpdateMember=function(){function k(b){var d="//dc:creator[@editinfo:memberid='"+h+"']";b=xmldom.XPath.getODFElementsWithXPath(b.getRootNode(),d,function(b){return"editinfo"===b?"urn:webodf:names:editinfo":odf.Namespaces.lookupNamespaceURI(b)});for(d=0;dd(f,h))&&(h=g));f=h;h=k.getDocument().getCanvas();e=h.getZoomLevel();h=a.getBoundingClientRect(h.getSizer());f?(r.style.top="0",g=a.getBoundingClientRect(r),8>f.height&&(f={top:f.top-(8-f.height)/2,height:8}),r.style.height=a.adaptRangeDifferenceToZoomLevel(f.height, -e)+"px",r.style.top=a.adaptRangeDifferenceToZoomLevel(f.top-g.top,e)+"px"):(r.style.height="1em",r.style.top="5%");c&&(f=runtime.getWindow().getComputedStyle(r,null),g=a.getBoundingClientRect(r),c.style.bottom=a.adaptRangeDifferenceToZoomLevel(h.bottom-g.bottom,e)+"px",c.style.left=a.adaptRangeDifferenceToZoomLevel(g.right-h.left,e)+"px",f.font?c.style.font=f.font:(c.style.fontStyle=f.fontStyle,c.style.fontVariant=f.fontVariant,c.style.fontWeight=f.fontWeight,c.style.fontSize=f.fontSize,c.style.lineHeight= -f.lineHeight,c.style.fontFamily=f.fontFamily))}if(z){var h=k.getDocument().getCanvas().getElement().parentNode,p;g=h.offsetWidth-h.clientWidth+5;m=h.offsetHeight-h.clientHeight+5;p=r.getBoundingClientRect();e=p.left-g;f=p.top-m;g=p.right+g;m=p.bottom+m;p=h.getBoundingClientRect();fp.bottom&&(h.scrollTop+=m-p.bottom);ep.right&&(h.scrollLeft+=g-p.right)}}u.isFocused!==v.isFocused&&l.markAsFocussed(v.isFocused);n();x=z=w=!1}function q(a){f.removeChild(r); -a()}var r,l,f,c,a=new core.DomUtils,m=new core.Async,e,t,w=!1,z=!1,x=!1,v={isFocused:!1,isShown:!0,visibility:"hidden"},u={isFocused:!v.isFocused,isShown:!v.isShown,visibility:"hidden"};this.handleUpdate=function(){x=!0;"hidden"!==v.visibility&&(v.visibility="hidden",r.style.visibility="hidden");e.trigger()};this.refreshCursorBlinking=function(){w=!0;e.trigger()};this.setFocus=function(){v.isFocused=!0;e.trigger()};this.removeFocus=function(){v.isFocused=!1;e.trigger()};this.show=function(){v.isShown= -!0;e.trigger()};this.hide=function(){v.isShown=!1;e.trigger()};this.setAvatarImageUrl=function(a){l.setImageUrl(a)};this.setColor=function(a){r.style.borderColor=a;l.setColor(a)};this.getCursor=function(){return k};this.getFocusElement=function(){return r};this.toggleHandleVisibility=function(){l.isVisible()?l.hide():l.show()};this.showHandle=function(){l.show()};this.hideHandle=function(){l.hide()};this.setOverlayElement=function(a){c=a;x=!0;e.trigger()};this.ensureVisible=function(){z=!0;e.trigger()}; -this.destroy=function(a){m.destroyAll([e.destroy,t.destroy,l.destroy,q],a)};(function(){var a=k.getDocument().getDOMDocument();r=a.createElementNS(a.documentElement.namespaceURI,"span");r.className="caret";r.style.top="5%";f=k.getNode();f.appendChild(r);l=new gui.Avatar(f,h);e=new core.ScheduledTask(g,0);t=new core.ScheduledTask(p,500);e.triggerImmediate()})()}; +gui.Caret=function(m,h,b){function g(){q.style.opacity="0"===q.style.opacity?"1":"0";u.trigger()}function d(a,b){var c=a.getBoundingClientRect(),d=0,e=0;c&&b&&(d=Math.max(c.top,b.top),e=Math.min(c.bottom,b.bottom));return e-d}function p(){Object.keys(t).forEach(function(a){v[a]=t[a]})}function n(){var e,k,g,l;if(!1===t.isShown||m.getSelectionType()!==ops.OdtCursor.RangeSelection||!b&&!m.getSelectedRange().collapsed)t.visibility="hidden",q.style.visibility="hidden",u.cancel();else{t.visibility="visible"; +q.style.visibility="visible";if(!1===t.isFocused)q.style.opacity="1",u.cancel();else{if(w||v.visibility!==t.visibility)q.style.opacity="1",u.cancel();u.trigger()}if(x||z||v.visibility!==t.visibility){e=m.getSelectedRange().cloneRange();k=m.getNode();var h=null;k.previousSibling&&(g=k.previousSibling.nodeType===Node.TEXT_NODE?k.previousSibling.textContent.length:k.previousSibling.childNodes.length,e.setStart(k.previousSibling,0d(k,h))&&(h=g));k=h;h=m.getDocument().getCanvas();e=h.getZoomLevel();h=c.getBoundingClientRect(h.getSizer());k?(q.style.top="0",g=c.getBoundingClientRect(q),8>k.height&&(k={top:k.top-(8-k.height)/2,height:8}),q.style.height=c.adaptRangeDifferenceToZoomLevel(k.height, +e)+"px",q.style.top=c.adaptRangeDifferenceToZoomLevel(k.top-g.top,e)+"px"):(q.style.height="1em",q.style.top="5%");a&&(k=runtime.getWindow().getComputedStyle(q,null),g=c.getBoundingClientRect(q),a.style.bottom=c.adaptRangeDifferenceToZoomLevel(h.bottom-g.bottom,e)+"px",a.style.left=c.adaptRangeDifferenceToZoomLevel(g.right-h.left,e)+"px",k.font?a.style.font=k.font:(a.style.fontStyle=k.fontStyle,a.style.fontVariant=k.fontVariant,a.style.fontWeight=k.fontWeight,a.style.fontSize=k.fontSize,a.style.lineHeight= +k.lineHeight,a.style.fontFamily=k.fontFamily))}if(z){var h=m.getDocument().getCanvas().getElement().parentNode,n;g=h.offsetWidth-h.clientWidth+5;l=h.offsetHeight-h.clientHeight+5;n=q.getBoundingClientRect();e=n.left-g;k=n.top-l;g=n.right+g;l=n.bottom+l;n=h.getBoundingClientRect();kn.bottom&&(h.scrollTop+=l-n.bottom);en.right&&(h.scrollLeft+=g-n.right)}}v.isFocused!==t.isFocused&&f.markAsFocussed(t.isFocused);p();x=z=w=!1}function l(a){r.removeChild(q); +a()}var q,f,r,a,c=new core.DomUtils,k=new core.Async,e,u,w=!1,z=!1,x=!1,t={isFocused:!1,isShown:!0,visibility:"hidden"},v={isFocused:!t.isFocused,isShown:!t.isShown,visibility:"hidden"};this.handleUpdate=function(){x=!0;"hidden"!==t.visibility&&(t.visibility="hidden",q.style.visibility="hidden");e.trigger()};this.refreshCursorBlinking=function(){w=!0;e.trigger()};this.setFocus=function(){t.isFocused=!0;e.trigger()};this.removeFocus=function(){t.isFocused=!1;e.trigger()};this.show=function(){t.isShown= +!0;e.trigger()};this.hide=function(){t.isShown=!1;e.trigger()};this.setAvatarImageUrl=function(a){f.setImageUrl(a)};this.setColor=function(a){q.style.borderColor=a;f.setColor(a)};this.getCursor=function(){return m};this.getFocusElement=function(){return q};this.toggleHandleVisibility=function(){f.isVisible()?f.hide():f.show()};this.showHandle=function(){f.show()};this.hideHandle=function(){f.hide()};this.setOverlayElement=function(b){a=b;x=!0;e.trigger()};this.ensureVisible=function(){z=!0;e.trigger()}; +this.destroy=function(a){k.destroyAll([e.destroy,u.destroy,f.destroy,l],a)};(function(){var a=m.getDocument().getDOMDocument();q=a.createElementNS(a.documentElement.namespaceURI,"span");q.className="caret";q.style.top="5%";r=m.getNode();r.appendChild(q);f=new gui.Avatar(r,h);e=new core.ScheduledTask(n,0);u=new core.ScheduledTask(g,500);e.triggerImmediate()})()}; // Input 77 /* @@ -2482,8 +2483,8 @@ this.destroy=function(a){m.destroyAll([e.destroy,t.destroy,l.destroy,q],a)};(fun @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -odf.TextSerializer=function(){function k(p){var d="",n=h.filter?h.filter.acceptNode(p):NodeFilter.FILTER_ACCEPT,g=p.nodeType,q;if((n===NodeFilter.FILTER_ACCEPT||n===NodeFilter.FILTER_SKIP)&&b.isTextContentContainingNode(p))for(q=p.firstChild;q;)d+=k(q),q=q.nextSibling;n===NodeFilter.FILTER_ACCEPT&&(g===Node.ELEMENT_NODE&&b.isParagraph(p)?d+="\n":g===Node.TEXT_NODE&&p.textContent&&(d+=p.textContent));return d}var h=this,b=new odf.OdfUtils;this.filter=null;this.writeToString=function(b){if(!b)return""; -b=k(b);"\n"===b[b.length-1]&&(b=b.substr(0,b.length-1));return b}}; +odf.TextSerializer=function(){function m(g){var d="",p=h.filter?h.filter.acceptNode(g):NodeFilter.FILTER_ACCEPT,n=g.nodeType,l;if((p===NodeFilter.FILTER_ACCEPT||p===NodeFilter.FILTER_SKIP)&&b.isTextContentContainingNode(g))for(l=g.firstChild;l;)d+=m(l),l=l.nextSibling;p===NodeFilter.FILTER_ACCEPT&&(n===Node.ELEMENT_NODE&&b.isParagraph(g)?d+="\n":n===Node.TEXT_NODE&&g.textContent&&(d+=g.textContent));return d}var h=this,b=new odf.OdfUtils;this.filter=null;this.writeToString=function(b){if(!b)return""; +b=m(b);"\n"===b[b.length-1]&&(b=b.substr(0,b.length-1));return b}}; // Input 78 /* @@ -2509,7 +2510,7 @@ b=k(b);"\n"===b[b.length-1]&&(b=b.substr(0,b.length-1));return b}}; @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.MimeDataExporter=function(){var k,h;this.exportRangeToDataTransfer=function(b,h){var d;d=h.startContainer.ownerDocument.createElement("span");d.appendChild(h.cloneContents());d=k.writeToString(d);try{b.setData("text/plain",d)}catch(n){b.setData("Text",d)}};k=new odf.TextSerializer;h=new odf.OdfNodeFilter;k.filter=h}; +gui.MimeDataExporter=function(){var m,h;this.exportRangeToDataTransfer=function(b,g){var d;d=g.startContainer.ownerDocument.createElement("span");d.appendChild(g.cloneContents());d=m.writeToString(d);try{b.setData("text/plain",d)}catch(h){b.setData("Text",d)}};m=new odf.TextSerializer;h=new odf.OdfNodeFilter;m.filter=h}; // Input 79 /* @@ -2548,7 +2549,7 @@ gui.MimeDataExporter=function(){var k,h;this.exportRangeToDataTransfer=function( @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.Clipboard=function(k){this.setDataFromRange=function(h,b){var p,d=h.clipboardData;p=runtime.getWindow();!d&&p&&(d=p.clipboardData);d?(p=!0,k.exportRangeToDataTransfer(d,b),h.preventDefault()):p=!1;return p}}; +gui.Clipboard=function(m){this.setDataFromRange=function(h,b){var g,d=h.clipboardData;g=runtime.getWindow();!d&&g&&(d=g.clipboardData);d?(g=!0,m.exportRangeToDataTransfer(d,b),h.preventDefault()):g=!1;return g}}; // Input 80 /* @@ -2587,8 +2588,8 @@ gui.Clipboard=function(k){this.setDataFromRange=function(h,b){var p,d=h.clipboar @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.StyleSummary=function(k){function h(b,g){var h=b+"|"+g,p;d.hasOwnProperty(h)||(p=[],k.forEach(function(d){d=(d=d[b])&&d[g];-1===p.indexOf(d)&&p.push(d)}),d[h]=p);return d[h]}function b(b,d,k){return function(){var p=h(b,d);return k.length>=p.length&&p.every(function(b){return-1!==k.indexOf(b)})}}function p(b,d){var k=h(b,d);return 1===k.length?k[0]:void 0}var d={};this.getPropertyValues=h;this.getCommonValue=p;this.isBold=b("style:text-properties","fo:font-weight",["bold"]);this.isItalic=b("style:text-properties", -"fo:font-style",["italic"]);this.hasUnderline=b("style:text-properties","style:text-underline-style",["solid"]);this.hasStrikeThrough=b("style:text-properties","style:text-line-through-style",["solid"]);this.fontSize=function(){var b=p("style:text-properties","fo:font-size");return b&&parseFloat(b)};this.fontName=function(){return p("style:text-properties","style:font-name")};this.isAlignedLeft=b("style:paragraph-properties","fo:text-align",["left","start"]);this.isAlignedCenter=b("style:paragraph-properties", +gui.StyleSummary=function(m){function h(b,g){var h=b+"|"+g,q;d.hasOwnProperty(h)||(q=[],m.forEach(function(d){d=(d=d[b])&&d[g];-1===q.indexOf(d)&&q.push(d)}),d[h]=q);return d[h]}function b(b,d,g){return function(){var m=h(b,d);return g.length>=m.length&&m.every(function(b){return-1!==g.indexOf(b)})}}function g(b,d){var g=h(b,d);return 1===g.length?g[0]:void 0}var d={};this.getPropertyValues=h;this.getCommonValue=g;this.isBold=b("style:text-properties","fo:font-weight",["bold"]);this.isItalic=b("style:text-properties", +"fo:font-style",["italic"]);this.hasUnderline=b("style:text-properties","style:text-underline-style",["solid"]);this.hasStrikeThrough=b("style:text-properties","style:text-line-through-style",["solid"]);this.fontSize=function(){var b=g("style:text-properties","fo:font-size");return b&&parseFloat(b)};this.fontName=function(){return g("style:text-properties","style:font-name")};this.isAlignedLeft=b("style:paragraph-properties","fo:text-align",["left","start"]);this.isAlignedCenter=b("style:paragraph-properties", "fo:text-align",["center"]);this.isAlignedRight=b("style:paragraph-properties","fo:text-align",["right","end"]);this.isAlignedJustified=b("style:paragraph-properties","fo:text-align",["justify"]);this.text={isBold:this.isBold,isItalic:this.isItalic,hasUnderline:this.hasUnderline,hasStrikeThrough:this.hasStrikeThrough,fontSize:this.fontSize,fontName:this.fontName};this.paragraph={isAlignedLeft:this.isAlignedLeft,isAlignedCenter:this.isAlignedCenter,isAlignedRight:this.isAlignedRight,isAlignedJustified:this.isAlignedJustified}}; // Input 81 /* @@ -2628,34 +2629,34 @@ gui.StyleSummary=function(k){function h(b,g){var h=b+"|"+g,p;d.hasOwnProperty(h) @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.DirectFormattingController=function(k,h,b,p){function d(a){var b;a.collapsed?(b=a.startContainer,b.hasChildNodes()&&a.startOffseta.clientWidth||a.scrollHeight>a.clientHeight)&&c.push(new p(a)), -a=a.parentNode;c.push(new b(r));return c}var r=runtime.getWindow(),l={beforecut:!0,beforepaste:!0},f={mousedown:!0,mouseup:!0,focus:!0},c={},a,m=k.getCanvas().getElement();this.addFilter=function(a,b){n(a,!0).filters.push(b)};this.removeFilter=function(a,b){var c=n(a,!0),d=c.filters.indexOf(b);-1!==d&&c.filters.splice(d,1)};this.subscribe=function(a,b){n(a,!0).handlers.push(b)};this.unsubscribe=function(a,b){var c=n(a,!1),d=c&&c.handlers.indexOf(b);c&&-1!==d&&c.handlers.splice(d,1)};this.hasFocus= -g;this.focus=function(){var b;g()||(b=q(a),a.focus(),b.forEach(function(a){a.restore()}))};this.getEventTrap=function(){return a};this.blur=function(){g()&&a.blur()};this.destroy=function(b){a.parentNode.removeChild(a);b()};(function(){var b=k.getOdfCanvas().getSizer(),c=b.ownerDocument;runtime.assert(Boolean(r),"EventManager requires a window object to operate correctly");a=c.createElement("input");a.id="eventTrap";a.setAttribute("tabindex",-1);b.appendChild(a)})()}; +gui.EventManager=function(m){function h(){var a=this,b=[];this.filters=[];this.handlers=[];this.handleEvent=function(c){-1===b.indexOf(c)&&(b.push(c),a.filters.every(function(a){return a(c)})&&a.handlers.forEach(function(a){a(c)}),runtime.setTimeout(function(){b.splice(b.indexOf(c),1)},0))}}function b(a){var b=a.scrollX,c=a.scrollY;this.restore=function(){a.scrollX===b&&a.scrollY===c||a.scrollTo(b,c)}}function g(a){var b=a.scrollTop,c=a.scrollLeft;this.restore=function(){if(a.scrollTop!==b||a.scrollLeft!== +c)a.scrollTop=b,a.scrollLeft=c}}function d(a,b,c){var d="on"+b,k=!1;a.attachEvent&&(a.attachEvent(d,c),k=!0);!k&&a.addEventListener&&(a.addEventListener(b,c,!1),k=!0);k&&!f[b]||!a.hasOwnProperty(d)||(a[d]=c)}function p(b,f){var g=a[b]||null;!g&&f&&(g=a[b]=new h,r[b]&&d(q,b,g.handleEvent),d(c,b,g.handleEvent),d(k,b,g.handleEvent));return g}function n(){return m.getDOMDocument().activeElement===c}function l(a){for(var c=[];a;)(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight)&&c.push(new g(a)), +a=a.parentNode;c.push(new b(q));return c}var q=runtime.getWindow(),f={beforecut:!0,beforepaste:!0},r={mousedown:!0,mouseup:!0,focus:!0},a={},c,k=m.getCanvas().getElement();this.addFilter=function(a,b){p(a,!0).filters.push(b)};this.removeFilter=function(a,b){var c=p(a,!0),d=c.filters.indexOf(b);-1!==d&&c.filters.splice(d,1)};this.subscribe=function(a,b){p(a,!0).handlers.push(b)};this.unsubscribe=function(a,b){var c=p(a,!1),d=c&&c.handlers.indexOf(b);c&&-1!==d&&c.handlers.splice(d,1)};this.hasFocus= +n;this.focus=function(){var a;n()||(a=l(c),c.focus(),a.forEach(function(a){a.restore()}))};this.getEventTrap=function(){return c};this.blur=function(){n()&&c.blur()};this.destroy=function(a){c.parentNode.removeChild(c);a()};(function(){var a=m.getOdfCanvas().getSizer(),b=a.ownerDocument;runtime.assert(Boolean(q),"EventManager requires a window object to operate correctly");c=b.createElement("input");c.id="eventTrap";c.setAttribute("tabindex",-1);a.appendChild(c)})()}; // Input 85 /* @@ -2681,22 +2682,22 @@ g;this.focus=function(){var b;g()||(b=q(a),a.focus(),b.forEach(function(a){a.res @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.IOSSafariSupport=function(k){function h(){b.innerHeight!==b.outerHeight&&(p.style.display="none",runtime.requestAnimationFrame(function(){p.style.display="block"}))}var b=runtime.getWindow(),p=k.getEventTrap();this.destroy=function(b){k.unsubscribe("focus",h);p.removeAttribute("autocapitalize");p.style.WebkitTransform="";b()};k.subscribe("focus",h);p.setAttribute("autocapitalize","off");p.style.WebkitTransform="translateX(-10000px)"}; +gui.IOSSafariSupport=function(m){function h(){b.innerHeight!==b.outerHeight&&(g.style.display="none",runtime.requestAnimationFrame(function(){g.style.display="block"}))}var b=runtime.getWindow(),g=m.getEventTrap();this.destroy=function(b){m.unsubscribe("focus",h);g.removeAttribute("autocapitalize");g.style.WebkitTransform="";b()};m.subscribe("focus",h);g.setAttribute("autocapitalize","off");g.style.WebkitTransform="translateX(-10000px)"}; // Input 86 -gui.ImageController=function(k,h,b){var p={"image/gif":".gif","image/jpeg":".jpg","image/png":".png"},d=odf.Namespaces.textns,n=k.getOdtDocument(),g=n.getFormatting(),q={};this.insertImage=function(r,l,f,c){var a;runtime.assert(0a.width&&(m=a.width/f);c>a.height&&(e=a.height/c);m=Math.min(m,e);a=f*m;f=c*m;e=n.getOdfCanvas().odfContainer().rootElement.styles;c=r.toLowerCase();var m=p.hasOwnProperty(c)?p[c]:null,t;c=[];runtime.assert(null!==m,"Image type is not supported: "+r);m="Pictures/"+b.generateImageName()+m;t=new ops.OpSetBlob;t.init({memberid:h,filename:m,mimetype:r,content:l});c.push(t);g.getStyleElement("Graphics","graphic",[e])||(r=new ops.OpAddStyle,r.init({memberid:h,styleName:"Graphics",styleFamily:"graphic", -isAutomaticStyle:!1,setProperties:{"style:graphic-properties":{"text:anchor-type":"paragraph","svg:x":"0cm","svg:y":"0cm","style:wrap":"dynamic","style:number-wrapped-paragraphs":"no-limit","style:wrap-contour":"false","style:vertical-pos":"top","style:vertical-rel":"paragraph","style:horizontal-pos":"center","style:horizontal-rel":"paragraph"}}}),c.push(r));r=b.generateStyleName();l=new ops.OpAddStyle;l.init({memberid:h,styleName:r,styleFamily:"graphic",isAutomaticStyle:!0,setProperties:{"style:parent-style-name":"Graphics", +gui.ImageController=function(m,h,b){var g={"image/gif":".gif","image/jpeg":".jpg","image/png":".png"},d=odf.Namespaces.textns,p=m.getOdtDocument(),n=p.getFormatting(),l={};this.insertImage=function(q,f,r,a){var c;runtime.assert(0c.width&&(k=c.width/r);a>c.height&&(e=c.height/a);k=Math.min(k,e);c=r*k;r=a*k;e=p.getOdfCanvas().odfContainer().rootElement.styles;a=q.toLowerCase();var k=g.hasOwnProperty(a)?g[a]:null,u;a=[];runtime.assert(null!==k,"Image type is not supported: "+q);k="Pictures/"+b.generateImageName()+k;u=new ops.OpSetBlob;u.init({memberid:h,filename:k,mimetype:q,content:f});a.push(u);n.getStyleElement("Graphics","graphic",[e])||(q=new ops.OpAddStyle,q.init({memberid:h,styleName:"Graphics",styleFamily:"graphic", +isAutomaticStyle:!1,setProperties:{"style:graphic-properties":{"text:anchor-type":"paragraph","svg:x":"0cm","svg:y":"0cm","style:wrap":"dynamic","style:number-wrapped-paragraphs":"no-limit","style:wrap-contour":"false","style:vertical-pos":"top","style:vertical-rel":"paragraph","style:horizontal-pos":"center","style:horizontal-rel":"paragraph"}}}),a.push(q));q=b.generateStyleName();f=new ops.OpAddStyle;f.init({memberid:h,styleName:q,styleFamily:"graphic",isAutomaticStyle:!0,setProperties:{"style:parent-style-name":"Graphics", "style:graphic-properties":{"style:vertical-pos":"top","style:vertical-rel":"baseline","style:horizontal-pos":"center","style:horizontal-rel":"paragraph","fo:background-color":"transparent","style:background-transparency":"100%","style:shadow":"none","style:mirror":"none","fo:clip":"rect(0cm, 0cm, 0cm, 0cm)","draw:luminance":"0%","draw:contrast":"0%","draw:red":"0%","draw:green":"0%","draw:blue":"0%","draw:gamma":"100%","draw:color-inversion":"false","draw:image-opacity":"100%","draw:color-mode":"standard"}}}); -c.push(l);t=new ops.OpInsertImage;t.init({memberid:h,position:n.getCursorPosition(h),filename:m,frameWidth:a+"cm",frameHeight:f+"cm",frameStyleName:r,frameName:b.generateFrameName()});c.push(t);k.enqueue(c)}}; +a.push(f);u=new ops.OpInsertImage;u.init({memberid:h,position:p.getCursorPosition(h),filename:k,frameWidth:c+"cm",frameHeight:r+"cm",frameStyleName:q,frameName:b.generateFrameName()});a.push(u);m.enqueue(a)}}; // Input 87 -gui.ImageSelector=function(k){function h(){var b=k.getSizer(),h=d.createElement("div");h.id="imageSelector";h.style.borderWidth="1px";b.appendChild(h);p.forEach(function(b){var g=d.createElement("div");g.className=b;h.appendChild(g)});return h}var b=odf.Namespaces.svgns,p="topLeft topRight bottomRight bottomLeft topMiddle rightMiddle bottomMiddle leftMiddle".split(" "),d=k.getElement().ownerDocument,n=!1;this.select=function(g){var p,r,l=d.getElementById("imageSelector");l||(l=h());n=!0;p=l.parentNode; -r=g.getBoundingClientRect();var f=p.getBoundingClientRect(),c=k.getZoomLevel();p=(r.left-f.left)/c-1;r=(r.top-f.top)/c-1;l.style.display="block";l.style.left=p+"px";l.style.top=r+"px";l.style.width=g.getAttributeNS(b,"width");l.style.height=g.getAttributeNS(b,"height")};this.clearSelection=function(){var b;n&&(b=d.getElementById("imageSelector"))&&(b.style.display="none");n=!1};this.isSelectorElement=function(b){var h=d.getElementById("imageSelector");return h?b===h||b.parentNode===h:!1}}; +gui.ImageSelector=function(m){function h(){var b=m.getSizer(),h=d.createElement("div");h.id="imageSelector";h.style.borderWidth="1px";b.appendChild(h);g.forEach(function(b){var f=d.createElement("div");f.className=b;h.appendChild(f)});return h}var b=odf.Namespaces.svgns,g="topLeft topRight bottomRight bottomLeft topMiddle rightMiddle bottomMiddle leftMiddle".split(" "),d=m.getElement().ownerDocument,p=!1;this.select=function(g){var l,q,f=d.getElementById("imageSelector");f||(f=h());p=!0;l=f.parentNode; +q=g.getBoundingClientRect();var r=l.getBoundingClientRect(),a=m.getZoomLevel();l=(q.left-r.left)/a-1;q=(q.top-r.top)/a-1;f.style.display="block";f.style.left=l+"px";f.style.top=q+"px";f.style.width=g.getAttributeNS(b,"width");f.style.height=g.getAttributeNS(b,"height")};this.clearSelection=function(){var b;p&&(b=d.getElementById("imageSelector"))&&(b.style.display="none");p=!1};this.isSelectorElement=function(b){var g=d.getElementById("imageSelector");return g?b===g||b.parentNode===g:!1}}; // Input 88 -(function(){function k(h){function b(b){g=b.which&&String.fromCharCode(b.which)===n;n=void 0;return!1===g}function k(){g=!1}function d(b){n=b.data;g=!1}var n,g=!1;this.destroy=function(g){h.unsubscribe("textInput",k);h.unsubscribe("compositionend",d);h.removeFilter("keypress",b);g()};h.subscribe("textInput",k);h.subscribe("compositionend",d);h.addFilter("keypress",b)}gui.InputMethodEditor=function(h,b){function p(b){m&&(b?m.getNode().setAttributeNS(a,"composing","true"):(m.getNode().removeAttributeNS(a, -"composing"),w.textContent=""))}function d(){u&&(u=!1,p(!1),A.emit(gui.InputMethodEditor.signalCompositionEnd,{data:s}),s="")}function n(){d();m&&m.getSelectedRange().collapsed?e.value="":e.value=x;e.setSelectionRange(0,e.value.length)}function g(){J=void 0;v.cancel();p(!0);u||A.emit(gui.InputMethodEditor.signalCompositionStart,{data:""})}function q(a){a=J=a.data;u=!0;s+=a;v.trigger()}function r(a){a.data!==J&&(a=a.data,u=!0,s+=a,v.trigger());J=void 0}function l(){w.textContent=e.value}function f(){b.blur(); -e.setAttribute("disabled",!0)}function c(){var a=b.hasFocus();a&&b.blur();F?e.removeAttribute("disabled"):e.setAttribute("disabled",!0);a&&b.focus()}var a="urn:webodf:names:cursor",m=null,e=b.getEventTrap(),t=e.ownerDocument,w,z=new core.Async,x="b",v,u=!1,s="",A=new core.EventNotifier([gui.InputMethodEditor.signalCompositionStart,gui.InputMethodEditor.signalCompositionEnd]),J,G=[],D,F=!1;this.subscribe=A.subscribe;this.unsubscribe=A.unsubscribe;this.registerCursor=function(a){a.getMemberId()===h&& -(m=a,m.getNode().appendChild(w),b.subscribe("input",l),b.subscribe("compositionupdate",l))};this.removeCursor=function(a){m&&a===h&&(m.getNode().removeChild(w),b.unsubscribe("input",l),b.unsubscribe("compositionupdate",l),m=null)};this.setEditing=function(a){F=a;c()};this.destroy=function(a){b.unsubscribe("compositionstart",g);b.unsubscribe("compositionend",q);b.unsubscribe("textInput",r);b.unsubscribe("keypress",d);b.unsubscribe("mousedown",f);b.unsubscribe("mouseup",c);b.unsubscribe("focus",n); -z.destroyAll(D,a)};(function(){b.subscribe("compositionstart",g);b.subscribe("compositionend",q);b.subscribe("textInput",r);b.subscribe("keypress",d);b.subscribe("mousedown",f);b.subscribe("mouseup",c);b.subscribe("focus",n);G.push(new k(b));D=G.map(function(a){return a.destroy});w=t.createElement("span");w.setAttribute("id","composer");v=new core.ScheduledTask(n,1);D.push(v.destroy)})()};gui.InputMethodEditor.signalCompositionStart="input/compositionstart";gui.InputMethodEditor.signalCompositionEnd= +(function(){function m(h){function b(b){n=b.which&&String.fromCharCode(b.which)===m;m=void 0;return!1===n}function g(){n=!1}function d(b){m=b.data;n=!1}var m,n=!1;this.destroy=function(l){h.unsubscribe("textInput",g);h.unsubscribe("compositionend",d);h.removeFilter("keypress",b);l()};h.subscribe("textInput",g);h.subscribe("compositionend",d);h.addFilter("keypress",b)}gui.InputMethodEditor=function(h,b){function g(a){k&&(a?k.getNode().setAttributeNS(c,"composing","true"):(k.getNode().removeAttributeNS(c, +"composing"),w.textContent=""))}function d(){v&&(v=!1,g(!1),C.emit(gui.InputMethodEditor.signalCompositionEnd,{data:s}),s="")}function p(){d();k&&k.getSelectedRange().collapsed?e.value="":e.value=x;e.setSelectionRange(0,e.value.length)}function n(){I=void 0;t.cancel();g(!0);v||C.emit(gui.InputMethodEditor.signalCompositionStart,{data:""})}function l(a){a=I=a.data;v=!0;s+=a;t.trigger()}function q(a){a.data!==I&&(a=a.data,v=!0,s+=a,t.trigger());I=void 0}function f(){w.textContent=e.value}function r(){b.blur(); +e.setAttribute("disabled",!0)}function a(){var a=b.hasFocus();a&&b.blur();F?e.removeAttribute("disabled"):e.setAttribute("disabled",!0);a&&b.focus()}var c="urn:webodf:names:cursor",k=null,e=b.getEventTrap(),u=e.ownerDocument,w,z=new core.Async,x="b",t,v=!1,s="",C=new core.EventNotifier([gui.InputMethodEditor.signalCompositionStart,gui.InputMethodEditor.signalCompositionEnd]),I,H=[],D,F=!1;this.subscribe=C.subscribe;this.unsubscribe=C.unsubscribe;this.registerCursor=function(a){a.getMemberId()===h&& +(k=a,k.getNode().appendChild(w),b.subscribe("input",f),b.subscribe("compositionupdate",f))};this.removeCursor=function(a){k&&a===h&&(k.getNode().removeChild(w),b.unsubscribe("input",f),b.unsubscribe("compositionupdate",f),k=null)};this.setEditing=function(b){F=b;a()};this.destroy=function(c){b.unsubscribe("compositionstart",n);b.unsubscribe("compositionend",l);b.unsubscribe("textInput",q);b.unsubscribe("keypress",d);b.unsubscribe("mousedown",r);b.unsubscribe("mouseup",a);b.unsubscribe("focus",p); +z.destroyAll(D,c)};(function(){b.subscribe("compositionstart",n);b.subscribe("compositionend",l);b.subscribe("textInput",q);b.subscribe("keypress",d);b.subscribe("mousedown",r);b.subscribe("mouseup",a);b.subscribe("focus",p);H.push(new m(b));D=H.map(function(a){return a.destroy});w=u.createElement("span");w.setAttribute("id","composer");t=new core.ScheduledTask(p,1);D.push(t.destroy)})()};gui.InputMethodEditor.signalCompositionStart="input/compositionstart";gui.InputMethodEditor.signalCompositionEnd= "input/compositionend";return gui.InputMethodEditor})(); // Input 89 /* @@ -2736,8 +2737,8 @@ z.destroyAll(D,a)};(function(){b.subscribe("compositionstart",g);b.subscribe("co @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.KeyboardHandler=function(){function k(b,k){k||(k=h.None);return b+":"+k}var h=gui.KeyboardHandler.Modifier,b=null,p={};this.setDefault=function(d){b=d};this.bind=function(b,h,g,q){b=k(b,h);runtime.assert(q||!1===p.hasOwnProperty(b),"tried to overwrite the callback handler of key combo: "+b);p[b]=g};this.unbind=function(b,h){var g=k(b,h);delete p[g]};this.reset=function(){b=null;p={}};this.handleEvent=function(d){var n=d.keyCode,g=h.None;d.metaKey&&(g|=h.Meta);d.ctrlKey&&(g|=h.Ctrl);d.altKey&& -(g|=h.Alt);d.shiftKey&&(g|=h.Shift);n=k(n,g);n=p[n];g=!1;n?g=n():null!==b&&(g=b(d));g&&(d.preventDefault?d.preventDefault():d.returnValue=!1)}};gui.KeyboardHandler.Modifier={None:0,Meta:1,Ctrl:2,Alt:4,CtrlAlt:6,Shift:8,MetaShift:9,CtrlShift:10,AltShift:12}; +gui.KeyboardHandler=function(){function m(b,g){g||(g=h.None);return b+":"+g}var h=gui.KeyboardHandler.Modifier,b=null,g={};this.setDefault=function(d){b=d};this.bind=function(b,h,n,l){b=m(b,h);runtime.assert(l||!1===g.hasOwnProperty(b),"tried to overwrite the callback handler of key combo: "+b);g[b]=n};this.unbind=function(b,h){var n=m(b,h);delete g[n]};this.reset=function(){b=null;g={}};this.handleEvent=function(d){var p=d.keyCode,n=h.None;d.metaKey&&(n|=h.Meta);d.ctrlKey&&(n|=h.Ctrl);d.altKey&& +(n|=h.Alt);d.shiftKey&&(n|=h.Shift);p=m(p,n);p=g[p];n=!1;p?n=p():null!==b&&(n=b(d));n&&(d.preventDefault?d.preventDefault():d.returnValue=!1)}};gui.KeyboardHandler.Modifier={None:0,Meta:1,Ctrl:2,Alt:4,CtrlAlt:6,Shift:8,MetaShift:9,CtrlShift:10,AltShift:12}; gui.KeyboardHandler.KeyCode={Backspace:8,Tab:9,Clear:12,Enter:13,Ctrl:17,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,LeftMeta:91,MetaInMozilla:224};(function(){return gui.KeyboardHandler})(); // Input 90 /* @@ -2777,7 +2778,7 @@ gui.KeyboardHandler.KeyCode={Backspace:8,Tab:9,Clear:12,Enter:13,Ctrl:17,End:35, @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.PlainTextPasteboard=function(k,h){function b(b,d){b.init(d);return b}this.createPasteOps=function(p){var d=k.getCursorPosition(h),n=d,g=[];p.replace(/\r/g,"").split("\n").forEach(function(d){g.push(b(new ops.OpSplitParagraph,{memberid:h,position:n,moveCursor:!0}));n+=1;g.push(b(new ops.OpInsertText,{memberid:h,position:n,text:d,moveCursor:!0}));n+=d.length});g.push(b(new ops.OpRemoveText,{memberid:h,position:d,length:1}));return g}}; +gui.PlainTextPasteboard=function(m,h){function b(b,d){b.init(d);return b}this.createPasteOps=function(g){var d=m.getCursorPosition(h),p=d,n=[];g.replace(/\r/g,"").split("\n").forEach(function(d){n.push(b(new ops.OpSplitParagraph,{memberid:h,position:p,moveCursor:!0}));p+=1;n.push(b(new ops.OpInsertText,{memberid:h,position:p,text:d,moveCursor:!0}));p+=d.length});n.push(b(new ops.OpRemoveText,{memberid:h,position:d,length:1}));return n}}; // Input 91 /* @@ -2816,24 +2817,24 @@ gui.PlainTextPasteboard=function(k,h){function b(b,d){b.init(d);return b}this.cr @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -odf.WordBoundaryFilter=function(k,h){function b(a,b,c){for(var d=null,f=k.getRootNode(),g;a!==f&&null!==a&&null===d;)g=0>b?a.previousSibling:a.nextSibling,c(g)===NodeFilter.FILTER_ACCEPT&&(d=g),a=a.parentNode;return d}function p(a,b){var c;return null===a?m.NO_NEIGHBOUR:g.isCharacterElement(a)?m.SPACE_CHAR:a.nodeType===d||g.isTextSpan(a)||g.isHyperlink(a)?(c=a.textContent.charAt(b()),r.test(c)?m.SPACE_CHAR:q.test(c)?m.PUNCTUATION_CHAR:m.WORD_CHAR):m.OTHER}var d=Node.TEXT_NODE,n=Node.ELEMENT_NODE, -g=new odf.OdfUtils,q=/[!-#%-*,-\/:-;?-@\[-\]_{}\u00a1\u00ab\u00b7\u00bb\u00bf;\u00b7\u055a-\u055f\u0589-\u058a\u05be\u05c0\u05c3\u05c6\u05f3-\u05f4\u0609-\u060a\u060c-\u060d\u061b\u061e-\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0964-\u0965\u0970\u0df4\u0e4f\u0e5a-\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u104a-\u104f\u10fb\u1361-\u1368\u166d-\u166e\u169b-\u169c\u16eb-\u16ed\u1735-\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944-\u1945\u19de-\u19df\u1a1e-\u1a1f\u1b5a-\u1b60\u1c3b-\u1c3f\u1c7e-\u1c7f\u2000-\u206e\u207d-\u207e\u208d-\u208e\u3008-\u3009\u2768-\u2775\u27c5-\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc-\u29fd\u2cf9-\u2cfc\u2cfe-\u2cff\u2e00-\u2e7e\u3000-\u303f\u30a0\u30fb\ua60d-\ua60f\ua673\ua67e\ua874-\ua877\ua8ce-\ua8cf\ua92e-\ua92f\ua95f\uaa5c-\uaa5f\ufd3e-\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a-\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a-\uff1b\uff1f-\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]|\ud800[\udd00-\udd01\udf9f\udfd0]|\ud802[\udd1f\udd3f\ude50-\ude58]|\ud809[\udc00-\udc7e]/, -r=/\s/,l=core.PositionFilter.FilterResult.FILTER_ACCEPT,f=core.PositionFilter.FilterResult.FILTER_REJECT,c=odf.WordBoundaryFilter.IncludeWhitespace.TRAILING,a=odf.WordBoundaryFilter.IncludeWhitespace.LEADING,m={NO_NEIGHBOUR:0,SPACE_CHAR:1,PUNCTUATION_CHAR:2,WORD_CHAR:3,OTHER:4};this.acceptPosition=function(e){var d=e.container(),g=e.leftNode(),k=e.rightNode(),q=e.unfilteredDomOffset,r=function(){return e.unfilteredDomOffset()-1};d.nodeType===n&&(null===k&&(k=b(d,1,e.getNodeFilter())),null===g&&(g= -b(d,-1,e.getNodeFilter())));d!==k&&(q=function(){return 0});d!==g&&null!==g&&(r=function(){return g.textContent.length-1});d=p(g,r);k=p(k,q);return d===m.WORD_CHAR&&k===m.WORD_CHAR||d===m.PUNCTUATION_CHAR&&k===m.PUNCTUATION_CHAR||h===c&&d!==m.NO_NEIGHBOUR&&k===m.SPACE_CHAR||h===a&&d===m.SPACE_CHAR&&k!==m.NO_NEIGHBOUR?f:l}};odf.WordBoundaryFilter.IncludeWhitespace={None:0,TRAILING:1,LEADING:2};(function(){return odf.WordBoundaryFilter})(); +odf.WordBoundaryFilter=function(m,h){function b(a,b,c){for(var d=null,f=m.getRootNode(),k;a!==f&&null!==a&&null===d;)k=0>b?a.previousSibling:a.nextSibling,c(k)===NodeFilter.FILTER_ACCEPT&&(d=k),a=a.parentNode;return d}function g(a,b){var c;return null===a?k.NO_NEIGHBOUR:n.isCharacterElement(a)?k.SPACE_CHAR:a.nodeType===d||n.isTextSpan(a)||n.isHyperlink(a)?(c=a.textContent.charAt(b()),q.test(c)?k.SPACE_CHAR:l.test(c)?k.PUNCTUATION_CHAR:k.WORD_CHAR):k.OTHER}var d=Node.TEXT_NODE,p=Node.ELEMENT_NODE, +n=new odf.OdfUtils,l=/[!-#%-*,-\/:-;?-@\[-\]_{}\u00a1\u00ab\u00b7\u00bb\u00bf;\u00b7\u055a-\u055f\u0589-\u058a\u05be\u05c0\u05c3\u05c6\u05f3-\u05f4\u0609-\u060a\u060c-\u060d\u061b\u061e-\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0964-\u0965\u0970\u0df4\u0e4f\u0e5a-\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u104a-\u104f\u10fb\u1361-\u1368\u166d-\u166e\u169b-\u169c\u16eb-\u16ed\u1735-\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944-\u1945\u19de-\u19df\u1a1e-\u1a1f\u1b5a-\u1b60\u1c3b-\u1c3f\u1c7e-\u1c7f\u2000-\u206e\u207d-\u207e\u208d-\u208e\u3008-\u3009\u2768-\u2775\u27c5-\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc-\u29fd\u2cf9-\u2cfc\u2cfe-\u2cff\u2e00-\u2e7e\u3000-\u303f\u30a0\u30fb\ua60d-\ua60f\ua673\ua67e\ua874-\ua877\ua8ce-\ua8cf\ua92e-\ua92f\ua95f\uaa5c-\uaa5f\ufd3e-\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a-\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a-\uff1b\uff1f-\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]|\ud800[\udd00-\udd01\udf9f\udfd0]|\ud802[\udd1f\udd3f\ude50-\ude58]|\ud809[\udc00-\udc7e]/, +q=/\s/,f=core.PositionFilter.FilterResult.FILTER_ACCEPT,r=core.PositionFilter.FilterResult.FILTER_REJECT,a=odf.WordBoundaryFilter.IncludeWhitespace.TRAILING,c=odf.WordBoundaryFilter.IncludeWhitespace.LEADING,k={NO_NEIGHBOUR:0,SPACE_CHAR:1,PUNCTUATION_CHAR:2,WORD_CHAR:3,OTHER:4};this.acceptPosition=function(d){var l=d.container(),m=d.leftNode(),n=d.rightNode(),q=d.unfilteredDomOffset,t=function(){return d.unfilteredDomOffset()-1};l.nodeType===p&&(null===n&&(n=b(l,1,d.getNodeFilter())),null===m&&(m= +b(l,-1,d.getNodeFilter())));l!==n&&(q=function(){return 0});l!==m&&null!==m&&(t=function(){return m.textContent.length-1});l=g(m,t);n=g(n,q);return l===k.WORD_CHAR&&n===k.WORD_CHAR||l===k.PUNCTUATION_CHAR&&n===k.PUNCTUATION_CHAR||h===a&&l!==k.NO_NEIGHBOUR&&n===k.SPACE_CHAR||h===c&&l===k.SPACE_CHAR&&n!==k.NO_NEIGHBOUR?r:f}};odf.WordBoundaryFilter.IncludeWhitespace={None:0,TRAILING:1,LEADING:2};(function(){return odf.WordBoundaryFilter})(); // Input 92 -gui.SelectionController=function(k,h){function b(){var a=x.getCursor(h).getNode();return x.createStepIterator(a,0,[s,J],x.getRootElement(a))}function p(a,b,c){c=new odf.WordBoundaryFilter(x,c);return x.createStepIterator(a,b,[s,J,c],x.getRootElement(a))}function d(a){return function(b){var c=a(b);return function(b,d){return a(d)===c}}}function n(a,b){return b?{anchorNode:a.startContainer,anchorOffset:a.startOffset,focusNode:a.endContainer,focusOffset:a.endOffset}:{anchorNode:a.endContainer,anchorOffset:a.endOffset, -focusNode:a.startContainer,focusOffset:a.startOffset}}function g(a,b,c){var d=new ops.OpMoveCursor;d.init({memberid:h,position:a,length:b||0,selectionType:c});return d}function q(a){var b;b=p(a.startContainer,a.startOffset,G);b.roundToPreviousStep()&&a.setStart(b.container(),b.offset());b=p(a.endContainer,a.endOffset,D);b.roundToNextStep()&&a.setEnd(b.container(),b.offset())}function r(a){var b=u.getParagraphElements(a),c=b[0],b=b[b.length-1];c&&a.setStart(c,0);b&&(u.isParagraph(a.endContainer)&& -0===a.endOffset?a.setEndBefore(b):a.setEnd(b,b.childNodes.length))}function l(a){var b=x.getCursorSelection(h),c=x.getCursor(h).getStepCounter();0!==a&&(a=0a?(c.focusNode=e,c.focusOffset=0):(c.focusNode=e,c.focusOffset=e.childNodes.length);e=x.convertDomToCursorRange(c,d(b));k.enqueue([g(e.position,e.length)])}function z(a){var b=x.getCursor(h),b=x.getRootElement(b.getNode());runtime.assert(Boolean(b),"SelectionController: Cursor outside root");a=0>a?x.convertDomPointToCursorStep(b,0,function(a){return a===ops.StepsTranslator.NEXT_STEP}):x.convertDomPointToCursorStep(b, -b.childNodes.length);k.enqueue([g(a,0)]);return!0}var x=k.getOdtDocument(),v=new core.DomUtils,u=new odf.OdfUtils,s=x.getPositionFilter(),A=new core.PositionFilterChain,J=x.createRootFilter(h),G=odf.WordBoundaryFilter.IncludeWhitespace.TRAILING,D=odf.WordBoundaryFilter.IncludeWhitespace.LEADING;this.selectionToRange=function(a){var b=0<=v.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset),c=a.focusNode.ownerDocument.createRange();b?(c.setStart(a.anchorNode,a.anchorOffset),c.setEnd(a.focusNode, -a.focusOffset)):(c.setStart(a.focusNode,a.focusOffset),c.setEnd(a.anchorNode,a.anchorOffset));return{range:c,hasForwardSelection:b}};this.rangeToSelection=n;this.selectImage=function(a){var b=x.getRootElement(a),c=x.createRootFilter(b),b=x.createStepIterator(a,0,[c,x.getPositionFilter()],b),d;b.roundToPreviousStep()||runtime.assert(!1,"No walkable position before frame");c=b.container();d=b.offset();b.setPosition(a,a.childNodes.length);b.roundToNextStep()||runtime.assert(!1,"No walkable position after frame"); -a=x.convertDomToCursorRange({anchorNode:c,anchorOffset:d,focusNode:b.container(),focusOffset:b.offset()});a=g(a.position,a.length,ops.OdtCursor.RegionSelection);k.enqueue([a])};this.expandToWordBoundaries=q;this.expandToParagraphBoundaries=r;this.selectRange=function(a,b,c){var e=x.getOdfCanvas().getElement(),f;f=v.containsNode(e,a.startContainer);e=v.containsNode(e,a.endContainer);if(f||e)if(f&&e&&(2===c?q(a):3<=c&&r(a)),a=n(a,b),b=x.convertDomToCursorRange(a,d(u.getParagraphElement)),a=x.getCursorSelection(h), -b.position!==a.position||b.length!==a.length)a=g(b.position,b.length,ops.OdtCursor.RangeSelection),k.enqueue([a])};this.moveCursorToLeft=function(){a(function(a){return a.previousStep()});return!0};this.moveCursorToRight=function(){a(function(a){return a.nextStep()});return!0};this.extendSelectionToLeft=function(){f(function(a){return a.previousStep()});return!0};this.extendSelectionToRight=function(){f(function(a){return a.nextStep()});return!0};this.moveCursorUp=function(){m(-1,!1);return!0};this.moveCursorDown= -function(){m(1,!1);return!0};this.extendSelectionUp=function(){m(-1,!0);return!0};this.extendSelectionDown=function(){m(1,!0);return!0};this.moveCursorBeforeWord=function(){t(-1,!1);return!0};this.moveCursorPastWord=function(){t(1,!1);return!0};this.extendSelectionBeforeWord=function(){t(-1,!0);return!0};this.extendSelectionPastWord=function(){t(1,!0);return!0};this.moveCursorToLineStart=function(){e(-1,!1);return!0};this.moveCursorToLineEnd=function(){e(1,!1);return!0};this.extendSelectionToLineStart= +gui.SelectionController=function(m,h){function b(){var a=x.getCursor(h).getNode();return x.createStepIterator(a,0,[s,I],x.getRootElement(a))}function g(a,b,c){c=new odf.WordBoundaryFilter(x,c);return x.createStepIterator(a,b,[s,I,c],x.getRootElement(a))}function d(a){return function(b){var c=a(b);return function(b,d){return a(d)===c}}}function p(a,b){return b?{anchorNode:a.startContainer,anchorOffset:a.startOffset,focusNode:a.endContainer,focusOffset:a.endOffset}:{anchorNode:a.endContainer,anchorOffset:a.endOffset, +focusNode:a.startContainer,focusOffset:a.startOffset}}function n(a,b,c){var d=new ops.OpMoveCursor;d.init({memberid:h,position:a,length:b||0,selectionType:c});return d}function l(a){var b;b=g(a.startContainer,a.startOffset,H);b.roundToPreviousStep()&&a.setStart(b.container(),b.offset());b=g(a.endContainer,a.endOffset,D);b.roundToNextStep()&&a.setEnd(b.container(),b.offset())}function q(a){var b=v.getParagraphElements(a),c=b[0],b=b[b.length-1];c&&a.setStart(c,0);b&&(v.isParagraph(a.endContainer)&& +0===a.endOffset?a.setEndBefore(b):a.setEnd(b,b.childNodes.length))}function f(a){var b=x.getCursorSelection(h),c=x.getCursor(h).getStepCounter();0!==a&&(a=0a?(c.focusNode=e,c.focusOffset=0):(c.focusNode=e,c.focusOffset=e.childNodes.length);e=x.convertDomToCursorRange(c,d(b));m.enqueue([n(e.position,e.length)])}function z(a){var b=x.getCursor(h),b=x.getRootElement(b.getNode());runtime.assert(Boolean(b),"SelectionController: Cursor outside root");a=0>a?x.convertDomPointToCursorStep(b,0,function(a){return a===ops.StepsTranslator.NEXT_STEP}):x.convertDomPointToCursorStep(b, +b.childNodes.length);m.enqueue([n(a,0)]);return!0}var x=m.getOdtDocument(),t=new core.DomUtils,v=new odf.OdfUtils,s=x.getPositionFilter(),C=new core.PositionFilterChain,I=x.createRootFilter(h),H=odf.WordBoundaryFilter.IncludeWhitespace.TRAILING,D=odf.WordBoundaryFilter.IncludeWhitespace.LEADING;this.selectionToRange=function(a){var b=0<=t.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset),c=a.focusNode.ownerDocument.createRange();b?(c.setStart(a.anchorNode,a.anchorOffset),c.setEnd(a.focusNode, +a.focusOffset)):(c.setStart(a.focusNode,a.focusOffset),c.setEnd(a.anchorNode,a.anchorOffset));return{range:c,hasForwardSelection:b}};this.rangeToSelection=p;this.selectImage=function(a){var b=x.getRootElement(a),c=x.createRootFilter(b),b=x.createStepIterator(a,0,[c,x.getPositionFilter()],b),d;b.roundToPreviousStep()||runtime.assert(!1,"No walkable position before frame");c=b.container();d=b.offset();b.setPosition(a,a.childNodes.length);b.roundToNextStep()||runtime.assert(!1,"No walkable position after frame"); +a=x.convertDomToCursorRange({anchorNode:c,anchorOffset:d,focusNode:b.container(),focusOffset:b.offset()});a=n(a.position,a.length,ops.OdtCursor.RegionSelection);m.enqueue([a])};this.expandToWordBoundaries=l;this.expandToParagraphBoundaries=q;this.selectRange=function(a,b,c){var e=x.getOdfCanvas().getElement(),f;f=t.containsNode(e,a.startContainer);e=t.containsNode(e,a.endContainer);if(f||e)if(f&&e&&(2===c?l(a):3<=c&&q(a)),a=p(a,b),b=x.convertDomToCursorRange(a,d(v.getParagraphElement)),a=x.getCursorSelection(h), +b.position!==a.position||b.length!==a.length)a=n(b.position,b.length,ops.OdtCursor.RangeSelection),m.enqueue([a])};this.moveCursorToLeft=function(){c(function(a){return a.previousStep()});return!0};this.moveCursorToRight=function(){c(function(a){return a.nextStep()});return!0};this.extendSelectionToLeft=function(){r(function(a){return a.previousStep()});return!0};this.extendSelectionToRight=function(){r(function(a){return a.nextStep()});return!0};this.moveCursorUp=function(){k(-1,!1);return!0};this.moveCursorDown= +function(){k(1,!1);return!0};this.extendSelectionUp=function(){k(-1,!0);return!0};this.extendSelectionDown=function(){k(1,!0);return!0};this.moveCursorBeforeWord=function(){u(-1,!1);return!0};this.moveCursorPastWord=function(){u(1,!1);return!0};this.extendSelectionBeforeWord=function(){u(-1,!0);return!0};this.extendSelectionPastWord=function(){u(1,!0);return!0};this.moveCursorToLineStart=function(){e(-1,!1);return!0};this.moveCursorToLineEnd=function(){e(1,!1);return!0};this.extendSelectionToLineStart= function(){e(-1,!0);return!0};this.extendSelectionToLineEnd=function(){e(1,!0);return!0};this.extendSelectionToParagraphStart=function(){w(-1,x.getParagraphElement);return!0};this.extendSelectionToParagraphEnd=function(){w(1,x.getParagraphElement);return!0};this.moveCursorToDocumentStart=function(){z(-1);return!0};this.moveCursorToDocumentEnd=function(){z(1);return!0};this.extendSelectionToDocumentStart=function(){w(-1,x.getRootElement);return!0};this.extendSelectionToDocumentEnd=function(){w(1,x.getRootElement); -return!0};this.extendSelectionToEntireDocument=function(){var a=x.getCursor(h),a=x.getRootElement(a.getNode());runtime.assert(Boolean(a),"SelectionController: Cursor outside root");a=x.convertDomToCursorRange({anchorNode:a,anchorOffset:0,focusNode:a,focusOffset:a.childNodes.length},d(x.getRootElement));k.enqueue([g(a.position,a.length)]);return!0};A.addFilter(s);A.addFilter(x.createRootFilter(h))}; +return!0};this.extendSelectionToEntireDocument=function(){var a=x.getCursor(h),a=x.getRootElement(a.getNode());runtime.assert(Boolean(a),"SelectionController: Cursor outside root");a=x.convertDomToCursorRange({anchorNode:a,anchorOffset:0,focusNode:a,focusOffset:a.childNodes.length},d(x.getRootElement));m.enqueue([n(a.position,a.length)]);return!0};C.addFilter(s);C.addFilter(x.createRootFilter(h))}; // Input 93 /* @@ -2872,10 +2873,10 @@ return!0};this.extendSelectionToEntireDocument=function(){var a=x.getCursor(h),a @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.TextController=function(k,h,b,p){function d(b){var d=new ops.OpRemoveText;d.init({memberid:h,position:b.position,length:b.length});return d}function n(b){0>b.length&&(b.position+=b.length,b.length=-b.length);return b}function g(b,d){var c=new core.PositionFilterChain,a=gui.SelectionMover.createPositionIterator(q.getRootElement(b)),g=d?a.nextPosition:a.previousPosition;c.addFilter(q.getPositionFilter());c.addFilter(q.createRootFilter(h));for(a.setUnfilteredPosition(b,0);g();)if(c.acceptPosition(a)=== -r)return!0;return!1}var q=k.getOdtDocument(),r=core.PositionFilter.FilterResult.FILTER_ACCEPT;this.enqueueParagraphSplittingOps=function(){var b=n(q.getCursorSelection(h)),f,c=[];0b.length&&(b.position+=b.length,b.length=-b.length);return b}function n(b,d){var a=new core.PositionFilterChain,c=gui.SelectionMover.createPositionIterator(l.getRootElement(b)),k=d?c.nextPosition:c.previousPosition;a.addFilter(l.getPositionFilter());a.addFilter(l.createRootFilter(h));for(c.setUnfilteredPosition(b,0);k();)if(a.acceptPosition(c)=== +q)return!0;return!1}var l=m.getOdtDocument(),q=core.PositionFilter.FilterResult.FILTER_ACCEPT;this.enqueueParagraphSplittingOps=function(){var b=p(l.getCursorSelection(h)),n,a=[];0c.right&&(c=w(d)))b.anchorNode=b.focusNode= -c.container,b.anchorOffset=b.focusOffset=c.offset}else W.isImage(b.focusNode.firstChild)&&1===b.focusOffset&&W.isCharacterFrame(b.focusNode)&&(c=w(b.focusNode))&&(b.anchorNode=b.focusNode=c.container,b.anchorOffset=b.focusOffset=c.offset);b.anchorNode&&b.focusNode&&(b=L.selectionToRange(b),L.selectRange(b.range,b.hasForwardSelection,a.detail));E.focus()}function x(a){var b=a.target||a.srcElement||null,c,d;V.processRequests();W.isImage(b)&&W.isCharacterFrame(b.parentNode)&&O.getSelection().isCollapsed? -(L.selectImage(b.parentNode),E.focus()):P.isSelectorElement(b)?E.focus():R&&(ca?(b=p.getSelectedRange(),c=b.collapsed,W.isImage(b.endContainer)&&0===b.endOffset&&W.isCharacterFrame(b.endContainer.parentNode)&&(d=b.endContainer.parentNode,d=w(d))&&(b.setEnd(d.container,d.offset),c&&b.collapse(!1)),L.selectRange(b,p.hasForwardSelection(),a.detail),E.focus()):ma?z(a):Y=runtime.setTimeout(function(){z(a)},0));ea=0;ca=R=!1}function v(a){var c=K.getCursor(b).getSelectedRange();c.collapsed||H.exportRangeToDataTransfer(a.dataTransfer, -c)}function u(){R&&E.focus();ea=0;ca=R=!1}function s(a){x(a)}function A(a){var b=a.target||a.srcElement||null,c=null;"annotationRemoveButton"===b.className?(c=Q.getElementsByTagNameNS(b.parentNode,odf.Namespaces.officens,"annotation")[0],S.removeAnnotation(c),E.focus()):x(a)}function J(a){(a=a.data)&&da.insertText(a)}function G(a){return function(){a();return!0}}function D(a){return function(c){return K.getCursor(b).getSelectionType()===ops.OdtCursor.RangeSelection?a(c):!0}}function F(a){E.unsubscribe("keydown", -y.handleEvent);E.unsubscribe("keypress",aa.handleEvent);E.unsubscribe("keyup",N.handleEvent);E.unsubscribe("copy",q);E.unsubscribe("mousedown",t);E.unsubscribe("mousemove",V.trigger);E.unsubscribe("mouseup",A);E.unsubscribe("contextmenu",s);E.unsubscribe("dragstart",v);E.unsubscribe("dragend",u);E.unsubscribe("click",fa.handleClick);K.unsubscribe(ops.OdtDocument.signalOperationEnd,ga.trigger);K.unsubscribe(ops.Document.signalCursorAdded,$.registerCursor);K.unsubscribe(ops.Document.signalCursorRemoved, -$.removeCursor);K.unsubscribe(ops.OdtDocument.signalOperationEnd,f);a()}var O=runtime.getWindow(),K=h.getOdtDocument(),Z=new core.Async,Q=new core.DomUtils,W=new odf.OdfUtils,H=new gui.MimeDataExporter,T=new gui.Clipboard(H),y=new gui.KeyboardHandler,aa=new gui.KeyboardHandler,N=new gui.KeyboardHandler,R=!1,I=new odf.ObjectNameGenerator(K.getOdfCanvas().odfContainer(),b),ca=!1,ia=null,Y,M=null,E=new gui.EventManager(K),S=new gui.AnnotationController(h,b),U=new gui.DirectFormattingController(h,b,I, -d.directParagraphStylingEnabled),da=new gui.TextController(h,b,U.createCursorStyleOp,U.createParagraphStyleOps),ka=new gui.ImageController(h,b,I),P=new gui.ImageSelector(K.getOdfCanvas()),X=gui.SelectionMover.createPositionIterator(K.getRootNode()),V,ga,ha=new gui.PlainTextPasteboard(K,b),$=new gui.InputMethodEditor(b,E),ea=0,fa=new gui.HyperlinkClickHandler(K.getRootNode),ja=new gui.HyperlinkController(h,b),L=new gui.SelectionController(h,b),B=gui.KeyboardHandler.Modifier,C=gui.KeyboardHandler.KeyCode, -ba=-1!==O.navigator.appVersion.toLowerCase().indexOf("mac"),ma=-1!==["iPad","iPod","iPhone"].indexOf(O.navigator.platform),la;runtime.assert(null!==O,"Expected to be run in an environment which has a global window, like a browser.");this.undo=a;this.redo=m;this.insertLocalCursor=function(){runtime.assert(void 0===h.getOdtDocument().getCursor(b),"Inserting local cursor a second time.");var a=new ops.OpAddCursor;a.init({memberid:b});h.enqueue([a]);E.focus()};this.removeLocalCursor=function(){runtime.assert(void 0!== -h.getOdtDocument().getCursor(b),"Removing local cursor without inserting before.");var a=new ops.OpRemoveCursor;a.init({memberid:b});h.enqueue([a])};this.startEditing=function(){$.subscribe(gui.InputMethodEditor.signalCompositionStart,da.removeCurrentSelection);$.subscribe(gui.InputMethodEditor.signalCompositionEnd,J);E.subscribe("beforecut",g);E.subscribe("cut",n);E.subscribe("beforepaste",l);E.subscribe("paste",r);O.addEventListener("focus",fa.showTextCursor,!1);M&&M.initialize();$.setEditing(!0); -fa.setModifier(ba?gui.HyperlinkClickHandler.Modifier.Meta:gui.HyperlinkClickHandler.Modifier.Ctrl);y.bind(C.Backspace,B.None,G(da.removeTextByBackspaceKey),!0);y.bind(C.Delete,B.None,da.removeTextByDeleteKey);y.bind(C.Tab,B.None,D(function(){da.insertText("\t");return!0}));ba?(y.bind(C.Clear,B.None,da.removeCurrentSelection),y.bind(C.B,B.Meta,D(U.toggleBold)),y.bind(C.I,B.Meta,D(U.toggleItalic)),y.bind(C.U,B.Meta,D(U.toggleUnderline)),y.bind(C.L,B.MetaShift,D(U.alignParagraphLeft)),y.bind(C.E,B.MetaShift, -D(U.alignParagraphCenter)),y.bind(C.R,B.MetaShift,D(U.alignParagraphRight)),y.bind(C.J,B.MetaShift,D(U.alignParagraphJustified)),y.bind(C.C,B.MetaShift,S.addAnnotation),y.bind(C.Z,B.Meta,a),y.bind(C.Z,B.MetaShift,m),y.bind(C.LeftMeta,B.Meta,fa.showPointerCursor),y.bind(C.MetaInMozilla,B.Meta,fa.showPointerCursor),N.bind(C.LeftMeta,B.None,fa.showTextCursor),N.bind(C.MetaInMozilla,B.None,fa.showTextCursor)):(y.bind(C.B,B.Ctrl,D(U.toggleBold)),y.bind(C.I,B.Ctrl,D(U.toggleItalic)),y.bind(C.U,B.Ctrl,D(U.toggleUnderline)), -y.bind(C.L,B.CtrlShift,D(U.alignParagraphLeft)),y.bind(C.E,B.CtrlShift,D(U.alignParagraphCenter)),y.bind(C.R,B.CtrlShift,D(U.alignParagraphRight)),y.bind(C.J,B.CtrlShift,D(U.alignParagraphJustified)),y.bind(C.C,B.CtrlAlt,S.addAnnotation),y.bind(C.Z,B.Ctrl,a),y.bind(C.Z,B.CtrlShift,m),y.bind(C.Ctrl,B.Ctrl,fa.showPointerCursor),N.bind(C.Ctrl,B.None,fa.showTextCursor));aa.setDefault(D(function(a){var b;b=null===a.which||void 0===a.which?String.fromCharCode(a.keyCode):0!==a.which&&0!==a.charCode?String.fromCharCode(a.which): -null;return!b||a.altKey||a.ctrlKey||a.metaKey?!1:(da.insertText(b),!0)}));aa.bind(C.Enter,B.None,D(da.enqueueParagraphSplittingOps))};this.endEditing=function(){$.unsubscribe(gui.InputMethodEditor.signalCompositionStart,da.removeCurrentSelection);$.unsubscribe(gui.InputMethodEditor.signalCompositionEnd,J);E.unsubscribe("cut",n);E.unsubscribe("beforecut",g);E.unsubscribe("paste",r);E.unsubscribe("beforepaste",l);O.removeEventListener("focus",fa.showTextCursor,!1);$.setEditing(!1);fa.setModifier(gui.HyperlinkClickHandler.Modifier.None); -y.bind(C.Backspace,B.None,function(){return!0},!0);y.unbind(C.Delete,B.None);y.unbind(C.Tab,B.None);ba?(y.unbind(C.Clear,B.None),y.unbind(C.B,B.Meta),y.unbind(C.I,B.Meta),y.unbind(C.U,B.Meta),y.unbind(C.L,B.MetaShift),y.unbind(C.E,B.MetaShift),y.unbind(C.R,B.MetaShift),y.unbind(C.J,B.MetaShift),y.unbind(C.C,B.MetaShift),y.unbind(C.Z,B.Meta),y.unbind(C.Z,B.MetaShift),y.unbind(C.LeftMeta,B.Meta),y.unbind(C.MetaInMozilla,B.Meta),N.unbind(C.LeftMeta,B.None),N.unbind(C.MetaInMozilla,B.None)):(y.unbind(C.B, -B.Ctrl),y.unbind(C.I,B.Ctrl),y.unbind(C.U,B.Ctrl),y.unbind(C.L,B.CtrlShift),y.unbind(C.E,B.CtrlShift),y.unbind(C.R,B.CtrlShift),y.unbind(C.J,B.CtrlShift),y.unbind(C.C,B.CtrlAlt),y.unbind(C.Z,B.Ctrl),y.unbind(C.Z,B.CtrlShift),y.unbind(C.Ctrl,B.Ctrl),N.unbind(C.Ctrl,B.None));aa.setDefault(null);aa.unbind(C.Enter,B.None)};this.getInputMemberId=function(){return b};this.getSession=function(){return h};this.setUndoManager=function(a){M&&M.unsubscribe(gui.UndoManager.signalUndoStackChanged,c);if(M=a)M.setDocument(K), -M.setPlaybackFunction(h.enqueue),M.subscribe(gui.UndoManager.signalUndoStackChanged,c)};this.getUndoManager=function(){return M};this.getAnnotationController=function(){return S};this.getDirectFormattingController=function(){return U};this.getHyperlinkController=function(){return ja};this.getImageController=function(){return ka};this.getSelectionController=function(){return L};this.getTextController=function(){return da};this.getEventManager=function(){return E};this.getKeyboardHandlers=function(){return{keydown:y, -keypress:aa}};this.destroy=function(a){var b=[];la&&b.push(la.destroy);b=b.concat([V.destroy,ga.destroy,U.destroy,$.destroy,E.destroy,F]);runtime.clearTimeout(Y);Z.destroyAll(b,a)};V=new core.ScheduledTask(e,0);ga=new core.ScheduledTask(function(){var a=K.getCursor(b);if(a&&a.getSelectionType()===ops.OdtCursor.RegionSelection&&(a=W.getImageElements(a.getSelectedRange())[0])){P.select(a.parentNode);return}P.clearSelection()},0);y.bind(C.Left,B.None,D(L.moveCursorToLeft));y.bind(C.Right,B.None,D(L.moveCursorToRight)); -y.bind(C.Up,B.None,D(L.moveCursorUp));y.bind(C.Down,B.None,D(L.moveCursorDown));y.bind(C.Left,B.Shift,D(L.extendSelectionToLeft));y.bind(C.Right,B.Shift,D(L.extendSelectionToRight));y.bind(C.Up,B.Shift,D(L.extendSelectionUp));y.bind(C.Down,B.Shift,D(L.extendSelectionDown));y.bind(C.Home,B.None,D(L.moveCursorToLineStart));y.bind(C.End,B.None,D(L.moveCursorToLineEnd));y.bind(C.Home,B.Ctrl,D(L.moveCursorToDocumentStart));y.bind(C.End,B.Ctrl,D(L.moveCursorToDocumentEnd));y.bind(C.Home,B.Shift,D(L.extendSelectionToLineStart)); -y.bind(C.End,B.Shift,D(L.extendSelectionToLineEnd));y.bind(C.Up,B.CtrlShift,D(L.extendSelectionToParagraphStart));y.bind(C.Down,B.CtrlShift,D(L.extendSelectionToParagraphEnd));y.bind(C.Home,B.CtrlShift,D(L.extendSelectionToDocumentStart));y.bind(C.End,B.CtrlShift,D(L.extendSelectionToDocumentEnd));ba?(y.bind(C.Left,B.Alt,D(L.moveCursorBeforeWord)),y.bind(C.Right,B.Alt,D(L.moveCursorPastWord)),y.bind(C.Left,B.Meta,D(L.moveCursorToLineStart)),y.bind(C.Right,B.Meta,D(L.moveCursorToLineEnd)),y.bind(C.Home, -B.Meta,D(L.moveCursorToDocumentStart)),y.bind(C.End,B.Meta,D(L.moveCursorToDocumentEnd)),y.bind(C.Left,B.AltShift,D(L.extendSelectionBeforeWord)),y.bind(C.Right,B.AltShift,D(L.extendSelectionPastWord)),y.bind(C.Left,B.MetaShift,D(L.extendSelectionToLineStart)),y.bind(C.Right,B.MetaShift,D(L.extendSelectionToLineEnd)),y.bind(C.Up,B.AltShift,D(L.extendSelectionToParagraphStart)),y.bind(C.Down,B.AltShift,D(L.extendSelectionToParagraphEnd)),y.bind(C.Up,B.MetaShift,D(L.extendSelectionToDocumentStart)), -y.bind(C.Down,B.MetaShift,D(L.extendSelectionToDocumentEnd)),y.bind(C.A,B.Meta,D(L.extendSelectionToEntireDocument))):(y.bind(C.Left,B.Ctrl,D(L.moveCursorBeforeWord)),y.bind(C.Right,B.Ctrl,D(L.moveCursorPastWord)),y.bind(C.Left,B.CtrlShift,D(L.extendSelectionBeforeWord)),y.bind(C.Right,B.CtrlShift,D(L.extendSelectionPastWord)),y.bind(C.A,B.Ctrl,D(L.extendSelectionToEntireDocument)));ma&&(la=new gui.IOSSafariSupport(E));E.subscribe("keydown",y.handleEvent);E.subscribe("keypress",aa.handleEvent);E.subscribe("keyup", -N.handleEvent);E.subscribe("copy",q);E.subscribe("mousedown",t);E.subscribe("mousemove",V.trigger);E.subscribe("mouseup",A);E.subscribe("contextmenu",s);E.subscribe("dragstart",v);E.subscribe("dragend",u);E.subscribe("click",fa.handleClick);K.subscribe(ops.OdtDocument.signalOperationEnd,ga.trigger);K.subscribe(ops.Document.signalCursorAdded,$.registerCursor);K.subscribe(ops.Document.signalCursorRemoved,$.removeCursor);K.subscribe(ops.OdtDocument.signalOperationEnd,f)};return gui.SessionController})(); +(d=f.caretRangeFromPoint(d,e),c={container:d.startContainer,offset:d.startOffset}):f.caretPositionFromPoint&&(d=f.caretPositionFromPoint(d,e))&&d.offsetNode&&(c={container:d.offsetNode,offset:d.offset});c&&(b.anchorNode=c.container,b.anchorOffset=c.offset,b.focusNode=b.anchorNode,b.focusOffset=b.anchorOffset)}if(X.isImage(b.focusNode)&&0===b.focusOffset&&X.isCharacterFrame(b.focusNode.parentNode)){if(d=b.focusNode.parentNode,c=d.getBoundingClientRect(),a.clientX>c.right&&(c=w(d)))b.anchorNode=b.focusNode= +c.container,b.anchorOffset=b.focusOffset=c.offset}else X.isImage(b.focusNode.firstChild)&&1===b.focusOffset&&X.isCharacterFrame(b.focusNode)&&(c=w(b.focusNode))&&(b.anchorNode=b.focusNode=c.container,b.anchorOffset=b.focusOffset=c.offset);b.anchorNode&&b.focusNode&&(b=L.selectionToRange(b),L.selectRange(b.range,b.hasForwardSelection,a.detail));E.focus()}function x(a){var b=a.target||a.srcElement||null,c,d;V.processRequests();X.isImage(b)&&X.isCharacterFrame(b.parentNode)&&O.getSelection().isCollapsed? +(L.selectImage(b.parentNode),E.focus()):P.isSelectorElement(b)?E.focus():R&&(ba?(b=g.getSelectedRange(),c=b.collapsed,X.isImage(b.endContainer)&&0===b.endOffset&&X.isCharacterFrame(b.endContainer.parentNode)&&(d=b.endContainer.parentNode,d=w(d))&&(b.setEnd(d.container,d.offset),c&&b.collapse(!1)),L.selectRange(b,g.hasForwardSelection(),a.detail),E.focus()):ma?z(a):N=runtime.setTimeout(function(){z(a)},0));ea=0;ba=R=!1}function t(a){var c=K.getCursor(b).getSelectedRange();c.collapsed||G.exportRangeToDataTransfer(a.dataTransfer, +c)}function v(){R&&E.focus();ea=0;ba=R=!1}function s(a){x(a)}function C(a){var b=a.target||a.srcElement||null,c=null;"annotationRemoveButton"===b.className?(c=Q.getElementsByTagNameNS(b.parentNode,odf.Namespaces.officens,"annotation")[0],U.removeAnnotation(c),E.focus()):x(a)}function I(a){(a=a.data)&&da.insertText(a)}function H(a){return function(){a();return!0}}function D(a){return function(c){return K.getCursor(b).getSelectionType()===ops.OdtCursor.RangeSelection?a(c):!0}}function F(a){E.unsubscribe("keydown", +y.handleEvent);E.unsubscribe("keypress",aa.handleEvent);E.unsubscribe("keyup",M.handleEvent);E.unsubscribe("copy",l);E.unsubscribe("mousedown",u);E.unsubscribe("mousemove",V.trigger);E.unsubscribe("mouseup",C);E.unsubscribe("contextmenu",s);E.unsubscribe("dragstart",t);E.unsubscribe("dragend",v);E.unsubscribe("click",fa.handleClick);K.unsubscribe(ops.OdtDocument.signalOperationEnd,ga.trigger);K.unsubscribe(ops.Document.signalCursorAdded,$.registerCursor);K.unsubscribe(ops.Document.signalCursorRemoved, +$.removeCursor);K.unsubscribe(ops.OdtDocument.signalOperationEnd,r);a()}var O=runtime.getWindow(),K=h.getOdtDocument(),Z=new core.Async,Q=new core.DomUtils,X=new odf.OdfUtils,G=new gui.MimeDataExporter,S=new gui.Clipboard(G),y=new gui.KeyboardHandler,aa=new gui.KeyboardHandler,M=new gui.KeyboardHandler,R=!1,J=new odf.ObjectNameGenerator(K.getOdfCanvas().odfContainer(),b),ba=!1,ia=null,N,T=null,E=new gui.EventManager(K),U=new gui.AnnotationController(h,b),W=new gui.DirectFormattingController(h,b,J, +d.directParagraphStylingEnabled),da=new gui.TextController(h,b,W.createCursorStyleOp,W.createParagraphStyleOps),ka=new gui.ImageController(h,b,J),P=new gui.ImageSelector(K.getOdfCanvas()),Y=gui.SelectionMover.createPositionIterator(K.getRootNode()),V,ga,ha=new gui.PlainTextPasteboard(K,b),$=new gui.InputMethodEditor(b,E),ea=0,fa=new gui.HyperlinkClickHandler(K.getRootNode),ja=new gui.HyperlinkController(h,b),L=new gui.SelectionController(h,b),A=gui.KeyboardHandler.Modifier,B=gui.KeyboardHandler.KeyCode, +ca=-1!==O.navigator.appVersion.toLowerCase().indexOf("mac"),ma=-1!==["iPad","iPod","iPhone"].indexOf(O.navigator.platform),la;runtime.assert(null!==O,"Expected to be run in an environment which has a global window, like a browser.");this.undo=c;this.redo=k;this.insertLocalCursor=function(){runtime.assert(void 0===h.getOdtDocument().getCursor(b),"Inserting local cursor a second time.");var a=new ops.OpAddCursor;a.init({memberid:b});h.enqueue([a]);E.focus()};this.removeLocalCursor=function(){runtime.assert(void 0!== +h.getOdtDocument().getCursor(b),"Removing local cursor without inserting before.");var a=new ops.OpRemoveCursor;a.init({memberid:b});h.enqueue([a])};this.startEditing=function(){$.subscribe(gui.InputMethodEditor.signalCompositionStart,da.removeCurrentSelection);$.subscribe(gui.InputMethodEditor.signalCompositionEnd,I);E.subscribe("beforecut",n);E.subscribe("cut",p);E.subscribe("beforepaste",f);E.subscribe("paste",q);O.addEventListener("focus",fa.showTextCursor,!1);T&&T.initialize();$.setEditing(!0); +fa.setModifier(ca?gui.HyperlinkClickHandler.Modifier.Meta:gui.HyperlinkClickHandler.Modifier.Ctrl);y.bind(B.Backspace,A.None,H(da.removeTextByBackspaceKey),!0);y.bind(B.Delete,A.None,da.removeTextByDeleteKey);y.bind(B.Tab,A.None,D(function(){da.insertText("\t");return!0}));ca?(y.bind(B.Clear,A.None,da.removeCurrentSelection),y.bind(B.B,A.Meta,D(W.toggleBold)),y.bind(B.I,A.Meta,D(W.toggleItalic)),y.bind(B.U,A.Meta,D(W.toggleUnderline)),y.bind(B.L,A.MetaShift,D(W.alignParagraphLeft)),y.bind(B.E,A.MetaShift, +D(W.alignParagraphCenter)),y.bind(B.R,A.MetaShift,D(W.alignParagraphRight)),y.bind(B.J,A.MetaShift,D(W.alignParagraphJustified)),y.bind(B.C,A.MetaShift,U.addAnnotation),y.bind(B.Z,A.Meta,c),y.bind(B.Z,A.MetaShift,k),y.bind(B.LeftMeta,A.Meta,fa.showPointerCursor),y.bind(B.MetaInMozilla,A.Meta,fa.showPointerCursor),M.bind(B.LeftMeta,A.None,fa.showTextCursor),M.bind(B.MetaInMozilla,A.None,fa.showTextCursor)):(y.bind(B.B,A.Ctrl,D(W.toggleBold)),y.bind(B.I,A.Ctrl,D(W.toggleItalic)),y.bind(B.U,A.Ctrl,D(W.toggleUnderline)), +y.bind(B.L,A.CtrlShift,D(W.alignParagraphLeft)),y.bind(B.E,A.CtrlShift,D(W.alignParagraphCenter)),y.bind(B.R,A.CtrlShift,D(W.alignParagraphRight)),y.bind(B.J,A.CtrlShift,D(W.alignParagraphJustified)),y.bind(B.C,A.CtrlAlt,U.addAnnotation),y.bind(B.Z,A.Ctrl,c),y.bind(B.Z,A.CtrlShift,k),y.bind(B.Ctrl,A.Ctrl,fa.showPointerCursor),M.bind(B.Ctrl,A.None,fa.showTextCursor));aa.setDefault(D(function(a){var b;b=null===a.which||void 0===a.which?String.fromCharCode(a.keyCode):0!==a.which&&0!==a.charCode?String.fromCharCode(a.which): +null;return!b||a.altKey||a.ctrlKey||a.metaKey?!1:(da.insertText(b),!0)}));aa.bind(B.Enter,A.None,D(da.enqueueParagraphSplittingOps))};this.endEditing=function(){$.unsubscribe(gui.InputMethodEditor.signalCompositionStart,da.removeCurrentSelection);$.unsubscribe(gui.InputMethodEditor.signalCompositionEnd,I);E.unsubscribe("cut",p);E.unsubscribe("beforecut",n);E.unsubscribe("paste",q);E.unsubscribe("beforepaste",f);O.removeEventListener("focus",fa.showTextCursor,!1);$.setEditing(!1);fa.setModifier(gui.HyperlinkClickHandler.Modifier.None); +y.bind(B.Backspace,A.None,function(){return!0},!0);y.unbind(B.Delete,A.None);y.unbind(B.Tab,A.None);ca?(y.unbind(B.Clear,A.None),y.unbind(B.B,A.Meta),y.unbind(B.I,A.Meta),y.unbind(B.U,A.Meta),y.unbind(B.L,A.MetaShift),y.unbind(B.E,A.MetaShift),y.unbind(B.R,A.MetaShift),y.unbind(B.J,A.MetaShift),y.unbind(B.C,A.MetaShift),y.unbind(B.Z,A.Meta),y.unbind(B.Z,A.MetaShift),y.unbind(B.LeftMeta,A.Meta),y.unbind(B.MetaInMozilla,A.Meta),M.unbind(B.LeftMeta,A.None),M.unbind(B.MetaInMozilla,A.None)):(y.unbind(B.B, +A.Ctrl),y.unbind(B.I,A.Ctrl),y.unbind(B.U,A.Ctrl),y.unbind(B.L,A.CtrlShift),y.unbind(B.E,A.CtrlShift),y.unbind(B.R,A.CtrlShift),y.unbind(B.J,A.CtrlShift),y.unbind(B.C,A.CtrlAlt),y.unbind(B.Z,A.Ctrl),y.unbind(B.Z,A.CtrlShift),y.unbind(B.Ctrl,A.Ctrl),M.unbind(B.Ctrl,A.None));aa.setDefault(null);aa.unbind(B.Enter,A.None)};this.getInputMemberId=function(){return b};this.getSession=function(){return h};this.setUndoManager=function(b){T&&T.unsubscribe(gui.UndoManager.signalUndoStackChanged,a);if(T=b)T.setDocument(K), +T.setPlaybackFunction(h.enqueue),T.subscribe(gui.UndoManager.signalUndoStackChanged,a)};this.getUndoManager=function(){return T};this.getAnnotationController=function(){return U};this.getDirectFormattingController=function(){return W};this.getHyperlinkController=function(){return ja};this.getImageController=function(){return ka};this.getSelectionController=function(){return L};this.getTextController=function(){return da};this.getEventManager=function(){return E};this.getKeyboardHandlers=function(){return{keydown:y, +keypress:aa}};this.destroy=function(a){var b=[];la&&b.push(la.destroy);b=b.concat([V.destroy,ga.destroy,W.destroy,$.destroy,E.destroy,F]);runtime.clearTimeout(N);Z.destroyAll(b,a)};V=new core.ScheduledTask(e,0);ga=new core.ScheduledTask(function(){var a=K.getCursor(b);if(a&&a.getSelectionType()===ops.OdtCursor.RegionSelection&&(a=X.getImageElements(a.getSelectedRange())[0])){P.select(a.parentNode);return}P.clearSelection()},0);y.bind(B.Left,A.None,D(L.moveCursorToLeft));y.bind(B.Right,A.None,D(L.moveCursorToRight)); +y.bind(B.Up,A.None,D(L.moveCursorUp));y.bind(B.Down,A.None,D(L.moveCursorDown));y.bind(B.Left,A.Shift,D(L.extendSelectionToLeft));y.bind(B.Right,A.Shift,D(L.extendSelectionToRight));y.bind(B.Up,A.Shift,D(L.extendSelectionUp));y.bind(B.Down,A.Shift,D(L.extendSelectionDown));y.bind(B.Home,A.None,D(L.moveCursorToLineStart));y.bind(B.End,A.None,D(L.moveCursorToLineEnd));y.bind(B.Home,A.Ctrl,D(L.moveCursorToDocumentStart));y.bind(B.End,A.Ctrl,D(L.moveCursorToDocumentEnd));y.bind(B.Home,A.Shift,D(L.extendSelectionToLineStart)); +y.bind(B.End,A.Shift,D(L.extendSelectionToLineEnd));y.bind(B.Up,A.CtrlShift,D(L.extendSelectionToParagraphStart));y.bind(B.Down,A.CtrlShift,D(L.extendSelectionToParagraphEnd));y.bind(B.Home,A.CtrlShift,D(L.extendSelectionToDocumentStart));y.bind(B.End,A.CtrlShift,D(L.extendSelectionToDocumentEnd));ca?(y.bind(B.Left,A.Alt,D(L.moveCursorBeforeWord)),y.bind(B.Right,A.Alt,D(L.moveCursorPastWord)),y.bind(B.Left,A.Meta,D(L.moveCursorToLineStart)),y.bind(B.Right,A.Meta,D(L.moveCursorToLineEnd)),y.bind(B.Home, +A.Meta,D(L.moveCursorToDocumentStart)),y.bind(B.End,A.Meta,D(L.moveCursorToDocumentEnd)),y.bind(B.Left,A.AltShift,D(L.extendSelectionBeforeWord)),y.bind(B.Right,A.AltShift,D(L.extendSelectionPastWord)),y.bind(B.Left,A.MetaShift,D(L.extendSelectionToLineStart)),y.bind(B.Right,A.MetaShift,D(L.extendSelectionToLineEnd)),y.bind(B.Up,A.AltShift,D(L.extendSelectionToParagraphStart)),y.bind(B.Down,A.AltShift,D(L.extendSelectionToParagraphEnd)),y.bind(B.Up,A.MetaShift,D(L.extendSelectionToDocumentStart)), +y.bind(B.Down,A.MetaShift,D(L.extendSelectionToDocumentEnd)),y.bind(B.A,A.Meta,D(L.extendSelectionToEntireDocument))):(y.bind(B.Left,A.Ctrl,D(L.moveCursorBeforeWord)),y.bind(B.Right,A.Ctrl,D(L.moveCursorPastWord)),y.bind(B.Left,A.CtrlShift,D(L.extendSelectionBeforeWord)),y.bind(B.Right,A.CtrlShift,D(L.extendSelectionPastWord)),y.bind(B.A,A.Ctrl,D(L.extendSelectionToEntireDocument)));ma&&(la=new gui.IOSSafariSupport(E));E.subscribe("keydown",y.handleEvent);E.subscribe("keypress",aa.handleEvent);E.subscribe("keyup", +M.handleEvent);E.subscribe("copy",l);E.subscribe("mousedown",u);E.subscribe("mousemove",V.trigger);E.subscribe("mouseup",C);E.subscribe("contextmenu",s);E.subscribe("dragstart",t);E.subscribe("dragend",v);E.subscribe("click",fa.handleClick);K.subscribe(ops.OdtDocument.signalOperationEnd,ga.trigger);K.subscribe(ops.Document.signalCursorAdded,$.registerCursor);K.subscribe(ops.Document.signalCursorRemoved,$.removeCursor);K.subscribe(ops.OdtDocument.signalOperationEnd,r)};return gui.SessionController})(); // Input 96 /* @@ -2982,13 +2983,13 @@ N.handleEvent);E.subscribe("copy",q);E.subscribe("mousedown",t);E.subscribe("mou @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.CaretManager=function(k){function h(b){return a.hasOwnProperty(b)?a[b]:null}function b(){return Object.keys(a).map(function(b){return a[b]})}function p(b){var c=a[b];c&&(c.destroy(function(){}),delete a[b])}function d(a){a=a.getMemberId();a===k.getInputMemberId()&&(a=h(a))&&a.refreshCursorBlinking()}function n(){var a=h(k.getInputMemberId());w=!1;a&&a.ensureVisible()}function g(){var a=h(k.getInputMemberId());a&&(a.handleUpdate(),w||(w=!0,t=runtime.setTimeout(n,50)))}function q(a){a.memberId=== -k.getInputMemberId()&&g()}function r(){var a=h(k.getInputMemberId());a&&a.setFocus()}function l(){var a=h(k.getInputMemberId());a&&a.removeFocus()}function f(){var a=h(k.getInputMemberId());a&&a.show()}function c(){var a=h(k.getInputMemberId());a&&a.hide()}var a={},m=new core.Async,e=runtime.getWindow(),t,w=!1;this.registerCursor=function(b,c,d){var e=b.getMemberId();c=new gui.Caret(b,c,d);d=k.getEventManager();a[e]=c;e===k.getInputMemberId()?(runtime.log("Starting to track input on new cursor of "+ -e),b.subscribe(ops.OdtCursor.signalCursorUpdated,g),c.setOverlayElement(d.getEventTrap())):b.subscribe(ops.OdtCursor.signalCursorUpdated,c.handleUpdate);return c};this.getCaret=h;this.getCarets=b;this.destroy=function(g){var h=k.getSession().getOdtDocument(),n=k.getEventManager(),u=b().map(function(a){return a.destroy});runtime.clearTimeout(t);h.unsubscribe(ops.OdtDocument.signalParagraphChanged,q);h.unsubscribe(ops.Document.signalCursorMoved,d);h.unsubscribe(ops.Document.signalCursorRemoved,p);n.unsubscribe("focus", -r);n.unsubscribe("blur",l);e.removeEventListener("focus",f,!1);e.removeEventListener("blur",c,!1);a={};m.destroyAll(u,g)};(function(){var a=k.getSession().getOdtDocument(),b=k.getEventManager();a.subscribe(ops.OdtDocument.signalParagraphChanged,q);a.subscribe(ops.Document.signalCursorMoved,d);a.subscribe(ops.Document.signalCursorRemoved,p);b.subscribe("focus",r);b.subscribe("blur",l);e.addEventListener("focus",f,!1);e.addEventListener("blur",c,!1)})()}; +gui.CaretManager=function(m){function h(a){return c.hasOwnProperty(a)?c[a]:null}function b(){return Object.keys(c).map(function(a){return c[a]})}function g(a){var b=c[a];b&&(b.destroy(function(){}),delete c[a])}function d(a){a=a.getMemberId();a===m.getInputMemberId()&&(a=h(a))&&a.refreshCursorBlinking()}function p(){var a=h(m.getInputMemberId());w=!1;a&&a.ensureVisible()}function n(){var a=h(m.getInputMemberId());a&&(a.handleUpdate(),w||(w=!0,u=runtime.setTimeout(p,50)))}function l(a){a.memberId=== +m.getInputMemberId()&&n()}function q(){var a=h(m.getInputMemberId());a&&a.setFocus()}function f(){var a=h(m.getInputMemberId());a&&a.removeFocus()}function r(){var a=h(m.getInputMemberId());a&&a.show()}function a(){var a=h(m.getInputMemberId());a&&a.hide()}var c={},k=new core.Async,e=runtime.getWindow(),u,w=!1;this.registerCursor=function(a,b,d){var e=a.getMemberId();b=new gui.Caret(a,b,d);d=m.getEventManager();c[e]=b;e===m.getInputMemberId()?(runtime.log("Starting to track input on new cursor of "+ +e),a.subscribe(ops.OdtCursor.signalCursorUpdated,n),b.setOverlayElement(d.getEventTrap())):a.subscribe(ops.OdtCursor.signalCursorUpdated,b.handleUpdate);return b};this.getCaret=h;this.getCarets=b;this.destroy=function(h){var n=m.getSession().getOdtDocument(),p=m.getEventManager(),v=b().map(function(a){return a.destroy});runtime.clearTimeout(u);n.unsubscribe(ops.OdtDocument.signalParagraphChanged,l);n.unsubscribe(ops.Document.signalCursorMoved,d);n.unsubscribe(ops.Document.signalCursorRemoved,g);p.unsubscribe("focus", +q);p.unsubscribe("blur",f);e.removeEventListener("focus",r,!1);e.removeEventListener("blur",a,!1);c={};k.destroyAll(v,h)};(function(){var b=m.getSession().getOdtDocument(),c=m.getEventManager();b.subscribe(ops.OdtDocument.signalParagraphChanged,l);b.subscribe(ops.Document.signalCursorMoved,d);b.subscribe(ops.Document.signalCursorRemoved,g);c.subscribe("focus",q);c.subscribe("blur",f);e.addEventListener("focus",r,!1);e.addEventListener("blur",a,!1)})()}; // Input 97 -gui.EditInfoHandle=function(k){var h=[],b,p=k.ownerDocument,d=p.documentElement.namespaceURI;this.setEdits=function(k){h=k;var g,q,r,l;b.innerHTML="";for(k=0;ka?(q=b(1,0),r=b(0.5,1E4-a),l=b(0.2,2E4-a)):1E4<=a&&2E4>a?(q=b(0.5,0),l=b(0.2,2E4-a)):q=b(0.2,0)};this.getEdits=function(){return k.getEdits()};this.clearEdits= -function(){k.clearEdits();n.setEdits([]);g.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&g.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return k};this.show=function(){g.style.display="block"};this.hide=function(){p.hideHandle();g.style.display="none"};this.showHandle=function(){n.show()};this.hideHandle=function(){n.hide()};this.destroy=function(b){runtime.clearTimeout(q);runtime.clearTimeout(r);runtime.clearTimeout(l);d.removeChild(g); -n.destroy(function(c){c?b(c):k.destroy(b)})};(function(){var b=k.getOdtDocument().getDOMDocument();g=b.createElementNS(b.documentElement.namespaceURI,"div");g.setAttribute("class","editInfoMarker");g.onmouseover=function(){p.showHandle()};g.onmouseout=function(){p.hideHandle()};d=k.getNode();d.appendChild(g);n=new gui.EditInfoHandle(d);h||p.hide()})()}; +gui.EditInfoMarker=function(m,h){function b(b,a){return runtime.setTimeout(function(){n.style.opacity=b},a)}var g=this,d,p,n,l,q,f;this.addEdit=function(d,a){var c=Date.now()-a;m.addEdit(d,a);p.setEdits(m.getSortedEdits());n.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",d);runtime.clearTimeout(q);runtime.clearTimeout(f);1E4>c?(l=b(1,0),q=b(0.5,1E4-c),f=b(0.2,2E4-c)):1E4<=c&&2E4>c?(l=b(0.5,0),f=b(0.2,2E4-c)):l=b(0.2,0)};this.getEdits=function(){return m.getEdits()};this.clearEdits= +function(){m.clearEdits();p.setEdits([]);n.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&n.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return m};this.show=function(){n.style.display="block"};this.hide=function(){g.hideHandle();n.style.display="none"};this.showHandle=function(){p.show()};this.hideHandle=function(){p.hide()};this.destroy=function(b){runtime.clearTimeout(l);runtime.clearTimeout(q);runtime.clearTimeout(f);d.removeChild(n); +p.destroy(function(a){a?b(a):m.destroy(b)})};(function(){var b=m.getOdtDocument().getDOMDocument();n=b.createElementNS(b.documentElement.namespaceURI,"div");n.setAttribute("class","editInfoMarker");n.onmouseover=function(){g.showHandle()};n.onmouseout=function(){g.hideHandle()};d=m.getNode();d.appendChild(n);p=new gui.EditInfoHandle(d);h||g.hide()})()}; // Input 100 -gui.ShadowCursor=function(k){var h=k.getDOMDocument().createRange(),b=!0;this.removeFromDocument=function(){};this.getMemberId=function(){return gui.ShadowCursor.ShadowCursorMemberId};this.getSelectedRange=function(){return h};this.setSelectedRange=function(k,d){h=k;b=!1!==d};this.hasForwardSelection=function(){return b};this.getDocument=function(){return k};this.getSelectionType=function(){return ops.OdtCursor.RangeSelection};h.setStart(k.getRootNode(),0)};gui.ShadowCursor.ShadowCursorMemberId=""; +gui.ShadowCursor=function(m){var h=m.getDOMDocument().createRange(),b=!0;this.removeFromDocument=function(){};this.getMemberId=function(){return gui.ShadowCursor.ShadowCursorMemberId};this.getSelectedRange=function(){return h};this.setSelectedRange=function(g,d){h=g;b=!1!==d};this.hasForwardSelection=function(){return b};this.getDocument=function(){return m};this.getSelectionType=function(){return ops.OdtCursor.RangeSelection};h.setStart(m.getRootNode(),0)};gui.ShadowCursor.ShadowCursorMemberId=""; (function(){return gui.ShadowCursor})(); // Input 101 -gui.SelectionView=function(k){};gui.SelectionView.prototype.rerender=function(){};gui.SelectionView.prototype.show=function(){};gui.SelectionView.prototype.hide=function(){};gui.SelectionView.prototype.destroy=function(k){}; +gui.SelectionView=function(m){};gui.SelectionView.prototype.rerender=function(){};gui.SelectionView.prototype.show=function(){};gui.SelectionView.prototype.hide=function(){};gui.SelectionView.prototype.destroy=function(m){}; // Input 102 /* @@ -3113,8 +3114,8 @@ gui.SelectionView=function(k){};gui.SelectionView.prototype.rerender=function(){ @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -gui.SelectionViewManager=function(k){function h(){return Object.keys(b).map(function(h){return b[h]})}var b={};this.getSelectionView=function(h){return b.hasOwnProperty(h)?b[h]:null};this.getSelectionViews=h;this.removeSelectionView=function(h){b.hasOwnProperty(h)&&(b[h].destroy(function(){}),delete b[h])};this.hideSelectionView=function(h){b.hasOwnProperty(h)&&b[h].hide()};this.showSelectionView=function(h){b.hasOwnProperty(h)&&b[h].show()};this.rerenderSelectionViews=function(){Object.keys(b).forEach(function(h){b[h].rerender()})}; -this.registerCursor=function(h,d){var n=h.getMemberId(),g=new k(h);d?g.show():g.hide();return b[n]=g};this.destroy=function(b){function d(g,h){h?b(h):gb.length;a&&k(b);return a}function b(b,a){function d(f){b[f]===a&&e.push(f)}var e=[];b&&["style:parent-style-name","style:next-style-name"].forEach(d);return e}function p(b,a){function d(e){b[e]===a&&delete b[e]}b&&["style:parent-style-name","style:next-style-name"].forEach(d)}function d(b){var a={};Object.keys(b).forEach(function(f){a[f]="object"===typeof b[f]?d(b[f]):b[f]});return a}function n(b, -a,d,e){var f,g=!1,h=!1,k,l=[];e&&e.attributes&&(l=e.attributes.split(","));b&&(d||0=a.position+a.length)){e=f?b:a;h=f?a:b;if(b.position!==a.position||b.length!==a.length)p=d(e),q=d(h);a=r(h.setProperties,null,e.setProperties,null,"style:text-properties");if(a.majorChanged||a.minorChanged)k=[],b=[],l=e.position+e.length,n=h.position+h.length,h.positionl?a.minorChanged&&(p=q,p.position=l,p.length=n-l,b.push(p),h.length=l-h.position):l>n&&a.majorChanged&&(p.position=n,p.length=l-n,k.push(p),e.length=n-e.position),e.setProperties&&g(e.setProperties)&&k.push(e),h.setProperties&&g(h.setProperties)&&b.push(h),f?(l=k,k=b):l=b}return{opSpecsA:l,opSpecsB:k}},InsertText:function(b,a){a.position<=b.position?b.position+=a.text.length:a.position<=b.position+b.length&&(b.length+=a.text.length);return{opSpecsA:[b],opSpecsB:[a]}}, -MoveCursor:l,RemoveCursor:l,RemoveStyle:l,RemoveText:function(b,a){var d=b.position+b.length,e=a.position+a.length,f=[b],g=[a];e<=b.position?b.position-=a.length:a.positiona.position?b.position+=a.text.length:d?a.position+=b.text.length:b.position+=a.text.length;return{opSpecsA:[b],opSpecsB:[a]}},MoveCursor:function(b,a){var d=h(a);b.positiona.position)b.position+=1;else return d?a.position+=b.text.length: -b.position+=1,null;return{opSpecsA:[b],opSpecsB:[a]}},UpdateMember:l,UpdateMetadata:l,UpdateParagraphStyle:l},MoveCursor:{MoveCursor:l,RemoveCursor:function(b,a){return{opSpecsA:b.memberid===a.memberid?[]:[b],opSpecsB:[a]}},RemoveMember:l,RemoveStyle:l,RemoveText:function(b,a){var d=h(b),e=b.position+b.length,f=a.position+a.length;f<=b.position?b.position-=a.length:a.positiona.position?b.position+=1:b.position===a.position&&(d?a.position+=1:b.position+=1);return{opSpecsA:[b],opSpecsB:[a]}},UpdateMember:l,UpdateMetadata:l,UpdateParagraphStyle:l},UpdateMember:{UpdateMetadata:l,UpdateParagraphStyle:l},UpdateMetadata:{UpdateMetadata:function(b,a,d){var e,f=[b],h=[a];e=d?b:a;b=d?a:b;n(b.setProperties||null,b.removedProperties||null,e.setProperties||null,e.removedProperties||null);e.setProperties&&g(e.setProperties)||e.removedProperties&& -q(e.removedProperties)||(d?f=[]:h=[]);b.setProperties&&g(b.setProperties)||b.removedProperties&&q(b.removedProperties)||(d?h=[]:f=[]);return{opSpecsA:f,opSpecsB:h}},UpdateParagraphStyle:l},UpdateParagraphStyle:{UpdateParagraphStyle:function(b,a,d){var e,f=[b],h=[a];b.styleName===a.styleName&&(e=d?b:a,b=d?a:b,r(b.setProperties,b.removedProperties,e.setProperties,e.removedProperties,"style:paragraph-properties"),r(b.setProperties,b.removedProperties,e.setProperties,e.removedProperties,"style:text-properties"), -n(b.setProperties||null,b.removedProperties||null,e.setProperties||null,e.removedProperties||null),e.setProperties&&g(e.setProperties)||e.removedProperties&&q(e.removedProperties)||(d?f=[]:h=[]),b.setProperties&&g(b.setProperties)||b.removedProperties&&q(b.removedProperties)||(d?h=[]:f=[]));return{opSpecsA:f,opSpecsB:h}}}};this.passUnchanged=l;this.extendTransformations=function(b){Object.keys(b).forEach(function(a){var d=b[a],e,g=f.hasOwnProperty(a);runtime.log((g?"Extending":"Adding")+" map for optypeA: "+ -a);g||(f[a]={});e=f[a];Object.keys(d).forEach(function(b){var c=e.hasOwnProperty(b);runtime.assert(a<=b,"Wrong order:"+a+", "+b);runtime.log(" "+(c?"Overwriting":"Adding")+" entry for optypeB: "+b);e[b]=d[b]})})};this.transformOpspecVsOpspec=function(b,a){var d=b.optype<=a.optype,e;runtime.log("Crosstransforming:");runtime.log(runtime.toJson(b));runtime.log(runtime.toJson(a));d||(e=b,b=a,a=e);(e=(e=f[b.optype])&&e[a.optype])?(e=e(b,a,!d),d||null===e||(e={opSpecsA:e.opSpecsB,opSpecsB:e.opSpecsA})): +ops.OperationTransformMatrix=function(){function m(a){a.position+=a.length;a.length*=-1}function h(a){var b=0>a.length;b&&m(a);return b}function b(a,b){function d(f){a[f]===b&&e.push(f)}var e=[];a&&["style:parent-style-name","style:next-style-name"].forEach(d);return e}function g(a,b){function d(e){a[e]===b&&delete a[e]}a&&["style:parent-style-name","style:next-style-name"].forEach(d)}function d(a){var b={};Object.keys(a).forEach(function(f){b[f]="object"===typeof a[f]?d(a[f]):a[f]});return b}function p(a, +b,d,e){var f,g=!1,h=!1,l,m=[];e&&e.attributes&&(m=e.attributes.split(","));a&&(d||0=b.position+b.length)){e=f?a:b;g=f?b:a;if(a.position!==b.position||a.length!==b.length)p=d(e),r=d(g);b=q(g.setProperties,null,e.setProperties,null,"style:text-properties");if(b.majorChanged||b.minorChanged)h=[],a=[],l=e.position+e.length,m=g.position+g.length,g.positionl?b.minorChanged&&(p=r,p.position=l,p.length=m-l,a.push(p),g.length=l-g.position):l>m&&b.majorChanged&&(p.position=m,p.length=l-m,h.push(p),e.length=m-e.position),e.setProperties&&n(e.setProperties)&&h.push(e),g.setProperties&&n(g.setProperties)&&a.push(g),f?(l=h,h=a):l=a}return{opSpecsA:l,opSpecsB:h}},InsertText:function(a,b){b.position<=a.position?a.position+=b.text.length:b.position<=a.position+a.length&&(a.length+=b.text.length);return{opSpecsA:[a],opSpecsB:[b]}}, +MoveCursor:f,RemoveCursor:f,RemoveStyle:f,RemoveText:function(a,b){var d=a.position+a.length,e=b.position+b.length,f=[a],g=[b];e<=a.position?a.position-=b.length:b.positionb.position?a.position+=b.text.length:d?b.position+=a.text.length:a.position+=b.text.length;return{opSpecsA:[a],opSpecsB:[b]}},MoveCursor:function(a,b){var d=h(b);a.positionb.position)a.position+=1;else return d?b.position+=a.text.length: +a.position+=1,null;return{opSpecsA:[a],opSpecsB:[b]}},UpdateMember:f,UpdateMetadata:f,UpdateParagraphStyle:f},MoveCursor:{MoveCursor:f,RemoveCursor:function(a,b){return{opSpecsA:a.memberid===b.memberid?[]:[a],opSpecsB:[b]}},RemoveMember:f,RemoveStyle:f,RemoveText:function(a,b){var d=h(a),e=a.position+a.length,f=b.position+b.length;f<=a.position?a.position-=b.length:b.positionb.position?a.position+=1:a.position===b.position&&(d?b.position+=1:a.position+=1);return{opSpecsA:[a],opSpecsB:[b]}},UpdateMember:f,UpdateMetadata:f,UpdateParagraphStyle:f},UpdateMember:{UpdateMetadata:f,UpdateParagraphStyle:f},UpdateMetadata:{UpdateMetadata:function(a,b,d){var e,f=[a],g=[b];e=d?a:b;a=d?b:a;p(a.setProperties||null,a.removedProperties||null,e.setProperties||null,e.removedProperties||null);e.setProperties&&n(e.setProperties)||e.removedProperties&& +l(e.removedProperties)||(d?f=[]:g=[]);a.setProperties&&n(a.setProperties)||a.removedProperties&&l(a.removedProperties)||(d?g=[]:f=[]);return{opSpecsA:f,opSpecsB:g}},UpdateParagraphStyle:f},UpdateParagraphStyle:{UpdateParagraphStyle:function(a,b,d){var e,f=[a],g=[b];a.styleName===b.styleName&&(e=d?a:b,a=d?b:a,q(a.setProperties,a.removedProperties,e.setProperties,e.removedProperties,"style:paragraph-properties"),q(a.setProperties,a.removedProperties,e.setProperties,e.removedProperties,"style:text-properties"), +p(a.setProperties||null,a.removedProperties||null,e.setProperties||null,e.removedProperties||null),e.setProperties&&n(e.setProperties)||e.removedProperties&&l(e.removedProperties)||(d?f=[]:g=[]),a.setProperties&&n(a.setProperties)||a.removedProperties&&l(a.removedProperties)||(d?g=[]:f=[]));return{opSpecsA:f,opSpecsB:g}}}};this.passUnchanged=f;this.extendTransformations=function(a){Object.keys(a).forEach(function(b){var d=a[b],e,f=r.hasOwnProperty(b);runtime.log((f?"Extending":"Adding")+" map for optypeA: "+ +b);f||(r[b]={});e=r[b];Object.keys(d).forEach(function(a){var f=e.hasOwnProperty(a);runtime.assert(b<=a,"Wrong order:"+b+", "+a);runtime.log(" "+(f?"Overwriting":"Adding")+" entry for optypeB: "+a);e[a]=d[a]})})};this.transformOpspecVsOpspec=function(a,b){var d=a.optype<=b.optype,e;runtime.log("Crosstransforming:");runtime.log(runtime.toJson(a));runtime.log(runtime.toJson(b));d||(e=a,a=b,b=e);(e=(e=r[a.optype])&&e[b.optype])?(e=e(a,b,!d),d||null===e||(e={opSpecsA:e.opSpecsB,opSpecsB:e.opSpecsA})): e=null;runtime.log("result:");e?(runtime.log(runtime.toJson(e.opSpecsA)),runtime.log(runtime.toJson(e.opSpecsB))):runtime.log("null");return e}}; // Input 108 /* @@ -3328,8 +3329,8 @@ e=null;runtime.log("result:");e?(runtime.log(runtime.toJson(e.opSpecsA)),runtime @source: http://www.webodf.org/ @source: https://github.com/kogmbh/WebODF/ */ -ops.OperationTransformer=function(){function k(d){var h=[];d.forEach(function(d){h.push(b.create(d))});return h}function h(b,k){for(var g,q,r=[],l=[];0 draw|image:nth-of-type(n+2) {\n display: none;\n}\ntext|list:before {\n display: none;\n content:"";\n}\ntext|list {\n counter-reset: list;\n}\ntext|list-item {\n display: block;\n}\ntext|number {\n display:none;\n}\n\ntext|a {\n color: blue;\n text-decoration: underline;\n cursor: pointer;\n}\noffice|text[webodfhelper|links="inactive"] text|a {\n cursor: text;\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: 0;\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 pointer-events: none;\n}\n\ncursor|cursor > .caret {\n /* IMPORTANT: when changing these values ensure DEFAULT_CARET_TOP and DEFAULT_CARET_HEIGHT\n in Caret.js remain in sync */\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 > .handle {\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 > .handle > img {\n border-radius: 5px;\n}\n\ncursor|cursor > .handle.active {\n opacity: 0.8;\n}\n\ncursor|cursor > .handle: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/** Input Method Editor input pane & behaviours */\n/* not within a cursor */\n#eventTrap {\n height: auto;\n display: block;\n position: absolute;\n width: 1px;\n outline: none;\n opacity: 0;\n color: rgba(255, 255, 255, 0); /* hide the blinking caret by setting the colour to fully transparent */\n overflow: hidden; /* The overflow visibility is used to hide and show characters being entered */\n pointer-events: none;\n}\n\n/* within a cursor */\ncursor|cursor > #composer {\n text-decoration: underline;\n}\n\ncursor|cursor[cursor|composing="true"] > #composer {\n display: inline-block;\n height: auto;\n width: auto;\n}\n\ncursor|cursor[cursor|composing="true"] {\n display: inline-block;\n width: auto;\n height: inherit;\n}\n\ncursor|cursor[cursor|composing="true"] > .caret {\n /* during composition, the caret should be pushed along by the composition text, inline with the text */\n position: static;\n /* as it is now part of an inline-block, it will no longer need correct to top or height values to align properly */\n height: auto !important;\n top: auto !important;\n}\n\neditinfo|editinfo {\n /* Empty or invisible display:inline elements respond very badly to mouse selection.\n Inline blocks are much more reliably selectable in Chrome & friends */\n display: inline-block;\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 color: black;\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\n.selectionOverlay {\n position: absolute;\n pointer-events: none;\n top: 0;\n left: 0;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 15;\n}\n.selectionOverlay > polygon {\n fill-opacity: 0.3;\n stroke-opacity: 0.8;\n stroke-width: 1;\n fill-rule: evenodd;\n}\n\n#imageSelector {\n display: none;\n position: absolute;\n border-style: solid;\n border-color: black;\n}\n\n#imageSelector > div {\n width: 5px;\n height: 5px;\n display: block;\n position: absolute;\n border: 1px solid black;\n background-color: #ffffff;\n}\n\n#imageSelector > .topLeft {\n top: -4px;\n left: -4px;\n}\n\n#imageSelector > .topRight {\n top: -4px;\n right: -4px;\n}\n\n#imageSelector > .bottomRight {\n right: -4px;\n bottom: -4px;\n}\n\n#imageSelector > .bottomLeft {\n bottom: -4px;\n left: -4px;\n}\n\n#imageSelector > .topMiddle {\n top: -4px;\n left: 50%;\n margin-left: -2.5px; /* half of the width defined in #imageSelector > div */\n}\n\n#imageSelector > .rightMiddle {\n top: 50%;\n right: -4px;\n margin-top: -2.5px; /* half of the height defined in #imageSelector > div */\n}\n\n#imageSelector > .bottomMiddle {\n bottom: -4px;\n left: 50%;\n margin-left: -2.5px; /* half of the width defined in #imageSelector > div */\n}\n\n#imageSelector > .leftMiddle {\n top: 50%;\n left: -4px;\n margin-top: -2.5px; /* half of the height defined in #imageSelector > div */\n}\n\ndiv.customScrollbars::-webkit-scrollbar\n{\n width: 8px;\n height: 8px;\n background-color: transparent;\n}\n\ndiv.customScrollbars::-webkit-scrollbar-track\n{\n background-color: transparent;\n}\n\ndiv.customScrollbars::-webkit-scrollbar-thumb\n{\n background-color: #444;\n border-radius: 4px;\n}\n';