From: Thierry Parmentelat Date: Fri, 15 Nov 2013 11:03:42 +0000 (+0100) Subject: tear down the start_with_spin/need_spin/need-spin thingy X-Git-Tag: myslice-0.3-0~113^2~7^2~7^2~5^2~2 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=2a5654f70a3fdb0ca45382619098a5bea8913bf0 tear down the start_with_spin/need_spin/need-spin thingy plugins can turn their spinner on with on_query_progress --- diff --git a/manifold/static/js/manifold.js b/manifold/static/js/manifold.js index 8c23cf6f..3f514345 100644 --- a/manifold/static/js/manifold.js +++ b/manifold/static/js/manifold.js @@ -346,17 +346,8 @@ var manifold = { // Executes all async. queries - intended for the javascript header to initialize queries // input queries are specified as a list of {'query_uuid': } + // each plugin is responsible for managing its spinner through on_query_in_progress asynchroneous_exec : function (query_exec_tuples) { -// start spinners - be robust if the spin stuff was not loaded for any reason -// turned off because each plugin is responsible for doing that through on_query_in_progress -// try { -// var subjects=$(".need-spin"); -// if (manifold.asynchroneous_debug) { -// messages.debug("Turning on spin with " + subjects.length + " matches for .need-spin"); -// $.map (subjects, function (subject) { messages.debug("need-spin: "+ subject.id);}); -// } -// subjects.spin(manifold.spin_presets); -// } catch (err) { messages.debug("Cannot turn on spins " + err); } // Loop through input array, and use publish_uuid to publish back results $.each(query_exec_tuples, function(index, tuple) { diff --git a/plugins/messages/__init__.py b/plugins/messages/__init__.py index 7ee0c3ce..f765d50d 100644 --- a/plugins/messages/__init__.py +++ b/plugins/messages/__init__.py @@ -41,6 +41,3 @@ class Messages (Plugin): def json_settings_list (self): return [ 'plugin_uuid', 'levels' ] - # and we don't need a spin wheel - def start_with_spin (self): - return False diff --git a/plugins/querycode/__init__.py b/plugins/querycode/__init__.py index 55da3e9c..d46a8421 100644 --- a/plugins/querycode/__init__.py +++ b/plugins/querycode/__init__.py @@ -25,6 +25,3 @@ class QueryCode (Plugin): } def json_settings_list (self): return ['plugin_uuid','query_uuid'] - - # because we have a link to a query it looks like we need a spin, let's make this right - def start_with_spin (self): return False diff --git a/plugins/queryupdater/__init__.py b/plugins/queryupdater/__init__.py index ad345c8f..d74caa32 100644 --- a/plugins/queryupdater/__init__.py +++ b/plugins/queryupdater/__init__.py @@ -15,5 +15,3 @@ class QueryUpdater(Plugin): def json_settings_list (self): return ['plugin_uuid', 'domid', 'query_uuid'] - def export_json_settings (self): - return True diff --git a/plugins/tabs/__init__.py b/plugins/tabs/__init__.py index 6da94da1..d1b9bda3 100644 --- a/plugins/tabs/__init__.py +++ b/plugins/tabs/__init__.py @@ -15,5 +15,3 @@ class Tabs (Composite): def json_settings_list (self): return [] - def export_json_settings(self): - return True diff --git a/unfold/plugin.py b/unfold/plugin.py index 61af0e07..8dd03bb6 100644 --- a/unfold/plugin.py +++ b/unfold/plugin.py @@ -163,10 +163,6 @@ class Plugin: def export_json_settings (self): return 'query_uuid' in self.json_settings_list() - # by default we create a timer if there's a query attached, redefine to change this behaviour - def start_with_spin (self): - return self.export_json_settings() - # returns the html code for that plugin # in essence, wraps the results of self.render_content () def render (self, request): @@ -175,8 +171,6 @@ class Plugin: # shove this into plugin.html env = {} env ['plugin_content']= plugin_content - # need_spin is used in plugin.html - self.need_spin=self.start_with_spin() env.update(self.__dict__) # translate high-level 'toggled' into 4 different booleans self.need_toggle = False @@ -312,6 +306,3 @@ class Plugin: # # whether we export the json settings to js # def export_json_settings (self) - # - # whether we show an initial spinner - # def start_with_spin (self) diff --git a/unfold/templates/plugin.html b/unfold/templates/plugin.html index 354b5608..0c022f68 100644 --- a/unfold/templates/plugin.html +++ b/unfold/templates/plugin.html @@ -1,5 +1,5 @@ {% if visible %} -
+
{% if togglable %}