// 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(n){};Runtime.prototype.getVariable=function(n){};Runtime.prototype.toJson=function(n){};Runtime.prototype.fromJson=function(n){};Runtime.ByteArray.prototype.slice=function(n,m){};Runtime.ByteArray.prototype.length=0;Runtime.prototype.byteArrayFromArray=function(n){};Runtime.prototype.byteArrayFromString=function(n,m){};Runtime.prototype.byteArrayToString=function(n,m){};Runtime.prototype.concatByteArrays=function(n,m){}; Runtime.prototype.read=function(n,m,l,d){};Runtime.prototype.readFile=function(n,m,l){};Runtime.prototype.readFileSync=function(n,m){};Runtime.prototype.loadXML=function(n,m){};Runtime.prototype.writeFile=function(n,m,l){};Runtime.prototype.isFile=function(n,m){};Runtime.prototype.getFileSize=function(n,m){};Runtime.prototype.deleteFile=function(n,m){};Runtime.prototype.log=function(n,m){};Runtime.prototype.setTimeout=function(n,m){};Runtime.prototype.clearTimeout=function(n){}; Runtime.prototype.libraryPaths=function(){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.parseXML=function(n){};Runtime.prototype.getWindow=function(){};Runtime.prototype.assert=function(n,m,l){};var IS_COMPILED_CODE=!0; Runtime.byteArrayToString=function(n,m){function l(b){var a="",h,f=b.length;for(h=0;hc?a+=String.fromCharCode(c):(h+=1,d=b[h],194<=c&&224>c?a+=String.fromCharCode((c&31)<<6|d&63):(h+=1,k=b[h],224<=c&&240>c?a+=String.fromCharCode((c&15)<<12|(d&63)<<6|k&63):(h+=1,q=b[h],240<=c&&245>c&&(c=(c&7)<<18|(d&63)<<12|(k&63)<<6|q&63,c-=65536,a+=String.fromCharCode((c>>10)+55296,(c&1023)+56320))))); return a}var b;"utf8"===m?b=d(n):("binary"!==m&&this.log("Unsupported encoding: "+m),b=l(n));return b};Runtime.getVariable=function(n){try{return eval(n)}catch(m){}};Runtime.toJson=function(n){return JSON.stringify(n)};Runtime.fromJson=function(n){return JSON.parse(n)};Runtime.getFunctionName=function(n){return void 0===n.name?(n=/function\s+(\w+)/.exec(n))&&n[1]:n.name}; function BrowserRuntime(n){function m(a,h){var f,c,b;void 0!==h?b=a:h=a;n?(c=n.ownerDocument,b&&(f=c.createElement("span"),f.className=b,f.appendChild(c.createTextNode(b)),n.appendChild(f),n.appendChild(c.createTextNode(" "))),f=c.createElement("span"),0k?(c[q]=k,q+=1):2048>k?(c[q]=192|k>>>6,c[q+1]=128|k&63,q+=2):(c[q]=224|k>>>12&15,c[q+1]=128|k>>>6&63,c[q+2]=128|k&63,q+=3)}else for("binary"!== h&&d.log("unknown encoding: "+h),f=a.length,c=new d.ByteArray(f),b=0;bc.status||0===c.status?f(null):f("Status "+String(c.status)+": "+c.responseText|| c.statusText):f("File "+a+" is empty."))};h=h.buffer&&!c.sendAsBinary?h.buffer:d.byteArrayToString(h,"binary");try{c.sendAsBinary?c.sendAsBinary(h):c.send(h)}catch(e){d.log("HUH? "+e+" "+h),f(e.message)}};this.deleteFile=function(a,h){delete b[a];var f=new XMLHttpRequest;f.open("DELETE",a,!0);f.onreadystatechange=function(){4===f.readyState&&(200>f.status&&300<=f.status?h(f.responseText):h(null))};f.send(null)};this.loadXML=function(a,h){var f=new XMLHttpRequest;f.open("GET",a,!0);f.overrideMimeType&& f.overrideMimeType("text/xml");f.onreadystatechange=function(){4===f.readyState&&(0!==f.status||f.responseText?200===f.status||0===f.status?h(null,f.responseXML):h(f.responseText):h("File "+a+" is empty."))};try{f.send(null)}catch(c){h(c.message)}};this.isFile=function(a,h){d.getFileSize(a,function(a){h(-1!==a)})};this.getFileSize=function(a,h){var f=new XMLHttpRequest;f.open("HEAD",a,!0);f.onreadystatechange=function(){if(4===f.readyState){var c=f.getResponseHeader("Content-Length");c?h(parseInt(c, 10)):l(a,"binary",function(c,a){c?h(-1):h(a.length)})}};f.send(null)};this.log=m;this.assert=function(a,h,f){if(!a)throw m("alert","ASSERTION FAILED:\n"+h),f&&f(),h;};this.setTimeout=function(a,h){return setTimeout(function(){a()},h)};this.clearTimeout=function(a){clearTimeout(a)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML=function(a){return(new DOMParser).parseFromString(a, "text/xml")};this.exit=function(a){m("Calling exit with code "+String(a)+", but exit() is not implemented.")};this.getWindow=function(){return window}} function NodeJSRuntime(){function n(a,f,c){a=d.resolve(b,a);"binary"!==f?l.readFile(a,f,c):l.readFile(a,null,c)}var m=this,l=require("fs"),d=require("path"),b="",e,a;this.ByteArray=function(a){return new Buffer(a)};this.byteArrayFromArray=function(a){var f=new Buffer(a.length),c,b=a.length;for(c=0;c").implementation} function RhinoRuntime(){function n(a,b){var f;void 0!==b?f=a:b=a;"alert"===f&&print("\n!!!!! ALERT !!!!!");print(b);"alert"===f&&print("!!!!! ALERT !!!!!")}var m=this,l=Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(),d,b,e="";l.setValidating(!1);l.setNamespaceAware(!0);l.setExpandEntityReferences(!1);l.setSchema(null);b=Packages.org.xml.sax.EntityResolver({resolveEntity:function(a,b){var f=new Packages.java.io.FileReader(b);return new Packages.org.xml.sax.InputSource(f)}});d=l.newDocumentBuilder(); d.setEntityResolver(b);this.ByteArray=function(a){return[a]};this.byteArrayFromArray=function(a){return a};this.byteArrayFromString=function(a,b){var f=[],c,d=a.length;for(c=0;c>>18],b+=p[a>>>12&63],b+=p[a>>>6&63],b+=p[a&63];g===k+1?(a=c[g]<<4,b+=p[a>>>6],b+=p[a&63],b+="=="):g===k&&(a=c[g]<<10|c[g+1]<<2,b+=p[a>>>12],b+=p[a>>>6&63],b+=p[a&63],b+="=");return b}function l(c){c=c.replace(/[^A-Za-z0-9+\/]+/g,"");var a=[],b=c.length%4,g,k=c.length,f;for(g=0;g>16,f>>8&255,f&255);a.length-=[0,0,2,1][b];return a}function d(c){var a=[],b,g=c.length,k;for(b=0;bk?a.push(k):2048>k?a.push(192|k>>>6,128|k&63):a.push(224|k>>>12&15,128|k>>>6&63,128|k&63);return a}function b(c){var a=[],b,g=c.length,k,f,p;for(b=0;bk?a.push(k):(b+=1,f=c[b],224>k?a.push((k&31)<<6|f&63):(b+=1,p=c[b],a.push((k&15)<<12|(f&63)<<6|p&63)));return a}function e(c){return m(n(c))} function a(c){return String.fromCharCode.apply(String,l(c))}function h(c){return b(n(c))}function f(c){c=b(c);for(var a="",g=0;ga?g+=String.fromCharCode(a):(p+=1,k=c.charCodeAt(p)&255,224>a?g+=String.fromCharCode((a&31)<<6|k&63):(p+=1,f=c.charCodeAt(p)&255,g+=String.fromCharCode((a&15)<<12|(k&63)<<6|f&63)));return g}function t(a,b){function g(){var d= p+k;d>a.length&&(d=a.length);f+=c(a,p,d);p=d;d=p===a.length;b(f,d)&&!d&&runtime.setTimeout(g,0)}var k=1E5,f="",p=0;a.length>>8):(ta(a&255),ta(a>>>8))},na=function(){s=(s<<5^g[z+3-1]&255)&8191;v=w[32768+s];w[z&32767]=v;w[32768+s]=z},ga=function(c,a){A>16-a?(u|=c<>16-A,A+=a-16):(u|=c<c;c++)g[c]=g[c+32768];P-=32768;z-=32768;y-=32768;for(c=0;8192>c;c++)a=w[32768+c],w[32768+c]=32768<=a?a-32768:0;for(c=0;32768>c;c++)a=w[c],w[c]=32768<=a?a-32768:0;b+=32768}C||(c=qa(g,z+K,b),0>=c?C=!0:K+=c)},Ca=function(c){var a=M,b=z,k,f=O,p=32506=aa&&(a>>=2);do if(k=c,g[k+f]===h&&g[k+f-1]===q&&g[k]===g[b]&&g[++k]===g[b+1]){b+= 2;k++;do++b;while(g[b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&g[++b]===g[++k]&&bf){P=c;f=k;if(258<=k)break;q=g[b+f-1];h=g[b+f]}c=w[c&32767]}while(c>p&&0!==--a);return f},xa=function(c,a){r[V++]=a;0===c?ba[a].fc++:(c--,ba[oa[a]+256+1].fc++,ea[(256>c?L[c]:L[256+(c>>7)])&255].fc++,p[T++]=c,Z|=ka);ka<<=1;0===(V&7)&&(pa[ha++]=Z,Z=0,ka=1);if(2k;k++)b+=ea[k].fc* (5+sa[k]);b>>=3;if(T>=1,b<<=1;while(0<--a);return b>>1},Ea=function(c,a){var b=[];b.length=16;var g=0,k;for(k=1;15>=k;k++)g=g+S[k-1]<<1,b[k]=g;for(g=0;g<=a;g++)k=c[g].dl,0!==k&&(c[g].fc=Da(b[k]++,k))},Ba=function(c){var a=c.dyn_tree,b=c.static_tree,g=c.elems,k,f=-1, p=g;$=0;Y=573;for(k=0;k$;)k=R[++$]=2>f?++f:0,a[k].fc=1,fa[k]=0,la--,null!==b&&(X-=b[k].dl);c.max_code=f;for(k=$>>1;1<=k;k--)Aa(a,k);do k=R[1],R[1]=R[$--],Aa(a,1),b=R[1],R[--Y]=k,R[--Y]=b,a[p].fc=a[k].fc+a[b].fc,fa[p]=fa[k]>fa[b]+1?fa[k]:fa[b]+1,a[k].dl=a[b].dl=p,R[1]=p++,Aa(a,1);while(2<=$);R[--Y]=R[1];p=c.dyn_tree;k=c.extra_bits;var g=c.extra_base,b=c.max_code,d=c.max_length,q=c.static_tree,h,e,r,s,l=0;for(e=0;15>=e;e++)S[e]=0;p[R[Y]].dl=0; for(c=Y+1;573>c;c++)h=R[c],e=p[p[h].dl].dl+1,e>d&&(e=d,l++),p[h].dl=e,h>b||(S[e]++,r=0,h>=g&&(r=k[h-g]),s=p[h].fc,la+=s*(e+r),null!==q&&(X+=s*(q[h].dl+r)));if(0!==l){do{for(e=d-1;0===S[e];)e--;S[e]--;S[e+1]+=2;S[d]--;l-=2}while(0b||(p[k].dl!==e&&(la+=(e-p[k].dl)*p[k].fc,p[k].fc=e),h--)}Ea(a,f)},Fa=function(c,a){var b,g=-1,k,f=c[0].dl,p=0,d=7,h=4;0===f&&(d=138,h=3);c[a+1].dl=65535;for(b=0;b<=a;b++)k=f,f=c[b+1].dl,++p=p?U[17].fc++:U[18].fc++,p=0,g=k,0===f?(d=138,h=3):k===f?(d=6,h=3):(d=7,h=4))},Ga=function(){8b?L[b]:L[256+(b>>7)])&255,H(h,a),e=sa[h],0!==e&&(b-=ia[h],ga(b,e))),d>>=1;while(k=p?(H(17,U),ga(p-3,3)):(H(18,U),ga(p-11,7));p=0;k=g;0===f?(d=138,h=3):g===f?(d=6,h=3):(d=7,h=4)}},Ja=function(){var c;for(c=0;286>c;c++)ba[c].fc=0;for(c=0;30>c;c++)ea[c].fc=0;for(c=0;19>c;c++)U[c].fc=0;ba[256].fc=1;Z=V=T=ha=la=X=0;ka=1},ya=function(c){var a,b,k,f;f=z-y;pa[ha]=Z;Ba(N);Ba(D);Fa(ba,N.max_code);Fa(ea,D.max_code);Ba(I);for(k=18;3<=k&&0===U[J[k]].dl;k--); la+=3*(k+1)+14;a=la+3+7>>3;b=X+3+7>>3;b<=a&&(a=b);if(f+4<=a&&0<=y)for(ga(0+c,3),Ga(),ja(f),ja(~f),k=0;ka.len&&(d=a.len);for(h=0;ht-k&&(d=t-k);for(h=0;he;e++)for(G[e]= h,d=0;d<1<e;e++)for(ia[e]=h,d=0;d<1<>=7;30>e;e++)for(ia[e]=h<<7,d=0;d<1<=d;d++)S[d]=0;for(d=0;143>=d;)Q[d++].dl=8,S[8]++;for(;255>=d;)Q[d++].dl=9,S[9]++;for(;279>=d;)Q[d++].dl=7,S[7]++;for(;287>=d;)Q[d++].dl=8,S[8]++;Ea(Q,287);for(d=0;30>d;d++)W[d].dl=5,W[d].fc=Da(d,5);Ja()}for(d=0;8192>d;d++)w[32768+d]=0;ca=ra[da].max_lazy;aa=ra[da].good_length;M=ra[da].max_chain;y=z=0;K=qa(g,0,65536);if(0>= K)C=!0,K=0;else{for(C=!1;262>K&&!C;)za();for(d=s=0;2>d;d++)s=(s<<5^g[d]&255)&8191}a=null;k=t=0;3>=da?(O=2,E=0):(E=2,F=0);q=!1}f=!0;if(0===K)return q=!0,0}d=Ka(c,b,p);if(d===p)return p;if(q)return d;if(3>=da)for(;0!==K&&null===a;){na();0!==v&&32506>=z-v&&(E=Ca(v),E>K&&(E=K));if(3<=E)if(e=xa(z-P,E-3),K-=E,E<=ca){E--;do z++,na();while(0!==--E);z++}else z+=E,E=0,s=g[z]&255,s=(s<<5^g[z+1]&255)&8191;else e=xa(0,g[z]&255),K--,z++;e&&(ya(0),y=z);for(;262>K&&!C;)za()}else for(;0!==K&&null===a;){na();O=E;x= P;E=2;0!==v&&(O=z-v)&&(E=Ca(v),E>K&&(E=K),3===E&&4096K&&!C;)za()}0===K&&(0!==F&&xa(0,g[z-1]&255),ya(1),q=!0);return d+Ka(c,d+b,p-d)};this.deflate=function(k,d){var q,s;B=k;ma=0;"undefined"===String(typeof d)&&(d=6);(q=d)?1>q?q=1:9q;q++)ba[q]=new n;ea=[];ea.length=61;for(q=0;61>q;q++)ea[q]=new n;Q=[];Q.length=288;for(q=0;288>q;q++)Q[q]=new n;W=[];W.length=30;for(q=0;30>q;q++)W[q]=new n;U=[];U.length=39;for(q=0;39>q;q++)U[q]=new n;N=new m;D=new m;I=new m;S=[];S.length=16;R=[];R.length=573;fa=[];fa.length=573;oa=[];oa.length=256;L=[];L.length=512;G=[];G.length=29;ia=[];ia.length=30;pa=[];pa.length=1024}var l=Array(1024),u=[],v=[];for(q=La(l, 0,l.length);0>8&255])};this.appendUInt32LE=function(d){m.appendArray([d&255,d>>8&255,d>>16&255,d>>24&255])};this.appendString=function(d){l=runtime.concatByteArrays(l, runtime.byteArrayFromString(d,n))};this.getLength=function(){return l.length};this.getByteArray=function(){return l}}; // Input 6 core.RawInflate=function(){var n,m,l=null,d,b,e,a,h,f,c,t,k,q,g,p,r,w,u=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],A=[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],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],v=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[16,17,18, 0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=function(){this.list=this.next=null},E=function(){this.n=this.b=this.e=0;this.t=null},O=function(c,a,b,k,g,f){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var d=Array(this.BMAX+1),p,h,q,e,r,s,l,u=Array(this.BMAX+1),n,m,v,w=new E,y=Array(this.BMAX);e=Array(this.N_MAX);var t,A=Array(this.BMAX+1),z,x,C;C=this.root=null;for(r=0;rr&&(f=r);for(z=1<(z-=d[s])){this.status=2;this.m=f;return}if(0>(z-=d[r]))this.status=2,this.m=f;else{d[r]+=z;A[1]=s=0;n=d;m=1;for(v=2;0<--r;)A[v++]=s+=n[m++];n=c;r=m=0;do 0!=(s=n[m++])&&(e[A[s]++]=r);while(++rt+u[1+e];){t+=u[1+e];e++;x=(x=q-t)>f?f:x;if((h=1<<(s=l-t))>c+1)for(h-=c+1,v=l;++sp&&t>t-u[e],y[e-1][s].e=w.e,y[e-1][s].b=w.b,y[e-1][s].n=w.n,y[e-1][s].t=w.t)}w.b=l-t;m>=a?w.e=99:n[m]n[m]?16:15,w.n=n[m++]): (w.e=g[n[m]-b],w.n=k[n[m++]-b]);h=1<>t;s>=1)r^=s;for(r^=s;(r&(1<>=c;a-=c},K=function(a,b,f){var d,e,r;if(0==f)return 0;for(r=0;;){z(g);e=k.list[P(g)];for(d=e.e;16 f;f++)n[x[f]]=0;g=7;f=new O(n,19,19,null,null,g);if(0!=f.status)return-1;k=f.root;g=f.m;h=l+u;for(d=e=0;df)n[d++]=e=f;else if(16==f){z(2);f=3+P(2);C(2);if(d+f>h)return-1;for(;0h)return-1;for(;0D;D++)N[D]=8;for(;256>D;D++)N[D]=9;for(;280>D;D++)N[D]=7;for(;288>D;D++)N[D]=8;b=7;D=new O(N,288,257,A,y,b);if(0!=D.status){alert("HufBuild error: "+D.status);Q=-1;break b}l=D.root;b=D.m;for(D=0;30>D;D++)N[D]=5;M=5;D=new O(N,30,0,s,v,M);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(n,m){var l=Date.now(),d=0;this.check=function(){var b;if(n&&(b=Date.now(),b-l>n))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0m))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}}; // Input 8 core.Utils=function(){this.hashString=function(n){var m=0,l,d;l=0;for(d=n.length;l=l.compareBoundaryPoints(l.START_TO_START,d)&&0<=l.compareBoundaryPoints(l.END_TO_END,d)};this.rangesIntersect=function(l,d){return 0>=l.compareBoundaryPoints(l.END_TO_START,d)&&0<=l.compareBoundaryPoints(l.START_TO_END,d)};this.getNodesInRange=function(l,d){var b=[],e,a=l.startContainer.ownerDocument.createTreeWalker(l.commonAncestorContainer,NodeFilter.SHOW_ALL,d,!1);for(e=a.currentNode=l.startContainer;e;){if(d(e)=== NodeFilter.FILTER_ACCEPT)b.push(e);else if(d(e)===NodeFilter.FILTER_REJECT)break;e=e.parentNode}b.reverse();for(e=a.nextNode();e;)b.push(e),e=a.nextNode();return b};this.normalizeTextNodes=function(l){l&&l.nextSibling&&(l=n(l,l.nextSibling));l&&l.previousSibling&&n(l.previousSibling,l)};this.rangeContainsNode=function(l,d){var b=d.ownerDocument.createRange(),e=d.nodeType===Node.TEXT_NODE?d.length:d.childNodes.length;b.setStart(l.startContainer,l.startOffset);b.setEnd(l.endContainer,l.endOffset);e= 0===b.comparePoint(d,0)&&0===b.comparePoint(d,e);b.detach();return e};this.mergeIntoParent=function(l){for(var d=l.parentNode;l.firstChild;)d.insertBefore(l.firstChild,l);d.removeChild(l);return d};this.getElementsByTagNameNS=function(l,d,b){return Array.prototype.slice.call(l.getElementsByTagNameNS(d,b))};this.rangeIntersectsNode=function(l,d){var b=d.nodeType===Node.TEXT_NODE?d.length:d.childNodes.length;return 0>=l.comparePoint(d,0)&&0<=l.comparePoint(d,b)};this.containsNode=function(l,d){return l=== d||l.contains(d)};(function(l){var d=runtime.getWindow();null!==d&&(d=d.navigator.appVersion.toLowerCase(),d=-1===d.indexOf("chrome")&&(-1!==d.indexOf("applewebkit")||-1!==d.indexOf("safari")))&&(l.containsNode=m)})(this)}; // Input 10 runtime.loadClass("core.DomUtils"); core.Cursor=function(n,m){function l(c){c.parentNode&&(h.push(c.previousSibling),h.push(c.nextSibling),c.parentNode.removeChild(c))}function d(c,a,b){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<=b&&b<=a.length,"putCursorIntoTextNode: offset is out of bounds");0===b?d.insertBefore(c,a):(b!==a.length&&a.splitText(b),d.insertBefore(c, 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(n){var m={};this.emit=function(l,d){var b,e;runtime.assert(m.hasOwnProperty(l),'unknown event fired "'+l+'"');e=m[l];for(b=0;b1/e?"-0":String(e),n(c+" should be "+a+". Was "+d+".")):n(c+" should be "+a+" (of type "+typeof a+"). Was "+e+" (of type "+typeof e+").")}var a=0,h;h=function(a,c){var d=Object.keys(a),k=Object.keys(c);d.sort();k.sort();return m(d,k)&&Object.keys(a).every(function(k){var g= a[k],d=c[k];return b(g,d)?!0:(n(g+" should be "+d+" for key "+k),!1)})};this.areNodesEqual=d;this.shouldBeNull=function(a,c){e(a,c,"null")};this.shouldBeNonNull=function(a,c){var b,k;try{k=eval(c)}catch(d){b=d}b?n(c+" should be non-null. Threw exception "+b):null!==k?runtime.log("pass",c+" is non-null."):n(c+" should be non-null. Was "+k)};this.shouldBe=e;this.countFailedTests=function(){return a}}; core.UnitTester=function(){function n(d,b){return""+d+""}var m=0,l={};this.runTests=function(d,b,e){function a(k){if(0===k.length)l[h]=t,m+=f.countFailedTests(),b();else{q=k[0];var d=Runtime.getFunctionName(q);runtime.log("Running "+d);p=f.countFailedTests();c.setUp();q(function(){c.tearDown();t[d]=p===f.countFailedTests();a(k.slice(1))})}}var h=Runtime.getFunctionName(d),f=new core.UnitTestRunner,c=new d(f),t={},k,q,g,p,r="BrowserRuntime"=== runtime.type();if(l.hasOwnProperty(h))runtime.log("Test "+h+" has already run.");else{r?runtime.log("Running "+n(h,'runSuite("'+h+'");')+": "+c.description()+""):runtime.log("Running "+h+": "+c.description);g=c.tests();for(k=0;kRunning "+n(d,'runTest("'+h+'","'+d+'")')+""):runtime.log("Running "+d),p=f.countFailedTests(),c.setUp(),q(),c.tearDown(),t[d]=p===f.countFailedTests()); a(c.asyncTests())}};this.countFailedTests=function(){return m};this.results=function(){return l}}; // Input 13 core.PositionIterator=function(n,m,l,d){function b(){this.acceptNode=function(c){return c.nodeType===Node.TEXT_NODE&&0===c.length?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}function e(c){this.acceptNode=function(a){return a.nodeType===Node.TEXT_NODE&&0===a.length?NodeFilter.FILTER_REJECT:c.acceptNode(a)}}function a(){var a=f.currentNode.nodeType;c=a===Node.TEXT_NODE?f.currentNode.length-1:a===Node.ELEMENT_NODE?1:0}var h=this,f,c,t;this.nextPosition=function(){if(f.currentNode===n)return!1; if(0===c&&f.currentNode.nodeType===Node.ELEMENT_NODE)null===f.firstChild()&&(c=1);else if(f.currentNode.nodeType===Node.TEXT_NODE&&c+1 "+a.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"), b===a.length&&(c=void 0,f.nextSibling()?c=0:f.parentNode()&&(c=1),runtime.assert(void 0!==c,"Error in setPosition: position not valid.")),!0;d=t(a);b>>8^k;return b^-1}function d(a){return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&15,a>>5&63,(a&31)<<1)}function b(a){var c=a.getFullYear();return 1980>c?0:c-1980<< 25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function e(a,c){var b,g,k,f,e,h,r,q=this;this.load=function(c){if(void 0!==q.data)c(null,q.data);else{var b=e+34+g+k+256;b+r>p&&(b=p-r);runtime.read(a,r,b,function(b,d){if(b||null===d)c(b,d);else a:{var g=d,k=new core.ByteArray(g),p=k.readUInt32LE(),r;if(67324752!==p)c("File entry signature is wrong."+p.toString()+" "+g.length.toString(),null);else{k.pos+=22;p=k.readUInt16LE();r=k.readUInt16LE();k.pos+=p+r; if(f){g=g.slice(k.pos,k.pos+e);if(e!==g.length){c("The amount of compressed bytes read was "+g.length.toString()+" instead of "+e.toString()+" for "+q.filename+" in "+a+".",null);break a}g=w(g,h)}else g=g.slice(k.pos,k.pos+h);h!==g.length?c("The amount of bytes read was "+g.length.toString()+" instead of "+h.toString()+" for "+q.filename+" in "+a+".",null):(q.data=g,c(null,g))}}})}};this.set=function(a,c,b,d){q.filename=a;q.data=c;q.compressed=b;q.date=d};this.error=null;c&&(b=c.readUInt32LE(),33639248!== b?this.error="Central directory entry has wrong signature at position "+(c.pos-4).toString()+' for file "'+a+'": '+c.data.length.toString():(c.pos+=6,f=c.readUInt16LE(),this.date=d(c.readUInt32LE()),c.readUInt32LE(),e=c.readUInt32LE(),h=c.readUInt32LE(),g=c.readUInt16LE(),k=c.readUInt16LE(),b=c.readUInt16LE(),c.pos+=8,r=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.slice(c.pos,c.pos+g),"utf8"),c.pos+=g+k+b))}function a(a,c){if(22!==a.length)c("Central directory length should be 22.", u);else{var b=new core.ByteArray(a),d;d=b.readUInt32LE();101010256!==d?c("Central directory signature is wrong: "+d.toString(),u):(d=b.readUInt16LE(),0!==d?c("Zip files with non-zero disk numbers are not supported.",u):(d=b.readUInt16LE(),0!==d?c("Zip files with non-zero disk numbers are not supported.",u):(d=b.readUInt16LE(),r=b.readUInt16LE(),d!==r?c("Number of entries is inconsistent.",u):(d=b.readUInt32LE(),b=b.readUInt16LE(),b=p-22-d,runtime.read(n,b,p-b,function(a,b){if(a||null===b)c(a,u);else a:{var d= new core.ByteArray(b),k,f;g=[];for(k=0;kp?m("File '"+n+"' cannot be read.",u):runtime.read(n,p-22,22,function(c,b){c||null===m||null===b?m(c,u):a(b,m)})})}; // Input 18 core.CSSUnits=function(){var n={"in":1,cm:2.54,mm:25.4,pt:72,pc:12};this.convert=function(m,l,d){return m*n[d]/n[l]};this.convertMeasure=function(n,l){var d,b;n&&l?(d=parseFloat(n),b=n.replace(d.toString(),""),d=this.convert(d,b,l)):d="";return d.toString()};this.getUnits=function(n){return n.substr(n.length-2,n.length)}}; // Input 19 xmldom.LSSerializerFilter=function(){}; // Input 20 "function"!==typeof Object.create&&(Object.create=function(n){var m=function(){};m.prototype=n;return new m}); xmldom.LSSerializer=function(){function n(b){var d=b||{},a=function(a){var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[a[b]]=b);return c}(b),h=[d],f=[a],c=0;this.push=function(){c+=1;d=h[c]=Object.create(d);a=f[c]=Object.create(a)};this.pop=function(){h[c]=void 0;f[c]=void 0;c-=1;d=h[c];a=f[c]};this.getLocalNamespaceDefinitions=function(){return a};this.getQName=function(c){var b=c.namespaceURI,f=0,g;if(!b)return c.localName;if(g=a[b])return g+":"+c.localName;do{g||!c.prefix?(g="ns"+f,f+=1):g=c.prefix; if(d[g]===b)break;if(!d[g]){d[g]=b;a[b]=g;break}g=null}while(null===g);return g+":"+c.localName}}function m(b){return b.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")}function l(b,e){var a="",h=d.filter?d.filter.acceptNode(e):NodeFilter.FILTER_ACCEPT,f;if(h===NodeFilter.FILTER_ACCEPT&&e.nodeType===Node.ELEMENT_NODE){b.push();f=b.getQName(e);var c,n=e.attributes,k,q,g,p="",r;c="<"+f;k=n.length;for(q=0;q")}if(h===NodeFilter.FILTER_ACCEPT||h===NodeFilter.FILTER_SKIP){for(h=e.firstChild;h;)a+=l(b,h),h=h.nextSibling;e.nodeValue&&(a+=m(e.nodeValue))}f&&(a+="",b.pop());return a}var d=this;this.filter=null;this.writeToString=function(b,d){if(!b)return"";var a=new n(d);return l(a,b)}}; // Input 21 xmldom.RelaxNGParser=function(){function n(a,b){this.message=function(){b&&(a+=1===b.nodeType?" Element ":" Node ",a+=b.nodeName,b.nodeValue&&(a+=" with value '"+b.nodeValue+"'"),a+=".");return a}}function m(a){if(2>=a.e.length)return a;var b={name:a.name,e:a.e.slice(0,2)};return m({name:a.name,e:[b].concat(a.e.slice(2))})}function l(a){a=a.split(":",2);var b="",d;1===a.length?a=["",a[0]]:b=a[0];for(d in h)h[d]===b&&(a[0]=d);return a}function d(a,b){for(var k=0,f,g,e=a.name;a.e&&k=d.length)return b;0===g&&(g=0);for(var f=d.item(g);f.namespaceURI===c;){g+=1;if(g>=d.length)return b;f=d.item(g)}return f=h(a,b.attDeriv(a,d.item(g)),d,g+1)}function f(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):f(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)): f(a,b,c.e[1])}var c="http://www.w3.org/2000/xmlns/",t,k,q,g,p,r,w,u,A,y,s={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return s},startTagOpenDeriv:function(){return s},attDeriv:function(){return s},startTagCloseDeriv:function(){return s},endTagDeriv:function(){return s}},v={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return s},startTagOpenDeriv:function(){return s},attDeriv:function(){return s},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return s}}, x={type:"text",nullable:!0,hash:"text",textDeriv:function(){return x},startTagOpenDeriv:function(){return s},attDeriv:function(){return s},startTagCloseDeriv:function(){return x},endTagDeriv:function(){return s}},F,E,O;t=d("choice",function(a,b){if(a===s)return b;if(b===s||a===b)return a},function(a,c){var d={},g;b(d,{p1:a,p2:c});c=a=void 0;for(g in d)d.hasOwnProperty(g)&&(void 0===a?a=d[g]:c=void 0===c?d[g]:t(c,d[g]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, textDeriv:function(c,d){return t(a.textDeriv(c,d),b.textDeriv(c,d))},startTagOpenDeriv:l(function(c){return t(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,d){return t(a.attDeriv(c,d),b.attDeriv(c,d))},startTagCloseDeriv:n(function(){return t(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:n(function(){return t(a.endTagDeriv(),b.endTagDeriv())})}}(a,c)});k=function(a,b,c){return function(){var d={},g=0;return function(f,k){var e=b&&b(f,k),h,p;if(void 0!==e)return e; e=f.hash||f.toString();h=k.hash||k.toString();eNode.ELEMENT_NODE;){if(c!==Node.COMMENT_NODE&&(c!==Node.TEXT_NODE||!/^\s+$/.test(b.currentNode.nodeValue)))return[new n("Not allowed node of type "+ c+".")];c=(d=b.nextSibling())?d.nodeType:0}if(!d)return[new n("Missing element "+a.names)];if(a.names&&-1===a.names.indexOf(e[d.namespaceURI]+":"+d.localName))return[new n("Found "+d.nodeName+" instead of "+a.names+".",d)];if(b.firstChild()){for(l=m(a.e[1],b,d);b.nextSibling();)if(c=b.currentNode.nodeType,!(b.currentNode&&b.currentNode.nodeType===Node.TEXT_NODE&&/^\s+$/.test(b.currentNode.nodeValue)||c===Node.COMMENT_NODE))return[new n("Spurious content.",b.currentNode)];if(b.parentNode()!==d)return[new n("Implementation error.")]}else l= m(a.e[1],b,d);b.nextSibling();return l}var d,b,e;b=function(a,d,f,c){var e=a.name,k=null;if("text"===e)a:{for(var q=(a=d.currentNode)?a.nodeType:0;a!==f&&3!==q;){if(1===q){k=[new n("Element not allowed here.",a)];break a}q=(a=d.nextSibling())?a.nodeType:0}d.nextSibling();k=null}else if("data"===e)k=null;else if("value"===e)c!==a.text&&(k=[new n("Wrong value, should be '"+a.text+"', not '"+c+"'",f)]);else if("list"===e)k=null;else if("attribute"===e)a:{if(2!==a.e.length)throw"Attribute with wrong # of elements: "+ a.e.length;e=a.localnames.length;for(k=0;k=e&&c.push(m(a.substring(b,d)))):"["===a[d]&&(0>=e&&(b=d+1),e+=1),d+=1;return d};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){};c=function(c,f,e){var p,r,l,n;for(p=0;p @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.AnnotationViewManager=function(n,m,l){function d(a){var b=a.node,d=a.end;a=f.createRange();d&&(a.setStart(b,b.childNodes.length),a.setEnd(d,0),d=c.getTextNodes(a,!1),d.forEach(function(a){var c=f.createElement("span");c.className="annotationHighlight";c.setAttribute("annotation",b.getAttributeNS(odf.Namespaces.officens,"name"));a.parentNode.insertBefore(c,a);c.appendChild(a)}));a.detach()}function b(a){var b=n.getSizer();a?(l.style.display="inline-block",b.style.paddingRight=t.getComputedStyle(l).width): (l.style.display="none",b.style.paddingRight=0);n.refreshSize()}function e(){h.sort(function(a,b){return a.node.compareDocumentPosition(b.node)===Node.DOCUMENT_POSITION_FOLLOWING?-1:1})}function a(){var a;for(a=0;a=(m.getBoundingClientRect().top-y.bottom)/u?c.style.top=Math.abs(m.getBoundingClientRect().top-y.bottom)/u+20+"px":c.style.top="0px");e.style.left=d.getBoundingClientRect().width/u+"px";var d=e.style,m=e.getBoundingClientRect().left/u,A=e.getBoundingClientRect().top/u,y=c.getBoundingClientRect().left/u,s=c.getBoundingClientRect().top/u,v=0,x= 0,v=y-m,v=v*v,x=s-A,x=x*x,m=Math.sqrt(v+x);d.width=m+"px";u=Math.asin((c.getBoundingClientRect().top-e.getBoundingClientRect().top)/(u*parseFloat(e.style.width)));e.style.transform="rotate("+u+"rad)";e.style.MozTransform="rotate("+u+"rad)";e.style.WebkitTransform="rotate("+u+"rad)";e.style.msTransform="rotate("+u+"rad)";b&&(u=t.getComputedStyle(b,":before").content)&&"none"!==u&&(u=u.substring(1,u.length-1),b.firstChild?b.firstChild.nodeValue=u:b.appendChild(f.createTextNode(u)))}}var h=[],f=m.ownerDocument, c=new odf.OdfUtils,t=runtime.getWindow();runtime.assert(Boolean(t),"Expected to be run in an environment which has a global window, like a browser.");this.rerenderAnnotations=a;this.addAnnotation=function(c){b(!0);h.push({node:c.node,end:c.end});e();var l=f.createElement("div"),g=f.createElement("div"),p=f.createElement("div"),r=f.createElement("div"),n=f.createElement("div"),u=c.node;l.className="annotationWrapper";u.parentNode.insertBefore(l,u);g.className="annotationNote";g.appendChild(u);n.className= "annotationRemoveButton";g.appendChild(n);p.className="annotationConnector horizontal";r.className="annotationConnector angular";l.appendChild(g);l.appendChild(p);l.appendChild(r);c.end&&d(c);a()};this.forgetAnnotations=function(){for(;h.length;){var a=h[0],c=h.indexOf(a),d=a.node,e=d.parentNode.parentNode;"div"===e.localName&&(e.parentNode.insertBefore(d,e),e.parentNode.removeChild(e));a=a.node.getAttributeNS(odf.Namespaces.officens,"name");a=f.querySelectorAll('span.annotationHighlight[annotation="'+ a+'"]');e=d=void 0;for(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/ */ odf.OdfNodeFilter=function(){this.acceptNode=function(n){return"http://www.w3.org/1999/xhtml"===n.namespaceURI?NodeFilter.FILTER_SKIP:n.namespaceURI&&n.namespaceURI.match(/^urn:webodf:/)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}; // Input 27 /* 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/ */ odf.Namespaces=function(){function n(d){return m[d]||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", dr3d:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",numberns:"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",dc:"http://purl.org/dc/elements/1.1/",webodf:"urn:webodf"},l;n.lookupNamespaceURI=n;l=function(){};l.forEachPrefix=function(d){for(var b in m)m.hasOwnProperty(b)&&d(b,m[b])};l.resolvePrefix=n;l.namespaceMap=m;l.drawns="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0";l.fons="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"; l.officens="urn:oasis:names:tc:opendocument:xmlns:office:1.0";l.presentationns="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0";l.stylens="urn:oasis:names:tc:opendocument:xmlns:style:1.0";l.svgns="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";l.tablens="urn:oasis:names:tc:opendocument:xmlns:table:1.0";l.textns="urn:oasis:names:tc:opendocument:xmlns:text:1.0";l.dr3dns="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0";l.numberns="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"; l.xlinkns="http://www.w3.org/1999/xlink";l.xmlns="http://www.w3.org/XML/1998/namespace";l.dcns="http://purl.org/dc/elements/1.1/";l.webodfns="urn:webodf";return l}(); // Input 28 runtime.loadClass("xmldom.XPath"); odf.StyleInfo=function(){function n(a,b){for(var c=q[a.localName],d=c&&c[a.namespaceURI],e=d?d.length:0,f,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/ */ runtime.loadClass("core.DomUtils"); odf.OdfUtils=function(){function n(a){var b=a&&a.localName;return("p"===b||"h"===b)&&a.namespaceURI===w}function m(a){for(;a&&!n(a);)a=a.parentNode;return a}function l(a){return/^[ \t\r\n]+$/.test(a)}function d(a){var b=a&&a.localName;return/^(span|p|h|a|meta)$/.test(b)&&a.namespaceURI===w||"span"===b&&"annotationHighlight"===a.className?!0:!1}function b(a){var b=a&&a.localName,c,d=!1;b&&(c=a.namespaceURI,c===w?d="s"===b||"tab"===b||"line-break"===b:c===u&&(d="frame"===b&&"as-char"===a.getAttributeNS(w, "anchor-type")));return d}function e(a){for(;null!==a.firstChild&&d(a);)a=a.firstChild;return a}function a(a){for(;null!==a.lastChild&&d(a);)a=a.lastChild;return a}function h(b){for(;!n(b)&&null===b.previousSibling;)b=b.parentNode;return n(b)?null:a(b.previousSibling)}function f(a){for(;!n(a)&&null===a.nextSibling;)a=a.parentNode;return n(a)?null:e(a.nextSibling)}function c(a){for(var c=!1;a;)if(a.nodeType===Node.TEXT_NODE)if(0===a.length)a=h(a);else return!l(a.data.substr(a.length-1,1));else b(a)? (c=!0,a=null):a=h(a);return c}function t(a){var c=!1;for(a=a&&e(a);a;){if(a.nodeType===Node.TEXT_NODE&&0=b.value||"%"===b.unit)?null:b;return b||p(a)};this.parseFoLineHeight=function(a){var b;b=(b=g(a))&&(0>b.value|| "%"===b.unit)?null:b;return b||p(a)};this.getImpactedParagraphs=function(a){var b=a.commonAncestorContainer,c=[];for(b.nodeType===Node.ELEMENT_NODE&&(c=y.getElementsByTagNameNS(b,w,"p").concat(y.getElementsByTagNameNS(b,w,"h")));b&&!n(b);)b=b.parentNode;b&&c.push(b);return c.filter(function(b){return y.rangeIntersectsNode(a,b)})};this.getTextNodes=function(a,b){var c=a.startContainer.ownerDocument.createRange(),d;d=y.getNodesInRange(a,function(d){c.selectNodeContents(d);if(d.nodeType===Node.TEXT_NODE){if(b&& y.rangesIntersect(a,c)||y.containsRange(a,c))return Boolean(m(d)&&(!l(d.textContent)||q(d,0)))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}else if(y.rangesIntersect(a,c)&&r(d))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});c.detach();return d};this.getTextElements=function(a,c){var e=a.startContainer.ownerDocument.createRange(),f;f=y.getNodesInRange(a,function(f){var g=f.nodeType;e.selectNodeContents(f);if(g===Node.TEXT_NODE){if(y.containsRange(a,e)&&(c||Boolean(m(f)&&(!l(f.textContent)|| q(f,0)))))return NodeFilter.FILTER_ACCEPT}else if(b(f)){if(y.containsRange(a,e))return NodeFilter.FILTER_ACCEPT}else if(r(f)||d(f))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT});e.detach();return f};this.getParagraphElements=function(a){var b=a.startContainer.ownerDocument.createRange(),c;c=y.getNodesInRange(a,function(c){b.selectNodeContents(c);if(n(c)){if(y.rangesIntersect(a,b))return NodeFilter.FILTER_ACCEPT}else if(r(c)||d(c))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_REJECT}); b.detach();return c}}; // Input 30 /* 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("odf.OdfUtils"); odf.TextSerializer=function(){function n(d){var b="",e=m.filter?m.filter.acceptNode(d):NodeFilter.FILTER_ACCEPT,a=d.nodeType,h;if(e===NodeFilter.FILTER_ACCEPT||e===NodeFilter.FILTER_SKIP)for(h=d.firstChild;h;)b+=n(h),h=h.nextSibling;e===NodeFilter.FILTER_ACCEPT&&(a===Node.ELEMENT_NODE&&l.isParagraph(d)?b+="\n":a===Node.TEXT_NODE&&d.textContent&&(b+=d.textContent));return b}var m=this,l=new odf.OdfUtils;this.filter=null;this.writeToString=function(d){return d?n(d):""}}; // 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.DomUtils");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.Namespaces"); odf.TextStyleApplicator=function(n,m,l){function d(a){function b(a,c){return"object"===typeof a&&"object"===typeof c?Object.keys(a).every(function(d){return b(a[d],c[d])}):a===c}this.isStyleApplied=function(d){d=m.getAppliedStylesForElement(d);return b(a,d)}}function b(b){var d={};this.applyStyleToContainer=function(e){var q;q=e.getAttributeNS(a,"style-name");var g=e.ownerDocument;q=q||"";if(!d.hasOwnProperty(q)){var p=q,r=q,w;r?(w=m.getStyleElement(r,"text"),w.parentNode===l?g=w.cloneNode(!0):(g= g.createElementNS(h,"style:style"),g.setAttributeNS(h,"style:parent-style-name",r),g.setAttributeNS(h,"style:family","text"),g.setAttributeNS(f,"scope","document-content"))):(g=g.createElementNS(h,"style:style"),g.setAttributeNS(h,"style:family","text"),g.setAttributeNS(f,"scope","document-content"));m.updateStyle(g,b,n);l.appendChild(g);d[p]=g}q=d[q].getAttributeNS(h,"name");e.setAttributeNS(a,"text:style-name",q)}}var e=new core.DomUtils,a=odf.Namespaces.textns,h=odf.Namespaces.stylens,f="urn:webodf:names:scope"; this.applyStyle=function(c,f,k){var h={},g,l,n,m;runtime.assert(k&&k["style:text-properties"],"applyStyle without any text properties");h["style:text-properties"]=k["style:text-properties"];n=new b(h);m=new d(h);c.forEach(function(b){g=m.isStyleApplied(b);if(!1===g){var c=b.ownerDocument,d=b.parentNode,k,h=b,q=new core.LoopWatchDog(1E3);"span"===d.localName&&d.namespaceURI===a?(b.previousSibling&&!e.rangeContainsNode(f,b.previousSibling)?(c=d.cloneNode(!1),d.parentNode.insertBefore(c,d.nextSibling)): c=d,k=!0):(c=c.createElementNS(a,"text:span"),d.insertBefore(c,b),k=!1);for(;h&&(h===b||e.rangeContainsNode(f,h));)q.check(),d=h.nextSibling,h.parentNode!==c&&c.appendChild(h),h=d;if(h&&k)for(b=c.cloneNode(!1),c.parentNode.insertBefore(b,c.nextSibling);h;)q.check(),d=h.nextSibling,b.appendChild(h),h=d;l=c;n.applyStyleToContainer(l)}})}}; // Input 32 /* 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 n(a){var b={},c,d;if(!a)return b;for(a=a.firstChild;a;){if(d=a.namespaceURI!==p||"style"!==a.localName&&"default-style"!==a.localName?a.namespaceURI===u&&"list-style"===a.localName?"list":a.namespaceURI!==p||"page-layout"!==a.localName&&"default-page-layout"!==a.localName?void 0:"page":a.getAttributeNS(p,"family"))(c=a.getAttributeNS&&a.getAttributeNS(p,"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 l(a,b,c){var d=b[a],e,f;d&&(e=d.getAttributeNS(p,"parent-style-name"),f=null,e&&(f=m(c,e),!f&&b[e]&&(l(e,b,c),f=b[e],b[e]=null)),f?(f.derivedStyles||(f.derivedStyles={}),f.derivedStyles[a]=d):c[a]=d)}function d(a,b){for(var c in a)a.hasOwnProperty(c)&&(l(c,a,b),a[c]=null)}function b(a,b){var c=s[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,c,d){var f=[],g,k;f.push(b(a,c));for(g in d.derivedStyles)if(d.derivedStyles.hasOwnProperty(g))for(k in c=e(a,g,d.derivedStyles[g]),c)c.hasOwnProperty(k)&&f.push(c[k]);return f}function 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 h(a,b){var c="",d,e;for(d in b)if(b.hasOwnProperty(d)&& (d=b[d],e=a.getAttributeNS(d[0],d[1]))){e=e.trim();if(da.hasOwnProperty(d[1])){var f=e.indexOf(" "),g=void 0,k=void 0;-1!==f?(g=e.substring(0,f),k=e.substring(f)):(g=e,k="");(g=ba.parseLength(g))&&("pt"===g.unit&&0.75>g.value)&&(e="0.75pt"+k)}d[2]&&(c+=d[2]+":"+e+";")}return c}function f(b){return(b=a(b,p,"text-properties"))?ba.parseFoFontSize(b.getAttributeNS(g,"font-size")):null}function c(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,c,d){return b+b+c+c+d+d});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))? {r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function t(a,b,c,d){b='text|list[text|style-name="'+b+'"]';var e=c.getAttributeNS(u,"level"),f;c=ba.getFirstNonWhitespaceChild(c);c=ba.getFirstNonWhitespaceChild(c);var g;c&&(f=c.attributes,g=f["fo:text-indent"]?f["fo:text-indent"].value:void 0,f=f["fo:margin-left"]?f["fo:margin-left"].value:void 0);g||(g="-0.6cm");c="-"===g.charAt(0)?g.substring(1):"-"+g;for(e=e&&parseInt(e,10);1 text|list-item > text|list",e-=1;e=b+" > text|list-item > *:not(text|list):first-child"; void 0!==f&&(f=e+"{margin-left:"+f+";}",a.insertRule(f,a.cssRules.length));d=b+" > text|list-item > *:not(text|list):first-child:before{"+d+";";d+="counter-increment:list;";d+="margin-left:"+g+";";d+="width:"+c+";";d+="display:inline-block}";try{a.insertRule(d,a.cssRules.length)}catch(k){throw k;}}function k(b,d,l,n){if("list"===d)for(var r=n.firstChild,m,s;r;){if(r.namespaceURI===u)if(m=r,"list-level-style-number"===r.localName){var v=m;s=v.getAttributeNS(p,"num-format");var L=v.getAttributeNS(p, "num-suffix"),G={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},v=v.getAttributeNS(p,"num-prefix")||"",v=G.hasOwnProperty(s)?v+(" counter(list, "+G[s]+")"):s?v+("'"+s+"';"):v+" ''";L&&(v+=" '"+L+"'");s="content: "+v+";";t(b,l,m,s)}else"list-level-style-image"===r.localName?(s="content: none;",t(b,l,m,s)):"list-level-style-bullet"===r.localName&&(s="content: '"+m.getAttributeNS(u,"bullet-char")+"';",t(b,l,m,s));r=r.nextSibling}else if("page"===d)if(L=m=l="",r=n.getElementsByTagNameNS(p, "page-layout-properties")[0],m=r.parentNode.parentNode.parentNode.masterStyles,L="",l+=h(r,M),s=r.getElementsByTagNameNS(p,"background-image"),0c)break;e=e.nextSibling}a.insertBefore(b,e)}}}function e(a){this.OdfContainer=a}function a(a, b,c,d){var e=this;this.size=0;this.type=null;this.name=a;this.container=c;this.onchange=this.onreadystatechange=this.document=this.mimetype=this.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){null!==d&&(this.mimetype=b,d.loadAsDataURL(a,b,function(a,b){a&&runtime.log(a);e.url=b;if(e.onchange)e.onchange(e);if(e.onstatereadychange)e.onstatereadychange(e)}))}}var h=new odf.StyleInfo,f="urn:oasis:names:tc:opendocument:xmlns:office:1.0",c="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", t="urn:webodf:names:scope",k="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),q=(new Date).getTime()+"_webodf_",g=new core.Base64;e.prototype=new function(){};e.prototype.constructor=e;e.namespaceURI=f;e.localName="document";a.prototype.load=function(){};a.prototype.getUrl=function(){return this.data?"data:;base64,"+g.toBase64(this.data):null};odf.OdfContainer=function r(g,k){function m(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,b.nodeType===Node.ELEMENT_NODE? m(b):b.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(b),b=c}function y(a,b){for(var c=a&&a.firstChild;c;)c.nodeType===Node.ELEMENT_NODE&&c.setAttributeNS(t,"scope",b),c=c.nextSibling}function s(a,b){var c=null,d,e,f;if(a)for(c=a.cloneNode(!0),d=c.firstChild;d;)e=d.nextSibling,d.nodeType===Node.ELEMENT_NODE&&(f=d.getAttributeNS(t,"scope"))&&f!==b&&c.removeChild(d),d=e;return c}function v(a){var b=I.rootElement.ownerDocument,c;if(a){m(a.documentElement);try{c=b.importNode(a.documentElement, !0)}catch(d){}}return c}function x(a){I.state=a;if(I.onchange)I.onchange(I);if(I.onstatereadychange)I.onstatereadychange(I)}function F(a){$=null;I.rootElement=a;a.fontFaceDecls=n(a,f,"font-face-decls");a.styles=n(a,f,"styles");a.automaticStyles=n(a,f,"automatic-styles");a.masterStyles=n(a,f,"master-styles");a.body=n(a,f,"body");a.meta=n(a,f,"meta")}function E(a){a=v(a);var c=I.rootElement;a&&"document-styles"===a.localName&&a.namespaceURI===f?(c.fontFaceDecls=n(a,f,"font-face-decls"),b(c,c.fontFaceDecls), c.styles=n(a,f,"styles"),b(c,c.styles),c.automaticStyles=n(a,f,"automatic-styles"),y(c.automaticStyles,"document-styles"),b(c,c.automaticStyles),c.masterStyles=n(a,f,"master-styles"),b(c,c.masterStyles),h.prefixStyleNames(c.automaticStyles,q,c.masterStyles)):x(r.INVALID)}function O(a){a=v(a);var c,d,e;if(a&&"document-content"===a.localName&&a.namespaceURI===f){c=I.rootElement;d=n(a,f,"font-face-decls");if(c.fontFaceDecls&&d)for(e=d.firstChild;e;)c.fontFaceDecls.appendChild(e),e=d.firstChild;else d&& (c.fontFaceDecls=d,b(c,d));d=n(a,f,"automatic-styles");y(d,"document-content");if(c.automaticStyles&&d)for(e=d.firstChild;e;)c.automaticStyles.appendChild(e),e=d.firstChild;else d&&(c.automaticStyles=d,b(c,d));c.body=n(a,f,"body");b(c,c.body)}else x(r.INVALID)}function z(a){a=v(a);var c;a&&("document-meta"===a.localName&&a.namespaceURI===f)&&(c=I.rootElement,c.meta=n(a,f,"meta"),b(c,c.meta))}function P(a){a=v(a);var c;a&&("document-settings"===a.localName&&a.namespaceURI===f)&&(c=I.rootElement,c.settings= n(a,f,"settings"),b(c,c.settings))}function C(a){a=v(a);var b;if(a&&"manifest"===a.localName&&a.namespaceURI===c)for(b=I.rootElement,b.manifest=a,a=b.manifest.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&("file-entry"===a.localName&&a.namespaceURI===c)&&(R[a.getAttributeNS(c,"full-path")]=a.getAttributeNS(c,"media-type")),a=a.nextSibling}function K(a){var b=a.shift(),c,d;b?(c=b[0],d=b[1],S.loadAsDOM(c,function(b,c){d(c);b||I.state===r.INVALID||K(a)})):x(r.DONE)}function M(a){var b="";odf.Namespaces.forEachPrefix(function(a, c){b+=" xmlns:"+a+'="'+c+'"'});return''}function ca(){var a=new xmldom.LSSerializer,b=M("document-meta");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(I.rootElement.meta,odf.Namespaces.namespaceMap);return b+""}function da(a,b){var d=document.createElementNS(c,"manifest:file-entry");d.setAttributeNS(c,"manifest:full-path",a);d.setAttributeNS(c,"manifest:media-type",b);return d}function aa(){var a= runtime.parseXML(''),b=n(a,c,"manifest"),d=new xmldom.LSSerializer,e;for(e in R)R.hasOwnProperty(e)&&b.appendChild(da(e,R[e]));d.filter=new odf.OdfNodeFilter;return'\n'+d.writeToString(a,odf.Namespaces.namespaceMap)}function ba(){var a=new xmldom.LSSerializer,b=M("document-settings");a.filter=new odf.OdfNodeFilter;b+=a.writeToString(I.rootElement.settings,odf.Namespaces.namespaceMap); return b+""}function ea(){var a=odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=s(I.rootElement.automaticStyles,"document-styles"),d=I.rootElement.masterStyles&&I.rootElement.masterStyles.cloneNode(!0),e=M("document-styles");h.removePrefixFromStyleNames(c,q,d);b.filter=new l(d,c);e+=b.writeToString(I.rootElement.fontFaceDecls,a);e+=b.writeToString(I.rootElement.styles,a);e+=b.writeToString(c,a);e+=b.writeToString(d,a);return e+""}function Q(){var a= odf.Namespaces.namespaceMap,b=new xmldom.LSSerializer,c=s(I.rootElement.automaticStyles,"document-content"),e=M("document-content");b.filter=new d(I.rootElement.body,c);e+=b.writeToString(c,a);e+=b.writeToString(I.rootElement.body,a);return e+""}function W(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var d=v(c);d&&"document"===d.localName&&d.namespaceURI===f?(F(d),x(r.DONE)):x(r.INVALID)}})}function U(){function a(b,c){var e;c||(c=b);e=document.createElementNS(f,c); d[b]=e;d.appendChild(e)}var b=new core.Zip("",null),c=runtime.byteArrayFromString("application/vnd.oasis.opendocument.text","utf8"),d=I.rootElement,e=document.createElementNS(f,"text");b.save("mimetype",c,!1,new Date);a("meta");a("settings");a("scripts");a("fontFaceDecls","font-face-decls");a("styles");a("automaticStyles","automatic-styles");a("masterStyles","master-styles");a("body");d.body.appendChild(e);x(r.DONE);return b}function N(){var a,b=new Date;a=runtime.byteArrayFromString(ba(),"utf8"); S.save("settings.xml",a,!0,b);a=runtime.byteArrayFromString(ca(),"utf8");S.save("meta.xml",a,!0,b);a=runtime.byteArrayFromString(ea(),"utf8");S.save("styles.xml",a,!0,b);a=runtime.byteArrayFromString(Q(),"utf8");S.save("content.xml",a,!0,b);a=runtime.byteArrayFromString(aa(),"utf8");S.save("META-INF/manifest.xml",a,!0,b)}function D(a,b){N();S.writeAs(a,function(a){b(a)})}var I=this,S,R={},$;this.onstatereadychange=k;this.rootElement=this.state=this.onchange=null;this.setRootElement=F;this.getContentElement= function(){var a;$||(a=I.rootElement.body,$=a.getElementsByTagNameNS(f,"text")[0]||a.getElementsByTagNameNS(f,"presentation")[0]||a.getElementsByTagNameNS(f,"spreadsheet")[0]);return $};this.getDocumentType=function(){var a=I.getContentElement();return a&&a.localName};this.getPart=function(b){return new a(b,R[b],I,S)};this.getPartData=function(a,b){S.load(a,b)};this.createByteArray=function(a,b){N();S.createByteArray(a,b)};this.saveAs=D;this.save=function(a){D(g,a)};this.getUrl=function(){return g}; this.state=r.LOADING;this.rootElement=function(a){var b=document.createElementNS(a.namespaceURI,a.localName),c;a=new a;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}(e);S=g?new core.Zip(g,function(a,b){S=b;a?W(g,function(b){a&&(S.error=a+"\n"+b,x(r.INVALID))}):K([["styles.xml",E],["content.xml",O],["meta.xml",z],["settings.xml",P],["META-INF/manifest.xml",C]])}):U()};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING= 4;odf.OdfContainer.MODIFIED=5;odf.OdfContainer.getContainer=function(a){return new odf.OdfContainer(a,null)};return odf.OdfContainer}(); // Input 34 /* 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 n(d,b,e,a,h){var f,c=0,m;for(m in d)if(d.hasOwnProperty(m)){if(c===e){f=m;break}c+=1}f?b.getPartData(d[f].href,function(c,m){if(c)runtime.log(c);else{var g="@font-face { font-family: '"+(d[f].family||f)+"'; src: url(data:application/x-font-ttf;charset=binary;base64,"+l.convertUTF8ArrayToBase64(m)+') format("truetype"); }';try{a.insertRule(g,a.cssRules.length)}catch(p){runtime.log("Problem inserting rule in CSS: "+runtime.toJson(p)+"\nRule: "+g)}}n(d,b,e+1,a,h)}): h&&h()}var m=new xmldom.XPath,l=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(d,b){for(var e=d.rootElement.fontFaceDecls;b.cssRules.length;)b.deleteRule(b.cssRules.length-1);if(e){var a={},h,f,c,l;if(e)for(e=m.getODFElementsWithXPath(e,"style:font-face[svg:font-face-src]",odf.Namespaces.resolvePrefix),h=0;h @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("core.Utils");runtime.loadClass("odf.Namespaces");runtime.loadClass("odf.OdfContainer");runtime.loadClass("odf.StyleInfo");runtime.loadClass("odf.OdfUtils");runtime.loadClass("odf.TextStyleApplicator"); odf.Formatting=function(){function n(a,b){Object.keys(b).forEach(function(c){try{a[c]=b[c].constructor===Object?n(a[c],b[c]):b[c]}catch(d){a[c]=b[c]}});return a}function m(a,b,d){var e,f;d=d||[c.rootElement.automaticStyles,c.rootElement.styles];for(e=d.shift();e;){for(e=e.firstChild;e;){if(e.nodeType===Node.ELEMENT_NODE&&(f=e.getAttributeNS(q,"name"),e.namespaceURI===q&&"style"===e.localName&&e.getAttributeNS(q,"family")===b&&f===a||"list-style"===b&&e.namespaceURI===g&&"list-style"===e.localName&& f===a||"data"===b&&e.namespaceURI===p&&f===a))return e;e=e.nextSibling}e=d.shift()}return null}function l(a){for(var b={},c=a.firstChild;c;){if(c.nodeType===Node.ELEMENT_NODE&&c.namespaceURI===q)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");runtime.loadClass("gui.AnnotationViewManager"); odf.OdfCanvas=function(){function n(){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(X=x.getAttributeNS(v,"style-name")){x=n[X];H=P.getFirstNonWhitespaceChild(x);x=void 0;if(H)if("list-level-style-number"===H.localName){x=H.getAttributeNS(A,"num-format");X=H.getAttributeNS(A,"num-suffix");var va="",va={1:"decimal",a:"lower-latin",A:"upper-latin", i:"lower-roman",I:"upper-roman"},qa=void 0,qa=H.getAttributeNS(A,"num-prefix")||"",qa=va.hasOwnProperty(x)?qa+(" counter(list, "+va[x]+")"):x?qa+("'"+x+"';"):qa+" ''";X&&(qa+=" '"+X+"'");x=va="content: "+qa+";"}else"list-level-style-image"===H.localName?x="content: none;":"list-level-style-bullet"===H.localName&&(x="content: '"+H.getAttributeNS(v,"bullet-char")+"';");H=x}if(C){for(x=m[C];x;)C=x,x=m[C];D+="counter-increment:"+C+";";H?(H=H.replace("list",C),D+=H):D+="content:counter("+C+");"}else C= "",H?(H=H.replace("list",q),D+=H):D+="content: counter("+q+");",D+="counter-increment:"+q+";",h.insertRule("text|list#"+q+" {counter-reset:"+q+"}",h.cssRules.length);D+="}";m[q]=C;D&&h.insertRule(D,h.cssRules.length)}M.insertBefore(K,M.firstChild);y();E(g);if(!d&&(g=[Y],ha.hasOwnProperty("statereadychange")))for(h=ha.statereadychange,H=0;H @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.Server=function(){};ops.Server.prototype.connect=function(n,m){};ops.Server.prototype.networkStatus=function(){};ops.Server.prototype.login=function(n,m,l,d){};ops.Server.prototype.joinSession=function(n,m,l,d){};ops.Server.prototype.leaveSession=function(n,m,l,d){};ops.Server.prototype.getGenesisUrl=function(n){}; // 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.Operation=function(){};ops.Operation.prototype.init=function(n){};ops.Operation.prototype.transform=function(n,m){};ops.Operation.prototype.execute=function(n){};ops.Operation.prototype.spec=function(){}; // 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/ */ ops.OpAddCursor=function(){var n=this,m,l;this.init=function(d){m=d.memberid;l=d.timestamp};this.transform=function(d,b){return[n]};this.execute=function(d){var b=d.getCursor(m);if(b)return!1;b=new ops.OdtCursor(m,d);d.addCursor(b);d.emit(ops.OdtDocument.signalCursorAdded,b);return!0};this.spec=function(){return{optype:"AddCursor",memberid:m,timestamp:l}}}; // 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/ */ runtime.loadClass("core.DomUtils");runtime.loadClass("odf.OdfUtils"); gui.StyleHelper=function(n){function m(b,e,a){var h=!0,f;b.collapsed?(f=b.startContainer,f.hasChildNodes()&&b.startOffset @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.StyleHelper");runtime.loadClass("odf.OdfUtils"); ops.OpApplyDirectStyling=function(){function n(a){var e=0<=b?d+b:d,c=a.getIteratorAtPosition(0<=b?d:d+b),e=b?a.getIteratorAtPosition(e):c;a=a.getDOM().createRange();a.setStart(c.container(),c.unfilteredDomOffset());a.setEnd(e.container(),e.unfilteredDomOffset());return a}var m,l,d,b,e,a=new odf.OdfUtils;this.init=function(a){m=a.memberid;l=a.timestamp;d=parseInt(a.position,10);b=parseInt(a.length,10);e=a.setProperties};this.transform=function(a,b){return null};this.execute=function(b){var d=n(b), c=a.getImpactedParagraphs(d);(new gui.StyleHelper(b.getFormatting())).applyStyle(m,d,e);d.detach();b.getOdfCanvas().refreshCSS();c.forEach(function(a){b.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,memberId:m,timeStamp:l})});b.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"ApplyDirectStyling",memberid:m,timestamp:l,position:d,length:b,setProperties:e}}}; // Input 43 /* 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 n=this,m,l;this.init=function(d){m=d.memberid;l=d.timestamp};this.transform=function(d,b){var e=d.spec(),a=[n];"RemoveCursor"===e.optype&&e.memberid===m&&(a=[]);return a};this.execute=function(d){return d.removeCursor(m)?!0:!1};this.spec=function(){return{optype:"RemoveCursor",memberid:m,timestamp:l}}}; // Input 44 /* 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 n=this,m,l,d,b;this.init=function(e){m=e.memberid;l=e.timestamp;d=parseInt(e.position,10);b=void 0!==e.length?parseInt(e.length,10):0};this.merge=function(e){return"MoveCursor"===e.optype&&e.memberid===m?(d=e.position,b=e.length,l=e.timestamp,!0):!1};this.transform=function(e,a){var h=e.spec(),f=d+b,c,l=[n];switch(h.optype){case "RemoveText":c=h.position+h.length;c<=d?d-=h.length:h.positionc?-h.countBackwardSteps(-c, f):0;a.move(c);b&&(f=0b?-h.countBackwardSteps(-b,f):0,a.move(f,!0));e.emit(ops.OdtDocument.signalCursorMoved,a);return!0};this.spec=function(){return{optype:"MoveCursor",memberid:m,timestamp:l,position:d,length:b}}}; // Input 45 /* 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.OpInsertTable=function(){function n(a,c){var d;if(1===t.length)d=t[0];else if(3===t.length)switch(a){case 0:d=t[0];break;case b-1:d=t[2];break;default:d=t[1]}else d=t[a];if(1===d.length)return d[0];if(3===d.length)switch(c){case 0:return d[0];case e-1:return d[2];default:return d[1]}return d[c]}var m=this,l,d,b,e,a,h,f,c,t;this.init=function(k){l=k.memberid;d=k.timestamp;a=parseInt(k.position,10);b=parseInt(k.initialRows,10);e=parseInt(k.initialColumns,10);h=k.tableName;f=k.tableStyleName;c=k.tableColumnStyleName; t=k.tableCellStyleMatrix};this.transform=function(b,c){var d=b.spec(),e=[m];switch(d.optype){case "InsertTable":e=null;break;case "AddAnnotation":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/ */ ops.OpInsertText=function(){function n(a,b){var d=b.parentNode,c=b.nextSibling,e=[];a.getCursors().forEach(function(a){var c=a.getSelectedRange();!c||c.startContainer!==b&&c.endContainer!==b||e.push({cursor:a,startContainer:c.startContainer,startOffset:c.startOffset,endContainer:c.endContainer,endOffset:c.endOffset})});d.removeChild(b);d.insertBefore(b,c);e.forEach(function(a){var b=a.cursor.getSelectedRange();b.setStart(a.startContainer,a.startOffset);b.setEnd(a.endContainer,a.endOffset)})}var m= this,l,d,b,e;this.init=function(a){l=a.memberid;d=a.timestamp;b=parseInt(a.position,10);e=a.text};this.merge=function(a){return"InsertText"===a.optype&&a.memberid===l&&a.position===b+e.length?(e+=a.text,d=a.timestamp,!0):!1};this.transform=function(a,d){var e=a.spec(),c=[m];switch(e.optype){case "InsertText":e.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.Namespaces");runtime.loadClass("odf.OdfUtils");runtime.loadClass("core.DomUtils"); ops.OpRemoveText=function(){function n(a){function b(a){if(h.isCharacterElement(a))return!1;if(a.nodeType===Node.TEXT_NODE)return 0===a.textContent.length;for(a=a.firstChild;a;){if(!b(a))return!1;a=a.nextSibling}return!0}function d(e){e=f.mergeIntoParent(e);return!h.isParagraph(e)&&e!==a&&b(e)?d(e):e}this.isEmpty=b;this.mergeChildrenIntoParent=d}function m(b){var d=b.getPositionFilter(),k,h,g,l,m=a,n=b.getDOM().createRange();b=b.getIteratorAtPosition(e);k=b.container();for(h=b.unfilteredDomOffset();m&& b.nextPosition();)g=b.container(),l=b.unfilteredDomOffset(),d.acceptPosition(b)===NodeFilter.FILTER_ACCEPT&&(m-=1);n.setStart(k,h);n.setEnd(g,l);f.splitBoundaries(n);return n}var l=this,d,b,e,a,h,f;this.init=function(c){runtime.assert(0<=c.length,"OpRemoveText only supports positive lengths");d=c.memberid;b=c.timestamp;e=parseInt(c.position,10);a=parseInt(c.length,10);h=new odf.OdfUtils;f=new core.DomUtils};this.transform=function(c,f){var k=c.spec(),h=e+a,g,m=[l];switch(k.optype){case "RemoveText":g= k.position+k.length;g<=e?e-=k.length:k.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 n=this,m,l,d,b=new odf.OdfUtils;this.init=function(b){m=b.memberid;l=b.timestamp;d=parseInt(b.position,10)};this.transform=function(b,a){var h=b.spec(),f=[n];switch(h.optype){case "SplitParagraph":h.position=a.textNode.length?null:a.textNode.splitText(a.offset));for(a=a.textNode;a!==f;)if(a=a.parentNode,c=a.cloneNode(!1),k){for(n&&c.appendChild(n);k.nextSibling;)c.appendChild(k.nextSibling); a.parentNode.insertBefore(c,a.nextSibling);k=a;n=c}else a.parentNode.insertBefore(c,a),k=c,n=a;b.isListItem(n)&&(n=n.childNodes[0]);e.fixCursorPositions(m);e.getOdfCanvas().refreshSize();e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:h,memberId:m,timeStamp:l});e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:n,memberId:m,timeStamp:l});e.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph",memberid:m,timestamp:l,position:d}}}; // Input 49 /* 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 n=this,m,l,d,b;this.init=function(e){m=e.memberid;l=e.timestamp;d=e.position;b=e.styleName};this.transform=function(d,a){var h=d.spec(),f=[n];switch(h.optype){case "RemoveParagraphStyle":h.styleName===b&&(b="")}return f};this.execute=function(e){var a;if(a=e.getPositionInTextNode(d))if(a=e.getParagraphElement(a.textNode))return""!==b?a.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:style-name",b):a.removeAttributeNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0", "style-name"),e.getOdfCanvas().refreshSize(),e.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:a,timeStamp:l,memberId:m}),e.getOdfCanvas().rerenderAnnotations(),!0;return!1};this.spec=function(){return{optype:"SetParagraphStyle",memberid:m,timestamp:l,position:d,styleName:b}}}; // 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.OpUpdateParagraphStyle=function(){function n(a,b){var c,d,e=b?b.split(","):[];for(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/ */ runtime.loadClass("odf.Namespaces"); ops.OpAddParagraphStyle=function(){function n(a){e&&["style:parent-style-name","style:next-style-name"].forEach(function(b){e[b]===a&&delete e[b]})}var m=this,l,d,b,e,a=odf.Namespaces.svgns,h=odf.Namespaces.stylens;this.init=function(a){l=a.memberid;d=a.timestamp;b=a.styleName;e=a.setProperties};this.transform=function(a,b){var d=a.spec();"RemoveParagraphStyle"===d.optype&&n(d.styleName);return[m]};this.execute=function(d){var c=d.getOdfCanvas().odfContainer(),l=d.getFormatting(),k=d.getDOM(),m=k.createElementNS(h, "style:style"),g,n,r,w,u;if(!m)return!1;m.setAttributeNS(h,"style:family","paragraph");m.setAttributeNS(h,"style:name",b);e&&Object.keys(e).forEach(function(b){switch(b){case "style:paragraph-properties":g=k.createElementNS(h,"style:paragraph-properties");m.appendChild(g);l.updateStyle(g,e["style:paragraph-properties"]);break;case "style:text-properties":n=k.createElementNS(h,"style:text-properties");m.appendChild(n);(w=e["style:text-properties"]["style:font-name"])&&!l.getFontMap().hasOwnProperty(w)&& (r=k.createElementNS(h,"style:font-face"),r.setAttributeNS(h,"style:name",w),r.setAttributeNS(a,"svg:font-family",w),c.rootElement.fontFaceDecls.appendChild(r));l.updateStyle(n,e["style:text-properties"]);break;default:"object"!==typeof e[b]&&(u=odf.Namespaces.resolvePrefix(b.substr(0,b.indexOf(":"))),m.setAttributeNS(u,b,e[b]))}});c.rootElement.styles.appendChild(m);d.getOdfCanvas().refreshCSS();d.emit(ops.OdtDocument.signalStyleCreated,b);return!0};this.spec=function(){return{optype:"AddParagraphStyle", memberid:l,timestamp:d,styleName:b,setProperties:e}}}; // Input 52 /* 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.OpRemoveParagraphStyle=function(){function n(d){var a=[];d&&["style:parent-style-name","style:next-style-name"].forEach(function(h){d[h]===b&&a.push(h)});return a}var m=this,l,d,b;this.init=function(e){l=e.memberid;d=e.timestamp;b=e.styleName};this.transform=function(d,a){var h=d.spec(),f,c;f=[m];switch(h.optype){case "RemoveParagraphStyle":h.styleName===b&&(f=[]);break;case "AddParagraphStyle":case "UpdateParagraphStyle":c=n(h.setProperties);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.OpAddAnnotation=function(){function n(a,b,c){if(c=a.getPositionInTextNode(c,l))a=c.textNode,c.offset!==a.length&&a.splitText(c.offset),a.parentNode.insertBefore(b,a.nextSibling)}var m=this,l,d,b,e,a;this.init=function(h){l=h.memberid;d=parseInt(h.timestamp,10);b=parseInt(h.position,10);e=parseInt(h.length,10)||0;a=h.name};this.transform=function(a,d){var c=a.spec(),l=b+e,k=[m];switch(c.optype){case "AddAnnotation":c.positionk?-g.countBackwardSteps(-k,c):0,m.move(c),h.emit(ops.OdtDocument.signalCursorMoved,m));h.getOdfCanvas().addAnnotation(f);return!0};this.spec=function(){return{optype:"AddAnnotation",memberid:l,timestamp:d,position:b, length:e,name:a}}}; // Input 54 /* 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("core.DomUtils"); ops.OpRemoveAnnotation=function(){var n,m,l,d,b;this.init=function(e){n=e.memberid;m=e.timestamp;l=parseInt(e.position,10);d=parseInt(e.length,10);b=new core.DomUtils};this.transform=function(b,a){return null};this.execute=function(d){for(var a=d.getIteratorAtPosition(l).container(),h,f=null,c=null;a.namespaceURI!==odf.Namespaces.officens||"annotation"!==a.localName;)a=a.parentNode;if(null===a)return!1;f=a;(h=f.getAttributeNS(odf.Namespaces.officens,"name"))&&(c=b.getElementsByTagNameNS(d.getRootNode(), odf.Namespaces.officens,"annotation-end").filter(function(a){return h===a.getAttributeNS(odf.Namespaces.officens,"name")})[0]||null);d.getOdfCanvas().forgetAnnotations();for(a=b.getElementsByTagNameNS(f,odf.Namespaces.webodfns+":names:cursor","cursor");a.length;)f.parentNode.insertBefore(a.pop(),f);f.parentNode.removeChild(f);c&&c.parentNode.removeChild(c);d.fixCursorPositions();d.getOdfCanvas().refreshAnnotations();return!0};this.spec=function(){return{optype:"RemoveAnnotation",memberid:n,timestamp:m, position:l,length:d}}}; // Input 55 /* 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.OpApplyDirectStyling");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertTable");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpAddParagraphStyle");runtime.loadClass("ops.OpRemoveParagraphStyle"); runtime.loadClass("ops.OpAddAnnotation");runtime.loadClass("ops.OpRemoveAnnotation"); ops.OperationFactory=function(){function n(l){return function(){return new l}}var m;this.register=function(l,d){m[l]=d};this.create=function(l){var d=null,b=m[l.optype];b&&(d=b(l),d.init(l));return d};m={AddCursor:n(ops.OpAddCursor),ApplyDirectStyling:n(ops.OpApplyDirectStyling),InsertTable:n(ops.OpInsertTable),InsertText:n(ops.OpInsertText),RemoveText:n(ops.OpRemoveText),SplitParagraph:n(ops.OpSplitParagraph),SetParagraphStyle:n(ops.OpSetParagraphStyle),UpdateParagraphStyle:n(ops.OpUpdateParagraphStyle), AddParagraphStyle:n(ops.OpAddParagraphStyle),RemoveParagraphStyle:n(ops.OpRemoveParagraphStyle),MoveCursor:n(ops.OpMoveCursor),RemoveCursor:n(ops.OpRemoveCursor),AddAnnotation:n(ops.OpAddAnnotation),RemoveAnnotation:n(ops.OpRemoveAnnotation)}}; // Input 56 runtime.loadClass("core.Cursor");runtime.loadClass("core.PositionIterator");runtime.loadClass("core.PositionFilter");runtime.loadClass("core.LoopWatchDog");runtime.loadClass("odf.OdfUtils"); gui.SelectionMover=function(n,m){function l(){u.setUnfilteredPosition(n.getNode(),0);return u}function d(a,b){var c,d=null;a&&(c=b?a[a.length-1]:a[0]);c&&(d={top:c.top,left:b?c.right:c.left,bottom:c.bottom});return d}function b(a,c,e,f){var g=a.nodeType;e.setStart(a,c);e.collapse(!f);f=d(e.getClientRects(),!0===f);!f&&0a?-1:1;for(a=Math.abs(a);0k?n.previousPosition():n.nextPosition());)if(I.check(),h.acceptPosition(n)===s&&(r+=1,p=n.container(),w=b(p,n.unfilteredDomOffset(),D),w.top!==W)){if(w.top!==N&&N!==W)break;N=w.top;w=Math.abs(U-w.left);if(null===q||wa?(d=h.previousPosition,e=-1):(d=h.nextPosition,e=1);for(f=b(h.container(),h.unfilteredDomOffset(),p);d.call(h);)if(c.acceptPosition(h)===s){if(w.getParagraphElement(h.getCurrentNode())!==k)break;g=b(h.container(),h.unfilteredDomOffset(),p);if(g.bottom!==f.bottom&&(f=g.top>=f.top&&g.bottomf.bottom,!f))break;n+=e;f=g}p.detach();return n}function p(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 r(a,b,c){runtime.assert(null!==a,"SelectionMover.countStepsToPosition called with element===null");var d=l(),e=d.container(),f=d.unfilteredDomOffset(),g=0,h=new core.LoopWatchDog(1E3);d.setUnfilteredPosition(a,b);a=d.container();runtime.assert(Boolean(a),"SelectionMover.countStepsToPosition: positionIterator.container() returned null");b=d.unfilteredDomOffset();d.setUnfilteredPosition(e,f);var e=a,f=b,k=d.container(), m=d.unfilteredDomOffset();if(e===k)e=m-f;else{var n=e.compareDocumentPosition(k);2===n?n=-1:4===n?n=1:10===n?(f=p(e,k),n=fe)for(;d.nextPosition()&&(h.check(),c.acceptPosition(d)===s&&(g+=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.OpAddParagraphStyle");runtime.loadClass("ops.OpUpdateParagraphStyle");runtime.loadClass("ops.OpRemoveParagraphStyle"); ops.OperationTransformer=function(){function n(l,d){for(var b,e,a,h=[],f=[];0=b&&(h=-d.movePointBackward(-b,a));l.handleUpdate();return h};this.handleUpdate=function(){};this.getStepCounter=function(){return d.getStepCounter()};this.getMemberId=function(){return n};this.getNode=function(){return b.getNode()};this.getAnchorNode=function(){return b.getAnchorNode()};this.getSelectedRange=function(){return b.getSelectedRange()}; this.getOdtDocument=function(){return m};b=new core.Cursor(m.getDOM(),n);d=new gui.SelectionMover(b,m.getRootNode())}; // Input 59 /* 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(n,m){function l(){var d=[],a;for(a in b)b.hasOwnProperty(a)&&d.push({memberid:a,time:b[a].time});d.sort(function(a,b){return a.time-b.time});return d}var d,b={};this.getNode=function(){return d};this.getOdtDocument=function(){return m};this.getEdits=function(){return b};this.getSortedEdits=function(){return l()};this.addEdit=function(d,a){b[d]={time:a}};this.clearEdits=function(){b={}};d=m.getDOM().createElementNS("urn:webodf:names:editinfo","editinfo");n.insertBefore(d,n.firstChild)}; // Input 60 gui.Avatar=function(n,m){var l=this,d,b,e;this.setColor=function(a){b.style.borderColor=a};this.setImageUrl=function(a){l.isVisible()?b.src=a:e=a};this.isVisible=function(){return"block"===d.style.display};this.show=function(){e&&(b.src=e,e=void 0);d.style.display="block"};this.hide=function(){d.style.display="none"};this.markAsFocussed=function(a){d.className=a?"active":""};(function(){var a=n.ownerDocument,e=a.documentElement.namespaceURI;d=a.createElementNS(e,"div");b=a.createElementNS(e,"img"); b.width=64;b.height=64;d.appendChild(b);d.style.width="64px";d.style.height="70px";d.style.position="absolute";d.style.top="-80px";d.style.left="-34px";d.style.display=m?"block":"none";n.appendChild(d)})()}; // Input 61 runtime.loadClass("gui.Avatar");runtime.loadClass("ops.OdtCursor"); gui.Caret=function(n,m,l){function d(e){h&&a.parentNode&&(!f||e)&&(e&&void 0!==c&&runtime.clearTimeout(c),f=!0,b.style.opacity=e||"0"===b.style.opacity?"1":"0",c=runtime.setTimeout(function(){f=!1;d(!1)},500))}var b,e,a,h=!1,f=!1,c;this.refreshCursorBlinking=function(){l||n.getSelectedRange().collapsed?(h=!0,d(!0)):(h=!1,b.style.opacity="0")};this.setFocus=function(){h=!0;e.markAsFocussed(!0);d(!0)};this.removeFocus=function(){h=!1;e.markAsFocussed(!1);b.style.opacity="0"};this.setAvatarImageUrl= function(a){e.setImageUrl(a)};this.setColor=function(a){b.style.borderColor=a;e.setColor(a)};this.getCursor=function(){return n};this.getFocusElement=function(){return b};this.toggleHandleVisibility=function(){e.isVisible()?e.hide():e.show()};this.showHandle=function(){e.show()};this.hideHandle=function(){e.hide()};this.ensureVisible=function(){var a,c,d,e,f=n.getOdtDocument().getOdfCanvas().getElement().parentNode,h;d=f.offsetWidth-f.clientWidth+5;e=f.offsetHeight-f.clientHeight+5;h=b.getBoundingClientRect(); a=h.left-d;c=h.top-e;d=h.right+d;e=h.bottom+e;h=f.getBoundingClientRect();ch.bottom&&(f.scrollTop+=e-h.bottom);ah.right&&(f.scrollLeft+=d-h.right)};(function(){var c=n.getOdtDocument().getDOM();b=c.createElementNS(c.documentElement.namespaceURI,"span");a=n.getNode();a.appendChild(b);e=new gui.Avatar(a,m)})()}; // Input 62 runtime.loadClass("core.EventNotifier"); gui.ClickHandler=function(){function n(){l=0;d=null}var m,l=0,d=null,b=new core.EventNotifier([gui.ClickHandler.signalSingleClick,gui.ClickHandler.signalDoubleClick,gui.ClickHandler.signalTripleClick]);this.subscribe=function(d,a){b.subscribe(d,a)};this.handleMouseUp=function(e){var a=runtime.getWindow();d&&d.x===e.screenX&&d.y===e.screenY?(l+=1,1===l?b.emit(gui.ClickHandler.signalSingleClick,e):2===l?b.emit(gui.ClickHandler.signalDoubleClick,void 0):3===l&&(a.clearTimeout(m),b.emit(gui.ClickHandler.signalTripleClick, void 0),n())):(b.emit(gui.ClickHandler.signalSingleClick,e),l=1,d={x:e.screenX,y:e.screenY},a.clearTimeout(m),m=a.setTimeout(n,400))}};gui.ClickHandler.signalSingleClick="click";gui.ClickHandler.signalDoubleClick="doubleClick";gui.ClickHandler.signalTripleClick="tripleClick";(function(){return gui.ClickHandler})(); // Input 63 /* 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 n(b,d){d||(d=m.None);return b+":"+d}var m=gui.KeyboardHandler.Modifier,l=null,d={};this.setDefault=function(b){l=b};this.bind=function(b,e,a){b=n(b,e);runtime.assert(!1===d.hasOwnProperty(b),"tried to overwrite the callback handler of key combo: "+b);d[b]=a};this.unbind=function(b,e){var a=n(b,e);delete d[a]};this.reset=function(){l=null;d={}};this.handleEvent=function(b){var e=b.keyCode,a=m.None;b.metaKey&&(a|=m.Meta);b.ctrlKey&&(a|=m.Ctrl);b.altKey&&(a|=m.Alt); b.shiftKey&&(a|=m.Shift);e=n(e,a);e=d[e];a=!1;e?a=e():null!==l&&(a=l(b));a&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}};gui.KeyboardHandler.Modifier={None:0,Meta:1,Ctrl:2,Alt:4,Shift:8,MetaShift:9,CtrlShift:10,AltShift:12};gui.KeyboardHandler.KeyCode={Backspace:8,Tab:9,Clear:12,Enter:13,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Delete:46,A:65,B:66,I:73,U:85,Z:90};(function(){return gui.KeyboardHandler})(); // Input 64 /* 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("odf.Namespaces");runtime.loadClass("xmldom.LSSerializer");runtime.loadClass("odf.OdfNodeFilter");runtime.loadClass("odf.TextSerializer"); gui.Clipboard=function(){var n,m,l;this.setDataFromRange=function(d,b){var e=!0,a,h=d.clipboardData;a=runtime.getWindow();var f=b.startContainer.ownerDocument;!h&&a&&(h=a.clipboardData);h?(f=f.createElement("span"),f.appendChild(b.cloneContents()),a=h.setData("text/plain",m.writeToString(f)),e=e&&a,a=h.setData("text/html",n.writeToString(f,odf.Namespaces.namespaceMap)),e=e&&a,d.preventDefault()):e=!1;return e};n=new xmldom.LSSerializer;m=new odf.TextSerializer;l=new odf.OdfNodeFilter;n.filter=l;m.filter= l}; // Input 65 runtime.loadClass("core.DomUtils");runtime.loadClass("odf.OdfUtils");runtime.loadClass("ops.OpAddCursor");runtime.loadClass("ops.OpRemoveCursor");runtime.loadClass("ops.OpMoveCursor");runtime.loadClass("ops.OpInsertText");runtime.loadClass("ops.OpRemoveText");runtime.loadClass("ops.OpSplitParagraph");runtime.loadClass("ops.OpSetParagraphStyle");runtime.loadClass("ops.OpRemoveAnnotation");runtime.loadClass("gui.ClickHandler");runtime.loadClass("gui.Clipboard");runtime.loadClass("gui.KeyboardHandler"); runtime.loadClass("gui.StyleHelper"); gui.SessionController=function(){gui.SessionController=function(n,m){function l(a,b,c,d){var e="on"+b,f=!1;a.attachEvent&&(f=a.attachEvent(e,c));!f&&a.addEventListener&&(a.addEventListener(b,c,!1),f=!0);f&&!d||!a.hasOwnProperty(e)||(a[e]=c)}function d(a,b,c){var d="on"+b;a.detachEvent&&a.detachEvent(d,c);a.removeEventListener&&a.removeEventListener(b,c,!1);a[d]===c&&(a[d]=null)}function b(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function 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(B.getRootNode()),d=B.getOdfCanvas().getElement(),e;e=a;if(!e)return null;for(;e!==d&&!("urn:webodf:names:cursor"===e.namespaceURI&&"cursor"===e.localName||"urn:webodf:names:editinfo"===e.namespaceURI&&"editinfo"===e.localName);)if(e=e.parentNode,!e)return null;e!==d&&a!==e&&(a=e.parentNode,b=Array.prototype.indexOf.call(a.childNodes,e));c.setUnfilteredPosition(a,b);return B.getDistanceFromCursor(m,c.container(), c.unfilteredDomOffset())}function h(a){var b=B.getOdfCanvas().getElement(),c=B.getRootNode(),d=0;b.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING||(a=gui.SelectionMover.createPositionIterator(c),a.moveToEnd(),c=a.container(),d=a.unfilteredDomOffset());return{node:c,offset:d}}function f(b){ga&&runtime.setTimeout(function(){var c;a:{var d=B.getOdfCanvas().getElement(),f=X.getSelection(),g,k,l,p;if(null===f.anchorNode&&null===f.focusNode){c=b.clientX;g=b.clientY;k=B.getDOM();k.caretRangeFromPoint? (c=k.caretRangeFromPoint(c,g),g={container:c.startContainer,offset:c.startOffset}):k.caretPositionFromPoint?(c=k.caretPositionFromPoint(c,g),g={container:c.offsetNode,offset:c.offset}):g=null;if(!g){c=null;break a}c=g.container;g=g.offset;k=c;f=g}else c=f.anchorNode,g=f.anchorOffset,k=f.focusNode,f=f.focusOffset;runtime.assert(null!==c&&null!==k,"anchorNode is null or focusNode is null");l=ma.containsNode(d,c);p=ma.containsNode(d,k);l||p?(l||(l=h(c),c=l.node,g=l.offset),p||(l=h(k),k=l.node,f=l.offset), d.focus(),c={anchorNode:c,anchorOffset:g,focusNode:k,focusOffset:f}):c=null}null!==c&&(d=a(c.anchorNode,c.anchorOffset),g=c.focusNode===c.anchorNode&&c.focusOffset===c.anchorOffset?d:a(c.focusNode,c.focusOffset),null!==g&&0!==g||null!==d&&0!==d)&&(c=B.getCursorPosition(m),d=e(c+d,g-d),n.enqueue(d))},0)}function c(a){f(a)}function t(){var a=B.getOdfCanvas().getElement(),b=/[A-Za-z0-9]/,c=0,d=0,f,g;if(ma.containsNode(a,X.getSelection().focusNode)){a=gui.SelectionMover.createPositionIterator(B.getRootNode()); f=B.getCursor(m).getNode();for(a.setUnfilteredPosition(f,0);a.previousPosition();)if(g=a.getCurrentNode(),g.nodeType===Node.TEXT_NODE){g=g.data[a.unfilteredDomOffset()];if(!b.test(g))break;c-=1}else if(g.namespaceURI!==odf.Namespaces.textns||"span"!==g.localName)break;a.setUnfilteredPosition(f,0);do if(g=a.getCurrentNode(),g.nodeType===Node.TEXT_NODE){g=g.data[a.unfilteredDomOffset()];if(!b.test(g))break;d+=1}else if(g.namespaceURI!==odf.Namespaces.textns||"span"!==g.localName)break;while(a.nextPosition()); if(0!==c||0!==d)b=B.getCursorPosition(m),c=e(b+c,Math.abs(c)+Math.abs(d)),n.enqueue(c)}}function k(){var a=B.getOdfCanvas().getElement(),b,c;ma.containsNode(a,X.getSelection().focusNode)&&(c=B.getParagraphElement(B.getCursor(m).getNode()),a=B.getDistanceFromCursor(m,c,0),b=gui.SelectionMover.createPositionIterator(B.getRootNode()),b.moveToEndOfNode(c),c=B.getDistanceFromCursor(m,c,b.unfilteredDomOffset()),0!==a||0!==c)&&(b=B.getCursorPosition(m),a=e(b+a,Math.abs(a)+Math.abs(c)),n.enqueue(a))}function q(a){var b= B.getCursorSelection(m),c=B.getCursor(m).getStepCounter();0!==a&&(a=0a.length&&(a.position+=a.length,a.length=-a.length); return a}function W(a){var b=new ops.OpRemoveText;b.init({memberid:m,position:a.position,length:a.length});return b}function U(){var a=Q(B.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.MemberModel=function(){};ops.MemberModel.prototype.getMemberDetailsAndUpdates=function(n,m){};ops.MemberModel.prototype.unsubscribeMemberDetailsUpdates=function(n,m){};ops.MemberModel.prototype.close=function(n){}; // Input 67 /* 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.TrivialMemberModel=function(){this.getMemberDetailsAndUpdates=function(n,m){m(n,null)};this.unsubscribeMemberDetailsUpdates=function(n,m){};this.close=function(n){n()}}; // Input 68 /* Copyright (C) 2013 KO GmbH @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ ops.OperationRouter=function(){};ops.OperationRouter.prototype.setOperationFactory=function(n){};ops.OperationRouter.prototype.setPlaybackFunction=function(n){};ops.OperationRouter.prototype.push=function(n){};ops.OperationRouter.prototype.close=function(n){};ops.OperationRouter.prototype.getHasLocalUnsyncedOpsAndUpdates=function(n){};ops.OperationRouter.prototype.unsubscribeHasLocalUnsyncedOpsUpdates=function(n){}; // Input 69 /* 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 n,m;this.setOperationFactory=function(l){n=l};this.setPlaybackFunction=function(l){m=l};this.push=function(l){l=l.spec();l.timestamp=(new Date).getTime();l=n.create(l);m(l)};this.close=function(l){l()};this.getHasLocalUnsyncedOpsAndUpdates=function(l){l(!0)};this.unsubscribeHasLocalUnsyncedOpsUpdates=function(l){}}; // Input 70 gui.EditInfoHandle=function(n){var m=[],l,d=n.ownerDocument,b=d.documentElement.namespaceURI;this.setEdits=function(e){m=e;var a,h,f,c;l.innerHTML="";for(e=0;ek?(l(1,0),h=l(0.5,1E4-k),f=l(0.2,2E4-k)):1E4<=k&&2E4>k?(l(0.5,0),f=l(0.2,2E4-k)):l(0.2,0)};this.getEdits= function(){return n.getEdits()};this.clearEdits=function(){n.clearEdits();e.setEdits([]);a.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&a.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return n};this.show=function(){a.style.display="block"};this.hide=function(){d.hideHandle();a.style.display="none"};this.showHandle=function(){e.show()};this.hideHandle=function(){e.hide()};(function(){var c=n.getOdtDocument().getDOM();a=c.createElementNS(c.documentElement.namespaceURI, "div");a.setAttribute("class","editInfoMarker");a.onmouseover=function(){d.showHandle()};a.onmouseout=function(){d.hideHandle()};b=n.getNode();b.appendChild(a);e=new gui.EditInfoHandle(b);m||d.hide()})()}; // Input 72 /* 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("gui.Caret");runtime.loadClass("ops.TrivialMemberModel");runtime.loadClass("ops.EditInfo");runtime.loadClass("gui.EditInfoMarker");gui.SessionViewOptions=function(){this.caretBlinksOnRangeSelect=this.caretAvatarsInitiallyVisible=this.editInfoMarkersInitiallyVisible=!0}; gui.SessionView=function(){return function(n,m,l){function d(a,b,d){function e(b,d,f){d=b+'[editinfo|memberid^="'+a+'"]'+f+d;a:{var g=c.firstChild;for(b=b+'[editinfo|memberid^="'+a+'"]'+f;g;){if(g.nodeType===Node.TEXT_NODE&&0===g.data.indexOf(b)){b=g;break a}g=g.nextSibling}b=null}b?b.data=d:c.appendChild(document.createTextNode(d))}e("div.editInfoMarker","{ background-color: "+d+"; }","");e("span.editInfoColor","{ background-color: "+d+"; }","");e("span.editInfoAuthor",'{ content: "'+b+'"; }',":before"); e("dc|creator",'{ content: "'+b+'"; display: none;}',":before");e("dc|creator","{ background-color: "+d+"; }","")}function b(a){var b,c;for(c in t)t.hasOwnProperty(c)&&(b=t[c],a?b.show():b.hide())}function e(a){l.getCarets().forEach(function(b){a?b.showHandle():b.hideHandle()})}function a(a,b){var c=l.getCaret(a);void 0===b?runtime.log('MemberModel 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)),d(a,b.fullname,b.color))}function h(b){var c=b.getMemberId(),d=m.getMemberModel();l.registerCursor(b,q,g);a(c,null);d.getMemberDetailsAndUpdates(c,a);runtime.log("+++ View here +++ eagerly created an Caret for '"+c+"'! +++")}function f(b){var c=!1,d;for(d in t)if(t.hasOwnProperty(d)&&t[d].getEditInfo().getEdits().hasOwnProperty(b)){c=!0;break}c||m.getMemberModel().unsubscribeMemberDetailsUpdates(b,a)}var c,t={},k=void 0!==n.editInfoMarkersInitiallyVisible?Boolean(n.editInfoMarkersInitiallyVisible): !0,q=void 0!==n.caretAvatarsInitiallyVisible?Boolean(n.caretAvatarsInitiallyVisible):!0,g=void 0!==n.caretBlinksOnRangeSelect?Boolean(n.caretBlinksOnRangeSelect):!0;this.showEditInfoMarkers=function(){k||(k=!0,b(k))};this.hideEditInfoMarkers=function(){k&&(k=!1,b(k))};this.showCaretAvatars=function(){q||(q=!0,e(q))};this.hideCaretAvatars=function(){q&&(q=!1,e(q))};this.getSession=function(){return m};this.getCaret=function(a){return l.getCaret(a)};this.close=function(a){a()};(function(){var a=m.getOdtDocument(), b=document.getElementsByTagName("head")[0];a.subscribe(ops.OdtDocument.signalCursorAdded,h);a.subscribe(ops.OdtDocument.signalCursorRemoved,f);a.subscribe(ops.OdtDocument.signalParagraphChanged,function(a){var b=a.paragraphElement,c=a.memberId;a=a.timeStamp;var d,e="",f=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0];f?(e=f.getAttributeNS("urn:webodf:names:editinfo","id"),d=t[e]):(e=Math.random().toString(),d=new ops.EditInfo(b,m.getOdtDocument()),d=new gui.EditInfoMarker(d,k), f=b.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo")[0],f.setAttributeNS("urn:webodf:names:editinfo","id",e),t[e]=d);d.addEdit(c,new Date(a))});c=document.createElementNS(b.namespaceURI,"style");c.type="text/css";c.media="screen, print, handheld, projection";c.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);"));c.appendChild(document.createTextNode("@namespace dc url(http://purl.org/dc/elements/1.1/);"));b.appendChild(c)})()}}(); // Input 73 /* 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("gui.Caret"); gui.CaretManager=function(n){function m(a){return f.hasOwnProperty(a)?f[a]:null}function l(){return n.getSession().getOdtDocument().getOdfCanvas().getElement()}function d(a){a===n.getInputMemberId()&&l().removeAttribute("tabindex");delete f[a]}function b(a){a=a.getMemberId();a===n.getInputMemberId()&&(a=m(a))&&a.refreshCursorBlinking()}function e(a){a.memberId===n.getInputMemberId()&&(a=m(a.memberId))&&a.ensureVisible()}function a(){var a=m(n.getInputMemberId());a&&a.setFocus()}function h(){var a= m(n.getInputMemberId());a&&a.removeFocus()}var f={};this.registerCursor=function(a,b,d){var e=a.getMemberId(),g=l();b=new gui.Caret(a,b,d);f[e]=b;e===n.getInputMemberId()&&(runtime.log("Starting to track input on new cursor of "+e),a.handleUpdate=b.ensureVisible,g.setAttribute("tabindex",0),g.focus());return b};this.getCaret=m;this.getCarets=function(){return Object.keys(f).map(function(a){return f[a]})};(function(){var c=n.getSession().getOdtDocument(),f=l();c.subscribe(ops.OdtDocument.signalParagraphChanged, e);c.subscribe(ops.OdtDocument.signalCursorMoved,b);c.subscribe(ops.OdtDocument.signalCursorRemoved,d);f.onfocus=a;f.onblur=h})()}; // Input 74 runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Namespaces"); gui.PresenterUI=function(){var n=new xmldom.XPath,m=runtime.getWindow();return function(l){var d=this;d.setInitialSlideMode=function(){d.startSlideMode("single")};d.keyDownHandler=function(b){if(!b.target.isContentEditable&&"input"!==b.target.nodeName)switch(b.keyCode){case 84:d.toggleToolbar();break;case 37:case 8:d.prevSlide();break;case 39:case 32:d.nextSlide();break;case 36:d.firstSlide();break;case 35:d.lastSlide()}};d.root=function(){return d.odf_canvas.odfContainer().rootElement};d.firstSlide= function(){d.slideChange(function(b,d){return 0})};d.lastSlide=function(){d.slideChange(function(b,d){return d-1})};d.nextSlide=function(){d.slideChange(function(b,d){return b+1b?-1:b-1})};d.slideChange=function(b){var e=d.getPages(d.odf_canvas.odfContainer().rootElement),a=-1,h=0;e.forEach(function(b){b=b[1];b.hasAttribute("slide_current")&&(a=h,b.removeAttribute("slide_current"));h+=1});b=b(a,e.length);-1===b&&(b=a);e[b][1].setAttribute("slide_current", "1");document.getElementById("pagelist").selectedIndex=b;"cont"===d.slide_mode&&m.scrollBy(0,e[b][1].getBoundingClientRect().top-30)};d.selectSlide=function(b){d.slideChange(function(d,a){return b>=a||0>b?-1:b})};d.scrollIntoContView=function(b){var e=d.getPages(d.odf_canvas.odfContainer().rootElement);0!==e.length&&m.scrollBy(0,e[b][1].getBoundingClientRect().top-30)};d.getPages=function(b){b=b.getElementsByTagNameNS(odf.Namespaces.drawns,"page");var d=[],a;for(a=0;a=a.rangeCount||!p)||(a=a.getRangeAt(0),p.setPoint(a.startContainer,a.startOffset))}function e(){var a=n.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();p&&p.node()&&(b=p.node(),c=b.ownerDocument.createRange(), c.setStart(b,p.position()),c.collapse(!0),a.addRange(c))}function a(a){var c=a.charCode||a.keyCode;if(p=null,p&&37===c)b(),p.stepBackward(),e();else if(16<=c&&20>=c||33<=c&&40>=c)return;d(a)}function h(a){d(a)}function f(a){for(var b=a.firstChild;b&&b!==a;)b.nodeType===Node.ELEMENT_NODE&&f(b),b=b.nextSibling||b.parentNode;var c,d,e,b=a.attributes;c="";for(e=b.length-1;0<=e;e-=1)d=b.item(e),c=c+" "+d.nodeName+'="'+d.nodeValue+'"';a.setAttribute("customns_name",a.nodeName);a.setAttribute("customns_atts", c);b=a.firstChild;for(d=/^\s*$/;b&&b!==a;)c=b,b=b.nextSibling||b.parentNode,c.nodeType===Node.TEXT_NODE&&d.test(c.nodeValue)&&c.parentNode.removeChild(c)}function c(a,b){for(var d=a.firstChild,e,f,g;d&&d!==a;){if(d.nodeType===Node.ELEMENT_NODE)for(c(d,b),e=d.attributes,g=e.length-1;0<=g;g-=1)f=e.item(g),"http://www.w3.org/2000/xmlns/"!==f.namespaceURI||b[f.nodeValue]||(b[f.nodeValue]=f.localName);d=d.nextSibling||d.parentNode}}function t(){var a=n.ownerDocument.createElement("style"),b;b={};c(n,b); var d={},e,f,g=0;for(e in b)if(b.hasOwnProperty(e)&&e){f=b[e];if(!f||d.hasOwnProperty(f)||"xmlns"===f){do f="ns"+g,g+=1;while(d.hasOwnProperty(f));b[e]=f}d[f]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+k;a.appendChild(n.ownerDocument.createTextNode(b));m=m.parentNode.replaceChild(a,m)}var k,q,g,p=null;n.id||(n.id="xml"+String(Math.random()).substring(2));q="#"+n.id+" ";k=q+"*,"+q+":visited, "+q+":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"+ q+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+q+":after {color: blue; content: '';}\n"+q+"{overflow: auto;}\n";(function(b){l(b,"click",h);l(b,"keydown",a);l(b,"drop",d);l(b,"dragend",d);l(b,"beforepaste",d);l(b,"paste",d)})(n);this.updateCSS=t;this.setXML=function(a){a=a.documentElement||a;g=a=n.ownerDocument.importNode(a,!0);for(f(a);n.lastChild;)n.removeChild(n.lastChild);n.appendChild(a);t();p=new core.PositionIterator(a)};this.getXML= function(){return g}}; // 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(n,m){};gui.UndoManager.prototype.unsubscribe=function(n,m){};gui.UndoManager.prototype.setOdtDocument=function(n){};gui.UndoManager.prototype.saveInitialState=function(){};gui.UndoManager.prototype.resetInitialState=function(){};gui.UndoManager.prototype.setPlaybackFunction=function(n){};gui.UndoManager.prototype.hasUndoStates=function(){};gui.UndoManager.prototype.hasRedoStates=function(){}; gui.UndoManager.prototype.moveForward=function(n){};gui.UndoManager.prototype.moveBackward=function(n){};gui.UndoManager.prototype.onOperationExecuted=function(n){};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 n(l){return l.spec().optype}function m(l){switch(n(l)){case "MoveCursor":case "AddCursor":case "RemoveCursor":return!1;default:return!0}}this.getOpType=n;this.isEditOperation=m;this.isPartOfOperationSet=function(l,d){if(m(l)){if(0===d.length)return!0;var b;if(b=m(d[d.length-1]))a:{b=d.filter(m);var e=n(l),a;b:switch(e){case "RemoveText":case "InsertText":a=!0;break b;default:a=!1}if(a&&e===n(b[0])){if(1===b.length){b=!0;break a}e=b[b.length-2].spec().position; b=b[b.length-1].spec().position;a=l.spec().position;if(b===a-(b-e)){b=!0;break a}}b=!1}return b}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("core.DomUtils");runtime.loadClass("gui.UndoManager");runtime.loadClass("gui.UndoStateRules"); gui.TrivialUndoManager=function(n){function m(){r.emit(gui.UndoManager.signalUndoStackChanged,{undoAvailable:a.hasUndoStates(),redoAvailable:a.hasRedoStates()})}function l(){q!==c&&q!==g[g.length-1]&&g.push(q)}function d(a){var b=a.previousSibling||a.nextSibling;a.parentNode.removeChild(a);h.normalizeTextNodes(b)}function b(a){return Object.keys(a).map(function(b){return a[b]})}function e(a){function c(a){var b=a.spec();if(f[b.memberid])switch(b.optype){case "AddCursor":d[b.memberid]||(d[b.memberid]= a,delete f[b.memberid],g-=1);break;case "MoveCursor":e[b.memberid]||(e[b.memberid]=a)}}var d={},e={},f={},g,h=a.pop();k.getCursors().forEach(function(a){f[a.getMemberId()]=!0});for(g=Object.keys(f).length;h&&0 @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");runtime.loadClass("gui.SelectionMover");runtime.loadClass("gui.StyleHelper");runtime.loadClass("core.PositionFilterChain"); ops.OdtDocument=function(n){function m(){var a=n.odfContainer().getContentElement(),b=a&&a.localName;runtime.assert("text"===b,"Unsupported content element type '"+b+"'for OdtDocument");return a}function l(a){function b(a){for(;!(a.namespaceURI===odf.Namespaces.officens&&"text"===a.localName||a.namespaceURI===odf.Namespaces.officens&&"annotation"===a.localName);)a=a.parentNode;return a}this.acceptPosition=function(c){c=c.container();var d=f[a].getNode();return b(c)===b(d)?t:k}}function d(a){var b= gui.SelectionMover.createPositionIterator(m());for(a+=1;0=e;e+=1){b=a.container();c=a.unfilteredDomOffset();if(b.nodeType===Node.TEXT_NODE&&" "===b.data[c]&&h.isSignificantWhitespace(b, c)){runtime.assert(" "===b.data[c],"upgradeWhitespaceToElement: textNode.data[offset] should be a literal space");var f=b.ownerDocument.createElementNS("urn:oasis:names:tc:opendocument:xmlns:text:1.0","text:s");f.appendChild(b.ownerDocument.createTextNode(" "));b.deleteData(c,1);0= 0");1===q.acceptPosition(d)?(h=d.container(),h.nodeType===Node.TEXT_NODE&&(e=h,k=0)):b+=1;for(;0 @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/webodf/webodf/ */ runtime.loadClass("ops.TrivialMemberModel");runtime.loadClass("ops.TrivialOperationRouter");runtime.loadClass("ops.OperationFactory");runtime.loadClass("ops.OdtDocument"); ops.Session=function(n){var m=new ops.OperationFactory,l=new ops.OdtDocument(n),d=new ops.TrivialMemberModel,b=null;this.setMemberModel=function(b){d=b};this.setOperationFactory=function(d){m=d;b&&b.setOperationFactory(m)};this.setOperationRouter=function(d){b=d;d.setPlaybackFunction(function(a){a.execute(l);l.emit(ops.OdtDocument.signalOperationExecuted,a)});d.setOperationFactory(m)};this.getOperationRouter=function(){return b};this.getMemberModel=function(){return d};this.getOperationFactory=function(){return m}; this.getOdtDocument=function(){return l};this.enqueue=function(d){b.push(d)};this.close=function(b){l.close(function(a){a?b(a):b()})};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@namespace annotation url(urn:webodf:names:annotation);\n@namespace dc url(http://purl.org/dc/elements/1.1/);\n\noffice|document > *, office|document-content > * {\n display: none;\n}\noffice|body, office|document {\n display: inline-block;\n position: relative;\n}\n\ntext|p, text|h {\n display: block;\n padding: 0;\n margin: 0;\n line-height: normal;\n position: relative;\n min-height: 1.3em; /* prevent empty paragraphs and headings from collapsing if they are empty */\n}\n*[runtimens|containsparagraphanchor] {\n position: relative;\n}\ntext|s {\n white-space: pre;\n}\ntext|tab {\n display: inline;\n white-space: pre;\n}\ntext|line-break {\n content: \" \";\n display: block;\n}\ntext|tracked-changes {\n /*Consumers that do not support change tracking, should ignore changes.*/\n display: none;\n}\noffice|binary-data {\n display: none;\n}\noffice|text {\n display: block;\n text-align: left;\n overflow: visible;\n word-wrap: break-word;\n}\n\noffice|text::selection {\n /** Let's not draw selection highlight that overflows into the office|text\n * node when selecting content across several paragraphs\n */\n background: transparent;\n}\noffice|text * draw|text-box {\n /** only for text documents */\n display: block;\n border: 1px solid #d3d3d3;\n}\noffice|spreadsheet {\n display: block;\n border-collapse: collapse;\n empty-cells: show;\n font-family: sans-serif;\n font-size: 10pt;\n text-align: left;\n page-break-inside: avoid;\n overflow: hidden;\n}\noffice|presentation {\n display: inline-block;\n text-align: left;\n}\n#shadowContent {\n display: inline-block;\n text-align: left;\n}\ndraw|page {\n display: block;\n position: relative;\n overflow: hidden;\n}\npresentation|notes, presentation|footer-decl, presentation|date-time-decl {\n display: none;\n}\n@media print {\n draw|page {\n border: 1pt solid black;\n page-break-inside: avoid;\n }\n presentation|notes {\n /*TODO*/\n }\n}\noffice|spreadsheet text|p {\n border: 0px;\n padding: 1px;\n margin: 0px;\n}\noffice|spreadsheet table|table {\n margin: 3px;\n}\noffice|spreadsheet table|table:after {\n /* show sheet name the end of the sheet */\n /*content: attr(table|name);*/ /* gives parsing error in opera */\n}\noffice|spreadsheet table|table-row {\n counter-increment: row;\n}\noffice|spreadsheet table|table-row:before {\n width: 3em;\n background: #cccccc;\n border: 1px solid black;\n text-align: center;\n content: counter(row);\n display: table-cell;\n}\noffice|spreadsheet table|table-cell {\n border: 1px solid #cccccc;\n}\ntable|table {\n display: table;\n}\ndraw|frame table|table {\n width: 100%;\n height: 100%;\n background: white;\n}\ntable|table-header-rows {\n display: table-header-group;\n}\ntable|table-row {\n display: table-row;\n}\ntable|table-column {\n display: table-column;\n}\ntable|table-cell {\n width: 0.889in;\n display: table-cell;\n word-break: break-all; /* prevent long words from extending out the table cell */\n}\ndraw|frame {\n display: block;\n}\ndraw|image {\n display: block;\n width: 100%;\n height: 100%;\n top: 0px;\n left: 0px;\n background-repeat: no-repeat;\n background-size: 100% 100%;\n -moz-background-size: 100% 100%;\n}\n/* only show the first image in frame */\ndraw|frame > draw|image:nth-of-type(n+2) {\n display: none;\n}\ntext|list:before {\n display: none;\n content:\"\";\n}\ntext|list {\n counter-reset: list;\n}\ntext|list-item {\n display: block;\n}\ntext|number {\n display:none;\n}\n\ntext|a {\n color: blue;\n text-decoration: underline;\n cursor: pointer;\n}\ntext|note-citation {\n vertical-align: super;\n font-size: smaller;\n}\ntext|note-body {\n display: none;\n}\ntext|note:hover text|note-citation {\n background: #dddddd;\n}\ntext|note:hover text|note-body {\n display: block;\n left:1em;\n max-width: 80%;\n position: absolute;\n background: #ffffaa;\n}\nsvg|title, svg|desc {\n display: none;\n}\nvideo {\n width: 100%;\n height: 100%\n}\n\n/* below set up the cursor */\ncursor|cursor {\n display: inline;\n width: 0px;\n height: 1em;\n /* making the position relative enables the avatar to use\n the cursor as reference for its absolute position */\n position: relative;\n z-index: 1;\n}\ncursor|cursor > span {\n display: inline;\n position: absolute;\n top: 5%; /* push down the caret; 0px can do the job, 5% looks better, 10% is a bit over */\n height: 1em;\n border-left: 2px solid black;\n outline: none;\n}\n\ncursor|cursor > div {\n padding: 3px;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n border: none !important;\n border-radius: 5px;\n opacity: 0.3;\n}\n\ncursor|cursor > div > img {\n border-radius: 5px;\n}\n\ncursor|cursor > div.active {\n opacity: 0.8;\n}\n\ncursor|cursor > div:after {\n content: ' ';\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: black transparent transparent transparent;\n\n top: 100%;\n left: 43%;\n}\n\n\n.editInfoMarker {\n position: absolute;\n width: 10px;\n height: 100%;\n left: -20px;\n opacity: 0.8;\n top: 0;\n border-radius: 5px;\n background-color: transparent;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n}\n.editInfoMarker:hover {\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);\n}\n\n.editInfoHandle {\n position: absolute;\n background-color: black;\n padding: 5px;\n border-radius: 5px;\n opacity: 0.8;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n bottom: 100%;\n margin-bottom: 10px;\n z-index: 3;\n left: -25px;\n}\n.editInfoHandle:after {\n content: ' ';\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: black transparent transparent transparent;\n\n top: 100%;\n left: 5px;\n}\n.editInfo {\n font-family: sans-serif;\n font-weight: normal;\n font-style: normal;\n text-decoration: none;\n color: white;\n width: 100%;\n height: 12pt;\n}\n.editInfoColor {\n float: left;\n width: 10pt;\n height: 10pt;\n border: 1px solid white;\n}\n.editInfoAuthor {\n float: left;\n margin-left: 5pt;\n font-size: 10pt;\n text-align: left;\n height: 12pt;\n line-height: 12pt;\n}\n.editInfoTime {\n float: right;\n margin-left: 30pt;\n font-size: 8pt;\n font-style: italic;\n color: yellow;\n height: 12pt;\n line-height: 12pt;\n}\n\n.annotationWrapper {\n display: inline;\n position: relative;\n}\n\n.annotationRemoveButton:before {\n content: '\u00d7';\n color: white;\n padding: 5px;\n line-height: 1em;\n}\n\n.annotationRemoveButton {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: black;\n box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);\n position: absolute;\n top: -10px;\n left: -10px;\n z-index: 3;\n text-align: center;\n font-family: sans-serif;\n font-style: normal;\n font-weight: normal;\n text-decoration: none;\n font-size: 15px;\n}\n.annotationRemoveButton:hover {\n cursor: pointer;\n box-shadow: 0px 0px 5px rgba(0, 0, 0, 1);\n}\n\n.annotationNote {\n width: 4cm;\n position: absolute;\n display: inline;\n z-index: 10;\n}\n.annotationNote > office|annotation {\n display: block;\n}\n\n.annotationConnector {\n position: absolute;\n display: inline;\n z-index: 2;\n border-top: 1px dashed brown;\n}\n.annotationConnector.angular {\n -moz-transform-origin: left top;\n -webkit-transform-origin: left top;\n -ms-transform-origin: left top;\n transform-origin: left top;\n}\n.annotationConnector.horizontal {\n left: 0;\n}\n.annotationConnector.horizontal:before {\n content: '';\n display: inline;\n position: absolute;\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 8.7px 5px 0 5px;\n border-color: brown transparent transparent transparent;\n top: -1px;\n left: -5px;\n}\n\noffice|annotation {\n width: 100%;\n height: 100%;\n display: none;\n background: rgb(198, 238, 184);\n background: -moz-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -webkit-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -o-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: -ms-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n background: linear-gradient(180deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);\n box-shadow: 0 3px 4px -3px #ccc;\n}\n\noffice|annotation > dc|creator {\n display: block;\n font-size: 10pt;\n font-weight: normal;\n font-style: normal;\n font-family: sans-serif;\n color: white;\n background-color: brown;\n padding: 4px;\n}\noffice|annotation > dc|date {\n display: block;\n font-size: 10pt;\n font-weight: normal;\n font-style: normal;\n font-family: sans-serif;\n border: 4px solid transparent;\n}\noffice|annotation > text|list {\n display: block;\n padding: 5px;\n}\n\n/* This is very temporary CSS. This must go once\n * we start bundling webodf-default ODF styles for annotations.\n */\noffice|annotation text|p {\n font-size: 10pt;\n color: black;\n font-weight: normal;\n font-style: normal;\n text-decoration: none;\n font-family: sans-serif;\n}\n\ndc|*::selection {\n background: transparent;\n}\ndc|*::-moz-selection {\n background: transparent;\n}\n\n#annotationsPane {\n background-color: #EAEAEA;\n width: 4cm;\n height: 100%;\n display: none;\n position: absolute;\n outline: 1px solid #ccc;\n}\n\n.annotationHighlight {\n background-color: yellow;\n position: relative;\n}\n";