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