From 38fc574527214a59045372091a712f6dc83fe4dc Mon Sep 17 00:00:00 2001 From: Tobias Hintze Date: Wed, 7 Aug 2013 10:37:44 +0200 Subject: [PATCH] more webodf sync --- js/webodf-debug.js | 31 +- js/webodf.js | 884 ++++++++++++++++++++++----------------------- 2 files changed, 451 insertions(+), 464 deletions(-) diff --git a/js/webodf-debug.js b/js/webodf-debug.js index 3620cb06..35c957c9 100644 --- a/js/webodf-debug.js +++ b/js/webodf-debug.js @@ -9468,10 +9468,7 @@ ops.PullBoxServer = function PullBoxServer(args) { return"/session/" + sessionId + "/genesis" }; function call(message, cb) { - var xhr = new XMLHttpRequest, byteArrayWriter = new core.ByteArrayWriter("utf8"), data; - if(typeof message === "object") { - message = JSON.stringify(message) - } + var xhr = new XMLHttpRequest, byteArrayWriter = new core.ByteArrayWriter("utf8"), messageString = JSON.stringify(message), data; function handleResult() { if(xhr.readyState === 4) { if((xhr.status < 200 || xhr.status >= 300) && xhr.status === 0) { @@ -9480,8 +9477,8 @@ ops.PullBoxServer = function PullBoxServer(args) { cb(xhr.responseText) } } - runtime.log("Sending message to server: " + message); - byteArrayWriter.appendString(message); + runtime.log("Sending message to server: " + messageString); + byteArrayWriter.appendString(messageString); data = byteArrayWriter.getByteArray(); xhr.open("POST", args.url, true); xhr.onreadystatechange = handleResult; @@ -9502,9 +9499,6 @@ ops.PullBoxServer = function PullBoxServer(args) { } } this.call = call; - this.getBase64 = function() { - return base64 - }; this.getToken = function() { return token }; @@ -9518,7 +9512,7 @@ ops.PullBoxServer = function PullBoxServer(args) { return"ready" }; this.login = function(login, password, successCb, failCb) { - call("login:" + base64.toBase64(login) + ":" + base64.toBase64(password), function(responseData) { + call({command:"login", args:{login:base64.toBase64(login), password:base64.toBase64(password)}}, function(responseData) { var response = (runtime.fromJson(responseData)); runtime.log("Login reply: " + responseData); if(response.hasOwnProperty("token")) { @@ -12948,14 +12942,14 @@ ops.PullBoxUserModel = function PullBoxUserModel(server) { } } function pullUserData() { - var base64 = server.getBase64(), i, userIds = []; + var i, userIds = []; for(i in memberDataSubscribers) { if(memberDataSubscribers.hasOwnProperty(i)) { userIds.push(i) } } runtime.log("user-list request for : " + userIds.join(",")); - server.call("user-list:" + base64.toBase64(server.getToken()) + ":" + userIds.join(","), function(responseData) { + server.call({command:"user-list", args:{user_ids:userIds}}, function(responseData) { var response = (runtime.fromJson(responseData)), userList, newUserData, oldUserData; runtime.log("user-list reply: " + responseData); if(response.hasOwnProperty("userdata_list")) { @@ -13342,13 +13336,8 @@ ops.PullBoxOperationRouter = function PullBoxOperationRouter(sessionId, memberId syncLock = true; syncedClientOpspecs = unsyncedClientOpspecQueue; unsyncedClientOpspecQueue = []; - server.call({command:"sync-ops", sec_token:server.getToken(), es_id:sessionId, member_id:memberId, seq_head:String(lastServerSeq), client_ops:syncedClientOpspecs}, function(responseData) { - var shouldRetryInstantly = false, response; - try { - response = (runtime.fromJson(responseData)) - }catch(ex) { - runtime.assert(response !== undefined, "invalid sync-ops reply: [" + responseData + "]") - } + server.call({command:"sync-ops", args:{es_id:sessionId, member_id:memberId, seq_head:String(lastServerSeq), client_ops:syncedClientOpspecs}}, function(responseData) { + var shouldRetryInstantly = false, response = (runtime.fromJson(responseData)); runtime.log("sync-ops reply: " + responseData); if(response.result === "newOps") { if(response.ops.length > 0) { @@ -13436,9 +13425,7 @@ ops.PullBoxOperationRouter = function PullBoxOperationRouter(sessionId, memberId triggerPushingOps() }; function init() { - var base64 = server.getBase64(), token = server.getToken(); - runtime.assert(token, "invalid token"); - server.call("join-session:" + base64.toBase64(token) + ":" + base64.toBase64(sessionId) + ":" + base64.toBase64(memberId), function(responseData) { + server.call({command:"join-session", args:{session_id:sessionId, member_id:memberId}}, function(responseData) { var response = Boolean(runtime.fromJson(responseData)); runtime.log("join-session reply: " + responseData); runtime.assert(response, "Trying to join a session which does not exists or where we are already in") diff --git a/js/webodf.js b/js/webodf.js index 223b0a0d..9d103c10 100644 --- a/js/webodf.js +++ b/js/webodf.js @@ -36,79 +36,79 @@ */ var core={},gui={},xmldom={},odf={},ops={}; // Input 1 -function Runtime(){}Runtime.ByteArray=function(k){};Runtime.prototype.getVariable=function(k){};Runtime.prototype.toJson=function(k){};Runtime.prototype.fromJson=function(k){};Runtime.ByteArray.prototype.slice=function(k,g){};Runtime.ByteArray.prototype.length=0;Runtime.prototype.byteArrayFromArray=function(k){};Runtime.prototype.byteArrayFromString=function(k,g){};Runtime.prototype.byteArrayToString=function(k,g){};Runtime.prototype.concatByteArrays=function(k,g){}; -Runtime.prototype.read=function(k,g,l,h){};Runtime.prototype.readFile=function(k,g,l){};Runtime.prototype.readFileSync=function(k,g){};Runtime.prototype.loadXML=function(k,g){};Runtime.prototype.writeFile=function(k,g,l){};Runtime.prototype.isFile=function(k,g){};Runtime.prototype.getFileSize=function(k,g){};Runtime.prototype.deleteFile=function(k,g){};Runtime.prototype.log=function(k,g){};Runtime.prototype.setTimeout=function(k,g){};Runtime.prototype.clearTimeout=function(k){}; -Runtime.prototype.libraryPaths=function(){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.parseXML=function(k){};Runtime.prototype.getWindow=function(){};Runtime.prototype.assert=function(k,g,l){};var IS_COMPILED_CODE=!0; -Runtime.byteArrayToString=function(k,g){function l(b){var a="",f,d=b.length;for(f=0;fc?a+=String.fromCharCode(c):(f+=1,h=b[f],194<=c&&224>c?a+=String.fromCharCode((c&31)<<6|h&63):(f+=1,e=b[f],224<=c&&240>c?a+=String.fromCharCode((c&15)<<12|(h&63)<<6|e&63):(f+=1,r=b[f],240<=c&&245>c&&(c=(c&7)<<18|(h&63)<<12|(e&63)<<6|r&63,c-=65536,a+=String.fromCharCode((c>>10)+55296,(c&1023)+56320))))); -return a}var b;"utf8"===g?b=h(k):("binary"!==g&&this.log("Unsupported encoding: "+g),b=l(k));return b};Runtime.getVariable=function(k){try{return eval(k)}catch(g){}};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 g(a,f){var d,c,b;void 0!==f?b=a:f=a;k?(c=k.ownerDocument,b&&(d=c.createElement("span"),d.className=b,d.appendChild(c.createTextNode(b)),k.appendChild(d),k.appendChild(c.createTextNode(" "))),d=c.createElement("span"),0e?(c[g]=e,g+=1):2048>e?(c[g]=192|e>>>6,c[g+1]=128|e&63,g+=2):(c[g]=224|e>>>12&15,c[g+1]=128|e>>>6&63,c[g+2]=128|e&63,g+=3)}else for("binary"!== -f&&h.log("unknown encoding: "+f),d=a.length,c=new h.ByteArray(d),b=0;bc.status||0===c.status?d(null):d("Status "+String(c.status)+": "+c.responseText|| -c.statusText):d("File "+a+" is empty."))};f=f.buffer&&!c.sendAsBinary?f.buffer:h.byteArrayToString(f,"binary");try{c.sendAsBinary?c.sendAsBinary(f):c.send(f)}catch(g){h.log("HUH? "+g+" "+f),d(g.message)}};this.deleteFile=function(a,f){delete b[a];var d=new XMLHttpRequest;d.open("DELETE",a,!0);d.onreadystatechange=function(){4===d.readyState&&(200>d.status&&300<=d.status?f(d.responseText):f(null))};d.send(null)};this.loadXML=function(a,f){var d=new XMLHttpRequest;d.open("GET",a,!0);d.overrideMimeType&& -d.overrideMimeType("text/xml");d.onreadystatechange=function(){4===d.readyState&&(0!==d.status||d.responseText?200===d.status||0===d.status?f(null,d.responseXML):f(d.responseText):f("File "+a+" is empty."))};try{d.send(null)}catch(c){f(c.message)}};this.isFile=function(a,f){h.getFileSize(a,function(a){f(-1!==a)})};this.getFileSize=function(a,f){var d=new XMLHttpRequest;d.open("HEAD",a,!0);d.onreadystatechange=function(){if(4===d.readyState){var c=d.getResponseHeader("Content-Length");c?f(parseInt(c, -10)):l(a,"binary",function(c,a){c?f(-1):f(a.length)})}};d.send(null)};this.log=g;this.assert=function(a,f,d){if(!a)throw g("alert","ASSERTION FAILED:\n"+f),d&&d(),f;};this.setTimeout=function(a,f){return setTimeout(function(){a()},f)};this.clearTimeout=function(a){clearTimeout(a)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(a){return(new DOMParser).parseFromString(a, -"text/xml")};this.exit=function(a){g("Calling exit with code "+String(a)+", but exit() is not implemented.")};this.getWindow=function(){return window}} -function NodeJSRuntime(){function k(a,d,c){a=h.resolve(b,a);"binary"!==d?l.readFile(a,d,c):l.readFile(a,null,c)}var g=this,l=require("fs"),h=require("path"),b="",n,a;this.ByteArray=function(a){return new Buffer(a)};this.byteArrayFromArray=function(a){var d=new Buffer(a.length),c,b=a.length;for(c=0;cc?a+=String.fromCharCode(c):(e+=1,g=b[e],194<=c&&224>c?a+=String.fromCharCode((c&31)<<6|g&63):(e+=1,h=b[e],224<=c&&240>c?a+=String.fromCharCode((c&15)<<12|(g&63)<<6|h&63):(e+=1,s=b[e],240<=c&&245>c&&(c=(c&7)<<18|(g&63)<<12|(h&63)<<6|s&63,c-=65536,a+=String.fromCharCode((c>>10)+55296,(c&1023)+56320))))); +return a}var b;"utf8"===f?b=g(l):("binary"!==f&&this.log("Unsupported encoding: "+f),b=m(l));return b};Runtime.getVariable=function(l){try{return eval(l)}catch(f){}};Runtime.toJson=function(l){return JSON.stringify(l)};Runtime.fromJson=function(l){return JSON.parse(l)};Runtime.getFunctionName=function(l){return void 0===l.name?(l=/function\s+(\w+)/.exec(l))&&l[1]:l.name}; +function BrowserRuntime(l){function f(a,e){var d,c,b;void 0!==e?b=a:e=a;l?(c=l.ownerDocument,b&&(d=c.createElement("span"),d.className=b,d.appendChild(c.createTextNode(b)),l.appendChild(d),l.appendChild(c.createTextNode(" "))),d=c.createElement("span"),0h?(c[f]=h,f+=1):2048>h?(c[f]=192|h>>>6,c[f+1]=128|h&63,f+=2):(c[f]=224|h>>>12&15,c[f+1]=128|h>>>6&63,c[f+2]=128|h&63,f+=3)}else for("binary"!== +e&&g.log("unknown encoding: "+e),d=a.length,c=new g.ByteArray(d),b=0;bc.status||0===c.status?d(null):d("Status "+String(c.status)+": "+c.responseText|| +c.statusText):d("File "+a+" is empty."))};e=e.buffer&&!c.sendAsBinary?e.buffer:g.byteArrayToString(e,"binary");try{c.sendAsBinary?c.sendAsBinary(e):c.send(e)}catch(f){g.log("HUH? "+f+" "+e),d(f.message)}};this.deleteFile=function(a,e){delete b[a];var d=new XMLHttpRequest;d.open("DELETE",a,!0);d.onreadystatechange=function(){4===d.readyState&&(200>d.status&&300<=d.status?e(d.responseText):e(null))};d.send(null)};this.loadXML=function(a,e){var d=new XMLHttpRequest;d.open("GET",a,!0);d.overrideMimeType&& +d.overrideMimeType("text/xml");d.onreadystatechange=function(){4===d.readyState&&(0!==d.status||d.responseText?200===d.status||0===d.status?e(null,d.responseXML):e(d.responseText):e("File "+a+" is empty."))};try{d.send(null)}catch(c){e(c.message)}};this.isFile=function(a,e){g.getFileSize(a,function(a){e(-1!==a)})};this.getFileSize=function(a,e){var d=new XMLHttpRequest;d.open("HEAD",a,!0);d.onreadystatechange=function(){if(4===d.readyState){var c=d.getResponseHeader("Content-Length");c?e(parseInt(c, +10)):m(a,"binary",function(c,a){c?e(-1):e(a.length)})}};d.send(null)};this.log=f;this.assert=function(a,e,d){if(!a)throw f("alert","ASSERTION FAILED:\n"+e),d&&d(),e;};this.setTimeout=function(a,e){return setTimeout(function(){a()},e)};this.clearTimeout=function(a){clearTimeout(a)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(a){return(new DOMParser).parseFromString(a, +"text/xml")};this.exit=function(a){f("Calling exit with code "+String(a)+", but exit() is not implemented.")};this.getWindow=function(){return window}} +function NodeJSRuntime(){function l(a,d,c){a=g.resolve(b,a);"binary"!==d?m.readFile(a,d,c):m.readFile(a,null,c)}var f=this,m=require("fs"),g=require("path"),b="",k,a;this.ByteArray=function(a){return new Buffer(a)};this.byteArrayFromArray=function(a){var d=new Buffer(a.length),c,b=a.length;for(c=0;c").implementation} -function RhinoRuntime(){function k(a,f){var d;void 0!==f?d=a:f=a;"alert"===d&&print("\n!!!!! ALERT !!!!!");print(f);"alert"===d&&print("!!!!! ALERT !!!!!")}var g=this,l=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),h,b,n="";l.setValidating(!1);l.setNamespaceAware(!0);l.setExpandEntityReferences(!1);l.setSchema(null);b=Packages.org.xml.sax.EntityResolver({resolveEntity:function(a,f){var d=new Packages.java.io.FileReader(f);return new Packages.org.xml.sax.InputSource(d)}});h=l.newDocumentBuilder(); -h.setEntityResolver(b);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=function(a,f){var d=[],c,b=a.length;for(c=0;c").implementation} +function RhinoRuntime(){function l(a,e){var d;void 0!==e?d=a:e=a;"alert"===d&&print("\n!!!!! ALERT !!!!!");print(e);"alert"===d&&print("!!!!! ALERT !!!!!")}var f=this,m=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),g,b,k="";m.setValidating(!1);m.setNamespaceAware(!0);m.setExpandEntityReferences(!1);m.setSchema(null);b=Packages.org.xml.sax.EntityResolver({resolveEntity:function(a,e){var d=new Packages.java.io.FileReader(e);return new Packages.org.xml.sax.InputSource(d)}});g=m.newDocumentBuilder(); +g.setEntityResolver(b);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=function(a,e){var d=[],c,b=a.length;for(c=0;c>>18],e+=q[c>>>12&63],e+=q[c>>>6&63],e+=q[c&63];d===b+1?(c=a[d]<<4,e+=q[c>>>6],e+=q[c&63],e+="=="):d===b&&(c=a[d]<<10|a[d+1]<<2,e+=q[c>>>12],e+=q[c>>>6&63],e+=q[c&63],e+="=");return e}function l(a){a=a.replace(/[^A-Za-z0-9+\/]+/g,"");var c=[],e=a.length%4,d,b=a.length,f;for(d=0;d>16,f>>8&255,f&255);c.length-=[0,0,2,1][e];return c}function h(a){var c=[],e,d=a.length,b;for(e=0;eb?c.push(b):2048>b?c.push(192|b>>>6,128|b&63):c.push(224|b>>>12&15,128|b>>>6&63,128|b&63);return c}function b(a){var c=[],e,d=a.length,b,f,m;for(e=0;eb?c.push(b):(e+=1,f=a[e],224>b?c.push((b&31)<<6|f&63):(e+=1,m=a[e],c.push((b&15)<<12|(f&63)<<6|m&63)));return c}function n(a){return g(k(a))} -function a(a){return String.fromCharCode.apply(String,l(a))}function f(a){return b(k(a))}function d(a){a=b(a);for(var c="",e=0;ec?d+=String.fromCharCode(c):(m+=1,b=a.charCodeAt(m)&255,224>c?d+=String.fromCharCode((c&31)<<6|b&63):(m+=1,f=a.charCodeAt(m)&255,d+=String.fromCharCode((c&15)<<12|(b&63)<<6|f&63)));return d}function t(a,e){function d(){var p= -m+b;p>a.length&&(p=a.length);f+=c(a,m,p);m=p;p=m===a.length;e(f,p)&&!p&&runtime.setTimeout(d,0)}var b=1E5,f="",m=0;a.length>>18],h+=q[c>>>12&63],h+=q[c>>>6&63],h+=q[c&63];d===b+1?(c=a[d]<<4,h+=q[c>>>6],h+=q[c&63],h+="=="):d===b&&(c=a[d]<<10|a[d+1]<<2,h+=q[c>>>12],h+=q[c>>>6&63],h+=q[c&63],h+="=");return h}function m(a){a=a.replace(/[^A-Za-z0-9+\/]+/g,"");var c=[],h=a.length%4,d,b=a.length,e;for(d=0;d>16,e>>8&255,e&255);c.length-=[0,0,2,1][h];return c}function g(a){var c=[],h,d=a.length,b;for(h=0;hb?c.push(b):2048>b?c.push(192|b>>>6,128|b&63):c.push(224|b>>>12&15,128|b>>>6&63,128|b&63);return c}function b(a){var c=[],h,d=a.length,b,e,n;for(h=0;hb?c.push(b):(h+=1,e=a[h],224>b?c.push((b&31)<<6|e&63):(h+=1,n=a[h],c.push((b&15)<<12|(e&63)<<6|n&63)));return c}function k(a){return f(l(a))} +function a(a){return String.fromCharCode.apply(String,m(a))}function e(a){return b(l(a))}function d(a){a=b(a);for(var c="",h=0;hc?d+=String.fromCharCode(c):(n+=1,b=a.charCodeAt(n)&255,224>c?d+=String.fromCharCode((c&31)<<6|b&63):(n+=1,e=a.charCodeAt(n)&255,d+=String.fromCharCode((c&15)<<12|(b&63)<<6|e&63)));return d}function t(a,h){function d(){var p= +n+b;p>a.length&&(p=a.length);e+=c(a,n,p);n=p;p=n===a.length;h(e,p)&&!p&&runtime.setTimeout(d,0)}var b=1E5,e="",n=0;a.length>>8):(fa(a&255),fa(a>>>8))},aa=function(){p=(p<<5^m[C+3-1]&255)&8191;y=w[32768+p];w[C&32767]=y;w[32768+p]=C},ga=function(a,c){z>16-c?(u|=a<>16-z,z+=c-16):(u|=a<a;a++)m[a]=m[a+32768];P-=32768;C-=32768;v-=32768;for(a=0;8192>a;a++)c=w[32768+a],w[32768+a]=32768<=c?c-32768:0;for(a=0;32768>a;a++)c=w[a],w[a]=32768<=c?c-32768:0;e+=32768}B||(a=Ba(m,C+J,e),0>=a?B=!0:J+=a)},Ca=function(a){var c=U,e=C,d,b=N,f=32506=ka&&(c>>=2);do if(d=a,m[d+b]===h&&m[d+b-1]===g&&m[d]===m[e]&&m[++d]===m[e+1]){e+= -2;d++;do++e;while(m[e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&m[++e]===m[++d]&&eb){P=a;b=d;if(258<=d)break;g=m[e+b-1];h=m[e+b]}a=w[a&32767]}while(a>f&&0!==--c);return b},va=function(a,c){s[Z++]=c;0===a?ca[c].fc++:(a--,ca[G[c]+256+1].fc++,W[(256>a?ea[a]:ea[256+(a>>7)])&255].fc++,q[X++]=a,qa|=x);x<<=1;0===(Z&7)&&(R[na++]=qa,qa=0,x=1);if(2b;b++)e+=W[b].fc* -(5+ra[b]);e>>=3;if(X>=1,e<<=1;while(0<--c);return e>>1},Ea=function(a,c){var e=[];e.length=16;var d=0,b;for(b=1;15>=b;b++)d=d+L[b-1]<<1,e[b]=d;for(d=0;d<=c;d++)b=a[d].dl,0!==b&&(a[d].fc=Da(e[b]++,b))},za=function(a){var c=a.dyn_tree,e=a.static_tree,d=a.elems,b,f=-1, -m=d;Y=0;la=573;for(b=0;bY;)b=K[++Y]=2>f?++f:0,c[b].fc=1,E[b]=0,ia--,null!==e&&(ma-=e[b].dl);a.max_code=f;for(b=Y>>1;1<=b;b--)ya(c,b);do b=K[1],K[1]=K[Y--],ya(c,1),e=K[1],K[--la]=b,K[--la]=e,c[m].fc=c[b].fc+c[e].fc,E[m]=E[b]>E[e]+1?E[b]:E[e]+1,c[b].dl=c[e].dl=m,K[1]=m++,ya(c,1);while(2<=Y);K[--la]=K[1];m=a.dyn_tree;b=a.extra_bits;var d=a.extra_base,e=a.max_code,p=a.max_length,g=a.static_tree,h,r,q,n,s=0;for(r=0;15>=r;r++)L[r]=0;m[K[la]].dl=0; -for(a=la+1;573>a;a++)h=K[a],r=m[m[h].dl].dl+1,r>p&&(r=p,s++),m[h].dl=r,h>e||(L[r]++,q=0,h>=d&&(q=b[h-d]),n=m[h].fc,ia+=n*(r+q),null!==g&&(ma+=n*(g[h].dl+q)));if(0!==s){do{for(r=p-1;0===L[r];)r--;L[r]--;L[r+1]+=2;L[p]--;s-=2}while(0e||(m[b].dl!==r&&(ia+=(r-m[b].dl)*m[b].fc,m[b].fc=r),h--)}Ea(c,f)},Fa=function(a,c){var e,d=-1,b,f=a[0].dl,m=0,p=7,g=4;0===f&&(p=138,g=3);a[c+1].dl=65535;for(e=0;e<=c;e++)b=f,f=a[e+1].dl,++m=m?S[17].fc++:S[18].fc++,m=0,d=b,0===f?(p=138,g=3):b===f?(p=6,g=3):(p=7,g=4))},Ga=function(){8e?ea[e]:ea[256+(e>>7)])&255,sa(p,c),g=ra[p],0!==g&&(e-=V[p],ga(e,g))),m>>=1;while(d=m?(sa(17,S),ga(m-3,3)):(sa(18,S),ga(m-11,7));m=0;d=b;0===f?(p=138,g=3):b===f?(p=6,g=3):(p=7,g=4)}},Ja=function(){var a;for(a=0;286>a;a++)ca[a].fc=0;for(a=0;30>a;a++)W[a].fc=0;for(a=0;19>a;a++)S[a].fc=0;ca[256].fc=1;qa=Z=X=na=ia=ma=0;x=1},wa=function(a){var c,e,d,b;b=C-v;R[na]=qa;za(Q);za(F);Fa(ca,Q.max_code);Fa(W,F.max_code);za(M);for(d=18;3<=d&&0=== -S[ua[d]].dl;d--);ia+=3*(d+1)+14;c=ia+3+7>>3;e=ma+3+7>>3;e<=c&&(c=e);if(b+4<=c&&0<=v)for(ga(0+a,3),Ga(),ja(b),ja(~b),d=0;da.len&&(p=a.len);for(g=0;gt-e&&(p=t-e);for(g=0;gq;q++)for(ha[q]=h,g=0;g<1<q;q++)for(V[q]=h,g=0;g<1<>=7;30>q;q++)for(V[q]=h<<7,g=0;g<1<=g;g++)L[g]=0;for(g=0;143>=g;)O[g++].dl=8,L[8]++;for(;255>=g;)O[g++].dl=9,L[9]++;for(;279>=g;)O[g++].dl=7,L[7]++;for(;287>=g;)O[g++].dl=8,L[8]++;Ea(O,287);for(g=0;30>g;g++)ba[g].dl=5,ba[g].fc=Da(g,5);Ja()}for(g=0;8192>g;g++)w[32768+g]=0;da=$[T].max_lazy;ka=$[T].good_length;U=$[T].max_chain;v=C=0;J=Ba(m, -0,65536);if(0>=J)B=!0,J=0;else{for(B=!1;262>J&&!B;)xa();for(g=p=0;2>g;g++)p=(p<<5^m[g]&255)&8191}a=null;e=t=0;3>=T?(N=2,A=0):(A=2,H=0);r=!1}d=!0;if(0===J)return r=!0,0}g=Ka(c,b,f);if(g===f)return f;if(r)return g;if(3>=T)for(;0!==J&&null===a;){aa();0!==y&&32506>=C-y&&(A=Ca(y),A>J&&(A=J));if(3<=A)if(q=va(C-P,A-3),J-=A,A<=da){A--;do C++,aa();while(0!==--A);C++}else C+=A,A=0,p=m[C]&255,p=(p<<5^m[C+1]&255)&8191;else q=va(0,m[C]&255),J--,C++;q&&(wa(0),v=C);for(;262>J&&!B;)xa()}else for(;0!==J&&null===a;){aa(); -N=A;D=P;A=2;0!==y&&(N=C-y)&&(A=Ca(y),A>J&&(A=J),3===A&&4096J&&!B;)xa()}0===J&&(0!==H&&va(0,m[C-1]&255),wa(1),r=!0);return g+Ka(c,g+b,f-g)};this.deflate=function(e,p){var h,r;oa=e;I=0;"undefined"===String(typeof p)&&(p=6);(h=p)?1>h?h=1:9h;h++)ca[h]=new k;W=[];W.length=61;for(h=0;61>h;h++)W[h]=new k;O=[];O.length=288;for(h=0;288>h;h++)O[h]=new k;ba=[];ba.length=30;for(h=0;30>h;h++)ba[h]=new k;S=[];S.length=39;for(h=0;39>h;h++)S[h]=new k;Q=new g;F=new g;M=new g;L=[];L.length=16;K=[];K.length=573;E=[];E.length=573;G=[];G.length=256;ea=[];ea.length=512;ha=[];ha.length=29;V=[];V.length=30;R=[];R.length=1024}var l=Array(1024),u=[],t=[];for(h=La(l, -0,l.length);0>>8):(fa(a&255),fa(a>>>8))},aa=function(){p=(p<<5^n[C+3-1]&255)&8191;y=w[32768+p];w[C&32767]=y;w[32768+p]=C},ga=function(a,c){z>16-c?(v|=a<>16-z,z+=c-16):(v|=a<a;a++)n[a]=n[a+32768];P-=32768;C-=32768;u-=32768;for(a=0;8192>a;a++)c=w[32768+a],w[32768+a]=32768<=c?c-32768:0;for(a=0;32768>a;a++)c=w[a],w[a]=32768<=c?c-32768:0;h+=32768}B||(a=Ba(n,C+J,h),0>=a?B=!0:J+=a)},Ca=function(a){var c=U,h=C,d,b=N,e=32506=ka&&(c>>=2);do if(d=a,n[d+b]===g&&n[d+b-1]===f&&n[d]===n[h]&&n[++d]===n[h+1]){h+= +2;d++;do++h;while(n[h]===n[++d]&&n[++h]===n[++d]&&n[++h]===n[++d]&&n[++h]===n[++d]&&n[++h]===n[++d]&&n[++h]===n[++d]&&n[++h]===n[++d]&&n[++h]===n[++d]&&hb){P=a;b=d;if(258<=d)break;f=n[h+b-1];g=n[h+b]}a=w[a&32767]}while(a>e&&0!==--c);return b},va=function(a,c){r[Z++]=c;0===a?ca[c].fc++:(a--,ca[G[c]+256+1].fc++,W[(256>a?ea[a]:ea[256+(a>>7)])&255].fc++,q[X++]=a,qa|=x);x<<=1;0===(Z&7)&&(R[na++]=qa,qa=0,x=1);if(2b;b++)h+=W[b].fc* +(5+ra[b]);h>>=3;if(X>=1,h<<=1;while(0<--c);return h>>1},Ea=function(a,c){var h=[];h.length=16;var d=0,b;for(b=1;15>=b;b++)d=d+L[b-1]<<1,h[b]=d;for(d=0;d<=c;d++)b=a[d].dl,0!==b&&(a[d].fc=Da(h[b]++,b))},za=function(a){var c=a.dyn_tree,h=a.static_tree,d=a.elems,b,e=-1, +n=d;Y=0;la=573;for(b=0;bY;)b=K[++Y]=2>e?++e:0,c[b].fc=1,E[b]=0,ia--,null!==h&&(ma-=h[b].dl);a.max_code=e;for(b=Y>>1;1<=b;b--)ya(c,b);do b=K[1],K[1]=K[Y--],ya(c,1),h=K[1],K[--la]=b,K[--la]=h,c[n].fc=c[b].fc+c[h].fc,E[n]=E[b]>E[h]+1?E[b]:E[h]+1,c[b].dl=c[h].dl=n,K[1]=n++,ya(c,1);while(2<=Y);K[--la]=K[1];n=a.dyn_tree;b=a.extra_bits;var d=a.extra_base,h=a.max_code,p=a.max_length,f=a.static_tree,g,s,q,k,r=0;for(s=0;15>=s;s++)L[s]=0;n[K[la]].dl=0; +for(a=la+1;573>a;a++)g=K[a],s=n[n[g].dl].dl+1,s>p&&(s=p,r++),n[g].dl=s,g>h||(L[s]++,q=0,g>=d&&(q=b[g-d]),k=n[g].fc,ia+=k*(s+q),null!==f&&(ma+=k*(f[g].dl+q)));if(0!==r){do{for(s=p-1;0===L[s];)s--;L[s]--;L[s+1]+=2;L[p]--;r-=2}while(0h||(n[b].dl!==s&&(ia+=(s-n[b].dl)*n[b].fc,n[b].fc=s),g--)}Ea(c,e)},Fa=function(a,c){var h,d=-1,b,e=a[0].dl,n=0,p=7,f=4;0===e&&(p=138,f=3);a[c+1].dl=65535;for(h=0;h<=c;h++)b=e,e=a[h+1].dl,++n=n?S[17].fc++:S[18].fc++,n=0,d=b,0===e?(p=138,f=3):b===e?(p=6,f=3):(p=7,f=4))},Ga=function(){8h?ea[h]:ea[256+(h>>7)])&255,sa(p,c),f=ra[p],0!==f&&(h-=V[p],ga(h,f))),n>>=1;while(d=n?(sa(17,S),ga(n-3,3)):(sa(18,S),ga(n-11,7));n=0;d=b;0===e?(p=138,f=3):b===e?(p=6,f=3):(p=7,f=4)}},Ja=function(){var a;for(a=0;286>a;a++)ca[a].fc=0;for(a=0;30>a;a++)W[a].fc=0;for(a=0;19>a;a++)S[a].fc=0;ca[256].fc=1;qa=Z=X=na=ia=ma=0;x=1},wa=function(a){var h,c,d,b;b=C-u;R[na]=qa;za(Q);za(F);Fa(ca,Q.max_code);Fa(W,F.max_code);za(M);for(d=18;3<=d&&0=== +S[ua[d]].dl;d--);ia+=3*(d+1)+14;h=ia+3+7>>3;c=ma+3+7>>3;c<=h&&(h=c);if(b+4<=h&&0<=u)for(ga(0+a,3),Ga(),ja(b),ja(~b),d=0;da.len&&(p=a.len);for(f=0;ft-h&&(p=t-h);for(f=0;fq;q++)for(ha[q]=g,f=0;f<1<q;q++)for(V[q]=g,f=0;f<1<>=7;30>q;q++)for(V[q]=g<<7,f=0;f<1<=f;f++)L[f]=0;for(f=0;143>=f;)O[f++].dl=8,L[8]++;for(;255>=f;)O[f++].dl=9,L[9]++;for(;279>=f;)O[f++].dl=7,L[7]++;for(;287>=f;)O[f++].dl=8,L[8]++;Ea(O,287);for(f=0;30>f;f++)ba[f].dl=5,ba[f].fc=Da(f,5);Ja()}for(f=0;8192>f;f++)w[32768+f]=0;da=$[T].max_lazy;ka=$[T].good_length;U=$[T].max_chain;u=C=0;J=Ba(n, +0,65536);if(0>=J)B=!0,J=0;else{for(B=!1;262>J&&!B;)xa();for(f=p=0;2>f;f++)p=(p<<5^n[f]&255)&8191}a=null;h=t=0;3>=T?(N=2,A=0):(A=2,H=0);s=!1}d=!0;if(0===J)return s=!0,0}f=Ka(c,b,e);if(f===e)return e;if(s)return f;if(3>=T)for(;0!==J&&null===a;){aa();0!==y&&32506>=C-y&&(A=Ca(y),A>J&&(A=J));if(3<=A)if(q=va(C-P,A-3),J-=A,A<=da){A--;do C++,aa();while(0!==--A);C++}else C+=A,A=0,p=n[C]&255,p=(p<<5^n[C+1]&255)&8191;else q=va(0,n[C]&255),J--,C++;q&&(wa(0),u=C);for(;262>J&&!B;)xa()}else for(;0!==J&&null===a;){aa(); +N=A;D=P;A=2;0!==y&&(N=C-y)&&(A=Ca(y),A>J&&(A=J),3===A&&4096J&&!B;)xa()}0===J&&(0!==H&&va(0,n[C-1]&255),wa(1),s=!0);return f+Ka(c,f+b,e-f)};this.deflate=function(h,p){var g,s;oa=h;I=0;"undefined"===String(typeof p)&&(p=6);(g=p)?1>g?g=1:9g;g++)ca[g]=new l;W=[];W.length=61;for(g=0;61>g;g++)W[g]=new l;O=[];O.length=288;for(g=0;288>g;g++)O[g]=new l;ba=[];ba.length=30;for(g=0;30>g;g++)ba[g]=new l;S=[];S.length=39;for(g=0;39>g;g++)S[g]=new l;Q=new f;F=new f;M=new f;L=[];L.length=16;K=[];K.length=573;E=[];E.length=573;G=[];G.length=256;ea=[];ea.length=512;ha=[];ha.length=29;V=[];V.length=30;R=[];R.length=1024}var v=Array(1024),m=[],t=[];for(g=La(v, +0,v.length);0>8&255])};this.appendUInt32LE=function(h){g.appendArray([h&255,h>>8&255,h>>16&255,h>>24&255])};this.appendString=function(g){l=runtime.concatByteArrays(l, -runtime.byteArrayFromString(g,k))};this.getLength=function(){return l.length};this.getByteArray=function(){return l}}; +core.ByteArrayWriter=function(l){var f=this,m=new runtime.ByteArray(0);this.appendByteArrayWriter=function(f){m=runtime.concatByteArrays(m,f.getByteArray())};this.appendByteArray=function(f){m=runtime.concatByteArrays(m,f)};this.appendArray=function(f){m=runtime.concatByteArrays(m,runtime.byteArrayFromArray(f))};this.appendUInt16LE=function(g){f.appendArray([g&255,g>>8&255])};this.appendUInt32LE=function(g){f.appendArray([g&255,g>>8&255,g>>16&255,g>>24&255])};this.appendString=function(f){m=runtime.concatByteArrays(m, +runtime.byteArrayFromString(f,l))};this.getLength=function(){return m.length};this.getByteArray=function(){return m}}; // Input 6 -core.RawInflate=function(){var k,g,l=null,h,b,n,a,f,d,c,t,e,r,m,q,s,w,u=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],z=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],v=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],p=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],y=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],D=[16,17,18, -0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],H=function(){this.list=this.next=null},A=function(){this.n=this.b=this.e=0;this.t=null},N=function(a,c,e,d,b,f){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var m=Array(this.BMAX+1),g,p,h,r,q,n,s,l=Array(this.BMAX+1),u,k,w,t=new A,y=Array(this.BMAX);r=Array(this.N_MAX);var v,z=Array(this.BMAX+1),D,C,B;B=this.root=null;for(q=0;qq&&(f=q);for(D=1<(D-=m[n])){this.status=2;this.m=f;return}if(0>(D-=m[q]))this.status=2,this.m=f;else{m[q]+=D;z[1]=n=0;u=m;k=1;for(w=2;0<--q;)z[w++]=n+=u[k++];u=a;q=k=0;do 0!=(n=u[k++])&&(r[z[n]++]=q);while(++qv+l[1+r];){v+=l[1+r];r++;C=(C=h-v)>f?f:C;if((p=1<<(n=s-v))>a+1)for(p-=a+1,w=s;++ng&&v>v-l[r],y[r-1][n].e=t.e,y[r-1][n].b=t.b,y[r-1][n].n=t.n,y[r-1][n].t=t.t)}t.b=s-v;k>=c?t.e=99:u[k]u[k]?16:15,t.n=u[k++]): -(t.e=b[u[k]-e],t.n=d[u[k++]-e]);p=1<>v;n>=1)q^=n;for(q^=n;(q&(1<>=c;a-=c},J=function(a,d,b){var p,h,n;if(0==b)return 0;for(n=0;;){C(m);h=e.list[P(m)];for(p=h.e;16 -f;f++)u[D[f]]=0;m=7;f=new N(u,19,19,null,null,m);if(0!=f.status)return-1;e=f.root;m=f.m;h=s+l;for(b=g=0;bf)u[b++]=g=f;else if(16==f){C(2);f=3+P(2);B(2);if(b+f>h)return-1;for(;0h)return-1;for(;0F;F++)Q[F]=8;for(;256>F;F++)Q[F]=9;for(;280>F;F++)Q[F]=7;for(;288>F;F++)Q[F]=8;b=7;F=new N(Q,288,257,z,v,b);if(0!=F.status){alert("HufBuild error: "+F.status);O=-1;break b}l=F.root;b=F.m;for(F=0;30>F;F++)Q[F]=5;U=5;F=new N(Q,30,0,p,y,U);if(1q&&(e=q);for(D=1<(D-=n[k])){this.status=2;this.m=e;return}if(0>(D-=n[q]))this.status=2,this.m=e;else{n[q]+=D;z[1]=k=0;m=n;l=1;for(t=2;0<--q;)z[t++]=k+=m[l++];m=a;q=l=0;do 0!=(k=m[l++])&&(s[z[k]++]=q);while(++qu+v[1+s];){u+=v[1+s];s++;C=(C=g-u)>e?e:C;if((p=1<<(k=r-u))>a+1)for(p-=a+1,t=r;++kf&&u>u-v[s],y[s-1][k].e=w.e,y[s-1][k].b=w.b,y[s-1][k].n=w.n,y[s-1][k].t=w.t)}w.b=r-u;l>=c?w.e=99:m[l]m[l]?16:15,w.n=m[l++]): +(w.e=b[m[l]-h],w.n=d[m[l++]-h]);p=1<>u;k>=1)q^=k;for(q^=k;(q&(1<>=c;a-=c},J=function(a,d,b){var p,g,k;if(0==b)return 0;for(k=0;;){C(n);g=h.list[P(n)];for(p=g.e;16 +e;e++)m[D[e]]=0;n=7;e=new N(m,19,19,null,null,n);if(0!=e.status)return-1;h=e.root;n=e.m;g=r+v;for(b=f=0;be)m[b++]=f=e;else if(16==e){C(2);e=3+P(2);B(2);if(b+e>g)return-1;for(;0g)return-1;for(;0F;F++)Q[F]=8;for(;256>F;F++)Q[F]=9;for(;280>F;F++)Q[F]=7;for(;288>F;F++)Q[F]=8;b=7;F=new N(Q,288,257,z,u,b);if(0!=F.status){alert("HufBuild error: "+F.status);O=-1;break b}m=F.root;b=F.m;for(F=0;30>F;F++)Q[F]=5;U=5;F=new N(Q,30,0,p,y,U);if(1k))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0g))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; +core.LoopWatchDog=function(l,f){var m=Date.now(),g=0;this.check=function(){var b;if(l&&(b=Date.now(),b-m>l))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0f))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; // Input 8 -core.Utils=function(){this.hashString=function(k){var g=0,l,h;l=0;for(h=k.length;l= -g.compareBoundaryPoints(g.START_TO_START,l)&&0<=g.compareBoundaryPoints(g.END_TO_END,l)};this.rangesIntersect=function(g,l){return 0>=g.compareBoundaryPoints(g.END_TO_START,l)&&0<=g.compareBoundaryPoints(g.START_TO_END,l)};this.getNodesInRange=function(g,l){var h=[],b,n=g.startContainer.ownerDocument.createTreeWalker(g.commonAncestorContainer,NodeFilter.SHOW_ALL,l,!1);for(b=n.currentNode=g.startContainer;b;){if(l(b)===NodeFilter.FILTER_ACCEPT)h.push(b);else if(l(b)===NodeFilter.FILTER_REJECT)break; -b=b.parentNode}h.reverse();for(b=n.nextNode();b;)h.push(b),b=n.nextNode();return h};this.normalizeTextNodes=function(g){g&&g.nextSibling&&(g=k(g,g.nextSibling));g&&g.previousSibling&&k(g.previousSibling,g)};this.rangeContainsNode=function(g,l){var h=l.ownerDocument.createRange(),b=l.nodeType===Node.TEXT_NODE?l.length:l.childNodes.length;h.setStart(g.startContainer,g.startOffset);h.setEnd(g.endContainer,g.endOffset);b=0===h.comparePoint(l,0)&&0===h.comparePoint(l,b);h.detach();return b};this.mergeIntoParent= -function(g){for(var l=g.parentNode;g.firstChild;)l.insertBefore(g.firstChild,g);l.removeChild(g);return l};this.getElementsByTagNameNS=function(g,l,h){return Array.prototype.slice.call(g.getElementsByTagNameNS(l,h))};this.rangeIntersectsNode=function(g,l){var h=l.nodeType===Node.TEXT_NODE?l.length:l.childNodes.length;return 0>=g.comparePoint(l,0)&&0<=g.comparePoint(l,h)}}; +core.DomUtils=function(){function l(f,m){if(f.nodeType===Node.TEXT_NODE)if(0===f.length)f.parentNode.removeChild(f);else if(m.nodeType===Node.TEXT_NODE)return m.insertData(0,f.data),f.parentNode.removeChild(f),m;return f}this.splitBoundaries=function(f){var m=[],g;if(f.startContainer.nodeType===Node.TEXT_NODE||f.endContainer.nodeType===Node.TEXT_NODE){g=f.endContainer;var b=f.endOffset;if(b= +f.compareBoundaryPoints(f.START_TO_START,m)&&0<=f.compareBoundaryPoints(f.END_TO_END,m)};this.rangesIntersect=function(f,m){return 0>=f.compareBoundaryPoints(f.END_TO_START,m)&&0<=f.compareBoundaryPoints(f.START_TO_END,m)};this.getNodesInRange=function(f,m){var g=[],b,k=f.startContainer.ownerDocument.createTreeWalker(f.commonAncestorContainer,NodeFilter.SHOW_ALL,m,!1);for(b=k.currentNode=f.startContainer;b;){if(m(b)===NodeFilter.FILTER_ACCEPT)g.push(b);else if(m(b)===NodeFilter.FILTER_REJECT)break; +b=b.parentNode}g.reverse();for(b=k.nextNode();b;)g.push(b),b=k.nextNode();return g};this.normalizeTextNodes=function(f){f&&f.nextSibling&&(f=l(f,f.nextSibling));f&&f.previousSibling&&l(f.previousSibling,f)};this.rangeContainsNode=function(f,m){var g=m.ownerDocument.createRange(),b=m.nodeType===Node.TEXT_NODE?m.length:m.childNodes.length;g.setStart(f.startContainer,f.startOffset);g.setEnd(f.endContainer,f.endOffset);b=0===g.comparePoint(m,0)&&0===g.comparePoint(m,b);g.detach();return b};this.mergeIntoParent= +function(f){for(var m=f.parentNode;f.firstChild;)m.insertBefore(f.firstChild,f);m.removeChild(f);return m};this.getElementsByTagNameNS=function(f,m,g){return Array.prototype.slice.call(f.getElementsByTagNameNS(m,g))};this.rangeIntersectsNode=function(f,m){var g=m.nodeType===Node.TEXT_NODE?m.length:m.childNodes.length;return 0>=f.comparePoint(m,0)&&0<=f.comparePoint(m,g)}}; // Input 10 runtime.loadClass("core.DomUtils"); -core.Cursor=function(k,g){function l(a){a.parentNode&&(f.push(a.previousSibling),f.push(a.nextSibling),a.parentNode.removeChild(a))}function h(a,c,d){if(c.nodeType===Node.TEXT_NODE){runtime.assert(Boolean(c),"putCursorIntoTextNode: invalid container");var b=c.parentNode;runtime.assert(Boolean(b),"putCursorIntoTextNode: container without parent");runtime.assert(0<=d&&d<=c.length,"putCursorIntoTextNode: offset is out of bounds");0===d?b.insertBefore(a,c):(d!==c.length&&c.splitText(d),b.insertBefore(a, -c.nextSibling))}else if(c.nodeType===Node.ELEMENT_NODE){runtime.assert(Boolean(c),"putCursorIntoContainer: invalid container");for(b=c.firstChild;null!==b&&01/g?"-0":String(g),k(c+" should be "+a+". Was "+f+".")):k(c+" should be "+a+" (of type "+typeof a+"). Was "+g+" (of type "+typeof g+").")}var a=0,f;f=function(a,c){var f=Object.keys(a),e=Object.keys(c);f.sort();e.sort();return g(f,e)&&Object.keys(a).every(function(e){var f= -a[e],g=c[e];return b(f,g)?!0:(k(f+" should be "+g+" for key "+e),!1)})};this.areNodesEqual=h;this.shouldBeNull=function(a,c){n(a,c,"null")};this.shouldBeNonNull=function(a,c){var b,e;try{e=eval(c)}catch(f){b=f}b?k(c+" should be non-null. Threw exception "+b):null!==e?runtime.log("pass",c+" is non-null."):k(c+" should be non-null. Was "+e)};this.shouldBe=n;this.countFailedTests=function(){return a}}; -core.UnitTester=function(){function k(g,b){return""+g+""}var g=0,l={};this.runTests=function(h,b,n){function a(e){if(0===e.length)l[f]=t,g+=d.countFailedTests(),b();else{r=e[0];var m=Runtime.getFunctionName(r);runtime.log("Running "+m);q=d.countFailedTests();c.setUp();r(function(){c.tearDown();t[m]=q===d.countFailedTests();a(e.slice(1))})}}var f=Runtime.getFunctionName(h),d=new core.UnitTestRunner,c=new h(d),t={},e,r,m,q,s="BrowserRuntime"=== -runtime.type();if(l.hasOwnProperty(f))runtime.log("Test "+f+" has already run.");else{s?runtime.log("Running "+k(f,'runSuite("'+f+'");')+": "+c.description()+""):runtime.log("Running "+f+": "+c.description);m=c.tests();for(e=0;eRunning "+k(h,'runTest("'+f+'","'+h+'")')+""):runtime.log("Running "+h),q=d.countFailedTests(),c.setUp(),r(),c.tearDown(),t[h]=q===d.countFailedTests()); -a(c.asyncTests())}};this.countFailedTests=function(){return g};this.results=function(){return l}}; +core.UnitTest.provideTestAreaDiv=function(){var l=runtime.getWindow().document,f=l.getElementById("testarea");runtime.assert(!f,'Unclean test environment, found a div with id "testarea".');f=l.createElement("div");f.setAttribute("id","testarea");l.body.appendChild(f);return f}; +core.UnitTest.cleanupTestAreaDiv=function(){var l=runtime.getWindow().document,f=l.getElementById("testarea");runtime.assert(!!f&&f.parentNode===l.body,'Test environment broken, found no div with id "testarea" below body.');l.body.removeChild(f)}; +core.UnitTestRunner=function(){function l(d){a+=1;runtime.log("fail",d)}function f(a,c){var b;try{if(a.length!==c.length)return l("array of length "+a.length+" should be "+c.length+" long"),!1;for(b=0;b1/f?"-0":String(f),l(c+" should be "+a+". Was "+e+".")):l(c+" should be "+a+" (of type "+typeof a+"). Was "+f+" (of type "+typeof f+").")}var a=0,e;e=function(a,c){var e=Object.keys(a),h=Object.keys(c);e.sort();h.sort();return f(e,h)&&Object.keys(a).every(function(h){var e= +a[h],f=c[h];return b(e,f)?!0:(l(e+" should be "+f+" for key "+h),!1)})};this.areNodesEqual=g;this.shouldBeNull=function(a,c){k(a,c,"null")};this.shouldBeNonNull=function(a,c){var b,h;try{h=eval(c)}catch(e){b=e}b?l(c+" should be non-null. Threw exception "+b):null!==h?runtime.log("pass",c+" is non-null."):l(c+" should be non-null. Was "+h)};this.shouldBe=k;this.countFailedTests=function(){return a}}; +core.UnitTester=function(){function l(f,b){return""+f+""}var f=0,m={};this.runTests=function(g,b,k){function a(h){if(0===h.length)m[e]=t,f+=d.countFailedTests(),b();else{s=h[0];var n=Runtime.getFunctionName(s);runtime.log("Running "+n);q=d.countFailedTests();c.setUp();s(function(){c.tearDown();t[n]=q===d.countFailedTests();a(h.slice(1))})}}var e=Runtime.getFunctionName(g),d=new core.UnitTestRunner,c=new g(d),t={},h,s,n,q,r="BrowserRuntime"=== +runtime.type();if(m.hasOwnProperty(e))runtime.log("Test "+e+" has already run.");else{r?runtime.log("Running "+l(e,'runSuite("'+e+'");')+": "+c.description()+""):runtime.log("Running "+e+": "+c.description);n=c.tests();for(h=0;hRunning "+l(g,'runTest("'+e+'","'+g+'")')+""):runtime.log("Running "+g),q=d.countFailedTests(),c.setUp(),s(),c.tearDown(),t[g]=q===d.countFailedTests()); +a(c.asyncTests())}};this.countFailedTests=function(){return f};this.results=function(){return m}}; // Input 13 -core.PositionIterator=function(k,g,l,h){function b(){this.acceptNode=function(a){return a.nodeType===Node.TEXT_NODE&&0===a.length?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}function n(a){this.acceptNode=function(c){return c.nodeType===Node.TEXT_NODE&&0===c.length?NodeFilter.FILTER_REJECT:a.acceptNode(c)}}function a(){var a=d.currentNode.nodeType;c=a===Node.TEXT_NODE?d.currentNode.length-1:a===Node.ELEMENT_NODE?1:0}var f=this,d,c,t;this.nextPosition=function(){if(d.currentNode===k)return!1; -if(0===c&&d.currentNode.nodeType===Node.ELEMENT_NODE)null===d.firstChild()&&(c=1);else if(d.currentNode.nodeType===Node.TEXT_NODE&&c+1 "+a.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"), -b===a.length&&(c=void 0,d.nextSibling()?c=0:d.parentNode()&&(c=1),runtime.assert(void 0!==c,"Error in setPosition: position not valid.")),!0;g=t(a);b "+a.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"), +b===a.length&&(c=void 0,d.nextSibling()?c=0:d.parentNode()&&(c=1),runtime.assert(void 0!==c,"Error in setPosition: position not valid.")),!0;f=t(a);b>>8^f;return b^-1}function h(a){return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&15,a>>5&63,(a&31)<<1)}function b(a){var 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,e,d,f,g,m,n,r=this;this.load=function(c){if(void 0!==r.data)c(null,r.data);else{var b=g+34+e+d+256;b+n>q&&(b=q-n);runtime.read(a,n,b,function(b,e){if(b||null===e)c(b,e);else a:{var d=e,p=new core.ByteArray(d),h=p.readUInt32LE(),n;if(67324752!==h)c("File entry signature is wrong."+h.toString()+" "+d.length.toString(),null);else{p.pos+=22;h=p.readUInt16LE();n=p.readUInt16LE();p.pos+=h+n; -if(f){d=d.slice(p.pos,p.pos+g);if(g!==d.length){c("The amount of compressed bytes read was "+d.length.toString()+" instead of "+g.toString()+" for "+r.filename+" in "+a+".",null);break a}d=w(d,m)}else d=d.slice(p.pos,p.pos+m);m!==d.length?c("The amount of bytes read was "+d.length.toString()+" instead of "+m.toString()+" for "+r.filename+" in "+a+".",null):(r.data=d,c(null,d))}}})}};this.set=function(a,c,b,e){r.filename=a;r.data=c;r.compressed=b;r.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=h(c.readUInt32LE()),c.readUInt32LE(),g=c.readUInt32LE(),m=c.readUInt32LE(),e=c.readUInt16LE(),d=c.readUInt16LE(),b=c.readUInt16LE(),c.pos+=8,n=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.slice(c.pos,c.pos+e),"utf8"),c.pos+=e+d+b))}function a(a,c){if(22!==a.length)c("Central directory length should be 22.", -u);else{var b=new core.ByteArray(a),e;e=b.readUInt32LE();101010256!==e?c("Central directory signature is wrong: "+e.toString(),u):(e=b.readUInt16LE(),0!==e?c("Zip files with non-zero disk numbers are not supported.",u):(e=b.readUInt16LE(),0!==e?c("Zip files with non-zero disk numbers are not supported.",u):(e=b.readUInt16LE(),s=b.readUInt16LE(),e!==s?c("Number of entries is inconsistent.",u):(e=b.readUInt32LE(),b=b.readUInt16LE(),b=q-22-e,runtime.read(k,b,q-b,function(a,b){if(a||null===b)c(a,u);else a:{var e= -new core.ByteArray(b),d,f;m=[];for(d=0;dq?g("File '"+k+"' cannot be read.",u):runtime.read(k,q-22,22,function(c,b){c||null===g||null===b?g(c,u):a(b,g)})})}; +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,h,d=a.length,e=0,e=0;b=-1;for(h=0;h>>8^e;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 b(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 k(a,c){var b,h,d,e,f,n,k,r=this;this.load=function(c){if(void 0!==r.data)c(null,r.data);else{var b=f+34+h+d+256;b+k>q&&(b=q-k);runtime.read(a,k,b,function(b,h){if(b||null===h)c(b,h);else a:{var d=h,p=new core.ByteArray(d),g=p.readUInt32LE(),k;if(67324752!==g)c("File entry signature is wrong."+g.toString()+" "+d.length.toString(),null);else{p.pos+=22;g=p.readUInt16LE();k=p.readUInt16LE();p.pos+=g+k; +if(e){d=d.slice(p.pos,p.pos+f);if(f!==d.length){c("The amount of compressed bytes read was "+d.length.toString()+" instead of "+f.toString()+" for "+r.filename+" in "+a+".",null);break a}d=w(d,n)}else d=d.slice(p.pos,p.pos+n);n!==d.length?c("The amount of bytes read was "+d.length.toString()+" instead of "+n.toString()+" for "+r.filename+" in "+a+".",null):(r.data=d,c(null,d))}}})}};this.set=function(a,c,b,d){r.filename=a;r.data=c;r.compressed=b;r.date=d};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,e=c.readUInt16LE(),this.date=g(c.readUInt32LE()),c.readUInt32LE(),f=c.readUInt32LE(),n=c.readUInt32LE(),h=c.readUInt16LE(),d=c.readUInt16LE(),b=c.readUInt16LE(),c.pos+=8,k=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.slice(c.pos,c.pos+h),"utf8"),c.pos+=h+d+b))}function a(a,c){if(22!==a.length)c("Central directory length should be 22.", +v);else{var b=new core.ByteArray(a),d;d=b.readUInt32LE();101010256!==d?c("Central directory signature is wrong: "+d.toString(),v):(d=b.readUInt16LE(),0!==d?c("Zip files with non-zero disk numbers are not supported.",v):(d=b.readUInt16LE(),0!==d?c("Zip files with non-zero disk numbers are not supported.",v):(d=b.readUInt16LE(),r=b.readUInt16LE(),d!==r?c("Number of entries is inconsistent.",v):(d=b.readUInt32LE(),b=b.readUInt16LE(),b=q-22-d,runtime.read(l,b,q-b,function(a,b){if(a||null===b)c(a,v);else a:{var d= +new core.ByteArray(b),h,e;n=[];for(h=0;hq?f("File '"+l+"' cannot be read.",v):runtime.read(l,q-22,22,function(c,b){c||null===f||null===b?f(c,v):a(b,f)})})}; // Input 18 -core.CSSUnits=function(){var k={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(g,l,h){return g*k[h]/k[l]};this.convertMeasure=function(g,l){var h,b;g&&l?(h=parseFloat(g),b=g.replace(h.toString(),""),h=this.convert(h,b,l)):h="";return h.toString()};this.getUnits=function(g){return g.substr(g.length-2,g.length)}}; +core.CSSUnits=function(){var l={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(f,m,g){return f*l[g]/l[m]};this.convertMeasure=function(f,m){var g,b;f&&m?(g=parseFloat(f),b=f.replace(g.toString(),""),g=this.convert(g,b,m)):g="";return g.toString()};this.getUnits=function(f){return f.substr(f.length-2,f.length)}}; // Input 19 xmldom.LSSerializerFilter=function(){}; // Input 20 -"function"!==typeof Object.create&&(Object.create=function(k){var g=function(){};g.prototype=k;return new g}); -xmldom.LSSerializer=function(){function k(b){var g=b||{},a=function(a){var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[a[b]]=b);return c}(b),f=[g],d=[a],c=0;this.push=function(){c+=1;g=f[c]=Object.create(g);a=d[c]=Object.create(a)};this.pop=function(){f[c]=void 0;d[c]=void 0;c-=1;g=f[c];a=d[c]};this.getLocalNamespaceDefinitions=function(){return a};this.getQName=function(c){var b=c.namespaceURI,d=0,f;if(!b)return c.localName;if(f=a[b])return f+":"+c.localName;do{f||!c.prefix?(f="ns"+d,d+=1):f=c.prefix; -if(g[f]===b)break;if(!g[f]){g[f]=b;a[b]=f;break}f=null}while(null===f);return f+":"+c.localName}}function g(b){return b.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function l(b,n){var a="",f=h.filter?h.filter.acceptNode(n):NodeFilter.FILTER_ACCEPT,d;if(f===NodeFilter.FILTER_ACCEPT&&n.nodeType===Node.ELEMENT_NODE){b.push();d=b.getQName(n);var c,k=n.attributes,e,r,m,q="",s;c="<"+d;e=k.length;for(r=0;r")}if(f===NodeFilter.FILTER_ACCEPT||f===NodeFilter.FILTER_SKIP){for(f=n.firstChild;f;)a+=l(b,f),f=f.nextSibling;n.nodeValue&&(a+=g(n.nodeValue))}d&&(a+="",b.pop());return a}var h=this;this.filter=null;this.writeToString=function(b,g){if(!b)return"";var a=new k(g);return l(a,b)}}; +"function"!==typeof Object.create&&(Object.create=function(l){var f=function(){};f.prototype=l;return new f}); +xmldom.LSSerializer=function(){function l(b){var f=b||{},a=function(a){var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[a[b]]=b);return c}(b),e=[f],d=[a],c=0;this.push=function(){c+=1;f=e[c]=Object.create(f);a=d[c]=Object.create(a)};this.pop=function(){e[c]=void 0;d[c]=void 0;c-=1;f=e[c];a=d[c]};this.getLocalNamespaceDefinitions=function(){return a};this.getQName=function(c){var b=c.namespaceURI,d=0,e;if(!b)return c.localName;if(e=a[b])return e+":"+c.localName;do{e||!c.prefix?(e="ns"+d,d+=1):e=c.prefix; +if(f[e]===b)break;if(!f[e]){f[e]=b;a[b]=e;break}e=null}while(null===e);return e+":"+c.localName}}function f(b){return b.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function m(b,k){var a="",e=g.filter?g.filter.acceptNode(k):NodeFilter.FILTER_ACCEPT,d;if(e===NodeFilter.FILTER_ACCEPT&&k.nodeType===Node.ELEMENT_NODE){b.push();d=b.getQName(k);var c,l=k.attributes,h,s,n,q="",r;c="<"+d;h=l.length;for(s=0;s")}if(e===NodeFilter.FILTER_ACCEPT||e===NodeFilter.FILTER_SKIP){for(e=k.firstChild;e;)a+=m(b,e),e=e.nextSibling;k.nodeValue&&(a+=f(k.nodeValue))}d&&(a+="",b.pop());return a}var g=this;this.filter=null;this.writeToString=function(b,f){if(!b)return"";var a=new l(f);return m(a,b)}}; // Input 21 -xmldom.RelaxNGParser=function(){function k(a,b){this.message=function(){b&&(a+=1===b.nodeType?" Element ":" Node ",a+=b.nodeName,b.nodeValue&&(a+=" with value '"+b.nodeValue+"'"),a+=".");return a}}function g(a){if(2>=a.e.length)return a;var b={name:a.name,e:a.e.slice(0,2)};return g({name:a.name,e:[b].concat(a.e.slice(2))})}function l(a){a=a.split(":",2);var b="",e;1===a.length?a=["",a[0]]:b=a[0];for(e in f)f[e]===b&&(a[0]=e);return a}function h(a,b){for(var e=0,d,f,g=a.name;a.e&&e=a.e.length)return a;var b={name:a.name,e:a.e.slice(0,2)};return f({name:a.name,e:[b].concat(a.e.slice(2))})}function m(a){a=a.split(":",2);var b="",d;1===a.length?a=["",a[0]]:b=a[0];for(d in e)e[d]===b&&(a[0]=d);return a}function g(a,b){for(var d=0,e,f,k=a.name;a.e&&d=d.length)return b;0===e&&(e=0);for(var g=d.item(e);g.namespaceURI===c;){e+=1;if(e>=d.length)return b;g=d.item(e)}return g=f(a,b.attDeriv(a,d.item(e)),d,e+1)}function d(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):d(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)): -d(a,b,c.e[1])}var c="http://www.w3.org/2000/xmlns/",t,e,r,m,q,s,w,u,z,v,p={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return p},startTagOpenDeriv:function(){return p},attDeriv:function(){return p},startTagCloseDeriv:function(){return p},endTagDeriv:function(){return p}},y={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return p},startTagOpenDeriv:function(){return p},attDeriv:function(){return p},startTagCloseDeriv:function(){return y},endTagDeriv:function(){return p}}, -D={type:"text",nullable:!0,hash:"text",textDeriv:function(){return D},startTagOpenDeriv:function(){return p},attDeriv:function(){return p},startTagCloseDeriv:function(){return D},endTagDeriv:function(){return p}},H,A,N;t=h("choice",function(a,b){if(a===p)return b;if(b===p||a===b)return a},function(a,c){var e={},d;b(e,{p1:a,p2:c});c=a=void 0;for(d in e)e.hasOwnProperty(d)&&(void 0===a?a=e[d]:c=void 0===c?e[d]:t(c,e[d]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, -textDeriv:function(c,e){return t(a.textDeriv(c,e),b.textDeriv(c,e))},startTagOpenDeriv:l(function(c){return t(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,e){return t(a.attDeriv(c,e),b.attDeriv(c,e))},startTagCloseDeriv:k(function(){return t(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:k(function(){return t(a.endTagDeriv(),b.endTagDeriv())})}}(a,c)});e=function(a,b,c){return function(){var e={},d=0;return function(f,g){var m=b&&b(f,g),h,p;if(void 0!==m)return m; -m=f.hash||f.toString();h=g.hash||g.toString();m=d.length)return b;0===h&&(h=0);for(var f=d.item(h);f.namespaceURI===c;){h+=1;if(h>=d.length)return b;f=d.item(h)}return f=e(a,b.attDeriv(a,d.item(h)),d,h+1)}function d(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):d(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)): +d(a,b,c.e[1])}var c="http://www.w3.org/2000/xmlns/",t,h,s,n,q,r,w,v,z,u,p={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return p},startTagOpenDeriv:function(){return p},attDeriv:function(){return p},startTagCloseDeriv:function(){return p},endTagDeriv:function(){return p}},y={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return p},startTagOpenDeriv:function(){return p},attDeriv:function(){return p},startTagCloseDeriv:function(){return y},endTagDeriv:function(){return p}}, +D={type:"text",nullable:!0,hash:"text",textDeriv:function(){return D},startTagOpenDeriv:function(){return p},attDeriv:function(){return p},startTagCloseDeriv:function(){return D},endTagDeriv:function(){return p}},H,A,N;t=g("choice",function(a,b){if(a===p)return b;if(b===p||a===b)return a},function(a,c){var d={},e;b(d,{p1:a,p2:c});c=a=void 0;for(e in d)d.hasOwnProperty(e)&&(void 0===a?a=d[e]:c=void 0===c?d[e]:t(c,d[e]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, +textDeriv:function(c,d){return t(a.textDeriv(c,d),b.textDeriv(c,d))},startTagOpenDeriv:m(function(c){return t(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,d){return t(a.attDeriv(c,d),b.attDeriv(c,d))},startTagCloseDeriv:l(function(){return t(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:l(function(){return t(a.endTagDeriv(),b.endTagDeriv())})}}(a,c)});h=function(a,b,c){return function(){var d={},e=0;return function(h,f){var g=b&&b(h,f),n,p;if(void 0!==g)return g; +g=h.hash||h.toString();n=f.hash||f.toString();gNode.ELEMENT_NODE;){if(c!==Node.COMMENT_NODE&&(c!==Node.TEXT_NODE||!/^\s+$/.test(b.currentNode.nodeValue)))return[new k("Not allowed node of type "+ -c+".")];c=(d=b.nextSibling())?d.nodeType:0}if(!d)return[new k("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(n[d.namespaceURI]+":"+d.localName))return[new k("Found "+d.nodeName+" instead of "+a.names+".",d)];if(b.firstChild()){for(h=g(a.e[1],b,d);b.nextSibling();)if(c=b.currentNode.nodeType,!(b.currentNode&&b.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(b.currentNode.nodeValue)||c===Node.COMMENT_NODE))return[new k("Spurious content.",b.currentNode)];if(b.parentNode()!==d)return[new k("Implementation error.")]}else h= -g(a.e[1],b,d);b.nextSibling();return h}var h,b,n;b=function(a,f,d,c){var h=a.name,e=null;if("text"===h)a:{for(var n=(a=f.currentNode)?a.nodeType:0;a!==d&&3!==n;){if(1===n){e=[new k("Element not allowed here.",a)];break a}n=(a=f.nextSibling())?a.nodeType:0}f.nextSibling();e=null}else if("data"===h)e=null;else if("value"===h)c!==a.text&&(e=[new k("Wrong value, should be '"+a.text+"', not '"+c+"'",d)]);else if("list"===h)e=null;else if("attribute"===h)a:{if(2!==a.e.length)throw"Attribute with wrong # of elements: "+ -a.e.length;h=a.localnames.length;for(e=0;eNode.ELEMENT_NODE;){if(c!==Node.COMMENT_NODE&&(c!==Node.TEXT_NODE||!/^\s+$/.test(b.currentNode.nodeValue)))return[new l("Not allowed node of type "+ +c+".")];c=(d=b.nextSibling())?d.nodeType:0}if(!d)return[new l("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(k[d.namespaceURI]+":"+d.localName))return[new l("Found "+d.nodeName+" instead of "+a.names+".",d)];if(b.firstChild()){for(g=f(a.e[1],b,d);b.nextSibling();)if(c=b.currentNode.nodeType,!(b.currentNode&&b.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(b.currentNode.nodeValue)||c===Node.COMMENT_NODE))return[new l("Spurious content.",b.currentNode)];if(b.parentNode()!==d)return[new l("Implementation error.")]}else g= +f(a.e[1],b,d);b.nextSibling();return g}var g,b,k;b=function(a,e,d,c){var g=a.name,h=null;if("text"===g)a:{for(var k=(a=e.currentNode)?a.nodeType:0;a!==d&&3!==k;){if(1===k){h=[new l("Element not allowed here.",a)];break a}k=(a=e.nextSibling())?a.nodeType:0}e.nextSibling();h=null}else if("data"===g)h=null;else if("value"===g)c!==a.text&&(h=[new l("Wrong value, should be '"+a.text+"', not '"+c+"'",d)]);else if("list"===g)h=null;else if("attribute"===g)a:{if(2!==a.e.length)throw"Attribute with wrong # of elements: "+ +a.e.length;g=a.localnames.length;for(h=0;h=h&&c.push(g(a.substring(b,d)))):"["===a[d]&&(0>=h&&(b=d+1),h+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};c=function(c,d,g){var n,l,k,u;for(n=0;n=g&&c.push(f(a.substring(b,d)))):"["===a[d]&&(0>=g&&(b=d+1),g+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};c=function(c,d,f){var k,m,l,v;for(k=0;k=l.getBoundingClientRect().top-w.bottom? -e.style.top=Math.abs(l.getBoundingClientRect().top-w.bottom)+20+"px":e.style.top="0px");m.style.left=h.getBoundingClientRect().width+"px";var h=m.style,l=m.getBoundingClientRect().left,k=m.getBoundingClientRect().top,w=e.getBoundingClientRect().left,u=e.getBoundingClientRect().top,z=0,v=0,z=w-l,z=z*z,v=u-k,v=v*v,l=Math.sqrt(z+v);h.width=l+"px";k=Math.asin((e.getBoundingClientRect().top-m.getBoundingClientRect().top)/parseFloat(m.style.width));m.style.transform="rotate("+k+"rad)";m.style.MozTransform= -"rotate("+k+"rad)";m.style.WebkitTransform="rotate("+k+"rad)";m.style.msTransform="rotate("+k+"rad)";f&&(w=d.getComputedStyle(f,":before").content)&&"none"!==w&&(w=w.substring(1,w.length-1),f.firstChild?f.firstChild.nodeValue=w:f.appendChild(a.createTextNode(w)))}}var n=[],a=k.ownerDocument,f=new odf.OdfUtils,d=runtime.getWindow();runtime.assert(Boolean(d),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=b;this.addAnnotation=function(c){n.push({node:c.node, -end:c.end});h();var d=a.createElement("div"),e=a.createElement("div"),f=a.createElement("div"),g=a.createElement("div"),k=c.node;d.className="annotationWrapper";k.parentNode.insertBefore(d,k);e.className="annotationNote";e.appendChild(k);f.className="annotationConnector horizontal";g.className="annotationConnector angular";d.appendChild(e);d.appendChild(f);d.appendChild(g);c.end&&l(c);b()};this.forgetAnnotations=function(){for(;n.length;){var b=n[0],d=b.node,e=d.parentNode.parentNode;"div"===e.localName&& -(e.parentNode.insertBefore(d,e),e.parentNode.removeChild(e));for(var d=b.node.getAttributeNS(odf.Namespaces.officens,"name"),d=a.querySelectorAll('span.annotationHighlight[annotation="'+d+'"]'),f=e=void 0,g=void 0,h=void 0,e=0;e=m.getBoundingClientRect().top-w.bottom? +h.style.top=Math.abs(m.getBoundingClientRect().top-w.bottom)+20+"px":h.style.top="0px");n.style.left=g.getBoundingClientRect().width+"px";var g=n.style,m=n.getBoundingClientRect().left,l=n.getBoundingClientRect().top,w=h.getBoundingClientRect().left,v=h.getBoundingClientRect().top,z=0,u=0,z=w-m,z=z*z,u=v-l,u=u*u,m=Math.sqrt(z+u);g.width=m+"px";l=Math.asin((h.getBoundingClientRect().top-n.getBoundingClientRect().top)/parseFloat(n.style.width));n.style.transform="rotate("+l+"rad)";n.style.MozTransform= +"rotate("+l+"rad)";n.style.WebkitTransform="rotate("+l+"rad)";n.style.msTransform="rotate("+l+"rad)";e&&(w=d.getComputedStyle(e,":before").content)&&"none"!==w&&(w=w.substring(1,w.length-1),e.firstChild?e.firstChild.nodeValue=w:e.appendChild(a.createTextNode(w)))}}var k=[],a=l.ownerDocument,e=new odf.OdfUtils,d=runtime.getWindow();runtime.assert(Boolean(d),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=b;this.addAnnotation=function(c){k.push({node:c.node, +end:c.end});g();var d=a.createElement("div"),e=a.createElement("div"),f=a.createElement("div"),n=a.createElement("div"),l=c.node;d.className="annotationWrapper";l.parentNode.insertBefore(d,l);e.className="annotationNote";e.appendChild(l);f.className="annotationConnector horizontal";n.className="annotationConnector angular";d.appendChild(e);d.appendChild(f);d.appendChild(n);c.end&&m(c);b()};this.forgetAnnotations=function(){for(;k.length;){var b=k[0],d=b.node,e=d.parentNode.parentNode;"div"===e.localName&& +(e.parentNode.insertBefore(d,e),e.parentNode.removeChild(e));for(var d=b.node.getAttributeNS(odf.Namespaces.officens,"name"),d=a.querySelectorAll('span.annotationHighlight[annotation="'+d+'"]'),f=e=void 0,g=void 0,m=void 0,e=0;e=b.value||"%"===b.unit)?null:b;return b||q(a)};this.parseFoLineHeight=function(a){var b;b=(b=m(a))&&(0>b.value|| -"%"===b.unit)?null:b;return b||q(a)};this.getImpactedParagraphs=function(a){var b=a.commonAncestorContainer,c=[];for(b.nodeType===Node.ELEMENT_NODE&&(c=v.getElementsByTagNameNS(b,w,"p").concat(v.getElementsByTagNameNS(b,w,"h")));b&&!k(b);)b=b.parentNode;b&&c.push(b);return c.filter(function(b){return v.rangeIntersectsNode(a,b)})};this.getTextNodes=function(a,b){var c=a.startContainer.ownerDocument.createRange(),d;d=v.getNodesInRange(a,function(d){c.selectNodeContents(d);if(d.nodeType===Node.TEXT_NODE){if(b&& -v.rangesIntersect(a,c)||v.containsRange(a,c))return Boolean(g(d)&&(!l(d.textContent)||r(d,0)))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}else if(v.rangesIntersect(a,c)&&s(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});c.detach();return d};this.getTextElements=function(a,c){var d=a.startContainer.ownerDocument.createRange(),e;e=v.getNodesInRange(a,function(e){var f=e.nodeType;d.selectNodeContents(e);if(f===Node.TEXT_NODE){if(v.containsRange(a,d)&&(c||Boolean(g(e)&&(!l(e.textContent)|| -r(e,0)))))return NodeFilter.FILTER_ACCEPT}else if(b(e)){if(v.containsRange(a,d))return NodeFilter.FILTER_ACCEPT}else if(s(e)||h(e))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});d.detach();return e};this.getParagraphElements=function(a){var b=a.startContainer.ownerDocument.createRange(),c;c=v.getNodesInRange(a,function(c){b.selectNodeContents(c);if(k(c)){if(v.rangesIntersect(a,b))return NodeFilter.FILTER_ACCEPT}else if(s(c)||h(c))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT}); +odf.OdfUtils=function(){function l(a){var b=a&&a.localName;return("p"===b||"h"===b)&&a.namespaceURI===w}function f(a){for(;a&&!l(a);)a=a.parentNode;return a}function m(a){return/^[ \t\r\n]+$/.test(a)}function g(a){var b=a&&a.localName;return/^(span|p|h|a|meta)$/.test(b)&&a.namespaceURI===w||"span"===b&&"annotationHighlight"===a.className?!0:!1}function b(a){var b=a&&a.localName,c,d=!1;b&&(c=a.namespaceURI,c===w?d="s"===b||"tab"===b||"line-break"===b:c===v&&(d="frame"===b&&"as-char"===a.getAttributeNS(w, +"anchor-type")));return d}function k(a){for(;null!==a.firstChild&&g(a);)a=a.firstChild;return a}function a(a){for(;null!==a.lastChild&&g(a);)a=a.lastChild;return a}function e(b){for(;!l(b)&&null===b.previousSibling;)b=b.parentNode;return l(b)?null:a(b.previousSibling)}function d(a){for(;!l(a)&&null===a.nextSibling;)a=a.parentNode;return l(a)?null:k(a.nextSibling)}function c(a){for(var c=!1;a;)if(a.nodeType===Node.TEXT_NODE)if(0===a.length)a=e(a);else return!m(a.data.substr(a.length-1,1));else b(a)? +(c=!0,a=null):a=e(a);return c}function t(a){var c=!1;for(a=a&&k(a);a;){if(a.nodeType===Node.TEXT_NODE&&0=b.value||"%"===b.unit)?null:b;return b||q(a)};this.parseFoLineHeight=function(a){var b;b=(b=n(a))&&(0>b.value|| +"%"===b.unit)?null:b;return b||q(a)};this.getImpactedParagraphs=function(a){var b=a.commonAncestorContainer,c=[];for(b.nodeType===Node.ELEMENT_NODE&&(c=u.getElementsByTagNameNS(b,w,"p").concat(u.getElementsByTagNameNS(b,w,"h")));b&&!l(b);)b=b.parentNode;b&&c.push(b);return c.filter(function(b){return u.rangeIntersectsNode(a,b)})};this.getTextNodes=function(a,b){var c=a.startContainer.ownerDocument.createRange(),d;d=u.getNodesInRange(a,function(d){c.selectNodeContents(d);if(d.nodeType===Node.TEXT_NODE){if(b&& +u.rangesIntersect(a,c)||u.containsRange(a,c))return Boolean(f(d)&&(!m(d.textContent)||s(d,0)))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}else if(u.rangesIntersect(a,c)&&r(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});c.detach();return d};this.getTextElements=function(a,c){var d=a.startContainer.ownerDocument.createRange(),e;e=u.getNodesInRange(a,function(e){var h=e.nodeType;d.selectNodeContents(e);if(h===Node.TEXT_NODE){if(u.containsRange(a,d)&&(c||Boolean(f(e)&&(!m(e.textContent)|| +s(e,0)))))return NodeFilter.FILTER_ACCEPT}else if(b(e)){if(u.containsRange(a,d))return NodeFilter.FILTER_ACCEPT}else if(r(e)||g(e))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});d.detach();return e};this.getParagraphElements=function(a){var b=a.startContainer.ownerDocument.createRange(),c;c=u.getNodesInRange(a,function(c){b.selectNodeContents(c);if(l(c)){if(u.rangesIntersect(a,b))return NodeFilter.FILTER_ACCEPT}else if(r(c)||g(c))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT}); b.detach();return c}}; // Input 30 /* @@ -564,7 +564,7 @@ b.detach();return c}}; @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.OdfUtils"); -odf.TextSerializer=function(){function k(h){var b="",n=g.filter?g.filter.acceptNode(h):NodeFilter.FILTER_ACCEPT,a=h.nodeType,f;if(n===NodeFilter.FILTER_ACCEPT||n===NodeFilter.FILTER_SKIP)for(f=h.firstChild;f;)b+=k(f),f=f.nextSibling;n===NodeFilter.FILTER_ACCEPT&&(a===Node.ELEMENT_NODE&&l.isParagraph(h)?b+="\n":a===Node.TEXT_NODE&&h.textContent&&(b+=h.textContent));return b}var g=this,l=new odf.OdfUtils;this.filter=null;this.writeToString=function(g){return g?k(g):""}}; +odf.TextSerializer=function(){function l(g){var b="",k=f.filter?f.filter.acceptNode(g):NodeFilter.FILTER_ACCEPT,a=g.nodeType,e;if(k===NodeFilter.FILTER_ACCEPT||k===NodeFilter.FILTER_SKIP)for(e=g.firstChild;e;)b+=l(e),e=e.nextSibling;k===NodeFilter.FILTER_ACCEPT&&(a===Node.ELEMENT_NODE&&m.isParagraph(g)?b+="\n":a===Node.TEXT_NODE&&g.textContent&&(b+=g.textContent));return b}var f=this,m=new odf.OdfUtils;this.filter=null;this.writeToString=function(f){return f?l(f):""}}; // Input 31 /* @@ -601,10 +601,10 @@ odf.TextSerializer=function(){function k(h){var b="",n=g.filter?g.filter.acceptN @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.DomUtils");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.Namespaces"); -odf.TextStyleApplicator=function(k,g,l){function h(a){function b(a,c){return"object"===typeof a&&"object"===typeof c?Object.keys(a).every(function(d){return b(a[d],c[d])}):a===c}this.isStyleApplied=function(d){d=g.getAppliedStylesForElement(d);return b(a,d)}}function b(b){var h={};this.applyStyleToContainer=function(e){var n;n=e.getAttributeNS(a,"style-name");var m=e.ownerDocument;n=n||"";if(!h.hasOwnProperty(n)){var q=n,s=n,w;s?(w=g.getStyleElement(s,"text"),w.parentNode===l?m=w.cloneNode(!0):(m= -m.createElementNS(f,"style:style"),m.setAttributeNS(f,"style:parent-style-name",s),m.setAttributeNS(f,"style:family","text"),m.setAttributeNS(d,"scope","document-content"))):(m=m.createElementNS(f,"style:style"),m.setAttributeNS(f,"style:family","text"),m.setAttributeNS(d,"scope","document-content"));g.updateStyle(m,b,k);l.appendChild(m);h[q]=m}n=h[n].getAttributeNS(f,"name");e.setAttributeNS(a,"text:style-name",n)}}var n=new core.DomUtils,a=odf.Namespaces.textns,f=odf.Namespaces.stylens,d="urn:webodf:names:scope"; -this.applyStyle=function(c,d,e){var f={},g,l,k,w;runtime.assert(e&&e["style:text-properties"],"applyStyle without any text properties");f["style:text-properties"]=e["style:text-properties"];k=new b(f);w=new h(f);c.forEach(function(b){g=w.isStyleApplied(b);if(!1===g){var c=b.ownerDocument,e=b.parentNode,f,h=b,r=new core.LoopWatchDog(1E3);"span"===e.localName&&e.namespaceURI===a?(b.previousSibling&&!n.rangeContainsNode(d,b.previousSibling)?(c=e.cloneNode(!1),e.parentNode.insertBefore(c,e.nextSibling)): -c=e,f=!0):(c=c.createElementNS(a,"text:span"),e.insertBefore(c,b),f=!1);for(;h&&(h===b||n.rangeContainsNode(d,h));)r.check(),e=h.nextSibling,h.parentNode!==c&&c.appendChild(h),h=e;if(h&&f)for(b=c.cloneNode(!1),c.parentNode.insertBefore(b,c.nextSibling);h;)r.check(),e=h.nextSibling,b.appendChild(h),h=e;l=c;k.applyStyleToContainer(l)}})}}; +odf.TextStyleApplicator=function(l,f,m){function g(a){function b(a,c){return"object"===typeof a&&"object"===typeof c?Object.keys(a).every(function(d){return b(a[d],c[d])}):a===c}this.isStyleApplied=function(d){d=f.getAppliedStylesForElement(d);return b(a,d)}}function b(b){var g={};this.applyStyleToContainer=function(h){var k;k=h.getAttributeNS(a,"style-name");var n=h.ownerDocument;k=k||"";if(!g.hasOwnProperty(k)){var q=k,r=k,w;r?(w=f.getStyleElement(r,"text"),w.parentNode===m?n=w.cloneNode(!0):(n= +n.createElementNS(e,"style:style"),n.setAttributeNS(e,"style:parent-style-name",r),n.setAttributeNS(e,"style:family","text"),n.setAttributeNS(d,"scope","document-content"))):(n=n.createElementNS(e,"style:style"),n.setAttributeNS(e,"style:family","text"),n.setAttributeNS(d,"scope","document-content"));f.updateStyle(n,b,l);m.appendChild(n);g[q]=n}k=g[k].getAttributeNS(e,"name");h.setAttributeNS(a,"text:style-name",k)}}var k=new core.DomUtils,a=odf.Namespaces.textns,e=odf.Namespaces.stylens,d="urn:webodf:names:scope"; +this.applyStyle=function(c,d,e){var f={},n,m,l,w;runtime.assert(e&&e["style:text-properties"],"applyStyle without any text properties");f["style:text-properties"]=e["style:text-properties"];l=new b(f);w=new g(f);c.forEach(function(b){n=w.isStyleApplied(b);if(!1===n){var c=b.ownerDocument,e=b.parentNode,f,h=b,g=new core.LoopWatchDog(1E3);"span"===e.localName&&e.namespaceURI===a?(b.previousSibling&&!k.rangeContainsNode(d,b.previousSibling)?(c=e.cloneNode(!1),e.parentNode.insertBefore(c,e.nextSibling)): +c=e,f=!0):(c=c.createElementNS(a,"text:span"),e.insertBefore(c,b),f=!1);for(;h&&(h===b||k.rangeContainsNode(d,h));)g.check(),e=h.nextSibling,h.parentNode!==c&&c.appendChild(h),h=e;if(h&&f)for(b=c.cloneNode(!1),c.parentNode.insertBefore(b,c.nextSibling);h;)g.check(),e=h.nextSibling,b.appendChild(h),h=e;m=c;l.applyStyleToContainer(m)}})}}; // Input 32 /* @@ -641,47 +641,47 @@ c=e,f=!0):(c=c.createElementNS(a,"text:span"),e.insertBefore(c,b),f=!1);for(;h&& @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.Namespaces");runtime.loadClass("odf.OdfUtils");runtime.loadClass("xmldom.XPath");runtime.loadClass("core.CSSUnits"); -odf.Style2CSS=function(){function k(a){var b={},c,d;if(!a)return b;for(a=a.firstChild;a;){if(d=a.namespaceURI!==q||"style"!==a.localName&&"default-style"!==a.localName?a.namespaceURI===w&&"list-style"===a.localName?"list":a.namespaceURI!==q||"page-layout"!==a.localName&&"default-page-layout"!==a.localName?void 0:"page":a.getAttributeNS(q,"family"))(c=a.getAttributeNS&&a.getAttributeNS(q,"name"))||(c=""),d=b[d]=b[d]||{},d[c]=a;a=a.nextSibling}return b}function g(a,b){if(!b||!a)return null;if(a[b])return a[b]; -var c,d;for(c in a)if(a.hasOwnProperty(c)&&(d=g(a[c].derivedStyles,b)))return d;return null}function l(a,b,c){var d=b[a],e,f;d&&(e=d.getAttributeNS(q,"parent-style-name"),f=null,e&&(f=g(c,e),!f&&b[e]&&(l(e,b,c),f=b[e],b[e]=null)),f?(f.derivedStyles||(f.derivedStyles={}),f.derivedStyles[a]=d):c[a]=d)}function h(a,b){for(var c in a)a.hasOwnProperty(c)&&(l(c,a,b),a[c]=null)}function b(a,b){var c=v[a],d;if(null===c)return null;d=b?"["+c+'|style-name="'+b+'"]':"["+c+"|style-name]";"presentation"===c&& -(c="draw",d=b?'[presentation|style-name="'+b+'"]':"[presentation|style-name]");return c+"|"+p[a].join(d+","+c+"|")+d}function n(a,c,d){var e=[],f,g;e.push(b(a,c));for(f in d.derivedStyles)if(d.derivedStyles.hasOwnProperty(f))for(g in c=n(a,f,d.derivedStyles[f]),c)c.hasOwnProperty(g)&&e.push(c[g]);return e}function a(a,b,c){if(!a)return null;for(a=a.firstChild;a;){if(a.namespaceURI===b&&a.localName===c)return b=a;a=a.nextSibling}return null}function f(a,b){var c="",d,e;for(d in b)b.hasOwnProperty(d)&& -(d=b[d],e=a.getAttributeNS(d[0],d[1]),d[2]&&e&&(c+=d[2]+":"+e+";"));return c}function d(b){return(b=a(b,q,"text-properties"))?T.parseFoFontSize(b.getAttributeNS(m,"font-size")):null}function c(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,c,d){return b+b+c+c+d+d});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function t(a,b,c,d){b='text|list[text|style-name="'+b+'"]';var e=c.getAttributeNS(w,"level"), -f;c=T.getFirstNonWhitespaceChild(c);c=T.getFirstNonWhitespaceChild(c);var g;c&&(f=c.attributes,g=f["fo:text-indent"]?f["fo:text-indent"].value:void 0,f=f["fo:margin-left"]?f["fo:margin-left"].value:void 0);g||(g="-0.6cm");c="-"===g.charAt(0)?g.substring(1):"-"+g;for(e=e&&parseInt(e,10);1 text|list-item > text|list",e-=1;e=b+" > text|list-item > *:not(text|list):first-child";void 0!==f&&(f=e+"{margin-left:"+f+";}",a.insertRule(f,a.cssRules.length));d=b+" > text|list-item > *:not(text|list):first-child:before{"+ -d+";";d+="counter-increment:list;";d+="margin-left:"+g+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(h){throw h;}}function e(b,g,h,l){if("list"===g)for(var k=l.firstChild,p,s;k;){if(k.namespaceURI===w)if(p=k,"list-level-style-number"===k.localName){var v=p;s=v.getAttributeNS(q,"num-format");var E=v.getAttributeNS(q,"num-suffix"),G={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},v=v.getAttributeNS(q,"num-prefix")||"",v=G.hasOwnProperty(s)? -v+(" counter(list, "+G[s]+")"):s?v+("'"+s+"';"):v+" ''";E&&(v+=" '"+E+"'");s="content: "+v+";";t(b,h,p,s)}else"list-level-style-image"===k.localName?(s="content: none;",t(b,h,p,s)):"list-level-style-bullet"===k.localName&&(s="content: '"+p.getAttributeNS(w,"bullet-char")+"';",t(b,h,p,s));k=k.nextSibling}else if("page"===g)if(E=p=h="",k=l.getElementsByTagNameNS(q,"page-layout-properties")[0],p=k.parentNode.parentNode.parentNode.masterStyles,E="",h+=f(k,J),s=k.getElementsByTagNameNS(q,"background-image"), -0 text|list-item > text|list",e-=1;e=b+" > text|list-item > *:not(text|list):first-child";void 0!==f&&(f=e+"{margin-left:"+f+";}",a.insertRule(f,a.cssRules.length));d=b+" > text|list-item > *:not(text|list):first-child:before{"+ +d+";";d+="counter-increment:list;";d+="margin-left:"+h+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(g){throw g;}}function h(b,f,g,m){if("list"===f)for(var l=m.firstChild,p,r;l;){if(l.namespaceURI===w)if(p=l,"list-level-style-number"===l.localName){var u=p;r=u.getAttributeNS(q,"num-format");var E=u.getAttributeNS(q,"num-suffix"),G={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},u=u.getAttributeNS(q,"num-prefix")||"",u=G.hasOwnProperty(r)? +u+(" counter(list, "+G[r]+")"):r?u+("'"+r+"';"):u+" ''";E&&(u+=" '"+E+"'");r="content: "+u+";";t(b,g,p,r)}else"list-level-style-image"===l.localName?(r="content: none;",t(b,g,p,r)):"list-level-style-bullet"===l.localName&&(r="content: '"+p.getAttributeNS(w,"bullet-char")+"';",t(b,g,p,r));l=l.nextSibling}else if("page"===f)if(E=p=g="",l=m.getElementsByTagNameNS(q,"page-layout-properties")[0],p=l.parentNode.parentNode.parentNode.masterStyles,E="",g+=e(l,J),r=l.getElementsByTagNameNS(q,"background-image"), +0c)break;e=e.nextSibling}a.insertBefore(b,e)}}}function n(a){this.OdfContainer=a}function a(a, -b,c,d){var e=this;this.size=0;this.type=null;this.name=a;this.container=c;this.onchange=this.onreadystatechange=this.document=this.mimetype=this.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){null!==d&&(this.mimetype=b,d.loadAsDataURL(a,b,function(a,b){a&&runtime.log(a);e.url=b;if(e.onchange)e.onchange(e);if(e.onstatereadychange)e.onstatereadychange(e)}))}}var f=new odf.StyleInfo,d="urn:oasis:names:tc:opendocument:xmlns:office:1.0",c="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", -t="urn:webodf:names:scope",e="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),r=(new Date).getTime()+"_webodf_",m=new core.Base64;n.prototype=new function(){};n.prototype.constructor=n;n.namespaceURI=d;n.localName="document";a.prototype.load=function(){};a.prototype.getUrl=function(){return this.data?"data:;base64,"+m.toBase64(this.data):null};odf.OdfContainer=function s(e,g){function m(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,b.nodeType===Node.ELEMENT_NODE? -m(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b),b=c}function v(a,b){for(var c=a&&a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&c.setAttributeNS(t,"scope",b),c=c.nextSibling}function p(a,b){var c=null,d,e,f;if(a)for(c=a.cloneNode(!0),d=c.firstChild;d;)e=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(f=d.getAttributeNS(t,"scope"))&&f!==b&&c.removeChild(d),d=e;return c}function y(a){var b=M.rootElement.ownerDocument,c;if(a){m(a.documentElement);try{c=b.importNode(a.documentElement, -!0)}catch(d){}}return c}function D(a){M.state=a;if(M.onchange)M.onchange(M);if(M.onstatereadychange)M.onstatereadychange(M)}function H(a){Y=null;M.rootElement=a;a.fontFaceDecls=k(a,d,"font-face-decls");a.styles=k(a,d,"styles");a.automaticStyles=k(a,d,"automatic-styles");a.masterStyles=k(a,d,"master-styles");a.body=k(a,d,"body");a.meta=k(a,d,"meta")}function A(a){a=y(a);var c=M.rootElement;a&&"document-styles"===a.localName&&a.namespaceURI===d?(c.fontFaceDecls=k(a,d,"font-face-decls"),b(c,c.fontFaceDecls), -c.styles=k(a,d,"styles"),b(c,c.styles),c.automaticStyles=k(a,d,"automatic-styles"),v(c.automaticStyles,"document-styles"),b(c,c.automaticStyles),c.masterStyles=k(a,d,"master-styles"),b(c,c.masterStyles),f.prefixStyleNames(c.automaticStyles,r,c.masterStyles)):D(s.INVALID)}function N(a){a=y(a);var c,e,f;if(a&&"document-content"===a.localName&&a.namespaceURI===d){c=M.rootElement;e=k(a,d,"font-face-decls");if(c.fontFaceDecls&&e)for(f=e.firstChild;f;)c.fontFaceDecls.appendChild(f),f=e.firstChild;else e&& -(c.fontFaceDecls=e,b(c,e));e=k(a,d,"automatic-styles");v(e,"document-content");if(c.automaticStyles&&e)for(f=e.firstChild;f;)c.automaticStyles.appendChild(f),f=e.firstChild;else e&&(c.automaticStyles=e,b(c,e));c.body=k(a,d,"body");b(c,c.body)}else D(s.INVALID)}function C(a){a=y(a);var c;a&&("document-meta"===a.localName&&a.namespaceURI===d)&&(c=M.rootElement,c.meta=k(a,d,"meta"),b(c,c.meta))}function P(a){a=y(a);var c;a&&("document-settings"===a.localName&&a.namespaceURI===d)&&(c=M.rootElement,c.settings= -k(a,d,"settings"),b(c,c.settings))}function B(a){a=y(a);var b;if(a&&"manifest"===a.localName&&a.namespaceURI===c)for(b=M.rootElement,b.manifest=a,a=b.manifest.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&("file-entry"===a.localName&&a.namespaceURI===c)&&(K[a.getAttributeNS(c,"full-path")]=a.getAttributeNS(c,"media-type")),a=a.nextSibling}function J(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],L.loadAsDOM(c,function(b,c){d(c);b||M.state===s.INVALID||J(a)})):D(s.DONE)}function U(a){var b="";odf.Namespaces.forEachPrefix(function(a, +odf.OdfContainer=function(){function l(a,b,c){for(a=a?a.firstChild:null;a;){if(a.localName===c&&a.namespaceURI===b)return a;a=a.nextSibling}return null}function f(a){var b,c=h.length;for(b=0;bc)break;e=e.nextSibling}a.insertBefore(b,e)}}}function k(a){this.OdfContainer=a}function a(a, +b,c,d){var e=this;this.size=0;this.type=null;this.name=a;this.container=c;this.onchange=this.onreadystatechange=this.document=this.mimetype=this.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){null!==d&&(this.mimetype=b,d.loadAsDataURL(a,b,function(a,b){a&&runtime.log(a);e.url=b;if(e.onchange)e.onchange(e);if(e.onstatereadychange)e.onstatereadychange(e)}))}}var e=new odf.StyleInfo,d="urn:oasis:names:tc:opendocument:xmlns:office:1.0",c="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", +t="urn:webodf:names:scope",h="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),s=(new Date).getTime()+"_webodf_",n=new core.Base64;k.prototype=new function(){};k.prototype.constructor=k;k.namespaceURI=d;k.localName="document";a.prototype.load=function(){};a.prototype.getUrl=function(){return this.data?"data:;base64,"+n.toBase64(this.data):null};odf.OdfContainer=function r(f,h){function n(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,b.nodeType===Node.ELEMENT_NODE? +n(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b),b=c}function u(a,b){for(var c=a&&a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&c.setAttributeNS(t,"scope",b),c=c.nextSibling}function p(a,b){var c=null,d,e,f;if(a)for(c=a.cloneNode(!0),d=c.firstChild;d;)e=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(f=d.getAttributeNS(t,"scope"))&&f!==b&&c.removeChild(d),d=e;return c}function y(a){var b=M.rootElement.ownerDocument,c;if(a){n(a.documentElement);try{c=b.importNode(a.documentElement, +!0)}catch(d){}}return c}function D(a){M.state=a;if(M.onchange)M.onchange(M);if(M.onstatereadychange)M.onstatereadychange(M)}function H(a){Y=null;M.rootElement=a;a.fontFaceDecls=l(a,d,"font-face-decls");a.styles=l(a,d,"styles");a.automaticStyles=l(a,d,"automatic-styles");a.masterStyles=l(a,d,"master-styles");a.body=l(a,d,"body");a.meta=l(a,d,"meta")}function A(a){a=y(a);var c=M.rootElement;a&&"document-styles"===a.localName&&a.namespaceURI===d?(c.fontFaceDecls=l(a,d,"font-face-decls"),b(c,c.fontFaceDecls), +c.styles=l(a,d,"styles"),b(c,c.styles),c.automaticStyles=l(a,d,"automatic-styles"),u(c.automaticStyles,"document-styles"),b(c,c.automaticStyles),c.masterStyles=l(a,d,"master-styles"),b(c,c.masterStyles),e.prefixStyleNames(c.automaticStyles,s,c.masterStyles)):D(r.INVALID)}function N(a){a=y(a);var c,e,f;if(a&&"document-content"===a.localName&&a.namespaceURI===d){c=M.rootElement;e=l(a,d,"font-face-decls");if(c.fontFaceDecls&&e)for(f=e.firstChild;f;)c.fontFaceDecls.appendChild(f),f=e.firstChild;else e&& +(c.fontFaceDecls=e,b(c,e));e=l(a,d,"automatic-styles");u(e,"document-content");if(c.automaticStyles&&e)for(f=e.firstChild;f;)c.automaticStyles.appendChild(f),f=e.firstChild;else e&&(c.automaticStyles=e,b(c,e));c.body=l(a,d,"body");b(c,c.body)}else D(r.INVALID)}function C(a){a=y(a);var c;a&&("document-meta"===a.localName&&a.namespaceURI===d)&&(c=M.rootElement,c.meta=l(a,d,"meta"),b(c,c.meta))}function P(a){a=y(a);var c;a&&("document-settings"===a.localName&&a.namespaceURI===d)&&(c=M.rootElement,c.settings= +l(a,d,"settings"),b(c,c.settings))}function B(a){a=y(a);var b;if(a&&"manifest"===a.localName&&a.namespaceURI===c)for(b=M.rootElement,b.manifest=a,a=b.manifest.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&("file-entry"===a.localName&&a.namespaceURI===c)&&(K[a.getAttributeNS(c,"full-path")]=a.getAttributeNS(c,"media-type")),a=a.nextSibling}function J(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],L.loadAsDOM(c,function(b,c){d(c);b||M.state===r.INVALID||J(a)})):D(r.DONE)}function U(a){var b="";odf.Namespaces.forEachPrefix(function(a, c){b+=" xmlns:"+a+'="'+c+'"'});return''}function da(){var a=new xmldom.LSSerializer,b=U("document-meta");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(M.rootElement.meta,odf.Namespaces.namespaceMap);return b+""}function T(a,b){var d=document.createElementNS(c,"manifest:file-entry");d.setAttributeNS(c,"manifest:full-path",a);d.setAttributeNS(c,"manifest:media-type",b);return d}function ka(){var a= -runtime.parseXML(''),b=k(a,c,"manifest"),d=new xmldom.LSSerializer,e;for(e in K)K.hasOwnProperty(e)&&b.appendChild(T(e,K[e]));d.filter=new odf.OdfNodeFilter;return'\n'+d.writeToString(a,odf.Namespaces.namespaceMap)}function ca(){var a=new xmldom.LSSerializer,b=U("document-settings");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(M.rootElement.settings,odf.Namespaces.namespaceMap); -return b+""}function W(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=p(M.rootElement.automaticStyles,"document-styles"),d=M.rootElement.masterStyles&&M.rootElement.masterStyles.cloneNode(!0),e=U("document-styles");f.removePrefixFromStyleNames(c,r,d);b.filter=new l(d,c);e+=b.writeToString(M.rootElement.fontFaceDecls,a);e+=b.writeToString(M.rootElement.styles,a);e+=b.writeToString(c,a);e+=b.writeToString(d,a);return e+""}function O(){var a= -odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=p(M.rootElement.automaticStyles,"document-content"),d=U("document-content");b.filter=new h(M.rootElement.body,c);d+=b.writeToString(c,a);d+=b.writeToString(M.rootElement.body,a);return d+""}function ba(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var e=y(c);e&&"document"===e.localName&&e.namespaceURI===d?(H(e),D(s.DONE)):D(s.INVALID)}})}function S(){function a(b,c){var f;c||(c=b);f=document.createElementNS(d, -c);e[b]=f;e.appendChild(f)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),e=M.rootElement,f=document.createElementNS(d,"text");b.save("mimetype",c,!1,new Date);a("meta");a("settings");a("scripts");a("fontFaceDecls","font-face-decls");a("styles");a("automaticStyles","automatic-styles");a("masterStyles","master-styles");a("body");e.body.appendChild(f);D(s.DONE);return b}function Q(){var a,b=new Date;a=runtime.byteArrayFromString(ca(),"utf8"); -L.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(da(),"utf8");L.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(W(),"utf8");L.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(O(),"utf8");L.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(ka(),"utf8");L.save("META-INF/manifest.xml",a,!0,b)}function F(a,b){Q();L.writeAs(a,function(a){b(a)})}var M=this,L,K={},Y;this.onstatereadychange=g;this.rootElement=this.state=this.onchange=null;this.setRootElement=H;this.getContentElement= -function(){var a;Y||(a=M.rootElement.body,Y=a.getElementsByTagNameNS(d,"text")[0]||a.getElementsByTagNameNS(d,"presentation")[0]||a.getElementsByTagNameNS(d,"spreadsheet")[0]);return Y};this.getDocumentType=function(){var a=M.getContentElement();return a&&a.localName};this.getPart=function(b){return new a(b,K[b],M,L)};this.getPartData=function(a,b){L.load(a,b)};this.createByteArray=function(a,b){Q();L.createByteArray(a,b)};this.saveAs=F;this.save=function(a){F(e,a)};this.getUrl=function(){return e}; -this.state=s.LOADING;this.rootElement=function(a){var b=document.createElementNS(a.namespaceURI,a.localName),c;a=new a;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}(n);L=e?new core.Zip(e,function(a,b){L=b;a?ba(e,function(b){a&&(L.error=a+"\n"+b,D(s.INVALID))}):J([["styles.xml",A],["content.xml",N],["meta.xml",C],["settings.xml",P],["META-INF/manifest.xml",B]])}):S()};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING= +runtime.parseXML(''),b=l(a,c,"manifest"),d=new xmldom.LSSerializer,e;for(e in K)K.hasOwnProperty(e)&&b.appendChild(T(e,K[e]));d.filter=new odf.OdfNodeFilter;return'\n'+d.writeToString(a,odf.Namespaces.namespaceMap)}function ca(){var a=new xmldom.LSSerializer,b=U("document-settings");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(M.rootElement.settings,odf.Namespaces.namespaceMap); +return b+""}function W(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=p(M.rootElement.automaticStyles,"document-styles"),d=M.rootElement.masterStyles&&M.rootElement.masterStyles.cloneNode(!0),f=U("document-styles");e.removePrefixFromStyleNames(c,s,d);b.filter=new m(d,c);f+=b.writeToString(M.rootElement.fontFaceDecls,a);f+=b.writeToString(M.rootElement.styles,a);f+=b.writeToString(c,a);f+=b.writeToString(d,a);return f+""}function O(){var a= +odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=p(M.rootElement.automaticStyles,"document-content"),d=U("document-content");b.filter=new g(M.rootElement.body,c);d+=b.writeToString(c,a);d+=b.writeToString(M.rootElement.body,a);return d+""}function ba(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var e=y(c);e&&"document"===e.localName&&e.namespaceURI===d?(H(e),D(r.DONE)):D(r.INVALID)}})}function S(){function a(b,c){var f;c||(c=b);f=document.createElementNS(d, +c);e[b]=f;e.appendChild(f)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),e=M.rootElement,f=document.createElementNS(d,"text");b.save("mimetype",c,!1,new Date);a("meta");a("settings");a("scripts");a("fontFaceDecls","font-face-decls");a("styles");a("automaticStyles","automatic-styles");a("masterStyles","master-styles");a("body");e.body.appendChild(f);D(r.DONE);return b}function Q(){var a,b=new Date;a=runtime.byteArrayFromString(ca(),"utf8"); +L.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(da(),"utf8");L.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(W(),"utf8");L.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(O(),"utf8");L.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(ka(),"utf8");L.save("META-INF/manifest.xml",a,!0,b)}function F(a,b){Q();L.writeAs(a,function(a){b(a)})}var M=this,L,K={},Y;this.onstatereadychange=h;this.rootElement=this.state=this.onchange=null;this.setRootElement=H;this.getContentElement= +function(){var a;Y||(a=M.rootElement.body,Y=a.getElementsByTagNameNS(d,"text")[0]||a.getElementsByTagNameNS(d,"presentation")[0]||a.getElementsByTagNameNS(d,"spreadsheet")[0]);return Y};this.getDocumentType=function(){var a=M.getContentElement();return a&&a.localName};this.getPart=function(b){return new a(b,K[b],M,L)};this.getPartData=function(a,b){L.load(a,b)};this.createByteArray=function(a,b){Q();L.createByteArray(a,b)};this.saveAs=F;this.save=function(a){F(f,a)};this.getUrl=function(){return f}; +this.state=r.LOADING;this.rootElement=function(a){var b=document.createElementNS(a.namespaceURI,a.localName),c;a=new a;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}(k);L=f?new core.Zip(f,function(a,b){L=b;a?ba(f,function(b){a&&(L.error=a+"\n"+b,D(r.INVALID))}):J([["styles.xml",A],["content.xml",N],["meta.xml",C],["settings.xml",P],["META-INF/manifest.xml",B]])}):S()};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING= 4;odf.OdfContainer.MODIFIED=5;odf.OdfContainer.getContainer=function(a){return new odf.OdfContainer(a,null)};return odf.OdfContainer}(); // Input 34 /* @@ -719,9 +719,9 @@ this.state=s.LOADING;this.rootElement=function(a){var b=document.createElementNS @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.Base64");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.OdfContainer"); -odf.FontLoader=function(){function k(g,b,n,a,f){var d,c=0,t;for(t in g)if(g.hasOwnProperty(t)){if(c===n){d=t;break}c+=1}d?b.getPartData(g[d].href,function(c,r){if(c)runtime.log(c);else{var m="@font-face { font-family: '"+(g[d].family||d)+"'; src: url(data:application/x-font-ttf;charset=binary;base64,"+l.convertUTF8ArrayToBase64(r)+') format("truetype"); }';try{a.insertRule(m,a.cssRules.length)}catch(q){runtime.log("Problem inserting rule in CSS: "+runtime.toJson(q)+"\nRule: "+m)}}k(g,b,n+1,a,f)}): -f&&f()}var g=new xmldom.XPath,l=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(h,b){for(var n=h.rootElement.fontFaceDecls;b.cssRules.length;)b.deleteRule(b.cssRules.length-1);if(n){var a={},f,d,c,l;if(n)for(n=g.getODFElementsWithXPath(n,"style:font-face[svg:font-face-src]",odf.Namespaces.resolvePrefix),f=0;f text|list-item > *:first-child:before {";if(ja=x.getAttributeNS(y,"style-name")){x=q[ja];B=P.getFirstNonWhitespaceChild(x);x=void 0;if("list-level-style-number"===B.localName){x=B.getAttributeNS(z,"num-format");ja=B.getAttributeNS(z, -"num-suffix");var F="",F={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},E=void 0,E=B.getAttributeNS(z,"num-prefix")||"",E=F.hasOwnProperty(x)?E+(" counter(list, "+F[x]+")"):x?E+("'"+x+"';"):E+" ''";ja&&(E+=" '"+ja+"'");x=F="content: "+E+";"}else"list-level-style-image"===B.localName?x="content: none;":"list-level-style-bullet"===B.localName&&(x="content: '"+B.getAttributeNS(y,"bullet-char")+"';");B=x}if(fa){for(x=k[fa];x;)fa=x,x=k[fa];aa+="counter-increment:"+fa+";"; -B?(B=B.replace("list",fa),aa+=B):aa+="content:counter("+fa+");"}else fa="",B?(B=B.replace("list",A),aa+=B):aa+="content: counter("+A+");",aa+="counter-increment:"+A+";",h.insertRule("text|list#"+A+" {counter-reset:"+A+"}",h.cssRules.length);aa+="}";k[A]=fa;aa&&h.insertRule(aa,h.cssRules.length)}m.insertBefore(J,m.firstChild);v();D(g);if(!d&&(g=[K],Z.hasOwnProperty("statereadychange")))for(h=Z.statereadychange,m=0;m text|list-item > *:first-child:before {";if(ja=x.getAttributeNS(y,"style-name")){x=q[ja];B=P.getFirstNonWhitespaceChild(x);x=void 0;if("list-level-style-number"===B.localName){x=B.getAttributeNS(z,"num-format");ja=B.getAttributeNS(z, +"num-suffix");var F="",F={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},E=void 0,E=B.getAttributeNS(z,"num-prefix")||"",E=F.hasOwnProperty(x)?E+(" counter(list, "+F[x]+")"):x?E+("'"+x+"';"):E+" ''";ja&&(E+=" '"+ja+"'");x=F="content: "+E+";"}else"list-level-style-image"===B.localName?x="content: none;":"list-level-style-bullet"===B.localName&&(x="content: '"+B.getAttributeNS(y,"bullet-char")+"';");B=x}if(fa){for(x=l[fa];x;)fa=x,x=l[fa];aa+="counter-increment:"+fa+";"; +B?(B=B.replace("list",fa),aa+=B):aa+="content:counter("+fa+");"}else fa="",B?(B=B.replace("list",A),aa+=B):aa+="content: counter("+A+");",aa+="counter-increment:"+A+";",g.insertRule("text|list#"+A+" {counter-reset:"+A+"}",g.cssRules.length);aa+="}";l[A]=fa;aa&&g.insertRule(aa,g.cssRules.length)}n.insertBefore(J,n.firstChild);u();D(f);if(!d&&(f=[K],Z.hasOwnProperty("statereadychange")))for(g=Z.statereadychange,n=0;nl?(runtime.log("connection to server timed out."),h("timeout")):(n+=100,runtime.getWindow().setTimeout(b,100)):(runtime.log("connection to collaboration server established."),h("ready"))}var n= -0;g||(g=runtime.getVariable("now"),void 0===g&&(g={networkStatus:"unavailable"}),b())};this.networkStatus=function(){return g?g.networkStatus:"unavailable"};this.login=function(l,h,b,n){g?g.login(l,h,b,n):n("Not connected to server")};this.createOperationRouter=function(g,h){return new ops.NowjsOperationRouter(g,h,k)};this.createUserModel=function(){return new ops.NowjsUserModel(k)}}; +ops.NowjsServer=function(){var l=this,f;this.getNowObject=function(){return f};this.getGenesisUrl=function(f){return"/session/"+f+"/genesis"};this.connect=function(m,g){function b(){"unavailable"===f.networkStatus?(runtime.log("connection to server unavailable."),g("unavailable")):"ready"!==f.networkStatus?k>m?(runtime.log("connection to server timed out."),g("timeout")):(k+=100,runtime.getWindow().setTimeout(b,100)):(runtime.log("connection to collaboration server established."),g("ready"))}var k= +0;f||(f=runtime.getVariable("now"),void 0===f&&(f={networkStatus:"unavailable"}),b())};this.networkStatus=function(){return f?f.networkStatus:"unavailable"};this.login=function(m,g,b,k){f?f.login(m,g,b,k):k("Not connected to server")};this.createOperationRouter=function(f,g){return new ops.NowjsOperationRouter(f,g,l)};this.createUserModel=function(){return new ops.NowjsUserModel(l)}}; // Input 40 /* @@ -944,9 +944,9 @@ ops.NowjsServer=function(){var k=this,g;this.getNowObject=function(){return g};t @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.Base64");runtime.loadClass("core.ByteArrayWriter"); -ops.PullBoxServer=function(k){function g(b,a){var f=new XMLHttpRequest,d=new core.ByteArrayWriter("utf8");"object"===typeof b&&(b=JSON.stringify(b));runtime.log("Sending message to server: "+b);d.appendString(b);d=d.getByteArray();f.open("POST",k.url,!0);f.onreadystatechange=function(){4===f.readyState&&((200>f.status||300<=f.status)&&0===f.status&&runtime.log("Status "+String(f.status)+": "+f.responseText||f.statusText),a(f.responseText))};d=d.buffer&&!f.sendAsBinary?d.buffer:runtime.byteArrayToString(d, -"binary");try{f.sendAsBinary?f.sendAsBinary(d):f.send(d)}catch(c){runtime.log("Problem with calling server: "+c+" "+d),a(c.message)}}var l=this,h,b=new core.Base64;k=k||{};k.url=k.url||"/WSER";this.getGenesisUrl=function(b){return"/session/"+b+"/genesis"};this.call=g;this.getBase64=function(){return b};this.getToken=function(){return h};this.setToken=function(b){h=b};this.connect=function(b,a){a("ready")};this.networkStatus=function(){return"ready"};this.login=function(n,a,f,d){g("login:"+b.toBase64(n)+ -":"+b.toBase64(a),function(a){var b=runtime.fromJson(a);runtime.log("Login reply: "+a);b.hasOwnProperty("token")?(h=b.token,runtime.log("Caching token: "+l.getToken()),f(b)):d(a)})}}; +ops.PullBoxServer=function(l){function f(b,a){var e=new XMLHttpRequest,d=new core.ByteArrayWriter("utf8"),c=JSON.stringify(b);runtime.log("Sending message to server: "+c);d.appendString(c);d=d.getByteArray();e.open("POST",l.url,!0);e.onreadystatechange=function(){4===e.readyState&&((200>e.status||300<=e.status)&&0===e.status&&runtime.log("Status "+String(e.status)+": "+e.responseText||e.statusText),a(e.responseText))};d=d.buffer&&!e.sendAsBinary?d.buffer:runtime.byteArrayToString(d,"binary");try{e.sendAsBinary? +e.sendAsBinary(d):e.send(d)}catch(f){runtime.log("Problem with calling server: "+f+" "+d),a(f.message)}}var m=this,g,b=new core.Base64;l=l||{};l.url=l.url||"/WSER";this.getGenesisUrl=function(b){return"/session/"+b+"/genesis"};this.call=f;this.getToken=function(){return g};this.setToken=function(b){g=b};this.connect=function(b,a){a("ready")};this.networkStatus=function(){return"ready"};this.login=function(k,a,e,d){f({command:"login",args:{login:b.toBase64(k),password:b.toBase64(a)}},function(a){var b= +runtime.fromJson(a);runtime.log("Login reply: "+a);b.hasOwnProperty("token")?(g=b.token,runtime.log("Caching token: "+m.getToken()),e(b)):d(a)})}}; // Input 41 /* @@ -982,7 +982,7 @@ ops.PullBoxServer=function(k){function g(b,a){var f=new XMLHttpRequest,d=new cor @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.Operation=function(){};ops.Operation.prototype.init=function(k){};ops.Operation.prototype.transform=function(k,g){};ops.Operation.prototype.execute=function(k){};ops.Operation.prototype.spec=function(){}; +ops.Operation=function(){};ops.Operation.prototype.init=function(l){};ops.Operation.prototype.transform=function(l,f){};ops.Operation.prototype.execute=function(l){};ops.Operation.prototype.spec=function(){}; // Input 42 /* @@ -1018,7 +1018,7 @@ ops.Operation=function(){};ops.Operation.prototype.init=function(k){};ops.Operat @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.OpAddCursor=function(){var k=this,g,l;this.init=function(h){g=h.memberid;l=h.timestamp};this.transform=function(g,b){return[k]};this.execute=function(h){var b=h.getCursor(g);if(b)return!1;b=new ops.OdtCursor(g,h);h.addCursor(b);h.emit(ops.OdtDocument.signalCursorAdded,b);return!0};this.spec=function(){return{optype:"AddCursor",memberid:g,timestamp:l}}}; +ops.OpAddCursor=function(){var l=this,f,m;this.init=function(g){f=g.memberid;m=g.timestamp};this.transform=function(f,b){return[l]};this.execute=function(g){var b=g.getCursor(f);if(b)return!1;b=new ops.OdtCursor(f,g);g.addCursor(b);g.emit(ops.OdtDocument.signalCursorAdded,b);return!0};this.spec=function(){return{optype:"AddCursor",memberid:f,timestamp:m}}}; // Input 43 /* @@ -1055,8 +1055,8 @@ ops.OpAddCursor=function(){var k=this,g,l;this.init=function(h){g=h.memberid;l=h @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.DomUtils");runtime.loadClass("odf.OdfUtils"); -gui.StyleHelper=function(k){function g(b,g,a){var f=!0,d;b.collapsed?(d=b.startContainer,d.hasChildNodes()&&b.startOffseth&&f.positionh&&f.positionc?-f.countBackwardSteps(-c,d):0;a.move(c);b&&(d=0b?-f.countBackwardSteps(-b, -d):0,a.move(d,!0));n.emit(ops.OdtDocument.signalCursorMoved,a);return!0};this.spec=function(){return{optype:"MoveCursor",memberid:g,timestamp:l,position:h,length:b}}}; +ops.OpMoveCursor=function(){var l=this,f,m,g,b;this.init=function(k){f=k.memberid;m=k.timestamp;g=parseInt(k.position,10);b=void 0!==k.length?parseInt(k.length,10):0};this.merge=function(k){return"MoveCursor"===k.optype&&k.memberid===f?(g=k.position,b=k.length,m=k.timestamp,!0):!1};this.transform=function(k,a){var e=k.spec(),d=e.optype,c=g+b,m=[l];"RemoveText"===d?(d=e.position+e.length,d<=g?g-=e.length:e.positiong&&e.positiong&&e.positionc?-e.countBackwardSteps(-c,d):0;a.move(c);b&&(d=0b?-e.countBackwardSteps(-b, +d):0,a.move(d,!0));k.emit(ops.OdtDocument.signalCursorMoved,a);return!0};this.spec=function(){return{optype:"MoveCursor",memberid:f,timestamp:m,position:g,length:b}}}; // Input 47 -ops.OpInsertTable=function(){function k(a,c){var d;if(1===t.length)d=t[0];else if(3===t.length)switch(a){case 0:d=t[0];break;case b-1:d=t[2];break;default:d=t[1]}else d=t[a];if(1===d.length)return d[0];if(3===d.length)switch(c){case 0:return d[0];case n-1:return d[2];default:return d[1]}return d[c]}var g=this,l,h,b,n,a,f,d,c,t;this.init=function(e){l=e.memberid;h=e.timestamp;a=parseInt(e.position,10);b=parseInt(e.initialRows,10);n=parseInt(e.initialColumns,10);f=e.tableName;d=e.tableStyleName;c=e.tableColumnStyleName; -t=e.tableCellStyleMatrix};this.transform=function(b,c){var d=b.spec(),f=d.optype,h=[g];if("InsertTable"===f)h=null;else if("SplitParagraph"===f)if(d.position=a.textNode.length?null:a.textNode.splitText(a.offset));for(a=a.textNode;a!==d;)if(a=a.parentNode,c=a.cloneNode(!1),e){for(k&&c.appendChild(k);e.nextSibling;)c.appendChild(e.nextSibling); -a.parentNode.insertBefore(c,a.nextSibling);e=a;k=c}else a.parentNode.insertBefore(c,a),e=c,k=a;b.isListItem(k)&&(k=k.childNodes[0]);n.fixCursorPositions(g);n.getOdfCanvas().refreshSize();n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:f,memberId:g,timeStamp:l});n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:k,memberId:g,timeStamp:l});n.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:g,timestamp:l,position:h}}}; +ops.OpSplitParagraph=function(){var l=this,f,m,g,b=new odf.OdfUtils;this.init=function(b){f=b.memberid;m=b.timestamp;g=parseInt(b.position,10)};this.transform=function(b,a){var e=b.spec(),d=e.optype,c=[l];if("SplitParagraph"===d)if(e.position=a.textNode.length?null:a.textNode.splitText(a.offset));for(a=a.textNode;a!==d;)if(a=a.parentNode,c=a.cloneNode(!1),h){for(l&&c.appendChild(l);h.nextSibling;)c.appendChild(h.nextSibling); +a.parentNode.insertBefore(c,a.nextSibling);h=a;l=c}else a.parentNode.insertBefore(c,a),h=c,l=a;b.isListItem(l)&&(l=l.childNodes[0]);k.fixCursorPositions(f);k.getOdfCanvas().refreshSize();k.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:e,memberId:f,timeStamp:m});k.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:l,memberId:f,timeStamp:m});k.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:f,timestamp:m,position:g}}}; // Input 51 /* @@ -1329,8 +1329,8 @@ a.parentNode.insertBefore(c,a.nextSibling);e=a;k=c}else a.parentNode.insertBefor @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.OpSetParagraphStyle=function(){var k=this,g,l,h,b;this.init=function(n){g=n.memberid;l=n.timestamp;h=n.position;b=n.styleName};this.transform=function(g,a){var f=g.spec();"DeleteParagraphStyle"===f.optype&&f.styleName===b&&(b="");return[k]};this.execute=function(n){var a;if(a=n.getPositionInTextNode(h))if(a=n.getParagraphElement(a.textNode))return""!==b?a.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",b):a.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0", -"style-name"),n.getOdfCanvas().refreshSize(),n.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,timeStamp:l,memberId:g}),n.getOdfCanvas().rerenderAnnotations(),!0;return!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:g,timestamp:l,position:h,styleName:b}}}; +ops.OpSetParagraphStyle=function(){var l=this,f,m,g,b;this.init=function(k){f=k.memberid;m=k.timestamp;g=k.position;b=k.styleName};this.transform=function(f,a){var e=f.spec();"DeleteParagraphStyle"===e.optype&&e.styleName===b&&(b="");return[l]};this.execute=function(k){var a;if(a=k.getPositionInTextNode(g))if(a=k.getParagraphElement(a.textNode))return""!==b?a.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",b):a.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0", +"style-name"),k.getOdfCanvas().refreshSize(),k.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,timeStamp:m,memberId:f}),k.getOdfCanvas().rerenderAnnotations(),!0;return!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:f,timestamp:m,position:g,styleName:b}}}; // Input 52 /* @@ -1366,12 +1366,12 @@ ops.OpSetParagraphStyle=function(){var k=this,g,l,h,b;this.init=function(n){g=n. @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.OpUpdateParagraphStyle=function(){function k(a,b){var d,f;for(d=0;da?-1:1;for(a=Math.abs(a);0n?k.previousPosition():k.nextPosition());)if(F.check(),m.acceptPosition(k)===v&&(q+=1,s=k.container(),z=h(s,k.unfilteredDomOffset(),Q),z.top!==O)){if(z.top!==S&&S!==O)break;S=z.top;z=Math.abs(ba-z.left);if(null===r||za?(c=m.previousPosition,d=-1):(c=m.nextPosition,d=1);for(e=h(m.container(),m.unfilteredDomOffset(),q);c.call(m);)if(b.acceptPosition(m)===v){if(s.getParagraphElement(m.getCurrentNode())!==n)break;f=h(m.container(),m.unfilteredDomOffset(),q);if(f.bottom!==e.bottom&&(e=f.top>=e.top&&f.bottome.bottom,!e))break;k+=d;e=f}q.detach();return k}function m(a,b){for(var c=0,d;a.parentNode!==b;)runtime.assert(null!==a.parentNode,"parent is null"),a=a.parentNode;for(d=b.firstChild;d!== -a;)c+=1,d=d.nextSibling;return c}function q(a,b,c){runtime.assert(null!==a,"SelectionMover.countStepsToPosition called with element===null");var d=l(),e=d.container(),f=d.unfilteredDomOffset(),g=0,h=new core.LoopWatchDog(1E3);d.setUnfilteredPosition(a,b);a=d.container();runtime.assert(Boolean(a),"SelectionMover.countStepsToPosition: positionIterator.container() returned null");b=d.unfilteredDomOffset();d.setUnfilteredPosition(e,f);var e=a,f=b,n=d.container(),k=d.unfilteredDomOffset();if(e===n)e=k- -f;else{var s=e.compareDocumentPosition(n);2===s?s=-1:4===s?s=1:10===s?(f=m(e,n),s=fe)for(;d.nextPosition()&&(h.check(),c.acceptPosition(d)===v&&(g+=1),d.container()!==a||d.unfilteredDomOffset()!==b););else if(0a?-1:1;for(a=Math.abs(a);0n?l.previousPosition():l.nextPosition());)if(F.check(),k.acceptPosition(l)===u&&(q+=1,r=l.container(),z=g(r,l.unfilteredDomOffset(),Q),z.top!==O)){if(z.top!==S&&S!==O)break;S=z.top;z=Math.abs(ba-z.left);if(null===s||za?(c=k.previousPosition,d=-1):(c=k.nextPosition,d=1);for(e=g(k.container(),k.unfilteredDomOffset(),q);c.call(k);)if(b.acceptPosition(k)===u){if(r.getParagraphElement(k.getCurrentNode())!==l)break;h=g(k.container(),k.unfilteredDomOffset(),q);if(h.bottom!==e.bottom&&(e=h.top>=e.top&&h.bottome.bottom,!e))break;n+=d;e=h}q.detach();return n}function n(a,b){for(var c=0,d;a.parentNode!==b;)runtime.assert(null!==a.parentNode,"parent is null"),a=a.parentNode;for(d=b.firstChild;d!== +a;)c+=1,d=d.nextSibling;return c}function q(a,b,c){runtime.assert(null!==a,"SelectionMover.countStepsToPosition called with element===null");var d=m(),e=d.container(),f=d.unfilteredDomOffset(),g=0,h=new core.LoopWatchDog(1E3);d.setUnfilteredPosition(a,b);a=d.container();runtime.assert(Boolean(a),"SelectionMover.countStepsToPosition: positionIterator.container() returned null");b=d.unfilteredDomOffset();d.setUnfilteredPosition(e,f);var e=a,f=b,k=d.container(),l=d.unfilteredDomOffset();if(e===k)e=l- +f;else{var r=e.compareDocumentPosition(k);2===r?r=-1:4===r?r=1:10===r?(f=n(e,k),r=fe)for(;d.nextPosition()&&(h.check(),c.acceptPosition(d)===u&&(g+=1),d.container()!==a||d.unfilteredDomOffset()!==b););else if(0=b&&(f=-h.movePointBackward(-b,a));l.handleUpdate();return f};this.handleUpdate=function(){};this.getStepCounter=function(){return h.getStepCounter()};this.getMemberId=function(){return k};this.getNode=function(){return b.getNode()};this.getAnchorNode=function(){return b.getAnchorNode()};this.getSelectedRange=function(){return b.getSelectedRange()}; -this.getOdtDocument=function(){return g};b=new core.Cursor(g.getDOM(),k);h=new gui.SelectionMover(b,g.getRootNode())}; +ops.OdtCursor=function(l,f){var m=this,g,b;this.removeFromOdtDocument=function(){b.remove()};this.move=function(b,a){var e=0;0=b&&(e=-g.movePointBackward(-b,a));m.handleUpdate();return e};this.handleUpdate=function(){};this.getStepCounter=function(){return g.getStepCounter()};this.getMemberId=function(){return l};this.getNode=function(){return b.getNode()};this.getAnchorNode=function(){return b.getAnchorNode()};this.getSelectedRange=function(){return b.getSelectedRange()}; +this.getOdtDocument=function(){return f};b=new core.Cursor(f.getDOM(),l);g=new gui.SelectionMover(b,f.getRootNode())}; // Input 60 /* @@ -1615,22 +1615,22 @@ this.getOdtDocument=function(){return g};b=new core.Cursor(g.getDOM(),k);h=new g @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -ops.EditInfo=function(k,g){function l(){var g=[],a;for(a in b)b.hasOwnProperty(a)&&g.push({memberid:a,time:b[a].time});g.sort(function(a,b){return a.time-b.time});return g}var h,b={};this.getNode=function(){return h};this.getOdtDocument=function(){return g};this.getEdits=function(){return b};this.getSortedEdits=function(){return l()};this.addEdit=function(g,a){var f,d=g.split("___")[0];if(!b[g])for(f in b)if(b.hasOwnProperty(f)&&f.split("___")[0]===d){delete b[f];break}b[g]={time:a}};this.clearEdits= -function(){b={}};h=g.getDOM().createElementNS("urn:webodf:names:editinfo","editinfo");k.insertBefore(h,k.firstChild)}; +ops.EditInfo=function(l,f){function m(){var f=[],a;for(a in b)b.hasOwnProperty(a)&&f.push({memberid:a,time:b[a].time});f.sort(function(a,b){return a.time-b.time});return f}var g,b={};this.getNode=function(){return g};this.getOdtDocument=function(){return f};this.getEdits=function(){return b};this.getSortedEdits=function(){return m()};this.addEdit=function(f,a){var e,d=f.split("___")[0];if(!b[f])for(e in b)if(b.hasOwnProperty(e)&&e.split("___")[0]===d){delete b[e];break}b[f]={time:a}};this.clearEdits= +function(){b={}};g=f.getDOM().createElementNS("urn:webodf:names:editinfo","editinfo");l.insertBefore(g,l.firstChild)}; // Input 61 -gui.Avatar=function(k,g){var l=this,h,b,n;this.setColor=function(a){b.style.borderColor=a};this.setImageUrl=function(a){l.isVisible()?b.src=a:n=a};this.isVisible=function(){return"block"===h.style.display};this.show=function(){n&&(b.src=n,n=void 0);h.style.display="block"};this.hide=function(){h.style.display="none"};this.markAsFocussed=function(a){h.className=a?"active":""};(function(){var a=k.ownerDocument,f=a.documentElement.namespaceURI;h=a.createElementNS(f,"div");b=a.createElementNS(f,"img"); -b.width=64;b.height=64;h.appendChild(b);h.style.width="64px";h.style.height="70px";h.style.position="absolute";h.style.top="-80px";h.style.left="-34px";h.style.display=g?"block":"none";k.appendChild(h)})()}; +gui.Avatar=function(l,f){var m=this,g,b,k;this.setColor=function(a){b.style.borderColor=a};this.setImageUrl=function(a){m.isVisible()?b.src=a:k=a};this.isVisible=function(){return"block"===g.style.display};this.show=function(){k&&(b.src=k,k=void 0);g.style.display="block"};this.hide=function(){g.style.display="none"};this.markAsFocussed=function(a){g.className=a?"active":""};(function(){var a=l.ownerDocument,e=a.documentElement.namespaceURI;g=a.createElementNS(e,"div");b=a.createElementNS(e,"img"); +b.width=64;b.height=64;g.appendChild(b);g.style.width="64px";g.style.height="70px";g.style.position="absolute";g.style.top="-80px";g.style.left="-34px";g.style.display=f?"block":"none";l.appendChild(g)})()}; // Input 62 runtime.loadClass("gui.Avatar");runtime.loadClass("ops.OdtCursor"); -gui.Caret=function(k,g,l){function h(a){d&&f.parentNode&&(!c||a)&&(a&&void 0!==t&&runtime.clearTimeout(t),c=!0,n.style.opacity=a||"0"===n.style.opacity?"1":"0",t=runtime.setTimeout(function(){c=!1;h(!1)},500))}function b(a){var b;if("string"===typeof a){if(""===a)return 0;b=/^(\d+)(\.\d+)?px$/.exec(a);runtime.assert(null!==b,"size ["+a+"] does not have unit px.");return parseFloat(b[1])}return a}var n,a,f,d=!1,c=!1,t;this.refreshCursor=function(){l||k.getSelectedRange().collapsed?(d=!0,h(!0)):(d= -!1,n.style.opacity="0")};this.setFocus=function(){d=!0;a.markAsFocussed(!0);h(!0)};this.removeFocus=function(){d=!1;a.markAsFocussed(!1);n.style.opacity="0"};this.setAvatarImageUrl=function(b){a.setImageUrl(b)};this.setColor=function(b){n.style.borderColor=b;a.setColor(b)};this.getCursor=function(){return k};this.getFocusElement=function(){return n};this.toggleHandleVisibility=function(){a.isVisible()?a.hide():a.show()};this.showHandle=function(){a.show()};this.hideHandle=function(){a.hide()};this.ensureVisible= -function(){var a,c,d,f,g,h,l,t=k.getOdtDocument().getOdfCanvas().getElement().parentNode;g=l=n;d=runtime.getWindow();runtime.assert(null!==d,"Expected to be run in an environment which has a global window, like a browser.");do{g=g.parentElement;if(!g)break;h=d.getComputedStyle(g,null)}while("block"!==h.display);h=g;g=f=0;if(h&&t){c=!1;do{d=h.offsetParent;for(a=h.parentNode;a!==d;){if(a===t){a=h;var v=t,p=0;c=0;var y=void 0,D=runtime.getWindow();for(runtime.assert(null!==D,"Expected to be run in an environment which has a global window, like a browser.");a&& -a!==v;)y=D.getComputedStyle(a,null),p+=b(y.marginLeft)+b(y.borderLeftWidth)+b(y.paddingLeft),c+=b(y.marginTop)+b(y.borderTopWidth)+b(y.paddingTop),a=a.parentElement;a=p;f+=a;g+=c;c=!0;break}a=a.parentNode}if(c)break;f+=b(h.offsetLeft);g+=b(h.offsetTop);h=d}while(h&&h!==t);d=f;f=g}else f=d=0;d+=l.offsetLeft;f+=l.offsetTop;g=d-5;h=f-5;d=d+l.scrollWidth-1+5;l=f+l.scrollHeight-1+5;ht.scrollTop+t.clientHeight-1&&(t.scrollTop=l-t.clientHeight+1);gt.scrollLeft+t.clientWidth-1&&(t.scrollLeft=d-t.clientWidth+1)};(function(){var b=k.getOdtDocument().getDOM();n=b.createElementNS(b.documentElement.namespaceURI,"span");f=k.getNode();f.appendChild(n);a=new gui.Avatar(f,g)})()}; +gui.Caret=function(l,f,m){function g(a){d&&e.parentNode&&(!c||a)&&(a&&void 0!==t&&runtime.clearTimeout(t),c=!0,k.style.opacity=a||"0"===k.style.opacity?"1":"0",t=runtime.setTimeout(function(){c=!1;g(!1)},500))}function b(a){var b;if("string"===typeof a){if(""===a)return 0;b=/^(\d+)(\.\d+)?px$/.exec(a);runtime.assert(null!==b,"size ["+a+"] does not have unit px.");return parseFloat(b[1])}return a}var k,a,e,d=!1,c=!1,t;this.refreshCursor=function(){m||l.getSelectedRange().collapsed?(d=!0,g(!0)):(d= +!1,k.style.opacity="0")};this.setFocus=function(){d=!0;a.markAsFocussed(!0);g(!0)};this.removeFocus=function(){d=!1;a.markAsFocussed(!1);k.style.opacity="0"};this.setAvatarImageUrl=function(b){a.setImageUrl(b)};this.setColor=function(b){k.style.borderColor=b;a.setColor(b)};this.getCursor=function(){return l};this.getFocusElement=function(){return k};this.toggleHandleVisibility=function(){a.isVisible()?a.hide():a.show()};this.showHandle=function(){a.show()};this.hideHandle=function(){a.hide()};this.ensureVisible= +function(){var a,c,d,e,f,g,m,t=l.getOdtDocument().getOdfCanvas().getElement().parentNode;f=m=k;d=runtime.getWindow();runtime.assert(null!==d,"Expected to be run in an environment which has a global window, like a browser.");do{f=f.parentElement;if(!f)break;g=d.getComputedStyle(f,null)}while("block"!==g.display);g=f;f=e=0;if(g&&t){c=!1;do{d=g.offsetParent;for(a=g.parentNode;a!==d;){if(a===t){a=g;var u=t,p=0;c=0;var y=void 0,D=runtime.getWindow();for(runtime.assert(null!==D,"Expected to be run in an environment which has a global window, like a browser.");a&& +a!==u;)y=D.getComputedStyle(a,null),p+=b(y.marginLeft)+b(y.borderLeftWidth)+b(y.paddingLeft),c+=b(y.marginTop)+b(y.borderTopWidth)+b(y.paddingTop),a=a.parentElement;a=p;e+=a;f+=c;c=!0;break}a=a.parentNode}if(c)break;e+=b(g.offsetLeft);f+=b(g.offsetTop);g=d}while(g&&g!==t);d=e;e=f}else e=d=0;d+=m.offsetLeft;e+=m.offsetTop;f=d-5;g=e-5;d=d+m.scrollWidth-1+5;m=e+m.scrollHeight-1+5;gt.scrollTop+t.clientHeight-1&&(t.scrollTop=m-t.clientHeight+1);ft.scrollLeft+t.clientWidth-1&&(t.scrollLeft=d-t.clientWidth+1)};(function(){var b=l.getOdtDocument().getDOM();k=b.createElementNS(b.documentElement.namespaceURI,"span");e=l.getNode();e.appendChild(k);a=new gui.Avatar(e,f)})()}; // Input 63 runtime.loadClass("core.EventNotifier"); -gui.ClickHandler=function(){function k(){l=0;h=null}var g,l=0,h=null,b=new core.EventNotifier([gui.ClickHandler.signalSingleClick,gui.ClickHandler.signalDoubleClick,gui.ClickHandler.signalTripleClick]);this.subscribe=function(g,a){b.subscribe(g,a)};this.handleMouseUp=function(n){var a=runtime.getWindow();h&&h.x===n.screenX&&h.y===n.screenY?(l+=1,1===l?b.emit(gui.ClickHandler.signalSingleClick,n):2===l?b.emit(gui.ClickHandler.signalDoubleClick,void 0):3===l&&(a.clearTimeout(g),b.emit(gui.ClickHandler.signalTripleClick, -void 0),k())):(b.emit(gui.ClickHandler.signalSingleClick,n),l=1,h={x:n.screenX,y:n.screenY},a.clearTimeout(g),g=a.setTimeout(k,400))}};gui.ClickHandler.signalSingleClick="click";gui.ClickHandler.signalDoubleClick="doubleClick";gui.ClickHandler.signalTripleClick="tripleClick";(function(){return gui.ClickHandler})(); +gui.ClickHandler=function(){function l(){m=0;g=null}var f,m=0,g=null,b=new core.EventNotifier([gui.ClickHandler.signalSingleClick,gui.ClickHandler.signalDoubleClick,gui.ClickHandler.signalTripleClick]);this.subscribe=function(f,a){b.subscribe(f,a)};this.handleMouseUp=function(k){var a=runtime.getWindow();g&&g.x===k.screenX&&g.y===k.screenY?(m+=1,1===m?b.emit(gui.ClickHandler.signalSingleClick,k):2===m?b.emit(gui.ClickHandler.signalDoubleClick,void 0):3===m&&(a.clearTimeout(f),b.emit(gui.ClickHandler.signalTripleClick, +void 0),l())):(b.emit(gui.ClickHandler.signalSingleClick,k),m=1,g={x:k.screenX,y:k.screenY},a.clearTimeout(f),f=a.setTimeout(l,400))}};gui.ClickHandler.signalSingleClick="click";gui.ClickHandler.signalDoubleClick="doubleClick";gui.ClickHandler.signalTripleClick="tripleClick";(function(){return gui.ClickHandler})(); // Input 64 /* @@ -1666,8 +1666,8 @@ void 0),k())):(b.emit(gui.ClickHandler.signalSingleClick,n),l=1,h={x:n.screenX,y @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -gui.KeyboardHandler=function(){function k(b,h){h||(h=g.None);return b+":"+h}var g=gui.KeyboardHandler.Modifier,l=null,h={};this.setDefault=function(b){l=b};this.bind=function(b,g,a){b=k(b,g);runtime.assert(!1===h.hasOwnProperty(b),"tried to overwrite the callback handler of key combo: "+b);h[b]=a};this.unbind=function(b,g){var a=k(b,g);delete h[a]};this.reset=function(){l=null;h={}};this.handleEvent=function(b){var n=b.keyCode,a=g.None;b.metaKey&&(a|=g.Meta);b.ctrlKey&&(a|=g.Ctrl);b.altKey&&(a|=g.Alt); -b.shiftKey&&(a|=g.Shift);n=k(n,a);n=h[n];a=!1;n?a=n():null!==l&&(a=l(b));a&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}};gui.KeyboardHandler.Modifier={None:0,Meta:1,Ctrl:2,Alt:4,Shift:8,MetaShift:9,CtrlShift:10,AltShift:12};gui.KeyboardHandler.KeyCode={Backspace:8,Tab:9,Clear:12,Enter:13,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Delete:46,A:65,B:66,I:73,U:85,Z:90};(function(){return gui.KeyboardHandler})(); +gui.KeyboardHandler=function(){function l(b,g){g||(g=f.None);return b+":"+g}var f=gui.KeyboardHandler.Modifier,m=null,g={};this.setDefault=function(b){m=b};this.bind=function(b,f,a){b=l(b,f);runtime.assert(!1===g.hasOwnProperty(b),"tried to overwrite the callback handler of key combo: "+b);g[b]=a};this.unbind=function(b,f){var a=l(b,f);delete g[a]};this.reset=function(){m=null;g={}};this.handleEvent=function(b){var k=b.keyCode,a=f.None;b.metaKey&&(a|=f.Meta);b.ctrlKey&&(a|=f.Ctrl);b.altKey&&(a|=f.Alt); +b.shiftKey&&(a|=f.Shift);k=l(k,a);k=g[k];a=!1;k?a=k():null!==m&&(a=m(b));a&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}};gui.KeyboardHandler.Modifier={None:0,Meta:1,Ctrl:2,Alt:4,Shift:8,MetaShift:9,CtrlShift:10,AltShift:12};gui.KeyboardHandler.KeyCode={Backspace:8,Tab:9,Clear:12,Enter:13,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Delete:46,A:65,B:66,I:73,U:85,Z:90};(function(){return gui.KeyboardHandler})(); // Input 65 /* @@ -1704,34 +1704,34 @@ b.shiftKey&&(a|=g.Shift);n=k(n,a);n=h[n];a=!1;n?a=n():null!==l&&(a=l(b));a&&(b.p @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.Namespaces");runtime.loadClass("xmldom.LSSerializer");runtime.loadClass("odf.OdfNodeFilter");runtime.loadClass("odf.TextSerializer"); -gui.Clipboard=function(){var k,g,l;this.setDataFromRange=function(h,b){var n=!0,a,f=h.clipboardData;a=runtime.getWindow();var d=b.startContainer.ownerDocument;!f&&a&&(f=a.clipboardData);f?(d=d.createElement("span"),d.appendChild(b.cloneContents()),a=f.setData("text/plain",g.writeToString(d)),n=n&&a,a=f.setData("text/html",k.writeToString(d,odf.Namespaces.namespaceMap)),n=n&&a,h.preventDefault()):n=!1;return n};k=new xmldom.LSSerializer;g=new odf.TextSerializer;l=new odf.OdfNodeFilter;k.filter=l;g.filter= -l}; +gui.Clipboard=function(){var l,f,m;this.setDataFromRange=function(g,b){var k=!0,a,e=g.clipboardData;a=runtime.getWindow();var d=b.startContainer.ownerDocument;!e&&a&&(e=a.clipboardData);e?(d=d.createElement("span"),d.appendChild(b.cloneContents()),a=e.setData("text/plain",f.writeToString(d)),k=k&&a,a=e.setData("text/html",l.writeToString(d,odf.Namespaces.namespaceMap)),k=k&&a,g.preventDefault()):k=!1;return k};l=new xmldom.LSSerializer;f=new odf.TextSerializer;m=new odf.OdfNodeFilter;l.filter=m;f.filter= +m}; // Input 66 runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("gui.ClickHandler");runtime.loadClass("gui.Clipboard");runtime.loadClass("gui.KeyboardHandler");runtime.loadClass("gui.StyleHelper"); -gui.SessionController=function(){gui.SessionController=function(k,g){function l(a,b,c,d){var e="on"+b,f=!1;a.attachEvent&&(f=a.attachEvent(e,c));!f&&a.addEventListener&&(a.addEventListener(b,c,!1),f=!0);f&&!d||!a.hasOwnProperty(e)||(a[e]=c)}function h(a,b,c){var d="on"+b;a.detachEvent&&a.detachEvent(d,c);a.removeEventListener&&a.removeEventListener(b,c,!1);a[d]===c&&(a[d]=null)}function b(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function n(a,b){var c=new ops.OpMoveCursor;c.init({memberid:g, -position:a,length:b||0});return c}function a(a,b){var c=gui.SelectionMover.createPositionIterator(x.getRootNode()),d=x.getOdfCanvas().getElement(),e;e=a;if(!e)return null;for(;e!==d&&!("urn:webodf:names:cursor"===e.namespaceURI&&"cursor"===e.localName||"urn:webodf:names:editinfo"===e.namespaceURI&&"editinfo"===e.localName);)if(e=e.parentNode,!e)return null;e!==d&&a!==e&&(a=e.parentNode,b=Array.prototype.indexOf.call(a.childNodes,e));c.setUnfilteredPosition(a,b);return x.getDistanceFromCursor(g,c.container(), -c.unfilteredDomOffset())}function f(b){runtime.setTimeout(function(){var c=runtime.getWindow().getSelection(),d=x.getCursorPosition(g),e,f;if(null===c.anchorNode&&null===c.focusNode){e=b.clientX;f=b.clientY;var h=x.getDOM();h.caretRangeFromPoint?(e=h.caretRangeFromPoint(e,f),f={container:e.startContainer,offset:e.startOffset}):h.caretPositionFromPoint?(e=h.caretPositionFromPoint(e,f),f={container:e.offsetNode,offset:e.offset}):f=null;f&&(e=x.getDOM().createRange(),e.setStart(f.container,f.offset), -e.collapse(!0),c.addRange(e))}e=a(c.anchorNode,c.anchorOffset);c=a(c.focusNode,c.focusOffset);if(null!==c&&0!==c||null!==e&&0!==e)d=n(d+e,c-e),k.enqueue(d)},0)}function d(a){f(a)}function c(){var a,b,c,d=gui.SelectionMover.createPositionIterator(x.getRootNode()),e=x.getCursor(g).getNode(),f=x.getCursorPosition(g),h=/[A-Za-z0-9]/,m=0,l=0;d.setUnfilteredPosition(e,0);if(d.previousPosition()&&(a=d.getCurrentNode(),a.nodeType===Node.TEXT_NODE))for(b=a.data.length-1;0<=b;b-=1)if(c=a.data[b],h.test(c))m-= -1;else break;d.setUnfilteredPosition(e,0);if(d.nextPosition()&&(a=d.getCurrentNode(),a.nodeType===Node.TEXT_NODE))for(b=0;ba.length&&(a.position+=a.length,a.length=-a.length);return a}function O(a){var b=new ops.OpRemoveText;b.init({memberid:g,position:a.position,length:a.length});return b}function ba(){var a=W(x.getCursorSelection(g)),b=null;0===a.length?0a.length&&(a.position+=a.length,a.length=-a.length);return a}function O(a){var b=new ops.OpRemoveText;b.init({memberid:f,position:a.position,length:a.length});return b}function ba(){var a=W(x.getCursorSelection(f)),b=null;0===a.length?0e?(l(1,0),f=l(0.5,1E4-e),d=l(0.2,2E4-e)):1E4<=e&&2E4>e?(l(0.5,0),d=l(0.2,2E4-e)):l(0.2,0)};this.getEdits= -function(){return k.getEdits()};this.clearEdits=function(){k.clearEdits();n.setEdits([]);a.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&a.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return k};this.show=function(){a.style.display="block"};this.hide=function(){h.hideHandle();a.style.display="none"};this.showHandle=function(){n.show()};this.hideHandle=function(){n.hide()};(function(){var c=k.getOdtDocument().getDOM();a=c.createElementNS(c.documentElement.namespaceURI, -"div");a.setAttribute("class","editInfoMarker");a.onmouseover=function(){h.showHandle()};a.onmouseout=function(){h.hideHandle()};b=k.getNode();b.appendChild(a);n=new gui.EditInfoHandle(b);g||h.hide()})()}; +gui.EditInfoMarker=function(l,f){function m(b,d){return runtime.getWindow().setTimeout(function(){a.style.opacity=b},d)}var g=this,b,k,a,e,d;this.addEdit=function(b,f){var g=Date.now()-f;l.addEdit(b,f);k.setEdits(l.getSortedEdits());a.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",b);if(e){var s=e;runtime.getWindow().clearTimeout(s)}d&&(s=d,runtime.getWindow().clearTimeout(s));1E4>g?(m(1,0),e=m(0.5,1E4-g),d=m(0.2,2E4-g)):1E4<=g&&2E4>g?(m(0.5,0),d=m(0.2,2E4-g)):m(0.2,0)};this.getEdits= +function(){return l.getEdits()};this.clearEdits=function(){l.clearEdits();k.setEdits([]);a.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&a.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return l};this.show=function(){a.style.display="block"};this.hide=function(){g.hideHandle();a.style.display="none"};this.showHandle=function(){k.show()};this.hideHandle=function(){k.hide()};(function(){var c=l.getOdtDocument().getDOM();a=c.createElementNS(c.documentElement.namespaceURI, +"div");a.setAttribute("class","editInfoMarker");a.onmouseover=function(){g.showHandle()};a.onmouseout=function(){g.hideHandle()};b=l.getNode();b.appendChild(a);k=new gui.EditInfoHandle(b);f||g.hide()})()}; // Input 77 /* @@ -1973,12 +1973,12 @@ function(){return k.getEdits()};this.clearEdits=function(){k.clearEdits();n.setE @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("gui.Caret");runtime.loadClass("ops.TrivialUserModel");runtime.loadClass("ops.EditInfo");runtime.loadClass("gui.EditInfoMarker");gui.SessionViewOptions=function(){this.caretBlinksOnRangeSelect=this.caretAvatarsInitiallyVisible=this.editInfoMarkersInitiallyVisible=!0}; -gui.SessionView=function(){return function(k,g,l){function h(a,b,c){b=b.split("___")[0];return a+'[editinfo|memberid^="'+b+'"]'+c}function b(a,b,c){function d(b,c,e){c=h(b,a,e)+c;a:{var f=t.firstChild;for(b=h(b,a,e);f;){if(f.nodeType===Node.TEXT_NODE&&0===f.data.indexOf(b)){b=f;break a}f=f.nextSibling}b=null}b?b.data=c:t.appendChild(document.createTextNode(c))}d("div.editInfoMarker","{ background-color: "+c+"; }","");d("span.editInfoColor","{ background-color: "+c+"; }","");d("span.editInfoAuthor", -'{ content: "'+b+'"; }',":before");d("dc|creator",'{ content: "'+b+'"; display: none;}',":before");d("dc|creator","{ background-color: "+c+"; }","")}function n(a){var b,c;for(c in e)e.hasOwnProperty(c)&&(b=e[c],a?b.show():b.hide())}function a(a){l.getCarets().forEach(function(b){a?b.showHandle():b.hideHandle()})}function f(a,c){var d=l.getCaret(a);void 0===c?runtime.log('UserModel sent undefined data for member "'+a+'".'):(null===c&&(c={memberid:a,fullname:"Unknown Identity",color:"black",imageurl:"avatar-joe.png"}), -d&&(d.setAvatarImageUrl(c.imageurl),d.setColor(c.color)),b(a,c.fullname,c.color))}function d(a){var b=a.getMemberId(),c=g.getUserModel();l.registerCursor(a,m,q);f(b,null);c.getUserDetailsAndUpdates(b,f);runtime.log("+++ View here +++ eagerly created an Caret for '"+b+"'! +++")}function c(a){var b=!1,c;for(c in e)if(e.hasOwnProperty(c)&&e[c].getEditInfo().getEdits().hasOwnProperty(a)){b=!0;break}b||g.getUserModel().unsubscribeUserDetailsUpdates(a,f)}var t,e={},r=void 0!==k.editInfoMarkersInitiallyVisible? -k.editInfoMarkersInitiallyVisible:!0,m=void 0!==k.caretAvatarsInitiallyVisible?k.caretAvatarsInitiallyVisible:!0,q=void 0!==k.caretBlinksOnRangeSelect?k.caretBlinksOnRangeSelect:!0;this.showEditInfoMarkers=function(){r||(r=!0,n(r))};this.hideEditInfoMarkers=function(){r&&(r=!1,n(r))};this.showCaretAvatars=function(){m||(m=!0,a(m))};this.hideCaretAvatars=function(){m&&(m=!1,a(m))};this.getSession=function(){return g};this.getCaret=function(a){return l.getCaret(a)};(function(){var a=g.getOdtDocument(), -b=document.getElementsByTagName("head")[0];a.subscribe(ops.OdtDocument.signalCursorAdded,d);a.subscribe(ops.OdtDocument.signalCursorRemoved,c);a.subscribe(ops.OdtDocument.signalParagraphChanged,function(a){var b=a.paragraphElement,c=a.memberId;a=a.timeStamp;var d,f="",h=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0];h?(f=h.getAttributeNS("urn:webodf:names:editinfo","id"),d=e[f]):(f=Math.random().toString(),d=new ops.EditInfo(b,g.getOdtDocument()),d=new gui.EditInfoMarker(d,r), -h=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0],h.setAttributeNS("urn:webodf:names:editinfo","id",f),e[f]=d);d.addEdit(c,new Date(a))});t=document.createElementNS(b.namespaceURI,"style");t.type="text/css";t.media="screen, print, handheld, projection";t.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);"));t.appendChild(document.createTextNode("@namespace dc url(http://purl.org/dc/elements/1.1/);"));b.appendChild(t)})()}}(); +gui.SessionView=function(){return function(l,f,m){function g(a,b,c){b=b.split("___")[0];return a+'[editinfo|memberid^="'+b+'"]'+c}function b(a,b,c){function d(b,c,e){c=g(b,a,e)+c;a:{var f=t.firstChild;for(b=g(b,a,e);f;){if(f.nodeType===Node.TEXT_NODE&&0===f.data.indexOf(b)){b=f;break a}f=f.nextSibling}b=null}b?b.data=c:t.appendChild(document.createTextNode(c))}d("div.editInfoMarker","{ background-color: "+c+"; }","");d("span.editInfoColor","{ background-color: "+c+"; }","");d("span.editInfoAuthor", +'{ content: "'+b+'"; }',":before");d("dc|creator",'{ content: "'+b+'"; display: none;}',":before");d("dc|creator","{ background-color: "+c+"; }","")}function k(a){var b,c;for(c in h)h.hasOwnProperty(c)&&(b=h[c],a?b.show():b.hide())}function a(a){m.getCarets().forEach(function(b){a?b.showHandle():b.hideHandle()})}function e(a,c){var d=m.getCaret(a);void 0===c?runtime.log('UserModel sent undefined data for member "'+a+'".'):(null===c&&(c={memberid:a,fullname:"Unknown Identity",color:"black",imageurl:"avatar-joe.png"}), +d&&(d.setAvatarImageUrl(c.imageurl),d.setColor(c.color)),b(a,c.fullname,c.color))}function d(a){var b=a.getMemberId(),c=f.getUserModel();m.registerCursor(a,n,q);e(b,null);c.getUserDetailsAndUpdates(b,e);runtime.log("+++ View here +++ eagerly created an Caret for '"+b+"'! +++")}function c(a){var b=!1,c;for(c in h)if(h.hasOwnProperty(c)&&h[c].getEditInfo().getEdits().hasOwnProperty(a)){b=!0;break}b||f.getUserModel().unsubscribeUserDetailsUpdates(a,e)}var t,h={},s=void 0!==l.editInfoMarkersInitiallyVisible? +l.editInfoMarkersInitiallyVisible:!0,n=void 0!==l.caretAvatarsInitiallyVisible?l.caretAvatarsInitiallyVisible:!0,q=void 0!==l.caretBlinksOnRangeSelect?l.caretBlinksOnRangeSelect:!0;this.showEditInfoMarkers=function(){s||(s=!0,k(s))};this.hideEditInfoMarkers=function(){s&&(s=!1,k(s))};this.showCaretAvatars=function(){n||(n=!0,a(n))};this.hideCaretAvatars=function(){n&&(n=!1,a(n))};this.getSession=function(){return f};this.getCaret=function(a){return m.getCaret(a)};(function(){var a=f.getOdtDocument(), +b=document.getElementsByTagName("head")[0];a.subscribe(ops.OdtDocument.signalCursorAdded,d);a.subscribe(ops.OdtDocument.signalCursorRemoved,c);a.subscribe(ops.OdtDocument.signalParagraphChanged,function(a){var b=a.paragraphElement,c=a.memberId;a=a.timeStamp;var d,e="",g=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0];g?(e=g.getAttributeNS("urn:webodf:names:editinfo","id"),d=h[e]):(e=Math.random().toString(),d=new ops.EditInfo(b,f.getOdtDocument()),d=new gui.EditInfoMarker(d,s), +g=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0],g.setAttributeNS("urn:webodf:names:editinfo","id",e),h[e]=d);d.addEdit(c,new Date(a))});t=document.createElementNS(b.namespaceURI,"style");t.type="text/css";t.media="screen, print, handheld, projection";t.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);"));t.appendChild(document.createTextNode("@namespace dc url(http://purl.org/dc/elements/1.1/);"));b.appendChild(t)})()}}(); // Input 78 /* @@ -2015,26 +2015,26 @@ h=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0],h.setAttri @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("gui.Caret"); -gui.CaretManager=function(k){function g(){return k.getSession().getOdtDocument().getOdfCanvas().getElement()}function l(a){a===k.getInputMemberId()&&g().removeAttribute("tabindex",0);delete f[a]}function h(a){(a=f[a.getMemberId()])&&a.refreshCursor()}function b(a){var b=f[a.memberId];a.memberId===k.getInputMemberId()&&b&&b.ensureVisible()}function n(){var a=f[k.getInputMemberId()];a&&a.setFocus()}function a(){var a=f[k.getInputMemberId()];a&&a.removeFocus()}var f={};this.registerCursor=function(a, -b,h){var e=a.getMemberId(),n=g();b=new gui.Caret(a,b,h);f[e]=b;e===k.getInputMemberId()&&(runtime.log("Starting to track input on new cursor of "+e),a.handleUpdate=b.ensureVisible,n.setAttribute("tabindex",0),n.focus());return b};this.getCaret=function(a){return f[a]};this.getCarets=function(){return Object.keys(f).map(function(a){return f[a]})};(function(){var d=k.getSession().getOdtDocument(),c=g();d.subscribe(ops.OdtDocument.signalParagraphChanged,b);d.subscribe(ops.OdtDocument.signalCursorMoved, -h);d.subscribe(ops.OdtDocument.signalCursorRemoved,l);c.onfocus=n;c.onblur=a})()}; +gui.CaretManager=function(l){function f(){return l.getSession().getOdtDocument().getOdfCanvas().getElement()}function m(a){a===l.getInputMemberId()&&f().removeAttribute("tabindex",0);delete e[a]}function g(a){(a=e[a.getMemberId()])&&a.refreshCursor()}function b(a){var b=e[a.memberId];a.memberId===l.getInputMemberId()&&b&&b.ensureVisible()}function k(){var a=e[l.getInputMemberId()];a&&a.setFocus()}function a(){var a=e[l.getInputMemberId()];a&&a.removeFocus()}var e={};this.registerCursor=function(a, +b,g){var h=a.getMemberId(),k=f();b=new gui.Caret(a,b,g);e[h]=b;h===l.getInputMemberId()&&(runtime.log("Starting to track input on new cursor of "+h),a.handleUpdate=b.ensureVisible,k.setAttribute("tabindex",0),k.focus());return b};this.getCaret=function(a){return e[a]};this.getCarets=function(){return Object.keys(e).map(function(a){return e[a]})};(function(){var d=l.getSession().getOdtDocument(),c=f();d.subscribe(ops.OdtDocument.signalParagraphChanged,b);d.subscribe(ops.OdtDocument.signalCursorMoved, +g);d.subscribe(ops.OdtDocument.signalCursorRemoved,m);c.onfocus=k;c.onblur=a})()}; // Input 79 runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Namespaces"); -gui.PresenterUI=function(){var k=new xmldom.XPath,g=runtime.getWindow();return function(l){var h=this;h.setInitialSlideMode=function(){h.startSlideMode("single")};h.keyDownHandler=function(b){if(!b.target.isContentEditable&&"input"!==b.target.nodeName)switch(b.keyCode){case 84:h.toggleToolbar();break;case 37:case 8:h.prevSlide();break;case 39:case 32:h.nextSlide();break;case 36:h.firstSlide();break;case 35:h.lastSlide()}};h.root=function(){return h.odf_canvas.odfContainer().rootElement};h.firstSlide= -function(){h.slideChange(function(b,g){return 0})};h.lastSlide=function(){h.slideChange(function(b,g){return g-1})};h.nextSlide=function(){h.slideChange(function(b,g){return b+1b?-1:b-1})};h.slideChange=function(b){var k=h.getPages(h.odf_canvas.odfContainer().rootElement),a=-1,f=0;k.forEach(function(b){b=b[1];b.hasAttribute("slide_current")&&(a=f,b.removeAttribute("slide_current"));f+=1});b=b(a,k.length);-1===b&&(b=a);k[b][1].setAttribute("slide_current", -"1");document.getElementById("pagelist").selectedIndex=b;"cont"===h.slide_mode&&g.scrollBy(0,k[b][1].getBoundingClientRect().top-30)};h.selectSlide=function(b){h.slideChange(function(g,a){return b>=a||0>b?-1:b})};h.scrollIntoContView=function(b){var k=h.getPages(h.odf_canvas.odfContainer().rootElement);0!==k.length&&g.scrollBy(0,k[b][1].getBoundingClientRect().top-30)};h.getPages=function(b){b=b.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var g=[],a;for(a=0;ab?-1:b-1})};g.slideChange=function(b){var k=g.getPages(g.odf_canvas.odfContainer().rootElement),a=-1,e=0;k.forEach(function(b){b=b[1];b.hasAttribute("slide_current")&&(a=e,b.removeAttribute("slide_current"));e+=1});b=b(a,k.length);-1===b&&(b=a);k[b][1].setAttribute("slide_current", +"1");document.getElementById("pagelist").selectedIndex=b;"cont"===g.slide_mode&&f.scrollBy(0,k[b][1].getBoundingClientRect().top-30)};g.selectSlide=function(b){g.slideChange(function(f,a){return b>=a||0>b?-1:b})};g.scrollIntoContView=function(b){var k=g.getPages(g.odf_canvas.odfContainer().rootElement);0!==k.length&&f.scrollBy(0,k[b][1].getBoundingClientRect().top-30)};g.getPages=function(b){b=b.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var f=[],a;for(a=0;a=a.rangeCount||!q)||(a=a.getRangeAt(0),q.setPoint(a.startContainer,a.startOffset))}function n(){var a=k.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();q&&q.node()&&(b=q.node(),c=b.ownerDocument.createRange(), -c.setStart(b,q.position()),c.collapse(!0),a.addRange(c))}function a(a){var c=a.charCode||a.keyCode;if(q=null,q&&37===c)b(),q.stepBackward(),n();else if(16<=c&&20>=c||33<=c&&40>=c)return;h(a)}function f(a){h(a)}function d(a){for(var b=a.firstChild;b&&b!==a;)b.nodeType===Node.ELEMENT_NODE&&d(b),b=b.nextSibling||b.parentNode;var c,e,f,b=a.attributes;c="";for(f=b.length-1;0<=f;f-=1)e=b.item(f),c=c+" "+e.nodeName+'="'+e.nodeValue+'"';a.setAttribute("customns_name",a.nodeName);a.setAttribute("customns_atts", -c);b=a.firstChild;for(e=/^\s*$/;b&&b!==a;)c=b,b=b.nextSibling||b.parentNode,c.nodeType===Node.TEXT_NODE&&e.test(c.nodeValue)&&c.parentNode.removeChild(c)}function c(a,b){for(var d=a.firstChild,e,f,g;d&&d!==a;){if(d.nodeType===Node.ELEMENT_NODE)for(c(d,b),e=d.attributes,g=e.length-1;0<=g;g-=1)f=e.item(g),"http://www.w3.org/2000/xmlns/"!==f.namespaceURI||b[f.nodeValue]||(b[f.nodeValue]=f.localName);d=d.nextSibling||d.parentNode}}function t(){var a=k.ownerDocument.createElement("style"),b;b={};c(k,b); -var d={},f,h,m=0;for(f in b)if(b.hasOwnProperty(f)&&f){h=b[f];if(!h||d.hasOwnProperty(h)||"xmlns"===h){do h="ns"+m,m+=1;while(d.hasOwnProperty(h));b[f]=h}d[h]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+e;a.appendChild(k.ownerDocument.createTextNode(b));g=g.parentNode.replaceChild(a,g)}var e,r,m,q=null;k.id||(k.id="xml"+String(Math.random()).substring(2));r="#"+k.id+" ";e=r+"*,"+r+":visited, "+r+":link {display:block; margin: 0px; margin-left: 10px; font-size: medium; color: black; background: white; font-variant: normal; font-weight: normal; font-style: normal; font-family: sans-serif; text-decoration: none; white-space: pre-wrap; height: auto; width: auto}\n"+ -r+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+r+":after {color: blue; content: '';}\n"+r+"{overflow: auto;}\n";(function(b){l(b,"click",f);l(b,"keydown",a);l(b,"drop",h);l(b,"dragend",h);l(b,"beforepaste",h);l(b,"paste",h)})(k);this.updateCSS=t;this.setXML=function(a){a=a.documentElement||a;m=a=k.ownerDocument.importNode(a,!0);for(d(a);k.lastChild;)k.removeChild(k.lastChild);k.appendChild(a);t();q=new core.PositionIterator(a)};this.getXML= -function(){return m}}; +gui.XMLEdit=function(l,f){function m(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function g(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function b(){var a=l.ownerDocument.defaultView.getSelection();!a||(0>=a.rangeCount||!q)||(a=a.getRangeAt(0),q.setPoint(a.startContainer,a.startOffset))}function k(){var a=l.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();q&&q.node()&&(b=q.node(),c=b.ownerDocument.createRange(), +c.setStart(b,q.position()),c.collapse(!0),a.addRange(c))}function a(a){var c=a.charCode||a.keyCode;if(q=null,q&&37===c)b(),q.stepBackward(),k();else if(16<=c&&20>=c||33<=c&&40>=c)return;g(a)}function e(a){g(a)}function d(a){for(var b=a.firstChild;b&&b!==a;)b.nodeType===Node.ELEMENT_NODE&&d(b),b=b.nextSibling||b.parentNode;var c,e,f,b=a.attributes;c="";for(f=b.length-1;0<=f;f-=1)e=b.item(f),c=c+" "+e.nodeName+'="'+e.nodeValue+'"';a.setAttribute("customns_name",a.nodeName);a.setAttribute("customns_atts", +c);b=a.firstChild;for(e=/^\s*$/;b&&b!==a;)c=b,b=b.nextSibling||b.parentNode,c.nodeType===Node.TEXT_NODE&&e.test(c.nodeValue)&&c.parentNode.removeChild(c)}function c(a,b){for(var d=a.firstChild,e,f,g;d&&d!==a;){if(d.nodeType===Node.ELEMENT_NODE)for(c(d,b),e=d.attributes,g=e.length-1;0<=g;g-=1)f=e.item(g),"http://www.w3.org/2000/xmlns/"!==f.namespaceURI||b[f.nodeValue]||(b[f.nodeValue]=f.localName);d=d.nextSibling||d.parentNode}}function t(){var a=l.ownerDocument.createElement("style"),b;b={};c(l,b); +var d={},e,g,k=0;for(e in b)if(b.hasOwnProperty(e)&&e){g=b[e];if(!g||d.hasOwnProperty(g)||"xmlns"===g){do g="ns"+k,k+=1;while(d.hasOwnProperty(g));b[e]=g}d[g]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+h;a.appendChild(l.ownerDocument.createTextNode(b));f=f.parentNode.replaceChild(a,f)}var h,s,n,q=null;l.id||(l.id="xml"+String(Math.random()).substring(2));s="#"+l.id+" ";h=s+"*,"+s+":visited, "+s+":link {display:block; margin: 0px; margin-left: 10px; font-size: medium; color: black; background: white; font-variant: normal; font-weight: normal; font-style: normal; font-family: sans-serif; text-decoration: none; white-space: pre-wrap; height: auto; width: auto}\n"+ +s+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+s+":after {color: blue; content: '';}\n"+s+"{overflow: auto;}\n";(function(b){m(b,"click",e);m(b,"keydown",a);m(b,"drop",g);m(b,"dragend",g);m(b,"beforepaste",g);m(b,"paste",g)})(l);this.updateCSS=t;this.setXML=function(a){a=a.documentElement||a;n=a=l.ownerDocument.importNode(a,!0);for(d(a);l.lastChild;)l.removeChild(l.lastChild);l.appendChild(a);t();q=new core.PositionIterator(a)};this.getXML= +function(){return n}}; // Input 81 /* @@ -2070,8 +2070,8 @@ function(){return m}}; @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -gui.UndoManager=function(){};gui.UndoManager.prototype.subscribe=function(k,g){};gui.UndoManager.prototype.unsubscribe=function(k,g){};gui.UndoManager.prototype.setOdtDocument=function(k){};gui.UndoManager.prototype.saveInitialState=function(){};gui.UndoManager.prototype.resetInitialState=function(){};gui.UndoManager.prototype.setPlaybackFunction=function(k){};gui.UndoManager.prototype.hasUndoStates=function(){};gui.UndoManager.prototype.hasRedoStates=function(){}; -gui.UndoManager.prototype.moveForward=function(k){};gui.UndoManager.prototype.moveBackward=function(k){};gui.UndoManager.prototype.onOperationExecuted=function(k){};gui.UndoManager.signalUndoStackChanged="undoStackChanged";gui.UndoManager.signalUndoStateCreated="undoStateCreated";gui.UndoManager.signalUndoStateModified="undoStateModified";(function(){return gui.UndoManager})(); +gui.UndoManager=function(){};gui.UndoManager.prototype.subscribe=function(l,f){};gui.UndoManager.prototype.unsubscribe=function(l,f){};gui.UndoManager.prototype.setOdtDocument=function(l){};gui.UndoManager.prototype.saveInitialState=function(){};gui.UndoManager.prototype.resetInitialState=function(){};gui.UndoManager.prototype.setPlaybackFunction=function(l){};gui.UndoManager.prototype.hasUndoStates=function(){};gui.UndoManager.prototype.hasRedoStates=function(){}; +gui.UndoManager.prototype.moveForward=function(l){};gui.UndoManager.prototype.moveBackward=function(l){};gui.UndoManager.prototype.onOperationExecuted=function(l){};gui.UndoManager.signalUndoStackChanged="undoStackChanged";gui.UndoManager.signalUndoStateCreated="undoStateCreated";gui.UndoManager.signalUndoStateModified="undoStateModified";(function(){return gui.UndoManager})(); // Input 82 /* @@ -2107,8 +2107,8 @@ gui.UndoManager.prototype.moveForward=function(k){};gui.UndoManager.prototype.mo @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ -gui.UndoStateRules=function(){function k(g){return g.spec().optype}function g(g){switch(k(g)){case "MoveCursor":case "AddCursor":case "RemoveCursor":return!1;default:return!0}}this.getOpType=k;this.isEditOperation=g;this.isPartOfOperationSet=function(l,h){if(g(l)){if(0===h.length)return!0;var b;if(b=g(h[h.length-1]))a:{b=h.filter(g);var n=k(l),a;b:switch(n){case "RemoveText":case "InsertText":a=!0;break b;default:a=!1}if(a&&n===k(b[0])){if(1===b.length){b=!0;break a}n=b[b.length-2].spec().position; -b=b[b.length-1].spec().position;a=l.spec().position;if(b===a-(b-n)){b=!0;break a}}b=!1}return b}return!0}}; +gui.UndoStateRules=function(){function l(f){return f.spec().optype}function f(f){switch(l(f)){case "MoveCursor":case "AddCursor":case "RemoveCursor":return!1;default:return!0}}this.getOpType=l;this.isEditOperation=f;this.isPartOfOperationSet=function(m,g){if(f(m)){if(0===g.length)return!0;var b;if(b=f(g[g.length-1]))a:{b=g.filter(f);var k=l(m),a;b:switch(k){case "RemoveText":case "InsertText":a=!0;break b;default:a=!1}if(a&&k===l(b[0])){if(1===b.length){b=!0;break a}k=b[b.length-2].spec().position; +b=b[b.length-1].spec().position;a=m.spec().position;if(b===a-(b-k)){b=!0;break a}}b=!1}return b}return!0}}; // Input 83 /* @@ -2145,12 +2145,12 @@ b=b[b.length-1].spec().position;a=l.spec().position;if(b===a-(b-n)){b=!0;break a @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.DomUtils");runtime.loadClass("gui.UndoManager");runtime.loadClass("gui.UndoStateRules"); -gui.TrivialUndoManager=function(k){function g(){s.emit(gui.UndoManager.signalUndoStackChanged,{undoAvailable:a.hasUndoStates(),redoAvailable:a.hasRedoStates()})}function l(){r!==c&&r!==m[m.length-1]&&m.push(r)}function h(a){var b=a.previousSibling||a.nextSibling;a.parentNode.removeChild(a);f.normalizeTextNodes(b)}function b(a){return Object.keys(a).map(function(b){return a[b]})}function n(a){function c(a){var b=a.spec();if(g[b.memberid])switch(b.optype){case "AddCursor":d[b.memberid]||(d[b.memberid]= -a,delete g[b.memberid],h-=1);break;case "MoveCursor":f[b.memberid]||(f[b.memberid]=a)}}var d={},f={},g={},h,m=a.pop();e.getCursors().forEach(function(a){g[a.getMemberId()]=!0});for(h=Object.keys(g).length;m&&0=d;d+=1){b=a.container();c=a.unfilteredDomOffset();if(b.nodeType===Node.TEXT_NODE&&" "===b.data[c]&&f.isSignificantWhitespace(b, -c)){runtime.assert(" "===b.data[c],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var e=b.ownerDocument.createElementNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:s");e.appendChild(b.ownerDocument.createTextNode(" "));b.deleteData(c,1);0= 0");1===r.acceptPosition(c)?(f=c.container(),f.nodeType===Node.TEXT_NODE&&(e=f,h=0)):a+=1;for(;0=d;d+=1){b=a.container();c=a.unfilteredDomOffset();if(b.nodeType===Node.TEXT_NODE&&" "===b.data[c]&&e.isSignificantWhitespace(b, +c)){runtime.assert(" "===b.data[c],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var f=b.ownerDocument.createElementNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:s");f.appendChild(b.ownerDocument.createTextNode(" "));b.deleteData(c,1);0= 0");1===s.acceptPosition(c)?(g=c.container(),g.nodeType===Node.TEXT_NODE&&(e=g,h=0)):a+=1;for(;0 draw|image:nth-of-type(n+2) {\n display: none;\n}\ntext|list:before {\n display: none;\n content:\"\";\n}\ntext|list {\n counter-reset: list;\n}\ntext|list-item {\n display: block;\n}\ntext|number {\n display:none;\n}\n\ntext|a {\n color: blue;\n text-decoration: underline;\n cursor: pointer;\n}\ntext|note-citation {\n vertical-align: super;\n font-size: smaller;\n}\ntext|note-body {\n display: none;\n}\ntext|note:hover text|note-citation {\n background: #dddddd;\n}\ntext|note:hover text|note-body {\n display: block;\n left:1em;\n max-width: 80%;\n position: absolute;\n background: #ffffaa;\n}\nsvg|title, svg|desc {\n display: none;\n}\nvideo {\n width: 100%;\n height: 100%\n}\n\n/* below set up the cursor */\ncursor|cursor {\n display: inline;\n width: 0px;\n height: 1em;\n /* making the position relative enables the avatar to use\n the cursor as reference for its absolute position */\n position: relative;\n z-index: 1;\n}\ncursor|cursor > span {\n display: inline;\n position: absolute;\n top: 5%; /* push down the caret; 0px can do the job, 5% looks better, 10% is a bit over */\n height: 1em;\n border-left: 2px solid black;\n outline: none;\n}\n\ncursor|cursor > div {\n padding: 3px;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n border: none !important;\n border-radius: 5px;\n opacity: 0.3;\n}\n\ncursor|cursor > div > img {\n border-radius: 5px;\n}\n\ncursor|cursor > div.active {\n opacity: 0.8;\n}\n\ncursor|cursor > div:after {\n content: ' ';\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: black transparent transparent transparent;\n\n top: 100%;\n left: 43%;\n}\n\n\n.editInfoMarker {\n position: absolute;\n width: 10px;\n height: 100%;\n left: -20px;\n opacity: 0.8;\n top: 0;\n border-radius: 5px;\n background-color: transparent;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n}\n.editInfoMarker:hover {\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);\n}\n\n.editInfoHandle {\n position: absolute;\n background-color: black;\n padding: 5px;\n border-radius: 5px;\n opacity: 0.8;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n bottom: 100%;\n margin-bottom: 10px;\n z-index: 3;\n left: -25px;\n}\n.editInfoHandle:after {\n content: ' ';\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: black transparent transparent transparent;\n\n top: 100%;\n left: 5px;\n}\n.editInfo {\n font-family: sans-serif;\n font-weight: normal;\n font-style: normal;\n text-decoration: none;\n color: white;\n width: 100%;\n height: 12pt;\n}\n.editInfoColor {\n float: left;\n width: 10pt;\n height: 10pt;\n border: 1px solid white;\n}\n.editInfoAuthor {\n float: left;\n margin-left: 5pt;\n font-size: 10pt;\n text-align: left;\n height: 12pt;\n line-height: 12pt;\n}\n.editInfoTime {\n float: right;\n margin-left: 30pt;\n font-size: 8pt;\n font-style: italic;\n color: yellow;\n height: 12pt;\n line-height: 12pt;\n}\n\n.annotationWrapper {\n display: inline;\n position: relative;\n}\n\n.annotationNote {\n width: 4cm;\n position: absolute;\n display: inline;\n z-index: 10;\n}\n.annotationNote > office|annotation {\n display: block;\n}\n\n.annotationConnector {\n position: absolute;\n display: inline;\n z-index: 10;\n border-top: 1px dashed brown;\n}\n.annotationConnector.angular {\n -moz-transform-origin: left top;\n -webkit-transform-origin: left top;\n -ms-transform-origin: left top;\n transform-origin: left top;\n}\n.annotationConnector.horizontal {\n left: 0;\n}\n.annotationConnector.horizontal:before {\n content: '';\n display: inline;\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: brown transparent transparent transparent;\n top: -1px;\n left: -5px;\n}\n\noffice|annotation {\n width: 100%;\n height: 100%;\n display: none;\n background: rgb(198, 238, 184);\n background: -moz-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -webkit-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -o-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -ms-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: linear-gradient(180deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n box-shadow: 0 3px 4px -3px #ccc;\n}\n\noffice|annotation > dc|creator {\n display: block;\n font-size: 10pt;\n font-weight: normal;\n font-style: normal;\n font-family: sans-serif;\n color: white;\n background-color: brown;\n padding: 4px;\n}\noffice|annotation > dc|date {\n display: block;\n font-size: 10pt;\n font-weight: normal;\n font-style: normal;\n font-family: sans-serif;\n border: 4px solid transparent;\n}\noffice|annotation > text|list {\n display: block;\n padding: 5px;\n}\n\n/* This is very temporary CSS. This must go once\n * we start bundling webodf-default ODF styles for annotations.\n */\noffice|annotation text|p {\n font-size: 10pt;\n color: black;\n font-weight: normal;\n font-style: normal;\n text-decoration: none;\n font-family: sans-serif;\n}\n\ndc|*::selection {\n background: transparent;\n}\ndc|*::-moz-selection {\n background: transparent;\n}\n\n#annotationsPane {\n background-color: #EAEAEA;\n width: 4cm;\n height: 100%;\n display: inline-block;\n position: absolute;\n outline: 1px solid #ccc;\n}\n\n.annotationHighlight {\n background-color: yellow;\n position: relative;\n}\n";