diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-12-04 08:49:23 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-12-04 08:49:23 +0000 |
commit | d3062b6bb4030a9dcc76f3507e6c58975570d1e4 (patch) | |
tree | 705b2ac48f6c7fc4790ddebb8ed988e50053bdeb | |
parent | 44083ca42582ab09ba969209dadc6be0bffb6f3c (diff) | |
parent | cdb2776cd241f26929ffd2d22762f938b3626286 (diff) | |
download | vaadin-framework-d3062b6bb4030a9dcc76f3507e6c58975570d1e4.tar.gz vaadin-framework-d3062b6bb4030a9dcc76f3507e6c58975570d1e4.zip |
Merge "Allow customization of the widgetset url in order to be able to remove the '?timestamp' part of the default url #10422"
-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) { |