common/utils.py
changeset 28 9b7067bfaa15
parent 0 b97547f5f1fa
child 643 616191014b8b
child 1808 aa09e20dd8c0
equal deleted inserted replaced
27:ef1c80154d6f 28:9b7067bfaa15
   139     def define_var(self, var, value):
   139     def define_var(self, var, value):
   140         self.jsvars.append( (var, value) )
   140         self.jsvars.append( (var, value) )
   141 
   141 
   142     def add_post_inline_script(self, content):
   142     def add_post_inline_script(self, content):
   143         self.post_inlined_scripts.append(content)
   143         self.post_inlined_scripts.append(content)
       
   144 
       
   145     def add_onload(self, jscode):
       
   146         self.add_post_inline_script(u"""jQuery(document).ready(function () {
       
   147  %s
       
   148  });""" % jscode)
       
   149         
   144     
   150     
   145     def add_js(self, jsfile):
   151     def add_js(self, jsfile):
   146         """adds `jsfile` to the list of javascripts used in the webpage
   152         """adds `jsfile` to the list of javascripts used in the webpage
   147 
   153 
   148         This function checks if the file has already been added
   154         This function checks if the file has already been added