Rico.addClass(this.content, Rico.theme.calendar || 'ricoCalContainer');
this.content.style.display='block'; // override jquery ui
+ // Navigation controls
+ this.heading=this.content.appendChild(document.createElement("div"));
+ this.heading.className='RicoCalHeading';
+ if (Rico.theme.calendarHeading) Rico.addClass(this.heading,Rico.theme.calendarHeading)
+ var monthHdg=this._createTitleSection('Month');
+ this.heading.appendChild(monthHdg);
+ 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.styles[i]='ricoCal'+dow;
}
- // Navigation controls
- this.heading=this.content.appendChild(document.createElement("div"));
- this.heading.className='RicoCalHeading';
- if (Rico.theme.calendarHeading) Rico.addClass(this.heading,Rico.theme.calendarHeading)
- var d2=this.heading.appendChild(document.createElement("div"));
- d2.className='RicoCalHeadingInner';
- d2.appendChild(this._createTitleSection('Month'));
- d2.appendChild(this._createTitleSection('Year'));
- new Rico.HoverSet(this.heading.getElementsByTagName('a'));
- new Rico.HoverSet(this.tbody.getElementsByTagName('td'),{ hoverNodes: function(e) { return e.innerHTML.match(/^\d+$/) ? [e] : []; } });
- if (this.position == 'absolute') this.heading.appendChild(Rico.closeButton(Rico.eventHandle(this,'close')));
-
// table footer (today)
if (this.options.showToday) {
this.tfoot=this.maintab.createTFoot();
Rico.eventBind(this.todayCell,"click", Rico.eventHandle(this,'selectNow'), false);
}
this.content.appendChild(this.maintab);
+ new Rico.HoverSet(this.tbody.getElementsByTagName('td'),{ hoverNodes: function(e) { return e.innerHTML.match(/^\d+$/) ? [e] : []; } });
// month selector
this.monthPopup=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 tab=document.createElement("table");
- tab.cellPadding=2;
- tab.cellSpacing=0;
- tab.border=0;
- tab.style.borderCollapse='separate';
- tab.style.margin='0px';
- r=tab.insertRow(-1);
- this.yearLabel=r.insertCell(-1);
- this.yearLabel.colSpan=3;
- this.yearLabel.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
- r=tab.insertRow(-1);
- c=r.insertCell(-1);
- this.yearInput=c.appendChild(document.createElement("input"));
+ var p1=document.createElement("p");
+ p1.innerHTML=Rico.getPhraseById("calYearRange",this.options.minDate.getFullYear(),this.options.maxDate.getFullYear());
+ var p2=document.createElement("p");
+ this.yearInput=p2.appendChild(document.createElement("input"));
this.yearInput.maxlength=4;
this.yearInput.size=4;
Rico.eventBind(this.yearInput,"keyup", Rico.eventHandle(this,'yearKey'), false);
- c=r.insertCell(-1);
- var a=Rico.floatButton('Checkmark', Rico.eventHandle(this,'processPopUpYear'));
- Rico.setStyle(a.firstChild,{ margin:"0px", padding:"0px", border:"none" });
- c.appendChild(a);
- c=r.insertCell(-1);
+ a=Rico.floatButton('Checkmark', Rico.eventHandle(this,'processPopUpYear'));
+ p2.appendChild(a);
a=Rico.floatButton('Cancel', Rico.eventHandle(this,'popDownYear'));
- Rico.setStyle(a.firstChild,{ margin:"0px", padding:"0px", border:"none" });
- c.appendChild(a);
- this.yearPopup.content.appendChild(tab);
+ p2.appendChild(a);
+ this.yearPopup.content.appendChild(p1);
+ this.yearPopup.content.appendChild(p2);
this.container.appendChild(this.yearPopup.container);
this.yearPopup.container.style.left='';
this.yearPopup.container.style.right='5px';
var a=s.appendChild(document.createElement("a"));
a.className='Rico_leftArrow';
- if (Rico.theme.leftArrowAnchor) Rico.addClass(a,Rico.theme.leftArrowAnchor);
a.appendChild(this.createNavArrow('dec'+section,'left'));
- a=s.appendChild(document.createElement("a"));
- a.style.display='inline';
+ var a=s.appendChild(document.createElement("a"));
Rico.eventBind(a,"click", Rico.eventHandle(this,'popUp'+section), false);
this['title'+section]=a;
a=s.appendChild(document.createElement("a"));
a.className='Rico_rightArrow';
- if (Rico.theme.rightArrowAnchor) Rico.addClass(a,Rico.theme.rightArrowAnchor);
a.appendChild(this.createNavArrow('inc'+section,'right'));
return s
},
createNavArrow: function(funcname,direction) {
var span=document.createElement("span");
span.className=Rico.theme[direction+'Arrow'] || 'rico-icon Rico_'+direction+'Arrow';
+ span.style.display="inline-block";
Rico.eventBind(span,"click", Rico.eventHandle(this,funcname), false);
return span;
},
return;
}
this.popDownMonth();
- this.yearPopup.openPopup(null, this.heading.offsetHeight+2);
this.yearInput.disabled=false;
this.yearInput.value=''; // this.yearSelected
- this.yearInput.focus();
+ this.yearPopup.openPopup(null, this.heading.offsetHeight+2);
+ var self=this;
+ setTimeout(function() { self.yearInput.focus(); }, 10); // ie8 has issues without this delay
return false;
},