]> git.datanom.net - qtadmin.git/blame - js/forms.js
First upload of wblist page
[qtadmin.git] / js / forms.js
CommitLineData
6b3d5ba9 1/* vim: set ts=4 tw=0 sw=4 noet: */
24560f82
MR
2
3function updateRowsPerPage() {
573d8075
MR
4 var pos;
5 var url;
6 var base;
7 var href;
24560f82 8 var link = document.getElementsByTagName('a');
573d8075 9 var found = false;
2ad8a6f8
MR
10 var rowsPerPage = document.getElementById("rows");
11
6ec0f098 12 if (rowsPerPage.value == '') {
249acbdd 13 rowsPerPage.value = '20';
2ad8a6f8 14 }
24560f82 15 for (var i = 0; i < link.length; i++) {
573d8075
MR
16 url = link[i].href;
17 pos = url.search('rowsperpage');
67d5e2dd 18 if (pos >= 0) {
8b2ac33e 19 found = true;
573d8075
MR
20 base = url.slice(0, pos);
21 href = base + 'rowsperpage=' + rowsPerPage.value;
e76515ed 22 link[i].href = href;
24560f82
MR
23 }
24 }
573d8075 25 if (found == false) {
f8ecfd25 26 pos = location.href.search('rowsperpage');
774b0894
MR
27 if (pos >= 0) {
28 base = location.href.slice(0, pos);
29 } else {
30 base = location.href;
31 }
6ba40e12 32 if (base.charAt(base.length - 1) == '?') {
f3d5584f
MR
33 href = base + 'rowsperpage=' + rowsPerPage.value;
34 } else {
35 href = base + '?rowsperpage=' + rowsPerPage.value;
36 }
573d8075
MR
37 } else {
38 pos = location.href.search('rowsperpage');
39 base = location.href.slice(0, pos);
40 href = base + 'rowsperpage=' + rowsPerPage.value;
41 }
295514a7 42 location.href = href;
24560f82 43}
This page took 0.081269 seconds and 5 git commands to generate.