~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/dispatch/request.py

  • Committer: dcoles
  • Date: 2008-07-10 07:29:14 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:848
Dispatch: Added scripts_init feature which uses window.addEventListener(...) to 
allow more than one javascript startup script to be run when a page loads. This  
is the better way to go than using the less flexible window.onload() method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
            in the head, if write_html_head_foot is True.
81
81
            URLs should be relative to the IVLE root; they will be fixed up
82
82
            to be site-relative.
 
83
        scripts_init (write)
 
84
            List of strings. Write a list of JS function names, and they
 
85
            will be added as window.addListener('load', ..., false); calls
 
86
            in the head, if write_html_head_foot is True.
 
87
            This is the propper way to specify functions that need to run at 
 
88
            page load time.
83
89
        write_html_head_foot (write)
84
90
            Boolean. If True, dispatch assumes that this is an XHTML page, and
85
91
            will immediately write a full HTML head, open the body element,
195
201
        self.title = None     # Will be set by dispatch before passing to app
196
202
        self.styles = []
197
203
        self.scripts = []
 
204
        self.scripts_init = []
198
205
        self.write_html_head_foot = False
199
206
        self.got_common_vars = False
200
207