tear down the start_with_spin/need_spin/need-spin thingy
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 15 Nov 2013 11:03:42 +0000 (12:03 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 15 Nov 2013 11:03:42 +0000 (12:03 +0100)
plugins can turn their spinner on with on_query_progress

manifold/static/js/manifold.js
plugins/messages/__init__.py
plugins/querycode/__init__.py
plugins/queryupdater/__init__.py
plugins/tabs/__init__.py
unfold/plugin.py
unfold/templates/plugin.html

index 8c23cf6..3f51434 100644 (file)
@@ -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': <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) {
index 7ee0c3c..f765d50 100644 (file)
@@ -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
index 55da3e9..d46a842 100644 (file)
@@ -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
index ad345c8..d74caa3 100644 (file)
@@ -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
index 6da94da..d1b9bda 100644 (file)
@@ -15,5 +15,3 @@ class Tabs (Composite):
     def json_settings_list (self):
         return []
 
-    def export_json_settings(self):
-        return True
index 61af0e0..8dd03bb 100644 (file)
@@ -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)
index 354b560..0c022f6 100644 (file)
@@ -1,5 +1,5 @@
 {% if visible %}
-<div id='complete-{{ domid }}' class='{% if need_toggle %}plugin-toggle{% endif %}{% if need_spin %} need-spin{% endif %}{% if persistent_toggle %} persistent-toggle{% endif %}{% if outline_complete %} plugin-outline-complete{% endif %}'>
+<div id='complete-{{ domid }}' class='{% if need_toggle %}plugin-toggle{% endif %}{% if persistent_toggle %} persistent-toggle{% endif %}{% if outline_complete %} plugin-outline-complete{% endif %}'>
 {% if togglable %}
 <h4 id='show-{{ domid }}' class='plugin-show'{% if not display_show_button %} style='display:none;'{% endif %}>
 <span class="glyphicon glyphicon-chevron-right"></span>