load Ox.js with pandora version to avoid loading outdated version without clearing cache, fixes #1556

This commit is contained in:
j 2013-05-31 21:17:57 +00:00
parent ff82ed2863
commit d85eaed453

View file

@ -58,6 +58,15 @@ appPanel
}); });
}); });
function getPandoraVersion() {
var i, path, scripts = document.getElementsByTagName('script');
for (i = 0;i < scripts.length; i++) {
if(/pandora.js/.test(scripts[i].src)) {
return scripts[1].src.replace(/.*\?/, '');
}
}
}
function loadImages(callback) { function loadImages(callback) {
// Opera doesn't fire onload for SVGs, // Opera doesn't fire onload for SVGs,
// so we only wait for the PNG to load. // so we only wait for the PNG to load.
@ -167,7 +176,7 @@ appPanel
} else { } else {
script.onload = callback; script.onload = callback;
} }
script.src = '/static/oxjs/' + (enableDebugMode ? 'dev' : 'build') + '/Ox.js'; script.src = '/static/oxjs/' + (enableDebugMode ? 'dev' : 'build') + '/Ox.js?' + getPandoraVersion();
script.type = 'text/javascript'; script.type = 'text/javascript';
head.appendChild(script); head.appendChild(script);
} }