// 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(h){};Runtime.prototype.getVariable=function(h){};Runtime.prototype.toJson=function(h){};Runtime.prototype.fromJson=function(h){};Runtime.ByteArray.prototype.slice=function(h,m){};Runtime.ByteArray.prototype.length=0;Runtime.prototype.byteArrayFromArray=function(h){};Runtime.prototype.byteArrayFromString=function(h,m){};Runtime.prototype.byteArrayToString=function(h,m){};Runtime.prototype.concatByteArrays=function(h,m){}; Runtime.prototype.read=function(h,m,f,n){};Runtime.prototype.readFile=function(h,m,f){};Runtime.prototype.readFileSync=function(h,m){};Runtime.prototype.loadXML=function(h,m){};Runtime.prototype.writeFile=function(h,m,f){};Runtime.prototype.isFile=function(h,m){};Runtime.prototype.getFileSize=function(h,m){};Runtime.prototype.deleteFile=function(h,m){};Runtime.prototype.log=function(h,m){};Runtime.prototype.setTimeout=function(h,m){};Runtime.prototype.libraryPaths=function(){}; Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.parseXML=function(h){};Runtime.prototype.getWindow=function(){};Runtime.prototype.assert=function(h,m,f){};var IS_COMPILED_CODE=!0; Runtime.byteArrayToString=function(h,m){function f(e){var a="",g,d=e.length;for(g=0;gb?a+=String.fromCharCode(b):(g+=1,r=e[g],194<=b&&224>b?a+=String.fromCharCode((b&31)<<6|r&63):(g+=1,k=e[g],224<=b&&240>b?a+=String.fromCharCode((b&15)<<12|(r&63)<<6|k&63):(g+=1,l=e[g],240<=b&&245>b&&(b=(b&7)<<18|(r&63)<<12|(k&63)<<6|l&63,b-=65536,a+=String.fromCharCode((b>>10)+55296,(b&1023)+56320))))); return a}var q;"utf8"===m?q=n(h):("binary"!==m&&this.log("Unsupported encoding: "+m),q=f(h));return q};Runtime.getVariable=function(h){try{return eval(h)}catch(m){}};Runtime.toJson=function(h){return JSON.stringify(h)};Runtime.fromJson=function(h){return JSON.parse(h)};Runtime.getFunctionName=function(h){return void 0===h.name?(h=/function\s+(\w+)/.exec(h))&&h[1]:h.name}; function BrowserRuntime(h){function m(e,a){var g,d,b;void 0!==a?b=e:a=e;h?(d=h.ownerDocument,b&&(g=d.createElement("span"),g.className=b,g.appendChild(d.createTextNode(b)),h.appendChild(g),h.appendChild(d.createTextNode(" "))),g=d.createElement("span"),0r?(d[k]=r,k+=1):2048>r?(d[k]=192|r>>>6,d[k+1]=128|r&63,k+=2):(d[k]=224|r>>>12&15,d[k+1]=128|r>>>6&63,d[k+2]=128|r&63,k+=3)}else for("binary"!==a&&f.log("unknown encoding: "+a),g=e.length,d=new f.ByteArray(g),b=0;bd.status||0===d.status?g(null):g("Status "+String(d.status)+": "+d.responseText||d.statusText):g("File "+e+" is empty."))}; a=a.buffer&&!d.sendAsBinary?a.buffer:f.byteArrayToString(a,"binary");try{d.sendAsBinary?d.sendAsBinary(a):d.send(a)}catch(b){f.log("HUH? "+b+" "+a),g(b.message)}};this.deleteFile=function(e,a){delete n[e];var g=new XMLHttpRequest;g.open("DELETE",e,!0);g.onreadystatechange=function(){4===g.readyState&&(200>g.status&&300<=g.status?a(g.responseText):a(null))};g.send(null)};this.loadXML=function(e,a){var g=new XMLHttpRequest;g.open("GET",e,!0);g.overrideMimeType&&g.overrideMimeType("text/xml");g.onreadystatechange= function(){4===g.readyState&&(0!==g.status||g.responseText?200===g.status||0===g.status?a(null,g.responseXML):a(g.responseText):a("File "+e+" is empty."))};try{g.send(null)}catch(d){a(d.message)}};this.isFile=function(e,a){f.getFileSize(e,function(g){a(-1!==g)})};this.getFileSize=function(e,a){var g=new XMLHttpRequest;g.open("HEAD",e,!0);g.onreadystatechange=function(){if(4===g.readyState){var d=g.getResponseHeader("Content-Length");d?a(parseInt(d,10)):a(-1)}};g.send(null)};this.log=m;this.assert= function(e,a,g){if(!e)throw m("alert","ASSERTION FAILED:\n"+a),g&&g(),a;};this.setTimeout=function(e,a){setTimeout(function(){e()},a)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(e){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(e){return(new DOMParser).parseFromString(e,"text/xml")};this.exit=function(e){m("Calling exit with code "+String(e)+", but exit() is not implemented.")}; this.getWindow=function(){return window}} function NodeJSRuntime(){function h(a,d,b){a=n.resolve(q,a);"binary"!==d?f.readFile(a,d,b):f.readFile(a,null,b)}var m=this,f=require("fs"),n=require("path"),q="",e,a;this.ByteArray=function(a){return new Buffer(a)};this.byteArrayFromArray=function(a){var d=new Buffer(a.length),b,r=a.length;for(b=0;b").implementation} function RhinoRuntime(){function h(a,g){var d;void 0!==g?d=a:g=a;"alert"===d&&print("\n!!!!! ALERT !!!!!");print(g);"alert"===d&&print("!!!!! ALERT !!!!!")}var m=this,f=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),n,q,e="";f.setValidating(!1);f.setNamespaceAware(!0);f.setExpandEntityReferences(!1);f.setSchema(null);q=Packages.org.xml.sax.EntityResolver({resolveEntity:function(a,g){var d=new Packages.java.io.FileReader(g);return new Packages.org.xml.sax.InputSource(d)}});n=f.newDocumentBuilder(); n.setEntityResolver(q);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=function(a,g){var d=[],b,e=a.length;for(b=0;b>>18],c+=u[a>>>12&63],c+=u[a>>>6&63],c+=u[a&63];k===p+1?(a=b[k]<<4,c+=u[a>>>6],c+=u[a&63],c+="=="):k===p&&(a=b[k]<<10|b[k+1]<<2,c+=u[a>>>12],c+=u[a>>>6&63],c+=u[a&63],c+="=");return c}function f(b){b=b.replace(/[^A-Za-z0-9+\/]+/g,"");var a=[],c=b.length%4,k,p=b.length,d;for(k=0;k>16,d>>8&255,d&255);a.length-=[0,0,2,1][c];return a}function n(b){var a=[],c,k=b.length,p;for(c=0;cp?a.push(p):2048>p?a.push(192|p>>>6,128|p&63):a.push(224|p>>>12&15,128|p>>>6&63,128|p&63);return a}function q(b){var a=[],c,k=b.length,p,d,l;for(c=0;cp?a.push(p):(c+=1,d=b[c],224>p?a.push((p&31)<<6|d&63):(c+=1,l=b[c],a.push((p&15)<<12|(d&63)<<6|l&63)));return a}function e(b){return m(h(b))} function a(b){return String.fromCharCode.apply(String,f(b))}function g(b){return q(h(b))}function d(b){b=q(b);for(var a="",c=0;ca?k+=String.fromCharCode(a):(l+=1,p=b.charCodeAt(l)&255,224>a?k+=String.fromCharCode((a&31)<<6|p&63):(l+=1,d=b.charCodeAt(l)&255,k+=String.fromCharCode((a&15)<<12|(p&63)<<6|d&63)));return k}function r(a,c){function k(){var e= l+p;e>a.length&&(e=a.length);d+=b(a,l,e);l=e;e=l===a.length;c(d,e)&&!e&&runtime.setTimeout(k,0)}var p=1E5,d="",l=0;a.lengtha;a+=1)b.push(65+a);for(a=0;26>a;a+=1)b.push(97+a);for(a= 0;10>a;a+=1)b.push(48+a);b.push(43);b.push(47);return b})();var t=function(b){var a={},c,k;c=0;for(k=b.length;c>>8):(oa(a&255),oa(a>>>8))},qa=function(){v=(v<<5^c[z+3-1]&255)&8191;x=s[32768+v];s[z&32767]=x;s[32768+v]=z},da=function(b,a){C>16-a?(p|=b<>16-C,C+=a-16):(p|=b<b;b++)c[b]=c[b+32768];H-=32768;z-=32768;y-=32768;for(b=0;8192>b;b++)a=s[32768+b],s[32768+b]=32768<=a?a-32768:0;for(b=0;32768>b;b++)a=s[b],s[b]=32768<=a?a-32768:0;k+=32768}D||(b=Aa(c,z+G,k),0>=b?D=!0:G+=b)},Ba=function(b){var a=T,k=z,p,d=O,l=32506=ca&&(a>>=2);do if(p=b,c[p+d]===g&&c[p+d-1]===t&&c[p]===c[k]&&c[++p]===c[k+1]){k+= 2;p++;do++k;while(c[k]===c[++p]&&c[++k]===c[++p]&&c[++k]===c[++p]&&c[++k]===c[++p]&&c[++k]===c[++p]&&c[++k]===c[++p]&&c[++k]===c[++p]&&c[++k]===c[++p]&&kd){H=b;d=p;if(258<=p)break;t=c[k+d-1];g=c[k+d]}}while((b=s[b&32767])>l&&0!==--a);return d},la=function(b,a){t[Z++]=a;0===b?U[a].fc++:(b--,U[w[a]+256+1].fc++,W[(256>b?aa[b]:aa[256+(b>>7)])&255].fc++,u[X++]=b,ha|=ja);ja<<=1;0===(Z&7)&&(L[sa++]=ha,ha=0,ja=1);if(2p;p++)c+=W[p].fc* (5+ka[p]);c>>=3;if(X>=1,c<<=1;while(0<--a);return c>>1},Da=function(b,a){var c=[];c.length=16;var k=0,p;for(p=1;15>=p;p++)k=k+P[p-1]<<1,c[p]=k;for(k=0;k<=a;k++)p=b[k].dl,0!==p&&(b[k].fc=Ca(c[p]++,p))},xa=function(b){var a=b.dyn_tree,c=b.static_tree,k=b.elems,p,d=-1, l=k;Y=0;E=573;for(p=0;pY;)p=Q[++Y]=2>d?++d:0,a[p].fc=1,$[p]=0,ea--,null!==c&&(ia-=c[p].dl);b.max_code=d;for(p=Y>>1;1<=p;p--)wa(a,p);do p=Q[1],Q[1]=Q[Y--],wa(a,1),c=Q[1],Q[--E]=p,Q[--E]=c,a[l].fc=a[p].fc+a[c].fc,$[l]=$[p]>$[c]+1?$[p]:$[c]+1,a[p].dl=a[c].dl=l,Q[1]=l++,wa(a,1);while(2<=Y);Q[--E]=Q[1];l=b.dyn_tree;p=b.extra_bits;var k=b.extra_base,c=b.max_code,e=b.max_length,t=b.static_tree,g,s,f,r,u=0;for(s=0;15>=s;s++)P[s]=0;l[Q[E]].dl=0;for(b= E+1;573>b;b++)g=Q[b],s=l[l[g].dl].dl+1,s>e&&(s=e,u++),l[g].dl=s,g>c||(P[s]++,f=0,g>=k&&(f=p[g-k]),r=l[g].fc,ea+=r*(s+f),null!==t&&(ia+=r*(t[g].dl+f)));if(0!==u){do{for(s=e-1;0===P[s];)s--;P[s]--;P[s+1]+=2;P[e]--;u-=2}while(0c||(l[p].dl!==s&&(ea+=(s-l[p].dl)*l[p].fc,l[p].fc=s),g--)}Da(a,d)},Ea=function(b,a){var c,k=-1,p,l=b[0].dl,d=0,e=7,s=4;0===l&&(e=138,s=3);b[a+1].dl=65535;for(c=0;c<=a;c++)p=l,l=b[c+1].dl,++d=d?R[17].fc++:R[18].fc++,d=0,k=p,0===l?(e=138,s=3):p===l?(e=6,s=3):(e=7,s=4))},Fa=function(){8c?aa[c]:aa[256+(c>>7)])&255,fa(e,a),s=ka[e],0!==s&&(c-=K[e],da(c,s))),d>>=1;while(k=l?(fa(17,R),da(l-3,3)):(fa(18,R),da(l-11,7));l=0;k=p;0===d?(e=138,s=3):p===d?(e=6,s=3):(e=7,s=4)}},Ia=function(){var b;for(b=0;286>b;b++)U[b].fc=0;for(b=0;30>b;b++)W[b].fc=0;for(b=0;19>b;b++)R[b].fc=0;U[256].fc=1;ha=Z=X=sa=ea=ia=0;ja=1},ra=function(b){var a,p,k,l;l=z-y;L[sa]=ha;xa(I);xa(B);Ea(U,I.max_code);Ea(W,B.max_code);xa(J);for(k=18;3<=k&&0===R[ya[k]].dl;k--); ea+=3*(k+1)+14;a=ea+3+7>>3;p=ia+3+7>>3;p<=a&&(a=p);if(l+4<=a&&0<=y)for(da(0+b,3),Fa(),pa(l),pa(~l),k=0;ka.len&&(s=a.len);for(t=0;tr-k&&(s=r-k);for(t=0;tu;u++)for(ga[u]= f,g=0;g<1<u;u++)for(K[u]=f,g=0;g<1<>=7;30>u;u++)for(K[u]=f<<7,g=0;g<1<=g;g++)P[g]=0;for(g=0;143>=g;)M[g++].dl=8,P[8]++;for(;255>=g;)M[g++].dl=9,P[9]++;for(;279>=g;)M[g++].dl=7,P[7]++;for(;287>=g;)M[g++].dl=8,P[8]++;Da(M,287);for(g=0;30>g;g++)S[g].dl=5,S[g].fc=Ca(g,5);Ia()}for(g=0;8192>g;g++)s[32768+g]=0;ba=na[V].max_lazy;ca=na[V].good_length;T=na[V].max_chain;y=z=0;G=Aa(c,0,65536);if(0>=G)D= !0,G=0;else{for(D=!1;262>G&&!D;)va();for(g=v=0;2>g;g++)v=(v<<5^c[g]&255)&8191}a=null;k=r=0;3>=V?(O=2,F=0):(F=2,A=0);l=!1}d=!0;if(0===G)return l=!0,0}if((g=Ja(b,e,t))===t)return t;if(l)return g;if(3>=V)for(;0!==G&&null===a;){qa();0!==x&&32506>=z-x&&(F=Ba(x),F>G&&(F=G));if(3<=F)if(u=la(z-H,F-3),G-=F,F<=ba){F--;do z++,qa();while(0!==--F);z++}else z+=F,F=0,v=c[z]&255,v=(v<<5^c[z+1]&255)&8191;else u=la(0,c[z]&255),G--,z++;u&&(ra(0),y=z);for(;262>G&&!D;)va()}else for(;0!==G&&null===a;){qa();O=F;N=H;F=2; 0!==x&&(O=z-x)&&(F=Ba(x),F>G&&(F=G),3===F&&4096G&&!D;)va()}0===G&&(0!==A&&la(0,c[z-1]&255),ra(1),l=!0);return g+Ja(b,g+e,t-g)};this.deflate=function(k,p){var l,f;ma=k;ta=0;"undefined"===String(typeof p)&&(p=6);(l=p)?1>l?l=1:9l;l++)U[l]=new h;W=[];W.length=61;for(l=0;61>l;l++)W[l]=new h;M=[];M.length=288;for(l=0;288>l;l++)M[l]=new h;S=[];S.length=30;for(l=0;30>l;l++)S[l]=new h;R=[];R.length=39;for(l=0;39>l;l++)R[l]=new h;I=new m;B=new m;J=new m;P=[];P.length=16;Q=[];Q.length=573;$=[];$.length=573;w=[];w.length=256;aa=[];aa.length=512;ga=[];ga.length=29;K=[];K.length=30;L=[];L.length=1024}for(var r=Array(1024),n=[];0<(l=La(r,0,r.length));){var v= [];v.length=l;for(f=0;f>8&255])};this.appendUInt32LE=function(f){m.appendArray([f&255,f>>8&255,f>>16&255,f>>24&255])};this.appendString=function(m){f=runtime.concatByteArrays(f, runtime.byteArrayFromString(m,h))};this.getLength=function(){return f.length};this.getByteArray=function(){return f}}; // Input 6 core.RawInflate=function(){var h,m,f=null,n,q,e,a,g,d,b,r,k,l,c,u,t,s,p=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],C=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],v=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],x=[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],N=[16,17,18, 0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],A=function(){this.list=this.next=null},F=function(){this.n=this.b=this.e=0;this.t=null},O=function(b,a,c,p,k,l){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var d=Array(this.BMAX+1),e,s,g,t,f,u,r,m=Array(this.BMAX+1),q,n,h,v=new F,C=Array(this.BMAX);t=Array(this.N_MAX);var y,x=Array(this.BMAX+1),G,z,D;D=this.root=null;for(f=0;ff&&(l=f);for(G=1<(G-=d[u])){this.status=2;this.m=l;return}if(0>(G-=d[f]))this.status=2,this.m=l;else{d[f]+=G;x[1]=u=0;q=d;n=1;for(h=2;0<--f;)x[h++]=u+=q[n++];q=b;f=n=0;do 0!=(u=q[n++])&&(t[x[u]++]=f);while(++fy+m[1+t];){y+=m[1+t];t++;z=(z=g-y)>l?l:z;if((s=1<<(u=r-y))>b+1)for(s-=b+1,h=r;++ue&&y>y-m[t],C[t-1][u].e=v.e,C[t-1][u].b=v.b,C[t-1][u].n=v.n,C[t-1][u].t=v.t)}v.b=r-y;n>=a?v.e=99:q[n]q[n]?16:15,v.n=q[n++]): (v.e=k[q[n]-c],v.n=p[q[n++]-c]);s=1<>y;u>=1)f^=u;for(f^=u;(f&(1<>=b;a-=b},G=function(a,p,d){var s,e,t;if(0==d)return 0;for(t=0;;){z(c);e=k.list[H(c)];for(s=e.e;16 s;s++)q[N[s]]=0;c=7;s=new O(q,19,19,null,null,c);if(0!=s.status)return-1;k=s.root;c=s.m;t=f+r;for(d=e=0;ds)q[d++]=e=s;else if(16==s){z(2);s=3+H(2);D(2);if(d+s>t)return-1;for(;0t)return-1;for(;0B;B++)I[B]=8;for(;256>B;B++)I[B]=9;for(;280>B;B++)I[B]=7;for(;288>B;B++)I[B]=8;q=7;B=new O(I,288,257,C,y,q);if(0!=B.status){alert("HufBuild error: "+B.status);M=-1;break b}f=B.root;q=B.m;for(B=0;30>B;B++)I[B]=5;T=5;B=new O(I,30,0,v,x,T);if(1 @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/ */ core.LoopWatchDog=function(h,m){var f=Date.now(),n=0;this.check=function(){var q;if(h&&(q=Date.now(),q-f>h))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0m))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; // Input 8 core.DomUtils=function(){function h(m,f){if(m.nodeType===Node.TEXT_NODE)if(0===m.length)m.parentNode.removeChild(m);else if(f.nodeType===Node.TEXT_NODE)return f.insertData(0,m.data),m.parentNode.removeChild(m),f;return m}this.splitBoundaries=function(m){var f=[],n;0!==m.endOffset&&(m.endContainer.nodeType===Node.TEXT_NODE&&m.endOffset!==m.endContainer.length)&&(f.push(m.endContainer.splitText(m.endOffset)),f.push(m.endContainer));0!==m.startOffset&&(m.startContainer.nodeType===Node.TEXT_NODE&&m.startOffset!== m.startContainer.length)&&(n=m.startContainer.splitText(m.startOffset),f.push(m.startContainer),f.push(n),m.setStart(n,0));return f};this.normalizeTextNodes=function(m){m&&m.nextSibling&&(m=h(m,m.nextSibling));m&&m.previousSibling&&h(m.previousSibling,m)};this.rangeContainsNode=function(m,f){var n=f.ownerDocument.createRange(),q=f.nodeType===Node.TEXT_NODE?f.length:f.childNodes.length;n.setStart(m.startContainer,m.startOffset);n.setEnd(m.endContainer,m.endOffset);q=0===n.comparePoint(f,0)&&0===n.comparePoint(f, q);n.detach();return q};this.mergeIntoParent=function(m){for(var f=m.parentNode;m.firstChild;)f.insertBefore(m.firstChild,m);f.removeChild(m);return f};this.getElementsByTagNameNS=function(m,f,n){return Array.prototype.slice.call(m.getElementsByTagNameNS(f,n))}}; // Input 9 runtime.loadClass("core.DomUtils"); core.Cursor=function(h,m){function f(b){b.parentNode&&(g.push(b.previousSibling),g.push(b.nextSibling),b.parentNode.removeChild(b))}function n(b,a,c){if(a.nodeType===Node.TEXT_NODE){runtime.assert(Boolean(a),"putCursorIntoTextNode: invalid container");var d=a.parentNode;runtime.assert(Boolean(d),"putCursorIntoTextNode: container without parent");runtime.assert(0<=c&&c<=a.length,"putCursorIntoTextNode: offset is out of bounds");0===c?d.insertBefore(b,a):(c!==a.length&&a.splitText(c),d.insertBefore(b, a.nextSibling))}else if(a.nodeType===Node.ELEMENT_NODE){runtime.assert(Boolean(a),"putCursorIntoContainer: invalid container");for(d=a.firstChild;null!==d&&0 @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ core.EventNotifier=function(h){var m={};this.emit=function(f,n){var q,e;runtime.assert(m.hasOwnProperty(f),'unknown event fired "'+f+'"');e=m[f];for(q=0;q1/l?"-0":String(l),h(b+" should be "+a+". Was "+e+".")):h(b+" should be "+a+" (of type "+typeof a+"). Was "+l+" (of type "+typeof l+").")}var a=0,g;g=function(a,b){var e=Object.keys(a),k=Object.keys(b);e.sort();k.sort();return m(e,k)&&Object.keys(a).every(function(k){var c= a[k],e=b[k];return q(c,e)?!0:(h(c+" should be "+e+" for key "+k),!1)})};this.areNodesEqual=n;this.shouldBeNull=function(a,b){e(a,b,"null")};this.shouldBeNonNull=function(a,b){var e,k;try{k=eval(b)}catch(l){e=l}e?h(b+" should be non-null. Threw exception "+e):null!==k?runtime.log("pass",b+" is non-null."):h(b+" should be non-null. Was "+k)};this.shouldBe=e;this.countFailedTests=function(){return a}}; core.UnitTester=function(){function h(f,q){return""+f+""}var m=0,f={};this.runTests=function(n,q,e){function a(c){if(0===c.length)f[g]=r,m+=d.countFailedTests(),q();else{l=c[0];var p=Runtime.getFunctionName(l);runtime.log("Running "+p);u=d.countFailedTests();b.setUp();l(function(){b.tearDown();r[p]=u===d.countFailedTests();a(c.slice(1))})}}var g=Runtime.getFunctionName(n),d=new core.UnitTestRunner,b=new n(d),r={},k,l,c,u,t="BrowserRuntime"=== runtime.type();if(f.hasOwnProperty(g))runtime.log("Test "+g+" has already run.");else{t?runtime.log("Running "+h(g,'runSuite("'+g+'");')+": "+b.description()+""):runtime.log("Running "+g+": "+b.description);c=b.tests();for(k=0;kRunning "+h(n,'runTest("'+g+'","'+n+'")')+""):runtime.log("Running "+n),u=d.countFailedTests(),b.setUp(),l(),b.tearDown(),r[n]=u===d.countFailedTests()); a(b.asyncTests())}};this.countFailedTests=function(){return m};this.results=function(){return f}}; // Input 12 core.PositionIterator=function(h,m,f,n){function q(){this.acceptNode=function(b){return b.nodeType===Node.TEXT_NODE&&0===b.length?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}function e(b){this.acceptNode=function(a){return a.nodeType===Node.TEXT_NODE&&0===a.length?NodeFilter.FILTER_REJECT:b.acceptNode(a)}}function a(){var a=d.currentNode.nodeType;b=a===Node.TEXT_NODE?d.currentNode.length-1:a===Node.ELEMENT_NODE?1:0}var g=this,d,b,r;this.nextPosition=function(){if(d.currentNode===h)return!1; if(0===b&&d.currentNode.nodeType===Node.ELEMENT_NODE)null===d.firstChild()&&(b=1);else if(d.currentNode.nodeType===Node.TEXT_NODE&&b+1 "+a.length),runtime.assert(0<=l,"Error in setPosition: "+l+" < 0"),l===a.length&&(b=void 0,d.nextSibling()?b=0:d.parentNode()&&(b=1),runtime.assert(void 0!==b,"Error in setPosition: position not valid.")),!0;c=r(a);l>>8^d;return c^-1}function n(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 q(a){var b=a.getFullYear();return 1980>b?0:b-1980<< 25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function e(a,b){var c,p,d,l,k,e,g,t=this;this.load=function(b){if(void 0!==t.data)b(null,t.data);else{var c=k+34+p+d+256;c+g>u&&(c=u-g);runtime.read(a,g,c,function(c,p){if(c||null===p)b(c,p);else a:{var d=p,g=new core.ByteArray(d),f=g.readUInt32LE(),u;if(67324752!==f)b("File entry signature is wrong."+f.toString()+" "+d.length.toString(),null);else{g.pos+=22;f=g.readUInt16LE();u=g.readUInt16LE();g.pos+=f+u; if(l){d=d.slice(g.pos,g.pos+k);if(k!==d.length){b("The amount of compressed bytes read was "+d.length.toString()+" instead of "+k.toString()+" for "+t.filename+" in "+a+".",null);break a}d=s(d,e)}else d=d.slice(g.pos,g.pos+e);e!==d.length?b("The amount of bytes read was "+d.length.toString()+" instead of "+e.toString()+" for "+t.filename+" in "+a+".",null):(t.data=d,b(null,d))}}})}};this.set=function(a,b,c,p){t.filename=a;t.data=b;t.compressed=c;t.date=p};this.error=null;b&&(c=b.readUInt32LE(),33639248!== c?this.error="Central directory entry has wrong signature at position "+(b.pos-4).toString()+' for file "'+a+'": '+b.data.length.toString():(b.pos+=6,l=b.readUInt16LE(),this.date=n(b.readUInt32LE()),b.readUInt32LE(),k=b.readUInt32LE(),e=b.readUInt32LE(),p=b.readUInt16LE(),d=b.readUInt16LE(),c=b.readUInt16LE(),b.pos+=8,g=b.readUInt32LE(),this.filename=runtime.byteArrayToString(b.data.slice(b.pos,b.pos+p),"utf8"),b.pos+=p+d+c))}function a(a,b){if(22!==a.length)b("Central directory length should be 22.", p);else{var d=new core.ByteArray(a),l;l=d.readUInt32LE();101010256!==l?b("Central directory signature is wrong: "+l.toString(),p):(l=d.readUInt16LE(),0!==l?b("Zip files with non-zero disk numbers are not supported.",p):(l=d.readUInt16LE(),0!==l?b("Zip files with non-zero disk numbers are not supported.",p):(l=d.readUInt16LE(),t=d.readUInt16LE(),l!==t?b("Number of entries is inconsistent.",p):(l=d.readUInt32LE(),d=d.readUInt16LE(),d=u-22-l,runtime.read(h,d,u-d,function(a,d){if(a||null===d)b(a,p);else a:{var l= new core.ByteArray(d),k,s;c=[];for(k=0;ku?m("File '"+h+"' cannot be read.",p):runtime.read(h,u-22,22,function(b,c){b||null===m||null===c?m(b,p):a(c,m)})})}; // Input 16 core.CSSUnits=function(){var h={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(m,f,n){return m*h[n]/h[f]};this.convertMeasure=function(m,f){var n,q;m&&f?(n=parseFloat(m),q=m.replace(n.toString(),""),n=this.convert(n,q,f)):n="";return n.toString()};this.getUnits=function(m){return m.substr(m.length-2,m.length)}}; // Input 17 xmldom.LSSerializerFilter=function(){}; // Input 18 "function"!==typeof Object.create&&(Object.create=function(h){var m=function(){};m.prototype=h;return new m}); xmldom.LSSerializer=function(){function h(f){var e=f||{},a=function(a){var b={},d;for(d in a)a.hasOwnProperty(d)&&(b[a[d]]=d);return b}(f),g=[e],d=[a],b=0;this.push=function(){b+=1;e=g[b]=Object.create(e);a=d[b]=Object.create(a)};this.pop=function(){g[b]=void 0;d[b]=void 0;b-=1;e=g[b];a=d[b]};this.getLocalNamespaceDefinitions=function(){return a};this.getQName=function(b){var d=b.namespaceURI,l=0,c;if(!d)return b.localName;if(c=a[d])return c+":"+b.localName;do{c||!b.prefix?(c="ns"+l,l+=1):c=b.prefix; if(e[c]===d)break;if(!e[c]){e[c]=d;a[d]=c;break}c=null}while(null===c);return c+":"+b.localName}}function m(f){return f.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function f(q,e){var a="",g=n.filter?n.filter.acceptNode(e):NodeFilter.FILTER_ACCEPT,d;if(g===NodeFilter.FILTER_ACCEPT&&e.nodeType===Node.ELEMENT_NODE){q.push();d=q.getQName(e);var b,r=e.attributes,k,l,c,u="",t;b="<"+d;k=r.length;for(l=0;l")}if(g===NodeFilter.FILTER_ACCEPT||g===NodeFilter.FILTER_SKIP){for(g=e.firstChild;g;)a+=f(q,g),g=g.nextSibling;e.nodeValue&&(a+=m(e.nodeValue))}d&&(a+="",q.pop());return a}var n=this;this.filter=null;this.writeToString=function(q,e){if(!q)return"";var a=new h(e);return f(a,q)}}; // Input 19 xmldom.RelaxNGParser=function(){function h(a,d){this.message=function(){d&&(a+=1===d.nodeType?" Element ":" Node ",a+=d.nodeName,d.nodeValue&&(a+=" with value '"+d.nodeValue+"'"),a+=".");return a}}function m(a){if(2>=a.e.length)return a;var d={name:a.name,e:a.e.slice(0,2)};return m({name:a.name,e:[d].concat(a.e.slice(2))})}function f(a){a=a.split(":",2);var d="",k;1===a.length?a=["",a[0]]:d=a[0];for(k in g)g[k]===d&&(a[0]=k);return a}function n(a,d){for(var k=0,l,c,e=a.name;a.e&&k=p.length)return c;0===d&&(d=0);for(var l=p.item(d);l.namespaceURI===b;){d+=1;if(d>=p.length)return c;l=p.item(d)}return l=g(a,c.attDeriv(a,p.item(d)),p,d+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 b="http://www.w3.org/2000/xmlns/",r,k,l,c,u,t,s,p,C,y,v={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return v}},x={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return v},startTagOpenDeriv:function(){return v},attDeriv:function(a,b){return v},startTagCloseDeriv:function(){return x},endTagDeriv:function(){return v}}, N={type:"text",nullable:!0,hash:"text",textDeriv:function(){return N},startTagOpenDeriv:function(){return v},attDeriv:function(){return v},startTagCloseDeriv:function(){return N},endTagDeriv:function(){return v}},A,F,O;r=n("choice",function(a,b){if(a===v)return b;if(b===v||a===b)return a},function(a,b){var c={},p;q(c,{p1:a,p2:b});b=a=void 0;for(p in c)c.hasOwnProperty(p)&&(void 0===a?a=c[p]:b=void 0===b?c[p]:r(b,c[p]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, textDeriv:function(c,p){return r(a.textDeriv(c,p),b.textDeriv(c,p))},startTagOpenDeriv:f(function(c){return r(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,p){return r(a.attDeriv(c,p),b.attDeriv(c,p))},startTagCloseDeriv:h(function(){return r(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:h(function(){return r(a.endTagDeriv(),b.endTagDeriv())})}}(a,b)});k=function(a,b,c){return function(){var p={},d=0;return function(l,k){var e=b&&b(l,k),s,g;if(void 0!==e)return e; e=l.hash||l.toString();s=k.hash||k.toString();eNode.ELEMENT_NODE;){if(b!==Node.COMMENT_NODE&&(b!==Node.TEXT_NODE||!/^\s+$/.test(g.currentNode.nodeValue)))return[new h("Not allowed node of type "+ b+".")];b=(d=g.nextSibling())?d.nodeType:0}if(!d)return[new h("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(e[d.namespaceURI]+":"+d.localName))return[new h("Found "+d.nodeName+" instead of "+a.names+".",d)];if(g.firstChild()){for(f=m(a.e[1],g,d);g.nextSibling();)if(b=g.currentNode.nodeType,!(g.currentNode&&g.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(g.currentNode.nodeValue)||b===Node.COMMENT_NODE))return[new h("Spurious content.",g.currentNode)];if(g.parentNode()!==d)return[new h("Implementation error.")]}else f= m(a.e[1],g,d);g.nextSibling();return f}var n,q,e;q=function(a,e,d,b){var n=a.name,k=null;if("text"===n)a:{for(var l=(a=e.currentNode)?a.nodeType:0;a!==d&&3!==l;){if(1===l){k=[new h("Element not allowed here.",a)];break a}l=(a=e.nextSibling())?a.nodeType:0}e.nextSibling();k=null}else if("data"===n)k=null;else if("value"===n)b!==a.text&&(k=[new h("Wrong value, should be '"+a.text+"', not '"+b+"'",d)]);else if("list"===n)k=null;else if("attribute"===n)a:{if(2!==a.e.length)throw"Attribute with wrong # of elements: "+ a.e.length;n=a.localnames.length;for(k=0;k=s&&c.push(m(a.substring(b,d)))):"["===a[d]&&(0>=s&&(b=d+1),s+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};b=function(b,d,c){var e,f,s,p;for(e=0;e @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/ */ odf.Namespaces=function(){function h(f){return m[f]||null}var m={draw:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",fo:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",office:"urn:oasis:names:tc:opendocument:xmlns:office:1.0",presentation:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",style:"urn:oasis:names:tc:opendocument:xmlns:style:1.0",svg:"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",table:"urn:oasis:names:tc:opendocument:xmlns:table:1.0",text:"urn:oasis:names:tc:opendocument:xmlns:text:1.0", xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},f;h.lookupNamespaceURI=h;f=function(){};f.forEachPrefix=function(f){for(var q in m)m.hasOwnProperty(q)&&f(q,m[q])};f.resolvePrefix=h;f.namespaceMap=m;f.drawns="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0";f.fons="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";f.officens="urn:oasis:names:tc:opendocument:xmlns:office:1.0";f.presentationns="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0";f.stylens= "urn:oasis:names:tc:opendocument:xmlns:style:1.0";f.svgns="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";f.tablens="urn:oasis:names:tc:opendocument:xmlns:table:1.0";f.textns="urn:oasis:names:tc:opendocument:xmlns:text:1.0";f.xlinkns="http://www.w3.org/1999/xlink";f.xmlns="http://www.w3.org/XML/1998/namespace";return f}(); // Input 26 runtime.loadClass("xmldom.XPath"); odf.StyleInfo=function(){function h(a,b){for(var c=l[a.localName],p=c&&c[a.namespaceURI],d=p?p.length:0,e,c=0;c @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/ */ odf.OdfUtils=function(){function h(a){var b=a&&a.localName;return("p"===b||"h"===b)&&a.namespaceURI===u}function m(a){return/^[ \t\r\n]+$/.test(a)}function f(a){var b=a&&a.localName;return("span"===b||"p"===b||"h"===b)&&a.namespaceURI===u}function n(a){var b=a&&a.localName,c,d=!1;b&&(c=a.namespaceURI,c===u?d="s"===b||"tab"===b||"line-break"===b:c===t&&(d="frame"===b&&"as-char"===a.getAttributeNS(u,"anchor-type")));return d}function q(a){for(;null!==a.firstChild&&f(a);)a=a.firstChild;return a}function e(a){for(;null!== a.lastChild&&f(a);)a=a.lastChild;return a}function a(a){for(;!h(a)&&null===a.previousSibling;)a=a.parentNode;return h(a)?null:e(a.previousSibling)}function g(a){for(;!h(a)&&null===a.nextSibling;)a=a.parentNode;return h(a)?null:q(a.nextSibling)}function d(b){for(var c=!1;b;)if(b.nodeType===Node.TEXT_NODE)if(0===b.length)b=a(b);else return!m(b.data.substr(b.length-1,1));else if(n(b)){c=!0;break}else b=a(b);return c}function b(b){var c=!1;for(b=b&&e(b);b;){if(b.nodeType===Node.TEXT_NODE&&0=b.value||"%"===b.unit)?null:b;return b||c(a)};this.parseFoLineHeight=function(a){var b;b=(b=l(a))&&(0>b.value||"%"=== b.unit)?null:b;return b||c(a)};this.getTextNodes=function(a,b){var c=a.startContainer.ownerDocument,d=c.createRange(),e=[],l;l=c.createTreeWalker(a.commonAncestorContainer.nodeType===Node.TEXT_NODE?a.commonAncestorContainer.parentNode:a.commonAncestorContainer,NodeFilter.SHOW_ALL,function(c){d.selectNodeContents(c);if(!1===b&&c.nodeType===Node.TEXT_NODE){if(0>=a.compareBoundaryPoints(a.START_TO_START,d)&&0<=a.compareBoundaryPoints(a.END_TO_END,d))return NodeFilter.FILTER_ACCEPT}else if(-1===a.compareBoundaryPoints(a.END_TO_START, d)&&1===a.compareBoundaryPoints(a.START_TO_END,d))return c.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT},!1);l.currentNode=a.startContainer.previousSibling||a.startContainer.parentNode;for(c=l.nextNode();c;)e.push(c),c=l.nextNode();d.detach();return e}}; // Input 28 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.DomUtils");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.Namespaces");runtime.loadClass("odf.OdfUtils"); odf.TextStyleApplicator=function(h,m,f){function n(a){function b(a,d){return"object"===typeof a&&"object"===typeof d?Object.keys(a).every(function(e){return b(a[e],d[e])}):a===d}this.isStyleApplied=function(c){c=m.getAppliedStylesForElement(c);return b(a,c)}}function q(a){var e={};this.applyStyleToContainer=function(c){var g;g=c.getAttributeNS(d,"style-name");var n=c.ownerDocument;g=g||"";if(!e.hasOwnProperty(g)){var s=g,p=g,q;p?(q=m.getStyleElement(p,"text"),q.parentNode===f?n=q.cloneNode(!0):(n= n.createElementNS(b,"style:style"),n.setAttributeNS(b,"style:parent-style-name",p),n.setAttributeNS(b,"style:family","text"),n.setAttributeNS(r,"scope","document-content"))):(n=n.createElementNS(b,"style:style"),n.setAttributeNS(b,"style:family","text"),n.setAttributeNS(r,"scope","document-content"));m.updateStyle(n,a,h);f.appendChild(n);e[s]=n}g=e[g].getAttributeNS(b,"name");c.setAttributeNS(d,"text:style-name",g)}}var e,a=new odf.OdfUtils,g=new core.DomUtils,d=odf.Namespaces.textns,b=odf.Namespaces.stylens, r="urn:webodf:names:scope";this.applyStyle=function(b,l){var c,f,m,s,p;c={};var h;runtime.assert(l&&l["style:text-properties"],"applyStyle without any text properties");c["style:text-properties"]=l["style:text-properties"];s=new q(c);p=new n(c);e=g.splitBoundaries(b);c=a.getTextNodes(b,!1);h={startContainer:b.startContainer,startOffset:b.startOffset,endContainer:b.endContainer,endOffset:b.endOffset};c.forEach(function(b){f=p.isStyleApplied(b);if(!1===f){var c=b.ownerDocument,e=b.parentNode,l,k=b, n=new core.LoopWatchDog(1E3);a.isParagraph(e)?(c=c.createElementNS(d,"text:span"),e.insertBefore(c,b),l=!1):(b.previousSibling&&!g.rangeContainsNode(h,b.previousSibling)?(c=e.cloneNode(!1),e.parentNode.insertBefore(c,e.nextSibling)):c=e,l=!0);for(;k&&(k===b||g.rangeContainsNode(h,k));)n.check(),e=k.nextSibling,k.parentNode!==c&&c.appendChild(k),k=e;if(k&&l)for(b=c.cloneNode(!1),c.parentNode.insertBefore(b,c.nextSibling);k;)n.check(),e=k.nextSibling,b.appendChild(k),k=e;m=c;s.applyStyleToContainer(m)}}); e.forEach(g.normalizeTextNodes);e=null}}; // Input 29 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.Namespaces");runtime.loadClass("odf.OdfUtils");runtime.loadClass("xmldom.XPath");runtime.loadClass("core.CSSUnits"); odf.Style2CSS=function(){function h(a){var b={},c,d;if(!a)return b;for(a=a.firstChild;a;){if(d=a.namespaceURI!==u||"style"!==a.localName&&"default-style"!==a.localName?a.namespaceURI===s&&"list-style"===a.localName?"list":a.namespaceURI!==u||"page-layout"!==a.localName&&"default-page-layout"!==a.localName?void 0:"page":a.getAttributeNS(u,"family"))(c=a.getAttributeNS&&a.getAttributeNS(u,"name"))||(c=""),d=b[d]=b[d]||{},d[c]=a;a=a.nextSibling}return b}function m(a,b){if(!b||!a)return null;if(a[b])return a[b]; var c,d;for(c in a)if(a.hasOwnProperty(c)&&(d=m(a[c].derivedStyles,b)))return d;return null}function f(a,b,c){var d=b[a],e,p;d&&(e=d.getAttributeNS(u,"parent-style-name"),p=null,e&&(p=m(c,e),!p&&b[e]&&(f(e,b,c),p=b[e],b[e]=null)),p?(p.derivedStyles||(p.derivedStyles={}),p.derivedStyles[a]=d):c[a]=d)}function n(a,b){for(var c in a)a.hasOwnProperty(c)&&(f(c,a,b),a[c]=null)}function q(a,b){var c=y[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+"|"+v[a].join(d+","+c+"|")+d}function e(a,b,c){var d=[],p,l;d.push(q(a,b));for(p in c.derivedStyles)if(c.derivedStyles.hasOwnProperty(p))for(l in b=e(a,p,c.derivedStyles[p]),b)b.hasOwnProperty(l)&&d.push(b[l]);return d}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 g(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,u,"text-properties"))?V.parseFoFontSize(b.getAttributeNS(c,"font-size")):null}function b(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 r(a,b,c,d){b='text|list[text|style-name="'+b+'"]';var e=c.getAttributeNS(s,"level"), p;c=V.getFirstNonWhitespaceChild(c);c=V.getFirstNonWhitespaceChild(c);var l;c&&(p=c.attributes,l=p["fo:text-indent"]?p["fo:text-indent"].value:void 0,p=p["fo:margin-left"]?p["fo:margin-left"].value:void 0);l||(l="-0.6cm");c="-"===l.charAt(0)?l.substring(1):"-"+l;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!==p&&(p=e+"{margin-left:"+p+";}",a.insertRule(p,a.cssRules.length));d=b+" > text|list-item > *:not(text|list):first-child:before{"+ d+";";d+="counter-increment:list;";d+="margin-left:"+l+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(g){throw g;}}function k(f,n,q,m){if("list"===n)for(var t=m.firstChild,h,v;t;){if(t.namespaceURI===s)if(h=t,"list-level-style-number"===t.localName){var E=h;v=E.getAttributeNS(u,"num-format");var y=E.getAttributeNS(u,"num-suffix"),w={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},E=E.getAttributeNS(u,"num-prefix")||"",E=w.hasOwnProperty(v)? E+(" counter(list, "+w[v]+")"):v?E+("'"+v+"';"):E+" ''";y&&(E+=" '"+y+"'");v="content: "+E+";";r(f,q,h,v)}else"list-level-style-image"===t.localName?(v="content: none;",r(f,q,h,v)):"list-level-style-bullet"===t.localName&&(v="content: '"+h.getAttributeNS(s,"bullet-char")+"';",r(f,q,h,v));t=t.nextSibling}else if("page"===n)if(y=h=q="",t=m.getElementsByTagNameNS(u,"page-layout-properties")[0],h=t.parentNode.parentNode.parentNode.masterStyles,y="",q+=g(t,G),v=t.getElementsByTagNameNS(u,"background-image"), 0c)break;e=e.nextSibling}a.insertBefore(b,e)}}}function q(a){this.OdfContainer=a}function e(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)}))};this.abort=function(){}}function a(a){this.length=0;this.item=function(a){}}var g=new odf.StyleInfo,d="urn:oasis:names:tc:opendocument:xmlns:office:1.0",b="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0",r="urn:webodf:names:scope",k="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),l=(new Date).getTime()+ "_webodf_",c=new core.Base64;q.prototype=new function(){};q.prototype.constructor=q;q.namespaceURI=d;q.localName="document";e.prototype.load=function(){};e.prototype.getUrl=function(){return this.data?"data:;base64,"+c.toBase64(this.data):null};odf.OdfContainer=function t(c,p){function k(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,b.nodeType===Node.ELEMENT_NODE?k(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b),b=c}function m(a,b){for(var c=a&&a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&& c.setAttributeNS(r,"scope",b),c=c.nextSibling}function v(a,b){var c=null,d,e,l;if(a)for(c=a.cloneNode(!0),d=c.firstChild;d;)e=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(l=d.getAttributeNS(r,"scope"))&&l!==b&&c.removeChild(d),d=e;return c}function x(a){var b=J.rootElement.ownerDocument,c;if(a){k(a.documentElement);try{c=b.importNode(a.documentElement,!0)}catch(d){}}return c}function N(a){J.state=a;if(J.onchange)J.onchange(J);if(J.onstatereadychange)J.onstatereadychange(J)}function A(a){Y=null; J.rootElement=a;a.fontFaceDecls=h(a,d,"font-face-decls");a.styles=h(a,d,"styles");a.automaticStyles=h(a,d,"automatic-styles");a.masterStyles=h(a,d,"master-styles");a.body=h(a,d,"body");a.meta=h(a,d,"meta")}function F(a){a=x(a);var b=J.rootElement;a&&"document-styles"===a.localName&&a.namespaceURI===d?(b.fontFaceDecls=h(a,d,"font-face-decls"),n(b,b.fontFaceDecls),b.styles=h(a,d,"styles"),n(b,b.styles),b.automaticStyles=h(a,d,"automatic-styles"),m(b.automaticStyles,"document-styles"),n(b,b.automaticStyles), b.masterStyles=h(a,d,"master-styles"),n(b,b.masterStyles),g.prefixStyleNames(b.automaticStyles,l,b.masterStyles)):N(t.INVALID)}function O(a){a=x(a);var b,c,e;if(a&&"document-content"===a.localName&&a.namespaceURI===d){b=J.rootElement;c=h(a,d,"font-face-decls");if(b.fontFaceDecls&&c)for(e=c.firstChild;e;)b.fontFaceDecls.appendChild(e),e=c.firstChild;else c&&(b.fontFaceDecls=c,n(b,c));c=h(a,d,"automatic-styles");m(c,"document-content");if(b.automaticStyles&&c)for(e=c.firstChild;e;)b.automaticStyles.appendChild(e), e=c.firstChild;else c&&(b.automaticStyles=c,n(b,c));b.body=h(a,d,"body");n(b,b.body)}else N(t.INVALID)}function z(a){a=x(a);var b;a&&("document-meta"===a.localName&&a.namespaceURI===d)&&(b=J.rootElement,b.meta=h(a,d,"meta"),n(b,b.meta))}function H(a){a=x(a);var b;a&&("document-settings"===a.localName&&a.namespaceURI===d)&&(b=J.rootElement,b.settings=h(a,d,"settings"),n(b,b.settings))}function D(a){a=x(a);var c;if(a&&"manifest"===a.localName&&a.namespaceURI===b)for(c=J.rootElement,c.manifest=a,a=c.manifest.firstChild;a;)a.nodeType=== Node.ELEMENT_NODE&&("file-entry"===a.localName&&a.namespaceURI===b)&&(Q[a.getAttributeNS(b,"full-path")]=a.getAttributeNS(b,"media-type")),a=a.nextSibling}function G(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],P.loadAsDOM(c,function(b,c){d(c);J.state!==t.INVALID&&G(a)})):N(t.DONE)}function T(a){var b="";odf.Namespaces.forEachPrefix(function(a,c){b+=" xmlns:"+a+'="'+c+'"'});return''}function ba(){var a=new xmldom.LSSerializer, b=T("document-meta");a.filter=new f;b+=a.writeToString(J.rootElement.meta,odf.Namespaces.namespaceMap);return b+""}function V(a,c){var d=document.createElementNS(b,"manifest:file-entry");d.setAttributeNS(b,"manifest:full-path",a);d.setAttributeNS(b,"manifest:media-type",c);return d}function ca(){var a=runtime.parseXML(''),c=h(a,b,"manifest"),d=new xmldom.LSSerializer,e;for(e in Q)Q.hasOwnProperty(e)&&c.appendChild(V(e, Q[e]));d.filter=new f;return'\n'+d.writeToString(a,odf.Namespaces.namespaceMap)}function U(){var a=new xmldom.LSSerializer,b=T("document-settings");a.filter=new f;b+=a.writeToString(J.rootElement.settings,odf.Namespaces.namespaceMap);return b+""}function W(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=v(J.rootElement.automaticStyles,"document-styles"),d=J.rootElement.masterStyles&&J.rootElement.masterStyles.cloneNode(!0), e=T("document-styles");g.removePrefixFromStyleNames(c,l,d);b.filter=new f(d,c);e+=b.writeToString(J.rootElement.fontFaceDecls,a);e+=b.writeToString(J.rootElement.styles,a);e+=b.writeToString(c,a);e+=b.writeToString(d,a);return e+""}function M(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=v(J.rootElement.automaticStyles,"document-content"),d=T("document-content");b.filter=new f(J.rootElement.body,c);d+=b.writeToString(c,a);d+=b.writeToString(J.rootElement.body, a);return d+""}function S(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var e=x(c);e&&"document"===e.localName&&e.namespaceURI===d?(A(e),N(t.DONE)):N(t.INVALID)}})}function R(){function a(b,c){var l;c||(c=b);l=document.createElementNS(d,c);e[b]=l;e.appendChild(l)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),e=J.rootElement,l=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(l);N(t.DONE);return b}function I(){var a,b=new Date;a=runtime.byteArrayFromString(U(),"utf8");P.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(ba(),"utf8");P.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(W(),"utf8");P.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(M(),"utf8");P.save("content.xml",a,!0,b);a= runtime.byteArrayFromString(ca(),"utf8");P.save("META-INF/manifest.xml",a,!0,b)}function B(a,b){I();P.writeAs(a,function(a){b(a)})}var J=this,P,Q={},Y;this.onstatereadychange=p;this.parts=this.rootElement=this.state=this.onchange=null;this.setRootElement=A;this.getContentElement=function(){var a;Y||(a=J.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= J.getContentElement();return a&&a.localName};this.getPart=function(a){return new e(a,Q[a],J,P)};this.getPartData=function(a,b){P.load(a,b)};this.createByteArray=function(a,b){I();P.createByteArray(a,b)};this.saveAs=B;this.save=function(a){B(c,a)};this.getUrl=function(){return c};this.state=t.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}(q);this.parts=new a(this);P=c?new core.Zip(c,function(a, b){P=b;a?S(c,function(b){a&&(P.error=a+"\n"+b,N(t.INVALID))}):G([["styles.xml",F],["content.xml",O],["meta.xml",z],["settings.xml",H],["META-INF/manifest.xml",D]])}):R()};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 31 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.Base64");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.OdfContainer"); odf.FontLoader=function(){function h(f,e,a,g,d){var b,m=0,k;for(k in f)if(f.hasOwnProperty(k)){if(m===a){b=k;break}m+=1}if(!b)return d();e.getPartData(f[b].href,function(l,c){if(l)runtime.log(l);else{var k="@font-face { font-family: '"+(f[b].family||b)+"'; src: url(data:application/x-font-ttf;charset=binary;base64,"+n.convertUTF8ArrayToBase64(c)+') format("truetype"); }';try{g.insertRule(k,g.cssRules.length)}catch(m){runtime.log("Problem inserting rule in CSS: "+runtime.toJson(m)+"\nRule: "+k)}}h(f, e,a+1,g,d)})}function m(f,e,a){h(f,e,0,a,function(){})}var f=new xmldom.XPath,n=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(n,e){for(var a=n.rootElement.fontFaceDecls;e.cssRules.length;)e.deleteRule(e.cssRules.length-1);if(a){var g={},d,b,h,k;if(a)for(a=f.getODFElementsWithXPath(a,"style:font-face[svg:font-face-src]",odf.Namespaces.resolvePrefix),d=0;d @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("odf.Namespaces");runtime.loadClass("odf.OdfContainer");runtime.loadClass("odf.StyleInfo");runtime.loadClass("odf.OdfUtils");runtime.loadClass("odf.TextStyleApplicator"); odf.Formatting=function(){function h(a,b){Object.keys(b).forEach(function(c){try{a[c]=b[c].constructor===Object?h(a[c],b[c]):b[c]}catch(d){a[c]=b[c]}});return a}function m(a,d,e){var g;e=e||[b.rootElement.automaticStyles,b.rootElement.styles];for(g=e.shift();g;){for(g=g.firstChild;g;){if(g.nodeType===Node.ELEMENT_NODE&&(g.namespaceURI===l&&"style"===g.localName&&g.getAttributeNS(l,"family")===d&&g.getAttributeNS(l,"name")===a||"list-style"===d&&g.namespaceURI===c&&"list-style"===g.localName&&g.getAttributeNS(l, "name")===a))return g;g=g.nextSibling}g=e.shift()}return null}function f(a){for(var b={},c=a.firstChild;c;){if(c.nodeType===Node.ELEMENT_NODE&&c.namespaceURI===l)for(b[c.nodeName]={},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/ */ runtime.loadClass("core.DomUtils");runtime.loadClass("odf.OdfContainer");runtime.loadClass("odf.Formatting");runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.FontLoader");runtime.loadClass("odf.Style2CSS");runtime.loadClass("odf.OdfUtils"); odf.OdfCanvas=function(){function h(){function a(d){c=!0;runtime.setTimeout(function(){try{d()}catch(e){runtime.log(e)}c=!1;0 text|list-item > *:first-child:before {";if(E=A.getAttributeNS(v,"style-name")){A=h[E];B=z.getFirstNonWhitespaceChild(A);A=void 0;if("list-level-style-number"===B.localName){A=B.getAttributeNS(p,"num-format");E=B.getAttributeNS(p,"num-suffix");var H="",H={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"}, I=void 0,I=B.getAttributeNS(p,"num-prefix")||"",I=H.hasOwnProperty(A)?I+(" counter(list, "+H[A]+")"):A?I+("'"+A+"';"):I+" ''";E&&(I+=" '"+E+"'");A=H="content: "+I+";"}else"list-level-style-image"===B.localName?A="content: none;":"list-level-style-bullet"===B.localName&&(A="content: '"+B.getAttributeNS(v,"bullet-char")+"';");B=A}if(w){for(A=n[w];A;)w=A,A=n[w];K+="counter-increment:"+w+";";B?(B=B.replace("list",w),K+=B):K+="content:counter("+w+");"}else w="",B?(B=B.replace("list",x),K+=B):K+="content: counter("+ x+");",K+="counter-increment:"+x+";",g.insertRule("text|list#"+x+" {counter-reset:"+x+"}",g.cssRules.length);K+="}";n[x]=w;K&&g.insertRule(K,g.cssRules.length)}f.insertBefore(D,f.firstChild);C();if(!c&&(g=[S],$.hasOwnProperty("statereadychange")))for(f=$.statereadychange,B=0;B @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.Server=function(){};ops.Server.prototype.connect=function(h,m){};ops.Server.prototype.networkStatus=function(){};ops.Server.prototype.login=function(h,m,f,n){}; // Input 36 /* Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.NowjsServer=function(){var h=this,m;this.getNowObject=function(){return m};this.connect=function(f,n){function h(){"unavailable"===m.networkStatus?(runtime.log("connection to server unavailable."),n("unavailable")):"ready"!==m.networkStatus?e>f?(runtime.log("connection to server timed out."),n("timeout")):(e+=100,runtime.getWindow().setTimeout(h,100)):(runtime.log("connection to collaboration server established."),n("ready"))}var e=0;m||(m=runtime.getVariable("now"),void 0===m&&(m={networkStatus:"unavailable"}), h())};this.networkStatus=function(){return m?m.networkStatus:"unavailable"};this.login=function(f,n,h,e){m?m.login(f,n,h,e):e("Not connected to server")};this.createOperationRouter=function(f,n){return new ops.NowjsOperationRouter(f,n,h)};this.createUserModel=function(){return new ops.NowjsUserModel(h)}}; // Input 37 /* Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.Base64");runtime.loadClass("core.ByteArrayWriter"); ops.PullBoxServer=function(h){function m(e,a){var g=new XMLHttpRequest,d=new core.ByteArrayWriter("utf8");runtime.log("Sending message to server: "+e);d.appendString(e);d=d.getByteArray();g.open("POST",h.url,!0);g.onreadystatechange=function(){4===g.readyState&&((200>g.status||300<=g.status)&&0===g.status&&runtime.log("Status "+String(g.status)+": "+g.responseText||g.statusText),a(g.responseText))};d=d.buffer&&!g.sendAsBinary?d.buffer:runtime.byteArrayToString(d,"binary");try{g.sendAsBinary?g.sendAsBinary(d): g.send(d)}catch(b){runtime.log("Problem with calling server: "+b+" "+d),a(b.message)}}var f=this,n,q=new core.Base64;h=h||{};h.url=h.url||"/WSER";this.call=m;this.getBase64=function(){return q};this.getToken=function(){return n};this.connect=function(e,a){a("ready")};this.networkStatus=function(){return"ready"};this.login=function(e,a,g,d){m("login:"+q.toBase64(e)+":"+q.toBase64(a),function(a){var e=runtime.fromJson(a);runtime.log("Login reply: "+a);e.hasOwnProperty("token")?(n=e.token,runtime.log("Caching token: "+ f.getToken()),g(e)):d(a)})};this.createOperationRouter=function(e,a){return new ops.PullBoxOperationRouter(e,a,f)};this.createUserModel=function(){return new ops.PullBoxUserModel(f)}}; // Input 38 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.Operation=function(){};ops.Operation.prototype.init=function(h){};ops.Operation.prototype.transform=function(h,m){};ops.Operation.prototype.execute=function(h){};ops.Operation.prototype.spec=function(){}; // Input 39 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpAddCursor=function(){var h=this,m,f;this.init=function(n){m=n.memberid;f=n.timestamp};this.transform=function(f,m){return[h]};this.execute=function(f){var h=f.getCursor(m);if(h)return!1;h=new ops.OdtCursor(m,f);f.addCursor(h);f.emit(ops.OdtDocument.signalCursorAdded,h);return!0};this.spec=function(){return{optype:"AddCursor",memberid:m,timestamp:f}}}; // Input 40 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("odf.OdfUtils"); ops.OpApplyStyle=function(){function h(a){var d=0<=e?q+e:q,g=a.getIteratorAtPosition(0<=e?q:q+e),d=e?a.getIteratorAtPosition(d):g;a=a.getDOM().createRange();a.setStart(g.container(),g.unfilteredDomOffset());a.setEnd(d.container(),d.unfilteredDomOffset());return a}function m(a){var e=a.commonAncestorContainer,k=[];for(e.nodeType===Node.ELEMENT_NODE&&(k=d.getElementsByTagNameNS(e,"urn:oasis:names:tc:opendocument:xmlns:text:1.0","p").concat(d.getElementsByTagNameNS(e,"urn:oasis:names:tc:opendocument:xmlns:text:1.0", "h")));e&&!g.isParagraph(e);)e=e.parentNode;e&&k.push(e);return k.filter(function(d){var c=d.nodeType===Node.TEXT_NODE?d.length:d.childNodes.length;return 0>=a.comparePoint(d,0)&&0<=a.comparePoint(d,c)})}var f,n,q,e,a,g=new odf.OdfUtils,d=new core.DomUtils;this.init=function(b){f=b.memberid;n=b.timestamp;q=parseInt(b.position,10);e=parseInt(b.length,10);a=b.info};this.transform=function(a,d){return null};this.execute=function(b){var d=h(b),e=m(d);b.getFormatting().applyStyle(f,d,a);d.detach();b.getOdfCanvas().refreshCSS(); e.forEach(function(a){b.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,memberId:f,timeStamp:n})});return!0};this.spec=function(){return{optype:"ApplyStyle",memberid:f,timestamp:n,position:q,length:e,info:a}}}; // Input 41 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpRemoveCursor=function(){var h=this,m,f;this.init=function(n){m=n.memberid;f=n.timestamp};this.transform=function(f,q){var e=f.spec();return"RemoveCursor"===e.optype&&e.memberid===m?[]:[h]};this.execute=function(f){return f.removeCursor(m)?!0:!1};this.spec=function(){return{optype:"RemoveCursor",memberid:m,timestamp:f}}}; // Input 42 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpMoveCursor=function(){var h=this,m,f,n,q;this.init=function(e){m=e.memberid;f=e.timestamp;n=parseInt(e.position,10);q=void 0!==e.length?parseInt(e.length,10):0};this.merge=function(e){return"MoveCursor"===e.optype&&e.memberid===m?(n=e.position,q=e.length,f=e.timestamp,!0):!1};this.transform=function(e,a){var g=e.spec(),d=g.optype,b=[h];"RemoveText"===d?g.position+g.length<=n?n-=g.length:g.positionb?-g.countBackwardSteps(-b,d):0;a.move(b);q&&(d=0q?-g.countBackwardSteps(-q,d):0,a.move(d,!0));e.emit(ops.OdtDocument.signalCursorMoved,a);return!0};this.spec=function(){return{optype:"MoveCursor",memberid:m, timestamp:f,position:n,length:q}}}; // Input 43 ops.OpInsertTable=function(){function h(a,b){var c;if(1===r.length)c=r[0];else if(3===r.length)switch(a){case 0:c=r[0];break;case q-1:c=r[2];break;default:c=r[1]}else c=r[a];if(1===c.length)return c[0];if(3===c.length)switch(b){case 0:return c[0];case e-1:return c[2];default:return c[1]}return c[b]}var m=this,f,n,q,e,a,g,d,b,r;this.init=function(k){f=k.memberid;n=k.timestamp;a=parseInt(k.position,10);q=parseInt(k.initialRows,10);e=parseInt(k.initialColumns,10);g=k.tableName;d=k.tableStyleName;b=k.tableColumnStyleName; r=k.tableCellStyleMatrix};this.transform=function(b,d){var c=b.spec(),e=c.optype,g=[m];if("InsertTable"===e)g=null;else if("SplitParagraph"===e)if(c.position @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(){function h(a,e){var d=e.parentNode,b=e.nextSibling,f=[];a.getCursors().forEach(function(a){var b=a.getSelectedRange();!b||b.startContainer!==e&&b.endContainer!==e||f.push({cursor:a,startContainer:b.startContainer,startOffset:b.startOffset,endContainer:b.endContainer,endOffset:b.endOffset})});d.removeChild(e);d.insertBefore(e,b);f.forEach(function(a){var b=a.cursor.getSelectedRange();b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset)})}var m= this,f,n,q,e;this.init=function(a){f=a.memberid;n=a.timestamp;q=parseInt(a.position,10);e=a.text};this.merge=function(a){return"InsertText"===a.optype&&a.memberid===f&&a.position===q+e.length?(e+=a.text,n=a.timestamp,!0):!1};this.transform=function(a,e){var d=a.spec(),b=d.optype,f=[m];if("InsertText"===b)if(d.position @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("odf.OdfUtils");runtime.loadClass("core.DomUtils"); ops.OpRemoveText=function(){function h(a){if(!d.isParagraph(a)&&(d.isGroupingElement(a)||d.isCharacterElement(a))&&0===a.textContent.length){for(a=a.firstChild;a;){if(d.isCharacterElement(a))return!1;a=a.nextSibling}return!0}return!1}function m(a,b,e){var c,g;c=e?b.lastChild:b.firstChild;for(e&&(g=a.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0]||a.firstChild);c;){b.removeChild(c);if("editinfo"!==c.localName)if(h(c))for(;c.firstChild;)a.insertBefore(c.firstChild,g);else a.insertBefore(c, g);c=e?b.lastChild:b.firstChild}a=b.parentNode;a.removeChild(b);d.isListItem(a)&&0===a.childNodes.length&&a.parentNode.removeChild(a)}var f=this,n,q,e,a,g,d=new odf.OdfUtils,b;this.init=function(f){runtime.assert(0<=f.length,"OpRemoveText only supports positive lengths");n=f.memberid;q=f.timestamp;e=parseInt(f.position,10);a=parseInt(f.length,10);g=f.text;d=new odf.OdfUtils;b=new core.DomUtils};this.transform=function(b,d){var l=b.spec(),c=l.optype,g=e+a,m=[f];"RemoveText"===c?(c=l.position+l.length, c<=e?e-=l.length:l.position @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.OpSplitParagraph=function(){var h=this,m,f,n,q=new odf.OdfUtils;this.init=function(e){m=e.memberid;f=e.timestamp;n=parseInt(e.position,10)};this.transform=function(e,a){var g=e.spec(),d=g.optype,b=[h];if("SplitParagraph"===d)if(g.position=a.textNode.length?null:a.textNode.splitText(a.offset));for(a=a.textNode;a!==d;)if(a=a.parentNode,b=a.cloneNode(!1),k){for(h&&b.appendChild(h);k.nextSibling;)b.appendChild(k.nextSibling);a.parentNode.insertBefore(b, a.nextSibling);k=a;h=b}else a.parentNode.insertBefore(b,a),k=b,h=a;q.isListItem(h)&&(h=h.childNodes[0]);e.fixCursorPositions(m);e.getOdfCanvas().refreshSize();e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:g,memberId:m,timeStamp:f});e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:h,memberId:m,timeStamp:f});return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:m,timestamp:f,position:n}}}; // Input 47 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpSetParagraphStyle=function(){var h=this,m,f,n,q;this.init=function(e){m=e.memberid;f=e.timestamp;n=e.position;q=e.styleName};this.transform=function(e,a){var g=e.spec();"DeleteParagraphStyle"===g.optype&&g.styleName===q&&(q="");return[h]};this.execute=function(e){var a;if(a=e.getPositionInTextNode(n))if(a=e.getParagraphElement(a.textNode))return""!==q?a.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",q):a.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0", "style-name"),e.getOdfCanvas().refreshSize(),e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,timeStamp:f,memberId:m}),!0;return!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:m,timestamp:f,position:n,styleName:q}}}; // Input 48 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpUpdateParagraphStyle=function(){function h(a,b,d){var e,g,f;for(e=0;e @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.OpCloneParagraphStyle=function(){var h=this,m,f,n,q,e;this.init=function(a){m=a.memberid;f=a.timestamp;n=a.styleName;q=a.newStyleName;e=a.newStyleDisplayName};this.transform=function(a,e){var d=a.spec();return"UpdateParagraphStyle"!==d.optype&&"DeleteParagraphStyle"!==d.optype||d.styleName!==n?[h]:null};this.execute=function(a){var g=a.getParagraphStyleElement(n),d;if(!g)return!1;d=g.cloneNode(!0);d.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","style:name",q);e?d.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0", "style:display-name",e):d.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:style:1.0","display-name");g.parentNode.appendChild(d);a.getOdfCanvas().refreshCSS();a.emit(ops.OdtDocument.signalStyleCreated,q);return!0};this.spec=function(){return{optype:"CloneParagraphStyle",memberid:m,timestamp:f,styleName:n,newStyleName:q,newStyleDisplayName:e}}}; // Input 50 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OpDeleteParagraphStyle=function(){var h=this,m,f,n;this.init=function(h){m=h.memberid;f=h.timestamp;n=h.styleName};this.transform=function(f,e){var a=f.spec(),g=a.optype;if("DeleteParagraphStyle"===g){if(a.styleName===n)return[]}else if("SetParagraphStyle"===g&&a.styleName===n)return a.styleName="",g=new ops.OpSetParagraphStyle,g.init(a),[g,h];return[h]};this.execute=function(f){var e=f.getParagraphStyleElement(n);if(!e)return!1;e.parentNode.removeChild(e);f.getOdfCanvas().refreshCSS();f.emit(ops.OdtDocument.signalStyleDeleted, n);return!0};this.spec=function(){return{optype:"DeleteParagraphStyle",memberid:m,timestamp:f,styleName:n}}}; // Input 51 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpApplyStyle");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertTable");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpCloneParagraphStyle");runtime.loadClass("ops.OpDeleteParagraphStyle"); ops.OperationFactory=function(){function h(f){return function(){return new f}}var m;this.register=function(f,h){m[f]=h};this.create=function(f){var h=null,q=m[f.optype];q&&(h=q(f),h.init(f));return h};m={AddCursor:h(ops.OpAddCursor),ApplyStyle:h(ops.OpApplyStyle),InsertTable:h(ops.OpInsertTable),InsertText:h(ops.OpInsertText),RemoveText:h(ops.OpRemoveText),SplitParagraph:h(ops.OpSplitParagraph),SetParagraphStyle:h(ops.OpSetParagraphStyle),UpdateParagraphStyle:h(ops.OpUpdateParagraphStyle),CloneParagraphStyle:h(ops.OpCloneParagraphStyle), DeleteParagraphStyle:h(ops.OpDeleteParagraphStyle),MoveCursor:h(ops.OpMoveCursor),RemoveCursor:h(ops.OpRemoveCursor)}}; // Input 52 runtime.loadClass("core.Cursor");runtime.loadClass("core.PositionIterator");runtime.loadClass("core.PositionFilter");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.OdfUtils"); gui.SelectionMover=function(h,m){function f(){c.setUnfilteredPosition(h.getNode(),0);return c}function n(a,b,c){var d;c.setStart(a,b);d=c.getClientRects()[0];if(!d)if(d={},a.childNodes[b-1]){c.setStart(a,b-1);c.setEnd(a,b);b=c.getClientRects()[0];if(!b){for(c=b=0;a&&a.nodeType===Node.ELEMENT_NODE;)b+=a.offsetLeft-a.scrollLeft,c+=a.offsetTop-a.scrollTop,a=a.parentNode;b={top:c,left:b}}d.top=b.top;d.left=b.right;d.bottom=b.bottom}else a.nodeType===Node.TEXT_NODE?(a.previousSibling&&(d=a.previousSibling.getClientRects()[0]), d||(c.setStart(a,0),c.setEnd(a,b),d=c.getClientRects()[0])):d=a.getClientRects()[0];return{top:d.top,left:d.left,bottom:d.bottom}}function q(a,b,c){var d=a,e=f(),g,l=m.ownerDocument.createRange(),k=h.getSelectedRange()?h.getSelectedRange().cloneRange():m.ownerDocument.createRange(),q;for(g=n(h.getNode(),0,l);0a?-1:1;for(a=Math.abs(a);0k?h.previousPosition():h.nextPosition());)if(M.check(),1===l.acceptPosition(h)&&(t+=1,q=h.container(),T=n(q,h.unfilteredDomOffset(),W),T.top!==V)){if(T.top!== U&&U!==V)break;U=T.top;T=Math.abs(ca-T.left);if(null===r||Ta?(g=c.previousPosition,k=-1):(g=c.nextPosition,k=1);for(h=n(c.container(),c.unfilteredDomOffset(),t);g.call(c);)if(b.acceptPosition(c)===NodeFilter.FILTER_ACCEPT){if(l.getParagraphElement(c.getCurrentNode())!== d)break;q=n(c.container(),c.unfilteredDomOffset(),t);if(q.bottom!==h.bottom&&(h=q.top>=h.top&&q.bottomh.bottom,!h))break;e+=k;h=q}t.detach();return e}function r(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 k(a,b,c){runtime.assert(null!==a,"SelectionMover.countStepsToPosition called with element===null");var d=f(),e=d.container(),g=d.unfilteredDomOffset(), l=0,k=new core.LoopWatchDog(1E3);d.setUnfilteredPosition(a,b);a=d.container();runtime.assert(Boolean(a),"SelectionMover.countStepsToPosition: positionIterator.container() returned null");b=d.unfilteredDomOffset();d.setUnfilteredPosition(e,g);var e=a,g=b,h=d.container(),m=d.unfilteredDomOffset();if(e===h)e=m-g;else{var n=e.compareDocumentPosition(h);2===n?n=-1:4===n?n=1:10===n?(g=r(e,h),n=ge)for(;d.nextPosition()&&(k.check(),1===c.acceptPosition(d)&&(l+=1),d.container()!== a||d.unfilteredDomOffset()!==b););else if(0 @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertTable");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpCloneParagraphStyle");runtime.loadClass("ops.OpDeleteParagraphStyle"); ops.OperationTransformer=function(){function h(f,n){for(var q,e,a,g=[],d=[];0=e&&(g=-n.movePointBackward(-e,a));f.handleUpdate();return g};this.handleUpdate=function(){};this.getStepCounter=function(){return n.getStepCounter()};this.getMemberId=function(){return h};this.getNode=function(){return q.getNode()};this.getAnchorNode=function(){return q.getAnchorNode()};this.getSelectedRange=function(){return q.getSelectedRange()}; this.getOdtDocument=function(){return m};q=new core.Cursor(m.getDOM(),h);n=new gui.SelectionMover(q,m.getRootNode())}; // Input 55 /* 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.EditInfo=function(h,m){function f(){var e=[],a;for(a in q)q.hasOwnProperty(a)&&e.push({memberid:a,time:q[a].time});e.sort(function(a,d){return a.time-d.time});return e}var n,q={};this.getNode=function(){return n};this.getOdtDocument=function(){return m};this.getEdits=function(){return q};this.getSortedEdits=function(){return f()};this.addEdit=function(e,a){var g,d=e.split("___")[0];if(!q[e])for(g in q)if(q.hasOwnProperty(g)&&g.split("___")[0]===d){delete q[g];break}q[e]={time:a}};this.clearEdits= function(){q={}};n=m.getDOM().createElementNS("urn:webodf:names:editinfo","editinfo");h.insertBefore(n,h.firstChild)}; // Input 56 gui.Avatar=function(h,m){var f=this,n,q,e;this.setColor=function(a){q.style.borderColor=a};this.setImageUrl=function(a){f.isVisible()?q.src=a:e=a};this.isVisible=function(){return"block"===n.style.display};this.show=function(){e&&(q.src=e,e=void 0);n.style.display="block"};this.hide=function(){n.style.display="none"};this.markAsFocussed=function(a){n.className=a?"active":""};(function(){var a=h.ownerDocument,e=a.documentElement.namespaceURI;n=a.createElementNS(e,"div");q=a.createElementNS(e,"img"); q.width=64;q.height=64;n.appendChild(q);n.style.width="64px";n.style.height="70px";n.style.position="absolute";n.style.top="-80px";n.style.left="-34px";n.style.display=m?"block":"none";h.appendChild(n)})()}; // Input 57 runtime.loadClass("gui.Avatar");runtime.loadClass("ops.OdtCursor"); gui.Caret=function(h,m){function f(){g&&a.parentNode&&!d&&(d=!0,q.style.borderColor="transparent"===q.style.borderColor?b:"transparent",runtime.setTimeout(function(){d=!1;f()},500))}function n(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 q,e,a,g=!1,d=!1,b="";this.setFocus=function(){g=!0;e.markAsFocussed(!0);f()};this.removeFocus=function(){g=!1;e.markAsFocussed(!1); q.style.borderColor=b};this.setAvatarImageUrl=function(a){e.setImageUrl(a)};this.setColor=function(a){b!==a&&(b=a,"transparent"!==q.style.borderColor&&(q.style.borderColor=b),e.setColor(b))};this.getCursor=function(){return h};this.getFocusElement=function(){return q};this.toggleHandleVisibility=function(){e.isVisible()?e.hide():e.show()};this.showHandle=function(){e.show()};this.hideHandle=function(){e.hide()};this.ensureVisible=function(){var a,b,d,c,e,g,f,p=h.getOdtDocument().getOdfCanvas().getElement().parentNode; e=f=q;d=runtime.getWindow();runtime.assert(null!==d,"Expected to be run in an environment which has a global window, like a browser.");do{e=e.parentElement;if(!e)break;g=d.getComputedStyle(e,null)}while("block"!==g.display);g=e;e=c=0;if(g&&p){b=!1;do{d=g.offsetParent;for(a=g.parentNode;a!==d;){if(a===p){a=g;var m=p,y=0;b=0;var v=void 0,x=runtime.getWindow();for(runtime.assert(null!==x,"Expected to be run in an environment which has a global window, like a browser.");a&&a!==m;)v=x.getComputedStyle(a, null),y+=n(v.marginLeft)+n(v.borderLeftWidth)+n(v.paddingLeft),b+=n(v.marginTop)+n(v.borderTopWidth)+n(v.paddingTop),a=a.parentElement;a=y;c+=a;e+=b;b=!0;break}a=a.parentNode}if(b)break;c+=n(g.offsetLeft);e+=n(g.offsetTop);g=d}while(g&&g!==p);d=c;c=e}else c=d=0;d+=f.offsetLeft;c+=f.offsetTop;e=d-5;g=c-5;d=d+f.scrollWidth-1+5;f=c+f.scrollHeight-1+5;gp.scrollTop+p.clientHeight-1&&(p.scrollTop=f-p.clientHeight+1);ep.scrollLeft+p.clientWidth- 1&&(p.scrollLeft=d-p.clientWidth+1)};(function(){var b=h.getOdtDocument().getDOM();q=b.createElementNS(b.documentElement.namespaceURI,"span");a=h.getNode();a.appendChild(q);e=new gui.Avatar(a,m)})()}; // Input 58 runtime.loadClass("core.EventNotifier"); gui.ClickHandler=function(){function h(){f=0;n=null}var m,f=0,n=null,q=new core.EventNotifier([gui.ClickHandler.signalSingleClick,gui.ClickHandler.signalDoubleClick,gui.ClickHandler.signalTripleClick]);this.subscribe=function(e,a){q.subscribe(e,a)};this.handleMouseUp=function(e){var a=runtime.getWindow();n&&n.x===e.screenX&&n.y===e.screenY?(f+=1,1===f?q.emit(gui.ClickHandler.signalSingleClick,void 0):2===f?q.emit(gui.ClickHandler.signalDoubleClick,void 0):3===f&&(a.clearTimeout(m),q.emit(gui.ClickHandler.signalTripleClick, void 0),h())):(q.emit(gui.ClickHandler.signalSingleClick,void 0),f=1,n={x:e.screenX,y:e.screenY},a.clearTimeout(m),m=a.setTimeout(h,400))}};gui.ClickHandler.signalSingleClick="click";gui.ClickHandler.signalDoubleClick="doubleClick";gui.ClickHandler.signalTripleClick="tripleClick";(function(){return gui.ClickHandler})(); // Input 59 /* Copyright (C) 2012-2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ gui.KeyboardHandler=function(){function h(f,e){e||(e=e.None);return f+":"+e}var m=gui.KeyboardHandler.Modifier,f=null,n={};this.setDefault=function(h){f=h};this.bind=function(f,e,a){f=h(f,e);runtime.assert(!1===n.hasOwnProperty(f),"tried to overwrite the callback handler of key combo: "+f);n[f]=a};this.unbind=function(f,e){var a=h(f,e);delete n[a]};this.reset=function(){f=null;n={}};this.handleEvent=function(q){var e=q.keyCode,a=m.None;q.metaKey&&(a|=m.Meta);q.ctrlKey&&(a|=m.Ctrl);q.altKey&&(a|=m.Alt); q.shiftKey&&(a|=m.Shift);e=h(e,a);e=n[e];a=!1;e?a=e():null!==f&&(a=f(q));a&&(q.preventDefault?q.preventDefault():q.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,Enter:13,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Delete:46,Z:90};(function(){return gui.KeyboardHandler})(); // Input 60 gui.Clipboard=function(){this.setDataFromRange=function(h,m){var f=!0,n,q=h.clipboardData,e=runtime.getWindow(),a,g;!q&&e&&(q=e.clipboardData);q?(e=new XMLSerializer,a=runtime.getDOMImplementation().createDocument("","",null),n=a.importNode(m.cloneContents(),!0),g=a.createElement("span"),g.appendChild(n),a.appendChild(g),n=q.setData("text/plain",m.toString()),f=f&&n,n=q.setData("text/html",e.serializeToString(a)),f=f&&n,h.preventDefault()):f=!1;return f}};(function(){return gui.Clipboard})(); // Input 61 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.KeyboardHandler");runtime.loadClass("gui.Clipboard"); gui.SessionController=function(){gui.SessionController=function(h,m){function f(a,b,c,d){var e="on"+b,g=!1;a.attachEvent&&(g=a.attachEvent(e,c));!g&&a.addEventListener&&(a.addEventListener(b,c,!1),g=!0);g&&!d||!a.hasOwnProperty(e)||(a[e]=c)}function n(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 q(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function e(a,b){var c=new ops.OpMoveCursor;c.init({memberid:m, position:a,length:b||0});return c}function a(a,b){var c=gui.SelectionMover.createPositionIterator(w.getRootNode()),d=w.getOdfCanvas().getElement(),e;if(e=a){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;e!==d&&a!==e&&(a=e.parentNode,b=Array.prototype.indexOf.call(a.childNodes,e));c.setUnfilteredPosition(a,b);return w.getDistanceFromCursor(m,c.container(),c.unfilteredDomOffset())}} function g(){var b=runtime.getWindow().getSelection(),c=w.getCursorPosition(m),d;d=a(b.anchorNode,b.anchorOffset);b=a(b.focusNode,b.focusOffset);if(0!==b||0!==d)c=e(c+d,b-d),h.enqueue(c)}function d(){var a=gui.SelectionMover.createPositionIterator(w.getRootNode()),b=w.getCursor(m).getNode(),c=w.getCursorPosition(m),d=/[A-Za-z0-9]/,g=0,f=0,l,k,p;a.setUnfilteredPosition(b,0);if(a.previousPosition()&&(l=a.getCurrentNode(),l.nodeType===Node.TEXT_NODE))for(k=l.data.length-1;0<=k;k-=1)if(p=l.data[k],d.test(p))g-= 1;else break;a.setUnfilteredPosition(b,0);if(a.nextPosition()&&(l=a.getCurrentNode(),l.nodeType===Node.TEXT_NODE))for(k=0;ka.length&&(a.position+=a.length,a.length=-a.length);return a}function U(a){var b=new ops.OpRemoveText;b.init({memberid:m,position:a.position,length:a.length});return b}function W(){var a=ca(w.getCursorSelection(m)),b=null;0===a.length?0 @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.TrivialUserModel=function(){var h={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(m,f){var n=m.split("___")[0];f(m,h[n]||null)};this.unsubscribeUserDetailsUpdates=function(h,f){}}; // Input 64 ops.NowjsUserModel=function(h){var m={},f={},n=h.getNowObject();this.getUserDetailsAndUpdates=function(h,e){var a=h.split("___")[0],g=m[a],d=f[a]=f[a]||[],b;runtime.assert(void 0!==e,"missing callback");for(b=0;b @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.PullBoxUserModel=function(h){function m(){var a=h.getBase64(),e,d=[];for(e in q)q.hasOwnProperty(e)&&d.push(e);runtime.log("user-list request for : "+d.join(","));h.call("user-list:"+a.toBase64(h.getToken())+":"+d.join(","),function(a){var d=runtime.fromJson(a),f;runtime.log("user-list reply: "+a);if(d.hasOwnProperty("userdata_list"))for(a=d.userdata_list,e=0;e @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OperationRouter=function(){};ops.OperationRouter.prototype.setOperationFactory=function(h){};ops.OperationRouter.prototype.setPlaybackFunction=function(h){};ops.OperationRouter.prototype.push=function(h){}; // Input 67 /* Copyright (C) 2012 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.TrivialOperationRouter=function(){var h,m;this.setOperationFactory=function(f){h=f};this.setPlaybackFunction=function(f){m=f};this.push=function(f){f=f.spec();f.timestamp=(new Date).getTime();f=h.create(f);m(f)}}; // Input 68 ops.NowjsOperationRouter=function(h,m,f){function n(a){var f;f=q.create(a);runtime.log(" op in: "+runtime.toJson(a));if(null!==f)if(a=Number(a.server_seq),runtime.assert(!isNaN(a),"server seq is not a number"),a===g+1)for(e(f),g=a,b=0,f=g+1;d.hasOwnProperty(f);f+=1)e(d[f]),delete d[f],runtime.log("op with server seq "+a+" taken from hold (reordered)");else runtime.assert(a!==g+1,"received incorrect order from server"),runtime.assert(!d.hasOwnProperty(a),"reorder_queue has incoming op"),runtime.log("op with server seq "+ a+" put on hold"),d[a]=f;else runtime.log("ignoring invalid incoming opspec: "+a)}var q,e,a=f.getNowObject(),g=-1,d={},b=0,r=1E3;this.setOperationFactory=function(a){q=a};this.setPlaybackFunction=function(a){e=a};a.ping=function(a){null!==m&&a(m)};a.receiveOp=function(a,b){a===h&&n(b)};this.push=function(d){d=d.spec();runtime.assert(null!==m,"Router sequence N/A without memberid");r+=1;d.client_nonce="C:"+m+":"+r;d.parent_op=g+"+"+b;b+=1;runtime.log("op out: "+runtime.toJson(d));a.deliverOp(h,d)}; this.requestReplay=function(b){a.requestReplay(h,function(a){runtime.log("replaying: "+runtime.toJson(a));n(a)},function(a){runtime.log("replay done ("+a+" ops).");b&&b()})};(function(){a.memberid=m;a.joinSession(h,function(a){runtime.assert(a,"Trying to join a session which does not exists or where we are already in")})})()}; // Input 69 /* Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("ops.OperationTransformer"); ops.PullBoxOperationRouter=function(h,m,f){function n(a){var b,c,e,f=[];for(b=0;bk?(f(1,0),g=f(0.5,1E4-k),d=f(0.2,2E4-k)):1E4<=k&&2E4>k?(f(0.5,0),d=f(0.2,2E4-k)):f(0.2,0)};this.getEdits=function(){return h.getEdits()};this.clearEdits=function(){h.clearEdits(); e.setEdits([]);a.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&a.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return h};this.show=function(){a.style.display="block"};this.hide=function(){n.hideHandle();a.style.display="none"};this.showHandle=function(){e.show()};this.hideHandle=function(){e.hide()};(function(){var b=h.getOdtDocument().getDOM();a=b.createElementNS(b.documentElement.namespaceURI,"div");a.setAttribute("class","editInfoMarker"); a.onmouseover=function(){n.showHandle()};a.onmouseout=function(){n.hideHandle()};q=h.getNode();q.appendChild(a);e=new gui.EditInfoHandle(q);m||n.hide()})()}; // Input 72 /* Copyright (C) 2012 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("gui.Caret");runtime.loadClass("ops.TrivialUserModel");runtime.loadClass("ops.EditInfo");runtime.loadClass("gui.EditInfoMarker"); gui.SessionView=function(){return function(h,m,f){function n(a,b,c){c=c.split("___")[0];return a+"."+b+'[editinfo|memberid^="'+c+'"]'}function q(a,b,c){function d(b,c,e){e=n(b,c,a)+e;a:{var f=k.firstChild;for(b=n(b,c,a);f;){if(f.nodeType===Node.TEXT_NODE&&0===f.data.indexOf(b)){b=f;break a}f=f.nextSibling}b=null}b?b.data=e:k.appendChild(document.createTextNode(e))}d("div","editInfoMarker","{ background-color: "+c+"; }");d("span","editInfoColor","{ background-color: "+c+"; }");d("span","editInfoAuthor", ':before { content: "'+b+'"; }')}function e(a){var b,c;for(c in l)l.hasOwnProperty(c)&&(b=l[c],a?b.show():b.hide())}function a(a){var b,c;for(c in r)r.hasOwnProperty(c)&&(b=r[c],a?b.showHandle():b.hideHandle())}function g(a,b){var c=r[a];void 0===b?runtime.log('UserModel sent undefined data for member "'+a+'".'):(null===b&&(b={memberid:a,fullname:"Unknown Identity",color:"black",imageurl:"avatar-joe.png"}),c&&(c.setAvatarImageUrl(b.imageurl),c.setColor(b.color)),q(a,b.fullname,b.color))}function d(a){var b= f.createCaret(a,u);a=a.getMemberId();var c=m.getUserModel();r[a]=b;g(a,null);c.getUserDetailsAndUpdates(a,g);runtime.log("+++ View here +++ eagerly created an Caret for '"+a+"'! +++")}function b(a){var b=!1,c;delete r[a];for(c in l)if(l.hasOwnProperty(c)&&l[c].getEditInfo().getEdits().hasOwnProperty(a)){b=!0;break}b||m.getUserModel().unsubscribeUserDetailsUpdates(a,g)}var r={},k,l={},c=void 0!==h.editInfoMarkersInitiallyVisible?h.editInfoMarkersInitiallyVisible:!0,u=void 0!==h.caretAvatarsInitiallyVisible? h.caretAvatarsInitiallyVisible:!0;this.showEditInfoMarkers=function(){c||(c=!0,e(c))};this.hideEditInfoMarkers=function(){c&&(c=!1,e(c))};this.showCaretAvatars=function(){u||(u=!0,a(u))};this.hideCaretAvatars=function(){u&&(u=!1,a(u))};this.getSession=function(){return m};this.getCaret=function(a){return r[a]};(function(){var a=m.getOdtDocument(),e=document.getElementsByTagName("head")[0];a.subscribe(ops.OdtDocument.signalCursorAdded,d);a.subscribe(ops.OdtDocument.signalCursorRemoved,b);a.subscribe(ops.OdtDocument.signalParagraphChanged, function(a){var b=a.paragraphElement,d=a.memberId;a=a.timeStamp;var e,f="",g=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0];g?(f=g.getAttributeNS("urn:webodf:names:editinfo","id"),e=l[f]):(f=Math.random().toString(),e=new ops.EditInfo(b,m.getOdtDocument()),e=new gui.EditInfoMarker(e,c),g=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0],g.setAttributeNS("urn:webodf:names:editinfo","id",f),l[f]=e);e.addEdit(d,new Date(a))});k=document.createElementNS(e.namespaceURI, "style");k.type="text/css";k.media="screen, print, handheld, projection";k.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);"));e.appendChild(k)})()}}(); // Input 73 /* 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(h){this.createCaret=function(m,f){var n=m.getMemberId(),q=h.getSession().getOdtDocument(),e=q.getOdfCanvas().getElement(),a=new gui.Caret(m,f);n===h.getInputMemberId()&&(runtime.log("Starting to track input on new cursor of "+n),q.subscribe(ops.OdtDocument.signalParagraphChanged,function(e){e.memberId===n&&a.ensureVisible()}),m.handleUpdate=a.ensureVisible,e.setAttribute("tabindex",0),e.onfocus=a.setFocus,e.onblur=a.removeFocus,e.focus());return a}}; // Input 74 runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Namespaces"); gui.PresenterUI=function(){var h=new xmldom.XPath;return function(m){var f=this;f.setInitialSlideMode=function(){f.startSlideMode("single")};f.keyDownHandler=function(h){if(!h.target.isContentEditable&&"input"!==h.target.nodeName)switch(h.keyCode){case 84:f.toggleToolbar();break;case 37:case 8:f.prevSlide();break;case 39:case 32:f.nextSlide();break;case 36:f.firstSlide();break;case 35:f.lastSlide()}};f.root=function(){return f.odf_canvas.odfContainer().rootElement};f.firstSlide=function(){f.slideChange(function(f, h){return 0})};f.lastSlide=function(){f.slideChange(function(f,h){return h-1})};f.nextSlide=function(){f.slideChange(function(f,h){return f+1f?-1:f-1})};f.slideChange=function(h){var m=f.getPages(f.odf_canvas.odfContainer().rootElement),e=-1,a=0;m.forEach(function(f){f=f[1];f.hasAttribute("slide_current")&&(e=a,f.removeAttribute("slide_current"));a+=1});h=h(e,m.length);-1===h&&(h=e);m[h][1].setAttribute("slide_current","1"); document.getElementById("pagelist").selectedIndex=h;"cont"===f.slide_mode&&window.scrollBy(0,m[h][1].getBoundingClientRect().top-30)};f.selectSlide=function(h){f.slideChange(function(f,e){return h>=e||0>h?-1:h})};f.scrollIntoContView=function(h){var m=f.getPages(f.odf_canvas.odfContainer().rootElement);0!==m.length&&window.scrollBy(0,m[h][1].getBoundingClientRect().top-30)};f.getPages=function(f){f=f.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var h=[],e;for(e=0;e=a.rangeCount||!t)||(a=a.getRangeAt(0),t.setPoint(a.startContainer,a.startOffset))}function e(){var a=h.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();t&&t.node()&&(b=t.node(),c=b.ownerDocument.createRange(), c.setStart(b,t.position()),c.collapse(!0),a.addRange(c))}function a(a){var b=a.charCode||a.keyCode;if(t=null,t&&37===b)q(),t.stepBackward(),e();else if(16<=b&&20>=b||33<=b&&40>=b)return;n(a)}function g(a){}function d(a){h.ownerDocument.defaultView.getSelection().getRangeAt(0);n(a)}function b(a){for(var c=a.firstChild;c&&c!==a;)c.nodeType===Node.ELEMENT_NODE&&b(c),c=c.nextSibling||c.parentNode;var d,e,f,c=a.attributes;d="";for(f=c.length-1;0<=f;f-=1)e=c.item(f),d=d+" "+e.nodeName+'="'+e.nodeValue+ '"';a.setAttribute("customns_name",a.nodeName);a.setAttribute("customns_atts",d);c=a.firstChild;for(e=/^\s*$/;c&&c!==a;)d=c,c=c.nextSibling||c.parentNode,d.nodeType===Node.TEXT_NODE&&e.test(d.nodeValue)&&d.parentNode.removeChild(d)}function r(a,b){for(var c=a.firstChild,d,e,f;c&&c!==a;){if(c.nodeType===Node.ELEMENT_NODE)for(r(c,b),d=c.attributes,f=d.length-1;0<=f;f-=1)e=d.item(f),"http://www.w3.org/2000/xmlns/"!==e.namespaceURI||b[e.nodeValue]||(b[e.nodeValue]=e.localName);c=c.nextSibling||c.parentNode}} function k(){var a=h.ownerDocument.createElement("style"),b;b={};r(h,b);var c={},d,e,f=0;for(d in b)if(b.hasOwnProperty(d)&&d){e=b[d];if(!e||c.hasOwnProperty(e)||"xmlns"===e){do e="ns"+f,f+=1;while(c.hasOwnProperty(e));b[d]=e}c[e]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+l;a.appendChild(h.ownerDocument.createTextNode(b));m=m.parentNode.replaceChild(a,m)}var l,c,u,t=null;h.id||(h.id="xml"+String(Math.random()).substring(2));c="#"+h.id+" ";l=c+"*,"+c+":visited, "+c+":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"+ c+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+c+":after {color: blue; content: '';}\n"+c+"{overflow: auto;}\n";(function(b){f(b,"click",d);f(b,"keydown",a);f(b,"keypress",g);f(b,"drop",n);f(b,"dragend",n);f(b,"beforepaste",n);f(b,"paste",n)})(h);this.updateCSS=k;this.setXML=function(a){a=a.documentElement||a;u=a=h.ownerDocument.importNode(a,!0);for(b(a);h.lastChild;)h.removeChild(h.lastChild);h.appendChild(a);k();t=new core.PositionIterator(a)}; this.getXML=function(){return u}}; // Input 76 /* Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ gui.UndoManager=function(){};gui.UndoManager.prototype.subscribe=function(h,m){};gui.UndoManager.prototype.unsubscribe=function(h,m){};gui.UndoManager.prototype.setOdtDocument=function(h){};gui.UndoManager.prototype.saveInitialState=function(){};gui.UndoManager.prototype.resetInitialState=function(){};gui.UndoManager.prototype.setPlaybackFunction=function(h){};gui.UndoManager.prototype.hasUndoStates=function(){};gui.UndoManager.prototype.hasRedoStates=function(){}; gui.UndoManager.prototype.moveForward=function(h){};gui.UndoManager.prototype.moveBackward=function(h){};gui.UndoManager.prototype.onOperationExecuted=function(h){};gui.UndoManager.signalUndoStackChanged="undoStackChanged";gui.UndoManager.signalUndoStateCreated="undoStateCreated";gui.UndoManager.signalUndoStateModified="undoStateModified";(function(){return gui.UndoManager})(); // Input 77 /* Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ gui.UndoStateRules=function(){function h(f){return f.spec().optype}function m(f){switch(h(f)){case "MoveCursor":case "AddCursor":case "RemoveCursor":return!1;default:return!0}}this.getOpType=h;this.isEditOperation=m;this.isPartOfOperationSet=function(f,n){if(m(f)){if(0===n.length)return!0;var q;if(q=m(n[n.length-1]))a:{q=n.filter(m);var e=h(f),a;b:switch(e){case "RemoveText":case "InsertText":a=!0;break b;default:a=!1}if(a&&e===h(q[0])){if(1===q.length){q=!0;break a}e=q[q.length-2].spec().position; q=q[q.length-1].spec().position;a=f.spec().position;if(q===a-(q-e)){q=!0;break a}}q=!1}return q}return!0}}; // Input 78 /* Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("gui.UndoManager");runtime.loadClass("gui.UndoStateRules"); gui.TrivialUndoManager=function(h){function m(){k.emit(gui.UndoManager.signalUndoStackChanged,{undoAvailable:n.hasUndoStates(),redoAvailable:n.hasRedoStates()})}function f(){d!==e&&d!==b[b.length-1]&&b.push(d)}var n=this,q,e,a,g,d=[],b=[],r=[],k=new core.EventNotifier([gui.UndoManager.signalUndoStackChanged,gui.UndoManager.signalUndoStateCreated,gui.UndoManager.signalUndoStateModified,gui.TrivialUndoManager.signalDocumentRootReplaced]),l=h||new gui.UndoStateRules;this.subscribe=function(a,b){k.subscribe(a, b)};this.unsubscribe=function(a,b){k.unsubscribe(a,b)};this.hasUndoStates=function(){return 0 @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.EventNotifier");runtime.loadClass("odf.OdfUtils"); ops.OdtDocument=function(h){function m(){var a=h.odfContainer().getContentElement(),b=a&&a.localName;runtime.assert("text"===b,"Unsupported content element type '"+b+"'for OdtDocument");return a}function f(a){var b=gui.SelectionMover.createPositionIterator(m());for(a+=1;0=g;g+=1)c=a.container(),d=a.unfilteredDomOffset(),c.nodeType===Node.TEXT_NODE&&(" "===c.data[d]&&b.isSignificantWhitespace(c,d))&&e(c,d),a.nextPosition()};this.getParagraphStyleElement=q;this.getParagraphElement=n;this.getParagraphStyleAttributes= function(a){return(a=q(a))?h.getFormatting().getInheritedStyleAttributes(a):null};this.getPositionInTextNode=function(a,b){var e=gui.SelectionMover.createPositionIterator(m()),f=null,g,h=0,k=null;runtime.assert(0<=a,"position must be >= 0");1===d.acceptPosition(e)?(g=e.container(),g.nodeType===Node.TEXT_NODE&&(f=g,h=0)):a+=1;for(;0 @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("ops.TrivialUserModel");runtime.loadClass("ops.TrivialOperationRouter");runtime.loadClass("ops.OperationFactory");runtime.loadClass("ops.OdtDocument"); ops.Session=function(h){var m=new ops.OperationFactory,f=new ops.OdtDocument(h),n=new ops.TrivialUserModel,q=null;this.setUserModel=function(e){n=e};this.setOperationFactory=function(e){m=e;q&&q.setOperationFactory(m)};this.setOperationRouter=function(e){q=e;e.setPlaybackFunction(function(a){a.execute(f);f.emit(ops.OdtDocument.signalOperationExecuted,a)});e.setOperationFactory(m)};this.getUserModel=function(){return n};this.getOperationFactory=function(){return m};this.getOdtDocument=function(){return f}; this.enqueue=function(e){q.push(e)};this.setOperationRouter(new ops.TrivialOperationRouter)}; // Input 81 var webodf_css="@namespace draw url(urn:oasis:names:tc:opendocument:xmlns:drawing:1.0);\n@namespace fo url(urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0);\n@namespace office url(urn:oasis:names:tc:opendocument:xmlns:office:1.0);\n@namespace presentation url(urn:oasis:names:tc:opendocument:xmlns:presentation:1.0);\n@namespace style url(urn:oasis:names:tc:opendocument:xmlns:style:1.0);\n@namespace svg url(urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0);\n@namespace table url(urn:oasis:names:tc:opendocument:xmlns:table:1.0);\n@namespace text url(urn:oasis:names:tc:opendocument:xmlns:text:1.0);\n@namespace runtimens url(urn:webodf); /* namespace for runtime only */\n@namespace cursor url(urn:webodf:names:cursor);\n@namespace editinfo url(urn:webodf:names:editinfo);\n\noffice|document > *, office|document-content > * {\n display: none;\n}\noffice|body, office|document {\n display: inline-block;\n position: relative;\n}\n\ntext|p, text|h {\n display: block;\n padding: 0;\n margin: 0;\n line-height: normal;\n position: relative;\n min-height: 1.3em; /* prevent empty paragraphs and headings from collapsing if they are empty */\n}\n*[runtimens|containsparagraphanchor] {\n position: relative;\n}\ntext|s {\n white-space: pre;\n}\ntext|tab {\n display: inline;\n white-space: pre;\n}\ntext|line-break {\n content: \" \";\n display: block;\n}\ntext|tracked-changes {\n /*Consumers that do not support change tracking, should ignore changes.*/\n display: none;\n}\noffice|binary-data {\n display: none;\n}\noffice|text {\n display: block;\n text-align: left;\n overflow: visible;\n word-wrap: break-word;\n}\n\noffice|text::selection {\n /** Let's not draw selection highlight that overflows into the office|text\n * node when selecting content across several paragraphs\n */\n background: transparent;\n}\n\noffice|spreadsheet {\n display: block;\n border-collapse: collapse;\n empty-cells: show;\n font-family: sans-serif;\n font-size: 10pt;\n text-align: left;\n page-break-inside: avoid;\n overflow: hidden;\n}\noffice|presentation {\n display: inline-block;\n text-align: left;\n}\n#shadowContent {\n display: inline-block;\n text-align: left;\n}\ndraw|page {\n display: block;\n position: relative;\n overflow: hidden;\n}\npresentation|notes, presentation|footer-decl, presentation|date-time-decl {\n display: none;\n}\n@media print {\n draw|page {\n border: 1pt solid black;\n page-break-inside: avoid;\n }\n presentation|notes {\n /*TODO*/\n }\n}\noffice|spreadsheet text|p {\n border: 0px;\n padding: 1px;\n margin: 0px;\n}\noffice|spreadsheet table|table {\n margin: 3px;\n}\noffice|spreadsheet table|table:after {\n /* show sheet name the end of the sheet */\n /*content: attr(table|name);*/ /* gives parsing error in opera */\n}\noffice|spreadsheet table|table-row {\n counter-increment: row;\n}\noffice|spreadsheet table|table-row:before {\n width: 3em;\n background: #cccccc;\n border: 1px solid black;\n text-align: center;\n content: counter(row);\n display: table-cell;\n}\noffice|spreadsheet table|table-cell {\n border: 1px solid #cccccc;\n}\ntable|table {\n display: table;\n}\ndraw|frame table|table {\n width: 100%;\n height: 100%;\n background: white;\n}\ntable|table-header-rows {\n display: table-header-group;\n}\ntable|table-row {\n display: table-row;\n}\ntable|table-column {\n display: table-column;\n}\ntable|table-cell {\n width: 0.889in;\n display: table-cell;\n word-break: break-all; /* prevent long words from extending out the table cell */\n}\ndraw|frame {\n display: block;\n}\ndraw|image {\n display: block;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n -moz-background-size: 100% 100%;\n}\n/* only show the first image in frame */\ndraw|frame > draw|image:nth-of-type(n+2) {\n display: none;\n}\ntext|list:before {\n display: none;\n content:\"\";\n}\ntext|list {\n counter-reset: list;\n}\ntext|list-item {\n display: block;\n}\ntext|number {\n display:none;\n}\n\ntext|a {\n color: blue;\n text-decoration: underline;\n cursor: pointer;\n}\ntext|note-citation {\n vertical-align: super;\n font-size: smaller;\n}\ntext|note-body {\n display: none;\n}\ntext|note:hover text|note-citation {\n background: #dddddd;\n}\ntext|note:hover text|note-body {\n display: block;\n left:1em;\n max-width: 80%;\n position: absolute;\n background: #ffffaa;\n}\nsvg|title, svg|desc {\n display: none;\n}\nvideo {\n width: 100%;\n height: 100%\n}\n\n/* below set up the cursor */\ncursor|cursor {\n display: inline;\n width: 0px;\n height: 1em;\n /* making the position relative enables the avatar to use\n the cursor as reference for its absolute position */\n position: relative;\n}\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";