def test_javascript_include_tag(self): eq_( """<script src="/javascripts/prototype.js" type="text/javascript"></script>\n<script src="/other-javascripts/util.js" type="text/javascript"></script>""", javascript_link('/javascripts/prototype.js', '/other-javascripts/util.js')) eq_( """<script defer="defer" src="/js/pngfix.js" type="text/javascript"></script>""", javascript_link('/js/pngfix.js', defer=True))
def js_helper( prefix, *args ): """ Take a prefix and list of javascript names and return appropriate string of script tags. Cache-bust with time that server started running on """ return "\n".join( [ javascript_link( url_for( "/%s%s.js?v=%s" % (prefix, name, server_starttime ) ) ) for name in args ] )
def javascript_link(path): return tags.javascript_link('/javascripts/' + path)