Skip to content

Commit 7da5001

Browse files
author
Richard Jones
committed
make popup Javascript IE 5.0 friendly (thanks Marlon van den Berg)
1 parent 0d42029 commit 7da5001

File tree

3 files changed

+17
-55
lines changed

3 files changed

+17
-55
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Fixed:
99
- fix user creation page
1010
- have roundup server pass though the cause of a "403 Forbidden" response
1111
- fix schema mutation in sqlite backends (thanks Tamer Fahmy)
12+
- make popup Javascript IE 5.0 friendly (thanks Marlon van den Berg)
1213

1314

1415
2004-05-06 0.7.0

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Thanks also to the many people on the mailing list, in the sourceforge
6464
project and those who just report bugs:
6565
Thomas Arendsen Hein,
6666
Anthony Baxter,
67+
Marlon van den Berg,
6768
Bo Berglund,
6869
Cameron Blackwood,
6970
Jeff Blaine,

templates/classic/html/help_controls.js

Lines changed: 15 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,6 @@
33

44
original_field = window.opener.document.itemSynopsis[field].value;
55

6-
7-
// pop() and push() methods for pre5.5 IE browsers
8-
9-
function bName() {
10-
// test for IE
11-
if (navigator.appName == "Microsoft Internet Explorer")
12-
return 1;
13-
return 0;
14-
}
15-
16-
function bVer() {
17-
// return version number (e.g., 4.03)
18-
msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
19-
return(parseFloat(navigator.appVersion.substr(msieIndex,3)));
20-
}
21-
22-
function pop() {
23-
// make a pop method for old IE browsers
24-
var lastElement = this[this.length - 1];
25-
this.length--;
26-
return lastElement;
27-
}
28-
29-
function push() {
30-
// make a pop method for old IE browsers
31-
var sub = this.length;
32-
for (var i = 0; i < push.arguments.length; ++i) {
33-
this[sub] = push.arguments[i];
34-
sub++;
35-
}
36-
}
37-
38-
// add the pop() and push() method to Array if they're not there
39-
if (!Array.prototype.pop) {
40-
Array.prototype.pop = pop;
41-
}
42-
if (!Array.prototype.push) {
43-
Array.prototype.push = push;
44-
}
45-
466
function trim(value) {
477
var temp = value;
488
var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
@@ -53,21 +13,21 @@ function trim(value) {
5313
}
5414

5515
function determineList() {
56-
// generate a comma-separated list of the checked items
57-
if (document.frm_help.check==undefined) { return; }
58-
var list = new Array();
59-
if (document.frm_help.check.length==undefined) {
60-
if (document.frm_help.check.checked) {
61-
list.push(document.frm_help.check.value);
62-
}
63-
} else {
64-
for (box=0; box < document.frm_help.check.length; box++) {
65-
if (document.frm_help.check[box].checked) {
66-
list.push(document.frm_help.check[box].value);
67-
}
68-
}
69-
}
70-
return new String(list.join(','));
16+
// generate a comma-separated list of the checked items
17+
var list = new String('');
18+
for (box=0; box < document.frm_help.check.length; box++) {
19+
if (document.frm_help.check[box].checked) {
20+
if (list.length == 0) {
21+
separator = '';
22+
}
23+
else {
24+
separator = ',';
25+
}
26+
// we used to use an Array and push / join, but IE5.0 sux
27+
list = list + separator + document.frm_help.check[box].value;
28+
}
29+
}
30+
return list;
7131
}
7232

7333
function updateList() {

0 commit comments

Comments
 (0)