1 |
slords |
1.1 |
diff -Nur -x '*.orig' -x '*.rej' turba-h3-2.1.4/templates/browse/javascript.inc mezzanine_patched_turba-h3-2.1.4/templates/browse/javascript.inc |
2 |
|
|
--- turba-h3-2.1.4/templates/browse/javascript.inc 2005-10-18 06:50:18.000000000 -0600 |
3 |
|
|
+++ mezzanine_patched_turba-h3-2.1.4/templates/browse/javascript.inc 2007-03-29 22:04:40.000000000 -0600 |
4 |
|
|
@@ -1,97 +1,89 @@ |
5 |
|
|
<script type="text/javascript"> |
6 |
|
|
-<!-- |
7 |
|
|
|
8 |
|
|
function AnySelected() |
9 |
|
|
{ |
10 |
|
|
- for (i = 0; i < document.contacts.elements.length; i++) { |
11 |
|
|
- if (document.contacts.elements[i].checked) { |
12 |
|
|
- return true; |
13 |
|
|
- } |
14 |
|
|
- } |
15 |
|
|
- return false; |
16 |
|
|
+for (i = 0; i < document.contacts.elements.length; i++) { |
17 |
|
|
+if (document.contacts.elements[i].checked) { |
18 |
|
|
+return true; |
19 |
|
|
+} |
20 |
|
|
+} |
21 |
|
|
+return false; |
22 |
|
|
} |
23 |
|
|
|
24 |
|
|
function Add(select) |
25 |
|
|
{ |
26 |
|
|
- if (!AnySelected()) { |
27 |
|
|
- window.alert('<?php echo addslashes(_("You must select at least one entry first.")) ?>'); |
28 |
|
|
- return false; |
29 |
|
|
- } |
30 |
|
|
- |
31 |
|
|
- key = select[select.selectedIndex].value; |
32 |
|
|
- if (key == '') { |
33 |
|
|
- alert('<?php echo addslashes(_("You must select a target list.")) ?>'); |
34 |
|
|
- return false; |
35 |
|
|
- } |
36 |
|
|
- |
37 |
|
|
- if (key.indexOf(':') == -1 || key.lastIndexOf(':') == key.length - 1) { |
38 |
|
|
- var newList = window.prompt('<?php echo addslashes(_("Please name the new contact list:")) ?>\n', ''); |
39 |
|
|
- if (newList != null && newList != '') { |
40 |
|
|
- if (key.lastIndexOf(':') == key.length - 1) { |
41 |
|
|
- key = key.substr(0, key.length - 1); |
42 |
|
|
- } |
43 |
|
|
- document.contacts.source.value = key; |
44 |
|
|
- document.contacts.targetNew.value = 1; |
45 |
|
|
- document.contacts.targetList.value = newList; |
46 |
|
|
- } else { |
47 |
|
|
- return false; |
48 |
|
|
- } |
49 |
|
|
- } else { |
50 |
|
|
- document.contacts.targetList.value = key; |
51 |
|
|
- } |
52 |
|
|
+if (!AnySelected()) { |
53 |
|
|
+window.alert('<?php echo addslashes(_("You must select at least one entry first.")) ?>'); |
54 |
|
|
+return false; |
55 |
|
|
+} |
56 |
|
|
+ |
57 |
|
|
+key = select[select.selectedIndex].value; |
58 |
|
|
+if (key == '') { |
59 |
|
|
+alert('<?php echo addslashes(_("You must select a target list.")) ?>'); |
60 |
|
|
+return false; |
61 |
|
|
+} |
62 |
|
|
|
63 |
|
|
- Submit('add'); |
64 |
|
|
+if (key.indexOf(':') == -1 || key.lastIndexOf(':') == key.length - 1) { |
65 |
|
|
+var newList = window.prompt('<?php echo addslashes(_("Please name the new contact list:")) ?>\n', ''); |
66 |
|
|
+if (newList != null && newList != '') { |
67 |
|
|
+if (key.lastIndexOf(':') == key.length - 1) { |
68 |
|
|
+key = key.substr(0, key.length - 1); |
69 |
|
|
+} |
70 |
|
|
+document.contacts.targetAddressbook.value = key; |
71 |
|
|
+document.contacts.targetNew.value = 1; |
72 |
|
|
+document.contacts.targetList.value = newList; |
73 |
|
|
+} else { |
74 |
|
|
+return false; |
75 |
|
|
+} |
76 |
|
|
+} else { |
77 |
|
|
+document.contacts.targetList.value = key; |
78 |
|
|
+} |
79 |
|
|
+ |
80 |
|
|
+Submit('add'); |
81 |
|
|
} |
82 |
|
|
|
83 |
|
|
function CopyMove(action, select) |
84 |
|
|
{ |
85 |
|
|
- if (!AnySelected()) { |
86 |
|
|
- window.alert('<?php echo addslashes(_("You must select at least one entry first.")) ?>'); |
87 |
|
|
- return false; |
88 |
|
|
- } |
89 |
|
|
- |
90 |
|
|
- key = select[select.selectedIndex].value; |
91 |
|
|
- if (key == '') { |
92 |
|
|
- alert('<?php echo addslashes(_("You must select a target address book.")) ?>'); |
93 |
|
|
- return false; |
94 |
|
|
- } |
95 |
|
|
+if (!AnySelected()) { |
96 |
|
|
+window.alert('<?php echo addslashes(_("You must select at least one entry first.")) ?>'); |
97 |
|
|
+return false; |
98 |
|
|
+} |
99 |
|
|
+ |
100 |
|
|
+key = select[select.selectedIndex].value; |
101 |
|
|
+if (key == '') { |
102 |
|
|
+alert('<?php echo addslashes(_("You must select a target address book.")) ?>'); |
103 |
|
|
+return false; |
104 |
|
|
+} |
105 |
|
|
|
106 |
|
|
- document.contacts.targetAddressbook.value = key; |
107 |
|
|
- Submit(action); |
108 |
|
|
+document.contacts.targetAddressbook.value = key; |
109 |
|
|
+Submit(action); |
110 |
|
|
} |
111 |
|
|
|
112 |
|
|
function Submit(action) |
113 |
|
|
{ |
114 |
|
|
- if (AnySelected()) { |
115 |
|
|
- if (action != 'delete' || |
116 |
|
|
- confirm('<?php echo addslashes(_("Are you sure that you want to delete the selected entries?")) ?>')) { |
117 |
|
|
- document.contacts.actionID.value = action; |
118 |
|
|
- document.contacts.submit(); |
119 |
|
|
- } |
120 |
|
|
- } else { |
121 |
|
|
- window.alert('<?php echo addslashes(_("You must select at least one entry first.")) ?>'); |
122 |
|
|
- return false; |
123 |
|
|
- } |
124 |
|
|
-} |
125 |
|
|
- |
126 |
|
|
-function Sort(col, direction) |
127 |
|
|
-{ |
128 |
|
|
- document.contacts.sortby.value = col; |
129 |
|
|
- document.contacts.sortdir.value = direction; |
130 |
|
|
- document.contacts.submit(); |
131 |
|
|
+if (AnySelected()) { |
132 |
|
|
+if (action != 'delete' || |
133 |
|
|
+confirm('<?php echo addslashes(_("Are you sure that you want to delete the selected entries?")) ?>')) { |
134 |
|
|
+document.contacts.actionID.value = action; |
135 |
|
|
+document.contacts.submit(); |
136 |
|
|
+} |
137 |
|
|
+} else { |
138 |
|
|
+window.alert('<?php echo addslashes(_("You must select at least one entry first.")) ?>'); |
139 |
|
|
+return false; |
140 |
|
|
+} |
141 |
|
|
} |
142 |
|
|
|
143 |
|
|
function SelectAll() |
144 |
|
|
{ |
145 |
|
|
- for (i = 0; i < document.contacts.elements.length; i++) { |
146 |
|
|
- document.contacts.elements[i].checked = document.contacts.checkAll.checked; |
147 |
|
|
- } |
148 |
|
|
+for (var i = 0; i < document.contacts.elements.length; i++) { |
149 |
|
|
+document.contacts.elements[i].checked = document.contacts.checkAll.checked; |
150 |
|
|
+} |
151 |
|
|
} |
152 |
|
|
|
153 |
|
|
function confirmDelete(name) |
154 |
|
|
{ |
155 |
|
|
- return confirm('<?php echo addslashes(_("Are you sure that you want to delete %s?")) ?>'.replace('%s', name)); |
156 |
|
|
+return confirm('<?php echo addslashes(_("Are you sure that you want to delete %s?")) ?>'.replace('%s', name)); |
157 |
|
|
} |
158 |
|
|
|
159 |
|
|
-//--> |
160 |
|
|
</script> |
161 |
|
|
+ |