mirror of https://github.com/django/django.git
Fixed #658 -- Fixed JavaScript calendar widget in IE. Thanks for the patch, kieranholland
git-svn-id: http://code.djangoproject.com/svn/django/trunk@977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
a102942d7a
commit
d8b8367494
|
@ -77,13 +77,15 @@ var DateTimeShortcuts = {
|
||||||
addEvent(clock_box, 'click', DateTimeShortcuts.cancelEventPropagation);
|
addEvent(clock_box, 'click', DateTimeShortcuts.cancelEventPropagation);
|
||||||
|
|
||||||
quickElement('h2', clock_box, 'Choose a time');
|
quickElement('h2', clock_box, 'Choose a time');
|
||||||
time_list = quickElement('ul', clock_box, '', 'class', 'timelist');
|
time_list = quickElement('ul', clock_box, '');
|
||||||
|
time_list.className = 'timelist';
|
||||||
quickElement("a", quickElement("li", time_list, ""), "Now", "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinute());")
|
quickElement("a", quickElement("li", time_list, ""), "Now", "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinute());")
|
||||||
quickElement("a", quickElement("li", time_list, ""), "Midnight", "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '00:00');")
|
quickElement("a", quickElement("li", time_list, ""), "Midnight", "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '00:00');")
|
||||||
quickElement("a", quickElement("li", time_list, ""), "6 a.m.", "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '06:00');")
|
quickElement("a", quickElement("li", time_list, ""), "6 a.m.", "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '06:00');")
|
||||||
quickElement("a", quickElement("li", time_list, ""), "Noon", "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '12:00');")
|
quickElement("a", quickElement("li", time_list, ""), "Noon", "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '12:00');")
|
||||||
|
|
||||||
cancel_p = quickElement('p', clock_box, '', 'class', 'calendar-cancel');
|
cancel_p = quickElement('p', clock_box, '');
|
||||||
|
cancel_p.className = 'calendar-cancel';
|
||||||
quickElement('a', cancel_p, 'Cancel', 'href', 'javascript:DateTimeShortcuts.dismissClock(' + num + ');');
|
quickElement('a', cancel_p, 'Cancel', 'href', 'javascript:DateTimeShortcuts.dismissClock(' + num + ');');
|
||||||
},
|
},
|
||||||
openClock: function(num) {
|
openClock: function(num) {
|
||||||
|
@ -147,8 +149,10 @@ var DateTimeShortcuts = {
|
||||||
|
|
||||||
// next-prev links
|
// next-prev links
|
||||||
var cal_nav = quickElement('div', cal_box, '');
|
var cal_nav = quickElement('div', cal_box, '');
|
||||||
quickElement('a', cal_nav, '<', 'class', 'calendarnav-previous', 'href', 'javascript:DateTimeShortcuts.drawPrev('+num+');');
|
var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', 'javascript:DateTimeShortcuts.drawPrev('+num+');');
|
||||||
quickElement('a', cal_nav, '>', 'class', 'calendarnav-next', 'href', 'javascript:DateTimeShortcuts.drawNext('+num+');');
|
cal_nav_prev.className = 'calendarnav-previous';
|
||||||
|
var cal_nav_next = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNext('+num+');');
|
||||||
|
cal_nav_next.className = 'calendarnav-next';
|
||||||
cal_box.appendChild(cal_nav);
|
cal_box.appendChild(cal_nav);
|
||||||
|
|
||||||
// main box
|
// main box
|
||||||
|
@ -158,7 +162,8 @@ var DateTimeShortcuts = {
|
||||||
DateTimeShortcuts.calendars[num].drawCurrent();
|
DateTimeShortcuts.calendars[num].drawCurrent();
|
||||||
|
|
||||||
// calendar shortcuts
|
// calendar shortcuts
|
||||||
var shortcuts = quickElement('div', cal_box, '', 'class', 'calendar-shortcuts');
|
var shortcuts = quickElement('div', cal_box, '');
|
||||||
|
shortcuts.className = 'calendar-shortcuts';
|
||||||
quickElement('a', shortcuts, 'Yesterday', 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', -1);');
|
quickElement('a', shortcuts, 'Yesterday', 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', -1);');
|
||||||
shortcuts.appendChild(document.createTextNode('\240|\240'));
|
shortcuts.appendChild(document.createTextNode('\240|\240'));
|
||||||
quickElement('a', shortcuts, 'Today', 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);');
|
quickElement('a', shortcuts, 'Today', 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);');
|
||||||
|
@ -166,7 +171,8 @@ var DateTimeShortcuts = {
|
||||||
quickElement('a', shortcuts, 'Tomorrow', 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', +1);');
|
quickElement('a', shortcuts, 'Tomorrow', 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', +1);');
|
||||||
|
|
||||||
// cancel bar
|
// cancel bar
|
||||||
var cancel_p = quickElement('p', cal_box, '', 'class', 'calendar-cancel');
|
var cancel_p = quickElement('p', cal_box, '');
|
||||||
|
cancel_p.className = 'calendar-cancel';
|
||||||
quickElement('a', cancel_p, 'Cancel', 'href', 'javascript:DateTimeShortcuts.dismissCalendar(' + num + ');');
|
quickElement('a', cancel_p, 'Cancel', 'href', 'javascript:DateTimeShortcuts.dismissCalendar(' + num + ');');
|
||||||
},
|
},
|
||||||
openCalendar: function(num) {
|
openCalendar: function(num) {
|
||||||
|
|
|
@ -65,7 +65,8 @@ var CalendarNamespace = {
|
||||||
// Draw blanks before first of month
|
// Draw blanks before first of month
|
||||||
tableRow = quickElement('tr', tableBody);
|
tableRow = quickElement('tr', tableBody);
|
||||||
for (var i = 0; i < startingPos; i++) {
|
for (var i = 0; i < startingPos; i++) {
|
||||||
quickElement('td', tableRow, ' ', 'bgcolor','#f3f3f3');
|
var _cell = quickElement('td', tableRow, ' ');
|
||||||
|
_cell.style.backgroundColor = '#f3f3f3';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw days of month
|
// Draw days of month
|
||||||
|
@ -81,7 +82,8 @@ var CalendarNamespace = {
|
||||||
|
|
||||||
// Draw blanks after end of month (optional, but makes for valid code)
|
// Draw blanks after end of month (optional, but makes for valid code)
|
||||||
while (tableRow.childNodes.length < 7) {
|
while (tableRow.childNodes.length < 7) {
|
||||||
quickElement('td', tableRow, ' ', 'bgcolor','#f3f3f3');
|
var _cell = quickElement('td', tableRow, ' ');
|
||||||
|
_cell.style.backgroundColor = '#f3f3f3';
|
||||||
}
|
}
|
||||||
|
|
||||||
calDiv.appendChild(calTable);
|
calDiv.appendChild(calTable);
|
||||||
|
|
Loading…
Reference in New Issue