Other recent changes had broken the Rico calendar on IE6-8. This update fixes all...
[infodrom/rico3] / ricoClient / js / rico_min.js
index ed1860a..225d171 100644 (file)
@@ -709,13 +709,21 @@ this.dateParts[RegExp.$5]=2
 }},addHoliday:function(f,a,g,e,c,b){this.Holidays[this.holidayKey(g,a-1,f)]={desc:e,txtColor:b,bgColor:c||"#DDF"}
 },holidayKey:function(c,a,b){return"h"+Rico.zFill(c,4)+Rico.zFill(a,2)+Rico.zFill(b,2)
 },atLoad:function(){Rico.log("Calendar#atLoad: "+this.id);
-var e=Rico.$(this.id);
-if(e){this.setDiv(e)
+var d=Rico.$(this.id);
+if(d){this.setDiv(d)
 }else{this.createContainer();
 this.container.id=this.id
 }Rico.addClass(this.content,Rico.theme.calendar||"ricoCalContainer");
 this.content.style.display="block";
-this.maintab=document.createElement("table");
+this.heading=this.content.appendChild(document.createElement("div"));
+this.heading.className="RicoCalHeading";
+if(Rico.theme.calendarHeading){Rico.addClass(this.heading,Rico.theme.calendarHeading)
+}var k=this._createTitleSection("Month");
+this.heading.appendChild(k);
+this.heading.appendChild(this._createTitleSection("Year"));
+new Rico.HoverSet(this.heading.getElementsByTagName("a"));
+if(this.position=="absolute"){this.heading.appendChild(Rico.closeButton(Rico.eventHandle(this,"close")))
+}this.maintab=document.createElement("table");
 this.maintab.cellSpacing=2;
 this.maintab.cellPadding=0;
 this.maintab.border=0;
@@ -723,107 +731,86 @@ this.maintab.style.borderCollapse="separate";
 this.maintab.className="ricoCalTab";
 if(Rico.theme.calendarTable){Rico.addClass(this.maintab,Rico.theme.calendarTable)
 }this.tbody=Rico.getTBody(this.maintab);
-var d,l,h,g,k,n,m,o,f;
+var b,l,g,f,h,p,m,q,e;
 this.colStart=this.options.showWeekNumber?1:0;
-for(h=0;
-h<7;
-h++){d=this.tbody.insertRow(-1);
-d.className="row"+h;
+for(g=0;
+g<7;
+g++){b=this.tbody.insertRow(-1);
+b.className="row"+g;
 for(l=0;
 l<7+this.colStart;
-l++){d.insertCell(-1)
-}}d=this.tbody.rows[0];
-d.className="ricoCalDayNames";
-if(this.options.showWeekNumber){d.cells[0].innerHTML=this.weekString;
-for(h=0;
-h<7;
-h++){this.tbody.rows[h].cells[0].className="ricoCalWeekNum"
+l++){b.insertCell(-1)
+}}b=this.tbody.rows[0];
+b.className="ricoCalDayNames";
+if(this.options.showWeekNumber){b.cells[0].innerHTML=this.weekString;
+for(g=0;
+g<7;
+g++){this.tbody.rows[g].cells[0].className="ricoCalWeekNum"
 }}this.styles=[];
-for(h=0;
-h<7;
-h++){n=(h+this.options.startAt)%7;
-d.cells[h+this.colStart].innerHTML=Rico.dayAbbr(n);
-this.styles[h]="ricoCal"+n
-}this.heading=this.content.appendChild(document.createElement("div"));
-this.heading.className="RicoCalHeading";
-if(Rico.theme.calendarHeading){Rico.addClass(this.heading,Rico.theme.calendarHeading)
-}var b=this.heading.appendChild(document.createElement("div"));
-b.className="RicoCalHeadingInner";
-b.appendChild(this._createTitleSection("Month"));
-b.appendChild(this._createTitleSection("Year"));
-new Rico.HoverSet(this.heading.getElementsByTagName("a"));
-new Rico.HoverSet(this.tbody.getElementsByTagName("td"),{hoverNodes:function(a){return a.innerHTML.match(/^\d+$/)?[a]:[]
-}});
-if(this.position=="absolute"){this.heading.appendChild(Rico.closeButton(Rico.eventHandle(this,"close")))
+for(g=0;
+g<7;
+g++){p=(g+this.options.startAt)%7;
+b.cells[g+this.colStart].innerHTML=Rico.dayAbbr(p);
+this.styles[g]="ricoCal"+p
 }if(this.options.showToday){this.tfoot=this.maintab.createTFoot();
-d=this.tfoot.insertRow(-1);
-this.todayCell=d.insertCell(-1);
+b=this.tfoot.insertRow(-1);
+this.todayCell=b.insertCell(-1);
 this.todayCell.colSpan=7+this.colStart;
 if(Rico.theme.calendarFooter){Rico.addClass(this.todayCell,Rico.theme.calendarFooter)
 }Rico.eventBind(this.todayCell,"click",Rico.eventHandle(this,"selectNow"),false)
 }this.content.appendChild(this.maintab);
+new Rico.HoverSet(this.tbody.getElementsByTagName("td"),{hoverNodes:function(a){return a.innerHTML.match(/^\d+$/)?[a]:[]
+}});
 this.monthPopup=new Rico.Popup(document.createElement("div"));
 this.monthPopup.closePopup();
-f=document.createElement("table");
-f.className="ricoCalMenu";
-if(Rico.theme.calendarPopdown){Rico.addClass(f,Rico.theme.calendarPopdown)
-}f.cellPadding=2;
-f.cellSpacing=0;
-f.border=0;
-f.style.borderCollapse="separate";
-f.style.margin="0px";
-for(h=0;
-h<4;
-h++){d=f.insertRow(-1);
+e=document.createElement("table");
+e.className="ricoCalMenu";
+if(Rico.theme.calendarPopdown){Rico.addClass(e,Rico.theme.calendarPopdown)
+}e.cellPadding=2;
+e.cellSpacing=0;
+e.border=0;
+e.style.borderCollapse="separate";
+e.style.margin="0px";
 for(g=0;
-g<3;
-g++){l=d.insertCell(-1);
+g<4;
+g++){b=e.insertRow(-1);
+for(f=0;
+f<3;
+f++){l=b.insertCell(-1);
 m=document.createElement("a");
-m.innerHTML=Rico.monthAbbr(h*3+g);
-m.name=h*3+g;
+m.innerHTML=Rico.monthAbbr(g*3+f);
+m.name=g*3+f;
 if(Rico.theme.calendarDay){Rico.addClass(m,Rico.theme.calendarDay)
 }l.appendChild(m);
 Rico.eventBind(m,"click",Rico.eventHandle(this,"selectMonth"),false)
-}}new Rico.HoverSet(f.getElementsByTagName("a"));
-this.monthPopup.content.appendChild(f);
+}}new Rico.HoverSet(e.getElementsByTagName("a"));
+this.monthPopup.content.appendChild(e);
 this.container.appendChild(this.monthPopup.container);
 this.yearPopup=new Rico.Popup(document.createElement("div"));
 this.yearPopup.closePopup();
 this.yearPopup.content.className="ricoCalYearPrompt";
 if(Rico.theme.calendarPopdown){Rico.addClass(this.yearPopup.content,Rico.theme.calendarPopdown)
-}var f=document.createElement("table");
-f.cellPadding=2;
-f.cellSpacing=0;
-f.border=0;
-f.style.borderCollapse="separate";
-f.style.margin="0px";
-d=f.insertRow(-1);
-this.yearLabel=d.insertCell(-1);
-this.yearLabel.colSpan=3;
-this.yearLabel.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
-d=f.insertRow(-1);
-l=d.insertCell(-1);
-this.yearInput=l.appendChild(document.createElement("input"));
+}var o=document.createElement("p");
+o.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
+var n=document.createElement("p");
+this.yearInput=n.appendChild(document.createElement("input"));
 this.yearInput.maxlength=4;
 this.yearInput.size=4;
 Rico.eventBind(this.yearInput,"keyup",Rico.eventHandle(this,"yearKey"),false);
-l=d.insertCell(-1);
-var m=Rico.floatButton("Checkmark",Rico.eventHandle(this,"processPopUpYear"));
-Rico.setStyle(m.firstChild,{margin:"0px",padding:"0px",border:"none"});
-l.appendChild(m);
-l=d.insertCell(-1);
+m=Rico.floatButton("Checkmark",Rico.eventHandle(this,"processPopUpYear"));
+n.appendChild(m);
 m=Rico.floatButton("Cancel",Rico.eventHandle(this,"popDownYear"));
-Rico.setStyle(m.firstChild,{margin:"0px",padding:"0px",border:"none"});
-l.appendChild(m);
-this.yearPopup.content.appendChild(f);
+n.appendChild(m);
+this.yearPopup.content.appendChild(o);
+this.yearPopup.content.appendChild(n);
 this.container.appendChild(this.yearPopup.container);
 this.yearPopup.container.style.left="";
 this.yearPopup.container.style.right="5px";
 this.yearPopup.container.style.zIndex=10;
 m=this.content.getElementsByTagName("a");
-for(h=0;
-h<m.length;
-h++){m[h].href="javascript:void(0)"
+for(g=0;
+g<m.length;
+g++){m[g].href="javascript:void(0)"
 }Rico.eventBind(this.tbody,"click",Rico.eventHandle(this,"saveAndClose"));
 this.close();
 this.bPageLoaded=true
@@ -832,16 +819,13 @@ c.className="RicoCal"+d+"Heading";
 if(Rico.theme.calendarSubheading){Rico.addClass(c,Rico.theme.calendarSubheading)
 }var b=c.appendChild(document.createElement("a"));
 b.className="Rico_leftArrow";
-if(Rico.theme.leftArrowAnchor){Rico.addClass(b,Rico.theme.leftArrowAnchor)
-}b.appendChild(this.createNavArrow("dec"+d,"left"));
-b=c.appendChild(document.createElement("a"));
-b.style.display="inline";
+b.appendChild(this.createNavArrow("dec"+d,"left"));
+var b=c.appendChild(document.createElement("a"));
 Rico.eventBind(b,"click",Rico.eventHandle(this,"popUp"+d),false);
 this["title"+d]=b;
 b=c.appendChild(document.createElement("a"));
 b.className="Rico_rightArrow";
-if(Rico.theme.rightArrowAnchor){Rico.addClass(b,Rico.theme.rightArrowAnchor)
-}b.appendChild(this.createNavArrow("inc"+d,"right"));
+b.appendChild(this.createNavArrow("inc"+d,"right"));
 return c
 },selectNow:function(){var a=new Date();
 this.dateNow=a.getDate();
@@ -852,6 +836,7 @@ this.yearSelected=this.yearNow;
 this.constructCalendar()
 },createNavArrow:function(a,c){var b=document.createElement("span");
 b.className=Rico.theme[c+"Arrow"]||"rico-icon Rico_"+c+"Arrow";
+b.style.display="inline-block";
 Rico.eventBind(b,"click",Rico.eventHandle(this,a),false);
 return b
 },isValidMonth:function(a,b){if(a<this.options.minDate.getFullYear()){return false
@@ -890,14 +875,16 @@ this.monthPopup.container.style.left=""
 },popDownMonth:function(){this.monthPopup.closePopup()
 },popDownYear:function(){this.yearPopup.closePopup();
 this.yearInput.disabled=true
-},popUpYear:function(a){Rico.eventStop(a);
+},popUpYear:function(b){Rico.eventStop(b);
 if(this.yearPopup.visible()){this.popDownYear();
 return
 }this.popDownMonth();
-this.yearPopup.openPopup(null,this.heading.offsetHeight+2);
 this.yearInput.disabled=false;
 this.yearInput.value="";
-this.yearInput.focus();
+this.yearPopup.openPopup(null,this.heading.offsetHeight+2);
+var a=this;
+setTimeout(function(){a.yearInput.focus()
+},10);
 return false
 },yearKey:function(a){switch(Rico.eventKey(a)){case 27:this.popDownYear();
 Rico.eventStop(a);
@@ -1546,7 +1533,7 @@ if(g.className.match(/node(p|m)(last)?$/)){g.className=g.className.replace(/node
 this.loadXMLDoc(g.name)
 }}};
 if(typeof Rico=="undefined"){throw ("GridCommon requires the Rico JavaScript framework")
-}Rico.GridCommon={baseInit:function(){this.options={saveColumnInfo:{width:true,filter:false,sort:false},cookiePrefix:"RicoGrid.",allowColResize:true,windowResize:true,click:null,dblclick:null,contextmenu:null,menuEvent:"dblclick",defaultWidth:-1,scrollBarWidth:19,minScrollWidth:100,frozenColumns:0,exportWindow:"height=400,width=500,scrollbars=1,menubar=1,resizable=1,location=0,toolbar=0,status=0",exportStyleList:["background-color","color","text-align","font-weight","font-size","font-family"],exportImgTags:false,exportFormFields:true,FilterLocation:null,FilterAllToken:"___ALL___",columnSpecs:[]};
+}Rico.GridCommon={baseInit:function(){this.options={saveColumnInfo:{width:true,filter:false,sort:false},cookiePrefix:"RicoGrid.",allowColResize:true,windowResize:true,click:null,dblclick:null,contextmenu:null,menuEvent:null,defaultWidth:-1,scrollBarWidth:19,minScrollWidth:100,frozenColumns:0,exportWindow:"height=400,width=500,scrollbars=1,menubar=1,resizable=1,location=0,toolbar=0,status=0",exportStyleList:["background-color","color","text-align","font-weight","font-size","font-family"],exportImgTags:false,exportFormFields:true,FilterLocation:null,FilterAllToken:"___ALL___",columnSpecs:[]};
 this.hdrCells=[];
 this.headerColCnt=0;
 this.headerRowIdx=0;
@@ -2102,9 +2089,9 @@ Rico.log("SimpleGrid initialize end: "+b)
 for(a=0;
 a<2;
 a++){Rico.log("simpleGridInit "+a);
-this.tabs[a]=document.getElementById(this.tableId+"_tab"+a);
+this.tabs[a]=Rico.$(this.tableId+"_tab"+a);
 if(!this.tabs[a]){return
-}this.hdrTabs[a]=document.getElementById(this.tableId+"_tab"+a+"h");
+}this.hdrTabs[a]=Rico.$(this.tableId+"_tab"+a+"h");
 if(!this.hdrTabs[a]){return
 }this.thead[a]=this.hdrTabs[a];
 this.tbody[a]=this.tabs[a];