X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=unfold%2Fpage.py;h=07ce237a3aa02467bd3d0503cf111db2853439b5;hb=65c555f623a08d7b84d86efff99436633d1e3436;hp=c61d1593c37e59f3d8f11b92d055c9c8512fc473;hpb=b0cb7f9e40e595ae15037bcbbc853de2fc268563;p=myslice.git diff --git a/unfold/page.py b/unfold/page.py index c61d1593..07ce237a 100644 --- a/unfold/page.py +++ b/unfold/page.py @@ -69,6 +69,10 @@ class Page: # we only do this if run_it is set if run_it: self._queue.append ( (query.query_uuid,domid) ) + def generate_records(self, query, generators, number): + self.add_js_files('js/record_generator.js'); + self.add_js_chunks('$(document).ready(function() { new RecordGenerator(' + query.to_json() + ', ' + json.dumps(generators) + ', 10).run(); });') + # return the javascript code for exposing queries # all queries are inserted in the global manifold object # in addition, the ones enqueued with 'run_it=True' are triggered @@ -116,7 +120,7 @@ class Page: def expose_js_metadata (self): # expose global MANIFOLD_METADATA as a js variable # xxx this is fetched synchroneously.. - self.add_js_init_chunks("var MANIFOLD_METADATA =" + self.get_metadata().to_json() + ";") + self.add_js_init_chunks("var MANIFOLD_METADATA =" + self.get_metadata().to_json() + ";\n") def expose_js_manifold_config (self): config=Config()