diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-10-08 08:11:51 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-10-08 10:35:02 +0000 |
commit | 13d5b3e98954c2ade382305f8d044b2b49fdbd0b (patch) | |
tree | 37559368471cbed3a9ea159261869bcf5c82e52a /WebContent/VAADIN | |
parent | 6337f8f8ccb88014f7a3d269332661ec8183b758 (diff) | |
download | vaadin-framework-13d5b3e98954c2ade382305f8d044b2b49fdbd0b.tar.gz vaadin-framework-13d5b3e98954c2ade382305f8d044b2b49fdbd0b.zip |
Bootstrap UI using relative URLs with servlets (#6771)
* Configure widgetset using URLs relative to the requested page
* Provide a Util method for getting an absolute URL from a relative URL
* Test by using an embedded Jetty acting as a transparent proxy
* Make /embed1 use the Buttons test to enable testing UIDL requests
Change-Id: I4ef9b40e3954ae16b682d743a339f4360db40d4d
Diffstat (limited to 'WebContent/VAADIN')
-rw-r--r-- | WebContent/VAADIN/vaadinBootstrap.js | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index 3fff0bd829..8c6e80a14f 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -81,12 +81,8 @@ log('Fetching root config'); var url = getConfig('browserDetailsUrl'); if (!url) { - // No special url defined, use the default URL - url = getConfig('appUri'); - // Add a slash to the end, because ApplicationConiguration.loadFromDOM does so... - if (url.length == 0 || url.substr(url.length-1) !== "/") { - url += '/'; - } + // No special url defined, use the same URL that loaded this page (without the fragment) + url = window.location.href.replace(/#.*/,''); } url += ((/\?/).test(url) ? "&" : "?") + "browserDetails=1"; var rootId = getConfig("rootId"); @@ -94,11 +90,11 @@ url += "&rootId=" + rootId; } - var initialPath = getConfig("initialPath"); - if (initialPath !== undefined) { - url += '&initialPath=' + encodeURIComponent(initialPath); + // Tell the UI what theme it is configured to use + var theme = getConfig('theme'); + if (theme !== undefined) { + url += '&theme=' + encodeURIComponent(theme); } - url += '&initialParams=' + encodeURIComponent(JSON.stringify(getConfig("initialParams"))); url += '&' + vaadin.getBrowserDetailsParameters(appId); @@ -145,12 +141,13 @@ } var bootstrapApp = function(mayDefer) { - var themeUri = getConfig('themeUri'); + var vaadinDir = getConfig('vaadinDir'); + + var themeUri = vaadinDir + 'themes/' + getConfig('theme') loadTheme(themeUri); - var widgetsetBase = getConfig('widgetsetBase'); var widgetset = getConfig('widgetset'); - loadWidgetset(widgetsetBase, widgetset); + loadWidgetset(vaadinDir + 'widgetsets/', widgetset); if (getConfig('uidl') === undefined) { if (mayDefer) { |