524 self.html_headers.add_js(jsfile) |
524 self.html_headers.add_js(jsfile) |
525 |
525 |
526 def add_css(self, cssfiles, media=u'all', localfile=True, ieonly=False, |
526 def add_css(self, cssfiles, media=u'all', localfile=True, ieonly=False, |
527 iespec=u'[if lt IE 8]'): |
527 iespec=u'[if lt IE 8]'): |
528 """specify a CSS file to include in the HTML headers |
528 """specify a CSS file to include in the HTML headers |
|
529 |
529 :param cssfiles: a CSS filename or a list of CSS filenames |
530 :param cssfiles: a CSS filename or a list of CSS filenames |
530 :param media: the CSS's media if necessary |
531 :param media: the CSS's media if necessary |
531 :param localfile: if True, the default data dir prefix is added to the |
532 :param localfile: if True, the default data dir prefix is added to the |
532 CSS filename |
533 CSS filename |
533 :param ieonly: True if this css is specific to IE |
534 :param ieonly: True if this css is specific to IE |
551 cssfile = self.datadir_url + cssfile |
552 cssfile = self.datadir_url + cssfile |
552 add_css(cssfile, media, *extraargs) |
553 add_css(cssfile, media, *extraargs) |
553 |
554 |
554 def build_ajax_replace_url(self, nodeid, rql, vid, replacemode='replace', |
555 def build_ajax_replace_url(self, nodeid, rql, vid, replacemode='replace', |
555 **extraparams): |
556 **extraparams): |
556 """builds an ajax url that will replace `nodeid`s content |
557 """builds an ajax url that will replace nodeid's content |
|
558 |
557 :param nodeid: the dom id of the node to replace |
559 :param nodeid: the dom id of the node to replace |
558 :param rql: rql to execute |
560 :param rql: rql to execute |
559 :param vid: the view to apply on the resultset |
561 :param vid: the view to apply on the resultset |
560 :param replacemode: defines how the replacement should be done. |
562 :param replacemode: defines how the replacement should be done. |
|
563 |
561 Possible values are : |
564 Possible values are : |
562 - 'replace' to replace the node's content with the generated HTML |
565 - 'replace' to replace the node's content with the generated HTML |
563 - 'swap' to replace the node itself with the generated HTML |
566 - 'swap' to replace the node itself with the generated HTML |
564 - 'append' to append the generated HTML to the node's content |
567 - 'append' to append the generated HTML to the node's content |
565 """ |
568 """ |
566 url = self.build_url('view', rql=rql, vid=vid, __notemplate=1, |
569 url = self.build_url('view', rql=rql, vid=vid, __notemplate=1, |
567 **extraparams) |
570 **extraparams) |
568 return "javascript: loadxhtml('%s', '%s', '%s')" % ( |
571 return "javascript: loadxhtml('%s', '%s', '%s')" % ( |
569 nodeid, xml_escape(url), replacemode) |
572 nodeid, xml_escape(url), replacemode) |