source: extensions/event_cats/admin/template/config.js @ 7832

Last change on this file since 7832 was 7832, checked in by LucMorizur, 13 years ago

Some cosmetic corrections

File size: 1.3 KB
Line 
1/* Event Cats Javascript functions LucMorizur June 2009 - ... */
2
3// Keeps file coded in UTF-8 without BOM: é
4
5// All variables declarations
6// Once this entire file has been read, some JS code is executed at the end
7// of .tpl file, thus some values below are modified during the HTML page
8// "reading and displaying"
9var ec_JS_message      = '';
10var ec_selected_AP     = '-1';
11var ec_selected_action = '-1';
12
13function de(ec_id) {
14  return document.getElementById(ec_id);
15}
16
17function ec_check_exist_value(ec_id, ec_val) {
18  var e = document.getElementById(ec_id);
19  for (var i = 0; i < e.length; i++) {
20    if (e.options[i].value == ec_val) return true;
21  }
22  return false;
23}
24
25function ec_mark_action(ec_id) {
26  de(ec_id).checked = 'checked';
27  if (de('ec_unknown_2_id').checked == '')
28   de('ec_in_up_aps_id').selectedIndex = '-1';
29  else {
30    if (!ec_check_exist_value('ec_in_up_aps_id', ec_selected_AP)) {
31      de('ec_in_up_aps_id').selectedIndex = '-1';
32      ec_selected_AP = '-1';
33    }
34    else de('ec_in_up_aps_id').value = ec_selected_AP;
35  }
36}
37
38function ec_check_submit() {
39  if (
40    document.getElementById('ec_unknown_2_id').checked != '' &&
41    document.getElementById('ec_in_up_aps_id').selectedIndex == '-1'
42  ) {
43    alert(ec_JS_message);
44    return false;
45  }
46}
47
Note: See TracBrowser for help on using the repository browser.