utils.py
changeset 2554 3b6a6d2f9d7e
parent 2361 8f00836580f1
child 2657 de974465d381
equal deleted inserted replaced
2553:1abdcb4199af 2554:3b6a6d2f9d7e
   253         """
   253         """
   254         w = self.write
   254         w = self.write
   255         # 1/ variable declaration if any
   255         # 1/ variable declaration if any
   256         if self.jsvars:
   256         if self.jsvars:
   257             from simplejson import dumps
   257             from simplejson import dumps
   258             w(u'<script type="text/javascript">\n')
   258             w(u'<script type="text/javascript"><!--//--><![CDATA[//><!--\n')
   259             for var, value in self.jsvars:
   259             for var, value in self.jsvars:
   260                 w(u'%s = %s;\n' % (var, dumps(value)))
   260                 w(u'%s = %s;\n' % (var, dumps(value)))
   261             w(u'</script>\n')
   261             w(u'//--><!]]></script>\n')
   262         # 2/ css files
   262         # 2/ css files
   263         for cssfile, media in self.cssfiles:
   263         for cssfile, media in self.cssfiles:
   264             w(u'<link rel="stylesheet" type="text/css" media="%s" href="%s"/>\n' %
   264             w(u'<link rel="stylesheet" type="text/css" media="%s" href="%s"/>\n' %
   265               (media, cssfile))
   265               (media, cssfile))
   266         # 3/ ie css if necessary
   266         # 3/ ie css if necessary