support loading Ox.js?\d+ to get new version

This commit is contained in:
j 2013-05-31 21:16:24 +00:00
parent 541af0917a
commit 9a2c7c7239
2 changed files with 4 additions and 4 deletions

View file

@ -36,8 +36,8 @@
function getPath() { function getPath() {
var i, path, scripts = document.getElementsByTagName('script'); var i, path, scripts = document.getElementsByTagName('script');
for (i = 0; i < scripts.length; i++) { for (i = 0; i < scripts.length; i++) {
if (/Ox\.js$/.test(scripts[i].src)) { if (/Ox\.js(\?\d+|)$/.test(scripts[i].src)) {
path = scripts[i].src.replace(/Ox\.js$/, ''); path = scripts[i].src.replace(/Ox\.js(\?\d+|)$/, '');
} }
} }
return path; return path;

View file

@ -91,8 +91,8 @@ Ox.SHORT_MONTHS = Ox.MONTHS.map(function(val) {
Ox.PATH = Ox.toArray( Ox.PATH = Ox.toArray(
document.getElementsByTagName('script') document.getElementsByTagName('script')
).reverse().filter(function(element) { ).reverse().filter(function(element) {
return /Ox\.js$/.test(element.src); return /Ox\.js(\?\d+|)$/.test(element.src);
})[0].src.replace(/Ox\.js$/, ''); })[0].src.replace(/Ox\.js(\?\d+|)$/, '');
//@ Ox.PREFIXES <[str]> `['', 'K', 'M', 'G', 'T', 'P']` //@ Ox.PREFIXES <[str]> `['', 'K', 'M', 'G', 'T', 'P']`
Ox.PREFIXES = ['', 'K', 'M', 'G', 'T', 'P']; Ox.PREFIXES = ['', 'K', 'M', 'G', 'T', 'P'];
//@ Ox.SEASONS <[s]> Names of the seasons of the year //@ Ox.SEASONS <[s]> Names of the seasons of the year