@Ian: I know, it's nasty. These things have gotten a bit out of hand, and we
have a big, fat TODO to come back and clean this up (as well as to bring
together various other linkers under a more coherent umbrella). But we
probably won't be able to get around to it for at least another quarter,
unfortunately.

On Mon, Mar 8, 2010 at 12:37 PM, Ian Petersen <ispet...@gmail.com> wrote:

> Just idle curiosity here, but why did you have to make the same change
> twice?  I know you're modifying selection scripts, and maybe that
> means you need to violate DRY for some reason, but it strikes me as a
> potential refactoring.
>
> Ian
>
> On Mon, Mar 8, 2010 at 9:23 AM,  <sp...@google.com> wrote:
> > Reviewers: jgw,
> >
> > Description:
> > 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.
> >
> > Review by: j...@google.com
> >
> > Please review this at http://gwt-code-reviews.appspot.com/159810
> >
> > Affected files:
> >  M dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js
> >  M dev/core/src/com/google/gwt/core/linker/XSTemplate.js
> >
> >
> > Index: dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js
> > ===================================================================
> > --- dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js   (revision
> > 7685)
> > +++ dev/core/src/com/google/gwt/core/linker/IFrameTemplate.js   (working
> > copy)
> > @@ -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 ---------------
> >
> > Index: dev/core/src/com/google/gwt/core/linker/XSTemplate.js
> > ===================================================================
> > --- dev/core/src/com/google/gwt/core/linker/XSTemplate.js       (revision
> > 7685)
> > +++ dev/core/src/com/google/gwt/core/linker/XSTemplate.js       (working
> > copy)
> > @@ -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
> > +  processMetas();
> >   computeScriptBase();
> > -  processMetas();
> >
> >   // --------------- WINDOW ONLOAD HOOK ---------------
> >
> >
> >
> > --
> > http://groups.google.com/group/Google-Web-Toolkit-Contributors
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors
>

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

Reply via email to