X-Git-Url: https://git.infodrom.org/?p=infodrom%2Frico3;a=blobdiff_plain;f=minsrc%2Frico.js;h=9c8e0ef450a31ba3660c90eaee95bd22be2bc47a;hp=c8f848b3bf0d935763891d9c6ffdcd51968a08a0;hb=ee6f74edc604824b08ca60e5fd782af9a69c4443;hpb=d06fe96aa202cebecd31425126b6fa2afdab54e1 diff --git a/minsrc/rico.js b/minsrc/rico.js index c8f848b..9c8e0ef 100644 --- a/minsrc/rico.js +++ b/minsrc/rico.js @@ -1,6 +1,6 @@ /* - * (c) 2005-2011 Richard Cowin (http://openrico.org) - * (c) 2005-2011 Matt Brown (http://dowdybrown.com) + * (c) 2005-2012 Richard Cowin (http://openrico.org) + * (c) 2005-2012 Matt Brown (http://dowdybrown.com) * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -13,7 +13,7 @@ * and limitations under the License. */ -Rico.Version='3.0b2'; +Rico.Version='3.0'; Rico.theme={}; Rico.onLoadCallbacks=[]; Rico.windowIsLoaded=false; @@ -184,7 +184,13 @@ Rico.getContentAsString=function( parentNode, isEncoded ) { }; Rico._getEncodedContent=function(parentNode) { - if (parentNode.innerHTML) return parentNode.innerHTML; + if (parentNode.innerHTML) { + if (Rico.isGecko && navigator.productSub >= "20100101") + parentNode.innerHTML.replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); + else + return parentNode.innerHTML; + } + switch (parentNode.childNodes.length) { case 0: return ""; case 1: return parentNode.firstChild.nodeValue; @@ -242,7 +248,7 @@ Rico.zFill=function(n,slen, radix) { Rico.keys=function(obj) { var objkeys=[]; for(var k in obj) - objkeys.push[k]; + objkeys.push(k); return objkeys; }; @@ -328,6 +334,7 @@ Rico.positionCtlOverIcon=function(ctl,icon) { icon=this.$(icon); var offsets=this.cumulativeOffset(icon); var scrTop=this.docScrollTop(); + var scrLeft=this.docScrollLeft(); var winHt=this.windowHeight(); if (ctl.style.display=='none') ctl.style.display='block'; var correction=2; // based on a 1px border @@ -336,7 +343,7 @@ Rico.positionCtlOverIcon=function(ctl,icon) { ctl.style.left = (offsets.left + icon.offsetWidth - ctl.offsetWidth)+'px'; } else { var margin=this.nan2zero(this.getStyle(icon,'marginLeft')); - ctl.style.left = (offsets.left+margin+correction)+'px'; + ctl.style.left = (offsets.left+margin+correction+scrLeft)+'px'; } var newTop=offsets.top + correction;// + scrTop; var ctlht=ctl.offsetHeight; @@ -541,7 +548,7 @@ Rico.formatNumber=function(n,fmt) { if (isNaN(n)) return 'NaN'; if (typeof fmt.multiplier=='number') n*=fmt.multiplier; var decPlaces=typeof fmt.decPlaces=='number' ? fmt.decPlaces : 0; - var thouSep=typeof fmt.thouSep=='undefined' ? true : this.thouSep; + var thouSep=typeof fmt.thouSep=='undefined' ? true : fmt.thouSep; var prefix=fmt.prefix || ""; var suffix=fmt.suffix || ""; var negSign=typeof fmt.negSign=='string' ? fmt.negSign : "L"; @@ -568,11 +575,11 @@ Rico.formatNumber=function(n,fmt) { * @param fmt string specifying the output format, may be one of the following: