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