web/request.py
branchstable
changeset 5290 15846058378b
parent 4984 6cb91be7707f
child 5302 dfd147de06b2
child 5377 84d14ddfae13
equal deleted inserted replaced
5289:540fa73caac6 5290:15846058378b
   521             self.html_headers.add_js(jsfile)
   521             self.html_headers.add_js(jsfile)
   522 
   522 
   523     def add_css(self, cssfiles, media=u'all', localfile=True, ieonly=False,
   523     def add_css(self, cssfiles, media=u'all', localfile=True, ieonly=False,
   524                 iespec=u'[if lt IE 8]'):
   524                 iespec=u'[if lt IE 8]'):
   525         """specify a CSS file to include in the HTML headers
   525         """specify a CSS file to include in the HTML headers
       
   526 
   526         :param cssfiles: a CSS filename or a list of CSS filenames
   527         :param cssfiles: a CSS filename or a list of CSS filenames
   527         :param media: the CSS's media if necessary
   528         :param media: the CSS's media if necessary
   528         :param localfile: if True, the default data dir prefix is added to the
   529         :param localfile: if True, the default data dir prefix is added to the
   529                           CSS filename
   530                           CSS filename
   530         :param ieonly: True if this css is specific to IE
   531         :param ieonly: True if this css is specific to IE
   548                 cssfile = self.datadir_url + cssfile
   549                 cssfile = self.datadir_url + cssfile
   549             add_css(cssfile, media, *extraargs)
   550             add_css(cssfile, media, *extraargs)
   550 
   551 
   551     def build_ajax_replace_url(self, nodeid, rql, vid, replacemode='replace',
   552     def build_ajax_replace_url(self, nodeid, rql, vid, replacemode='replace',
   552                                **extraparams):
   553                                **extraparams):
   553         """builds an ajax url that will replace `nodeid`s content
   554         """builds an ajax url that will replace nodeid's content
       
   555 
   554         :param nodeid: the dom id of the node to replace
   556         :param nodeid: the dom id of the node to replace
   555         :param rql: rql to execute
   557         :param rql: rql to execute
   556         :param vid: the view to apply on the resultset
   558         :param vid: the view to apply on the resultset
   557         :param replacemode: defines how the replacement should be done.
   559         :param replacemode: defines how the replacement should be done.
       
   560 
   558         Possible values are :
   561         Possible values are :
   559          - 'replace' to replace the node's content with the generated HTML
   562         - 'replace' to replace the node's content with the generated HTML
   560          - 'swap' to replace the node itself with the generated HTML
   563         - 'swap' to replace the node itself with the generated HTML
   561          - 'append' to append the generated HTML to the node's content
   564         - 'append' to append the generated HTML to the node's content
   562         """
   565         """
   563         url = self.build_url('view', rql=rql, vid=vid, __notemplate=1,
   566         url = self.build_url('view', rql=rql, vid=vid, __notemplate=1,
   564                              **extraparams)
   567                              **extraparams)
   565         return "javascript: loadxhtml('%s', '%s', '%s')" % (
   568         return "javascript: loadxhtml('%s', '%s', '%s')" % (
   566             nodeid, xml_escape(url), replacemode)
   569             nodeid, xml_escape(url), replacemode)