Permalink
Browse files

get required version from query string. this allows boomerang-reload.…

…html to be cached forever
  • Loading branch information...
1 parent 54c8412 commit 54e8316148a0c4656e8ce77251daae67f4fadaf3 @bluesmoon committed Jan 29, 2013
Showing with 15 additions and 11 deletions.
  1. +15 −11 boomerang-reload.html
View
@@ -2,18 +2,22 @@
<html>
<head>
<script src="boomerang.js"></script>
-</head>
-<body>
<script>
-var boom_ver = BOOMR.version.split('.'),
- reqd_ver = location.search.replace(/.*v=([0-9\.]+).*/, '$1').split('.');
-if ( (boom_ver[0] < reqd_ver[0]) // javascript will do type coercion
- || (boom_ver[0] == reqd_ver[0] && boom_ver[1] < reqd_ver[1])
- || (boom_ver[0] == reqd_ver[0] && boom_ver[1] == reqd_ver[1] && boom_ver[2] < reqd_ver[2])
-)
-{
- location.reload(true);
-}
+var v = decodeURIComponent(location.search.replace(/.*v=([0-9.]+).*/, '$1'));
+
+window.onload = function() {
+ var boom_ver = BOOMR.version.split('.'),
+ reqd_ver = v.split('.');
+ if ( (boom_ver[0] < reqd_ver[0]) // javascript will do type coercion
+ || (boom_ver[0] == reqd_ver[0] && boom_ver[1] < reqd_ver[1])
+ || (boom_ver[0] == reqd_ver[0] && boom_ver[1] == reqd_ver[1] && boom_ver[2] < reqd_ver[2])
+ )
+ {
+ location.reload(true);
+ }
+};
</script>
+</head>
+<body>
</body>
</html>

0 comments on commit 54e8316

Please sign in to comment.