rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
i;if(typeof j.keyCode!=="undefined")e+=d+"keyCode="+j.keyCode;if(typeof j.charCode!=="undefined")e+=d+"charCode="+j.charCode;if(j.altKey)e+=d+"altKey=1";if(j.ctrlKey)e+=d+"ctrlKey=1";if(j.metaKey)e+=d+"metaKey=1";if(j.shiftKey)e+=d+"shiftKey=1";if(j.touches)e+=W(d+"touches",j.touches,m);if(j.targetTouches)e+=W(d+"ttouches",j.targetTouches,m);if(j.changedTouches)e+=W(d+"ctouches",j.changedTouches,m);if(j.scale)e+=d+"scale="+j.scale;if(j.rotation)e+=d+"rotation="+j.rotation;c.data=e;return c}function X(){for(var c=
i;if(typeof j.keyCode!=="undefined")e+=d+"keyCode="+j.keyCode;if(typeof j.charCode!=="undefined")e+=d+"charCode="+j.charCode;if(j.altKey)e+=d+"altKey=1";if(j.ctrlKey)e+=d+"ctrlKey=1";if(j.metaKey)e+=d+"metaKey=1";if(j.shiftKey)e+=d+"shiftKey=1";if(typeof j.touches!=="undefined")e+=W(d+"touches",j.touches,m);if(typeof j.targetTouches!=="undefined")e+=W(d+"ttouches",j.targetTouches,m);if(typeof j.changedTouches!=="undefined")e+=W(d+"ctouches",j.changedTouches,m);if(j.scale)e+=d+"scale="+j.scale;if(j.rotation)e+= d+"rotation="+j.rotation;c.data=e;return c}function X(){for(var c="",d=false,e=0;e<y.length;++e){d=d||y[e].feedback;c+=y[e].data}ga=y;y=[];return{feedback:d,result:c}}function N(){R=true;if(aa){clearTimeout(aa);aa=null}var c=$("#Wt-timers");c.size()>0&&h.setHtml(c.get(0),"",false)}function z(){h.history._initTimeout();ba==0&&u(null,"none",null,false);aa=setTimeout(z,_$_KEEP_ALIVE_$_000)}function da(c){if(!h.isIEMobile)document.title=c}function a(){if(!document.activeElement){function c(e){if(e&&e.target)document.activeElement=
d,e){var j,m;m=c+"=";c=0;for(j=d.length;c<j;++c){var i=d[c];m+=[i.identifier,i.clientX,i.clientY,i.pageX,i.pageY,i.screenX,i.screenY,i.pageX-e.x,i.pageY-e.y].join(";")}return m}function g(c,d){var e,j;j=c.event;d=d>0?"&e"+d:"&";e=d+"signal="+c.signal;if(c.id){e+=d+"id="+c.id+d+"name="+encodeURIComponent(c.name)+d+"an="+c.args.length;for(var m=0;m<c.args.length;++m)e+=d+"a"+m+"="+encodeURIComponent(c.args[m])}for(var i=0;i<Z.length;++i){var p=h.getElement(Z[i]),t=null,ia;if(p!=null){if(p.type=="select-multiple"){m=0;for(ia=p.options.length;m<ia;m++)if(p.options[m].selected)e+=d+Z[i]+"="+encodeURIComponent(p.options[m].value)}else if(p.type=="checkbox"||p.type=="radio")if(p.indeterminate||p.style.opacity=="0.5")t="i";else{if(p.checked)t=p.value}else if(h.hasTag(p,"VIDEO")||h.hasTag(p,"AUDIO"))t=""+p.volume+";"+p.currentTime+";"+p.duration+";"+(p.paused?"1":"0")+";"+(p.ended?"1":"0");else if(p.type!="file"){t=$(p).hasClass("Wt-edit-emptyText")?"":""+p.value;if(h.hasFocus(p)){m=h.getSelectionRange(p);e+=d+"selstart="+m.start+d+"selend="+m.end}}if(t!=null)e+=d+Z[i]+"="+encodeURIComponent(t)}}try{if(document.activeElement)e+=d+"focus="+document.activeElement.id}catch(oa){}if(H!=null)e+=d+"_="+encodeURIComponent(unescape(H));if(!j){c.data=e;return c}for(i=h.target(j);!i.id&&i.parentNode;)i=i.parentNode;if(i.id)e+=d+"tid="+i.id;try{e+=d+"type="+j.type}catch(pa){}if(j.clientX||j.clientY)e+=d+"clientX="+j.clientX+d+"clientY="+j.clientY;t=h.pageCoordinates(j);i=t.x;t=t.y;if(i||t){e+=d+"documentX="+i+d+"documentY="+t;e+=d+"dragdX="+(i-s)+d+"dragdY="+(t-A);m=h.wheelDelta(j);e+=d+"wheel="+m}if(j.screenX||j.screenY)e+=d+"screenX="+j.screenX+d+"screenY="+j.screenY;m={x:0,y:0};if(c.object&&c.object.nodeType!=9){m=h.widgetPageCoordinates(c.object);e+=d+"scrollX="+c.object.scrollLeft+d+"scrollY="+c.object.scrollTop+d+"width="+c.object.clientWidth+d+"height="+c.object.clientHeight+d+"widgetX="+(i-m.x)+d+"widgetY="+(t-m.y)}i=h.button(j);if(!i)if(h.buttons&1)i=1;else if(h.buttons&2)i=2;else if(h.buttons&4)i=4;e+=d+"button="+i;if(typeof j.keyCode!=="undefined")e+=d+"keyCode="+j.keyCode;if(typeof j.charCode!=="undefined")e+=d+"charCode="+j.charCode;if(j.altKey)e+=d+"altKey=1";if(j.ctrlKey)e+=d+"ctrlKey=1";if(j.metaKey)e+=d+"metaKey=1";if(j.shiftKey)e+=d+"shiftKey=1";if(j.touches)e+=W(d+"touches",j.touches,m);if(j.targetTouches)e+=W(d+"ttouches",j.targetTouches,m);if(j.changedTouches)e+=W(d+"ctouches",j.changedTouches,m);if(j.scale)e+=d+"scale="+j.scale;if(j.rotation)e+=d+"rotation="+j.rotation;c.data=e;return c}function X(){for(var c=
O=f?setTimeout(x,_$_SERVER_PUSH_TIMEOUT_$_):null}}function M(d,c){var f={},j=z.length;f.signal="user";f.id=typeof d==="string"?d:d==_$_APP_CLASS_$_?"app":d.id;if(typeof c==="object"){f.name=c.name;f.object=c.eventObject;f.event=c.event}else{f.name=c;f.object=f.event=null}f.args=[];for(var m=2;m<arguments.length;++m){var h=arguments[m];h=h===false?0:h===true?1:h.toDateString?h.toDateString():h;f.args[m-2]=h}f.feedback=true;z[j]=T(f,j);F()}function L(d,c,f){var j=function(){var h=o.getElement(d);if(h){if(f)h.timer=
O=f?setTimeout(x,_$_SERVER_PUSH_TIMEOUT_$_):null}}function M(d,c){var f={},j=z.length;f.signal="user";f.id=typeof d==="string"?d:d==_$_APP_CLASS_$_?"app":d.id;if(typeof c==="object"){f.name=c.name;f.object=c.eventObject;f.event=c.event}else{f.name=c;f.object=f.event=null}f.args=[];for(var m=2;m<arguments.length;++m){var g=arguments[m];g=g===false?0:g===true?1:g.toDateString?g.toDateString():g;f.args[m-2]=g}f.feedback=true;z[j]=T(f,j);F()}function L(d,c,f){var j=function(){var g=o.getElement(d);if(g){if(f)g.timer=
ha>o.updateDelay){clearTimeout(R);G()}}function I(d){da=d;y._p_.comm.responseReceived(d)}function G(){R=null;if(Q){if(!ia){if(confirm("The application was quited, do you want to restart?"))document.location=document.location;ia=true}}else{var d,c,f,j="&rand="+Math.round(Math.random(ja)*1E5);if(z.length>0){d=a();c=d.feedback?setTimeout(K,_$_INDICATOR_TIMEOUT_$_):null;f=false}else{d={result:"signal=poll"};c=null;f=true}J=y._p_.comm.sendUpdate(ka+j,"request=jsupdate&"+d.result+"&ackId="+da,c,da,-1);O=f?setTimeout(x,_$_SERVER_PUSH_TIMEOUT_$_):null}}function M(d,c){var f={},j=z.length;f.signal="user";f.id=typeof d==="string"?d:d==_$_APP_CLASS_$_?"app":d.id;if(typeof c==="object"){f.name=c.name;f.object=c.eventObject;f.event=c.event}else{f.name=c;f.object=f.event=null}f.args=[];for(var m=2;m<arguments.length;++m){var h=arguments[m];h=h===false?0:h===true?1:h.toDateString?h.toDateString():h;f.args[m-2]=h}f.feedback=true;z[j]=T(f,j);F()}function L(d,c,f){var j=function(){var h=o.getElement(d);if(h){if(f)h.timer=
className:e.object.className};e.object.parentNode.removeChild(e.object);e.object.style.position="absolute";e.object.className="";document.body.appendChild(e.object);n.capture(null);n.capture(e.object);e.object.onmousemove=g;e.object.onmouseup=Z;e.offsetX=-4;e.offsetY=-4;e.dropTarget=null;e.mimeType=d.getAttribute("dmt");e.xy=n.pageCoordinates(c);n.cancelEvent(c);return false}function g(d){if(aa.object!=null){var c=aa,e=n.pageCoordinates(d);if(c.object.style.display!=""&&c.xy.x!=e.x&&c.xy.y!=e.y)c.object.style.display= "";c.object.style.left=e.x-c.offsetX+"px";c.object.style.top=e.y-c.offsetY+"px";e=c.dropTarget;var j=d.target||d.srcElement,m="{"+c.mimeType+":",i=null;for(c.dropTarget=null;j;){i=j.getAttribute("amts");if(i!=null&&i.indexOf(m)!=-1){c.dropTarget=j;break}j=j.parentNode;if(!j.tagName||n.hasTag(j,"HTML"))break}if(c.dropTarget!=e){if(c.dropTarget){j=i.indexOf(m)+m.length;var s=i.indexOf("}",j);i=i.substring(j,s);if(i.length!=0){c.dropTarget.setAttribute("dos",c.dropTarget.className);c.dropTarget.className= c.dropTarget.className+" "+i}}else c.object.styleClass="";if(e!=null){e.handleDragDrop&&e.handleDragDrop("end",c.object,d,"",m);i=e.getAttribute("dos");if(i!=null)e.className=i}}if(c.dropTarget)if(c.dropTarget.handleDragDrop)c.dropTarget.handleDragDrop("drag",c.object,d,"",m);else c.object.className="Wt-valid-drop";n.cancelEvent(d);return false}return true}function Z(d){n.capture(null);var c=aa;if(c.object){if(c.dropTarget){var e=c.dropTarget.getAttribute("dos");if(e!=null)c.dropTarget.className=
e.xy=n.pageCoordinates(c);n.cancelEvent(c);return false}function g(d){if(aa.object!=null){var c=aa,e=n.pageCoordinates(d);if(c.object.style.display!=""&&c.xy.x!=e.x&&c.xy.y!=e.y)c.object.style.display="";c.object.style.left=e.x-c.offsetX+"px";c.object.style.top=e.y-c.offsetY+"px";e=c.dropTarget;var j=d.target||d.srcElement,m="{"+c.mimeType+":",i=null;for(c.dropTarget=null;j;){i=j.getAttribute("amts");if(i!=null&&i.indexOf(m)!=-1){c.dropTarget=j;break}j=j.parentNode;if(!j.tagName||n.hasTag(j,"HTML"))break}if(c.dropTarget!= e){if(c.dropTarget){j=i.indexOf(m)+m.length;var s=i.indexOf("}",j);i=i.substring(j,s);if(i.length!=0){c.dropTarget.setAttribute("dos",c.dropTarget.className);c.dropTarget.className=c.dropTarget.className+" "+i}}else c.object.styleClass="";if(e!=null){e.handleDragDrop&&e.handleDragDrop("end",c.object,d,"",m);i=e.getAttribute("dos");if(i!=null)e.className=i}}if(c.dropTarget)if(c.dropTarget.handleDragDrop)c.dropTarget.handleDragDrop("drag",c.object,d,"",m);else c.object.className="Wt-valid-drop";n.cancelEvent(d); return false}return true}function Z(d){n.capture(null);var c=aa;if(c.object){if(c.dropTarget){var e=c.dropTarget.getAttribute("dos");if(e!=null)c.dropTarget.className=e;c.dropTarget.handleDragDrop?c.dropTarget.handleDragDrop("drop",c.object,d,c.sourceId,c.mimeType):I(c.dropTarget,{name:"_drop",eventObject:c.dropTarget,event:d},c.sourceId,c.mimeType)}c.object.style.position=c.objectPrevStyle.position;c.object.style.display=c.objectPrevStyle.display;c.object.style.left=c.objectPrevStyle.left;c.object.style.top=
className:e.object.className};e.object.parentNode.removeChild(e.object);e.object.style.position="absolute";e.object.className="";document.body.appendChild(e.object);n.capture(null);n.capture(e.object);e.object.onmousemove=g;e.object.onmouseup=Z;e.offsetX=-4;e.offsetY=-4;e.dropTarget=null;e.mimeType=d.getAttribute("dmt");e.xy=n.pageCoordinates(c);n.cancelEvent(c);return false}function g(d){if(aa.object!=null){var c=aa,e=n.pageCoordinates(d);if(c.object.style.display!=""&&c.xy.x!=e.x&&c.xy.y!=e.y)c.object.style.display="";c.object.style.left=e.x-c.offsetX+"px";c.object.style.top=e.y-c.offsetY+"px";e=c.dropTarget;var j=d.target||d.srcElement,m="{"+c.mimeType+":",i=null;for(c.dropTarget=null;j;){i=j.getAttribute("amts");if(i!=null&&i.indexOf(m)!=-1){c.dropTarget=j;break}j=j.parentNode;if(!j.tagName||n.hasTag(j,"HTML"))break}if(c.dropTarget!=e){if(c.dropTarget){j=i.indexOf(m)+m.length;var s=i.indexOf("}",j);i=i.substring(j,s);if(i.length!=0){c.dropTarget.setAttribute("dos",c.dropTarget.className);c.dropTarget.className=c.dropTarget.className+" "+i}}else c.object.styleClass="";if(e!=null){e.handleDragDrop&&e.handleDragDrop("end",c.object,d,"",m);i=e.getAttribute("dos");if(i!=null)e.className=i}}if(c.dropTarget)if(c.dropTarget.handleDragDrop)c.dropTarget.handleDragDrop("drag",c.object,d,"",m);else c.object.className="Wt-valid-drop";n.cancelEvent(d);return false}return true}function Z(d){n.capture(null);var c=aa;if(c.object){if(c.dropTarget){var e=c.dropTarget.getAttribute("dos");if(e!=null)c.dropTarget.className=
c.event}else{e.name=c;e.object=e.event=null}e.args=[];for(var m=2;m<arguments.length;++m){var i=arguments[m];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[m-2]=i}e.feedback=true;A[j]=B(e,j);x()}function U(d,c,e){var j=function(){var i=n.getElement(d);if(i){if(e)i.timer=setTimeout(i.tm,c);else{i.timer=null;i.tm=null}i.onclick&&i.onclick()}},m=n.getElement(d);m.timer=setTimeout(j,c);m.tm=j}function M(d,c){setTimeout(function(){if(R[d]===true)c();else R[d]=c},20)}function G(d){if(R[d]!== true){typeof R[d]!=="undefined"&&R[d]();R[d]=true}}function C(d,c){var e=false;if(c!="")try{e=!eval("typeof "+c+" === 'undefined'")}catch(j){e=false}if(e)G(d);else{var m=document.createElement("script");m.setAttribute("src",d);m.onload=function(){G(d)};m.onreadystatechange=function(){if(m.readyState=="complete"||m.readyState=="loaded")G(d)};document.getElementsByTagName("head")[0].appendChild(m)}}function H(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=
null}i.onclick&&i.onclick()}},m=n.getElement(d);m.timer=setTimeout(j,c);m.tm=j}function M(d,c){setTimeout(function(){if(R[d]===true)c();else R[d]=c},20)}function G(d){if(R[d]!==true){typeof R[d]!=="undefined"&&R[d]();R[d]=true}}function C(d,c){var e=false;if(c!="")try{e=!eval("typeof "+c+" === 'undefined'")}catch(j){e=false}if(e)G(d);else{var m=document.createElement("script");m.setAttribute("src",d);m.onload=function(){G(d)};m.onreadystatechange=function(){if(m.readyState=="complete"||m.readyState==
c.event}else{e.name=c;e.object=e.event=null}e.args=[];for(var m=2;m<arguments.length;++m){var i=arguments[m];i=i===false?0:i===true?1:i.toDateString?i.toDateString():i;e.args[m-2]=i}e.feedback=true;A[j]=B(e,j);x()}function U(d,c,e){var j=function(){var i=n.getElement(d);if(i){if(e)i.timer=setTimeout(i.tm,c);else{i.timer=null;i.tm=null}i.onclick&&i.onclick()}},m=n.getElement(d);m.timer=setTimeout(j,c);m.tm=j}function M(d,c){setTimeout(function(){if(R[d]===true)c();else R[d]=c},20)}function G(d){if(R[d]!==true){typeof R[d]!=="undefined"&&R[d]();R[d]=true}}function C(d,c){var e=false;if(c!="")try{e=!eval("typeof "+c+" === 'undefined'")}catch(j){e=false}if(e)G(d);else{var m=document.createElement("script");m.setAttribute("src",d);m.onload=function(){G(d)};m.onreadystatechange=function(){if(m.readyState=="complete"||m.readyState=="loaded")G(d)};document.getElementsByTagName("head")[0].appendChild(m)}}function H(d,c){this.callback=c;this.work=d.length;this.images=[];if(d.length==0)c(this.images);else for(c=
}
};
function GaSentinelMarker_getMarkerClickedFn() { var gaSentinel = this; return function() { gaSentinel.markerClicked(); }}
panel.gavExtras = data[6];
panel.extraData = data[6];
var gavPopulator = function(panel, data) { // groupId if (data.length > 1) { panel.getTopToolbar().items.itemAt(2).setRawValue(data[1]); } // artifactId if (data.length > 2) { panel.getTopToolbar().items.itemAt(5).setRawValue(data[2]); } // version if (data.length > 3) { panel.getTopToolbar().items.itemAt(8).setRawValue(data[3]); } // packaging if (data.length > 4) { panel.getTopToolbar().items.itemAt(11).setRawValue(data[4]); } // classifier if (data.length > 5) { panel.getTopToolbar().items.itemAt(14).setRawValue(data[5]); } // extra params, comma seperated list of params if ( data.length > 6) { panel.gavExtras = data[6]; } }
RSA.log( "RSAEngine:2.3.3:subparam.result="+result );
RSA.log( "RSAEngine:2.3.3:result="+result );
RSA.prototype.generateAsync = function(keylen,exp,result) { var self=this; var generator = new NS( stepping_generate,true); var _result = function(keyPair) { $extend(self,keyPair); result( self ); }; generator.EXEC([keylen,exp],_result); /////////////////////////////////////////// // implementation /////////////////////////////////////////// // Generate a new random private key B bits long, using public expt E function stepping_generate (myArgs) { var B,E; B = myArgs[0]; E = myArgs[1]; //var rng = new SecureRandom(); // MODIFIED 2008/12/07 var rng; // var qs = B>>1; var qs = self.splitBitLength( B ); self._e(E); var ee = new BigInteger(self.e); var p1; var q1; var phi; return DO([ // Step1.ver2 function () { RSA.log("RSAEngine:1.1"); self.p = new BigInteger(); rng = new SecureRandom(); }, function () { RSA.log("RSAEngine:1.2"); // return self.p.stepping_fromNumber1( B-qs, 1, rng ).BREAK(); return self.p.stepping_fromNumber1( qs[0], 1, rng ); }, [ // Step1.3 ver3 function () { RSA.log("RSAEngine:1.3.1"); if ( self.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) != 0 ) return AGAIN(); }, function () { RSA.log("RSAEngine:1.3.2 : calling stepping_isProbablePrime"); return self.p.stepping_isProbablePrime(10); }, function (result) { RSA.log("RSAEngine:1.3.3 : returned stepping_isProbablePrime" + result ); if ( result ) { RSA.log("RSAEngine:1.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:1.3.3=>AGAIN"); return AGAIN(); } }, EXIT ], function() { RSA.log("RSAEngine:2.0"); }, // Step2.ver2 [ function() { RSA.log("RSAEngine:2.1"); self.q = new BigInteger(); }, function () { RSA.log("RSAEngine:2.2"); // return self.q.stepping_fromNumber1( qs, 1, rng ).BREAK(); return self.q.stepping_fromNumber1( qs[1], 1, rng ); }, // Step2.3 ver2>>> function () { RSA.log("RSAEngine:2.3.1"); if ( self.q.subtract( BigInteger.ONE ).gcd( ee ).compareTo( BigInteger.ONE ) != 0 ) return AGAIN(); }, function() { RSA.log("RSAEngine:2.3.2"); return self.q.stepping_isProbablePrime(10); }, function(result) { RSA.log( "RSAEngine:2.3.3:subparam.result="+result ); if ( result ) { RSA.log("RSAEngine:2.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:2.3.3=>AGAIN"); return AGAIN(); } }, // <<< EXIT ], function() { RSA.log("RSAEngine:2.3"); if ( self.p.compareTo(self.q) <= 0 ) { var t = self.p; self.p = self.q; self.q = t; } RSA.log("RSAEngine:3.1"); RSA.log( "p=" + self.p.toString(16) ); RSA.log( "q=" + self.q.toString(16) ); }, // // Step3.2 ver2 >>> function() { RSA.log("RSAEngine:3.2"); /* var */ p1 = self.p.subtract( BigInteger.ONE ); /* var */ q1 = self.q.subtract( BigInteger.ONE ); /* var */ phi = p1.multiply( q1 ); if ( phi.gcd(ee).compareTo( BigInteger.ONE ) == 0 ) { RSA.log("RSAEngine:3.2=>BREAK"); return ; } else { RSA.log("RSAEngine:3.2=>AGAIN"); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.2.sub"); // ADDED 11Dec,2008 Ats >>> // When p and q in a RSA key have the same value, the RSA // key cannot encrypt/decrypt messages correctly. // Check if they have the same value and if so regenerate these value again. // Though rarely do p and q conflict when key length is large enough. // <<< if ( self.p.compareTo( self.q ) ==0 ) { RSA.log("RSAEngine:3.2.sub +++ P & Q ARE EQUAL !!!"); return AGAIN(); } self.n = self.p.multiply( self.q ); // ADDED 2008/12/1 >>> // if ( self.n.bitLength() != B ) { // if ( self.n.bitLength() < B ) { // modified 2009/1/13 if ( ! self.isProperBitLength( self.n, B ) ) { // modified 2009/1/15 RSA.log("RSAEngine:3.3.2.1:AGAIN bitLength="+self.n.bitLength() + " B=" + B ); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.3.1"); RSA.log("RSAEngine:3.3.1(1)"); self.d = ee.modInverse( phi ); RSA.log("RSAEngine:3.3.2(2)"); self._ksize(B); // added Jan15,2009 }, function() { RSA.log("RSAEngine:3.3.2"); self.dmp1 = self.d.mod(p1); self.dmq1 = self.d.mod(q1); }, function() { RSA.log("RSAEngine:3.3.3"); self.coeff = self.q.modInverse(self.p); }, // <<< EXIT ]); } }
if ( result.prime ) {
if ( result ) {
RSA.prototype.generateAsync = function(keylen,exp,result) { var self=this; var generator = new NS( stepping_generate,true); var _result = function(keyPair) { result( self ); }; generator.EXEC([keylen,exp],_result); /////////////////////////////////////////// // implementation /////////////////////////////////////////// // Generate a new random private key B bits long, using public expt E function stepping_generate (myArgs) { var B,E; B = myArgs[0]; E = myArgs[1]; //var rng = new SecureRandom(); // MODIFIED 2008/12/07 var rng; // var qs = B>>1; var qs = self.splitBitLength( B ); self._e(E); var ee = new BigInteger(self.e); var p1; var q1; var phi; return DO([ // Step1.ver2 function () { RSA.log("RSAEngine:1.1"); self.p = new BigInteger(); rng = new SecureRandom(); }, function () { RSA.log("RSAEngine:1.2"); // return self.p.stepping_fromNumber1( B-qs, 1, rng ).BREAK(); return self.p.stepping_fromNumber1( qs[0], 1, rng ); }, [ // Step1.3 ver3 function () { RSA.log("RSAEngine:1.3.1"); if ( self.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) != 0 ) return AGAIN(); }, function () { RSA.log("RSAEngine:1.3.2 : calling stepping_isProbablePrime"); return self.p.stepping_isProbablePrime(10); }, function (result) { RSA.log("RSAEngine:1.3.3 : returned stepping_isProbablePrime" + result ); if ( result.prime ) { RSA.log("RSAEngine:1.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:1.3.3=>AGAIN"); return AGAIN(); } }, EXIT ], function() { RSA.log("RSAEngine:2.0"); }, // Step2.ver2 [ function() { RSA.log("RSAEngine:2.1"); self.q = new BigInteger(); }, function () { RSA.log("RSAEngine:2.2"); // return self.q.stepping_fromNumber1( qs, 1, rng ).BREAK(); return self.q.stepping_fromNumber1( qs[1], 1, rng ); }, // Step2.3 ver2>>> function () { var result = self.q.subtract( BigInteger.ONE ).gcd( ee ).compareTo( BigInteger.ONE ); RSA.log("RSAEngine:2.3.1 returned from q.stepping_from number with result "+result); if ( result != 0 ) return AGAIN(); }, function() { RSA.log("RSAEngine:2.3.2"); return self.q.stepping_isProbablePrime(10); }, function(result) { RSA.log( "RSAEngine:2.3.3:result="+result.prime ); if ( result.prime ) { RSA.log("RSAEngine:2.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:2.3.3=>AGAIN"); return AGAIN(); } }, // <<< EXIT ], function() { RSA.log("RSAEngine:2.3"); if ( self.p.compareTo(self.q) <= 0 ) { var t = self.p; self.p = self.q; self.q = t; } RSA.log("RSAEngine:3.1"); RSA.log( "p=" + self.p.toString(16) ); RSA.log( "q=" + self.q.toString(16) ); }, // // Step3.2 ver2 >>> function() { RSA.log("RSAEngine:3.2"); /* var */ p1 = self.p.subtract( BigInteger.ONE ); /* var */ q1 = self.q.subtract( BigInteger.ONE ); /* var */ phi = p1.multiply( q1 ); if ( phi.gcd(ee).compareTo( BigInteger.ONE ) == 0 ) { RSA.log("RSAEngine:3.2=>BREAK"); return ; } else { RSA.log("RSAEngine:3.2=>AGAIN"); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.2.sub"); // ADDED 11Dec,2008 Ats >>> // When p and q in a RSA key have the same value, the RSA // key cannot encrypt/decrypt messages correctly. // Check if they have the same value and if so regenerate these value again. // Though rarely do p and q conflict when key length is large enough. // <<< if ( self.p.compareTo( self.q ) ==0 ) { RSA.log("RSAEngine:3.2.sub +++ P & Q ARE EQUAL !!!"); return AGAIN(); } self.n = self.p.multiply( self.q ); // ADDED 2008/12/1 >>> // if ( self.n.bitLength() != B ) { // if ( self.n.bitLength() < B ) { // modified 2009/1/13 if ( ! self.isProperBitLength( self.n, B ) ) { // modified 2009/1/15 RSA.log("RSAEngine:3.3.2.1:AGAIN bitLength="+self.n.bitLength() + " B=" + B ); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.3.1"); RSA.log("RSAEngine:3.3.1(1)"); self.d = ee.modInverse( phi ); RSA.log("RSAEngine:3.3.2(2)"); self._ksize(B); // added Jan15,2009 }, function() { RSA.log("RSAEngine:3.3.2"); self.dmp1 = self.d.mod(p1); self.dmq1 = self.d.mod(q1); }, function() { RSA.log("RSAEngine:3.3.3"); self.coeff = self.q.modInverse(self.p); }, // <<< EXIT ]); } }
RSA.log( "RSAEngine:2.3.3:result="+result.prime ); if ( result.prime ) {
RSA.log( "RSAEngine:2.3.3:result="+result ); if ( result ) {
RSA.prototype.generateAsync = function(keylen,exp,result) { var self=this; var generator = new NS( stepping_generate,true); var _result = function(keyPair) { result( self ); }; generator.EXEC([keylen,exp],_result); /////////////////////////////////////////// // implementation /////////////////////////////////////////// // Generate a new random private key B bits long, using public expt E function stepping_generate (myArgs) { var B,E; B = myArgs[0]; E = myArgs[1]; //var rng = new SecureRandom(); // MODIFIED 2008/12/07 var rng; // var qs = B>>1; var qs = self.splitBitLength( B ); self._e(E); var ee = new BigInteger(self.e); var p1; var q1; var phi; return DO([ // Step1.ver2 function () { RSA.log("RSAEngine:1.1"); self.p = new BigInteger(); rng = new SecureRandom(); }, function () { RSA.log("RSAEngine:1.2"); // return self.p.stepping_fromNumber1( B-qs, 1, rng ).BREAK(); return self.p.stepping_fromNumber1( qs[0], 1, rng ); }, [ // Step1.3 ver3 function () { RSA.log("RSAEngine:1.3.1"); if ( self.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) != 0 ) return AGAIN(); }, function () { RSA.log("RSAEngine:1.3.2 : calling stepping_isProbablePrime"); return self.p.stepping_isProbablePrime(10); }, function (result) { RSA.log("RSAEngine:1.3.3 : returned stepping_isProbablePrime" + result ); if ( result.prime ) { RSA.log("RSAEngine:1.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:1.3.3=>AGAIN"); return AGAIN(); } }, EXIT ], function() { RSA.log("RSAEngine:2.0"); }, // Step2.ver2 [ function() { RSA.log("RSAEngine:2.1"); self.q = new BigInteger(); }, function () { RSA.log("RSAEngine:2.2"); // return self.q.stepping_fromNumber1( qs, 1, rng ).BREAK(); return self.q.stepping_fromNumber1( qs[1], 1, rng ); }, // Step2.3 ver2>>> function () { var result = self.q.subtract( BigInteger.ONE ).gcd( ee ).compareTo( BigInteger.ONE ); RSA.log("RSAEngine:2.3.1 returned from q.stepping_from number with result "+result); if ( result != 0 ) return AGAIN(); }, function() { RSA.log("RSAEngine:2.3.2"); return self.q.stepping_isProbablePrime(10); }, function(result) { RSA.log( "RSAEngine:2.3.3:result="+result.prime ); if ( result.prime ) { RSA.log("RSAEngine:2.3.3=>EXIT"); return DONE(); } else { RSA.log("RSAEngine:2.3.3=>AGAIN"); return AGAIN(); } }, // <<< EXIT ], function() { RSA.log("RSAEngine:2.3"); if ( self.p.compareTo(self.q) <= 0 ) { var t = self.p; self.p = self.q; self.q = t; } RSA.log("RSAEngine:3.1"); RSA.log( "p=" + self.p.toString(16) ); RSA.log( "q=" + self.q.toString(16) ); }, // // Step3.2 ver2 >>> function() { RSA.log("RSAEngine:3.2"); /* var */ p1 = self.p.subtract( BigInteger.ONE ); /* var */ q1 = self.q.subtract( BigInteger.ONE ); /* var */ phi = p1.multiply( q1 ); if ( phi.gcd(ee).compareTo( BigInteger.ONE ) == 0 ) { RSA.log("RSAEngine:3.2=>BREAK"); return ; } else { RSA.log("RSAEngine:3.2=>AGAIN"); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.2.sub"); // ADDED 11Dec,2008 Ats >>> // When p and q in a RSA key have the same value, the RSA // key cannot encrypt/decrypt messages correctly. // Check if they have the same value and if so regenerate these value again. // Though rarely do p and q conflict when key length is large enough. // <<< if ( self.p.compareTo( self.q ) ==0 ) { RSA.log("RSAEngine:3.2.sub +++ P & Q ARE EQUAL !!!"); return AGAIN(); } self.n = self.p.multiply( self.q ); // ADDED 2008/12/1 >>> // if ( self.n.bitLength() != B ) { // if ( self.n.bitLength() < B ) { // modified 2009/1/13 if ( ! self.isProperBitLength( self.n, B ) ) { // modified 2009/1/15 RSA.log("RSAEngine:3.3.2.1:AGAIN bitLength="+self.n.bitLength() + " B=" + B ); return AGAIN(); } }, function() { RSA.log("RSAEngine:3.3.1"); RSA.log("RSAEngine:3.3.1(1)"); self.d = ee.modInverse( phi ); RSA.log("RSAEngine:3.3.2(2)"); self._ksize(B); // added Jan15,2009 }, function() { RSA.log("RSAEngine:3.3.2"); self.dmp1 = self.d.mod(p1); self.dmq1 = self.d.mod(q1); }, function() { RSA.log("RSAEngine:3.3.3"); self.coeff = self.q.modInverse(self.p); }, // <<< EXIT ]); } }
if (!component)
if (!component) {
var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; };
obj['dimensionBounds'] = {
obj.dimensionBounds = {
var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; };
obj['valueBounds'] = {
obj.valueBounds = {
var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; };
if (child)
if (child) {
var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; };
}
var generateConstraints = function(component) { if (!component) return null; if (component.initialConfig.variableType === 'axis') { var fromField = component.get(0); var toField = component.get(1); var obj = { type : component.initialConfig.variableType, name : component.initialConfig.name }; if (component.initialConfig.usingDimensionBounds) { obj['dimensionBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } else { obj['valueBounds'] = { from : parseFloat(fromField.value), to : parseFloat(toField.value) }; } return obj; } else if (component.initialConfig.variableType === 'grid') { var childAxes = []; for (var i = 0; i < frm.items.getCount(); i++) { var child = generateConstraints(component.items.get(i)); if (child) childAxes.push(child); } return { type : component.initialConfig.variableType, name : component.initialConfig.name, axes : childAxes }; } return null; };
deliverString = deliverString+hiddenInput.name.replace(/\$/g, "%24")+"="+encodeURIComponent(hiddenInput.value) + "&";
if (hiddenInput.name !== "__EVENTTARGET" && hiddenInput.name !== "") { deliverString = deliverString+hiddenInput.name.replace(/\$/g, "%24")+"="+encodeURIComponent(hiddenInput.value) + "&"; }
function generateDeliverString(nsResolver, doc){ var hiddenInputs = doc.evaluate('//input[@type="hidden" and not(contains(@name, "folderHas")) and not(@name ="ajax")]', doc, nsResolver, XPathResult.ANY_TYPE, null); var hiddenInput; var deliverString =""; while(hiddenInput = hiddenInputs.iterateNext()) { deliverString = deliverString+hiddenInput.name.replace(/\$/g, "%24")+"="+encodeURIComponent(hiddenInput.value) + "&"; } var otherHiddenInputs = doc.evaluate('//input[@type="hidden" and contains(@name, "folderHas")]', doc, nsResolver, XPathResult.ANY_TYPE, null); while(hiddenInput = otherHiddenInputs.iterateNext()) { deliverString = deliverString+hiddenInput.name.replace(/\$/g, "%24")+"="+escape(hiddenInput.value).replace(/\//g, "%2F").replace(/%20/g, "+") + "&"; } deliverString = deliverString +"&ctl00%24ctl00%24MainContentArea%24MainContentArea%24topDeliveryControl%24deliveryButtonControl%24lnkExportImage.x=5" +"&ctl00%24ctl00%24MainContentArea%24MainContentArea%24topDeliveryControl%24deliveryButtonControl%24lnkExportImage.y=14"; return deliverString;}
deliverString = deliverString +"&ctl00%24ctl00%24MainContentArea%24MainContentArea%24topDeliveryControl%24deliveryButtonControl%24lnkExportImage.x=5" +"&ctl00%24ctl00%24MainContentArea%24MainContentArea%24topDeliveryControl%24deliveryButtonControl%24lnkExportImage.y=14";
deliverString = "__EVENTTARGET=ctl00%24ctl00%24Column2%24Column2%24topDeliveryControl%24deliveryButtonControl%24lnkExport&" + deliverString;
function generateDeliverString(nsResolver, doc){ var hiddenInputs = doc.evaluate('//input[@type="hidden" and not(contains(@name, "folderHas")) and not(@name ="ajax")]', doc, nsResolver, XPathResult.ANY_TYPE, null); var hiddenInput; var deliverString =""; while(hiddenInput = hiddenInputs.iterateNext()) { deliverString = deliverString+hiddenInput.name.replace(/\$/g, "%24")+"="+encodeURIComponent(hiddenInput.value) + "&"; } var otherHiddenInputs = doc.evaluate('//input[@type="hidden" and contains(@name, "folderHas")]', doc, nsResolver, XPathResult.ANY_TYPE, null); while(hiddenInput = otherHiddenInputs.iterateNext()) { deliverString = deliverString+hiddenInput.name.replace(/\$/g, "%24")+"="+escape(hiddenInput.value).replace(/\//g, "%2F").replace(/%20/g, "+") + "&"; } deliverString = deliverString +"&ctl00%24ctl00%24MainContentArea%24MainContentArea%24topDeliveryControl%24deliveryButtonControl%24lnkExportImage.x=5" +"&ctl00%24ctl00%24MainContentArea%24MainContentArea%24topDeliveryControl%24deliveryButtonControl%24lnkExportImage.y=14"; return deliverString;}
if (!arr || arr.length == 0)
if (!arr || arr.length === 0) {
var generateRowFragmentFromArray = function (col1, arr, colCount, contentFunc) { if (!arr || arr.length == 0) return ''; if (!contentFunc) { contentFunc = function (item) { return item; } } if (!colCount) colCount = 1; var description = ''; for (var i = 0; i < arr.length; i++) { var item = arr[i]; if (i >= colCount && i % colCount == 0) description += '<br/>'; else if (description.length > 0) description += ' '; description += contentFunc(arr[i]); } return generateRowFragment(col1, description); };
if (!colCount)
if (!colCount) {
var generateRowFragmentFromArray = function (col1, arr, colCount, contentFunc) { if (!arr || arr.length == 0) return ''; if (!contentFunc) { contentFunc = function (item) { return item; } } if (!colCount) colCount = 1; var description = ''; for (var i = 0; i < arr.length; i++) { var item = arr[i]; if (i >= colCount && i % colCount == 0) description += '<br/>'; else if (description.length > 0) description += ' '; description += contentFunc(arr[i]); } return generateRowFragment(col1, description); };
if (i >= colCount && i % colCount == 0)
if (i >= colCount && i % colCount === 0) {
var generateRowFragmentFromArray = function (col1, arr, colCount, contentFunc) { if (!arr || arr.length == 0) return ''; if (!contentFunc) { contentFunc = function (item) { return item; } } if (!colCount) colCount = 1; var description = ''; for (var i = 0; i < arr.length; i++) { var item = arr[i]; if (i >= colCount && i % colCount == 0) description += '<br/>'; else if (description.length > 0) description += ' '; description += contentFunc(arr[i]); } return generateRowFragment(col1, description); };
else if (description.length > 0)
} else if (description.length > 0) {
var generateRowFragmentFromArray = function (col1, arr, colCount, contentFunc) { if (!arr || arr.length == 0) return ''; if (!contentFunc) { contentFunc = function (item) { return item; } } if (!colCount) colCount = 1; var description = ''; for (var i = 0; i < arr.length; i++) { var item = arr[i]; if (i >= colCount && i % colCount == 0) description += '<br/>'; else if (description.length > 0) description += ' '; description += contentFunc(arr[i]); } return generateRowFragment(col1, description); };
}
var generateRowFragmentFromArray = function (col1, arr, colCount, contentFunc) { if (!arr || arr.length == 0) return ''; if (!contentFunc) { contentFunc = function (item) { return item; } } if (!colCount) colCount = 1; var description = ''; for (var i = 0; i < arr.length; i++) { var item = arr[i]; if (i >= colCount && i % colCount == 0) description += '<br/>'; else if (description.length > 0) description += ' '; description += contentFunc(arr[i]); } return generateRowFragment(col1, description); };
if (overlay == null || !overlay.description) {
if (overlay === null || !overlay.description) {
var genericParserClickHandler = function (map, overlay, latlng, parentOnlineResource) { if (overlay == null || !overlay.description) { return false; } if (!parentOnlineResource) { return false; } //The generic parser stamps the description with a specific string followed by the gml:id of the node var genericParserString = 'GENERIC_PARSER:'; if (overlay.description.indexOf(genericParserString) == 0) { //Lets extract the ID and then lookup the parent record //Assumption - We are only interested in the first WFS record var gmlID = overlay.description.substring(genericParserString.length); var wfsUrl = parentOnlineResource.url; var wfsTypeName = parentOnlineResource.name; //Parse the parameters to our iframe popup and get that to request the raw gml var html = '<iframe src="genericparser.html'; html += '?serviceUrl=' + wfsUrl; html += '&typeName=' + wfsTypeName; html += '&featureId=' + gmlID; html += '" width="600" height="350"/>'; if (overlay instanceof GMarker) { overlay.openInfoWindowHtml(html); } else { map.openInfoWindowHtml(overlay.getBounds().getCenter(), html); } return true; } return false;};
if (overlay.description.indexOf(genericParserString) == 0) {
if (overlay.description.indexOf(genericParserString) === 0) {
var genericParserClickHandler = function (map, overlay, latlng, parentOnlineResource) { if (overlay == null || !overlay.description) { return false; } if (!parentOnlineResource) { return false; } //The generic parser stamps the description with a specific string followed by the gml:id of the node var genericParserString = 'GENERIC_PARSER:'; if (overlay.description.indexOf(genericParserString) == 0) { //Lets extract the ID and then lookup the parent record //Assumption - We are only interested in the first WFS record var gmlID = overlay.description.substring(genericParserString.length); var wfsUrl = parentOnlineResource.url; var wfsTypeName = parentOnlineResource.name; //Parse the parameters to our iframe popup and get that to request the raw gml var html = '<iframe src="genericparser.html'; html += '?serviceUrl=' + wfsUrl; html += '&typeName=' + wfsTypeName; html += '&featureId=' + gmlID; html += '" width="600" height="350"/>'; if (overlay instanceof GMarker) { overlay.openInfoWindowHtml(html); } else { map.openInfoWindowHtml(overlay.getBounds().getCenter(), html); } return true; } return false;};
var cswRecords = parentActiveLayerRecord.getCSWRecords();
var genericParserClickHandler = function (map, overlay, latlng, parentOnlineResource) { if (overlay == null || !overlay.description) return false; if (!parentOnlineResource) return false; //The generic parser stamps the description with a specific string followed by the gml:id of the node var genericParserString = 'GENERIC_PARSER:'; if (overlay.description.indexOf(genericParserString) == 0) { //Lets extract the ID and then lookup the parent record //Assumption - We are only interested in the first WFS record var gmlID = overlay.description.substring(genericParserString.length); var cswRecords = parentActiveLayerRecord.getCSWRecords(); var wfsUrl = parentOnlineResource.url; var wfsTypeName = parentOnlineResource.name; //Parse the parameters to our iframe popup and get that to request the raw gml var html = '<iframe src="genericparser.html'; html += '?serviceUrl=' + wfsUrl; html += '&typeName=' + wfsTypeName; html += '&featureId=' + gmlID; html += '" width="600" height="350"/>'; if (overlay instanceof GMarker) { overlay.openInfoWindowHtml(html); } else { map.openInfoWindowHtml(overlay.getBounds().getCenter(), html); } return true; } return false;};
if(reportTitleFilter != '' && /^\w+/.test(reportTitleFilter)) { var regexp = new RegExp(reportTitleFilter, "i");
if(reportTitleFilter !== '' && /^\w+/.test(reportTitleFilter)) { regexp = new RegExp(reportTitleFilter, "i");
var genericRecordHandler = function(activeLayerRecord) { //get our overlay manager (create if required) var overlayManager = activeLayerRecord.getOverlayManager(); if (!overlayManager) { overlayManager = new OverlayManager(map); activeLayerRecord.setOverlayManager(overlayManager); } overlayManager.clearOverlays(); var responseTooltip = new ResponseTooltip(); activeLayerRecord.setResponseToolTip(responseTooltip); var reportTitleFilter = ''; var keywordFilter = ''; var resourceProviderFilter = ''; var filterObj = filterPanel.getLayout().activeItem.getForm().getValues(); reportTitleFilter = filterObj.title; var regexp = /\*/; if(reportTitleFilter != '' && /^\w+/.test(reportTitleFilter)) { var regexp = new RegExp(reportTitleFilter, "i"); } if(filterObj.keyword != null) { keywordFilter = filterObj.keyword; } if(filterObj.resourceProvider != null) { resourceProviderFilter = filterObj.resourceProvider; } //Get the list of bounding box polygons var cswRecords = activeLayerRecord.getCSWRecords(); var knownLayer = activeLayerRecord.getParentKnownLayer(); var numRecords = 0; for (var i = 0; i < cswRecords.length; i++) { if ((reportTitleFilter === '' || regexp.test(cswRecords[i].getServiceName())) && (keywordFilter === '' || cswRecords[i].containsKeyword(keywordFilter)) && (resourceProviderFilter === '' || cswRecords[i].getResourceProvider() == resourceProviderFilter)) { numRecords++; var geoEls = cswRecords[i].getGeographicElements(); for (var j = 0; j < geoEls.length; j++) { var geoEl = geoEls[j]; if (geoEl instanceof BBox) { if(geoEl.eastBoundLongitude == geoEl.westBoundLongitude && geoEl.southBoundLatitude == geoEl.northBoundLatitude) { //We only have a point var point = new GLatLng(parseFloat(geoEl.southBoundLatitude), parseFloat(geoEl.eastBoundLongitude)); var icon = new GIcon(G_DEFAULT_ICON, activeLayerRecord.getIconUrl()); icon.shadow = null; var iconSize = knownLayer.getIconSize(); if (iconSize) { icon.iconSize = new GSize(iconSize.width, iconSize.height); } var iconAnchor = knownLayer.getIconAnchor(); if(iconAnchor) { icon.iconAnchor = new GPoint(iconAnchor.x, iconAnchor.y); } var marker = new GMarker(point, {icon: icon}); marker.activeLayerRecord = activeLayerRecord.internalRecord; marker.cswRecord = cswRecords[i].internalRecord; //marker.onlineResource = onlineResource; //Add our single point overlayManager.markerManager.addMarker(marker, 0); } else { //polygon var polygonList = geoEl.toGMapPolygon('#0003F9', 4, 0.75,'#0055FE', 0.4); for (var k = 0; k < polygonList.length; k++) { polygonList[k].cswRecord = cswRecords[i].internalRecord; polygonList[k].activeLayerRecord = activeLayerRecord.internalRecord; overlayManager.addOverlay(polygonList[k]); } } } } } } overlayManager.markerManager.refresh(); responseTooltip.addResponse("", numRecords + " records retrieved."); };
if(filterObj.keyword != null) {
if(filterObj.keyword !== null) {
var genericRecordHandler = function(activeLayerRecord) { //get our overlay manager (create if required) var overlayManager = activeLayerRecord.getOverlayManager(); if (!overlayManager) { overlayManager = new OverlayManager(map); activeLayerRecord.setOverlayManager(overlayManager); } overlayManager.clearOverlays(); var responseTooltip = new ResponseTooltip(); activeLayerRecord.setResponseToolTip(responseTooltip); var reportTitleFilter = ''; var keywordFilter = ''; var resourceProviderFilter = ''; var filterObj = filterPanel.getLayout().activeItem.getForm().getValues(); reportTitleFilter = filterObj.title; var regexp = /\*/; if(reportTitleFilter != '' && /^\w+/.test(reportTitleFilter)) { var regexp = new RegExp(reportTitleFilter, "i"); } if(filterObj.keyword != null) { keywordFilter = filterObj.keyword; } if(filterObj.resourceProvider != null) { resourceProviderFilter = filterObj.resourceProvider; } //Get the list of bounding box polygons var cswRecords = activeLayerRecord.getCSWRecords(); var knownLayer = activeLayerRecord.getParentKnownLayer(); var numRecords = 0; for (var i = 0; i < cswRecords.length; i++) { if ((reportTitleFilter === '' || regexp.test(cswRecords[i].getServiceName())) && (keywordFilter === '' || cswRecords[i].containsKeyword(keywordFilter)) && (resourceProviderFilter === '' || cswRecords[i].getResourceProvider() == resourceProviderFilter)) { numRecords++; var geoEls = cswRecords[i].getGeographicElements(); for (var j = 0; j < geoEls.length; j++) { var geoEl = geoEls[j]; if (geoEl instanceof BBox) { if(geoEl.eastBoundLongitude == geoEl.westBoundLongitude && geoEl.southBoundLatitude == geoEl.northBoundLatitude) { //We only have a point var point = new GLatLng(parseFloat(geoEl.southBoundLatitude), parseFloat(geoEl.eastBoundLongitude)); var icon = new GIcon(G_DEFAULT_ICON, activeLayerRecord.getIconUrl()); icon.shadow = null; var iconSize = knownLayer.getIconSize(); if (iconSize) { icon.iconSize = new GSize(iconSize.width, iconSize.height); } var iconAnchor = knownLayer.getIconAnchor(); if(iconAnchor) { icon.iconAnchor = new GPoint(iconAnchor.x, iconAnchor.y); } var marker = new GMarker(point, {icon: icon}); marker.activeLayerRecord = activeLayerRecord.internalRecord; marker.cswRecord = cswRecords[i].internalRecord; //marker.onlineResource = onlineResource; //Add our single point overlayManager.markerManager.addMarker(marker, 0); } else { //polygon var polygonList = geoEl.toGMapPolygon('#0003F9', 4, 0.75,'#0055FE', 0.4); for (var k = 0; k < polygonList.length; k++) { polygonList[k].cswRecord = cswRecords[i].internalRecord; polygonList[k].activeLayerRecord = activeLayerRecord.internalRecord; overlayManager.addOverlay(polygonList[k]); } } } } } } overlayManager.markerManager.refresh(); responseTooltip.addResponse("", numRecords + " records retrieved."); };
if(filterObj.resourceProvider != null) {
if(filterObj.resourceProvider !== null) {
var genericRecordHandler = function(activeLayerRecord) { //get our overlay manager (create if required) var overlayManager = activeLayerRecord.getOverlayManager(); if (!overlayManager) { overlayManager = new OverlayManager(map); activeLayerRecord.setOverlayManager(overlayManager); } overlayManager.clearOverlays(); var responseTooltip = new ResponseTooltip(); activeLayerRecord.setResponseToolTip(responseTooltip); var reportTitleFilter = ''; var keywordFilter = ''; var resourceProviderFilter = ''; var filterObj = filterPanel.getLayout().activeItem.getForm().getValues(); reportTitleFilter = filterObj.title; var regexp = /\*/; if(reportTitleFilter != '' && /^\w+/.test(reportTitleFilter)) { var regexp = new RegExp(reportTitleFilter, "i"); } if(filterObj.keyword != null) { keywordFilter = filterObj.keyword; } if(filterObj.resourceProvider != null) { resourceProviderFilter = filterObj.resourceProvider; } //Get the list of bounding box polygons var cswRecords = activeLayerRecord.getCSWRecords(); var knownLayer = activeLayerRecord.getParentKnownLayer(); var numRecords = 0; for (var i = 0; i < cswRecords.length; i++) { if ((reportTitleFilter === '' || regexp.test(cswRecords[i].getServiceName())) && (keywordFilter === '' || cswRecords[i].containsKeyword(keywordFilter)) && (resourceProviderFilter === '' || cswRecords[i].getResourceProvider() == resourceProviderFilter)) { numRecords++; var geoEls = cswRecords[i].getGeographicElements(); for (var j = 0; j < geoEls.length; j++) { var geoEl = geoEls[j]; if (geoEl instanceof BBox) { if(geoEl.eastBoundLongitude == geoEl.westBoundLongitude && geoEl.southBoundLatitude == geoEl.northBoundLatitude) { //We only have a point var point = new GLatLng(parseFloat(geoEl.southBoundLatitude), parseFloat(geoEl.eastBoundLongitude)); var icon = new GIcon(G_DEFAULT_ICON, activeLayerRecord.getIconUrl()); icon.shadow = null; var iconSize = knownLayer.getIconSize(); if (iconSize) { icon.iconSize = new GSize(iconSize.width, iconSize.height); } var iconAnchor = knownLayer.getIconAnchor(); if(iconAnchor) { icon.iconAnchor = new GPoint(iconAnchor.x, iconAnchor.y); } var marker = new GMarker(point, {icon: icon}); marker.activeLayerRecord = activeLayerRecord.internalRecord; marker.cswRecord = cswRecords[i].internalRecord; //marker.onlineResource = onlineResource; //Add our single point overlayManager.markerManager.addMarker(marker, 0); } else { //polygon var polygonList = geoEl.toGMapPolygon('#0003F9', 4, 0.75,'#0055FE', 0.4); for (var k = 0; k < polygonList.length; k++) { polygonList[k].cswRecord = cswRecords[i].internalRecord; polygonList[k].activeLayerRecord = activeLayerRecord.internalRecord; overlayManager.addOverlay(polygonList[k]); } } } } } } overlayManager.markerManager.refresh(); responseTooltip.addResponse("", numRecords + " records retrieved."); };
if (!pStringDate)
if (!pStringDate) {
function GeodesyCalendar_parseStringDate (pStringDate) { // if no parameter specified return current timestamp if (!pStringDate) return (new Date()); // if positive integer treat as milliseconds from epoch if (RE_NUM.exec(pStringDate)) { return new Date(pStringDate); } else { return (newDate()); }}
}
function GeodesyCalendar_parseStringDate (pStringDate) { // if no parameter specified return current timestamp if (!pStringDate) return (new Date()); // if positive integer treat as milliseconds from epoch if (RE_NUM.exec(pStringDate)) { return new Date(pStringDate); } else { return (newDate()); }}
this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array();
this.maStationDataForDate = []; this.maYearMonthWfsUrlQueried = []; this.maYearCheckedState = []; this.maMonthCheckedStateForYear = []; this.maDateCheckedStateForMonth = []; this.maDataCheckedStateForDate = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array();
this.maYearMonthWfsUrlQueried[gaYears[year]] = []; this.maMonthCheckedStateForYear[gaYears[year]] = []; this.maDateCheckedStateForMonth[gaYears[year]] = []; this.maDataCheckedStateForDate[gaYears[year]] = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array();
this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = []; this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array();
this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array();
this.maMonthSelectedForYear = []; this.maDateSelectedForMonth = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.maDateSelectedForMonth[year] = new Array();
this.maDateSelectedForMonth[year] = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.msWfsYearDataUrl = new Array();
this.msWfsYearDataUrl = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.msYearMonthWfsUrl = new Array();
this.msYearMonthWfsUrl = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.msYearMonthWfsUrl[gaYears[year]] = new Array();
this.msYearMonthWfsUrl[gaYears[year]] = [];
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
for (month=1; month<=12; month++) {
for (var month=1; month<=12; month++) {
function GeodesyMarker (pWfsUrl, pDataLayerName, stationId, marker, description) { //this.moGeodesyStation = new GeodesyStation(pGeodesyStationNode); this.stationId = marker.title; this.moMarker = marker; // Initiaize all the members //cut off this from the URL "%26request=GetFeature%26typeName=ngcp:GnssStation" this.msWfsUrl = pWfsUrl.substring(0,pWfsUrl.indexOf('?')+1); this.msDataLayerName = pDataLayerName; this.maStationDataForDate = new Array(); this.maYearMonthWfsUrlQueried = new Array(); this.maYearCheckedState = new Array(); this.maMonthCheckedStateForYear = new Array(); this.maDateCheckedStateForMonth = new Array(); this.maDataCheckedStateForDate = new Array(); // This class stores the previously selected years, months and dates for the station // This helps to recreate user selection between successive marker clicks. for(year=0; year<gaYears.length; year++) { this.maYearMonthWfsUrlQueried[gaYears[year]] = new Array(); this.maMonthCheckedStateForYear[gaYears[year]] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]] = new Array(); this.maYearCheckedState[gaYears[year]] = false; for(var month=1; month<=12; month++) { this.maYearMonthWfsUrlQueried[gaYears[year]][gaMonths[month]] = false; this.maMonthCheckedStateForYear[gaYears[year]][gaMonths[month]] = false; this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]] = new Array(); this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]] = new Array(); for(var date=1; date<=31; date++) { this.maDataCheckedStateForDate[gaYears[year]][gaMonths[month]][date] = new Array(); this.maDateCheckedStateForMonth[gaYears[year]][gaMonths[month]][date] = false; } } } // Each station has data for various years // Users can chose different months in different years for viewing data // These arrays retain the last selected year, month dates etc by the user for any station. this.msYearSelected = ""; this.maMonthSelectedForYear = new Array(); this.maDateSelectedForMonth = new Array(); for(var y=0; y<gaYears.length; y++) { // Initially user choses nothing var year = gaYears[y]; this.maMonthSelectedForYear[year] = ""; this.maDateSelectedForMonth[year] = new Array(); for(var m=1; m<=12; m++) { this.maDateSelectedForMonth[year][gaMonths[m]] = ""; } } // Users can query data based on updateCSWRecords year (by clicking on the checkbox against updateCSWRecords year) // or months (by clicking on the checkbox against any month) // We create different wfs query urls for data from each year this.msWfsYearDataUrl = new Array(); for (i=0; i<gaYears.length; i++) { this.msWfsYearDataUrl[gaYears[i]] = this.getWfsYearUrl(gaYears[i] ); } // We create different wfs urls (to query renix files) for each year-month combination this.msYearMonthWfsUrl = new Array(); // Loop over years for (var year=0; year<gaYears.length; year++) { this.msYearMonthWfsUrl[gaYears[year]] = new Array(); // Loop over months for (month=1; month<=12; month++) { this.msYearMonthWfsUrl[gaYears[year]][gaMonths[month]] = this.getYearMonthWfsUrl(gaYears[year], month); } } this.msSummaryHtml = description; this.msRenixFilesHtml = ""; // Create updateCSWRecords GMarker object for each station using the location information for the same. /*var longitude = this.moGeodesyStation.moLocation.msLongitude; var latitude = this.moGeodesyStation.moLocation.msLatitude; var oPoint = new GPoint(parseFloat(longitude), parseFloat(latitude)); var oMarkerIcon = new GIcon(goBaseIcon, psIcon); var oMarker = new GMarker(oPoint, oMarkerIcon); this.moMarker = oMarker; // Add updateCSWRecords listener for updateCSWRecords click event on this marker GEvent.addListener(oMarker, "click", this.getMarkerClickedFn());*/}
this.maStationDataForDate[pYear][pMonth][d] = new Array();
this.maStationDataForDate[pYear][pMonth][d] = [];
function GeodesyMarker_createDataArraysForMonth(pYear, pMonth) { // Check if the third level of indexing has been created. if (!this.maStationDataForDate[pYear]) { this.createDataArraysForYear(pYear); } // Now create arrays for each date // We have arrays to hold data for each date, as there may be more than one data files for each date for(var d=1; d<=31; d++) { this.maStationDataForDate[pYear][pMonth][d] = new Array(); }}
if (this.maStationDataForDate[pYear] == undefined) { this.maStationDataForDate[pYear] = new Array();
if (this.maStationDataForDate[pYear] === undefined) { this.maStationDataForDate[pYear] = [];
function GeodesyMarker_createDataArraysForYear(pYear) { // Check if arrays don't already exist for this year if (this.maStationDataForDate[pYear] == undefined) { this.maStationDataForDate[pYear] = new Array(); for(var m=1; m<=12; m++) { // Create arrays for each month. // Dates for these arrays will be populated in createDataArraysForMonth function var month = gaMonths[m]; this.maStationDataForDate[pYear][month] = new Array(); } }}
this.maStationDataForDate[pYear][month] = new Array();
this.maStationDataForDate[pYear][month] = [];
function GeodesyMarker_createDataArraysForYear(pYear) { // Check if arrays don't already exist for this year if (this.maStationDataForDate[pYear] == undefined) { this.maStationDataForDate[pYear] = new Array(); for(var m=1; m<=12; m++) { // Create arrays for each month. // Dates for these arrays will be populated in createDataArraysForMonth function var month = gaMonths[m]; this.maStationDataForDate[pYear][month] = new Array(); } }}
if (dataUrlChkObj && this.maDataCheckedStateForDate[pYear][pMonth][pDate][pIndex]!=undefined) {
if (dataUrlChkObj && this.maDataCheckedStateForDate[pYear][pMonth][pDate][pIndex]!==undefined) {
function GeodesyMarker_dataUrlChecked(pYear, pMonth, pDate, pIndex, pDataUrlChkId) { var dataUrlChkObj = document.getElementById(pDataUrlChkId); if (dataUrlChkObj && this.maDataCheckedStateForDate[pYear][pMonth][pDate][pIndex]!=undefined) { this.maDataCheckedStateForDate[pYear][pMonth][pDate][pIndex] = dataUrlChkObj.checked; }}
}
};
function GeodesyMarker_getDataUrlCheckedFn(pYear, pMonth, pDate, pIndex, pDataUrlChkId) { var oGeodesyMarker = this; return function () { oGeodesyMarker.dataUrlChecked(pYear, pMonth, pDate, pIndex, pDataUrlChkId); }}
wfs.dataUrlChecked(pYear, pMonth, pDate, pIndex, pDataUrlChkId);
oGeodesyMarker.dataUrlChecked(pYear, pMonth, pDate, pIndex, pDataUrlChkId);
function GeodesyMarker_getDataUrlCheckedFn(pYear, pMonth, pDate, pIndex, pDataUrlChkId) { var oGeodesyMarker = this; return function () { wfs.dataUrlChecked(pYear, pMonth, pDate, pIndex, pDataUrlChkId); }}
}
};
function GeodesyMarker_getDateCheckedFn (pYear, pMonth, pDate, pDateChkId, pDateHrefId) { var oGeodesyMarker = this; var year = pYear; var month = pMonth; var date = pDate; var dateChkId = pDateChkId; var dateHrefId = pDateHrefId; // Return the actual function that should be called when updateCSWRecords year checkbox is clicked return function() { oGeodesyMarker.dateChecked(year, month, date, dateChkId, dateHrefId); }}
}
};
function GeodesyMarker_getDateClickedFn(pYear, pMonth, pDate, pDateHrefId) { var oGeodesyMarker = this; var year = pYear; var month = pMonth; var date = pDate; var dateHrefId = pDateHrefId; // Return the actual function that should be called when updateCSWRecords year checkbox is clicked return function() { oGeodesyMarker.dateClicked(year, month, date, dateHrefId); }}
setTimeout( function(){ marker.updateInfoWindow() }, 500); }
setTimeout( function(){ marker.updateInfoWindow(); }, 500); };
function GeodesyMarker_getMarkerClickedFn() { var geodesyMarker = this; return function() { geodesyMarker.markerClicked(); // Once the marker has been opened and rendered, // we add the calendar to the info window // The onOpenFn option with GInfoWindow does not work // Hence this function is called with updateCSWRecords time lag of 500ms var marker = geodesyMarker; setTimeout( function(){ marker.updateInfoWindow() }, 500); }}
}
};
function GeodesyMarker_getMonthCheckedFn (pYear, pMonth, pMonthChkId, pMonthHrefId, pDatesDivId) { var oGeodesyMarker = this; var station = this.stationId;//this.moGeodesyStation.msId; var year = pYear; var month = pMonth; var monthChkId = pMonthChkId; var monthHrefId = pMonthHrefId; var datesDivId = pDatesDivId; // Return the actual function that should be called when updateCSWRecords year checkbox is clicked return function() { oGeodesyMarker.monthChecked(year, month, monthChkId, monthHrefId, datesDivId); }}
}
};
function GeodesyMarker_getMonthClickedFn (pYear, pMonth, pMonthHrefId, pDatesDivId) { var oGeodesyMarker = this; var year = pYear; var month = pMonth; var monthHrefId = pMonthHrefId; var datesDivId = pDatesDivId; // Return the actual function that should be called when updateCSWRecords month href is clicked return function() { oGeodesyMarker.monthClicked(year, month, monthHrefId, datesDivId); }}
}
};
function GeodesyMarker_getYearCheckedFn (pYear, pYearChkId, pYearHrefId, pMonthsDivId, pDatesDivId) { var oGeodesyMarker = this; var yearChkId = pYearChkId; var yearHrefId = pYearHrefId; var year = pYear; var monthsDivId = pMonthsDivId; var datesDivId = pDatesDivId; // Return the actual function that should be called when updateCSWRecords year checkbox is clicked return function () { oGeodesyMarker.yearChecked(year, yearChkId, yearHrefId, monthsDivId, datesDivId); }}
}
};
function GeodesyMarker_getYearClickedFn (pYear, pYearChkId, pYearHrefId, pMonthsDivId, pDatesDivId) { var oGeodesyMarker = this; var yearChkId = pYearChkId; var yearHrefId = pYearHrefId; var year = pYear; var monthsDivId = pMonthsDivId; var datesDivId = pDatesDivId; // Return the actual function that should be called when updateCSWRecords year href is clicked return function () { oGeodesyMarker.yearClicked(year, yearHrefId, monthsDivId, datesDivId); }}
if (num_urls != 0) {
if (num_urls !== 0) {
function GeodesyMarker_setCheckedStateForDate (pYear, pMonth, pDate, pState) { this.maDateCheckedStateForMonth[pYear][pMonth][pDate] = pState; // Propogate this state to all the data urls belonging to this date var num_urls = this.maDataCheckedStateForDate[pYear][pMonth][pDate].length; if (num_urls != 0) { for (var url_index=0; url_index<num_urls; url_index++ ) { this.maDataCheckedStateForDate[pYear][pMonth][pDate][url_index] = pState; } }}
if (featureMembers.length != 0) {
if (featureMembers.length !== 0) {
function GeodesyMarker_setDataForSelectedMonth(pYear, pMonth, pDatesDivObj) { var oGeodesyMarker = this; var station = this.stationId;//this.moGeodesyStation.msId; var year = pYear; var month = pMonth; var datesDivObj = pDatesDivObj; // Create the wfs call that will get the data var sStationDataUrl = ProxyURL + this.msYearMonthWfsUrl[year][month]; //sStationDataUrl= sStationDataUrl + "AND(id='" + station + "')"; if (this.maYearMonthWfsUrlQueried[year][month]) { this.makeCalendarForMonth(year, month); return; } // Create the arrays to hold the data urls for the dates of this year+month this.createDataArraysForMonth(year, month); // Download the renix files by making the wfs call GDownloadUrl(sStationDataUrl, function(xmlData, pResponseCode) { var xmlDoc = GXml.parse(xmlData); if (g_IsIE) xmlDoc.setProperty("SelectionLanguage", "XPath"); var rootNode = xmlDoc.documentElement; if (!rootNode) { return; } var geodesyMarker = oGeodesyMarker; var monthChkId = "month_chk_" + station + "_" + year + "_" + month; var monthChkObj = document.getElementById(monthChkId); // The checked state of the month should be propogated to all the dates belonging to the month var checkedState = false; if (monthChkObj) { checkedState = monthChkObj.checked; } // Parse the XML for "featureMembers" var featureMembers = rootNode.selectNodes(".//*[local-name() = 'featureMember']"); if (featureMembers.length != 0) { // Each of these contain updateCSWRecords "geodesy:date" and "geodesy:url" child node. for(var i=0; i < featureMembers.length; i++) { var fullDate = GXml.value(featureMembers[i].selectSingleNode(".//*[local-name() = 'date']")); var url = GXml.value(featureMembers[i].selectSingleNode(".//*[local-name() = 'url']")); if (fullDate=="" || url=="") { continue; } else { // Get the date out of the geodesy:date tag var adate = fullDate.split("-"); var date = parseInt(adate[2], 10); // Add the url associated with the date to the array maStationDataForDate // This array maintains the list of all station data urls for updateCSWRecords given // station+year+month+date combo. var numRenixFiles = geodesyMarker.maStationDataForDate[year][month][date].length; geodesyMarker.maStationDataForDate[year][month][date][numRenixFiles] = url; // Propogate the checked state of the month to the checkbox associated with this date. geodesyMarker.maDataCheckedStateForDate[year][month][date][numRenixFiles] = checkedState; } } } // Now that all the requird arrays are populated, // make the calendar for this month now. oGeodesyMarker.makeCalendarForMonth(year, month); // This flag keeps tab of whether this month has already been queried. oGeodesyMarker.maYearMonthWfsUrlQueried[year][month] = true; });}
if (fullDate=="" || url=="") {
if (fullDate==="" || url==="") {
function GeodesyMarker_setDataForSelectedMonth(pYear, pMonth, pDatesDivObj) { var oGeodesyMarker = this; var station = this.stationId;//this.moGeodesyStation.msId; var year = pYear; var month = pMonth; var datesDivObj = pDatesDivObj; // Create the wfs call that will get the data var sStationDataUrl = ProxyURL + this.msYearMonthWfsUrl[year][month]; //sStationDataUrl= sStationDataUrl + "AND(id='" + station + "')"; if (this.maYearMonthWfsUrlQueried[year][month]) { this.makeCalendarForMonth(year, month); return; } // Create the arrays to hold the data urls for the dates of this year+month this.createDataArraysForMonth(year, month); // Download the renix files by making the wfs call GDownloadUrl(sStationDataUrl, function(xmlData, pResponseCode) { var xmlDoc = GXml.parse(xmlData); if (g_IsIE) xmlDoc.setProperty("SelectionLanguage", "XPath"); var rootNode = xmlDoc.documentElement; if (!rootNode) { return; } var geodesyMarker = oGeodesyMarker; var monthChkId = "month_chk_" + station + "_" + year + "_" + month; var monthChkObj = document.getElementById(monthChkId); // The checked state of the month should be propogated to all the dates belonging to the month var checkedState = false; if (monthChkObj) { checkedState = monthChkObj.checked; } // Parse the XML for "featureMembers" var featureMembers = rootNode.selectNodes(".//*[local-name() = 'featureMember']"); if (featureMembers.length != 0) { // Each of these contain updateCSWRecords "geodesy:date" and "geodesy:url" child node. for(var i=0; i < featureMembers.length; i++) { var fullDate = GXml.value(featureMembers[i].selectSingleNode(".//*[local-name() = 'date']")); var url = GXml.value(featureMembers[i].selectSingleNode(".//*[local-name() = 'url']")); if (fullDate=="" || url=="") { continue; } else { // Get the date out of the geodesy:date tag var adate = fullDate.split("-"); var date = parseInt(adate[2], 10); // Add the url associated with the date to the array maStationDataForDate // This array maintains the list of all station data urls for updateCSWRecords given // station+year+month+date combo. var numRenixFiles = geodesyMarker.maStationDataForDate[year][month][date].length; geodesyMarker.maStationDataForDate[year][month][date][numRenixFiles] = url; // Propogate the checked state of the month to the checkbox associated with this date. geodesyMarker.maDataCheckedStateForDate[year][month][date][numRenixFiles] = checkedState; } } } // Now that all the requird arrays are populated, // make the calendar for this month now. oGeodesyMarker.makeCalendarForMonth(year, month); // This flag keeps tab of whether this month has already been queried. oGeodesyMarker.maYearMonthWfsUrlQueried[year][month] = true; });}
if (g_IsIE)
if (g_IsIE) {
function GeodesyMarker_yearChecked (pYear, pYearChkId, pYearHrefId, pMonthsDivId, pDatesDivId) { var oGeodesyMarker = this; var station = this.stationId;//this.moGeodesyStation.msId; var yearChkId = pYearChkId; var yearHrefId = pYearHrefId; var year = pYear; var monthsDivId = pMonthsDivId; var datesDivId = pDatesDivId; var month; for (var m=1; m<=12; m++) { month = gaMonths[m]; this.createDataArraysForMonth(year, month); } // Get the html checkbox object var yearChkObj = document.getElementById(yearChkId); if (yearChkObj) { // Set the checked state for the year and propogate it further this.setCheckedStateForYear(year, yearChkObj.checked); } var sStationDataUrl = ProxyURL + this.msWfsYearDataUrl[year]; // sStationDataUrl= sStationDataUrl + "AND(id='" + station + "')"; // Download renix files for this year GDownloadUrl(sStationDataUrl, function(xmlData, pResponseCode) { var xmlDoc = GXml.parse(xmlData); if (g_IsIE) xmlDoc.setProperty("SelectionLanguage", "XPath"); var rootNode = xmlDoc.documentElement; if (!rootNode) { return; } var geodesyMarker = oGeodesyMarker; // The checked state of the year should be propogated to all the dates belonging to the month var checkedState = false; if (yearChkObj) { checkedState = yearChkObj.checked; } // Parse the XML for "stations" or "geodesy:stations" var featureMembers = rootNode.selectNodes(".//*[local-name() = 'featureMember']"); for(var i=0; i < featureMembers.length; i++) { // Extract date and url from each featureMember var fullDate = GXml.value(featureMembers[i].selectSingleNode(".//*[local-name() = 'date']")); var url = GXml.value(featureMembers[i].selectSingleNode(".//*[local-name() = 'url']")); if (fullDate=="" || url=="") { continue; } else { // Extract month from the date element var adate = fullDate.split("-"); var date = parseInt(adate[2], 10); gmonth = parseInt(adate[1], 10); gmonth = gaMonths[gmonth]; // Add the url associated with the date to the array maStationDataForDate // This array maintains the list of all station data urls for updateCSWRecords given // station+year+month+date combo. var numRenixFiles = geodesyMarker.maStationDataForDate[year][gmonth][date].length; geodesyMarker.maStationDataForDate[year][gmonth][date][numRenixFiles] = url; // Propogate the checked state of the year to the checkbox associated with this date. geodesyMarker.maDataCheckedStateForDate[year][gmonth][date][numRenixFiles] = checkedState; } } for (var m=1; m<=12; m++) { // Create the arrays to hold the data urls for the dates of this year+month month = gaMonths[m]; geodesyMarker.maYearMonthWfsUrlQueried[year][month] = true; } // Now call the onclick function associated with the year href // This is so that the user can see the list of months for his currently checked year geodesyMarker.yearClicked(year, yearHrefId, monthsDivId, datesDivId, true); }); }
if (fullDate=="" || url=="") {
if (fullDate==="" || url==="") {
function GeodesyMarker_yearChecked (pYear, pYearChkId, pYearHrefId, pMonthsDivId, pDatesDivId) { var oGeodesyMarker = this; var station = this.stationId;//this.moGeodesyStation.msId; var yearChkId = pYearChkId; var yearHrefId = pYearHrefId; var year = pYear; var monthsDivId = pMonthsDivId; var datesDivId = pDatesDivId; var month; for (var m=1; m<=12; m++) { month = gaMonths[m]; this.createDataArraysForMonth(year, month); } // Get the html checkbox object var yearChkObj = document.getElementById(yearChkId); if (yearChkObj) { // Set the checked state for the year and propogate it further this.setCheckedStateForYear(year, yearChkObj.checked); } var sStationDataUrl = ProxyURL + this.msWfsYearDataUrl[year]; // sStationDataUrl= sStationDataUrl + "AND(id='" + station + "')"; // Download renix files for this year GDownloadUrl(sStationDataUrl, function(xmlData, pResponseCode) { var xmlDoc = GXml.parse(xmlData); if (g_IsIE) xmlDoc.setProperty("SelectionLanguage", "XPath"); var rootNode = xmlDoc.documentElement; if (!rootNode) { return; } var geodesyMarker = oGeodesyMarker; // The checked state of the year should be propogated to all the dates belonging to the month var checkedState = false; if (yearChkObj) { checkedState = yearChkObj.checked; } // Parse the XML for "stations" or "geodesy:stations" var featureMembers = rootNode.selectNodes(".//*[local-name() = 'featureMember']"); for(var i=0; i < featureMembers.length; i++) { // Extract date and url from each featureMember var fullDate = GXml.value(featureMembers[i].selectSingleNode(".//*[local-name() = 'date']")); var url = GXml.value(featureMembers[i].selectSingleNode(".//*[local-name() = 'url']")); if (fullDate=="" || url=="") { continue; } else { // Extract month from the date element var adate = fullDate.split("-"); var date = parseInt(adate[2], 10); gmonth = parseInt(adate[1], 10); gmonth = gaMonths[gmonth]; // Add the url associated with the date to the array maStationDataForDate // This array maintains the list of all station data urls for updateCSWRecords given // station+year+month+date combo. var numRenixFiles = geodesyMarker.maStationDataForDate[year][gmonth][date].length; geodesyMarker.maStationDataForDate[year][gmonth][date][numRenixFiles] = url; // Propogate the checked state of the year to the checkbox associated with this date. geodesyMarker.maDataCheckedStateForDate[year][gmonth][date][numRenixFiles] = checkedState; } } for (var m=1; m<=12; m++) { // Create the arrays to hold the data urls for the dates of this year+month month = gaMonths[m]; geodesyMarker.maYearMonthWfsUrlQueried[year][month] = true; } // Now call the onclick function associated with the year href // This is so that the user can see the list of months for his currently checked year geodesyMarker.yearClicked(year, yearHrefId, monthsDivId, datesDivId, true); }); }
if (g_IsIE)
if (g_IsIE) {
function GeodesyStation_parseXmlElement(pGeodesyStationNode) { var nodeGeodesyStation = pGeodesyStationNode; if (g_IsIE) nodeGeodesyStation.setProperty("SelectionLanguage", "XPath"); /** * Sample XML fragment for updateCSWRecords Geodesy station - * <gml:featureMember> * <geodesy:stations fid="stations.alic"> * <geodesy:station_id>alic</geodesy:station_id> * <geodesy:name>Alice Springs AU012</geodesy:name> * <geodesy:url> * http://apacsrv7.arrc.csiro.au/geodesy/station_logs/alic_20060329.log * </geodesy:url> * <geodesy:location> * <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"> * <gml:coordinates decimal="." cs="," ts=" ">133.8855,-23.6701</gml:coordinates> * </gml:Point> * </geodesy:location> * </geodesy:stations> * </gml:featureMember> */ var sId = null; var sName = null; var sLogUrl = null; var oLocation = null; // Extract all the data about the GeodesyStation from the WFS sId = GXml.value(nodeGeodesyStation.selectSingleNode("*[local-name() = 'station_id']")); sName = GXml.value(nodeGeodesyStation.selectSingleNode("*[local-name() = 'name']")); sLogUrl = GXml.value(nodeGeodesyStation.selectSingleNode("*[local-name() = 'url']")); // geodesy:stations contains updateCSWRecords gsml:pos node oLocation = new Coordinates(nodeGeodesyStation.selectSingleNode(".//*[local-name() = 'Point']")); // Populate the arrays for the object. this.msId = sId; this.msName = sName; this.msLogUrl = sLogUrl; this.moLocation = oLocation;}
}
function GeodesyStation_parseXmlElement(pGeodesyStationNode) { var nodeGeodesyStation = pGeodesyStationNode; if (g_IsIE) nodeGeodesyStation.setProperty("SelectionLanguage", "XPath"); /** * Sample XML fragment for updateCSWRecords Geodesy station - * <gml:featureMember> * <geodesy:stations fid="stations.alic"> * <geodesy:station_id>alic</geodesy:station_id> * <geodesy:name>Alice Springs AU012</geodesy:name> * <geodesy:url> * http://apacsrv7.arrc.csiro.au/geodesy/station_logs/alic_20060329.log * </geodesy:url> * <geodesy:location> * <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"> * <gml:coordinates decimal="." cs="," ts=" ">133.8855,-23.6701</gml:coordinates> * </gml:Point> * </geodesy:location> * </geodesy:stations> * </gml:featureMember> */ var sId = null; var sName = null; var sLogUrl = null; var oLocation = null; // Extract all the data about the GeodesyStation from the WFS sId = GXml.value(nodeGeodesyStation.selectSingleNode("*[local-name() = 'station_id']")); sName = GXml.value(nodeGeodesyStation.selectSingleNode("*[local-name() = 'name']")); sLogUrl = GXml.value(nodeGeodesyStation.selectSingleNode("*[local-name() = 'url']")); // geodesy:stations contains updateCSWRecords gsml:pos node oLocation = new Coordinates(nodeGeodesyStation.selectSingleNode(".//*[local-name() = 'Point']")); // Populate the arrays for the object. this.msId = sId; this.msName = sName; this.msLogUrl = sLogUrl; this.moLocation = oLocation;}
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
get : function()
this.get = function()
get : function() { return $(this._id).value; },
},
};
get : function() { return $(this._id).value; },
if(obj.hasClass("open")) json.state = "open"; if(obj.hasClass("closed")) json.state = "closed";
if(obj.hasClass("open")) json.data.state = "open"; if(obj.hasClass("closed")) json.data.state = "closed";
get : function(obj, tree, opts) { var _this = this; if(!obj || $(obj).size() == 0) obj = tree.container.children("ul").children("li"); else obj = $(obj); if(!opts) opts = {}; if(!opts.outer_attrib) opts.outer_attrib = [ "id", "rel", "class" ]; if(!opts.inner_attrib) opts.inner_attrib = [ ]; if(obj.size() > 1) { var arr = []; obj.each(function () { arr.push(_this.get(this, tree, opts)); }); return arr; } if(obj.size() == 0) return []; var json = { attributes : {}, data : {} }; if(obj.hasClass("open")) json.state = "open"; if(obj.hasClass("closed")) json.state = "closed"; for(var i in opts.outer_attrib) { if(!opts.outer_attrib.hasOwnProperty(i)) continue; var val = (opts.outer_attrib[i] == "class") ? obj.attr(opts.outer_attrib[i]).replace(/(^| )last( |$)/ig," ").replace(/(^| )(leaf|closed|open)( |$)/ig," ") : obj.attr(opts.outer_attrib[i]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.attributes[opts.outer_attrib[i]] = val; delete val; } if(tree.settings.languages.length) { for(var i in tree.settings.languages) { if(!tree.settings.languages.hasOwnProperty(i)) continue; var a = obj.children("a." + tree.settings.languages[i]); if(opts.force || opts.inner_attrib.length || a.children("ins").get(0).style.backgroundImage.toString().length || a.children("ins").get(0).className.length) { json.data[tree.settings.languages[i]] = {}; json.data[tree.settings.languages[i]].title = tree.get_text(obj,tree.settings.languages[i]); if(a.children("ins").get(0).style.className.length) { json.data[tree.settings.languages[i]].icon = a.children("ins").get(0).style.className; } if(a.children("ins").get(0).style.backgroundImage.length) { json.data[tree.settings.languages[i]].icon = a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""); } if(opts.inner_attrib.length) { json.data[tree.settings.languages[i]].attributes = {}; for(var j in opts.inner_attrib) { if(!opts.inner_attrib.hasOwnProperty(j)) continue; var val = a.attr(opts.inner_attrib[j]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.data[tree.settings.languages[i]].attributes[opts.inner_attrib[j]] = val; delete val; } } } else { json.data[tree.settings.languages[i]] = tree.get_text(obj,tree.settings.languages[i]); } } } else { var a = obj.children("a"); json.data.title = tree.get_text(obj); if(a.children("ins").size() && a.children("ins").get(0).className.length) { json.data.icon = a.children("ins").get(0).className; } if(a.children("ins").size() && a.children("ins").get(0).style.backgroundImage.length) { json.data.icon = a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""); } if(opts.inner_attrib.length) { json.data.attributes = {}; for(var j in opts.inner_attrib) { if(!opts.inner_attrib.hasOwnProperty(j)) continue; var val = a.attr(opts.inner_attrib[j]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.data.attributes[opts.inner_attrib[j]] = val; delete val; } } } if(obj.children("ul").size() > 0) { json.children = []; obj.children("ul").children("li").each(function () { json.children.push(_this.get(this, tree, opts)); }); } return json; },
m.setAttribute('type','text/javascript');m.appendText(l);m.appendTo(a.document.getHead());}};})();a.resourceManager=function(j,k){var l=this;l.basePath=j;l.fileName=k;l.registered={};l.loaded={};l.externals={};l._={waitingList:{}};};a.resourceManager.prototype={add:function(j,k){if(this.registered[j])throw '[CKEDITOR.resourceManager.add] The resource name "'+j+'" is already registered.';a.fire(j+e.capitalize(this.fileName)+'Ready',this.registered[j]=k||{});},get:function(j){return this.registered[j]||null;},getPath:function(j){var k=this.externals[j];return a.getUrl(k&&k.dir||this.basePath+j+'/');},getFilePath:function(j){var k=this.externals[j];return a.getUrl(this.getPath(j)+(k&&typeof k.file=='string'?k.file:this.fileName+'.js'));},addExternal:function(j,k,l){j=j.split(',');for(var m=0;m<j.length;m++){var n=j[m];this.externals[n]={dir:k,file:l};}},load:function(j,k,l){if(!e.isArray(j))j=j?[j]:[];var m=this.loaded,n=this.registered,o=[],p={},q={};for(var r=0;r<j.length;r++){var s=j[r];if(!s)continue;if(!m[s]&&!n[s]){var t=this.getFilePath(s);o.push(t);if(!(t in p))p[t]=[];p[t].push(s);}else q[s]=this.get(s);}a.scriptLoader.load(o,function(u,v){if(v.length)throw '[CKEDITOR.resourceManager.load] Resource name "'+p[v[0]].join(',')+'" was not found at "'+v[0]+'".';for(var w=0;w<u.length;w++){var x=p[u[w]];for(var y=0;y<x.length;y++){var z=x[y];q[z]=this.get(z);m[z]=1;}}k.call(l,q);},this);}};a.plugins=new a.resourceManager('plugins/','plugin');var j=a.plugins;j.load=e.override(j.load,function(k){return function(l,m,n){var o={},p=function(q){k.call(this,q,function(r){e.extend(o,r);var s=[];for(var t in r){var u=r[t],v=u&&u.requires;if(v)for(var w=0;w<v.length;w++){if(!o[v[w]])s.push(v[w]);}}if(s.length)p.call(this,s);else{for(t in o){u=o[t];if(u.onLoad&&!u.onLoad._called){u.onLoad();u.onLoad._called=1;}}if(m)m.call(n||window,o);}},this);};p.call(this,l);};});j.setLang=function(k,l,m){var n=this.get(k),o=n.lang||(n.lang={});o[l]=m;};(function(){var k={},l=function(m,n){var o=function(){p.removeAllListeners();k[m]=1;n();},p=new h('img');p.on('load',o);p.on('error',o);p.setAttribute('src',m);};a.imageCacher={load:function(m,n){var o=m.length,p=function(){if(--o===0)n();};for(var q=0;q<m.length;q++){var r=m[q];if(k[r])p();else l(r,p);}}};})();a.skins=(function(){var k={},l={},m={},n=function(o,p,q,r){var s=k[p];if(!o.skin){o.skin=s;if(s.init)s.init(o);}var t=function(D){for(var E=0;E<D.length;E++)D[E]=a.getUrl(m[p]+D[E]);};function u(D,E){return D.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(F,G,H,I){if(/^\/|^\w?:/.test(H))return F;
j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k);if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o,p){var q=typeof l=='string';if(q)l=[l];if(!n)n=a;var r=l.length,s=[],t=[],u=function(z){if(m)if(q)m.call(n,z);else m.call(n,s,t);};if(r===0){u(true);return;}var v=function(z,A){(A?s:t).push(z);if(--r<=0){p&&a.document.getDocumentElement().removeStyle('cursor');u(A);}},w=function(z,A){j[z]=1;var B=k[z];delete k[z];for(var C=0;C<B.length;C++)B[C](z,A);},x=function(z){if(o!==true&&j[z]){v(z,true);return;}var A=k[z]||(k[z]=[]);A.push(v);if(A.length>1)return;var B=new h('script');B.setAttributes({type:'text/javascript',src:z});if(m)if(c)B.$.onreadystatechange=function(){if(B.$.readyState=='loaded'||B.$.readyState=='complete'){B.$.onreadystatechange=null;w(z,true);}};else{B.$.onload=function(){setTimeout(function(){w(z,true);},0);};B.$.onerror=function(){w(z,false);};}B.appendTo(a.document.getHead());};p&&a.document.getDocumentElement().setStyle('cursor','wait');for(var y=0;y<r;y++)x(l[y]);},loadCode:function(l){var m=new h('script');m.setAttribute('type','text/javascript');m.appendText(l);m.appendTo(a.document.getHead());}};})();a.resourceManager=function(j,k){var l=this;l.basePath=j;l.fileName=k;l.registered={};l.loaded={};l.externals={};l._={waitingList:{}};};a.resourceManager.prototype={add:function(j,k){if(this.registered[j])throw '[CKEDITOR.resourceManager.add] The resource name "'+j+'" is already registered.';a.fire(j+e.capitalize(this.fileName)+'Ready',this.registered[j]=k||{});},get:function(j){return this.registered[j]||null; },getPath:function(j){var k=this.externals[j];return a.getUrl(k&&k.dir||this.basePath+j+'/');},getFilePath:function(j){var k=this.externals[j];return a.getUrl(this.getPath(j)+(k&&typeof k.file=='string'?k.file:this.fileName+'.js'));},addExternal:function(j,k,l){j=j.split(',');for(var m=0;m<j.length;m++){var n=j[m];this.externals[n]={dir:k,file:l};}},load:function(j,k,l){if(!e.isArray(j))j=j?[j]:[];var m=this.loaded,n=this.registered,o=[],p={},q={};for(var r=0;r<j.length;r++){var s=j[r];if(!s)continue;if(!m[s]&&!n[s]){var t=this.getFilePath(s);o.push(t);if(!(t in p))p[t]=[];p[t].push(s);}else q[s]=this.get(s);}a.scriptLoader.load(o,function(u,v){if(v.length)throw '[CKEDITOR.resourceManager.load] Resource name "'+p[v[0]].join(',')+'" was not found at "'+v[0]+'".';for(var w=0;w<u.length;w++){var x=p[u[w]];for(var y=0;y<x.length;y++){var z=x[y];q[z]=this.get(z);m[z]=1;}}k.call(l,q);},this);}};a.plugins=new a.resourceManager('plugins/','plugin');var j=a.plugins;j.load=e.override(j.load,function(k){return function(l,m,n){var o={},p=function(q){k.call(this,q,function(r){e.extend(o,r);var s=[];for(var t in r){var u=r[t],v=u&&u.requires;if(v)for(var w=0;w<v.length;w++){if(!o[v[w]])s.push(v[w]);}}if(s.length)p.call(this,s);else{for(t in o){u=o[t];if(u.onLoad&&!u.onLoad._called){u.onLoad();u.onLoad._called=1;}}if(m)m.call(n||window,o);}},this);};p.call(this,l);};});j.setLang=function(k,l,m){var n=this.get(k),o=n.lang||(n.lang={});o[l]=m;};(function(){var k={},l=function(m,n){var o=function(){p.removeAllListeners();k[m]=1;n();},p=new h('img');p.on('load',o);p.on('error',o);p.setAttribute('src',m);};a.imageCacher={load:function(m,n){var o=m.length,p=function(){if(--o===0)n();};for(var q=0;q<m.length;q++){var r=m[q];if(k[r])p();else l(r,p);}}};})();a.skins=(function(){var k={},l={},m={},n=function(o,p,q,r){var s=k[p];if(!o.skin){o.skin=s;if(s.init)s.init(o);}var t=function(D){for(var E=0;E<D.length;E++)D[E]=a.getUrl(m[p]+D[E]);};function u(D,E){return D.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(F,G,H,I){if(/^\/|^\w?:/.test(H))return F;else return 'url('+E+G+H+I+')';});};if(!l[p]){var v=s.preload;if(v&&v.length>0){t(v);a.imageCacher.load(v,function(){l[p]=1;n(o,p,q,r);});return;}l[p]=1;}q=s[q];var w=!q||!!q._isLoaded;if(w)r&&r();else{var x=q._pending||(q._pending=[]);x.push(r);if(x.length>1)return;var y=!q.css||!q.css.length,z=!q.js||!q.js.length,A=function(){if(y&&z){q._isLoaded=1;for(var D=0;D<x.length;D++){if(x[D])x[D]();}}};if(!y){var B=q.css;if(e.isArray(B)){t(B);
m.setAttribute('type','text/javascript');m.appendText(l);m.appendTo(a.document.getHead());}};})();a.resourceManager=function(j,k){var l=this;l.basePath=j;l.fileName=k;l.registered={};l.loaded={};l.externals={};l._={waitingList:{}};};a.resourceManager.prototype={add:function(j,k){if(this.registered[j])throw '[CKEDITOR.resourceManager.add] The resource name "'+j+'" is already registered.';a.fire(j+e.capitalize(this.fileName)+'Ready',this.registered[j]=k||{});},get:function(j){return this.registered[j]||null;},getPath:function(j){var k=this.externals[j];return a.getUrl(k&&k.dir||this.basePath+j+'/');},getFilePath:function(j){var k=this.externals[j];return a.getUrl(this.getPath(j)+(k&&typeof k.file=='string'?k.file:this.fileName+'.js'));},addExternal:function(j,k,l){j=j.split(',');for(var m=0;m<j.length;m++){var n=j[m];this.externals[n]={dir:k,file:l};}},load:function(j,k,l){if(!e.isArray(j))j=j?[j]:[];var m=this.loaded,n=this.registered,o=[],p={},q={};for(var r=0;r<j.length;r++){var s=j[r];if(!s)continue;if(!m[s]&&!n[s]){var t=this.getFilePath(s);o.push(t);if(!(t in p))p[t]=[];p[t].push(s);}else q[s]=this.get(s);}a.scriptLoader.load(o,function(u,v){if(v.length)throw '[CKEDITOR.resourceManager.load] Resource name "'+p[v[0]].join(',')+'" was not found at "'+v[0]+'".';for(var w=0;w<u.length;w++){var x=p[u[w]];for(var y=0;y<x.length;y++){var z=x[y];q[z]=this.get(z);m[z]=1;}}k.call(l,q);},this);}};a.plugins=new a.resourceManager('plugins/','plugin');var j=a.plugins;j.load=e.override(j.load,function(k){return function(l,m,n){var o={},p=function(q){k.call(this,q,function(r){e.extend(o,r);var s=[];for(var t in r){var u=r[t],v=u&&u.requires;if(v)for(var w=0;w<v.length;w++){if(!o[v[w]])s.push(v[w]);}}if(s.length)p.call(this,s);else{for(t in o){u=o[t];if(u.onLoad&&!u.onLoad._called){u.onLoad();u.onLoad._called=1;}}if(m)m.call(n||window,o);}},this);};p.call(this,l);};});j.setLang=function(k,l,m){var n=this.get(k),o=n.lang||(n.lang={});o[l]=m;};(function(){var k={},l=function(m,n){var o=function(){p.removeAllListeners();k[m]=1;n();},p=new h('img');p.on('load',o);p.on('error',o);p.setAttribute('src',m);};a.imageCacher={load:function(m,n){var o=m.length,p=function(){if(--o===0)n();};for(var q=0;q<m.length;q++){var r=m[q];if(k[r])p();else l(r,p);}}};})();a.skins=(function(){var k={},l={},m={},n=function(o,p,q,r){var s=k[p];if(!o.skin){o.skin=s;if(s.init)s.init(o);}var t=function(D){for(var E=0;E<D.length;E++)D[E]=a.getUrl(m[p]+D[E]);};function u(D,E){return D.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(F,G,H,I){if(/^\/|^\w?:/.test(H))return F;
this.setArray(a):d.makeArray(a,this)},selector:"",jquery:"1.4b1pre",length:0,size:function(){return this.length},toArray:function(){return I.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,e){a=d(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+e;else if(b)a.selector=this.selector+"."+b+"("+e+")";return a},setArray:function(a){this.length=0;V.apply(this,a);return this},each:function(a,
this.setArray(a):c.makeArray(a,this)},selector:"",jquery:"1.4b1pre",length:0,size:function(){return this.length},toArray:function(){return I.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,e){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+e;else if(b)a.selector=this.selector+"."+b+"("+e+")";return a},setArray:function(a){this.length=0;V.apply(this,a);return this},each:function(a,
this.setArray(a):d.makeArray(a,this)},selector:"",jquery:"1.4b1pre",length:0,size:function(){return this.length},toArray:function(){return I.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,e){a=d(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+e;else if(b)a.selector=this.selector+"."+b+"("+e+")";return a},setArray:function(a){this.length=0;V.apply(this,a);return this},each:function(a,
get focusedWindow() this.getForcusedWindow(),
get focusedWindow() this.getFocusedWindow(),
get focusedWindow() this.getForcusedWindow(),
get _logService() { if (!this.__logService) this.__logService = Cc["@mozilla.org/consoleservice;1"]. getService(Ci.nsIConsoleService); return this.__logService;
get _logFile() {this._logService.logStringMessage("logging"); if (!this.__logFile) {this._logService.logStringMessage("logging2"); var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); var dir = directoryService.get("ProfD", Components.interfaces.nsIFile); this._logService.logStringMessage("logging3"); file.initWithPath(dir.path); file.append("keefox"); file.append("log.txt"); this._logService.logStringMessage("logging4"); this.__logFile = file; } this._logService.logStringMessage("logging5"); return this.__logFile;
get _logService() { if (!this.__logService) this.__logService = Cc["@mozilla.org/consoleservice;1"]. getService(Ci.nsIConsoleService); return this.__logService; },
{this._logService.logStringMessage("logging");
{
get _logFile() {this._logService.logStringMessage("logging"); if (!this.__logFile) {this._logService.logStringMessage("logging2"); var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); //var MY_ID = "[email protected]"; //var em = Components.classes["@mozilla.org/extensions/manager;1"]. // getService(Components.interfaces.nsIExtensionManager); //var dir = em.getInstallLocation(MY_ID).getItemLocation(MY_ID); var dir = directoryService.get("ProfD", Components.interfaces.nsIFile); this._logService.logStringMessage("logging3"); file.initWithPath(dir.path); file.append("keefox"); file.append("log.txt"); this._logService.logStringMessage("logging4"); this.__logFile = file; } this._logService.logStringMessage("logging5"); return this.__logFile; },
{this._logService.logStringMessage("logging2");
{ var directoryService = Components.classes["@mozilla.org/file/directory_service;1"]. getService(Components.interfaces.nsIProperties); var dir = directoryService.get("ProfD", Components.interfaces.nsIFile); var folder = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); folder.initWithPath(dir.path); folder.append("keefox"); if (!folder.exists()) folder.create(folder.DIRECTORY_TYPE, 0775);
get _logFile() {this._logService.logStringMessage("logging"); if (!this.__logFile) {this._logService.logStringMessage("logging2"); var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); //var MY_ID = "[email protected]"; //var em = Components.classes["@mozilla.org/extensions/manager;1"]. // getService(Components.interfaces.nsIExtensionManager); //var dir = em.getInstallLocation(MY_ID).getItemLocation(MY_ID); var dir = directoryService.get("ProfD", Components.interfaces.nsIFile); this._logService.logStringMessage("logging3"); file.initWithPath(dir.path); file.append("keefox"); file.append("log.txt"); this._logService.logStringMessage("logging4"); this.__logFile = file; } this._logService.logStringMessage("logging5"); return this.__logFile; },
.createInstance(Components.interfaces.nsILocalFile); var dir = directoryService.get("ProfD", Components.interfaces.nsIFile); this._logService.logStringMessage("logging3");
.createInstance(Components.interfaces.nsILocalFile);
get _logFile() {this._logService.logStringMessage("logging"); if (!this.__logFile) {this._logService.logStringMessage("logging2"); var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); //var MY_ID = "[email protected]"; //var em = Components.classes["@mozilla.org/extensions/manager;1"]. // getService(Components.interfaces.nsIExtensionManager); //var dir = em.getInstallLocation(MY_ID).getItemLocation(MY_ID); var dir = directoryService.get("ProfD", Components.interfaces.nsIFile); this._logService.logStringMessage("logging3"); file.initWithPath(dir.path); file.append("keefox"); file.append("log.txt"); this._logService.logStringMessage("logging4"); this.__logFile = file; } this._logService.logStringMessage("logging5"); return this.__logFile; },
this._logService.logStringMessage("logging4");
get _logFile() {this._logService.logStringMessage("logging"); if (!this.__logFile) {this._logService.logStringMessage("logging2"); var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); //var MY_ID = "[email protected]"; //var em = Components.classes["@mozilla.org/extensions/manager;1"]. // getService(Components.interfaces.nsIExtensionManager); //var dir = em.getInstallLocation(MY_ID).getItemLocation(MY_ID); var dir = directoryService.get("ProfD", Components.interfaces.nsIFile); this._logService.logStringMessage("logging3"); file.initWithPath(dir.path); file.append("keefox"); file.append("log.txt"); this._logService.logStringMessage("logging4"); this.__logFile = file; } this._logService.logStringMessage("logging5"); return this.__logFile; },
this._logService.logStringMessage("logging5");
get _logFile() {this._logService.logStringMessage("logging"); if (!this.__logFile) {this._logService.logStringMessage("logging2"); var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); //var MY_ID = "[email protected]"; //var em = Components.classes["@mozilla.org/extensions/manager;1"]. // getService(Components.interfaces.nsIExtensionManager); //var dir = em.getInstallLocation(MY_ID).getItemLocation(MY_ID); var dir = directoryService.get("ProfD", Components.interfaces.nsIFile); this._logService.logStringMessage("logging3"); file.initWithPath(dir.path); file.append("keefox"); file.append("log.txt"); this._logService.logStringMessage("logging4"); this.__logFile = file; } this._logService.logStringMessage("logging5"); return this.__logFile; },
get session() { let sh = window.getWebNavigation().sessionHistory; let obj = []; obj.index = sh.index; obj.__iterator__ = function () util.Array.iteritems(this); for (let i in util.range(0, sh.count)) { obj[i] = { index: i, __proto__: sh.getEntryAtIndex(i, false) }; util.memoize(obj[i], "icon", function (obj) services.get("favicon").getFaviconImageForPage(obj.URI).spec); } return obj;
get: function get(filter, maxItems) { let query = services.get("history").getNewQuery(); let options = services.get("history").getNewQueryOptions(); if (typeof filter == "string") filter = { searchTerms: filter }; for (let [k, v] in Iterator(filter)) query[k] = v; options.sortingMode = options.SORT_BY_DATE_DESCENDING; options.resultType = options.RESULTS_AS_URI; if (maxItems > 0) options.maxResults = maxItems; let root = services.get("history").executeQuery(query, options).root; root.containerOpen = true; let items = util.map(util.range(0, root.childCount), function (i) { let node = root.getChild(i); return { url: node.uri, title: node.title, icon: node.icon ? node.icon.spec : DEFAULT_FAVICON }; }); root.containerOpen = false; return items;
get session() { let sh = window.getWebNavigation().sessionHistory; let obj = []; obj.index = sh.index; obj.__iterator__ = function () util.Array.iteritems(this); for (let i in util.range(0, sh.count)) { obj[i] = { index: i, __proto__: sh.getEntryAtIndex(i, false) }; util.memoize(obj[i], "icon", function (obj) services.get("favicon").getFaviconImageForPage(obj.URI).spec); } return obj; },
get rangeFind() buffer.localStore.rangeFind,
get selection() this.selectionController.getSelection(Ci.nsISelectionController.SELECTION_NORMAL) }),
get rangeFind() buffer.localStore.rangeFind,
}
};
BF.get_position = function (obj){ var left_pos = 0, top_pos = 0; /// Does the object have an element above it (i.e., offsetParent)? if (obj.offsetParent) { do { left_pos += obj.offsetLeft; top_pos += obj.offsetTop; } while (obj = obj.offsetParent); } return {left: left_pos, top: top_pos};}
a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1;a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h);if(!i){var k=function(l){if(l.nodeType!=1)return;l.removeAttribute('id',false);l.removeAttribute('_cke_expando',false);var m=l.childNodes;for(var n=0;n<m.length;n++)k(m[n]);};k(j);}return new d.node(j);},hasPrevious:function(){return!!this.$.previousSibling;},hasNext:function(){return!!this.$.nextSibling;},insertAfter:function(h){h.$.parentNode.insertBefore(this.$,h.$.nextSibling);return h;},insertBefore:function(h){h.$.parentNode.insertBefore(this.$,h.$);return h;},insertBeforeMe:function(h){this.$.parentNode.insertBefore(h.$,this.$);return h;},getAddress:function(h){var i=[],j=this.getDocument().$.documentElement,k=this.$;while(k&&k!=j){var l=k.parentNode,m=-1;if(l){for(var n=0;n<l.childNodes.length;n++){var o=l.childNodes[n];if(h&&o.nodeType==3&&o.previousSibling&&o.previousSibling.nodeType==3)continue;m++;if(o==k)break;}i.unshift(m);}k=l;}return i;},getDocument:function(){var h=new g(this.$.ownerDocument||this.$.parentNode.ownerDocument);return(this.getDocument=function(){return h;})();},getIndex:function(){var h=this.$,i=h.parentNode&&h.parentNode.firstChild,j=-1;while(i){j++;if(i==h)return j;i=i.nextSibling;}return-1;},getNextSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getFirst&&this.getFirst(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getNext();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getNext();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&i!=l.type)return l.getNextSourceNode(false,i,j);return l;},getPreviousSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getLast&&this.getLast(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getPrevious();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getPrevious();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&l.type!=i)return l.getPreviousSourceNode(false,i,j);return l;},getPrevious:function(h){var i=this.$,j;do{i=i.previousSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;
}return this;};d.node.prototype=new d.domObject();a.NODE_ELEMENT=1;a.NODE_DOCUMENT=9;a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1;a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h);if(!i){var k=function(l){if(l.nodeType!=1)return;l.removeAttribute('id',false);l.removeAttribute('_cke_expando',false);var m=l.childNodes;for(var n=0;n<m.length;n++)k(m[n]);};k(j);}return new d.node(j);},hasPrevious:function(){return!!this.$.previousSibling;},hasNext:function(){return!!this.$.nextSibling;},insertAfter:function(h){h.$.parentNode.insertBefore(this.$,h.$.nextSibling);return h;},insertBefore:function(h){h.$.parentNode.insertBefore(this.$,h.$);return h;},insertBeforeMe:function(h){this.$.parentNode.insertBefore(h.$,this.$);return h;},getAddress:function(h){var i=[],j=this.getDocument().$.documentElement,k=this.$;while(k&&k!=j){var l=k.parentNode,m=-1;if(l){for(var n=0;n<l.childNodes.length;n++){var o=l.childNodes[n];if(h&&o.nodeType==3&&o.previousSibling&&o.previousSibling.nodeType==3)continue;m++;if(o==k)break;}i.unshift(m);}k=l;}return i;},getDocument:function(){var h=new g(this.$.ownerDocument||this.$.parentNode.ownerDocument);return(this.getDocument=function(){return h;})();},getIndex:function(){var h=this.$,i=h.parentNode&&h.parentNode.firstChild,j=-1;while(i){j++;if(i==h)return j;i=i.nextSibling;}return-1;},getNextSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getFirst&&this.getFirst(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getNext();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getNext();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&i!=l.type)return l.getNextSourceNode(false,i,j);return l;},getPreviousSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getLast&&this.getLast(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getPrevious();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getPrevious();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&l.type!=i)return l.getPreviousSourceNode(false,i,j);return l;},getPrevious:function(h){var i=this.$,j;do{i=i.previousSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;
a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1;a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h);if(!i){var k=function(l){if(l.nodeType!=1)return;l.removeAttribute('id',false);l.removeAttribute('_cke_expando',false);var m=l.childNodes;for(var n=0;n<m.length;n++)k(m[n]);};k(j);}return new d.node(j);},hasPrevious:function(){return!!this.$.previousSibling;},hasNext:function(){return!!this.$.nextSibling;},insertAfter:function(h){h.$.parentNode.insertBefore(this.$,h.$.nextSibling);return h;},insertBefore:function(h){h.$.parentNode.insertBefore(this.$,h.$);return h;},insertBeforeMe:function(h){this.$.parentNode.insertBefore(h.$,this.$);return h;},getAddress:function(h){var i=[],j=this.getDocument().$.documentElement,k=this.$;while(k&&k!=j){var l=k.parentNode,m=-1;if(l){for(var n=0;n<l.childNodes.length;n++){var o=l.childNodes[n];if(h&&o.nodeType==3&&o.previousSibling&&o.previousSibling.nodeType==3)continue;m++;if(o==k)break;}i.unshift(m);}k=l;}return i;},getDocument:function(){var h=new g(this.$.ownerDocument||this.$.parentNode.ownerDocument);return(this.getDocument=function(){return h;})();},getIndex:function(){var h=this.$,i=h.parentNode&&h.parentNode.firstChild,j=-1;while(i){j++;if(i==h)return j;i=i.nextSibling;}return-1;},getNextSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getFirst&&this.getFirst(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getNext();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getNext();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&i!=l.type)return l.getNextSourceNode(false,i,j);return l;},getPreviousSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return!n.equals(k);};}var l=!h&&this.getLast&&this.getLast(),m;if(!l){if(this.type==1&&j&&j(this,true)===false)return null;l=this.getPrevious();}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false)return null;l=m.getPrevious();}if(!l)return null;if(j&&j(l)===false)return null;if(i&&l.type!=i)return l.getPreviousSourceNode(false,i,j);return l;},getPrevious:function(h){var i=this.$,j;do{i=i.previousSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;
},getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null;},getParents:function(h){var i=this,j=[];do j[h?'push':'unshift'](i);while(i=i.getParent())return j;},getCommonAncestor:function(h){var j=this;if(h.equals(j))return j;if(h.contains&&h.contains(j))return h;var i=j.contains?j:j.getParent();do{if(i.contains(h))return i;}while(i=i.getParent())return null;},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition)return i.compareDocumentPosition(j);if(i==j)return 0;if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j))return 16+4;if(j.contains(i))return 8+2;}if('sourceIndex' in i)return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex<j.sourceIndex?4:2;}var k=this.getAddress(),l=h.getAddress(),m=Math.min(k.length,l.length);for(var n=0;n<=m-1;n++){if(k[n]!=l[n]){if(n<m)return k[n]<l[n]?4:2;break;}}return k.length<l.length?16+4:8+2;},getAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return new d.node(j);j=j.parentNode;}return null;},hasAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return true;j=j.parentNode;}return false;},move:function(h,i){h.append(this.remove(),i);},remove:function(h){var i=this.$,j=i.parentNode;if(j){if(h)for(var k;k=i.firstChild;)j.insertBefore(i.removeChild(k),i);j.removeChild(i);}return this;},replace:function(h){this.insertBefore(h);h.remove();},trim:function(){this.ltrim();this.rtrim();},ltrim:function(){var k=this;var h;while(k.getFirst&&(h=k.getFirst())){if(h.type==3){var i=e.ltrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(j-i.length);k.$.removeChild(k.$.firstChild);}}break;}},rtrim:function(){var k=this;var h;while(k.getLast&&(h=k.getLast())){if(h.type==3){var i=e.rtrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(i.length);k.$.lastChild.parentNode.removeChild(k.$.lastChild);}}break;}if(!c&&!b.opera){h=k.$.lastChild;if(h&&h.type==1&&h.nodeName.toLowerCase()=='br')h.parentNode.removeChild(h);}}});d.nodeList=function(h){this.$=h;};d.nodeList.prototype={count:function(){return this.$.length;},getItem:function(h){var i=this.$[h];return i?new d.node(i):null;}};d.element=function(h,i){if(typeof h=='string')h=(i?i.$:document).createElement(h);d.domObject.call(this,h);};var h=d.element;h.get=function(i){return i&&(i.$?i:new h(i));};h.prototype=new d.node();h.createFromHtml=function(i,j){var k=new h('div',j);
},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;},getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null;},getParents:function(h){var i=this,j=[];do j[h?'push':'unshift'](i);while(i=i.getParent())return j;},getCommonAncestor:function(h){var j=this;if(h.equals(j))return j;if(h.contains&&h.contains(j))return h;var i=j.contains?j:j.getParent();do{if(i.contains(h))return i;}while(i=i.getParent())return null;},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition)return i.compareDocumentPosition(j);if(i==j)return 0;if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j))return 16+4;if(j.contains(i))return 8+2;}if('sourceIndex' in i)return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex<j.sourceIndex?4:2;}var k=this.getAddress(),l=h.getAddress(),m=Math.min(k.length,l.length);for(var n=0;n<=m-1;n++){if(k[n]!=l[n]){if(n<m)return k[n]<l[n]?4:2;break;}}return k.length<l.length?16+4:8+2;},getAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return new d.node(j);j=j.parentNode;}return null;},hasAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return true;j=j.parentNode;}return false;},move:function(h,i){h.append(this.remove(),i);},remove:function(h){var i=this.$,j=i.parentNode;if(j){if(h)for(var k;k=i.firstChild;)j.insertBefore(i.removeChild(k),i);j.removeChild(i);}return this;},replace:function(h){this.insertBefore(h);h.remove();},trim:function(){this.ltrim();this.rtrim();},ltrim:function(){var k=this;var h;while(k.getFirst&&(h=k.getFirst())){if(h.type==3){var i=e.ltrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(j-i.length);k.$.removeChild(k.$.firstChild);}}break;}},rtrim:function(){var k=this;var h;while(k.getLast&&(h=k.getLast())){if(h.type==3){var i=e.rtrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(i.length);k.$.lastChild.parentNode.removeChild(k.$.lastChild);}}break;}if(!c&&!b.opera){h=k.$.lastChild;if(h&&h.type==1&&h.nodeName.toLowerCase()=='br')h.parentNode.removeChild(h);}},isReadOnly:function(){var h=this;while(h){if(h.type==1){if(h.is('body')||h.getCustomData('_cke_notReadOnly'))break;if(h.getAttribute('contentEditable')=='false')return h;else if(h.getAttribute('contentEditable')=='true')break;}h=h.getParent();}return false;}});d.nodeList=function(h){this.$=h;
},getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null;},getParents:function(h){var i=this,j=[];do j[h?'push':'unshift'](i);while(i=i.getParent())return j;},getCommonAncestor:function(h){var j=this;if(h.equals(j))return j;if(h.contains&&h.contains(j))return h;var i=j.contains?j:j.getParent();do{if(i.contains(h))return i;}while(i=i.getParent())return null;},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition)return i.compareDocumentPosition(j);if(i==j)return 0;if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j))return 16+4;if(j.contains(i))return 8+2;}if('sourceIndex' in i)return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex<j.sourceIndex?4:2;}var k=this.getAddress(),l=h.getAddress(),m=Math.min(k.length,l.length);for(var n=0;n<=m-1;n++){if(k[n]!=l[n]){if(n<m)return k[n]<l[n]?4:2;break;}}return k.length<l.length?16+4:8+2;},getAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return new d.node(j);j=j.parentNode;}return null;},hasAscendant:function(h,i){var j=this.$;if(!i)j=j.parentNode;while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h)return true;j=j.parentNode;}return false;},move:function(h,i){h.append(this.remove(),i);},remove:function(h){var i=this.$,j=i.parentNode;if(j){if(h)for(var k;k=i.firstChild;)j.insertBefore(i.removeChild(k),i);j.removeChild(i);}return this;},replace:function(h){this.insertBefore(h);h.remove();},trim:function(){this.ltrim();this.rtrim();},ltrim:function(){var k=this;var h;while(k.getFirst&&(h=k.getFirst())){if(h.type==3){var i=e.ltrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(j-i.length);k.$.removeChild(k.$.firstChild);}}break;}},rtrim:function(){var k=this;var h;while(k.getLast&&(h=k.getLast())){if(h.type==3){var i=e.rtrim(h.getText()),j=h.getLength();if(!i){h.remove();continue;}else if(i.length<j){h.split(i.length);k.$.lastChild.parentNode.removeChild(k.$.lastChild);}}break;}if(!c&&!b.opera){h=k.$.lastChild;if(h&&h.type==1&&h.nodeName.toLowerCase()=='br')h.parentNode.removeChild(h);}}});d.nodeList=function(h){this.$=h;};d.nodeList.prototype={count:function(){return this.$.length;},getItem:function(h){var i=this.$[h];return i?new d.node(i):null;}};d.element=function(h,i){if(typeof h=='string')h=(i?i.$:document).createElement(h);d.domObject.call(this,h);};var h=d.element;h.get=function(i){return i&&(i.$?i:new h(i));};h.prototype=new d.node();h.createFromHtml=function(i,j){var k=new h('div',j);
if (str.startsWith("][")) { if ((str[2] >= '1' && str[2] <= '9') || str[2] === '"') return {len: 2, token: "bar_invisible"}; return {len: 0}; } if (str.startsWith("]")) return {len: 1, token: "bar_invisible"};
this.getBarLine = function(str) { if (str[0] !== ':' && str[0] !== '|' && str[0] !== '[' && str[0] !== ']') return {len: 0}; if (str.startsWith("]|")) return {len: 2, token: "bar_thick_thin"}; if (str.startsWith(":||:")) return {len: 4, token: "bar_dbl_repeat"}; if (str.startsWith(":|]|:")) return {len: 5, token: "bar_dbl_repeat"}; if (str.startsWith(":|]")) return {len: 3, token: "bar_right_repeat"}; if (str.startsWith(":||")) return {len: 3, token: "bar_right_repeat"}; if (str.startsWith(":|")) return {len: 2, token: "bar_right_repeat"}; if (str.startsWith("::")) return {len: 2, token: "bar_dbl_repeat"}; if (str.startsWith("[|:")) return {len: 3, token: "bar_left_repeat"}; if (str.startsWith("[|]")) return {len: 3, token: "bar_invisible"}; if (str.startsWith("[|")) return {len: 2, token: "bar_thick_thin"}; if (str.startsWith("[")) { if ((str[1] >= '1' && str[1] <= '9') || str[1] === '"') return {len: 1, token: "bar_invisible"}; return {len: 0}; } if (str.startsWith("||:")) return {len: 3, token: "bar_left_repeat"}; if (str.startsWith("|:::::")) return {len: 6, token: "bar_left_repeat"}; if (str.startsWith("|::::")) return {len: 5, token: "bar_left_repeat"}; if (str.startsWith("|:::")) return {len: 4, token: "bar_left_repeat"}; if (str.startsWith("|::")) return {len: 3, token: "bar_left_repeat"}; if (str.startsWith("|:")) return {len: 2, token: "bar_left_repeat"}; if (str.startsWith("||")) return {len: 2, token: "bar_thin_thin"}; if (str.startsWith("|]")) return {len: 2, token: "bar_thin_thick"};// if (str.startsWith("|[")) return { len: 2, token: "bar_thin_thick" }; if (str.startsWith("|")) return {len: 1, token: "bar_thin"}; return {len: 1, warn: "Unknown bar symbol"}; };
switch (line[i]) { case ']':
switch (line[i]) { case ']': ++i; switch (line[i]) { case '|': return {len: 2, token: "bar_thick_thin"}; case '[': ++i; if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 2, token: "bar_invisible"}; return {len: 1, warn: "Unknown bar symbol"}; default: return {len: 1, token: "bar_invisible"}; } break; case ':': ++i; switch (line[i]) { case ':': return {len: 2, token: "bar_dbl_repeat"}; case '|': ++i; switch (line[i]) { case ']': ++i; switch (line[i]) { case '|': ++i; if (line[i] === ':') return {len: 5, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; default: return {len: 3, token: "bar_right_repeat"}; } break; case '|': ++i; if (line[i] === ':') return {len: 4, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; default: return {len: 2, token: "bar_right_repeat"}; } break; default: return {len: 1, warn: "Unknown bar symbol"}; } break; case '[': ++i; if (line[i] === '|') {
this.getBarLine = function(line, i) { switch (line[i]) { case ']': ++i; switch (line[i]) { case '|': return {len: 2, token: "bar_thick_thin"}; case '[': ++i; if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 2, token: "bar_invisible"}; return {len: 1, warn: "Unknown bar symbol"}; default: return {len: 1, token: "bar_invisible"}; } break; case ':': ++i; switch (line[i]) { case ':': return {len: 2, token: "bar_dbl_repeat"}; case '|': // :| ++i; switch (line[i]) { case ']': // :|] ++i; switch (line[i]) { case '|': // :|]| ++i; if (line[i] === ':') return {len: 5, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; default: return {len: 3, token: "bar_right_repeat"}; } break; case '|': // :|| ++i; if (line[i] === ':') return {len: 4, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; break; default: return {len: 2, token: "bar_right_repeat"}; } default: return {len: 1, warn: "Unknown bar symbol"}; } break; case '[': // [ ++i; if (line[i] === '|') { // [| ++i; switch (line[i]) { case ':': return {len: 3, token: "bar_left_repeat"}; case ']': return {len: 3, token: "bar_invisible"}; default: return {len: 2, token: "bar_thick_thin"}; } } else { if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 1, token: "bar_invisible"}; return {len: 0}; } break; case '|': // | ++i; switch (line[i]) { case ']': return {len: 2, token: "bar_thin_thick"}; case '|': // || ++i; if (line[i] === ':') return {len: 3, token: "bar_left_repeat"}; return {len: 2, token: "bar_thin_thin"}; case ':': // |: var colons = 0; while (line[i+colons] === ':') colons++; return { len: 1+colons, token: "bar_left_repeat"}; default: return {len: 1, token: "bar_thin"}; } break; } return {len: 0}; };
case '|': return {len: 2, token: "bar_thick_thin"}; case '[': ++i; if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 2, token: "bar_invisible"}; return {len: 1, warn: "Unknown bar symbol"}; default: return {len: 1, token: "bar_invisible"};
case ':': return {len: 3, token: "bar_left_repeat"}; case ']': return {len: 3, token: "bar_invisible"}; default: return {len: 2, token: "bar_thick_thin"};
this.getBarLine = function(line, i) { switch (line[i]) { case ']': ++i; switch (line[i]) { case '|': return {len: 2, token: "bar_thick_thin"}; case '[': ++i; if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 2, token: "bar_invisible"}; return {len: 1, warn: "Unknown bar symbol"}; default: return {len: 1, token: "bar_invisible"}; } break; case ':': ++i; switch (line[i]) { case ':': return {len: 2, token: "bar_dbl_repeat"}; case '|': // :| ++i; switch (line[i]) { case ']': // :|] ++i; switch (line[i]) { case '|': // :|]| ++i; if (line[i] === ':') return {len: 5, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; default: return {len: 3, token: "bar_right_repeat"}; } break; case '|': // :|| ++i; if (line[i] === ':') return {len: 4, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; break; default: return {len: 2, token: "bar_right_repeat"}; } default: return {len: 1, warn: "Unknown bar symbol"}; } break; case '[': // [ ++i; if (line[i] === '|') { // [| ++i; switch (line[i]) { case ':': return {len: 3, token: "bar_left_repeat"}; case ']': return {len: 3, token: "bar_invisible"}; default: return {len: 2, token: "bar_thick_thin"}; } } else { if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 1, token: "bar_invisible"}; return {len: 0}; } break; case '|': // | ++i; switch (line[i]) { case ']': return {len: 2, token: "bar_thin_thick"}; case '|': // || ++i; if (line[i] === ':') return {len: 3, token: "bar_left_repeat"}; return {len: 2, token: "bar_thin_thin"}; case ':': // |: var colons = 0; while (line[i+colons] === ':') colons++; return { len: 1+colons, token: "bar_left_repeat"}; default: return {len: 1, token: "bar_thin"}; } break; } return {len: 0}; };
break; case ':': ++i; switch (line[i]) { case ':': return {len: 2, token: "bar_dbl_repeat"}; case '|': ++i; switch (line[i]) { case ']': ++i; switch (line[i]) { case '|': ++i; if (line[i] === ':') return {len: 5, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; default: return {len: 3, token: "bar_right_repeat"}; } break; case '|': ++i; if (line[i] === ':') return {len: 4, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; break; default: return {len: 2, token: "bar_right_repeat"}; } default: return {len: 1, warn: "Unknown bar symbol"}; } break; case '[': ++i; if (line[i] === '|') {
} else { if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 1, token: "bar_invisible"}; return {len: 0}; } break; case '|': ++i; switch (line[i]) { case ']': return {len: 2, token: "bar_thin_thick"}; case '|':
this.getBarLine = function(line, i) { switch (line[i]) { case ']': ++i; switch (line[i]) { case '|': return {len: 2, token: "bar_thick_thin"}; case '[': ++i; if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 2, token: "bar_invisible"}; return {len: 1, warn: "Unknown bar symbol"}; default: return {len: 1, token: "bar_invisible"}; } break; case ':': ++i; switch (line[i]) { case ':': return {len: 2, token: "bar_dbl_repeat"}; case '|': // :| ++i; switch (line[i]) { case ']': // :|] ++i; switch (line[i]) { case '|': // :|]| ++i; if (line[i] === ':') return {len: 5, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; default: return {len: 3, token: "bar_right_repeat"}; } break; case '|': // :|| ++i; if (line[i] === ':') return {len: 4, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; break; default: return {len: 2, token: "bar_right_repeat"}; } default: return {len: 1, warn: "Unknown bar symbol"}; } break; case '[': // [ ++i; if (line[i] === '|') { // [| ++i; switch (line[i]) { case ':': return {len: 3, token: "bar_left_repeat"}; case ']': return {len: 3, token: "bar_invisible"}; default: return {len: 2, token: "bar_thick_thin"}; } } else { if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 1, token: "bar_invisible"}; return {len: 0}; } break; case '|': // | ++i; switch (line[i]) { case ']': return {len: 2, token: "bar_thin_thick"}; case '|': // || ++i; if (line[i] === ':') return {len: 3, token: "bar_left_repeat"}; return {len: 2, token: "bar_thin_thin"}; case ':': // |: var colons = 0; while (line[i+colons] === ':') colons++; return { len: 1+colons, token: "bar_left_repeat"}; default: return {len: 1, token: "bar_thin"}; } break; } return {len: 0}; };
switch (line[i]) { case ':': return {len: 3, token: "bar_left_repeat"}; case ']': return {len: 3, token: "bar_invisible"}; default: return {len: 2, token: "bar_thick_thin"}; } } else { if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 1, token: "bar_invisible"}; return {len: 0}; } break; case '|': ++i; switch (line[i]) { case ']': return {len: 2, token: "bar_thin_thick"}; case '|': ++i; if (line[i] === ':') return {len: 3, token: "bar_left_repeat"}; return {len: 2, token: "bar_thin_thin"}; case ':': var colons = 0; while (line[i+colons] === ':') colons++; return { len: 1+colons, token: "bar_left_repeat"}; default: return {len: 1, token: "bar_thin"}; } break; } return {len: 0}; };
if (line[i] === ':') return {len: 3, token: "bar_left_repeat"}; return {len: 2, token: "bar_thin_thin"}; case ':': var colons = 0; while (line[i+colons] === ':') colons++; return { len: 1+colons, token: "bar_left_repeat"}; default: return {len: 1, token: "bar_thin"}; } break; } return {len: 0}; };
this.getBarLine = function(line, i) { switch (line[i]) { case ']': ++i; switch (line[i]) { case '|': return {len: 2, token: "bar_thick_thin"}; case '[': ++i; if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 2, token: "bar_invisible"}; return {len: 1, warn: "Unknown bar symbol"}; default: return {len: 1, token: "bar_invisible"}; } break; case ':': ++i; switch (line[i]) { case ':': return {len: 2, token: "bar_dbl_repeat"}; case '|': // :| ++i; switch (line[i]) { case ']': // :|] ++i; switch (line[i]) { case '|': // :|]| ++i; if (line[i] === ':') return {len: 5, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; default: return {len: 3, token: "bar_right_repeat"}; } break; case '|': // :|| ++i; if (line[i] === ':') return {len: 4, token: "bar_dbl_repeat"}; return {len: 3, token: "bar_right_repeat"}; break; default: return {len: 2, token: "bar_right_repeat"}; } default: return {len: 1, warn: "Unknown bar symbol"}; } break; case '[': // [ ++i; if (line[i] === '|') { // [| ++i; switch (line[i]) { case ':': return {len: 3, token: "bar_left_repeat"}; case ']': return {len: 3, token: "bar_invisible"}; default: return {len: 2, token: "bar_thick_thin"}; } } else { if ((line[i] >= '1' && line[i] <= '9') || line[i] === '"') return {len: 1, token: "bar_invisible"}; return {len: 0}; } break; case '|': // | ++i; switch (line[i]) { case ']': return {len: 2, token: "bar_thin_thick"}; case '|': // || ++i; if (line[i] === ':') return {len: 3, token: "bar_left_repeat"}; return {len: 2, token: "bar_thin_thin"}; case ':': // |: var colons = 0; while (line[i+colons] === ':') colons++; return { len: 1+colons, token: "bar_left_repeat"}; default: return {len: 1, token: "bar_thin"}; } break; } return {len: 0}; };
if ( this.bookmarkable ) { var searchType = this.getSearchType(this.searchTypeButton.value); return searchType.getBookmarkHandler.call(this, this); } else { return null; }
var searchType = this.getSearchType(this.searchTypeButton.value); return searchType.getBookmarkHandler.call(this, this);
getBookmark : function() { if ( this.bookmarkable ) { var searchType = this.getSearchType(this.searchTypeButton.value); return searchType.getBookmarkHandler.call(this, this); } else { return null; } }
return searchType.getBookmarkHandler.call(this, this);
var bookmark = searchType.getBookmarkHandler.call(this, this); if ( this.extraData ) { var extras = this.extraData.split( ',' ); if ( extras.length > 0 ) { bookmark += '~'; for ( var i = 0 ; i < extras.length ; i++ ) { if ( i > 0 ) { bookmark += ','; } bookmark += extras[i]; } } } return bookmark;
getBookmark : function() { var searchType = this.getSearchType(this.searchTypeButton.value); return searchType.getBookmarkHandler.call(this, this); }
u.endOffset=u.startOffset;}else{u.startContainer=u.endContainer;u.startOffset=u.endOffset;}u.collapsed=true;},cloneContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,t);return t;},deleteContents:function(){if(this.collapsed)return;m(this,0);},extractContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,t);return t;},createBookmark:function(t){var y=this;var u,v,w,x;u=y.document.createElement('span');u.setAttribute('_fck_bookmark',1);u.setStyle('display','none');u.setHtml('&nbsp;');if(t){w='cke_bm_'+e.getNextNumber();u.setAttribute('id',w+'S');}if(!y.collapsed){v=u.clone();v.setHtml('&nbsp;');if(t)v.setAttribute('id',w+'E');x=y.clone();x.collapse();x.insertNode(v);}x=y.clone();x.collapse(true);x.insertNode(u);if(v){y.setStartAfter(u);y.setEndBefore(v);}else y.moveToPosition(u,4);return{startNode:t?w+'S':u,endNode:t?w+'E':v,serializable:t};},createBookmark2:function(t){var A=this;var u=A.startContainer,v=A.endContainer,w=A.startOffset,x=A.endOffset,y,z;if(!u||!v)return{start:0,end:0};if(t){if(u.type==1){y=u.getChild(w);if(y&&y.type==3&&w>0&&y.getPrevious().type==3){u=y;w=0;}}while(u.type==3&&(z=u.getPrevious())&&z.type==3){u=z;w+=z.getLength();}if(!A.isCollapsed){if(v.type==1){y=v.getChild(x);if(y&&y.type==3&&x>0&&y.getPrevious().type==3){v=y;x=0;}}while(v.type==3&&(z=v.getPrevious())&&z.type==3){v=z;x+=z.getLength();}}}return{start:u.getAddress(t),end:A.isCollapsed?null:v.getAddress(t),startOffset:w,endOffset:x,normalized:t,is2:true};},moveToBookmark:function(t){var B=this;if(t.is2){var u=B.document.getByAddress(t.start,t.normalized),v=t.startOffset,w=t.end&&B.document.getByAddress(t.end,t.normalized),x=t.endOffset;B.setStart(u,v);if(w)B.setEnd(w,x);else B.collapse(true);}else{var y=t.serializable,z=y?B.document.getById(t.startNode):t.startNode,A=y?B.document.getById(t.endNode):t.endNode;B.setStartBefore(z);z.remove();if(A){B.setEndBefore(A);A.remove();}else B.collapse(true);}},getBoundaryNodes:function(){var y=this;var t=y.startContainer,u=y.endContainer,v=y.startOffset,w=y.endOffset,x;if(t.type==1){x=t.getChildCount();if(x>v)t=t.getChild(v);else if(x<1)t=t.getPreviousSourceNode();else{t=t.$;while(t.lastChild)t=t.lastChild;t=new d.node(t);t=t.getNextSourceNode()||t;}}if(u.type==1){x=u.getChildCount();if(x>w)u=u.getChild(w).getPreviousSourceNode(true);else if(x<1)u=u.getPreviousSourceNode();else{u=u.$;while(u.lastChild)u=u.lastChild;u=new d.node(u);}}if(t.getPosition(u)&2)t=u;return{startNode:t,endNode:u}; },getCommonAncestor:function(t,u){var y=this;var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1)x=v.getChild(y.startOffset);else x=v;}else x=v.getCommonAncestor(w);return u&&!x.is?x.getParent():x;},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1)if(!u)v.setStartBefore(t);else if(u>=t.getLength())v.setStartAfter(t);t=v.endContainer;u=v.endOffset;if(t.type!=1)if(!u)v.setEndBefore(t);else if(u>=t.getLength())v.setEndAfter(t);},optimizeBookmark:function(){var v=this;var t=v.startContainer,u=v.endContainer;if(t.is&&t.is('span')&&t.hasAttribute('_fck_bookmark'))v.setStartAt(t,3);if(u&&u.is&&u.is('span')&&u.hasAttribute('_fck_bookmark'))v.setEndAt(u,4);},trim:function(t,u){var B=this;var v=B.startContainer,w=B.startOffset,x=B.collapsed;if((!t||x)&&v&&v.type==3){if(!w){w=v.getIndex();v=v.getParent();}else if(w>=v.getLength()){w=v.getIndex()+1;v=v.getParent();}else{var y=v.split(w);w=v.getIndex()+1;v=v.getParent();if(B.startContainer.equals(B.endContainer))B.setEnd(y,B.endOffset-B.startOffset);else if(v.equals(B.endContainer))B.endOffset+=1;}B.setStart(v,w);if(x){B.collapse(true);return;}}var z=B.endContainer,A=B.endOffset;if(!(u||x)&&z&&z.type==3){if(!A){A=z.getIndex();z=z.getParent();}else if(A>=z.getLength()){A=z.getIndex()+1;z=z.getParent();}else{z.split(A);A=z.getIndex()+1;z=z.getParent();}B.setEnd(z,A);}},enlarge:function(t){switch(t){case 1:if(this.collapsed)return;var u=this.getCommonAncestor(),v=this.document.getBody(),w,x,y,z,A,B=false,C,D,E=this.startContainer,F=this.startOffset;if(E.type==3){if(F){E=!e.trim(E.substring(0,F)).length&&E;B=!!E;}if(E)if(!(z=E.getPrevious()))y=E.getParent();}else{if(F)z=E.getChild(F-1)||E.getLast();if(!z)y=E;}while(y||z){if(y&&!z){if(!A&&y.equals(u))A=true;if(!v.contains(y))break;if(!B||y.getComputedStyle('display')!='inline'){B=false;if(A)w=y;else this.setStartBefore(y);}z=y.getPrevious();}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;C=/[\s\ufeff]$/.test(D);}else if(z.$.offsetWidth>0&&!z.getAttribute('_fck_bookmark'))if(B&&f.$removeEmpty[z.getName()]){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;else{var G=z.$.all||z.$.getElementsByTagName('*');for(var H=0,I;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break;}}}if(z)C=!!D.length;}else z=null;if(C)if(B){if(A)w=y;else if(y)this.setStartBefore(y);}else B=true;if(z){var J=z.getPrevious();if(!y&&!J){y=z;z=null;break;}z=J;}else y=null;}if(y)y=y.getParent();
u.endOffset=u.startOffset;}else{u.startContainer=u.endContainer;u.startOffset=u.endOffset;}u.collapsed=true;},cloneContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,t);return t;},deleteContents:function(){if(this.collapsed)return;m(this,0);},extractContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,t);return t;},createBookmark:function(t){var z=this;var u,v,w,x,y=z.collapsed;u=z.document.createElement('span');u.setAttribute('_cke_bookmark',1);u.setStyle('display','none');u.setHtml('&nbsp;');if(t){w='cke_bm_'+e.getNextNumber();u.setAttribute('id',w+'S');}if(!y){v=u.clone();v.setHtml('&nbsp;');if(t)v.setAttribute('id',w+'E');x=z.clone();x.collapse();x.insertNode(v);}x=z.clone();x.collapse(true);x.insertNode(u);if(v){z.setStartAfter(u);z.setEndBefore(v);}else z.moveToPosition(u,4);return{startNode:t?w+'S':u,endNode:t?w+'E':v,serializable:t,collapsed:y};},createBookmark2:function(t){var B=this;var u=B.startContainer,v=B.endContainer,w=B.startOffset,x=B.endOffset,y=B.collapsed,z,A;if(!u||!v)return{start:0,end:0};if(t){if(u.type==1){z=u.getChild(w);if(z&&z.type==3&&w>0&&z.getPrevious().type==3){u=z;w=0;}}while(u.type==3&&(A=u.getPrevious())&&A.type==3){u=A;w+=A.getLength();}if(!y){if(v.type==1){z=v.getChild(x);if(z&&z.type==3&&x>0&&z.getPrevious().type==3){v=z;x=0;}}while(v.type==3&&(A=v.getPrevious())&&A.type==3){v=A;x+=A.getLength();}}}return{start:u.getAddress(t),end:y?null:v.getAddress(t),startOffset:w,endOffset:x,normalized:t,collapsed:y,is2:true};},moveToBookmark:function(t){var B=this;if(t.is2){var u=B.document.getByAddress(t.start,t.normalized),v=t.startOffset,w=t.end&&B.document.getByAddress(t.end,t.normalized),x=t.endOffset;B.setStart(u,v);if(w)B.setEnd(w,x);else B.collapse(true);}else{var y=t.serializable,z=y?B.document.getById(t.startNode):t.startNode,A=y?B.document.getById(t.endNode):t.endNode;B.setStartBefore(z);z.remove();if(A){B.setEndBefore(A);A.remove();}else B.collapse(true);}},getBoundaryNodes:function(){var y=this;var t=y.startContainer,u=y.endContainer,v=y.startOffset,w=y.endOffset,x;if(t.type==1){x=t.getChildCount();if(x>v)t=t.getChild(v);else if(x<1)t=t.getPreviousSourceNode();else{t=t.$;while(t.lastChild)t=t.lastChild;t=new d.node(t);t=t.getNextSourceNode()||t;}}if(u.type==1){x=u.getChildCount();if(x>w)u=u.getChild(w).getPreviousSourceNode(true);else if(x<1)u=u.getPreviousSourceNode();else{u=u.$;while(u.lastChild)u=u.lastChild;u=new d.node(u);}}if(t.getPosition(u)&2)t=u; return{startNode:t,endNode:u};},getCommonAncestor:function(t,u){var y=this;var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1)x=v.getChild(y.startOffset);else x=v;}else x=v.getCommonAncestor(w);return u&&!x.is?x.getParent():x;},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1)if(!u)v.setStartBefore(t);else if(u>=t.getLength())v.setStartAfter(t);t=v.endContainer;u=v.endOffset;if(t.type!=1)if(!u)v.setEndBefore(t);else if(u>=t.getLength())v.setEndAfter(t);},optimizeBookmark:function(){var v=this;var t=v.startContainer,u=v.endContainer;if(t.is&&t.is('span')&&t.hasAttribute('_cke_bookmark'))v.setStartAt(t,3);if(u&&u.is&&u.is('span')&&u.hasAttribute('_cke_bookmark'))v.setEndAt(u,4);},trim:function(t,u){var B=this;var v=B.startContainer,w=B.startOffset,x=B.collapsed;if((!t||x)&&v&&v.type==3){if(!w){w=v.getIndex();v=v.getParent();}else if(w>=v.getLength()){w=v.getIndex()+1;v=v.getParent();}else{var y=v.split(w);w=v.getIndex()+1;v=v.getParent();if(B.startContainer.equals(B.endContainer))B.setEnd(y,B.endOffset-B.startOffset);else if(v.equals(B.endContainer))B.endOffset+=1;}B.setStart(v,w);if(x){B.collapse(true);return;}}var z=B.endContainer,A=B.endOffset;if(!(u||x)&&z&&z.type==3){if(!A){A=z.getIndex();z=z.getParent();}else if(A>=z.getLength()){A=z.getIndex()+1;z=z.getParent();}else{z.split(A);A=z.getIndex()+1;z=z.getParent();}B.setEnd(z,A);}},enlarge:function(t){switch(t){case 1:if(this.collapsed)return;var u=this.getCommonAncestor(),v=this.document.getBody(),w,x,y,z,A,B=false,C,D,E=this.startContainer,F=this.startOffset;if(E.type==3){if(F){E=!e.trim(E.substring(0,F)).length&&E;B=!!E;}if(E)if(!(z=E.getPrevious()))y=E.getParent();}else{if(F)z=E.getChild(F-1)||E.getLast();if(!z)y=E;}while(y||z){if(y&&!z){if(!A&&y.equals(u))A=true;if(!v.contains(y))break;if(!B||y.getComputedStyle('display')!='inline'){B=false;if(A)w=y;else this.setStartBefore(y);}z=y.getPrevious();}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;C=/[\s\ufeff]$/.test(D);}else if(z.$.offsetWidth>0&&!z.getAttribute('_cke_bookmark'))if(B&&f.$removeEmpty[z.getName()]){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;else{var G=z.$.all||z.$.getElementsByTagName('*');for(var H=0,I;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break;}}}if(z)C=!!D.length;}else z=null;if(C)if(B){if(A)w=y;else if(y)this.setStartBefore(y);}else B=true;if(z){var J=z.getPrevious();if(!y&&!J){y=z;z=null;break;
u.endOffset=u.startOffset;}else{u.startContainer=u.endContainer;u.startOffset=u.endOffset;}u.collapsed=true;},cloneContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,t);return t;},deleteContents:function(){if(this.collapsed)return;m(this,0);},extractContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,t);return t;},createBookmark:function(t){var y=this;var u,v,w,x;u=y.document.createElement('span');u.setAttribute('_fck_bookmark',1);u.setStyle('display','none');u.setHtml('&nbsp;');if(t){w='cke_bm_'+e.getNextNumber();u.setAttribute('id',w+'S');}if(!y.collapsed){v=u.clone();v.setHtml('&nbsp;');if(t)v.setAttribute('id',w+'E');x=y.clone();x.collapse();x.insertNode(v);}x=y.clone();x.collapse(true);x.insertNode(u);if(v){y.setStartAfter(u);y.setEndBefore(v);}else y.moveToPosition(u,4);return{startNode:t?w+'S':u,endNode:t?w+'E':v,serializable:t};},createBookmark2:function(t){var A=this;var u=A.startContainer,v=A.endContainer,w=A.startOffset,x=A.endOffset,y,z;if(!u||!v)return{start:0,end:0};if(t){if(u.type==1){y=u.getChild(w);if(y&&y.type==3&&w>0&&y.getPrevious().type==3){u=y;w=0;}}while(u.type==3&&(z=u.getPrevious())&&z.type==3){u=z;w+=z.getLength();}if(!A.isCollapsed){if(v.type==1){y=v.getChild(x);if(y&&y.type==3&&x>0&&y.getPrevious().type==3){v=y;x=0;}}while(v.type==3&&(z=v.getPrevious())&&z.type==3){v=z;x+=z.getLength();}}}return{start:u.getAddress(t),end:A.isCollapsed?null:v.getAddress(t),startOffset:w,endOffset:x,normalized:t,is2:true};},moveToBookmark:function(t){var B=this;if(t.is2){var u=B.document.getByAddress(t.start,t.normalized),v=t.startOffset,w=t.end&&B.document.getByAddress(t.end,t.normalized),x=t.endOffset;B.setStart(u,v);if(w)B.setEnd(w,x);else B.collapse(true);}else{var y=t.serializable,z=y?B.document.getById(t.startNode):t.startNode,A=y?B.document.getById(t.endNode):t.endNode;B.setStartBefore(z);z.remove();if(A){B.setEndBefore(A);A.remove();}else B.collapse(true);}},getBoundaryNodes:function(){var y=this;var t=y.startContainer,u=y.endContainer,v=y.startOffset,w=y.endOffset,x;if(t.type==1){x=t.getChildCount();if(x>v)t=t.getChild(v);else if(x<1)t=t.getPreviousSourceNode();else{t=t.$;while(t.lastChild)t=t.lastChild;t=new d.node(t);t=t.getNextSourceNode()||t;}}if(u.type==1){x=u.getChildCount();if(x>w)u=u.getChild(w).getPreviousSourceNode(true);else if(x<1)u=u.getPreviousSourceNode();else{u=u.$;while(u.lastChild)u=u.lastChild;u=new d.node(u);}}if(t.getPosition(u)&2)t=u;return{startNode:t,endNode:u};},getCommonAncestor:function(t,u){var y=this;var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1)x=v.getChild(y.startOffset);else x=v;}else x=v.getCommonAncestor(w);return u&&!x.is?x.getParent():x;},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1)if(!u)v.setStartBefore(t);else if(u>=t.getLength())v.setStartAfter(t);t=v.endContainer;u=v.endOffset;if(t.type!=1)if(!u)v.setEndBefore(t);else if(u>=t.getLength())v.setEndAfter(t);},optimizeBookmark:function(){var v=this;var t=v.startContainer,u=v.endContainer;if(t.is&&t.is('span')&&t.hasAttribute('_fck_bookmark'))v.setStartAt(t,3);if(u&&u.is&&u.is('span')&&u.hasAttribute('_fck_bookmark'))v.setEndAt(u,4);},trim:function(t,u){var B=this;var v=B.startContainer,w=B.startOffset,x=B.collapsed;if((!t||x)&&v&&v.type==3){if(!w){w=v.getIndex();v=v.getParent();}else if(w>=v.getLength()){w=v.getIndex()+1;v=v.getParent();}else{var y=v.split(w);w=v.getIndex()+1;v=v.getParent();if(B.startContainer.equals(B.endContainer))B.setEnd(y,B.endOffset-B.startOffset);else if(v.equals(B.endContainer))B.endOffset+=1;}B.setStart(v,w);if(x){B.collapse(true);return;}}var z=B.endContainer,A=B.endOffset;if(!(u||x)&&z&&z.type==3){if(!A){A=z.getIndex();z=z.getParent();}else if(A>=z.getLength()){A=z.getIndex()+1;z=z.getParent();}else{z.split(A);A=z.getIndex()+1;z=z.getParent();}B.setEnd(z,A);}},enlarge:function(t){switch(t){case 1:if(this.collapsed)return;var u=this.getCommonAncestor(),v=this.document.getBody(),w,x,y,z,A,B=false,C,D,E=this.startContainer,F=this.startOffset;if(E.type==3){if(F){E=!e.trim(E.substring(0,F)).length&&E;B=!!E;}if(E)if(!(z=E.getPrevious()))y=E.getParent();}else{if(F)z=E.getChild(F-1)||E.getLast();if(!z)y=E;}while(y||z){if(y&&!z){if(!A&&y.equals(u))A=true;if(!v.contains(y))break;if(!B||y.getComputedStyle('display')!='inline'){B=false;if(A)w=y;else this.setStartBefore(y);}z=y.getPrevious();}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;C=/[\s\ufeff]$/.test(D);}else if(z.$.offsetWidth>0&&!z.getAttribute('_fck_bookmark'))if(B&&f.$removeEmpty[z.getName()]){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;else{var G=z.$.all||z.$.getElementsByTagName('*');for(var H=0,I;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break;}}}if(z)C=!!D.length;}else z=null;if(C)if(B){if(A)w=y;else if(y)this.setStartBefore(y);}else B=true;if(z){var J=z.getPrevious();if(!y&&!J){y=z;z=null;break;}z=J;}else y=null;}if(y)y=y.getParent();
var matchChar = _matchChar || line[i]; var pos = i+1; while ((pos < line.length) && (line[pos] !== matchChar)) ++pos; if (line[pos] === matchChar) return [pos-i+1,substInChord(line.substring(i+1, pos)), true]; else { pos = i+maxErrorChars; if (pos > line.length-1) pos = line.length-1; return [pos-i+1, substInChord(line.substring(i+1, pos)), false]; } };
pos = i+maxErrorChars; if (pos > line.length-1) pos = line.length-1; return [pos-i+1, substInChord(line.substring(i+1, pos)), false]; } };
this.getBrackettedSubstring = function(line, i, maxErrorChars, _matchChar) { // This extracts the sub string by looking at the first character and searching for that // character later in the line (or search for the optional _matchChar). // For instance, if the first character is a quote it will look for // the end quote. If the end of the line is reached, then only up to the default number // of characters are returned, so that a missing end quote won't eat up the entire line. // It returns the substring and the number of characters consumed. // The number of characters consumed is normally two more than the size of the substring, // but in the error case it might not be. var matchChar = _matchChar || line[i]; var pos = i+1; while ((pos < line.length) && (line[pos] !== matchChar)) ++pos; if (line[pos] === matchChar) return [pos-i+1,substInChord(line.substring(i+1, pos)), true]; else // we hit the end of line, so we'll just pick an arbitrary num of chars so the line doesn't disappear. { pos = i+maxErrorChars; if (pos > line.length-1) pos = line.length-1; return [pos-i+1, substInChord(line.substring(i+1, pos)), false]; } };
}
},
getByCSWRecord : function (cswRecord) { var rec = ActiveLayersStore.superclass.getById.call(this, cswRecord.getFileIdentifier()); if (rec) { return new ActiveLayersRecord(rec); } return null; }
log.debug("converted logins: " + JSON.stringify(convertedResult));
if (log.logSensitiveData) log.debug("converted logins: " + JSON.stringify(convertedResult));
this.getChildEntries = function(uniqueID) { var result = this.syncRequest(this, "GetChildEntries", [uniqueID]); var convertedResult = []; for (var i in result) { var kfl = newkfLoginInfo(); kfl.initFromEntry(result[i]); convertedResult.push(kfl); } log.debug("converted logins: " + JSON.stringify(convertedResult)); return convertedResult; // an array of logins }
else if (strClef.startsWith('perc')) name = 'perc';
this.getClef = function(str) { var strOrig = str; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; // The word 'clef' is optional, but if it appears, a clef MUST appear var needsClef = false; var strClef = str.substring(i); if (strClef.startsWith('clef=')) { needsClef = true; strClef = strClef.substring(5); i += 5; } if (strClef.length === 0 && needsClef) return {len: i+5, warn: "No clef specified: " + strOrig}; var j = this.skipWhiteSpace(strClef); if (finished(strClef, j)) return {len: 0}; if (j > 0) { i += j; strClef = strClef.substring(j); } var name = null; if (strClef.startsWith('treble')) name = 'treble'; else if (strClef.startsWith('bass3')) name = 'bass3'; else if (strClef.startsWith('bass')) name = 'bass'; else if (strClef.startsWith('tenor')) name = 'tenor'; else if (strClef.startsWith('alto2')) name = 'alto2'; else if (strClef.startsWith('alto1')) name = 'alto1'; else if (strClef.startsWith('alto')) name = 'alto'; else if (strClef.startsWith('none')) name = 'none'; else return {len: i+5, warn: "Unknown clef specified: " + strOrig}; strClef = strClef.substring(name.length); j = this.isMatch(strClef, '+8'); if (j > 0) name += "+8"; else { j = this.isMatch(strClef, '-8'); if (j > 0) name += "-8"; } return {len: i+name.length, token: name, explicit: needsClef}; };
strClef = strClef.substring(name.length); j = this.isMatch(strClef, '+8');
strClef = strClef.substring(name.length); j = this.isMatch(strClef, '+8'); if (j > 0) name += "+8"; else { j = this.isMatch(strClef, '-8');
this.getClef = function(str) { var strOrig = str; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; // The word 'clef' is optional, but if it appears, a clef MUST appear var needsClef = false; var strClef = str.substring(i); if (strClef.startsWith('clef=')) { needsClef = true; strClef = strClef.substring(5); i += 5; } if (strClef.length === 0 && needsClef) return {len: i+5, warn: "No clef specified: " + strOrig}; var j = this.skipWhiteSpace(strClef); if (finished(strClef, j)) return {len: 0}; if (j > 0) { i += j; strClef = strClef.substring(j); } var name = null; if (strClef.startsWith('treble')) name = 'treble'; else if (strClef.startsWith('bass3')) name = 'bass3'; else if (strClef.startsWith('bass')) name = 'bass'; else if (strClef.startsWith('tenor')) name = 'tenor'; else if (strClef.startsWith('alto2')) name = 'alto2'; else if (strClef.startsWith('alto1')) name = 'alto1'; else if (strClef.startsWith('alto')) name = 'alto'; else if (strClef.startsWith('none')) name = 'none'; else return {len: i+5, warn: "Unknown clef specified: " + strOrig}; strClef = strClef.substring(name.length); j = this.isMatch(strClef, '+8'); if (j > 0) name += "+8"; else { j = this.isMatch(strClef, '-8'); if (j > 0) name += "-8"; } return {len: i+name.length, token: name, explicit: needsClef}; };
name += "+8"; else { j = this.isMatch(strClef, '-8'); if (j > 0) name += "-8"; } return {len: i+name.length, token: name, explicit: needsClef}; };
name += "-8"; } return {len: i+name.length, token: name, explicit: needsClef}; };
this.getClef = function(str) { var strOrig = str; var i = this.skipWhiteSpace(str); if (finished(str, i)) return {len: 0}; // The word 'clef' is optional, but if it appears, a clef MUST appear var needsClef = false; var strClef = str.substring(i); if (strClef.startsWith('clef=')) { needsClef = true; strClef = strClef.substring(5); i += 5; } if (strClef.length === 0 && needsClef) return {len: i+5, warn: "No clef specified: " + strOrig}; var j = this.skipWhiteSpace(strClef); if (finished(strClef, j)) return {len: 0}; if (j > 0) { i += j; strClef = strClef.substring(j); } var name = null; if (strClef.startsWith('treble')) name = 'treble'; else if (strClef.startsWith('bass3')) name = 'bass3'; else if (strClef.startsWith('bass')) name = 'bass'; else if (strClef.startsWith('tenor')) name = 'tenor'; else if (strClef.startsWith('alto2')) name = 'alto2'; else if (strClef.startsWith('alto1')) name = 'alto1'; else if (strClef.startsWith('alto')) name = 'alto'; else if (strClef.startsWith('none')) name = 'none'; else return {len: i+5, warn: "Unknown clef specified: " + strOrig}; strClef = strClef.substring(name.length); j = this.isMatch(strClef, '+8'); if (j > 0) name += "+8"; else { j = this.isMatch(strClef, '-8'); if (j > 0) name += "-8"; } return {len: i+name.length, token: name, explicit: needsClef}; };
return "SBgL3aeB37Mnmy94+s3J3KAL/1EkSgiCVEkfp3Otm04tQtKBDDtaIw==";
return "hUiPbbPln4TIl+/RCsl5pjL0QOeEN7OqBmkz68ZMz7tGZOUxb7BCaQ==";
this.getClientIdSignatureBase64 = function() { return "SBgL3aeB37Mnmy94+s3J3KAL/1EkSgiCVEkfp3Otm04tQtKBDDtaIw=="; }
function getColumn(columni) {
this.getColumn = function(columni) {
function getColumn(columni) { var widget = WT.getElement(id), t = widget.firstChild; var i, j, jl, chn=t.childNodes; for (i=0, j=0, jl=chn.length; j<jl; j++) { var col=chn[j]; // for finding a column if (WT.hasTag(col, 'COLGROUP')) { // IE j=-1; chn=col.childNodes; jl=chn.length; } if (!WT.hasTag(col, 'COL')) continue; if (col.className != 'Wt-vrh') { if (i == columni) { return col; } else ++i; } } return null; }
}
};
function getColumn(columni) { var widget = WT.getElement(id), t = widget.firstChild; var i, j, jl, chn=t.childNodes; for (i=0, j=0, jl=chn.length; j<jl; j++) { var col=chn[j]; // for finding a column if (WT.hasTag(col, 'COLGROUP')) { // IE j=-1; chn=col.childNodes; jl=chn.length; } if (!WT.hasTag(col, 'COL')) continue; if (col.className != 'Wt-vrh') { if (i == columni) { return col; } else ++i; } } return null; }
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,h){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var f=a.px(c,"marginLeft");f+=a.px(c,"marginRight");f+=a.px(c,"borderLeftWidth");f+=a.px(c,"borderRightWidth");f+=a.px(c,"paddingLeft");f+=a.px(c,"paddingRight");return f};this.marginV=function(c){var f=a.px(c,"marginTop");f+=a.px(c,"marginBottom");f+=a.px(c,"borderTopWidth");f+=a.px(c,"borderBottomWidth");f+=a.px(c,"paddingTop");f+=a.px(c,"paddingBottom");return f};this.getColumn= function(c){var f,i,j,g=a.getElement(s).firstChild.childNodes;i=f=0;for(j=g.length;i<j;i++){var q=g[i];if(a.hasTag(q,"COLGROUP")){i=-1;g=q.childNodes;j=g.length}if(a.hasTag(q,"COL"))if(q.className!="Wt-vrh")if(f==c)return q;else++f}return null};this.adjustRow=function(c,f){if(c.style.height!=f+"px")c.style.height=f+"px";c=c.childNodes;var i,j,g,q;i=0;q=-1;for(j=c.length;i<j;++i){g=c[i];var d=f;d-=a.pxself(g,"paddingTop");d-=a.pxself(g,"paddingBottom");if(d<=0)d=0;g.className!="Wt-vrh"&&++q;g.style.height=
f+=a.px(b,"paddingTop");f+=a.px(b,"paddingBottom");return f};this.getColumn=function(b){var f,g,j,h=a.getElement(s).firstChild.childNodes;g=f=0;for(j=h.length;g<j;g++){var q=h[g];if(a.hasTag(q,"COLGROUP")){g=-1;h=q.childNodes;j=h.length}if(a.hasTag(q,"COL"))if(q.className!="Wt-vrh")if(f==b)return q;else++f}return null};this.adjustRow=function(b,f){if(b.style.height!=f+"px")b.style.height=f+"px";b=b.childNodes;var g,j,h,q;g=0;q=-1;for(j=b.length;g<j;++g){h=b[g];var d=f;d-=a.pxself(h,"paddingTop");
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,h){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var f=a.px(c,"marginLeft");f+=a.px(c,"marginRight");f+=a.px(c,"borderLeftWidth");f+=a.px(c,"borderRightWidth");f+=a.px(c,"paddingLeft");f+=a.px(c,"paddingRight");return f};this.marginV=function(c){var f=a.px(c,"marginTop");f+=a.px(c,"marginBottom");f+=a.px(c,"borderTopWidth");f+=a.px(c,"borderBottomWidth");f+=a.px(c,"paddingTop");f+=a.px(c,"paddingBottom");return f};this.getColumn=function(c){var f,i,j,g=a.getElement(s).firstChild.childNodes;i=f=0;for(j=g.length;i<j;i++){var q=g[i];if(a.hasTag(q,"COLGROUP")){i=-1;g=q.childNodes;j=g.length}if(a.hasTag(q,"COL"))if(q.className!="Wt-vrh")if(f==c)return q;else++f}return null};this.adjustRow=function(c,f){if(c.style.height!=f+"px")c.style.height=f+"px";c=c.childNodes;var i,j,g,q;i=0;q=-1;for(j=c.length;i<j;++i){g=c[i];var d=f;d-=a.pxself(g,"paddingTop");d-=a.pxself(g,"paddingBottom");if(d<=0)d=0;g.className!="Wt-vrh"&&++q;g.style.height=
return h};this.getColumn=function(c){var h,g,j,f=a.getElement(s).firstChild.childNodes;g=h=0;for(j=f.length;g<j;g++){var q=f[g];if(a.hasTag(q,"COLGROUP")){g=-1;f=q.childNodes;j=f.length}if(a.hasTag(q,"COL"))if(q.className!="Wt-vrh")if(h==c)return q;else++h}return null};this.adjustRow=function(c,h){if(c.style.height!=h+"px")c.style.height=h+"px";c=c.childNodes;var g,j,f,q;g=0;q=-1;for(j=c.length;g<j;++g){f=c[g];var d=h;d-=a.pxself(f,"paddingTop");d-=a.pxself(f,"paddingBottom");if(d<=0)d=0;f.className!=
WT_DECLARE_WT_MEMBER(1,"StdLayout",function(a,s,h){var p=this;this.getId=function(){return s};this.WT=a;this.marginH=function(c){var f=a.px(c,"marginLeft");f+=a.px(c,"marginRight");f+=a.px(c,"borderLeftWidth");f+=a.px(c,"borderRightWidth");f+=a.px(c,"paddingLeft");f+=a.px(c,"paddingRight");return f};this.marginV=function(c){var f=a.px(c,"marginTop");f+=a.px(c,"marginBottom");f+=a.px(c,"borderTopWidth");f+=a.px(c,"borderBottomWidth");f+=a.px(c,"paddingTop");f+=a.px(c,"paddingBottom");return f};this.getColumn= function(c){var f,i,j,g=a.getElement(s).firstChild.childNodes;i=f=0;for(j=g.length;i<j;i++){var q=g[i];if(a.hasTag(q,"COLGROUP")){i=-1;g=q.childNodes;j=g.length}if(a.hasTag(q,"COL"))if(q.className!="Wt-vrh")if(f==c)return q;else++f}return null};this.adjustRow=function(c,f){if(c.style.height!=f+"px")c.style.height=f+"px";c=c.childNodes;var i,j,g,q;i=0;q=-1;for(j=c.length;i<j;++i){g=c[i];var d=f;d-=a.pxself(g,"paddingTop");d-=a.pxself(g,"paddingBottom");if(d<=0)d=0;g.className!="Wt-vrh"&&++q;g.style.height=
return h};this.getColumn=function(c){var h,g,j,f=a.getElement(s).firstChild.childNodes;g=h=0;for(j=f.length;g<j;g++){var q=f[g];if(a.hasTag(q,"COLGROUP")){g=-1;f=q.childNodes;j=f.length}if(a.hasTag(q,"COL"))if(q.className!="Wt-vrh")if(h==c)return q;else++h}return null};this.adjustRow=function(c,h){if(c.style.height!=h+"px")c.style.height=h+"px";c=c.childNodes;var g,j,f,q;g=0;q=-1;for(j=c.length;g<j;++g){f=c[g];var d=h;d-=a.pxself(f,"paddingTop");d-=a.pxself(f,"paddingBottom");if(d<=0)d=0;f.className!=
c+=a.px(b,"paddingTop");c+=a.px(b,"paddingBottom");return c};this.getColumn=function(b){var c,f,d,i=a.getElement(t).firstChild.childNodes;f=c=0;for(d=i.length;f<d;f++){var k=i[f];if(a.hasTag(k,"COLGROUP")){f=-1;i=k.childNodes;d=i.length}if(a.hasTag(k,"COL"))if(k.className!="Wt-vrh")if(c==b)return k;else++c}return null};this.adjustCell=function(b,c){var f=c==0;c-=a.pxself(b,"paddingTop");c-=a.pxself(b,"paddingBottom");if(c<=0)c=0;b.style.height=c+"px";if(!(b.style.verticalAlign||b.childNodes.length==
c+=a.px(b,"paddingTop");c+=a.px(b,"paddingBottom");return c};this.getColumn=function(b){var c,f,i,d=a.getElement(t).firstChild.childNodes;f=c=0;for(i=d.length;f<i;f++){var k=d[f];if(a.hasTag(k,"COLGROUP")){f=-1;d=k.childNodes;i=d.length}if(a.hasTag(k,"COL"))if(k.className!="Wt-vrh")if(c==b)return k;else++c}return null};this.adjustCell=function(b,c,f){var i=c==0;c-=a.pxself(b,"paddingTop");c-=a.pxself(b,"paddingBottom");if(c<=0)c=0;b.style.height=c+"px";if(!(b.style.verticalAlign||b.childNodes.length==
c+=a.px(b,"paddingTop");c+=a.px(b,"paddingBottom");return c};this.getColumn=function(b){var c,f,d,i=a.getElement(t).firstChild.childNodes;f=c=0;for(d=i.length;f<d;f++){var k=i[f];if(a.hasTag(k,"COLGROUP")){f=-1;i=k.childNodes;d=i.length}if(a.hasTag(k,"COL"))if(k.className!="Wt-vrh")if(c==b)return k;else++c}return null};this.adjustCell=function(b,c){var f=c==0;c-=a.pxself(b,"paddingTop");c-=a.pxself(b,"paddingBottom");if(c<=0)c=0;b.style.height=c+"px";if(!(b.style.verticalAlign||b.childNodes.length==
},getCommonAncestor:function(t,u){var y=this;var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1)x=v.getChild(y.startOffset);else x=v;}else x=v.getCommonAncestor(w);return u&&!x.is?x.getParent():x;},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1)if(!u)v.setStartBefore(t);else if(u>=t.getLength())v.setStartAfter(t);t=v.endContainer;u=v.endOffset;if(t.type!=1)if(!u)v.setEndBefore(t);else if(u>=t.getLength())v.setEndAfter(t);},optimizeBookmark:function(){var v=this;var t=v.startContainer,u=v.endContainer;if(t.is&&t.is('span')&&t.hasAttribute('_fck_bookmark'))v.setStartAt(t,3);if(u&&u.is&&u.is('span')&&u.hasAttribute('_fck_bookmark'))v.setEndAt(u,4);},trim:function(t,u){var B=this;var v=B.startContainer,w=B.startOffset,x=B.collapsed;if((!t||x)&&v&&v.type==3){if(!w){w=v.getIndex();v=v.getParent();}else if(w>=v.getLength()){w=v.getIndex()+1;v=v.getParent();}else{var y=v.split(w);w=v.getIndex()+1;v=v.getParent();if(B.startContainer.equals(B.endContainer))B.setEnd(y,B.endOffset-B.startOffset);else if(v.equals(B.endContainer))B.endOffset+=1;}B.setStart(v,w);if(x){B.collapse(true);return;}}var z=B.endContainer,A=B.endOffset;if(!(u||x)&&z&&z.type==3){if(!A){A=z.getIndex();z=z.getParent();}else if(A>=z.getLength()){A=z.getIndex()+1;z=z.getParent();}else{z.split(A);A=z.getIndex()+1;z=z.getParent();}B.setEnd(z,A);}},enlarge:function(t){switch(t){case 1:if(this.collapsed)return;var u=this.getCommonAncestor(),v=this.document.getBody(),w,x,y,z,A,B=false,C,D,E=this.startContainer,F=this.startOffset;if(E.type==3){if(F){E=!e.trim(E.substring(0,F)).length&&E;B=!!E;}if(E)if(!(z=E.getPrevious()))y=E.getParent();}else{if(F)z=E.getChild(F-1)||E.getLast();if(!z)y=E;}while(y||z){if(y&&!z){if(!A&&y.equals(u))A=true;if(!v.contains(y))break;if(!B||y.getComputedStyle('display')!='inline'){B=false;if(A)w=y;else this.setStartBefore(y);}z=y.getPrevious();}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;C=/[\s\ufeff]$/.test(D);}else if(z.$.offsetWidth>0&&!z.getAttribute('_fck_bookmark'))if(B&&f.$removeEmpty[z.getName()]){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;else{var G=z.$.all||z.$.getElementsByTagName('*');for(var H=0,I;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break;}}}if(z)C=!!D.length;}else z=null;if(C)if(B){if(A)w=y;else if(y)this.setStartBefore(y);}else B=true;if(z){var J=z.getPrevious();if(!y&&!J){y=z;z=null;break;}z=J;}else y=null;}if(y)y=y.getParent();
return{startNode:t,endNode:u};},getCommonAncestor:function(t,u){var y=this;var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1)x=v.getChild(y.startOffset);else x=v;}else x=v.getCommonAncestor(w);return u&&!x.is?x.getParent():x;},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1)if(!u)v.setStartBefore(t);else if(u>=t.getLength())v.setStartAfter(t);t=v.endContainer;u=v.endOffset;if(t.type!=1)if(!u)v.setEndBefore(t);else if(u>=t.getLength())v.setEndAfter(t);},optimizeBookmark:function(){var v=this;var t=v.startContainer,u=v.endContainer;if(t.is&&t.is('span')&&t.hasAttribute('_cke_bookmark'))v.setStartAt(t,3);if(u&&u.is&&u.is('span')&&u.hasAttribute('_cke_bookmark'))v.setEndAt(u,4);},trim:function(t,u){var B=this;var v=B.startContainer,w=B.startOffset,x=B.collapsed;if((!t||x)&&v&&v.type==3){if(!w){w=v.getIndex();v=v.getParent();}else if(w>=v.getLength()){w=v.getIndex()+1;v=v.getParent();}else{var y=v.split(w);w=v.getIndex()+1;v=v.getParent();if(B.startContainer.equals(B.endContainer))B.setEnd(y,B.endOffset-B.startOffset);else if(v.equals(B.endContainer))B.endOffset+=1;}B.setStart(v,w);if(x){B.collapse(true);return;}}var z=B.endContainer,A=B.endOffset;if(!(u||x)&&z&&z.type==3){if(!A){A=z.getIndex();z=z.getParent();}else if(A>=z.getLength()){A=z.getIndex()+1;z=z.getParent();}else{z.split(A);A=z.getIndex()+1;z=z.getParent();}B.setEnd(z,A);}},enlarge:function(t){switch(t){case 1:if(this.collapsed)return;var u=this.getCommonAncestor(),v=this.document.getBody(),w,x,y,z,A,B=false,C,D,E=this.startContainer,F=this.startOffset;if(E.type==3){if(F){E=!e.trim(E.substring(0,F)).length&&E;B=!!E;}if(E)if(!(z=E.getPrevious()))y=E.getParent();}else{if(F)z=E.getChild(F-1)||E.getLast();if(!z)y=E;}while(y||z){if(y&&!z){if(!A&&y.equals(u))A=true;if(!v.contains(y))break;if(!B||y.getComputedStyle('display')!='inline'){B=false;if(A)w=y;else this.setStartBefore(y);}z=y.getPrevious();}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;C=/[\s\ufeff]$/.test(D);}else if(z.$.offsetWidth>0&&!z.getAttribute('_cke_bookmark'))if(B&&f.$removeEmpty[z.getName()]){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;else{var G=z.$.all||z.$.getElementsByTagName('*');for(var H=0,I;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break;}}}if(z)C=!!D.length;}else z=null;if(C)if(B){if(A)w=y;else if(y)this.setStartBefore(y);}else B=true;if(z){var J=z.getPrevious();if(!y&&!J){y=z;z=null;break;
},getCommonAncestor:function(t,u){var y=this;var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1)x=v.getChild(y.startOffset);else x=v;}else x=v.getCommonAncestor(w);return u&&!x.is?x.getParent():x;},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1)if(!u)v.setStartBefore(t);else if(u>=t.getLength())v.setStartAfter(t);t=v.endContainer;u=v.endOffset;if(t.type!=1)if(!u)v.setEndBefore(t);else if(u>=t.getLength())v.setEndAfter(t);},optimizeBookmark:function(){var v=this;var t=v.startContainer,u=v.endContainer;if(t.is&&t.is('span')&&t.hasAttribute('_fck_bookmark'))v.setStartAt(t,3);if(u&&u.is&&u.is('span')&&u.hasAttribute('_fck_bookmark'))v.setEndAt(u,4);},trim:function(t,u){var B=this;var v=B.startContainer,w=B.startOffset,x=B.collapsed;if((!t||x)&&v&&v.type==3){if(!w){w=v.getIndex();v=v.getParent();}else if(w>=v.getLength()){w=v.getIndex()+1;v=v.getParent();}else{var y=v.split(w);w=v.getIndex()+1;v=v.getParent();if(B.startContainer.equals(B.endContainer))B.setEnd(y,B.endOffset-B.startOffset);else if(v.equals(B.endContainer))B.endOffset+=1;}B.setStart(v,w);if(x){B.collapse(true);return;}}var z=B.endContainer,A=B.endOffset;if(!(u||x)&&z&&z.type==3){if(!A){A=z.getIndex();z=z.getParent();}else if(A>=z.getLength()){A=z.getIndex()+1;z=z.getParent();}else{z.split(A);A=z.getIndex()+1;z=z.getParent();}B.setEnd(z,A);}},enlarge:function(t){switch(t){case 1:if(this.collapsed)return;var u=this.getCommonAncestor(),v=this.document.getBody(),w,x,y,z,A,B=false,C,D,E=this.startContainer,F=this.startOffset;if(E.type==3){if(F){E=!e.trim(E.substring(0,F)).length&&E;B=!!E;}if(E)if(!(z=E.getPrevious()))y=E.getParent();}else{if(F)z=E.getChild(F-1)||E.getLast();if(!z)y=E;}while(y||z){if(y&&!z){if(!A&&y.equals(u))A=true;if(!v.contains(y))break;if(!B||y.getComputedStyle('display')!='inline'){B=false;if(A)w=y;else this.setStartBefore(y);}z=y.getPrevious();}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;C=/[\s\ufeff]$/.test(D);}else if(z.$.offsetWidth>0&&!z.getAttribute('_fck_bookmark'))if(B&&f.$removeEmpty[z.getName()]){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;else{var G=z.$.all||z.$.getElementsByTagName('*');for(var H=0,I;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break;}}}if(z)C=!!D.length;}else z=null;if(C)if(B){if(A)w=y;else if(y)this.setStartBefore(y);}else B=true;if(z){var J=z.getPrevious();if(!y&&!J){y=z;z=null;break;}z=J;}else y=null;}if(y)y=y.getParent();
if (tune.addTieToLastNote()) el.endTie = true; else warn("Illegal tie before any other note", line, index);
tune.addTieToLastNote(); el.endTie = true;
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state == 'duration' || state == 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.pitch = null; el.rest_type = rests[line[index]]; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. if (tune.addTieToLastNote()) el.endTie = true; else warn("Illegal tie before any other note", line, index); } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el = addEndBeam(el); el.endChar = index; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };
var isComplete = function(state) { return (state === 'octave' || state === 'duration' || state === 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.rest = { type: rests[line[index]] }; delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1;
var isComplete = function(state) { return (state === 'octave' || state === 'duration' || state === 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.rest = { type: rests[line[index]] }; delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else if (state === 'sharp2') { el.accidental = 'quartersharp';state = 'pitch'; } else if (state === 'flat2') { el.accidental = 'quarterflat';state = 'pitch'; } else return null; break; case '-': if (state === 'startSlur') { tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm)
var getCoreNote = function(line, index, el, canHaveBrokenRhythm) { //var el = { startChar: index }; var isComplete = function(state) { return (state === 'octave' || state === 'duration' || state === 'broken_rhythm' || state === 'end_slur'); }; var state = 'startSlur'; var durationSetByPreviousNote = false; while (1) { switch(line[index]) { case '(': if (state === 'startSlur') { if (el.startSlur === undefined) el.startSlur = 1; else el.startSlur++; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ')': if (isComplete(state)) { if (el.endSlur === undefined) el.endSlur = 1; else el.endSlur++; } else return null; break; case '^': if (state === 'startSlur') {el.accidental = 'sharp';state = 'sharp2';} else if (state === 'sharp2') {el.accidental = 'dblsharp';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '_': if (state === 'startSlur') {el.accidental = 'flat';state = 'flat2';} else if (state === 'flat2') {el.accidental = 'dblflat';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '=': if (state === 'startSlur') {el.accidental = 'natural';state = 'pitch';} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': if (state === 'startSlur' || state === 'sharp2' || state === 'flat2' || state === 'pitch') { el.pitch = pitches[line[index]]; state = 'octave'; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case ',': if (state === 'octave') {el.pitch -= 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '\'': if (state === 'octave') {el.pitch += 7;} else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case 'x': case 'y': case 'z': if (state === 'startSlur') { el.rest = { type: rests[line[index]] }; // There shouldn't be some of the properties that notes have. If some sneak in due to bad syntax in the abc file, // just nix them here. delete el.accidental; delete el.startSlur; delete el.startTie; delete el.endSlur; delete el.endTie; delete el.end_beam; delete el.grace_notes; // At this point we have a valid note. The rest is optional. Set the duration in case we don't get one below if (canHaveBrokenRhythm && multilineVars.next_note_duration !== 0) { el.duration = multilineVars.next_note_duration; multilineVars.next_note_duration = 0; durationSetByPreviousNote = true; } else el.duration = multilineVars.default_length; state = 'duration'; } else if (isComplete(state)) {el.endChar = index;return el;} else return null; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '0': case '/': if (state === 'octave' || state === 'duration') { var fraction = tokenizer.getFraction(line, index); if (!durationSetByPreviousNote) el.duration = el.duration * fraction.value; // TODO-PER: We can test the returned duration here and give a warning if it isn't the one expected. el.endChar = fraction.index; while (fraction.index < line.length && (tokenizer.isWhiteSpace(line[fraction.index]) || line[fraction.index] === '-')) { if (line[fraction.index] === '-') el.startTie = true; else el = addEndBeam(el); fraction.index++; } index = fraction.index-1; state = 'broken_rhythm'; } else if (state === 'sharp2') { el.accidental = 'quartersharp';state = 'pitch'; } else if (state === 'flat2') { el.accidental = 'quarterflat';state = 'pitch'; } else return null; break; case '-': if (state === 'startSlur') { // This is the first character, so it must have been meant for the previous note. Correct that here. tune.addTieToLastNote(); el.endTie = true; } else if (state === 'octave' || state === 'duration' || state === 'end_slur') { el.startTie = true; if (!durationSetByPreviousNote && canHaveBrokenRhythm) state = 'broken_rhythm'; else { // Peek ahead to the next character. If it is a space, then we have an end beam. if (tokenizer.isWhiteSpace(line[index+1])) addEndBeam(el); el.endChar = index+1; return el; } } else if (state === 'broken_rhythm') {el.endChar = index;return el;} else return null; break; case ' ': case '\t': if (isComplete(state)) { el.end_beam = true; // look ahead to see if there is a tie do { if (line[index] === '-') el.startTie = true; index++; } while (index < line.length && (tokenizer.isWhiteSpace(line[index]) || line[index] === '-')); el.endChar = index; if (!durationSetByPreviousNote && canHaveBrokenRhythm && (line[index] === '<' || line[index] === '>')) { // TODO-PER: Don't need the test for < and >, but that makes the endChar work out for the regression test. index--; state = 'broken_rhythm'; } else return el; } else return null; break; case '>': case '<': if (isComplete(state)) { if (canHaveBrokenRhythm) { var br2 = getBrokenRhythm(line, index); index += br2[0] - 1; // index gets incremented below, so we'll let that happen multilineVars.next_note_duration = br2[2]*el.duration; el.duration = br2[1]*el.duration; state = 'end_slur'; } else { el.endChar = index; return el; } } else return null; break; default: if (isComplete(state)) { el.endChar = index; return el; } return null; } index++; if (index === line.length) { if (isComplete(state)) {el.endChar = index;return el;} else return null; } } return null; };