Skip to content

Node.js based forum software built for the modern web

added jqueryUI to list of prefetched resources, and updated its loader to not use $.getScript(). Updated require.js files to use ?v= in the url argument for cache buster

Julian Lam790298790098
diff --git a/public/src/app.js b/public/src/app.js
index e9b52ef0bf..390bde2f04 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -466,7 +466,11 @@ app.cacheBuster = null;
return callback();
}
- $.getScript(config.relative_path + '/vendor/jquery/js/jquery-ui-1.10.4.custom.js', callback);
+ var scriptEl = document.createElement('script');
+ scriptEl.type = 'text/javascript';
+ scriptEl.src = config.relative_path + '/vendor/jquery/js/jquery-ui-1.10.4.custom.js' + (app.cacheBuster ? '?v=' + app.cacheBuster : '');
+ scriptEl.onload = callback;
+ document.head.appendChild(scriptEl);
};
app.showEmailConfirmWarning = function(err) {
diff --git a/src/meta/tags.js b/src/meta/tags.js
index 3747db61da..50afe9a1db 100644
--- a/src/meta/tags.js
+++ b/src/meta/tags.js
@@ -46,10 +46,13 @@ module.exports = function(Meta) {
var defaultLinks = [{
rel: "icon",
type: "image/x-icon",
- href: nconf.get('relative_path') + '/favicon.ico?' + Meta.config['cache-buster']
+ href: nconf.get('relative_path') + '/favicon.ico' + (Meta.config['cache-buster'] ? '?' + Meta.config['cache-buster'] : '')
}, {
rel: "manifest",
href: nconf.get('relative_path') + '/manifest.json'
+ }, {
+ rel: "prefetch",
+ href: nconf.get('relative_path') + '/vendor/jquery/js/jquery-ui-1.10.4.custom.js' + (Meta.config['cache-buster'] ? '?v=' + Meta.config['cache-buster'] : '')
}];
// Touch icons for mobile-devices
diff --git a/src/views/partials/requirejs-config.tpl b/src/views/partials/requirejs-config.tpl
index addb5cfcaa..c11b4aa9a3 100644
--- a/src/views/partials/requirejs-config.tpl
+++ b/src/views/partials/requirejs-config.tpl
@@ -2,7 +2,7 @@
require.config({
baseUrl: "{relative_path}/src/modules",
waitSeconds: 3,
- urlArgs: "{config.cache-buster}",
+ urlArgs: "v={config.cache-buster}",
paths: {
'forum': '../client',
'admin': '../admin',