Revision: 7686
Author: [email protected]
Date: Mon Mar  8 12:02:36 2010
Log: Updates the IFRame and XS selection script templates to support
inlined selection scripts.  There are two changes involved:

1. There is a baseUrl meta property that can be used to override
the choice of base URL.

2. Meta tags can be made to apply to only module MODULENAME by putting
"MODULENAME::" at the beginning of the "name" attribute of the meta tag.

http://groups.google.com/group/google-web-toolkit-contributors/browse_thread/thread/f86a8e085457a7b5/1449181b1952c35a?lnk=raot

http://gwt-code-reviews.appspot.com/159810

Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=7686

Modified:
 /trunk/dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js
 /trunk/dev/core/src/com/google/gwt/core/linker/XSTemplate.js

=======================================
--- /trunk/dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js Wed Oct 21 13:20:55 2009 +++ /trunk/dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js Mon Mar 8 12:02:36 2010
@@ -120,6 +120,10 @@
     ,markerId = "__gwt_marker___MODULE_NAME__"
     ,markerScript;

+    if (base = metaProps['baseUrl']) {
+      return;
+    }
+
     $doc.write('<script id="' + markerId + '"></script>');
     markerScript = $doc.getElementById(markerId);

@@ -189,6 +193,12 @@
       var meta = metas[i], name = meta.getAttribute('name'), content;

       if (name) {
+        name = name.replace('__MODULE_NAME__::', '');
+        if (name.indexOf('::') >= 0) {
+          // It's for a different module
+          continue;
+       }
+
         if (name == 'gwt:property') {
           content = meta.getAttribute('content');
           if (content) {
@@ -347,6 +357,7 @@
   // --------------- STRAIGHT-LINE CODE ---------------

   // do it early for compile/browse rebasing
+  processMetas();
   computeScriptBase();

   var strongName;
@@ -361,7 +372,6 @@
     strongName = "";
   }

-  processMetas();

   // --------------- WINDOW ONLOAD HOOK ---------------

=======================================
--- /trunk/dev/core/src/com/google/gwt/core/linker/XSTemplate.js Wed Oct 21 13:20:55 2009 +++ /trunk/dev/core/src/com/google/gwt/core/linker/XSTemplate.js Mon Mar 8 12:02:36 2010
@@ -104,6 +104,10 @@
     ,markerId = "__gwt_marker___MODULE_NAME__"
     ,markerScript;

+    if (base = metaProps['baseUrl']) {
+      return;
+    }
+
     $doc.write('<script id="' + markerId + '"></script>');
     markerScript = $doc.getElementById(markerId);

@@ -173,7 +177,13 @@
       var meta = metas[i], name = meta.getAttribute('name'), content;

       if (name) {
-        if (name == 'gwt:property') {
+        name = name.replace('__MODULE_NAME__::', '');
+        if (name.indexOf('::') >= 0) {
+          // It's for a different module
+          continue;
+        }
+
+       if (name == 'gwt:property') {
           content = meta.getAttribute('content');
           if (content) {
             var value, eq = content.indexOf('=');
@@ -287,8 +297,8 @@
   }

   // do it early for compile/browse rebasing
-  computeScriptBase();
   processMetas();
+  computeScriptBase();

   // --------------- WINDOW ONLOAD HOOK ---------------

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to