X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fqueryupdater%2Fstatic%2Fjs%2Fqueryupdater.js;h=8e5793a147c7cdbe7616a9eff0075044b37e5ab1;hb=aa4d616f76726d8ace17518a11dd603856674d85;hp=4bd5189f639e168c926ebc754d312a7172c453ad;hpb=d81f5f5ca87b6eba05adb93cd27ac3c9952cc294;p=myslice.git diff --git a/plugins/queryupdater/static/js/queryupdater.js b/plugins/queryupdater/static/js/queryupdater.js index 4bd5189f..8e5793a1 100644 --- a/plugins/queryupdater/static/js/queryupdater.js +++ b/plugins/queryupdater/static/js/queryupdater.js @@ -28,6 +28,10 @@ var QueryUpdaterPlugin = Plugin.extend({ + /************************************************************************** + * CONSTRUCTOR + **************************************************************************/ + init: function(options, element) { this.classname="queryupdater"; this._super(options, element); @@ -299,42 +303,15 @@ }, - 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'); @@ -457,11 +434,42 @@ } }, - /*************************** 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) { @@ -532,7 +540,6 @@ on_query_in_progress: function() { - messages.debug("queryupdater.on_query_in_progress"); this.spin(); }, @@ -586,8 +593,6 @@ this.selected_resources.splice(i,1); } } - messages.debug(result) - this.set_state(result); },