Merge branch 'master' of ssh://git.onelab.eu/git/myslice
[myslice.git] / unfold / plugin.py
index 61af0e0..229f196 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
@@ -201,7 +195,8 @@ class Plugin:
             env ['settings_json' ] = self.settings_json()
             # compute plugin-specific initialization
             js_init = render_to_string ( 'plugin-init.js', env )
-            self.add_js_chunks (js_init)
+            # make sure this happens first in js
+            self.add_js_init_chunks (js_init)
         
         # interpret the result of requirements ()
         self.handle_requirements (request)
@@ -258,6 +253,8 @@ class Plugin:
     @to_prelude
     def add_css_files (self):pass
     @to_prelude
+    def add_js_init_chunks (self):pass
+    @to_prelude
     def add_js_chunks (self):pass
     @to_prelude
     def add_css_chunks (self):pass
@@ -312,6 +309,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)