Revision: 9212
Author: [email protected]
Date: Wed Nov 10 07:11:31 2010
Log: Modify the SSSS Direct install linker to install code in the main
window rather than just
letting it execute because we have no guarantee that the doc is loaded and
teams are
seeing doc not defined errors if they include the script in the head.
http://code.google.com/p/google-web-toolkit/source/detail?r=9212
Added:
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationMainWindow.js
Deleted:
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptNull.js
Modified:
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationIframe.js
=======================================
--- /dev/null
+++
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationMainWindow.js
Wed Nov 10 07:11:31 2010
@@ -0,0 +1,30 @@
+// The GWT code can be installed anywhere, although an iFrame is the best
+// approach if you want both variable isolation (useful in general, but
+// critical if you want more than one GWT module on your page) and runAsync
+// which will need to be able to install additional chunks of code into
that
+// isolated environment later on.
+
+// The items that must be provided in any install location are:
+// $wnd - the location where the bootstrap module is defined. Should also
+// be the location where the __gwtStatsEvent is defined
+
+var init = false;
+
+function getInstallLocationDoc() {
+ setupInstallLocation();
+ return window.document;
+}
+
+function getInstallLocation() {
+ setupInstallLocation();
+ return window.document.body;
+}
+
+function setupInstallLocation() {
+ if (init) { return; }
+ var script = window.document.createElement('script');
+ script.language='javascript';
+ script.text = "var $wnd = window;";
+ window.document.body.appendChild(script);
+ init = true;
+}
=======================================
---
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/installScriptNull.js
Wed Oct 27 13:37:45 2010
+++ /dev/null
@@ -1,5 +0,0 @@
-// Assumes that the script contents are directly part of the bootstrap
script
-// and do not need to be installed anywhere.
-function installScript(filename) {
- // Does nothing
-}
=======================================
---
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationIframe.js
Tue Oct 12 16:00:43 2010
+++
/trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/installLocationIframe.js
Wed Nov 10 07:11:31 2010
@@ -7,11 +7,6 @@
// The items that must be provided in any install location are:
// $wnd - the location where the bootstrap module is defined. Should also
// be the location where the __gwtStatsEvent is defined
-//
-// For hosted mode to work, the following must also be provided. Note that
if
-// the hosted.js file went through the same processing as the md5.js files,
-// these additional variables would not be needed.
-// __gwt_moduleFunction
var frameDoc;
@@ -19,7 +14,7 @@
setupInstallLocation();
return frameDoc;
}
-
+
function getInstallLocation() {
setupInstallLocation();
return frameDoc.getElementsByTagName('body')[0];
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors