updated gmaps plugin
[myslice.git] / plugins / queryupdater / static / js / queryupdater.js
index 4bd5189..8e5793a 100644 (file)
 
     var QueryUpdaterPlugin = Plugin.extend({
 
+        /**************************************************************************
+         *                          CONSTRUCTOR
+         **************************************************************************/
+
         init: function(options, element) {
                this.classname="queryupdater";
             this._super(options, element);
         },
 
      
-        do_update: function(e) {
-            var self = e.data;
-
-            var username = e.data.options.username;
-            var urn = data.value;
-            // XXX check that the query is not disabled
-
-            self.spin();
-            console.log("do_update");
-            // XXX check that the query is not disabled
-            //manifold.raise_event(self.options.query_uuid, RUN_UPDATE);
-
-            // how to stop the spinning after the event? 
-            // this should be triggered by some on_updatequery_done ?
-
-        },
-
-       // related buttons are also disabled in the html template
-        do_refresh: function(e)
-        {
-            throw 'resource_selected.do_refresh Not implemented';
-        },
-
-        do_reset: function(e)
-        {
-            throw 'queryupdater.do_reset Not implemented';
-        },
+        /************************** GUI MANIPULATION **************************/
 
-        do_clear_annotations: function(e)
+        populate_table: function()
         {
-            throw 'queryupdater.do_clear_annotations Not implemented';
+            // Loop over records and display pending ones
+            manifold.query_store.iter_records(this.options.query_uuid, function (record_key, record) {
+            }
         },
         
-        /************************** GUI MANIPULATION **************************/
-
-        
         set_button_state: function(name, state)
         {
             this.elmt(name).attr('disabled', state ? false : 'disabled');
             }
         },
 
-        /*************************** QUERY HANDLER ****************************/
+        do_update: function(e) {
+            var self = e.data;
+
+            var username = e.data.options.username;
+            var urn = data.value;
+            // XXX check that the query is not disabled
+
+            self.spin();
+            console.log("do_update");
+            // XXX check that the query is not disabled
+            //manifold.raise_event(self.options.query_uuid, RUN_UPDATE);
+
+            // how to stop the spinning after the event? 
+            // this should be triggered by some on_updatequery_done ?
+
+        },
+
+        // related buttons are also disabled in the html template
+        do_refresh: function(e)
+        {
+            throw 'resource_selected.do_refresh Not implemented';
+        },
 
-        // NONE
+        do_reset: function(e)
+        {
+            throw 'queryupdater.do_reset Not implemented';
+        },
 
-        /*************************** RECORD HANDLER ***************************/
+        do_clear_annotations: function(e)
+        {
+            throw 'queryupdater.do_clear_annotations Not implemented';
+        },
+        
+       /**************************************************************************
+        *                           QUERY HANDLERS
+        **************************************************************************/ 
 
         on_new_record: function(record)
         {
 
         on_query_in_progress: function()
         {
-               messages.debug("queryupdater.on_query_in_progress");
             this.spin();
         },
 
                     this.selected_resources.splice(i,1);
                 }
             }
-            messages.debug(result)
-
             this.set_state(result);
         },