add skeleton for senslabmap plugin
[unfold.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       /* Member variables */
7       // query status
8       this.received_all = false;
9       this.received_set = false;
10       this.in_set_buffer = Array();
11       
12       this.el().on('show', this, this.on_show);
13       
14       var query = manifold.query_store.find_analyzed_query(options.query_uuid);
15       this.method = query.object;
16       
17       var keys = manifold.metadata.get_key(this.method);
18       this.key = (keys && keys.length == 1) ? keys[0] : null;
19       
20       /* Setup query and record handlers */
21       this.listen_query(options.query_uuid);
22       this.listen_query(options.query_uuid, 'all');
23       
24       /* GUI setup and event binding */
25       this.initialize_map();
26     },
27     
28     initialize_map: function() {
29       // TODO: this is static, retrieve directly nodes
30       nodes = nodes_gre;
31       init();
32       parseNodebox();
33     },
34     
35     on_show: function(e) {
36       // TODO
37     },
38     
39     on_filter_added: function(filter) {
40       console.log(filter);
41     },
42     
43     on_new_record: function(record) {
44       console.log(record);
45     },
46     
47     on_record_received: function(record) {
48       console.log(record);
49     },
50   });
51   $.plugin('SensLabMap', SensLabMap);
52 })(jQuery);