Cache defeat for css/js

This commit is contained in:
James Taylor
2009-08-24 15:27:27 -04:00
parent 0a852278e2
commit 06ceec4dba
3 changed files with 17 additions and 17 deletions
+6 -3
View File
@@ -27,14 +27,17 @@ def css( *args ):
Take a list of stylesheet names (no extension) and return appropriate string
of link tags.
TODO: This has a hardcoded "?v=1" to defeat caching. This should be done
TODO: This has a hardcoded "?v=2" to defeat caching. This should be done
in a better way.
"""
return "\n".join( [ stylesheet_link_tag( "/static/style/" + name + ".css?v=1" ) for name in args ] )
return "\n".join( [ stylesheet_link_tag( "/static/style/" + name + ".css?v=2" ) for name in args ] )
def js( *args ):
"""
Take a list of javascript names (no extension) and return appropriate
string of script tags.
TODO: This has a hardcoded "?v=2" to defeat caching. This should be done
in a better way.
"""
return "\n".join( [ javascript_include_tag( "/static/scripts/" + name + ".js" ) for name in args ] )
return "\n".join( [ javascript_include_tag( "/static/scripts/" + name + ".js?v=2" ) for name in args ] )
+1 -4
View File
@@ -27,9 +27,6 @@ ${self.javascripts()}
## <!--[if lt IE 7]>
## <script type='text/javascript' src="/static/scripts/IE7.js"> </script>
## <![endif]-->
<script type="text/javascript" src="${h.url_for('/static/scripts/jquery.js')}"></script>
<script type="text/javascript" src="${h.url_for('/static/scripts/galaxy.base.js')}"></script>
${h.js( "jquery", "galaxy.base" )}
</%def>
+10 -10
View File
@@ -25,17 +25,17 @@
<!--[if IE]>
<script type='text/javascript' src="${h.url_for('/static/scripts/excanvas.js')}"> </script>
<![endif]-->
<script type='text/javascript' src="${h.url_for('/static/scripts/jquery.js')}"> </script>
<script type='text/javascript' src="${h.url_for('/static/scripts/jquery.event.drag.js')}"> </script>
<script type='text/javascript' src="${h.url_for('/static/scripts/jquery.event.drop.js')}"> </script>
<script type='text/javascript' src="${h.url_for('/static/scripts/jquery.event.hover.js')}"> </script>
<script type='text/javascript' src="${h.url_for('/static/scripts/jquery.form.js')}"> </script>
<script type='text/javascript' src="${h.url_for('/static/scripts/jquery.jstore-all.js')}"> </script>
<script type='text/javascript' src="${h.url_for('/static/scripts/json2.js')}"> </script>
<script type='text/javascript' src="${h.url_for('/static/scripts/galaxy.base.js')}"> </script>
<script type='text/javascript' src="${h.url_for('/static/scripts/galaxy.workflow_editor.canvas.js')}"> </script>
${h.js( "jquery",
"jquery.event.drag",
"jquery.event.drop",
"jquery.event.hover",
"jquery.form",
"jquery.jstore-all",
"json2",
"galaxy.base",
"galaxy.workflow_editor.canvas" )}
<!--[if lt IE 7]>
<script type='text/javascript'>
window.lt_ie_7 = true;