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

Last change on this file since 4329 was 4329, checked in by LucMorizur, 14 years ago

[Event Cats] Finish duplication management, configuration management, code cleaning

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