71de05a5f48a8e4fcf528288cab34daef80b8156
[myslice.git] / plugins / senslabmap / static / js / senslabmap.js
1 (function($){
2   var SensLabMap = Plugin.extend({
3     init: function(options, element) {
4       this._super(options, element);
5       
6       this.elmt().on('show', this, this.on_show);
7       
8       this.method = query.object;
9       
10       /* Setup query and record handlers */
11       this.listen_query(options.query_uuid);
12       this.listen_query(options.query_all_uuid, 'all');
13
14       /* GUI setup and event binding */
15       this.initialize_map();
16     },
17     
18     initialize_map: function() {
19       console.log("init toto");
20       // TODO: this is static, retrieve directly nodes
21       nodes = nodes_gre;
22       init();
23       parseNodebox();
24     },
25
26     refresh: function() {
27       console.log("refresh");
28       myrender();
29     },
30     
31     on_show: function(e) {
32       /* GUI setup and event binding */
33       e.data.refresh();
34     },
35     
36     on_all_new_record: function(record) {
37       console.log("All New Record : " + record);
38     },
39     
40     on_new_record: function(record) {
41       console.log("New Record : " + record);
42     },
43
44     on_query_in_progress: function()
45     {
46       console.log('on_query_in_progress');
47     },
48     
49     on_query_done: function()
50     {
51       console.log('on_query_done');
52     },
53
54     on_all_query_in_progress: function()
55     {
56       console.log('on_all_query_in_progress');
57     },
58     
59     on_all_query_done: function()
60     {
61       console.log('on_all_query_done');
62     }
63   });
64   $.plugin('SensLabMap', SensLabMap);
65 })(jQuery);