Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
Fixes for Internet Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
sander committed Jan 25, 2012
1 parent 81aa86f commit 089a067
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 17 deletions.
33 changes: 19 additions & 14 deletions plapp/static/script/caleftar.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ $(function() {

// Add Mon/Tue/Wed/etc.
$(DAYS).each(function() {
$('<span>').text(this).appendTo($(me).find('.week-days'));
// The '' + this is apparently needed for IE.
$('<span>').text('' + this).appendTo($(me).find('.week-days'));
});

// Month selector.
Expand Down Expand Up @@ -135,16 +136,15 @@ $(function() {
var normal = new Date(year, month);
year = normal.getFullYear();
month = normal.getMonth();

var nDays = new Date(year, month + 1, 0).getDate();

// Contains the day boxes.
var even = !$($(me).find('.month').get(-1)).find('.day')
.hasClass('even');
var div = $('<div class=month>').appendTo($(me).find('.days'))
.addClass('year-' + year).addClass('month-' + month);
$('<span class=which-year>').text(year).appendTo(div);
$('<span class=which-month>').text(month).appendTo(div);
$('<span>').addClass('which-year').text(year).appendTo(div);
$('<span>').addClass('which-month').text(month).appendTo(div);
for (var i = 0; i < nDays; i++)
addDay(year, month, i + 1).addClass(even ? 'even' : 'odd')
.appendTo(div);
Expand All @@ -167,8 +167,10 @@ $(function() {
var div = $('<div class=month>').appendTo($(me).find('.days'))
.addClass('year-' + previous.getFullYear())
.addClass('month-' + previous.getMonth());
$('<span class=which-year>').text(previous.getFullYear()).appendTo(div);
$('<span class=which-month>').text(previous.getMonth()).appendTo(div);
$('<span>').addClass('which-year').text(previous.getFullYear())
.appendTo(div);
$('<span>').addClass('which-month').text(previous.getMonth())
.appendTo(div);
for (var i = firstCurrent - 1; i >= 0; i--)
addDay(previous.getFullYear(), previous.getMonth(),
lastPrevious - i).addClass('odd').appendTo(div);
Expand Down Expand Up @@ -355,8 +357,9 @@ $(function() {

$('.time-picker').click(preventScroll);

$('<a class=enter>').appendTo(content).click(add);
$('<span class=close>').appendTo($(me).find('.popup')).click(function() {
$('<a>').addClass('enter').appendTo(content).click(add);
$('<span>').addClass('close').appendTo($(me).find('.popup'))
.click(function() {
closePopup();
return false;
});
Expand All @@ -383,9 +386,9 @@ $(function() {

var elt = $('<div class=date>').addClass('time-' + full)
.appendTo($(me).find('.selected-times'));
$('<span class=which-time>').text(full).appendTo(elt);
$('<span class=readable>').text(formatDate(date)).appendTo(elt);
$('<a class=date-delete>').text('×').appendTo(elt);
$('<span>').addClass('which-time').text(full).appendTo(elt);
$('<span>').addClass('readable').text(formatDate(date)).appendTo(elt);
$('<a>').addClass('date-delete').text('×').appendTo(elt);

updateTimes();
updateDay(year, month, day);
Expand All @@ -402,12 +405,14 @@ $(function() {
var time = parseInt($(this).text());
if (time < begin || time > end) return;

var box = $('<span class=time-box>').text(formatTime(new Date(time)))
var box = $('<span>').addClass('time-box')
.text(formatTime(new Date(time)))
.appendTo($(me).find('.popup-times'));
$('<span class=which-time>').text(new Date(time).getTime())
$('<span>').addClass('which-time').text(new Date(time).getTime())
.appendTo(box);

$('<a class=time-delete>').text('×').appendTo(box).click(function() {
$('<a>').addClass('time-delete').text('×').appendTo(box)
.click(function() {
deleteTime(time);
updateTimes();
updateDay(year, month, day);
Expand Down
1 change: 1 addition & 0 deletions plapp/static/script/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,6 @@ $(function() {
});
$('.popup > p a').click(function() {
$('.popup').toggleClass('open', false);
$('.popup > div').html('');
});
});
5 changes: 3 additions & 2 deletions plapp/static/script/textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $(function() {
// Add support for HTML5's maxlength if needed.
if (document.createElement('textarea').maxLength == undefined) {
$(this).keyup(function() {
$(this).val(text.substr(0, $(this)).attr('maxlength'));
$(this).val($(this).val().substr(0, $(this).attr('maxlength')));
});
}

Expand All @@ -43,7 +43,8 @@ $(function() {
} else $(this).height(minimum);
};

$(this).css('lineHeight', lineHeight + 'px').height(minimum).keyup(this.setHeight);
$(this).css('lineHeight', lineHeight + 'px').height(minimum)
.keyup(this.setHeight);

this.setHeight();
});
Expand Down
2 changes: 2 additions & 0 deletions plapp/static/style/caleftar.css
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
line-height: 16px;
padding-left: .3em;
color: #fff;
margin-top: -15px;
}
.date-time-picker .which-month, .which-year, .which-time {
display: none;
Expand All @@ -239,6 +240,7 @@
left: 91px;
cursor: pointer;
top: 18px;
z-index: 3;
}
.date-time-picker .enter:active {
background: url(../images/dp-enter-pressed.png);
Expand Down
2 changes: 2 additions & 0 deletions plapp/static/style/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ body {
text-decoration: none;
font-size: 36px;
cursor: pointer;
z-index: 3;
position: relative;
}
.side-help .popup > h1 {
font-size: 16px;
Expand Down
4 changes: 4 additions & 0 deletions plapp/static/style/ie7.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
float: left;
}

.side-help .popup > p a {
margin-top: -8px !important;
}

#appointment .date-balloon .arrow {
margin-left: 147px;
}
Expand Down
1 change: 1 addition & 0 deletions plapp/static/style/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ a img {
list-style: none;
padding: 0;
z-index: 2;
margin-left: 0;
}
.menu-bar .menu.open ul li {
overflow: hidden;
Expand Down
2 changes: 1 addition & 1 deletion plapp/templates/plapp/appointment.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h3>{{ tool.title }}</h3>
{{ field.label_tag }}: {{ field }}
{% endif %}
{% endfor %}
<button>{{ tool.submit_text }}</button>
<button type=submit>{{ tool.submit_text }}</button>
<span class=success></span>
<span class=error></span>
</div>
Expand Down

0 comments on commit 089a067

Please sign in to comment.