some server side xul
[working/Evergreen.git] / Open-ILS / xul / staff_client / server / main / menu.js
1 dump('entering main/menu.js\n');
2
3 if (typeof main == 'undefined') main = {};
4 main.menu = function () {
5
6         JSAN.use('util.error'); this.error = new util.error();
7         this.error.sdump('D_ERROR',window);
8
9 }
10
11 main.menu.prototype = {
12
13         'init' : function() {
14
15                 var obj = this;
16
17                 var cmd_close_window = window.document.getElementById('cmd_close_window');
18                         if (cmd_close_window) {
19                                 this.error.sdump('D_TRACE', 'cmd_close_window = ' + cmd_close_window );
20                                 cmd_close_window.addEventListener('command', function() { dump('hiccup\n'); alert('help'); window.close(); }, false);
21                         }
22                         
23                 var test_button = window.document.getElementById('cmd_test_button');
24                         if (test_button) {
25                                 this.error.sdump('D_TRACE', 'test_button = ' + test_button );
26                                 test_button.addEventListener('command', function() { dump('hiccup\n'); alert('help'); window.close(); }, false);
27                         }
28
29                 var cmd_new_window = window.document.getElementById('cmd_new_window');
30                         if (cmd_new_window)
31                                 cmd_new_window.addEventListener('command', function() { alert('Not Yet Implemented'); }, false);
32
33                 var cmd_broken = window.document.getElementById('cmd_broken');
34                         if (cmd_broken)
35                                 cmd_broken.addEventListener('command', function() { alert('Not Yet Implemented'); }, false);
36                 
37         },
38
39         'close_tab' : function (t_idx) {
40         }
41
42 }
43
44 dump('exiting main/menu.js\n');