X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=unfold%2Fplugin.py;h=229f196c3bf6a2dd5d889f8c99c8512114dce3d9;hb=350a118a4f8e3329f39fe7f245cb27388a3756f0;hp=61af0e078d7732a87db44441a7e77f97bafa417b;hpb=ceaa4271ec96d47dc4e8d1eb727d82364a9032aa;p=myslice.git diff --git a/unfold/plugin.py b/unfold/plugin.py index 61af0e07..229f196c 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 @@ -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)