diff options
author | Jonatan Kronqvist <jonatan@vaadin.com> | 2012-11-27 13:46:18 +0200 |
---|---|---|
committer | Jonatan Kronqvist <jonatan@vaadin.com> | 2012-12-04 10:44:51 +0200 |
commit | cdb2776cd241f26929ffd2d22762f938b3626286 (patch) | |
tree | ca72d234f08b07d0c8c32e1c871060e586a9fe4a /WebContent | |
parent | 84099ee2b8363c12a813157f9752981add5db113 (diff) | |
download | vaadin-framework-cdb2776cd241f26929ffd2d22762f938b3626286.tar.gz vaadin-framework-cdb2776cd241f26929ffd2d22762f938b3626286.zip |
Allow customization of the widgetset url in order to be able to remove the '?timestamp' part of the default url #10422
Change-Id: I561ba82d027b9207ed67fd7a861b0d6602e02024
Diffstat (limited to 'WebContent')
-rw-r--r-- | WebContent/VAADIN/vaadinBootstrap.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index 64a1a00111..9e012ae987 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -29,25 +29,23 @@ themesLoaded[url] = true; } }; - + var isWidgetsetLoaded = function(widgetset) { var className = widgetset.replace(/\./g, "_"); return (typeof window[className]) != "undefined"; }; - var loadWidgetset = function(basePath, widgetset) { + var loadWidgetset = function(url, widgetset) { if (widgetsets[widgetset]) { return; } - log("load widgetset", basePath, widgetset); + log("load widgetset", url, widgetset); setTimeout(function() { if (!isWidgetsetLoaded(widgetset)) { alert("Failed to load the widgetset: " + url); } }, 15000); - - var url = basePath + widgetset + "/" + widgetset + ".nocache.js?" + new Date().getTime(); - + var scriptTag = document.createElement('script'); scriptTag.setAttribute('type', 'text/javascript'); scriptTag.setAttribute('src', url); @@ -57,7 +55,7 @@ pendingApps: [] }; }; - + window.vaadin = window.vaadin || { initApplication: function(appId, config) { if (apps[appId]) { @@ -159,7 +157,11 @@ loadTheme(themeUri); var widgetset = getConfig('widgetset'); - loadWidgetset(vaadinDir + 'widgetsets/', widgetset); + var widgetsetUrl = getConfig('widgetsetUrl'); + if (!widgetsetUrl) { + widgetsetUrl = vaadinDir + 'widgetsets/' + widgetset + "/" + widgetset + ".nocache.js?" + new Date().getTime(); + } + loadWidgetset(widgetsetUrl, widgetset); if (getConfig('uidl') === undefined) { if (mayDefer) { |