]> git.mxchange.org Git - mailer.git/blob - templates/de/html/js/js_surfbar_member_edit.tpl
First batch of removal of the headers needed for revision-functions.php
[mailer.git] / templates / de / html / js / js_surfbar_member_edit.tpl
1 /**
2  * JavaScript for ext-surfbar - member editing page
3  * --------------------------------------------------------------------
4  * Copyright (c) 2003 - 2009 by Roland Haeder
5  * Copyright (c) 2009 - 2013 by Mailer Developer Team
6  * For more information visit: http://mxchange.org
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21  * MA  02110-1301  USA
22  */
23
24 var limit = document.getElementById('limit');
25 var span = document.getElementById('span_limit');
26 var old_limit = $content[url_views_max];
27
28 function FocusLimitedNo () {
29         if ((limit.value > 0) && (limit.value != '-')) {
30                 old_limit = limit.value;
31         }
32         limit.disabled = true;
33         limit.setAttribute('class', 'disabled');
34         limit.style.textAlign = 'center';
35         limit.value = '-';
36 }
37
38 function FocusLimitedYes () {
39         limit.disabled = false;
40         limit.setAttribute('class', 'form_field');
41         limit.style.textAlign = 'left';
42         if (old_limit > 0) {
43                 limit.value = old_limit;
44         } else {
45                 limit.value = '';
46         }
47         limit.focus();
48 }
49
50 function SubmitForm () {
51         if (limit.value == '-') {
52                 limit.value = 0;
53         }
54         return true;
55 }
56
57 function ResetForm () {
58         old_limit = 0;
59         FocusLimitedNo();
60         return false;
61 }
62
63 if ($content[limited] === true) {
64         FocusLimitedYes();
65 } else {
66         FocusLimitedNo();
67 }
68
69 // Register event listeners
70 $('#edit').submit(function() {
71         return submitForm();
72 });
73
74 $('#reset').click(function() {
75         return resetForm();
76 });