From 9a2c7c7239f9966283eabcf105e1d996bbeb04c7 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 31 May 2013 21:16:24 +0000 Subject: [PATCH] support loading Ox.js?\d+ to get new version --- source/Ox.js | 4 ++-- source/Ox/js/Constants.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Ox.js b/source/Ox.js index 64c676a6..8feeb26d 100644 --- a/source/Ox.js +++ b/source/Ox.js @@ -36,8 +36,8 @@ function getPath() { var i, path, scripts = document.getElementsByTagName('script'); for (i = 0; i < scripts.length; i++) { - if (/Ox\.js$/.test(scripts[i].src)) { - path = scripts[i].src.replace(/Ox\.js$/, ''); + if (/Ox\.js(\?\d+|)$/.test(scripts[i].src)) { + path = scripts[i].src.replace(/Ox\.js(\?\d+|)$/, ''); } } return path; diff --git a/source/Ox/js/Constants.js b/source/Ox/js/Constants.js index 5618afb5..488f7bc6 100644 --- a/source/Ox/js/Constants.js +++ b/source/Ox/js/Constants.js @@ -91,8 +91,8 @@ Ox.SHORT_MONTHS = Ox.MONTHS.map(function(val) { Ox.PATH = Ox.toArray( document.getElementsByTagName('script') ).reverse().filter(function(element) { - return /Ox\.js$/.test(element.src); -})[0].src.replace(/Ox\.js$/, ''); + return /Ox\.js(\?\d+|)$/.test(element.src); +})[0].src.replace(/Ox\.js(\?\d+|)$/, ''); //@ Ox.PREFIXES <[str]> `['', 'K', 'M', 'G', 'T', 'P']` Ox.PREFIXES = ['', 'K', 'M', 'G', 'T', 'P']; //@ Ox.SEASONS <[s]> Names of the seasons of the year