Skip to content

Commit

Permalink
added jqueryUI to list of prefetched resources, and updated its loade…
Browse files Browse the repository at this point in the history
…r to not use $.getScript(). Updated require.js files to use ?v= in the url argument for cache buster
  • Loading branch information
julianlam committed Aug 3, 2016
1 parent daa7dfa commit 7902987
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion public/src/app.js
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion src/meta/tags.js
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/views/partials/requirejs-config.tpl
Expand Up @@ -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',
Expand Down

0 comments on commit 7902987

Please sign in to comment.