]>
Commit | Line | Data |
---|---|---|
1 | /* vim: set ts=4 tw=4 sw=4 noet: */ | |
2 | ||
3 | function updateRowsPerPage() { | |
4 | var pos; | |
5 | var url; | |
6 | var base; | |
7 | var href; | |
8 | var rowsPerPage = document.getElementById("rows"); | |
9 | var link = document.getElementsByTagName('a'); | |
10 | var found = false; | |
11 | for (var i = 0; i < link.length; i++) { | |
12 | url = link[i].href; | |
13 | pos = url.search('rowsperpage'); | |
14 | if (pos >= 0) { | |
15 | found = true; | |
16 | base = url.slice(0, pos); | |
17 | href = base + 'rowsperpage=' + rowsPerPage.value; | |
18 | link[i].href = href; | |
19 | } | |
20 | } | |
21 | if (found == false) { | |
22 | pos = location.href.search('rowsperpage'); | |
23 | if (pos >= 0) { | |
24 | base = location.href.slice(0, pos); | |
25 | } else { | |
26 | base = location.href; | |
27 | } | |
28 | if (location.href.charAt(location.href.length) == '?') { | |
29 | href = base + 'rowsperpage=' + rowsPerPage.value; | |
30 | } else { | |
31 | href = base + '?rowsperpage=' + rowsPerPage.value; | |
32 | } | |
33 | } else { | |
34 | pos = location.href.search('rowsperpage'); | |
35 | base = location.href.slice(0, pos); | |
36 | href = base + 'rowsperpage=' + rowsPerPage.value; | |
37 | } | |
38 | location.href = href; | |
39 | } |