+e;e++)j[D[e]]=0;h=7;e=new J(j,19,19,null,null,h);if(0!=e.status)return-1;m=e.root;h=e.m;p=F+i;for(d=f=0;de)j[d++]=f=e;else if(16==e){r(2);e=3+s(2);t(2);if(d+e>p)return-1;for(;0p)return-1;for(;0E;E++)K[E]=8;for(;256>E;E++)K[E]=9;for(;280>E;E++)K[E]=7;for(;288>E;E++)K[E]=8;c=7;E=new J(K,288,257,w,v,c);if(0!=E.status){alert("HufBuild error: "+E.status);D=-1;break b}k=E.root;c=E.m;for(E=0;30>E;E++)K[E]=5;F=5;E=new J(K,30,0,A,B,F);if(1e&&l.setStart(f,l.startOffset-1);l.endContainer===c?l.setEnd(f,e):l.endContainer===f&&l.endOffset>e&&l.setEnd(f,l.endOffset-1)}if(d){for(b=0;b1/l?"-0":String(l),j(b+" should be "+c+". Was "+a+".")):j(b+" should be "+c+" (of type "+typeof c+"). Was "+l+" (of type "+typeof l+").")}var i=0;this.shouldBeNull=function(c,b){k(c,b,"null")};this.shouldBeNonNull=function(c,b){var a,d;try{d=eval(b)}catch(l){a=l}a?j(b+" should be non-null. Threw exception "+a):null!==d?runtime.log("pass",b+
+" is non-null."):j(b+" should be non-null. Was "+d)};this.shouldBe=k;this.countFailedTests=function(){return i}};
+core.UnitTester=function(){var j=0,n={};this.runTests=function(k,i){function c(a){if(0===a.length)n[b]=e,j+=d.countFailedTests(),i();else{m=a[0];var g=Runtime.getFunctionName(m);runtime.log("Running "+g);h=d.countFailedTests();l.setUp();m(function(){l.tearDown();e[g]=h===d.countFailedTests();c(a.slice(1))})}}var b=Runtime.getFunctionName(k),a,d=new core.UnitTestRunner,l=new k(d),e={},f,m,g,h;if(b.hasOwnProperty(n))runtime.log("Test "+b+" has already run.");else{runtime.log("Running "+b+": "+l.description());
+g=l.tests();for(f=0;f>>8^g;return b^-1}function i(a){var c=a.getFullYear();return 1980>c?0:c-1980<<25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function c(a,
+c){var b,d,e,g,f,o,p,l=this;this.load=function(c){if(void 0!==l.data)c(null,l.data);else{var b=f+34+d+e+256;b+p>m&&(b=m-p);runtime.read(a,p,b,function(b,d){if(b||null===d)c(b,d);else a:{var e=d,s=new core.ByteArray(e),m=s.readUInt32LE(),p;if(67324752!==m)c("File entry signature is wrong."+m.toString()+" "+e.length.toString(),null);else{s.pos+=22;m=s.readUInt16LE();p=s.readUInt16LE();s.pos+=m+p;if(g){e=e.slice(s.pos,s.pos+f);if(f!==e.length){c("The amount of compressed bytes read was "+e.length.toString()+
+" instead of "+f.toString()+" for "+l.filename+" in "+a+".",null);break a}e=h(e,o)}else e=e.slice(s.pos,s.pos+o);o!==e.length?c("The amount of bytes read was "+e.length.toString()+" instead of "+o.toString()+" for "+l.filename+" in "+a+".",null):(l.data=e,c(null,e))}}})}};this.set=function(a,c,b,d){l.filename=a;l.data=c;l.compressed=b;l.date=d};this.error=null;c&&(b=c.readUInt32LE(),33639248!==b?this.error="Central directory entry has wrong signature at position "+(c.pos-4).toString()+' for file "'+
+a+'": '+c.data.length.toString():(c.pos+=6,g=c.readUInt16LE(),b=c.readUInt32LE(),this.date=new Date((b>>25&127)+1980,(b>>21&15)-1,b>>16&31,b>>11&15,b>>5&63,(b&31)<<1),c.readUInt32LE(),f=c.readUInt32LE(),o=c.readUInt32LE(),d=c.readUInt16LE(),e=c.readUInt16LE(),b=c.readUInt16LE(),c.pos+=8,p=c.readUInt32LE(),this.filename=runtime.byteArrayToString(c.data.slice(c.pos,c.pos+d),"utf8"),c.pos+=d+e+b))}function b(a,c){var b=null,d,e;for(e=0;em?n("File '"+j+"' cannot be read.",
+o):runtime.read(j,m-22,22,function(a,b){if(a||null===n||null===b)n(a,o);else if(22!==b.length)n("Central directory length should be 22.",o);else{var e=new core.ByteArray(b),d;d=e.readUInt32LE();101010256!==d?n("Central directory signature is wrong: "+d.toString(),o):(d=e.readUInt16LE(),0!==d?n("Zip files with non-zero disk numbers are not supported.",o):(d=e.readUInt16LE(),0!==d?n("Zip files with non-zero disk numbers are not supported.",o):(d=e.readUInt16LE(),g=e.readUInt16LE(),d!==g?n("Number of entries is inconsistent.",
+o):(d=e.readUInt32LE(),e=e.readUInt16LE(),e=m-22-d,runtime.read(j,e,m-e,function(a,b){if(a||null===b)n(a,o);else a:{var e=new core.ByteArray(b),d,h;f=[];for(d=0;d"}c+=d}if(1===a||3===a){for(d=i.firstChild;d;)c+=j(b,d),d=d.nextSibling;i.nodeValue&&(c+=i.nodeValue)}1===a&&(b="",1===i.nodeType&&(b+=""+i.nodeName+">"),c+=b);return c}var n=this;this.filter=null;this.writeToString=function(k,i){if(!k)return"";var c;if(i){c=i;var b={},a;for(a in c)c.hasOwnProperty(a)&&(b[c[a]]=a);c=b}else c={};return j(c,
+k)}};
+// Input 15
+xmldom.RelaxNGParser=function(){function j(a,c){this.message=function(){c&&(a+=1===c.nodeType?" Element ":" Node ",a+=c.nodeName,c.nodeValue&&(a+=" with value '"+c.nodeValue+"'"),a+=".");return a}}function n(a){if(2>=a.e.length)return a;var c={name:a.name,e:a.e.slice(0,2)};return n({name:a.name,e:[c].concat(a.e.slice(2))})}function k(a){var a=a.split(":",2),c="",b;1===a.length?a=["",a[0]]:c=a[0];for(b in d)d[b]===c&&(a[0]=b);return a}function i(a,c){for(var b=0,d,h,o=a.name;a.e&&b=e.length)return c;0===h&&(h=0);for(var g=e.item(h);g.namespaceURI===d;){h+=1;if(h>=e.length)return c;g=e.item(h)}return g=b(a,c.attDeriv(a,e.item(h)),e,h+1)}
+function a(b,c,d){d.e[0].a?(b.push(d.e[0].text),c.push(d.e[0].a.ns)):a(b,c,d.e[0]);d.e[1].a?(b.push(d.e[1].text),c.push(d.e[1].a.ns)):a(b,c,d.e[1])}var d="http://www.w3.org/2000/xmlns/",l,e,f,m,g,h,o,p,z,C,w={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return w},startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return w},endTagDeriv:function(){return w}},v={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return w},
+startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return v},endTagDeriv:function(){return w}},A={type:"text",nullable:!0,hash:"text",textDeriv:function(){return A},startTagOpenDeriv:function(){return w},attDeriv:function(){return w},startTagCloseDeriv:function(){return A},endTagDeriv:function(){return w}},B,D,x;l=i("choice",function(a,b){if(a===w)return b;if(b===w||a===b)return a},function(a,b){var d={},e;c(d,{p1:a,p2:b});b=a=void 0;for(e in d)d.hasOwnProperty(e)&&
+(void 0===a?a=d[e]:b=void 0===b?d[e]:l(b,d[e]));var h=a,g=b;return{type:"choice",p1:h,p2:g,nullable:h.nullable||g.nullable,textDeriv:function(a,b){return l(h.textDeriv(a,b),g.textDeriv(a,b))},startTagOpenDeriv:k(function(a){return l(h.startTagOpenDeriv(a),g.startTagOpenDeriv(a))}),attDeriv:function(a,b){return l(h.attDeriv(a,b),g.attDeriv(a,b))},startTagCloseDeriv:j(function(){return l(h.startTagCloseDeriv(),g.startTagCloseDeriv())}),endTagDeriv:j(function(){return l(h.endTagDeriv(),g.endTagDeriv())})}});
+var u=function(a,b){if(a===w||b===w)return w;if(a===v)return b;if(b===v)return a},J={},r=0;e=function(a,b){var c=u&&u(a,b),d,h;if(void 0!==c)return c;c=a.hash||a.toString();d=b.hash||b.toString();c=f&&c.push(n(a.substring(b,d)))):"["===a[d]&&(0>=f&&(b=d+1),f+=1),d+=1;return d};k.prototype.next=function(){};k.prototype.reset=function(){};f=function(a,e,f){var j,i,m,k;for(j=
+0;j text|list-item > text|list",e-=1;i=b+" > text|list-item > *:not(text|list):first-child:before{"+d+";counter-increment:list;"+("margin-left:"+h+";")+("width:"+c+";")+"display:inline-block}";try{a.insertRule(b+" > text|list-item > *:not(text|list):first-child{margin-left:"+f+";}",a.cssRules.length),
+a.insertRule(i,a.cssRules.length)}catch(l){throw l;}}function e(c,h,i,j){if("list"===h)for(var o=j.firstChild,k,p;o;){if(o.namespaceURI===g)if(k=o,"list-level-style-number"===o.localName){p=k;var n=p.getAttributeNS(m,"num-format"),y=p.getAttributeNS(m,"num-suffix"),G="",G={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},I="",I=p.getAttributeNS(m,"num-prefix")||"",I=G.hasOwnProperty(n)?I+(" counter(list, "+G[n]+")"):n?I+("'"+n+"';"):I+" ''";y&&(I+=" '"+y+"'");p=G="content: "+
+I+";";l(c,i,k,p)}else"list-level-style-image"===o.localName?(p="content: none;",l(c,i,k,p)):"list-level-style-bullet"===o.localName&&(p="content: '"+k.getAttributeNS(g,"bullet-char")+"';",l(c,i,k,p));o=o.nextSibling}else{i=b(h,i,j).join(",");k="";if(o=a(j,m,"text-properties")){p=""+d(o,z);n=o.getAttributeNS(m,"text-underline-style");"solid"===n&&(p+="text-decoration: underline;");if(n=o.getAttributeNS(m,"font-name"))(n=u[n])&&(p+="font-family: "+n+";");k+=p}if(o=a(j,m,"paragraph-properties")){p=o;
+o=""+d(p,w);p=p.getElementsByTagNameNS(m,"background-image");if(0c)break;e=e.nextSibling}a.insertBefore(b,e)}}}function c(a){this.OdfContainer=a}function b(a,b,c){var d=this;this.size=0;this.type=null;this.name=a;this.container=b;this.onchange=this.onreadystatechange=this.document=this.mimetype=this.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){if(null!==c){var b=h[a];this.mimetype=b;c.loadAsDataURL(a,b,function(a,b){d.url=b;if(d.onchange)d.onchange(d);if(d.onstatereadychange)d.onstatereadychange(d)})}};
+this.abort=function(){}}function a(){this.length=0;this.item=function(){}}var d=new odf.StyleInfo,l=new odf.Style2CSS,e="urn:oasis:names:tc:opendocument:xmlns:office:1.0",f="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "),m=new core.Base64,g=new odf.FontLoader,h={};c.prototype=new function(){};c.prototype.constructor=c;c.namespaceURI=e;c.localName="document";b.prototype.load=function(){};b.prototype.getUrl=function(){return this.data?"data:;base64,"+m.toBase64(this.data):
+null};odf.OdfContainer=function p(d,f){function m(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,1===b.nodeType?m(b):7===b.nodeType&&a.removeChild(b),b=c}function n(a){var b=s.rootElement.ownerDocument,c;if(a){m(a.documentElement);try{c=b.importNode(a.documentElement,!0)}catch(d){}}return c}function A(a){s.state=a;if(s.onchange)s.onchange(s);if(s.onstatereadychange)s.onstatereadychange(s)}function B(a,b){var c="",d;for(d in b)b.hasOwnProperty(d)&&(c+=" xmlns:"+d+'="'+b[d]+'"');return''}function D(){var a=l.namespaces,b=new xmldom.LSSerializer,c=B("document-meta",a);b.filter=new k(s.rootElement);c+=b.writeToString(s.rootElement.meta,a);return c+""}function x(){var a=l.namespaces,b=new xmldom.LSSerializer,c=B("document-settings",a);b.filter=new k(s.rootElement);c+=b.writeToString(s.rootElement.settings,a);return c+""}function u(){var a=l.namespaces,b=new xmldom.LSSerializer,c=B("document-styles",a);
+b.filter=new k(s.rootElement,s.rootElement.masterStyles);c+=b.writeToString(s.rootElement.fontFaceDecls,a);c+=b.writeToString(s.rootElement.styles,a);c+=b.writeToString(s.rootElement.automaticStyles,a);c+=b.writeToString(s.rootElement.masterStyles,a);return c+""}function J(){var a=l.namespaces,b=new xmldom.LSSerializer,c=B("document-content",a);b.filter=new k(s.rootElement,s.rootElement.body);c+=b.writeToString(s.rootElement.automaticStyles,a);c+=b.writeToString(s.rootElement.body,
+a);return c+""}function r(a,b){var c;c=runtime.byteArrayFromString(x(),"utf8");t.save("settings.xml",c,!0,new Date);c=runtime.byteArrayFromString(D(),"utf8");t.save("meta.xml",c,!0,new Date);c=runtime.byteArrayFromString(u(),"utf8");t.save("styles.xml",c,!0,new Date);c=runtime.byteArrayFromString(J(),"utf8");t.save("content.xml",c,!0,new Date);t.writeAs(a,function(a){b(a)})}var s=this,t=null;this.onstatereadychange=f;this.parts=this.rootElement=this.state=this.onchange=null;
+this.getPart=function(a){return new b(a,s,t)};this.saveAs=r;this.save=function(a){r(d,a)};this.state=p.LOADING;var q=document.createElementNS(c.namespaceURI,c.localName),F,O=new c;for(F in O)O.hasOwnProperty(F)&&(q[F]=O[F]);this.rootElement=q;this.parts=new a(this);t=new core.Zip(d,function(a,b){t=b;a?runtime.loadXML(d,function(b,c){if(b)a&&(t.error=a+"\n"+b,A(p.INVALID));else{var d=n(c);!d||"document"!==d.localName||d.namespaceURI!==e?A(p.INVALID):(s.rootElement=d,d.fontFaceDecls=j(d,e,"font-face-decls"),
+d.styles=j(d,e,"styles"),d.automaticStyles=j(d,e,"automatic-styles"),d.masterStyles=j(d,e,"master-styles"),d.body=j(d,e,"body"),d.meta=j(d,e,"meta"),A(p.DONE))}}):t.loadAsDOM("styles.xml",function(a,b){var c=n(b),d=s.rootElement;!c||"document-styles"!==c.localName||c.namespaceURI!==e?A(p.INVALID):(d.fontFaceDecls=j(c,e,"font-face-decls"),i(d,d.fontFaceDecls),d.styles=j(c,e,"styles"),i(d,d.styles),d.automaticStyles=j(c,e,"automatic-styles"),i(d,d.automaticStyles),d.masterStyles=j(c,e,"master-styles"),
+i(d,d.masterStyles),g.loadFonts(d.fontFaceDecls,t,null));s.state!==p.INVALID&&t.loadAsDOM("content.xml",function(a,b){var c=n(b),d,f,g;if(!c||c.localName!=="document-content"||c.namespaceURI!==e)A(p.INVALID);else{d=s.rootElement;f=j(c,e,"font-face-decls");if(d.fontFaceDecls&&f)for(g=f.firstChild;g;){d.fontFaceDecls.appendChild(g);g=f.firstChild}else if(f){d.fontFaceDecls=f;i(d,f)}f=j(c,e,"automatic-styles");if(d.automaticStyles&&f)for(g=f.firstChild;g;){d.automaticStyles.appendChild(g);g=f.firstChild}else if(f){d.automaticStyles=
+f;i(d,f)}d.body=j(c,e,"body");i(d,d.body)}s.state!==p.INVALID&&t.loadAsDOM("meta.xml",function(a,c){var b=n(c),d;if(b&&!(b.localName!=="document-meta"||b.namespaceURI!==e)){d=s.rootElement;d.meta=j(b,e,"meta");i(d,d.meta)}s.state!==p.INVALID&&t.loadAsDOM("settings.xml",function(a,b){if(b){var c=n(b),d;if(c&&!(c.localName!=="document-settings"||c.namespaceURI!==e)){d=s.rootElement;d.settings=j(c,e,"settings");i(d,d.settings)}}t.loadAsDOM("META-INF/manifest.xml",function(a,c){if(c){var b=n(c),d;if(b&&
+!(b.localName!=="manifest"||b.namespaceURI!=="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0")){d=s.rootElement;d.manifest=b;for(b=d.manifest.firstChild;b;){b.nodeType===1&&(b.localName==="file-entry"&&b.namespaceURI==="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0")&&(h[b.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","full-path")]=b.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","media-type"));b=b.nextSibling}}}s.state!==p.INVALID&&A(p.DONE)})})})})})})};
+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 25
+odf.Formatting=function(){function j(j){function i(b,a){for(var c=b&&b.firstChild;c&&a;)c=c.nextSibling,a-=1;return c}var c=i(j.startContainer,j.startOffset);i(j.endContainer,j.endOffset);this.next=function(){return null===c?c:null}}var n=new odf.StyleInfo;this.setOdfContainer=function(){};this.isCompletelyBold=function(){return!1};this.getAlignment=function(j){this.getParagraphStyles(j)};this.getParagraphStyles=function(k){var i,c,b,a=[];for(i=0;i text|list-item > *:first-child:before {";if(y=x.getAttributeNS(h,"style-name"))x=t[y],L=x.firstChild,x=void 0,"list-level-style-number"===L.localName?(x=L.getAttributeNS(f,"num-format"),y=L.getAttributeNS(f,"num-suffix"),G="",G={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},I=void 0,I=L.getAttributeNS(f,"num-prefix")||"",I=G.hasOwnProperty(x)?I+(" counter(list, "+
+G[x]+")"):x?I+("'"+x+"';"):I+" ''",y&&(I+=" '"+y+"'"),x=G="content: "+I+";"):"list-level-style-image"===L.localName?x="content: none;":"list-level-style-bullet"===L.localName&&(x="content: '"+L.getAttributeNS(h,"bullet-char")+"';"),L=x;if(H){for(x=q[H];x;)H=x,x=q[H];r+="counter-increment:"+H+";";L?(L=L.replace("list",H),r+=L):r+="content:counter("+H+");"}else H="",L?(L=L.replace("list",v),r+=L):r+="content: counter("+v+");",r+="counter-increment:"+v+";",k.insertRule("text|list#"+v+" {counter-reset:"+
+v+"}",k.cssRules.length);r+="}";q[v]=H;r&&k.insertRule(r,k.cssRules.length)}e();if(w.hasOwnProperty("statereadychange")){k=w.statereadychange;for(L=0;L0?c.getRangeAt(0):null,e=d&&d.startContainer,f=d&&d.startOffset,g=d&&d.endContainer,i=d&&d.endOffset,j,k;b&&!((b.localName==="p"||b.localName==="h")&&b.namespaceURI===h);)b=b.parentNode;if(R&&b&&b.parentNode!==v){j=b.ownerDocument;k=j.documentElement.namespaceURI;if(v)v.parentNode&&u();else{v=j.createElementNS(k,"p");v.style.margin="0px";v.style.padding="0px";v.style.border="0px";v.setAttribute("contenteditable",
+true)}b.parentNode.replaceChild(v,b);v.appendChild(b);v.focus();if(d){c.removeAllRanges();d=b.ownerDocument.createRange();d.setStart(e,f);d.setEnd(g,i);c.addRange(d)}if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}}})};return odf.OdfCanvas}();
+// Input 27
+runtime.loadClass("odf.OdfCanvas");
+odf.CommandLineTools=function(){this.roundTrip=function(j,n,k){new odf.OdfContainer(j,function(i){if(i.state===odf.OdfContainer.INVALID)return k("Document "+j+" is invalid.");i.state===odf.OdfContainer.DONE?i.saveAs(n,function(c){k(c)}):k("Document was not completely loaded.")})};this.render=function(j,n,k){for(n=n.getElementsByTagName("body")[0];n.firstChild;)n.removeChild(n.firstChild);n=new odf.OdfCanvas(n);n.addListener("statereadychange",function(i){k(i)});n.load(j)}};
+// Input 28
+runtime.loadClass("xmldom.XPath");runtime.loadClass("odf.Style2CSS");
+gui.PresenterUI=function(){var j=new odf.Style2CSS,n=new xmldom.XPath,k=j.namespaceResolver;return function(i){var c=this;c.setInitialSlideMode=function(){c.startSlideMode("single")};c.keyDownHandler=function(b){if(!b.target.isContentEditable&&"input"!==b.target.nodeName)switch(b.keyCode){case 84:c.toggleToolbar();break;case 37:case 8:c.prevSlide();break;case 39:case 32:c.nextSlide();break;case 36:c.firstSlide();break;case 35:c.lastSlide()}};c.root=function(){return c.odf_canvas.odfContainer().rootElement};
+c.firstSlide=function(){c.slideChange(function(){return 0})};c.lastSlide=function(){c.slideChange(function(b,a){return a-1})};c.nextSlide=function(){c.slideChange(function(b,a){return b+1b?-1:b-1})};c.slideChange=function(b){var a=c.getPages(c.odf_canvas.odfContainer().rootElement),d=-1,i=0;a.forEach(function(a){a=a[1];a.hasAttribute("slide_current")&&(d=i,a.removeAttribute("slide_current"));i+=1});b=b(d,a.length);-1===b&&(b=d);
+a[b][1].setAttribute("slide_current","1");document.getElementById("pagelist").selectedIndex=b;"cont"===c.slide_mode&&window.scrollBy(0,a[b][1].getBoundingClientRect().top-30)};c.selectSlide=function(b){c.slideChange(function(a,c){return b>=c||0>b?-1:b})};c.scrollIntoContView=function(b){var a=c.getPages(c.odf_canvas.odfContainer().rootElement);0!==a.length&&window.scrollBy(0,a[b][1].getBoundingClientRect().top-30)};c.getPages=function(b){var b=b.getElementsByTagNameNS(k("draw"),"page"),a=[],c;for(c=
+0;cc}}var c=n.node().ownerDocument,b=new core.Cursor(j,c);this.movePointForward=function(a){k(a,n.stepForward)};this.movePointBackward=function(a){k(a,n.stepBackward)};this.moveLineForward=function(a){j.modify?j.modify(a?"extend":"move",
+"forward","line"):k(a,i)};this.moveLineBackward=function(a){j.modify?j.modify(a?"extend":"move","backward","line"):k(a,function(){})};return this};
+// Input 31
+runtime.loadClass("core.PointWalker");runtime.loadClass("core.Cursor");
+gui.XMLEdit=function(j,n){function k(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function i(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function c(){var a=j.ownerDocument.defaultView.getSelection();a&&(!(0>=a.rangeCount)&&g)&&(a=a.getRangeAt(0),g.setPoint(a.startContainer,a.startOffset))}function b(){var a=j.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();g&&g.node()&&(b=g.node(),c=b.ownerDocument.createRange(),
+c.setStart(b,g.position()),c.collapse(!0),a.addRange(c))}function a(b){for(var c=b.firstChild;c&&c!==b;)1===c.nodeType&&a(c),c=c.nextSibling||c.parentNode;var d,e,f,c=b.attributes;d="";for(f=c.length-1;0<=f;f-=1)e=c.item(f),d=d+" "+e.nodeName+'="'+e.nodeValue+'"';b.setAttribute("customns_name",b.nodeName);b.setAttribute("customns_atts",d);c=b.firstChild;for(e=/^\s*$/;c&&c!==b;)d=c,c=c.nextSibling||c.parentNode,3===d.nodeType&&e.test(d.nodeValue)&&d.parentNode.removeChild(d)}function d(a,b){for(var c=
+a.firstChild,e,f,g;c&&c!==a;){if(1===c.nodeType){d(c,b);e=c.attributes;for(g=e.length-1;0<=g;g-=1)f=e.item(g),"http://www.w3.org/2000/xmlns/"===f.namespaceURI&&!b[f.nodeValue]&&(b[f.nodeValue]=f.localName)}c=c.nextSibling||c.parentNode}}function l(){var a=j.ownerDocument.createElement("style"),b;b={};d(j,b);var c={},f,g,i=0;for(f in b)if(b.hasOwnProperty(f)&&f){g=b[f];if(!g||c.hasOwnProperty(g)||"xmlns"===g){do g="ns"+i,i+=1;while(c.hasOwnProperty(g));b[f]=g}c[g]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+
+e;a.appendChild(j.ownerDocument.createTextNode(b));n=n.parentNode.replaceChild(a,n)}var e,f,m,g=null;j.id||(j.id="xml"+String(Math.random()).substring(2));f="#"+j.id+" ";e=f+"*,"+f+":visited, "+f+":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"+f+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+
+f+":after {color: blue; content: '' attr(customns_name) '>';}\n"+f+"{overflow: auto;}\n";f=j;k(f,"click",function(a){j.ownerDocument.defaultView.getSelection().getRangeAt(0);i(a)});k(f,"keydown",function(a){var d=a.charCode||a.keyCode;if((g=null)&&d===39){c();g.stepForward();b()}else if(g&&d===37){c();g.stepBackward();b()}else if(d>=16&&d<=20||d>=33&&d<=40)return;i(a)});k(f,"keypress",function(){});k(f,"drop",i);k(f,"dragend",i);k(f,"beforepaste",i);k(f,"paste",i);this.updateCSS=l;this.setXML=function(b){b=
+b.documentElement||b;m=b=j.ownerDocument.importNode(b,true);for(a(b);j.lastChild;)j.removeChild(j.lastChild);j.appendChild(b);l();g=new core.PointWalker(b)};this.getXML=function(){return m}};
+// Input 32
+(function(){return"core/Async.js core/Base64.js core/ByteArray.js core/ByteArrayWriter.js core/Cursor.js core/JSLint.js core/PointWalker.js core/RawDeflate.js core/RawInflate.js core/UnitTester.js core/Zip.js gui/Caret.js gui/PresenterUI.js gui/SelectionMover.js gui/XMLEdit.js odf/CommandLineTools.js odf/FontLoader.js odf/Formatting.js odf/OdfCanvas.js odf/OdfContainer.js odf/Style2CSS.js odf/StyleInfo.js xmldom/LSSerializer.js xmldom/LSSerializerFilter.js xmldom/OperationalTransformDOM.js xmldom/OperationalTransformInterface.js xmldom/RelaxNG.js xmldom/RelaxNG2.js xmldom/RelaxNGParser.js xmldom/XPath.js".split(" ")})();
diff --git a/webodf/lib/core/JSLint.js b/webodf/lib/core/JSLint.js
index 7e45244c..f4eb5e3c 100644
--- a/webodf/lib/core/JSLint.js
+++ b/webodf/lib/core/JSLint.js
@@ -1,5 +1,5 @@
// jslint.js
-// 2012-07-13
+// 2012-08-23
// Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
@@ -143,10 +143,10 @@
// You can request a properties report, which produces a list of the program's
// properties in the form of a /*properties*/ declaration.
-// var myPropertyReport = properties_report(JSLINT.property);
+// var myPropertyReport = JSLINT.properties_report(JSLINT.property);
// You can obtain the parse tree that JSLint constructed while parsing. The
-// latest tree is kept in JSLINT.tree. A nice stringication can be produced
+// latest tree is kept in JSLINT.tree. A nice stringification can be produced
// with
// JSON.stringify(JSLINT.tree, [
@@ -299,14 +299,14 @@
unclosed_comment, unclosed_regexp, undef, undefined, unescaped_a,
unexpected_a, unexpected_char_a_b, unexpected_comment, unexpected_else,
unexpected_label_a, unexpected_property_a, unexpected_space_a_b,
- 'unicode-bidi', unnecessary_initialize, unnecessary_use, unparam,
- unreachable_a_b, unrecognized_style_attribute_a, unrecognized_tag_a, unsafe,
- unused, url, urls, use_array, use_braces, use_charAt, use_object, use_or,
- use_param, used_before_a, var, var_a_not, vars, 'vertical-align', video,
- visibility, was, weird_assignment, weird_condition, weird_new,
- weird_program, weird_relation, weird_ternary, white, 'white-space', width,
- windows, 'word-spacing', 'word-wrap', wrap, wrap_immediate, wrap_regexp,
- write_is_wrong, writeable, 'z-index'
+ unexpected_typeof_a, 'unicode-bidi', unnecessary_initialize,
+ unnecessary_use, unparam, unreachable_a_b, unrecognized_style_attribute_a,
+ unrecognized_tag_a, unsafe, unused, url, urls, use_array, use_braces,
+ use_charAt, use_object, use_or, use_param, used_before_a, var, var_a_not,
+ vars, 'vertical-align', video, visibility, was, weird_assignment,
+ weird_condition, weird_new, weird_program, weird_relation, weird_ternary,
+ white, 'white-space', width, windows, 'word-spacing', 'word-wrap', wrap,
+ wrap_immediate, wrap_regexp, write_is_wrong, writeable, 'z-index'
*/
// The global directive is used to declare global variables that can
@@ -511,7 +511,7 @@ var JSLINT = (function () {
expected_selector_a: "Expected a CSS selector, and instead saw {a}.",
expected_small_a: "Expected a small positive integer and instead saw '{a}'",
expected_space_a_b: "Expected exactly one space between '{a}' and '{b}'.",
- expected_string_a: "Expected a string and instead saw {a}.",
+ expected_string_a: "Expected a string and instead saw '{a}'.",
expected_style_attribute: "Excepted a style attribute, and instead saw '{a}'.",
expected_style_pattern: "Expected a style pattern, and instead saw '{a}'.",
expected_tagname_a: "Expected a tagName, and instead saw {a}.",
@@ -591,6 +591,8 @@ var JSLINT = (function () {
unexpected_label_a: "Unexpected label '{a}'.",
unexpected_property_a: "Unexpected /*property*/ '{a}'.",
unexpected_space_a_b: "Unexpected space between '{a}' and '{b}'.",
+ unexpected_typeof_a: "Unexpected 'typeof'. " +
+ "Use '===' to compare directly with {a}.",
unnecessary_initialize: "It is not necessary to initialize '{a}' " +
"to 'undefined'.",
unnecessary_use: "Unnecessary 'use strict'.",
@@ -2544,7 +2546,7 @@ klass: do {
x.thru = 1;
x.line = 0;
x.edge = 'edge';
- s.string = s;
+ x.string = s;
return postscript(x);
}
@@ -2589,13 +2591,26 @@ klass: do {
}
this.first = expression(150);
this.arity = 'prefix';
- if (this.id === '++' || this.id === '--') {
+ switch (this.id) {
+ case '++':
+ case '--':
if (!option.plusplus) {
warn('unexpected_a', this);
} else if ((!this.first.identifier || this.first.reserved) &&
this.first.id !== '.' && this.first.id !== '[') {
warn('bad_operand', this);
}
+ break;
+ case '+':
+ case '-':
+ switch (this.first.id) {
+ case '[':
+ case '{':
+ case '!':
+ warn('unexpected_a', this.first);
+ break;
+ }
+ break;
}
return this;
};
@@ -2693,7 +2708,10 @@ klass: do {
warn(message || bundle.weird_condition, node);
break;
case '(':
- if (node.first.id === '.' && numbery[node.first.second.string] === true) {
+ if (node.first.id === 'new' ||
+ (node.first.string === 'Boolean') ||
+ (node.first.id === '.' &&
+ numbery[node.first.second.string] === true)) {
warn(message || bundle.weird_condition, node);
}
break;
@@ -2738,6 +2756,15 @@ klass: do {
((left.id === '(string)' || left.id === '(number)') &&
(right.id === '(string)' || right.id === '(number)'))) {
warn('weird_relation', that);
+ } else if (left.id === 'typeof') {
+ if (right.id !== '(string)') {
+ warn("expected_string_a", right, right.id === '(number)'
+ ? right.number
+ : right.string);
+ } else if (right.string === 'undefined' ||
+ right.string === 'null') {
+ warn("unexpected_typeof_a", left, right.string);
+ }
}
that.first = left;
that.second = check_relation(right);
@@ -2904,7 +2931,7 @@ klass: do {
// If this is an expression statement, determine if it is acceptable.
// We do not like
-// new Blah();
+// new Blah;
// statments. If it is to be used at all, new should only be used to make
// objects, not side effects. The expression statements we do like do
// assignment or invocation or delete.
@@ -2917,7 +2944,7 @@ klass: do {
the_statement.id !== 'delete' &&
the_statement.id !== '++' &&
the_statement.id !== '--') {
- warn('assignment_function_expression', token);
+ warn('assignment_function_expression', the_statement);
}
semicolon();
}
@@ -3527,7 +3554,7 @@ klass: do {
});
infix('(', 160, function (left, that) {
- var p;
+ var e, p;
if (indent && indent.mode === 'expression') {
no_space(prev_token, token);
} else {
@@ -3564,7 +3591,11 @@ klass: do {
no_space();
for (;;) {
edge();
- p.push(expression(10));
+ e = expression(10);
+ if (left.string === 'Boolean' && (e.id === '!' || e.id === '~')) {
+ warn('weird_condition', e);
+ }
+ p.push(e);
if (next_token.id !== ',') {
break;
}
@@ -6250,6 +6281,9 @@ klass: do {
itself.error_report = function (data) {
var evidence, i, output = [], snippets, warning;
if (data.errors) {
+ if (data.json) {
+ output.push('JSON: bad.
');
+ }
for (i = 0; i < data.errors.length; i += 1) {
warning = data.errors[i];
if (warning) {
@@ -6295,20 +6329,17 @@ klass: do {
}
output.push('');
}
- if (data.json) {
- output.push('JSON: bad.
');
- }
return output.join('');
};
itself.report = function (data) {
- var dl, err, i, j, names, output = [], the_function;
+ var dl, i, j, names, output = [], the_function;
function detail(h, value) {
var comma_needed, singularity;
if (Array.isArray(value)) {
- output.push('' + h + '');
+ output.push("" + h + "");
value.sort().forEach(function (item) {
if (item !== singularity) {
singularity = item;
@@ -6316,54 +6347,58 @@ klass: do {
comma_needed = true;
}
});
- output.push('');
+ output.push("");
} else if (value) {
- output.push('' + h + '', value, '');
+ output.push("" + h + "", value, "");
}
}
output.push('');
if (data.urls) {
- detail("url", data.urls);
+ detail('url', data.urls);
dl = true;
}
if (data.globals) {
detail('global', data.globals);
dl = true;
} else if (xmode === 'style') {
- output.push('CSS.
');
- } else if (data.json && !err) {
- output.push('JSON: good.
');
+ output.push("- CSS.
");
+ } else if (data.json) {
+ if (!data.errors) {
+ output.push("- JSON: good.
");
+ }
} else {
- output.push('No new global variables introduced.
');
+ output.push("- No new global variables introduced.
");
}
if (dl) {
- output.push('
');
+ output.push("");
} else {
output[0] = '';
}
- for (i = 0; i < data.functions.length; i += 1) {
- the_function = data.functions[i];
- names = [];
- if (the_function.params) {
- for (j = 0; j < the_function.params.length; j += 1) {
- names[j] = the_function.params[j].string;
+ if (data.functions) {
+ for (i = 0; i < data.functions.length; i += 1) {
+ the_function = data.functions[i];
+ names = [];
+ if (the_function.params) {
+ for (j = 0; j < the_function.params.length; j += 1) {
+ names[j] = the_function.params[j].string;
+ }
}
+ output.push('line ' +
+ String(the_function.line) + '' +
+ the_function.name.entityify() +
+ '(' + names.join(', ') + ')');
+ detail('undefined', the_function['undefined']);
+ detail('unused', the_function.unused);
+ detail('closure', the_function.closure);
+ detail('variable', the_function['var']);
+ detail('exception', the_function.exception);
+ detail('outer', the_function.outer);
+ detail('global', the_function.global);
+ detail('label', the_function.label);
+ output.push('
');
}
- output.push('line ' +
- String(the_function.line) + '' +
- the_function.name.entityify() +
- '(' + names.join(', ') + ')');
- detail('undefined', the_function['undefined']);
- detail('unused', the_function.unused);
- detail('closure', the_function.closure);
- detail('variable', the_function['var']);
- detail('exception', the_function.exception);
- detail('outer', the_function.outer);
- detail('global', the_function.global);
- detail('label', the_function.label);
- output.push('
');
}
return output.join('');
};
@@ -6404,7 +6439,7 @@ klass: do {
itself.jslint = itself;
- itself.edition = '2012-07-13';
+ itself.edition = '2012-08-23';
return itself;
}());
diff --git a/webodf/lib/odf/OdfCanvas.js b/webodf/lib/odf/OdfCanvas.js
index 25f0f9ea..679c9122 100644
--- a/webodf/lib/odf/OdfCanvas.js
+++ b/webodf/lib/odf/OdfCanvas.js
@@ -103,6 +103,10 @@ odf.OdfCanvas = (function () {
sheet.insertRule("office|presentation draw|page:nth-child(" +
position + ") {display:block;}", 1);
}
+ this.showFirstPage = function() {
+ position = 1;
+ updateCSS();
+ };
/**
* @return {undefined}
*/
@@ -119,6 +123,14 @@ odf.OdfCanvas = (function () {
updateCSS();
}
};
+
+ this.showPage = function(n) {
+ if(n > 0) {
+ position = n;
+ updateCSS();
+ }
+ };
+
this.css = css;
}
/**
@@ -869,18 +881,32 @@ odf.OdfCanvas = (function () {
if (!odfdoc) {
return;
}
- element.style.zoom = zoomLevel;
- element.style.WebkitTransform = 'scale(' + zoomLevel + ')';
- element.style.WebkitTransformOrigin = 'left top';
- element.style.MozTransform = 'scale(' + zoomLevel + ')';
- element.style.MozTransformOrigin = 'left top';
- element.style.OTransform = 'scale(' + zoomLevel + ')';
- element.style.OTransformOrigin = 'left top';
- element.style.width = Math.round(zoomLevel * odfdoc.offsetWidth)
- + "px";
- element.style.height = Math.round(zoomLevel * odfdoc.offsetHeight)
- + "px";
+ /*
+ When zoom > 1,
+ - origin needs to be 'center top'
+ When zoom < 1
+ - origin needs to be 'left top'
+ */
+ if (zoomLevel > 1) {
+ sizer.style.MozTransformOrigin = 'center top';
+ sizer.style.WebkitTransformOrigin = 'center top';
+ sizer.style.OTransformOrigin = 'center top';
+ sizer.style.msTransformOrigin = 'center top';
+ } else {
+ sizer.style.MozTransformOrigin = 'left top';
+ sizer.style.WebkitTransformOrigin = 'left top';
+ sizer.style.OTransformOrigin = 'left top';
+ sizer.style.msTransformOrigin = 'left top';
+ }
+
+ sizer.style.WebkitTransform = 'scale(' + zoomLevel + ')';
+ sizer.style.MozTransform = 'scale(' + zoomLevel + ')';
+ sizer.style.OTransform = 'scale(' + zoomLevel + ')';
+ sizer.style.msTransform = 'scale(' + zoomLevel + ')';
+
+ element.style.width = Math.round(zoomLevel * sizer.offsetWidth) + "px";
+ element.style.height = Math.round(zoomLevel * sizer.offsetHeight) + "px";
}
/**
* A new content.xml has been loaded. Update the live document with it.
@@ -1117,6 +1143,28 @@ odf.OdfCanvas = (function () {
zoomLevel = width / realWidth;
fixContainerSize();
};
+ /**
+ * @param {!number} width
+ * @param {!number} height
+ * @return {undefined}
+ */
+ this.fitSmart = function (width, height) {
+ var realWidth, realHeight, newScale;
+
+ realWidth = element.offsetWidth / zoomLevel;
+ realHeight = element.offsetHeight / zoomLevel;
+
+ newScale = width / realWidth;
+ if(height !== undefined) {
+ if (height / realHeight < newScale) {
+ newScale = height / realHeight;
+ }
+ }
+
+ zoomLevel = Math.min(1.0, newScale);
+
+ fixContainerSize();
+ };
/**
* @param {!number} height
* @return {undefined}
@@ -1126,6 +1174,9 @@ odf.OdfCanvas = (function () {
zoomLevel = height / realHeight;
fixContainerSize();
};
+ this.showFirstPage = function() {
+ pageSwitcher.showFirstPage();
+ };
/**
* @return {undefined}
*/
@@ -1138,6 +1189,12 @@ odf.OdfCanvas = (function () {
this.showPreviousPage = function () {
pageSwitcher.showPreviousPage();
};
+ /**
+ * @return {undefined}
+ */
+ this.showPage = function (n) {
+ pageSwitcher.showPage(n);
+ };
/**
* @return {undefined}
*/