]> source.dussan.org Git - vaadin-framework.git/commitdiff
Don't require browserDetailsUrl when embedding (#10122) 98/198/1
authorLeif Åstrand <leif@vaadin.com>
Fri, 2 Nov 2012 11:40:47 +0000 (13:40 +0200)
committerLeif Åstrand <leif@vaadin.com>
Fri, 2 Nov 2012 11:40:47 +0000 (13:40 +0200)
Change-Id: I2c6d5518d1e6adc4a502a8ad646e784f93ece4a3

WebContent/VAADIN/vaadinBootstrap.js
WebContent/statictestfiles/simpleEmbed.html [new file with mode: 0644]
server/src/com/vaadin/ui/SimpleEmbed.html [new file with mode: 0644]

index 8c6e80a14f4beafd63f2edec399782ce97109154..953fa44180ef810a95efcf95fabad3dfce10cdd0 100644 (file)
                        };
                        
                        var fetchRootConfig = function() {
-                               log('Fetching root config');
                                var url = getConfig('browserDetailsUrl');
+                               if (!url) {
+                                       url = getConfig('serviceUrl');
+                               }
                                if (!url) {
                                        // No special url defined, use the same URL that loaded this page (without the fragment)
                                        url = window.location.href.replace(/#.*/,'');
                                }
+                               log('Fetching root config from ' + url);
                                url += ((/\?/).test(url) ? "&" : "?") + "browserDetails=1";
                                var rootId = getConfig("rootId");
                                if (rootId !== undefined) {
diff --git a/WebContent/statictestfiles/simpleEmbed.html b/WebContent/statictestfiles/simpleEmbed.html
new file mode 100644 (file)
index 0000000..93dd6e7
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="X-UA-Compatible" content="chrome=1" />
+<title>Simple embed</title>
+<style type="text/css">
+html,body {
+       height: 100%;
+       margin: 0;
+}
+</style>
+<link rel="shortcut icon" type="image/vnd.microsoft.icon"
+       href="/VAADIN/themes/reindeer/favicon.ico" />
+<link rel="icon" type="image/vnd.microsoft.icon"
+       href="/VAADIN/themes/reindeer/favicon.ico" />
+
+<script type="text/javascript" src="/VAADIN/vaadinBootstrap.js"></script>
+</head>
+<body scroll="auto" class=" v-generated-body">
+       <span>MarginsInLabels</span>
+       <div style="width: 300px; height: 300px; border: 1px solid red;"
+               id="embedded" class=" v-app v-app-VaadinServletSession">
+               <div class=" v-app-loading"></div>
+               <noscript>You have to enable javascript in your browser to
+                       use an application built with Vaadin.</noscript>
+       </div>
+       <iframe tabindex="-1" id="__gwt_historyFrame"
+               style="position: absolute; width: 0; height: 0; border: 0; overflow: hidden"
+               src="javascript:false"></iframe>
+
+  <script type="text/javascript">//<![CDATA[
+if (!window.vaadin) alert("Failed to load the bootstrap javascript: ../VAADIN/vaadinBootstrap.js");
+vaadin.initApplication("embedded",{
+    "heartbeatInterval": 300,
+    "versionInfo": {"vaadinVersion": "9.9.9.INTERNAL-DEBUG-BUILD"},
+    "vaadinDir": "../VAADIN/",
+    "serviceUrl": "../embed2",
+    "authErrMsg": {
+        "message": "Take note of any unsaved data, and <u>click here<\/u> to continue.",
+        "caption": "Authentication problem"
+    },
+    "widgetset": "com.vaadin.DefaultWidgetSet",
+    "theme": "reindeer",
+    "debug": true,
+    "comErrMsg": {
+        "message": "Take note of any unsaved data, and <u>click here<\/u> to continue.",
+        "caption": "Communication problem"
+    },
+    "standalone": true
+});
+//]]></script>
+</body>
+</html>
\ No newline at end of file
diff --git a/server/src/com/vaadin/ui/SimpleEmbed.html b/server/src/com/vaadin/ui/SimpleEmbed.html
new file mode 100644 (file)
index 0000000..84d521c
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/statictestfiles/simpleEmbed.html</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>//span</td>
+       <td>MarginsInLabels</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=embedded::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VLabel[0]/domChild[0]</td>
+       <td>Vertical layout</td>
+</tr>
+</tbody></table>
+</body>
+</html>