// Input 0 /* Copyright (C) 2012 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ var core={},gui={},xmldom={},odf={},ops={}; // Input 1 function Runtime(){}Runtime.ByteArray=function(){};Runtime.prototype.getVariable=function(){};Runtime.prototype.toJson=function(){};Runtime.prototype.fromJson=function(){};Runtime.ByteArray.prototype.slice=function(){};Runtime.ByteArray.prototype.length=0;Runtime.prototype.byteArrayFromArray=function(){};Runtime.prototype.byteArrayFromString=function(){};Runtime.prototype.byteArrayToString=function(){};Runtime.prototype.concatByteArrays=function(){};Runtime.prototype.read=function(){}; Runtime.prototype.readFile=function(){};Runtime.prototype.readFileSync=function(){};Runtime.prototype.loadXML=function(){};Runtime.prototype.writeFile=function(){};Runtime.prototype.isFile=function(){};Runtime.prototype.getFileSize=function(){};Runtime.prototype.deleteFile=function(){};Runtime.prototype.log=function(){};Runtime.prototype.setTimeout=function(){};Runtime.prototype.libraryPaths=function(){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){}; Runtime.prototype.parseXML=function(){};Runtime.prototype.getWindow=function(){};Runtime.prototype.assert=function(){};var IS_COMPILED_CODE=!0; Runtime.byteArrayToString=function(g,k){var m;if("utf8"===k){m="";var f,e=g.length,c,a,b;for(f=0;fc?m+=String.fromCharCode(c):(f+=1,a=g[f],224>c?m+=String.fromCharCode((c&31)<<6|a&63):(f+=1,b=g[f],m+=String.fromCharCode((c&15)<<12|(a&63)<<6|b&63)))}else{"binary"!==k&&this.log("Unsupported encoding: "+k);m="";e=g.length;for(f=0;fl?(h[e]=l,e+=1):2048>l?(h[e]=192|l>>>6,h[e+1]=128|l&63,e+=2):(h[e]=224|l>>>12&15,h[e+1]=128|l>>>6&63,h[e+2]=128|l&63,e+=3)}else{"binary"!==a&&m.log("unknown encoding: "+a);b=c.length;h=new m.ByteArray(b);for(d=0;dh.status||0===h.status?b(null):b("Status "+String(h.status)+": "+h.responseText||h.statusText))};a=a.buffer&&!h.sendAsBinary?a.buffer:m.byteArrayToString(a,"binary");try{h.sendAsBinary?h.sendAsBinary(a):h.send(a)}catch(d){m.log("HUH? "+ d+" "+a),b(d.message)}};this.deleteFile=function(c,a){delete f[c];var b=new XMLHttpRequest;b.open("DELETE",c,!0);b.onreadystatechange=function(){4===b.readyState&&(200>b.status&&300<=b.status?a(b.responseText):a(null))};b.send(null)};this.loadXML=function(c,a){var b=new XMLHttpRequest;b.open("GET",c,!0);b.overrideMimeType&&b.overrideMimeType("text/xml");b.onreadystatechange=function(){4===b.readyState&&(0===b.status&&!b.responseText?a("File "+c+" is empty."):200===b.status||0===b.status?a(null,b.responseXML): a(b.responseText))};try{b.send(null)}catch(h){a(h.message)}};this.isFile=function(c,a){m.getFileSize(c,function(b){a(-1!==b)})};this.getFileSize=function(c,a){var b=new XMLHttpRequest;b.open("HEAD",c,!0);b.onreadystatechange=function(){if(4===b.readyState){var h=b.getResponseHeader("Content-Length");h?a(parseInt(h,10)):a(-1)}};b.send(null)};this.log=k;this.assert=function(c,a,b){if(!c)throw k("alert","ASSERTION FAILED:\n"+a),b&&b(),a;};this.setTimeout=function(c,a){setTimeout(function(){c()},a)}; this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(c){return(new DOMParser).parseFromString(c,"text/xml")};this.exit=function(c){k("Calling exit with code "+String(c)+", but exit() is not implemented.")};this.getWindow=function(){return window};this.getNetwork=function(){var c=this.getVariable("now");return void 0===c?{networkStatus:"unavailable"}: c}} function NodeJSRuntime(){function g(b,a,d){b=f.resolve(e,b);"binary"!==a?m.readFile(b,a,d):m.readFile(b,null,d)}var k=this,m=require("fs"),f=require("path"),e="",c,a;this.ByteArray=function(b){return new Buffer(b)};this.byteArrayFromArray=function(b){var a=new Buffer(b.length),d,l=b.length;for(d=0;d").implementation} function RhinoRuntime(){function g(a,b){var c;void 0!==b?c=a:b=a;"alert"===c&&print("\n!!!!! ALERT !!!!!");print(b);"alert"===c&&print("!!!!! ALERT !!!!!")}var k=this,m=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),f,e,c="";m.setValidating(!1);m.setNamespaceAware(!0);m.setExpandEntityReferences(!1);m.setSchema(null);e=Packages.org.xml.sax.EntityResolver({resolveEntity:function(a,b){var c=new Packages.java.io.FileReader(b);return new Packages.org.xml.sax.InputSource(c)}});f=m.newDocumentBuilder(); f.setEntityResolver(e);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=function(a){var b=[],c,d=a.length;for(c=0;c>>18],a+=r[b>>>12&63],a+=r[b>>>6&63],a+=r[b&63];c===j+1?(b=d[c]<<4,a+=r[b>>>6],a+=r[b&63],a+="=="):c===j&&(b=d[c]<<10|d[c+1]<<2,a+=r[b>>>12],a+=r[b>>>6&63],a+=r[b&63],a+="=");return a}function m(d){d=d.replace(/[^A-Za-z0-9+\/]+/g,"");var b=[],a=d.length%4,c,j=d.length,l;for(c=0;c>16,l>>8&255,l&255);b.length-=[0,0,2,1][a];return b}function f(d){var b=[],a,c=d.length,j;for(a=0;aj?b.push(j):2048>j?b.push(192|j>>>6,128|j&63):b.push(224|j>>>12&15,128|j>>>6&63,128|j&63);return b}function e(d){var b=[],a,c=d.length,j,l,e;for(a=0;aj?b.push(j):(a+=1,l=d[a],224>j?b.push((j&31)<<6|l&63):(a+=1,e=d[a],b.push((j&15)<<12|(l&63)<<6|e&63)));return b}function c(d){return k(g(d))} function a(d){return String.fromCharCode.apply(String,m(d))}function b(d){return e(g(d))}function h(d){d=e(d);for(var b="",a=0;ab?c+=String.fromCharCode(b):(e+=1,j=d.charCodeAt(e)&255,224>b?c+=String.fromCharCode((b&31)<<6|j&63):(e+=1,l=d.charCodeAt(e)&255,c+=String.fromCharCode((b&15)<<12|(j&63)<<6|l&63)));return c}function l(b,a){function c(){var h= e+j;h>b.length&&(h=b.length);l+=d(b,e,h);e=h;h=e===b.length;a(l,h)&&!h&&runtime.setTimeout(c,0)}var j=1E5,l="",e=0;b.lengthw;w+=1)n.push(65+w);for(w=0;26>w;w+=1)n.push(97+w);for(w=0;10>w;w+=1)n.push(48+ w);n.push(43);n.push(47);var x,n=r;w={};var v,G;v=0;for(G=n.length;v>>8):(na(b&255),na(b>>>8))},pa=function(){C=(C<<5^j[A+3-1]&255)&8191;E=w[32768+C];w[A&32767]=E;w[32768+C]=A},U=function(d,b){v>16-b?(x|=d<>16-v,v+=b-16):(x|=d<d;d++)j[d]=j[d+32768];z-=32768;A-=32768;G-=32768;for(d=0;8192>d;d++)b=w[32768+d],w[32768+d]=32768<=b?b-32768:0;for(d=0;32768>d;d++)b=w[d],w[d]=32768<=b?b-32768:0;a+=32768}y||(d=za(j,A+B,a),0>=d?y=!0:B+=d)},Aa=function(d){var b=Q,a=A,c,e=J,l=32506=K&&(b>>=2);do if(c=d,!(j[c+e]!==r||j[c+e-1]!==p||j[c]!==j[a]||j[++c]!==j[a+1])){a+=2;c++;do++a; while(j[a]===j[++c]&&j[++a]===j[++c]&&j[++a]===j[++c]&&j[++a]===j[++c]&&j[++a]===j[++c]&&j[++a]===j[++c]&&j[++a]===j[++c]&&j[++a]===j[++c]&&ae){z=d;e=c;if(258<=c)break;p=j[a+e-1];r=j[a+e]}}while((d=w[d&32767])>l&&0!==--b);return e},ia=function(d,b){n[Z++]=b;0===d?I[b].fc++:(d--,I[da[b]+256+1].fc++,S[(256>d?ba[d]:ba[256+(d>>7)])&255].fc++,r[ka++]=d,X|=$);$<<=1;0===(Z&7)&&(ga[ra++]=X,X=0,$=1);if(2j;j++)a+=S[j].fc*(5+ha[j]); a>>=3;if(ka>=1,a<<=1;while(0<--b);return a>>1},Ca=function(d,b){var a=[];a.length=16;var c=0,j;for(j=1;15>=j;j++)c=c+T[j-1]<<1,a[j]=c;for(c=0;c<=b;c++)j=d[c].dl,0!==j&&(d[c].fc=Ba(a[j]++,j))},wa=function(d){var b=d.dyn_tree,a=d.static_tree,c=d.elems,j,e=-1,l=c;Y=0; ca=573;for(j=0;jY;)j=R[++Y]=2>e?++e:0,b[j].fc=1,W[j]=0,O--,null!==a&&(ea-=a[j].dl);d.max_code=e;for(j=Y>>1;1<=j;j--)va(b,j);do j=R[1],R[1]=R[Y--],va(b,1),a=R[1],R[--ca]=j,R[--ca]=a,b[l].fc=b[j].fc+b[a].fc,W[l]=W[j]>W[a]+1?W[j]:W[a]+1,b[j].dl=b[a].dl=l,R[1]=l++,va(b,1);while(2<=Y);R[--ca]=R[1];l=d.dyn_tree;j=d.extra_bits;var c=d.extra_base,a=d.max_code,h=d.max_length,p=d.static_tree,r,n,f,g,k=0;for(n=0;15>=n;n++)T[n]=0;l[R[ca]].dl=0;for(d=ca+ 1;573>d;d++)r=R[d],n=l[l[r].dl].dl+1,n>h&&(n=h,k++),l[r].dl=n,r>a||(T[n]++,f=0,r>=c&&(f=j[r-c]),g=l[r].fc,O+=g*(n+f),null!==p&&(ea+=g*(p[r].dl+f)));if(0!==k){do{for(n=h-1;0===T[n];)n--;T[n]--;T[n+1]+=2;T[h]--;k-=2}while(0a||(l[j].dl!==n&&(O+=(n-l[j].dl)*l[j].fc,l[j].fc=n),r--)}Ca(b,e)},Da=function(d,b){var a,c=-1,j,l=d[0].dl,e=0,h=7,r=4;0===l&&(h=138,r=3);d[b+1].dl=65535;for(a=0;a<=b;a++)j=l,l=d[a+1].dl,++e=e?H[17].fc++:H[18].fc++,e=0,c=j,0===l?(h=138,r=3):j===l?(h=6,r=3):(h=7,r=4))},Ea=function(){8a?ba[a]:ba[256+(a>>7)])&255,aa(h,b),p=ha[h],0!==p&&(a-=fa[h],U(a,p))),e>>=1;while(c=l?(aa(17,H),U(l-3,3)):(aa(18,H),U(l-11,7));l=0;c=j;0===e?(h=138,r=3):j===e?(h=6,r=3):(h=7,r=4)}},Ha=function(){var d;for(d=0;286>d;d++)I[d].fc=0;for(d=0;30>d;d++)S[d].fc=0;for(d=0;19>d;d++)H[d].fc=0;I[256].fc=1;X=Z=ka=ra=O=ea=0;$=1},qa=function(d){var a,b,c,l;l=A-G;ga[ra]=X;wa(F);wa(L);Da(I,F.max_code);Da(S,L.max_code);wa(V);for(c=18;3<=c&&0===H[xa[c]].dl;c--);O+= 3*(c+1)+14;a=O+3+7>>3;b=ea+3+7>>3;b<=a&&(a=b);if(l+4<=a&&0<=G){U(0+d,3);Ea();oa(l);oa(~l);for(c=0;ca.len&&(r=a.len);for(p=0;pl-q&&(r=l-q);for(p=0;pn;n++){ja[n]=r;for(e= 0;e<1<n;n++){fa[n]=r;for(e=0;e<1<>=7;30>n;n++){fa[n]=r<<7;for(e=0;e<1<=e;e++)T[e]=0;for(e=0;143>=e;)N[e++].dl=8,T[8]++;for(;255>=e;)N[e++].dl=9,T[9]++;for(;279>=e;)N[e++].dl=7,T[7]++;for(;287>=e;)N[e++].dl=8,T[8]++;Ca(N,287);for(e=0;30>e;e++)P[e].dl=5,P[e].fc=Ba(e,5);Ha()}for(e=0;8192>e;e++)w[32768+e]=0;M=ma[t].max_lazy;K=ma[t].good_length;Q=ma[t].max_chain;G=A=0;B=za(j,0,65536);if(0>=B)y= !0,B=0;else{for(y=!1;262>B&&!y;)ua();for(e=C=0;2>e;e++)C=(C<<5^j[e]&255)&8191}a=null;q=l=0;3>=t?(J=2,D=0):(D=2,s=0);p=!1}h=!0;if(0===B)return p=!0,0}if((e=Ia(d,b,c))===c)return c;if(p)return e;if(3>=t)for(;0!==B&&null===a;){pa();0!==E&&32506>=A-E&&(D=Aa(E),D>B&&(D=B));if(3<=D)if(n=ia(A-z,D-3),B-=D,D<=M){D--;do A++,pa();while(0!==--D);A++}else A+=D,D=0,C=j[A]&255,C=(C<<5^j[A+1]&255)&8191;else n=ia(0,j[A]&255),B--,A++;n&&(qa(0),G=A);for(;262>B&&!y;)ua()}else for(;0!==B&&null===a;){pa();J=D;u=z;D=2; 0!==E&&(J=A-E)&&(D=Aa(E),D>B&&(D=B),3===D&&4096B&&!y;)ua()}0===B&&(0!==s&&ia(0,j[A-1]&255),qa(1),p=!0);return e+Ia(d,e+b,c-e)};this.deflate=function(l,p){var f,q;la=l;sa=0;"undefined"===String(typeof p)&&(p=6);(f=p)?1>f?f=1:9f;f++)I[f]=new g;S=[];S.length=61;for(f=0;61>f;f++)S[f]=new g;N=[];N.length=288;for(f=0;288>f;f++)N[f]=new g;P=[];P.length=30;for(f=0;30>f;f++)P[f]=new g;H=[];H.length=39;for(f=0;39>f;f++)H[f]=new g;F=new k;L=new k;V=new k;T=[];T.length=16;R=[];R.length=573;W=[];W.length=573;da=[];da.length=256;ba=[];ba.length=512;ja=[];ja.length=29;fa=[];fa.length=30;ga=[];ga.length=1024}for(var m=Array(1024),x=[];0<(f=Ka(m,0,m.length));){var B= [];B.length=f;for(q=0;q>8&255])};this.appendUInt32LE=function(f){k.appendArray([f&255,f>>8&255,f>>16&255,f>>24&255])};this.appendString=function(f){m=runtime.concatByteArrays(m, runtime.byteArrayFromString(f,g))};this.getLength=function(){return m.length};this.getByteArray=function(){return m}}; // Input 6 core.RawInflate=function(){var g,k,m=null,f,e,c,a,b,h,d,l,q,p,j,r,n,w,x=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],v=[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],G=[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],C=[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],E=[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],u=[16,17,18, 0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s=function(){this.list=this.next=null},D=function(){this.n=this.b=this.e=0;this.t=null},J=function(d,b,a,c,j,e){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var l=Array(this.BMAX+1),h,r,n,p,f,g,q,k=Array(this.BMAX+1),m,w,x,B=new D,y=Array(this.BMAX);p=Array(this.N_MAX);var v,z=Array(this.BMAX+1),Q,M,C;C=this.root=null;for(f=0;ff&&(e=f);for(Q=1<(Q-=l[g])){this.status=2;this.m=e;return}if(0>(Q-=l[f]))this.status=2,this.m=e;else{l[f]+=Q;z[1]=g=0;m=l;w=1;for(x=2;0<--f;)z[x++]=g+=m[w++];m=d;f=w=0;do if(0!=(g=m[w++]))p[z[g]++]=f;while(++fv+k[1+p];){v+=k[1+p];p++;M=(M=n-v)>e?e:M;if((r=1<<(g=q-v))>d+1){r-=d+1;for(x=q;++gh&&v>v-k[p],y[p-1][g].e=B.e,y[p-1][g].b=B.b,y[p-1][g].n=B.n,y[p-1][g].t=B.t)}B.b=q-v;w>=b?B.e=99:m[w]m[w]?16:15,B.n=m[w++]): (B.e=j[m[w]-a],B.n=c[m[w++]-a]);r=1<>v;g>=1)f^=g;for(f^=g;(f&(1<>=d;a-=d},B=function(a,c,e){var h,f,n;if(0==e)return 0;for(n=0;;){A(j);f=q.list[z(j)];for(h=f.e;16 e;e++)k[u[e]]=0;j=7;e=new J(k,19,19,null,null,j);if(0!=e.status)return-1;q=e.root;j=e.m;h=n+g;for(c=l=0;ce)k[c++]=l=e;else if(16==e){A(2);e=3+z(2);y(2);if(c+e>h)return-1;for(;0h)return-1;for(;0L;L++)F[L]=8;for(;256>L;L++)F[L]=9;for(;280>L;L++)F[L]=7;for(;288>L;L++)F[L]=8;e=7;L=new J(F,288,257,v,G,e);if(0!=L.status){alert("HufBuild error: "+L.status);s=-1;break b}m=L.root;e=L.m;for(L=0;30>L;L++)F[L]=5;Q=5;L=new J(F,30,0,C,E,Q);if(1g))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0k))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; // Input 9 runtime.loadClass("core.Selection"); core.Cursor=function(g,k){function m(c){var a=f.nextSibling,b=0;e.parentNode&&(e.parentNode.removeChild(e),a&&3===a.nodeType&&(a.insertData(0,e.nodeValue),b=e.length));c(a,b);f.parentNode&&f.parentNode.removeChild(f)}var f,e;this.getNode=function(){return f};this.getSelection=function(){return g};this.updateToSelection=function(c,a){m(c);if(g.focusNode){var b=g.focusNode,h=g.focusOffset;if(3===b.nodeType){var d=b.parentNode;01/h?"-0":String(h),g(c+" should be "+e+". Was "+a+".")):g(c+" should be "+e+" (of type "+typeof e+"). Was "+h+" (of type "+typeof h+").")}var f=0;this.shouldBeNull=function(e,c){m(e,c,"null")};this.shouldBeNonNull=function(e,c){var a,b;try{b=eval(c)}catch(h){a=h}a?g(c+" should be non-null. Threw exception "+a):null!==b?runtime.log("pass",c+ " is non-null."):g(c+" should be non-null. Was "+b)};this.shouldBe=m;this.countFailedTests=function(){return f}}; core.UnitTester=function(){var g=0,k={};this.runTests=function(m,f){function e(a){if(0===a.length)k[c]=d,g+=b.countFailedTests(),f();else{q=a[0];var l=Runtime.getFunctionName(q);runtime.log("Running "+l);j=b.countFailedTests();h.setUp();q(function(){h.tearDown();d[l]=j===b.countFailedTests();e(a.slice(1))})}}var c=Runtime.getFunctionName(m),a,b=new core.UnitTestRunner,h=new m(b),d={},l,q,p,j;if(k.hasOwnProperty(c))runtime.log("Test "+c+" has already run.");else{runtime.log("Running "+c+": "+h.description()); p=h.tests();for(l=0;ld.length)throw"Error in setPosition: "+a+" > "+d.length;if(0>a)throw"Error in setPosition: "+a+" < 0";if(a===d.length)if(b.nextSibling())h=0;else if(b.parentNode())h=1;else throw"Error in setPosition: position not valid.";return!0}for(var c=a,e=b.firstChild(),j;0>>8^j;return b^-1}function f(d){var a=d.getFullYear();return 1980>a?0:a-1980<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1}function e(d, a){var b,c,e,j,l,h,f,n=this;this.load=function(a){if(void 0!==n.data)a(null,n.data);else{var b=l+34+c+e+256;b+f>p&&(b=p-f);runtime.read(d,f,b,function(b,c){if(b||null===c)a(b,c);else a:{var e=c,f=new core.ByteArray(e),g=f.readUInt32LE(),p;if(67324752!==g)a("File entry signature is wrong."+g.toString()+" "+e.length.toString(),null);else{f.pos+=22;g=f.readUInt16LE();p=f.readUInt16LE();f.pos+=g+p;if(j){e=e.slice(f.pos,f.pos+l);if(l!==e.length){a("The amount of compressed bytes read was "+e.length.toString()+ " instead of "+l.toString()+" for "+n.filename+" in "+d+".",null);break a}e=r(e,h)}else e=e.slice(f.pos,f.pos+h);h!==e.length?a("The amount of bytes read was "+e.length.toString()+" instead of "+h.toString()+" for "+n.filename+" in "+d+".",null):(n.data=e,a(null,e))}}})}};this.set=function(d,a,b,c){n.filename=d;n.data=a;n.compressed=b;n.date=c};this.error=null;a&&(b=a.readUInt32LE(),33639248!==b?this.error="Central directory entry has wrong signature at position "+(a.pos-4).toString()+' for file "'+ d+'": '+a.data.length.toString():(a.pos+=6,j=a.readUInt16LE(),b=a.readUInt32LE(),this.date=new Date((b>>25&127)+1980,(b>>21&15)-1,b>>16&31,b>>11&15,b>>5&63,(b&31)<<1),a.readUInt32LE(),l=a.readUInt32LE(),h=a.readUInt32LE(),c=a.readUInt16LE(),e=a.readUInt16LE(),b=a.readUInt16LE(),a.pos+=8,f=a.readUInt32LE(),this.filename=runtime.byteArrayToString(a.data.slice(a.pos,a.pos+c),"utf8"),a.pos+=c+e+b))}function c(d,a){var b=null,c,e;for(e=0;ep?k("File '"+g+"' cannot be read.",n):runtime.read(g,p-22,22,function(d,a){if(d||null===k||null===a)k(d,n);else if(22!==a.length)k("Central directory length should be 22.",n);else{var b=new core.ByteArray(a),c;c=b.readUInt32LE();101010256!==c?k("Central directory signature is wrong: "+c.toString(),n):(c=b.readUInt16LE(),0!==c?k("Zip files with non-zero disk numbers are not supported.",n):(c=b.readUInt16LE(),0!==c?k("Zip files with non-zero disk numbers are not supported.",n):(c= b.readUInt16LE(),j=b.readUInt16LE(),c!==j?k("Number of entries is inconsistent.",n):(c=b.readUInt32LE(),b=b.readUInt16LE(),b=p-22-c,runtime.read(g,b,p-b,function(d,a){if(d||null===a)k(d,n);else a:{var b=new core.ByteArray(a),c,l;q=[];for(c=0;c"}e+=b}if(1===a||3===a){for(b=f.firstChild;b;)e+=g(c,b),b=b.nextSibling;f.nodeValue&&(e+=f.nodeValue)}1===a&&(c="",1===f.nodeType&&(c+=""),e+=c);return e}var k=this;this.filter=null;this.writeToString=function(k,f){if(!k)return"";var e;if(f){e=f;var c={},a;for(a in e)e.hasOwnProperty(a)&&(c[e[a]]=a);e=c}else e= {};return g(e,k)}}; // Input 19 xmldom.RelaxNGParser=function(){function g(d,a){this.message=function(){a&&(d+=1===a.nodeType?" Element ":" Node ",d+=a.nodeName,a.nodeValue&&(d+=" with value '"+a.nodeValue+"'"),d+=".");return d}}function k(d){if(2>=d.e.length)return d;var a={name:d.name,e:d.e.slice(0,2)};return k({name:d.name,e:[a].concat(d.e.slice(2))})}function m(d){d=d.split(":",2);var a="",c;1===d.length?d=["",d[0]]:a=d[0];for(c in b)b[c]===a&&(d[0]=c);return d}function f(d,a){for(var b=0,c,e,h=d.name;d.e&&b=e.length)return a;0===j&&(j=0);for(var h=e.item(j);h.namespaceURI===b;){j+=1;if(j>=e.length)return a;h=e.item(j)}return h=c(d,a.attDeriv(d,e.item(j)),e,j+1)} function a(d,b,c){c.e[0].a?(d.push(c.e[0].text),b.push(c.e[0].a.ns)):a(d,b,c.e[0]);c.e[1].a?(d.push(c.e[1].text),b.push(c.e[1].a.ns)):a(d,b,c.e[1])}var b="http://www.w3.org/2000/xmlns/",h,d,l,q,p,j,r,n,w,x,v={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return v}},G={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return v}, startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return G},endTagDeriv:function(){return v}},C={type:"text",nullable:!0,hash:"text",textDeriv:function(){return C},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return C},endTagDeriv:function(){return v}},E,u,s;h=f("choice",function(d,a){if(d===v)return a;if(a===v||d===a)return d},function(d,a){var b={},c;e(b,{p1:d,p2:a});a=d=void 0;for(c in b)b.hasOwnProperty(c)&& (void 0===d?d=b[c]:a=void 0===a?b[c]:h(a,b[c]));var j=d,l=a;return{type:"choice",p1:j,p2:l,nullable:j.nullable||l.nullable,textDeriv:function(d,a){return h(j.textDeriv(d,a),l.textDeriv(d,a))},startTagOpenDeriv:m(function(d){return h(j.startTagOpenDeriv(d),l.startTagOpenDeriv(d))}),attDeriv:function(d,a){return h(j.attDeriv(d,a),l.attDeriv(d,a))},startTagCloseDeriv:g(function(){return h(j.startTagCloseDeriv(),l.startTagCloseDeriv())}),endTagDeriv:g(function(){return h(j.endTagDeriv(),l.endTagDeriv())})}}); var D=function(d,a){if(d===v||a===v)return v;if(d===G)return a;if(a===G)return d},J={},A=0;d=function(a,b){var c=D&&D(a,b),e,j;if(void 0!==c)return c;c=a.hash||a.toString();e=b.hash||b.toString();c= f&&b.push(k(a.substring(d,c)))):"["===a[c]&&(0>=f&&(d=c+1),f+=1),c+=1;return c};m.prototype.next=function(){};m.prototype.reset=function(){};l=function(a,d,f){var l,g,k,m;for(l=0;l text|list-item > text|list",e-=1;e=d+" > text|list-item > *:not(text|list):first-child";void 0!==f&&(f=e+"{margin-left:"+f+";}",a.insertRule(f,a.cssRules.length));l=d+" > text|list-item > *:not(text|list):first-child:before{"+c+";";l+="counter-increment:list;";l+="margin-left:"+j+";";l+="width:"+b+";";l+="display:inline-block}";try{a.insertRule(l,a.cssRules.length)}catch(h){throw h;}}function l(e,f,j,h){if("list"===f)for(var g=h.firstChild,k,n;g;){if(g.namespaceURI=== r)if(k=g,"list-level-style-number"===g.localName){n=k;var m=n.getAttributeNS(p,"num-format"),w=n.getAttributeNS(p,"num-suffix"),x="",x={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},P="",P=n.getAttributeNS(p,"num-prefix")||"",P=x.hasOwnProperty(m)?P+(" counter(list, "+x[m]+")"):m?P+("'"+m+"';"):P+" ''";w&&(P+=" '"+w+"'");n=x="content: "+P+";";d(e,j,k,n)}else"list-level-style-image"===g.localName?(n="content: none;",d(e,j,k,n)):"list-level-style-bullet"===g.localName&& (n="content: '"+k.getAttributeNS(r,"bullet-char")+"';",d(e,j,k,n));g=g.nextSibling}else{j=c(f,j,h).join(",");k="";if(g=a(h,p,"text-properties")){m=g;w="";g=""+b(m,v);n=m.getAttributeNS(p,"text-underline-style");"solid"===n&&(w+=" underline");n=m.getAttributeNS(p,"text-line-through-style");"solid"===n&&(w+=" line-through");w.length&&(g+="text-decoration:"+w+";");if(m=m.getAttributeNS(p,"font-name"))n=A[m],g+="font-family: "+(n||m)+";";k+=g}if(g=a(h,p,"paragraph-properties")){n=g;g=""+b(n,C);n=n.getElementsByTagNameNS(p, "background-image");if(0b)break;e=e.nextSibling}a.insertBefore(d,e)}}}function e(a){this.OdfContainer=a}function c(a,d,b){var c=this;this.size=0;this.type=null;this.name=a;this.container=d;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(){if(null!==b){var d=r[a];this.mimetype=d;b.loadAsDataURL(a,d,function(a, d){c.url=d;if(c.onchange)c.onchange(c);if(c.onstatereadychange)c.onstatereadychange(c)})}};this.abort=function(){}}function a(){this.length=0;this.item=function(){}}var b=new odf.StyleInfo,h=new odf.Style2CSS,d="urn:oasis:names:tc:opendocument:xmlns:office:1.0",l="urn:webodf:names:origin",q="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),p=new core.Base64,j=new odf.FontLoader,r={};e.prototype=new function(){};e.prototype.constructor=e;e.namespaceURI=d; e.localName="document";c.prototype.load=function(){};c.prototype.getUrl=function(){return this.data?"data:;base64,"+p.toBase64(this.data):null};odf.OdfContainer=function w(b,k){function p(a){for(var d=a.firstChild,b;d;)b=d.nextSibling,1===d.nodeType?p(d):7===d.nodeType&&a.removeChild(d),d=b}function q(a,d){for(var b=a&&a.firstChild;b;)1===b.nodeType&&b.setAttributeNS(l,"origin",d),b=b.nextSibling}function E(a,d){var b=null,c,e;if(a){b=a.cloneNode(!0);for(c=b.firstChild;c;)e=c.nextSibling,1===c.nodeType&& c.getAttributeNS(l,"origin")!==d&&b.removeChild(c),c=e}return b}function u(a){var d=t.rootElement.ownerDocument,b;if(a){p(a.documentElement);try{b=d.importNode(a.documentElement,!0)}catch(c){}}return b}function s(a){t.state=a;if(t.onchange)t.onchange(t);if(t.onstatereadychange)t.onstatereadychange(t)}function D(a,d){var b="",c;for(c in d)d.hasOwnProperty(c)&&(b+=" xmlns:"+c+'="'+d[c]+'"');return''}function J(){var a=h.namespaces, d=new xmldom.LSSerializer,b=D("document-meta",a);d.filter=new m(t.rootElement);b+=d.writeToString(t.rootElement.meta,a);return b+""}function A(){var a=runtime.parseXML(""), d=new xmldom.LSSerializer;d.filter=new m(t.rootElement);return d.writeToString(a,h.namespaces)}function z(){var a=h.namespaces,d=new xmldom.LSSerializer,b=D("document-settings",a);d.filter=new m(t.rootElement);b+=d.writeToString(t.rootElement.settings,a);return b+""}function y(){var a=h.namespaces,d=new xmldom.LSSerializer,b=E(t.rootElement.automaticStyles,"styles.xml"),c=D("document-styles",a);d.filter=new m(t.rootElement);c+=d.writeToString(t.rootElement.fontFaceDecls, a);c+=d.writeToString(t.rootElement.styles,a);c+=d.writeToString(b,a);c+=d.writeToString(t.rootElement.masterStyles,a);return c+""}function B(){var a=h.namespaces,d=new xmldom.LSSerializer,b=E(t.rootElement.automaticStyles,"content.xml"),c=D("document-content",a);d.filter=new m(t.rootElement);c+=d.writeToString(b,a);c+=d.writeToString(t.rootElement.body,a);return c+""}function Q(){var a,d=new Date;a=runtime.byteArrayFromString(z(),"utf8");K.save("settings.xml", a,!0,d);a=runtime.byteArrayFromString(J(),"utf8");K.save("meta.xml",a,!0,d);a=runtime.byteArrayFromString(y(),"utf8");K.save("styles.xml",a,!0,d);a=runtime.byteArrayFromString(B(),"utf8");K.save("content.xml",a,!0,d);a=runtime.byteArrayFromString(A(),"utf8");K.save("META-INF/manifest.xml",a,!0,d)}function M(a,d){Q();K.writeAs(a,function(a){d(a)})}var t=this,K;this.onstatereadychange=k;this.parts=this.rootElement=this.state=this.onchange=null;this.getPart=function(a){return new c(a,t,K)};this.createByteArray= function(a,d){Q();K.createByteArray(a,d)};this.saveAs=M;this.save=function(a){M(b,a)};this.getUrl=function(){return b};this.state=w.LOADING;var I=document.createElementNS(e.namespaceURI,e.localName),S,N=new e;for(S in N)N.hasOwnProperty(S)&&(I[S]=N[S]);this.rootElement=I;this.parts=new a(this);if(b)K=new core.Zip(b,function(a,c){K=c;a?runtime.loadXML(b,function(b,c){if(b)a&&(K.error=a+"\n"+b,s(w.INVALID));else{var e=u(c);!e||"document"!==e.localName||e.namespaceURI!==d?s(w.INVALID):(t.rootElement= e,e.fontFaceDecls=g(e,d,"font-face-decls"),e.styles=g(e,d,"styles"),e.automaticStyles=g(e,d,"automatic-styles"),e.masterStyles=g(e,d,"master-styles"),e.body=g(e,d,"body"),e.meta=g(e,d,"meta"),s(w.DONE))}}):K.loadAsDOM("styles.xml",function(a,b){var c=u(b),e=t.rootElement;!c||"document-styles"!==c.localName||c.namespaceURI!==d?s(w.INVALID):(e.fontFaceDecls=g(c,d,"font-face-decls"),f(e,e.fontFaceDecls),e.styles=g(c,d,"styles"),f(e,e.styles),e.automaticStyles=g(c,d,"automatic-styles"),q(e.automaticStyles, "styles.xml"),f(e,e.automaticStyles),e.masterStyles=g(c,d,"master-styles"),f(e,e.masterStyles),e.fontFaceDecls&&j.loadFonts(e.fontFaceDecls,K,null));t.state!==w.INVALID&&K.loadAsDOM("content.xml",function(a,b){var c=u(b),e,j,l;if(!c||"document-content"!==c.localName||c.namespaceURI!==d)s(w.INVALID);else{e=t.rootElement;j=g(c,d,"font-face-decls");if(e.fontFaceDecls&&j)for(l=j.firstChild;l;)e.fontFaceDecls.appendChild(l),l=j.firstChild;else j&&(e.fontFaceDecls=j,f(e,j));j=g(c,d,"automatic-styles"); q(j,"content.xml");if(e.automaticStyles&&j)for(l=j.firstChild;l;)e.automaticStyles.appendChild(l),l=j.firstChild;else j&&(e.automaticStyles=j,f(e,j));e.body=g(c,d,"body");f(e,e.body)}t.state!==w.INVALID&&K.loadAsDOM("meta.xml",function(a,b){var c=u(b),e;if(c&&!("document-meta"!==c.localName||c.namespaceURI!==d))e=t.rootElement,e.meta=g(c,d,"meta"),f(e,e.meta);t.state!==w.INVALID&&K.loadAsDOM("settings.xml",function(a,b){if(b){var c=u(b),e;if(c&&!("document-settings"!==c.localName||c.namespaceURI!== d))e=t.rootElement,e.settings=g(c,d,"settings"),f(e,e.settings)}K.loadAsDOM("META-INF/manifest.xml",function(a,d){if(d){var b=u(d),c;if(b&&!("manifest"!==b.localName||"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"!==b.namespaceURI)){c=t.rootElement;c.manifest=b;for(b=c.manifest.firstChild;b;)1===b.nodeType&&("file-entry"===b.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"===b.namespaceURI)&&(r[b.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","full-path")]= b.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","media-type")),b=b.nextSibling}}t.state!==w.INVALID&&s(w.DONE)})})})})})});else{I=new core.Zip("",null);S=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8");var N=t.rootElement,P=document.createElementNS(d,"text");I.save("mimetype",S,!1,new Date);N.body=document.createElementNS(d,"body");N.body.appendChild(P);N.appendChild(N.body);s(w.DONE);K=I}};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 29 odf.Formatting=function(){function g(a){function d(a,d){for(var b=a&&a.firstChild;b&&d;)b=b.nextSibling,d-=1;return b}var b=d(a.startContainer,a.startOffset);d(a.endContainer,a.endOffset);this.next=function(){return null===b?b:null}}function k(a,d){for(var b in d)if(d.hasOwnProperty(b))try{a[b]=d[b].constructor===Object?k(a[b],d[b]):d[b]}catch(c){a[b]=d[b]}return a}function m(a,d,c){for(a=a.firstChild;a;){if(1===a.nodeType&&a.namespaceURI===b.style&&"style"===a.localName&&a.getAttributeNS(b.style, "family")===c&&a.getAttributeNS(b.style,"name")===d)return a;a=a.nextSibling}return null}function f(a){for(var d={},c=a.firstChild;c;){if(1===c.nodeType&&c.namespaceURI===b.style){d[c.nodeName]={};for(a=0;a text|list-item > *:first-child:before {";if(z=y.getAttributeNS(n,"style-name"))y=m[z],O=y.firstChild,y=void 0,"list-level-style-number"===O.localName?(y=O.getAttributeNS(p,"num-format"),z=O.getAttributeNS(p,"num-suffix"),I="",I={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},H=void 0,H=O.getAttributeNS(p,"num-prefix")||"",H=I.hasOwnProperty(y)? H+(" counter(list, "+I[y]+")"):y?H+("'"+y+"';"):H+" ''",z&&(H+=" '"+z+"'"),y=I="content: "+H+";"):"list-level-style-image"===O.localName?y="content: none;":"list-level-style-bullet"===O.localName&&(y="content: '"+O.getAttributeNS(n,"bullet-char")+"';"),O=y;if(F){for(y=k[F];y;)F=y,y=k[F];s+="counter-increment:"+F+";";O?(O=O.replace("list",F),s+=O):s+="content:counter("+F+");"}else F="",O?(O=O.replace("list",u),s+=O):s+="content: counter("+u+");",s+="counter-increment:"+u+";",f.insertRule("text|list#"+ u+" {counter-reset:"+u+"}",f.cssRules.length);s+="}";k[u]=F;s&&f.insertRule(s,f.cssRules.length)}q();f=[J];if(K.hasOwnProperty("statereadychange")){O=K.statereadychange;for(g=0;g @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpAddCursor=function(g){var k,m;this.init=function(f){k=f.memberid;m=f.timestamp};this.execute=function(){var f=g.getOdtDocument(),e=new ops.OdtCursor(k,f);f.addCursor(e);g.emit(ops.Session.signalCursorAdded,e)};this.spec=function(){return{optype:"AddCursor",memberid:k,timestamp:m}}}; // Input 34 /* Copyright (C) 2012 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpRemoveCursor=function(g){var k,m;this.init=function(f){k=f.memberid;m=f.timestamp};this.execute=function(){g.getOdtDocument().removeCursor(k);g.emit(ops.Session.signalCursorRemoved,k)};this.spec=function(){return{optype:"RemoveCursor",memberid:k,timestamp:m}}}; // Input 35 /* Copyright (C) 2012 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpMoveCursor=function(g){var k,m,f;this.init=function(e){k=e.memberid;m=e.timestamp;f=e.number};this.execute=function(){var e=g.getOdtDocument(),c=e.getCursor(k),e=e.getPositionFilter(),a;runtime.assert(void 0!==c,"cursor for ["+k+"] not found (MoveCursor).");a=c.getStepCounter();if(0f)e=-a.countBackwardSteps(-f,e);else return;c.move(e);g.emit(ops.Session.signalCursorMoved,c)};this.spec=function(){return{optype:"MoveCursor",memberid:k,timestamp:m,number:f}}}; // Input 36 /* Copyright (C) 2012 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpInsertText=function(g){var k,m,f,e;this.init=function(c){k=c.memberid;m=c.timestamp;f=c.position;e=c.text};this.execute=function(){g.getOdtDocument().insertText(k,m,f,e)};this.spec=function(){return{optype:"InsertText",memberid:k,timestamp:m,position:f,text:e}}}; // Input 37 ops.OpRemoveText=function(g){var k,m,f,e,c;this.init=function(a){k=a.memberid;m=a.timestamp;f=a.position;e=a.length;c=a.text};this.execute=function(){g.getOdtDocument().removeText(k,m,f,e)};this.spec=function(){return{optype:"RemoveText",memberid:k,timestamp:m,position:f,length:e,text:c}}}; // Input 38 ops.OpSplitParagraph=function(g){var k,m,f;this.init=function(e){k=e.memberid;m=e.timestamp;f=e.position};this.execute=function(){var e=g.getOdtDocument(),c,a,b,h,d;if(c=e.getPositionInTextNode(f))if(a=e.getParagraphElement(c.textNode)){0===c.offset?(d=c.textNode.previousSibling,b=null):(c.textNode.nextSibling&&("urn:webodf:names:cursor"===c.textNode.nextSibling.namespaceURI&&"cursor"===c.textNode.nextSibling.localName)&&(b=c.textNode.cloneNode(!1),c.textNode.parentNode.insertBefore(b,c.textNode), c.textNode.parentNode.removeChild(c.textNode),c.textNode="",c.textNode=b),d=c.textNode,b=c.offset>=c.textNode.length?null:c.textNode.splitText(c.offset));for(c=c.textNode;c!==a;)if(c=c.parentNode,h=c.cloneNode(!1),d){for(b&&h.appendChild(b);d.nextSibling;)h.appendChild(d.nextSibling);c.parentNode.insertBefore(h,c.nextSibling);d=c;b=h}else c.parentNode.insertBefore(h,c),d=h,b=c;e.emit("paragraphEdited",{element:a,memberId:k,timeStamp:m});e.emit("paragraphEdited",{element:b,memberId:k,timeStamp:m})}}; this.spec=function(){return{optype:"SplitParagraph",memberid:k,timestamp:m,position:f}}}; // Input 39 ops.OpSetParagraphStyle=function(g){var k,m,f,e,c;this.init=function(a){k=a.memberid;m=a.timestamp;f=a.position;e=a.styleNameBefore;c=a.styleNameAfter};this.execute=function(){var a,b=g.getOdtDocument();b.setParagraphStyle(k,m,f,e,c);if(a=b.getPositionInTextNode(f))a=b.getParagraphElement(a.textNode),g.emit(ops.Session.signalParagraphChanged,a)};this.spec=function(){return{optype:"SetParagraphStyle",memberid:k,timestamp:m,position:f,styleNameBefore:e,styleNameAfter:c}}}; // Input 40 ops.OpUpdateParagraphStyle=function(g){var k,m,f,e,c;this.init=function(a){k=a.memberid;m=a.timestamp;f=a.position;e=a.styleName;c=a.info};this.execute=function(){g.getOdtDocument().updateParagraphStyle(e,c);g.emit(ops.Session.signalParagraphStyleModified,e)};this.spec=function(){return{optype:"UpdateParagraphStyle",memberid:k,timestamp:m,position:f,styleName:e,info:c}}}; // Input 41 ops.OpCloneStyle=function(g){var k,m,f,e,c;this.init=function(a){k=a.memberid;m=a.timestamp;f=a.styleName;e=a.newStyleName;c=a.newStyleDisplayName};this.execute=function(){var a=g.getOdtDocument(),b=a.getParagraphStyleElement(f),h=b.cloneNode(!0);h.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:name",e);h.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:display-name",c);b.parentNode.appendChild(h);a.getOdfCanvas().refreshCSS();g.emit(ops.Session.signalStyleCreated, e)};this.spec=function(){return{optype:"CloneStyle",memberid:k,timestamp:m,styleName:f,newStyleName:e,newStyleDisplayName:c}}}; // Input 42 ops.OpDeleteStyle=function(g){var k,m,f;this.init=function(e){k=e.memberid;m=e.timestamp;f=e.styleName};this.execute=function(){g.getOdtDocument().deleteStyle(f);g.emit(ops.Session.signalStyleDeleted,f)};this.spec=function(){return{optype:"DeleteStyle",memberid:k,timestamp:m,styleName:f}}}; // Input 43 runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpCloneStyle");runtime.loadClass("ops.OpDeleteStyle"); ops.OperationFactory=function(g){this.create=function(k){var m=null;"AddCursor"===k.optype?m=new ops.OpAddCursor(g):"InsertText"===k.optype?m=new ops.OpInsertText(g):"RemoveText"===k.optype?m=new ops.OpRemoveText(g):"SplitParagraph"===k.optype?m=new ops.OpSplitParagraph(g):"SetParagraphStyle"===k.optype?m=new ops.OpSetParagraphStyle(g):"UpdateParagraphStyle"===k.optype?m=new ops.OpUpdateParagraphStyle(g):"CloneStyle"===k.optype?m=new ops.OpCloneStyle(g):"DeleteStyle"===k.optype?m=new ops.OpDeleteStyle(g): "MoveCursor"===k.optype?m=new ops.OpMoveCursor(g):"RemoveCursor"===k.optype&&(m=new ops.OpRemoveCursor(g));m&&m.init(k);return m}}; // Input 44 runtime.loadClass("core.Cursor"); ops.OdtCursor=function(g,k){var m=this,f,e;this.removeFromOdtDocument=function(){e.remove(function(){})};this.move=function(a){var b=0;0=a&&(b=-f.movePointBackward(-a));m.handleUpdate();return b};this.handleUpdate=function(){};this.getStepCounter=function(){return f.getStepCounter()};this.getMemberId=function(){return g};this.getNode=function(){return e.getNode()};this.getSelection=function(){return e.getSelection()};this.getOdtDocument=function(){return k};var c;c=new core.Selection(k.getDOM()); e=new core.Cursor(c,k.getDOM());e.getNode().setAttributeNS("urn:webodf:names:cursor","memberId",g);f=k.getSelectionManager().createSelectionMover(e)}; // Input 45 runtime.loadClass("core.Cursor");runtime.loadClass("core.PositionIterator");runtime.loadClass("core.PositionFilter");runtime.loadClass("core.LoopWatchDog"); gui.SelectionMover=function(g,k,m,f){function e(a,b,d){b=a;f=f||q.adaptToCursorRemoval;m=m||q.adaptToInsertedCursor;for(g.remove(f);0h){for(;j.nextPosition();)if(l.check(),1===c.acceptPosition(j)&&(g+=1),j.container()===a&&j.offset()===b)return j.setPosition(e,f),g;j.setPosition(e,f)}else if(0x.scrollTop+x.clientHeight-1&&(x.scrollTop=k-x.clientHeight+1);ex.scrollLeft+x.clientWidth-1&&(x.scrollLeft= d-x.clientWidth+1)};var d=g.getOdtDocument().getDOM();f=d.createElementNS(d.documentElement.namespaceURI,"span");c=g.getNode();c.appendChild(f);e=new gui.Avatar(c)}; // Input 48 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"); gui.SessionController=function(){gui.SessionController=function(g,k){function m(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function f(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function e(a){f(a)}function c(){var a=runtime.getWindow().getSelection(),b,c=g.getOdtDocument(),e=c.getOdfCanvas().getElement();for(b=a.focusNode;b!==e;){if("urn:webodf:names:cursor"===b.namespaceURI&&"cursor"===b.localName)return;b=b.parentNode}a=c.getDistanceFromCursor(k, a.focusNode,a.focusOffset);0!==a&&(b=new ops.OpMoveCursor(g),b.init({memberid:k,number:a}),g.enqueue(b))}function a(a){var b=new ops.OpMoveCursor(g);b.init({memberid:k,number:a});return b}function b(b){var c=b.keyCode,e=null,h=!1;37===c?(e=a(-1),h=!0):39===c?(e=a(1),h=!0):38===c?(e=a(-10),h=!0):40===c?(e=a(10),h=!0):36===c?(e=g.getOdtDocument(),c=null,h=e.getParagraphElement(e.getCursor(k).getNode()),e=e.getDistanceFromCursor(k,h,0),0!==e&&(c=new ops.OpMoveCursor(g),c.init({memberid:k,number:e})), e=c,h=!0):35===c?h=!0:8===c?(c=g.getOdtDocument(),e=c.getCursorPosition(k),h=null,c.getPositionInTextNode(e-1)&&(h=new ops.OpRemoveText(g),h.init({memberid:k,position:e,length:-1})),e=h,h=null!==e):46===c&&(c=g.getOdtDocument(),e=c.getCursorPosition(k),h=null,c.getPositionInTextNode(e+1)&&(h=new ops.OpRemoveText(g),h.init({memberid:k,position:e,length:1})),e=h,h=null!==e);e&&g.enqueue(e);h&&f(b)}function h(a){var b,c;c=null===a.which?String.fromCharCode(a.keyCode):0!==a.which&&0!==a.charCode?String.fromCharCode(a.which): null;13===a.keyCode?(b=g.getOdtDocument().getCursorPosition(k),c=new ops.OpSplitParagraph(g),c.init({memberid:k,position:b}),g.enqueue(c),f(a)):c&&(!a.altKey&&!a.ctrlKey&&!a.metaKey)&&(b=new ops.OpInsertText(g),b.init({memberid:k,position:g.getOdtDocument().getCursorPosition(k),text:c}),g.enqueue(b),f(a))}new odf.Style2CSS;this.startListening=function(){var a=g.getOdtDocument().getOdfCanvas().getElement();m(a,"keydown",b);m(a,"keypress",h);m(a,"keyup",e);m(a,"copy",e);m(a,"cut",e);m(a,"paste",e); m(a,"click",c)};this.startEditing=function(){var a=new ops.OpAddCursor(g);a.init({memberid:k});g.enqueue(a)};this.endEditing=function(){var a=new ops.OpRemoveCursor(g);a.init({memberid:k});g.enqueue(a)};this.getInputMemberId=function(){return k};this.getSession=function(){return g}};return gui.SessionController}(); // Input 49 runtime.loadClass("gui.SelectionMover");gui.SelectionManager=function(g){function k(e,c){var a;for(a=0;a @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.TrivialUserModel=function(){var g={bob:{memberid:"bob",fullname:"Bob Pigeon",color:"red",imageurl:"avatar-pigeon.png"},alice:{memberid:"alice",fullname:"Alice Bee",color:"green",imageurl:"avatar-flower.png"},you:{memberid:"you",fullname:"I, Robot",color:"blue",imageurl:"avatar-joe.png"}};this.getUserDetailsAndUpdates=function(k,m){var f=k.split("___")[0];m(k,g[f]||null)};this.unsubscribeUserDetailsUpdates=function(){}}; // Input 52 ops.NowjsUserModel=function(){var g={},k={},m=runtime.getNetwork();this.getUserDetailsAndUpdates=function(f,e){var c=f.split("___")[0],a=g[c],b=k[c]=k[c]||[],h;runtime.assert(void 0!==e,"missing callback");for(h=0;h @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.TrivialOperationRouter=function(){var g=this;this.setOperationFactory=function(k){g.op_factory=k};this.setPlaybackFunction=function(k){g.playback_func=k};this.push=function(k){k=k.spec();k.timestamp=(new Date).getTime();k=g.op_factory.create(k);g.playback_func(k)}}; // Input 54 ops.NowjsOperationRouter=function(g,k){function m(d){var e;e=f.op_factory.create(d);runtime.log(" op in: "+runtime.toJson(d));if(null!==e)if(d=Number(d.server_seq),runtime.assert(!isNaN(d),"server seq is not a number"),d===c+1){f.playback_func(e);c=d;b=0;for(e=c+1;a.hasOwnProperty(e);e+=1)f.playback_func(a[e]),delete a[e],runtime.log("op with server seq "+d+" taken from hold (reordered)")}else runtime.assert(d!==c+1,"received incorrect order from server"),runtime.assert(!a.hasOwnProperty(d),"reorder_queue has incoming op"), runtime.log("op with server seq "+d+" put on hold"),a[d]=e;else runtime.log("ignoring invalid incoming opspec: "+d)}var f=this,e=runtime.getNetwork(),c=-1,a={},b=0,h=1E3;this.setOperationFactory=function(a){f.op_factory=a};this.setPlaybackFunction=function(a){f.playback_func=a};e.ping=function(a){null!==k&&a(k)};e.receiveOp=function(a,b){a===g&&m(b)};this.push=function(a){a=a.spec();runtime.assert(null!==k,"Router sequence N/A without memberid");h+=1;a.client_nonce="C:"+k+":"+h;a.parent_op=c+"+"+ b;b+=1;runtime.log("op out: "+runtime.toJson(a));e.deliverOp(g,a)};this.requestReplay=function(a){e.requestReplay(g,function(a){runtime.log("replaying: "+runtime.toJson(a));m(a)},function(b){runtime.log("replay done ("+b+" ops).");a&&a()})};e.memberid=k;e.joinSession(g,function(a){runtime.assert(a,"Trying to join a session which does not exists or where we are already in")})}; // Input 55 gui.EditInfoHandle=function(g){var k=[],m,f=g.ownerDocument,e=f.documentElement.namespaceURI;this.setEdits=function(c){k=c;var a,b,g,d;m.innerHTML="";for(c=0;cl?(k(1,0),a=k(0.5,1E4-l),b=k(0.2,2E4-l)):1E4<=l&&2E4>l?(k(0.5,0),b=k(0.2,2E4-l)):k(0.2,0)};this.getEdits=function(){return g.getEdits()};this.clearEdits=function(){g.clearEdits(); e.setEdits([]);c.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&c.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return g};this.showHandle=function(){e.show()};this.hideHandle=function(){e.hide()};f=g.getOdtDocument().getDOM();c=f.createElementNS(f.documentElement.namespaceURI,"div");c.setAttribute("class","editInfoMarker");c.onmouseover=function(){m.showHandle()};c.onmouseout=function(){m.hideHandle()};f=g.getNode();f.appendChild(c); e=new gui.EditInfoHandle(f)}; // Input 57 /* Copyright (C) 2012 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("gui.Caret");runtime.loadClass("ops.TrivialUserModel");runtime.loadClass("core.EditInfo");runtime.loadClass("gui.EditInfoMarker"); gui.SessionView=function(){return function(g,k){function m(a,b,c){c=c.split("___")[0];return a+"."+b+'[editinfo|memberid^="'+c+'"]'}function f(b,f){var g=e[b];if(void 0===f)runtime.log('UserModel sent undefined data for member "'+b+'".');else if(null===f&&(f={memberid:b,fullname:"Unknown Identity",color:"black",imageurl:"avatar-joe.png"}),g&&(g.setAvatarImageUrl(f.imageurl),g.setColor(f.color)),a){var g=f.fullname,h=f.color,j=function(a,e,f){f=m(a,e,b)+f;a:{var j=c.firstChild;for(a=m(a,e,b);j;){if(3=== j.nodeType&&0===j.data.indexOf(a)){a=j;break a}j=j.nextSibling}a=null}a?a.data=f:c.appendChild(document.createTextNode(f))};j("div","editInfoMarker","{ background-color: "+h+"; }");j("span","editInfoColor","{ background-color: "+h+"; }");j("span","editInfoAuthor",':before { content: "'+g+'"; }')}}var e={},c,a=!0,b={};g.getOdtDocument().subscribe("paragraphEdited",function(a){var c=a.element,e=a.memberId;a=a.timeStamp;var f,j="";g.getUserModel();var h=c.getElementsByTagNameNS("urn:webodf:names:editinfo", "editinfo")[0];h?(j=h.getAttributeNS("urn:webodf:names:editinfo","id"),f=b[j]):(j=Math.random().toString(),f=new core.EditInfo(c,g.getOdtDocument()),f=new gui.EditInfoMarker(f),h=c.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0],h.setAttributeNS("urn:webodf:names:editinfo","id",j),b[j]=f);f.addEdit(e,new Date(a))});this.enableEditHighlighting=function(){a||(a=!0)};this.disableEditHighlighting=function(){a&&(a=!1)};this.getSession=function(){return g};this.getCaret=function(a){return e[a]}; var h=document.getElementsByTagName("head")[0];g.subscribe(ops.Session.signalCursorAdded,function(a){var b=k.createCaret(a);a=a.getMemberId();var c=g.getUserModel();e[a]=b;f(a,null);c.getUserDetailsAndUpdates(a,f);runtime.log("+++ View here +++ eagerly created an Caret for '"+a+"'! +++")});g.subscribe(ops.Session.signalCursorRemoved,function(a){delete e[a]});c=document.createElementNS(h.namespaceURI,"style");c.type="text/css";c.media="screen, print, handheld, projection";c.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);")); h.appendChild(c)}}(); // Input 58 /* Copyright (C) 2012 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("gui.Caret");gui.CaretFactory=function(g){this.createCaret=function(k){var m=k.getMemberId(),f=g.getSession().getOdtDocument(),e=f.getOdfCanvas().getElement(),c=new gui.Caret(k);m===g.getInputMemberId()&&(runtime.log("Starting to track input on new cursor of "+m),f.subscribe("paragraphEdited",function(a){a.memberId===m&&c.ensureVisible()}),k.handleUpdate=c.ensureVisible,e.setAttribute("tabindex",0),e.onfocus=c.setFocus,e.onblur=c.removeFocus,e.focus(),g.startListening());return c}}; // Input 59 runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Style2CSS"); gui.PresenterUI=function(){var g=new odf.Style2CSS,k=new xmldom.XPath,m=g.namespaceResolver;return function(f){var e=this;e.setInitialSlideMode=function(){e.startSlideMode("single")};e.keyDownHandler=function(c){if(!c.target.isContentEditable&&"input"!==c.target.nodeName)switch(c.keyCode){case 84:e.toggleToolbar();break;case 37:case 8:e.prevSlide();break;case 39:case 32:e.nextSlide();break;case 36:e.firstSlide();break;case 35:e.lastSlide()}};e.root=function(){return e.odf_canvas.odfContainer().rootElement}; e.firstSlide=function(){e.slideChange(function(){return 0})};e.lastSlide=function(){e.slideChange(function(c,a){return a-1})};e.nextSlide=function(){e.slideChange(function(c,a){return c+1c?-1:c-1})};e.slideChange=function(c){var a=e.getPages(e.odf_canvas.odfContainer().rootElement),b=-1,f=0;a.forEach(function(a){a=a[1];a.hasAttribute("slide_current")&&(b=f,a.removeAttribute("slide_current"));f+=1});c=c(b,a.length);-1===c&&(c=b); a[c][1].setAttribute("slide_current","1");document.getElementById("pagelist").selectedIndex=c;"cont"===e.slide_mode&&window.scrollBy(0,a[c][1].getBoundingClientRect().top-30)};e.selectSlide=function(c){e.slideChange(function(a,b){return c>=b||0>c?-1:c})};e.scrollIntoContView=function(c){var a=e.getPages(e.odf_canvas.odfContainer().rootElement);0!==a.length&&window.scrollBy(0,a[c][1].getBoundingClientRect().top-30)};e.getPages=function(c){c=c.getElementsByTagNameNS(m("draw"),"page");var a=[],b;for(b= 0;b=a.rangeCount)&&p)&&(a=a.getRangeAt(0),p.setPoint(a.startContainer,a.startOffset))}function c(){var a=g.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();p&&p.node()&&(b=p.node(),c=b.ownerDocument.createRange(), c.setStart(b,p.position()),c.collapse(!0),a.addRange(c))}function a(b){for(var c=b.firstChild;c&&c!==b;)1===c.nodeType&&a(c),c=c.nextSibling||c.parentNode;var d,e,f,c=b.attributes;d="";for(f=c.length-1;0<=f;f-=1)e=c.item(f),d=d+" "+e.nodeName+'="'+e.nodeValue+'"';b.setAttribute("customns_name",b.nodeName);b.setAttribute("customns_atts",d);c=b.firstChild;for(e=/^\s*$/;c&&c!==b;)d=c,c=c.nextSibling||c.parentNode,3===d.nodeType&&e.test(d.nodeValue)&&d.parentNode.removeChild(d)}function b(a,c){for(var d= a.firstChild,e,f,g;d&&d!==a;){if(1===d.nodeType){b(d,c);e=d.attributes;for(g=e.length-1;0<=g;g-=1)f=e.item(g),"http://www.w3.org/2000/xmlns/"===f.namespaceURI&&!c[f.nodeValue]&&(c[f.nodeValue]=f.localName)}d=d.nextSibling||d.parentNode}}function h(){var a=g.ownerDocument.createElement("style"),c;c={};b(g,c);var e={},f,h,l=0;for(f in c)if(c.hasOwnProperty(f)&&f){h=c[f];if(!h||e.hasOwnProperty(h)||"xmlns"===h){do h="ns"+l,l+=1;while(e.hasOwnProperty(h));c[f]=h}e[h]=!0}a.type="text/css";c="@namespace customns url(customns);\n"+ d;a.appendChild(g.ownerDocument.createTextNode(c));k=k.parentNode.replaceChild(a,k)}var d,l,q,p=null;g.id||(g.id="xml"+String(Math.random()).substring(2));l="#"+g.id+" ";d=l+"*,"+l+":visited, "+l+":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"+l+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+ l+":after {color: blue; content: '';}\n"+l+"{overflow: auto;}\n";l=g;m(l,"click",function(a){g.ownerDocument.defaultView.getSelection().getRangeAt(0);f(a)});m(l,"keydown",function(a){var b=a.charCode||a.keyCode;if(p=null,p&&37===b)e(),p.stepBackward(),c();else if(16<=b&&20>=b||33<=b&&40>=b)return;f(a)});m(l,"keypress",function(){});m(l,"drop",f);m(l,"dragend",f);m(l,"beforepaste",f);m(l,"paste",f);this.updateCSS=h;this.setXML=function(b){b=b.documentElement||b;q=b=g.ownerDocument.importNode(b, !0);for(a(b);g.lastChild;)g.removeChild(g.lastChild);g.appendChild(b);h();p=new core.PositionIterator(b)};this.getXML=function(){return q}}; // Input 61 ops.SessionPointFilter=function(){this.acceptNode=function(){return 1}}; // Input 62 runtime.loadClass("ops.TrivialOperationRouter");runtime.loadClass("gui.SelectionManager"); ops.OdtDocument=function(g){function k(a){var c=gui.SelectionMover.createPositionIterator(b),e=null,f,g=0;a+=1;1===d.acceptPosition(c)&&(f=c.container(),3===f.nodeType?(e=f,g=0):0===a&&(e=b.ownerDocument.createTextNode(""),f.insertBefore(e,null),g=0));for(;0e)e=-e,d=k(d-e);else{d=k(d+1);if(1!==d.offset)return runtime.log("unexpected!"),!1;d.offset-=1}return d?(d.textNode.deleteData(d.offset,e),c.emit("paragraphEdited",{element:m(d.textNode),memberId:a,timeStamp:b}),!0):!1};this.setParagraphStyle=function(b,d,e,f,g){var h;h=k(e); runtime.log("Setting paragraph style:"+h+" -- "+e+" "+f+"->"+g);return h&&(e=m(h.textNode))?(e.setAttributeNS(a,"text:style-name",g),c.emit("paragraphEdited",{element:e,timeStamp:d,memberId:b}),!0):!1};this.updateParagraphStyle=function(a,c){var d,h,k;if(d=f(a)){h=d.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","paragraph-properties")[0];k=d.getElementsByTagNameNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","text-properties")[0];void 0===h&&c.paragraphProperties&& (h=b.ownerDocument.createElementNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:paragraph-properties"),d.appendChild(h));void 0===k&&c.textProperties&&(k=b.ownerDocument.createElementNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:text-properties"),d.appendChild(k));c.paragraphProperties&&(e(h,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","fo:margin-top",c.paragraphProperties.topMargin,"mm"),e(h,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0", "fo:margin-bottom",c.paragraphProperties.bottomMargin,"mm"),e(h,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","fo:margin-left",c.paragraphProperties.leftMargin,"mm"),e(h,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","fo:margin-right",c.paragraphProperties.rightMargin,"mm"),e(h,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","fo:text-align",c.paragraphProperties.textAlign));if(c.textProperties){e(k,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0", "fo:font-size",c.textProperties.fontSize,"pt");d=c.textProperties.fontName;d=g.getFormatting().getFontMap().hasOwnProperty(d)?!0:!1;if(!d){h=d=c.textProperties.fontName;var l;d&&h&&(l=b.ownerDocument.createElementNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:font-face"),l.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:name",d),l.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","svg:font-family",h),g.odfContainer().rootElement.fontFaceDecls.appendChild(l))}e(k, "urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:font-name",c.textProperties.fontName);e(k,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","fo:color",c.textProperties.color);e(k,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","fo:background-color",c.textProperties.backgroundColor);e(k,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","fo:font-weight",c.textProperties.fontWeight);e(k,"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","fo:font-style", c.textProperties.fontStyle);e(k,"urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:text-underline-style",c.textProperties.underline);e(k,"urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:text-line-through-style",c.textProperties.strikethrough)}g.refreshCSS();return!0}return!1};this.deleteStyle=function(a){a=f(a);a.parentNode.removeChild(a);g.refreshCSS()};this.getCursor=function(a){return l[a]};this.getCursors=function(){var a=[],b;for(b in l)l.hasOwnProperty(b)&&a.push(l[b]);return a}; this.addCursor=function(a){var b=a.getStepCounter().countForwardSteps(1,d);a.move(b);l[a.getMemberId()]=a};this.removeCursor=function(a){var b=l[a];b&&(b.removeFromOdtDocument(),delete l[a])};this.getMetaData=function(a){for(var b=g.odfContainer().rootElement.firstChild;b&&"meta"!==b.localName;)b=b.nextSibling;for(b=b&&b.firstChild;b&&b.localName!==a;)b=b.nextSibling;for(b=b&&b.firstChild;b&&3!==b.nodeType;)b=b.nextSibling;return b?b.data:null};this.getFormatting=function(){return g.getFormatting()}; this.emit=function(a,b){var c,d;runtime.assert(q.hasOwnProperty(a),'unknown event fired "'+a+'"');d=q[a];for(c=0;c 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}\ncursor|cursor > span {\n display: inline;\n position: absolute;\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";