You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Carlos Rovira <ca...@codeoscopic.com> on 2016/11/29 22:48:30 UTC
[FlexJS] index html template vars
Can I create a custom var in html template?
if so how?
for example, I'd like to add to my html ${color} (just like ${body} or
${head}
thanks
--
Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.
De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.
Re: [FlexJS] index html template vars
Posted by Alex Harui <ah...@adobe.com>.
The compiler generates a new index.html. If the resource plugin runs
first, then yes, the index.html will be overwritten, although if you use
the resource plugin to generate the template, then the compiler should
just fill in its part and not touch the stuff you added.
On 11/30/16, 2:57 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:
>Hi Chris,
>
>I just tried with maven using the following link
>https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.ht
>ml
>
>in pom.xml insert:
>
><properties>
> <primary>indigo</primary>
> <accent>pink</accent>
> </properties>
>
>added filtering true here:
>
><resource>
> <directory>src/main/resources</directory>
> <filtering>true</filtering>
> </resource>
>
>in mdl-js-index-template.html use the vars
>
><link rel="stylesheet" href="
>https://code.getmdl.io/1.2.1/material.${primary}-${accent}.min.css">
>
>but nothing is changed and I get the same output
>
>I'm missing something? or maybe flexjs compiler is stoping the process of
>the html file translation?
>
>I suppose that I only need to use mvn clean install right?
>
>Thanks
>
>Carlos
>
>
>
>El 30 de noviembre de 2016, 17:50, Christofer Dutz <
>christofer.dutz@c-ware.de> escribió:
>
>> When using the maven resource plugin it should be relatively easy to do
>> this ...
>>
>> Chris
>>
>>
>> Am 29.11.16, 23:48 schrieb "carlos.rovira@gmail.com im Auftrag von
>>Carlos
>> Rovira" <carlos.rovira@gmail.com im Auftrag von
>> carlos.rovira@codeoscopic.com>:
>>
>> Can I create a custom var in html template?
>> if so how?
>> for example, I'd like to add to my html ${color} (just like ${body}
>>or
>> ${head}
>> thanks
>>
>> --
>>
>> Carlos Rovira
>> Director General
>> M: +34 607 22 60 05
>> http://www.codeoscopic.com
>> http://www.avant2.es
>>
>> Este mensaje se dirige exclusivamente a su destinatario y puede
>> contener
>> información privilegiada o confidencial. Si ha recibido este mensaje
>> por
>> error, le rogamos que nos lo comunique inmediatamente por esta misma
>> vía y
>> proceda a su destrucción.
>>
>> De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>> comunicamos
>> que sus datos forman parte de un fichero cuyo responsable es
>> CODEOSCOPIC
>> S.A. La finalidad de dicho tratamiento es facilitar la prestación
>>del
>> servicio o información solicitados, teniendo usted derecho de
>>acceso,
>> rectificación, cancelación y oposición de sus datos dirigiéndose a
>> nuestras
>> oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la
>>documentación
>> necesaria.
>>
>>
>>
>
>
>--
>
>Carlos Rovira
>Director General
>M: +34 607 22 60 05
>http://www.codeoscopic.com
>http://www.avant2.es
>
>Este mensaje se dirige exclusivamente a su destinatario y puede contener
>información privilegiada o confidencial. Si ha recibido este mensaje por
>error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
>proceda a su destrucción.
>
>De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>comunicamos
>que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
>S.A. La finalidad de dicho tratamiento es facilitar la prestación del
>servicio o información solicitados, teniendo usted derecho de acceso,
>rectificación, cancelación y oposición de sus datos dirigiéndose a
>nuestras
>oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
>necesaria.
Re: [FlexJS] index html template vars
Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Chris,
I just tried with maven using the following link
https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
in pom.xml insert:
<properties>
<primary>indigo</primary>
<accent>pink</accent>
</properties>
added filtering true here:
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
in mdl-js-index-template.html use the vars
<link rel="stylesheet" href="
https://code.getmdl.io/1.2.1/material.${primary}-${accent}.min.css">
but nothing is changed and I get the same output
I'm missing something? or maybe flexjs compiler is stoping the process of
the html file translation?
I suppose that I only need to use mvn clean install right?
Thanks
Carlos
El 30 de noviembre de 2016, 17:50, Christofer Dutz <
christofer.dutz@c-ware.de> escribió:
> When using the maven resource plugin it should be relatively easy to do
> this ...
>
> Chris
>
>
> Am 29.11.16, 23:48 schrieb "carlos.rovira@gmail.com im Auftrag von Carlos
> Rovira" <carlos.rovira@gmail.com im Auftrag von
> carlos.rovira@codeoscopic.com>:
>
> Can I create a custom var in html template?
> if so how?
> for example, I'd like to add to my html ${color} (just like ${body} or
> ${head}
> thanks
>
> --
>
> Carlos Rovira
> Director General
> M: +34 607 22 60 05
> http://www.codeoscopic.com
> http://www.avant2.es
>
> Este mensaje se dirige exclusivamente a su destinatario y puede
> contener
> información privilegiada o confidencial. Si ha recibido este mensaje
> por
> error, le rogamos que nos lo comunique inmediatamente por esta misma
> vía y
> proceda a su destrucción.
>
> De la vigente Ley Orgánica de Protección de Datos (15/1999), le
> comunicamos
> que sus datos forman parte de un fichero cuyo responsable es
> CODEOSCOPIC
> S.A. La finalidad de dicho tratamiento es facilitar la prestación del
> servicio o información solicitados, teniendo usted derecho de acceso,
> rectificación, cancelación y oposición de sus datos dirigiéndose a
> nuestras
> oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
> necesaria.
>
>
>
--
Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.
De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.
Re: [FlexJS] index html template vars
Posted by Christofer Dutz <ch...@c-ware.de>.
When using the maven resource plugin it should be relatively easy to do this ...
Chris
Am 29.11.16, 23:48 schrieb "carlos.rovira@gmail.com im Auftrag von Carlos Rovira" <carlos.rovira@gmail.com im Auftrag von carlos.rovira@codeoscopic.com>:
Can I create a custom var in html template?
if so how?
for example, I'd like to add to my html ${color} (just like ${body} or
${head}
thanks
--
Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.
De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.
Re: [FlexJS] index html template vars
Posted by Alex Harui <ah...@adobe.com>.
On 11/30/16, 1:52 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:
>Are you saying we could make a bead to decorate the index.html...don't
>understand exactly the proposed solution. I thought beads was something
>inside the framework, nothing to do in the html template...
A bead wouldn't directly update the index.html, but it can:
1) use the <inject_html> to inject stuff into the <head> (see
Mobile/src/main/flex/org/apache/cordova/Application.as for an example)
2) run JavaScript that could add <link> tags at runtime. There isn't a
good example for this, but I don't see why it couldn't be done.
BrowserScroller.as even uses eval() on the SWF side to muck with the
SWFObject wrapper.
I guess it would depend a bit on whether the link data is static or
dynamically computed. Some people may not like having this sort of
configuration in the code instead of in compiler switches or whatever, but
IMO, a compiler's job is to compile and not leak into the area of build
and deployment.
My 2 cents,
-Alex
Re: [FlexJS] index html template vars
Posted by Carlos Rovira <ca...@codeoscopic.com>.
Are you saying we could make a bead to decorate the index.html...don't
understand exactly the proposed solution. I thought beads was something
inside the framework, nothing to do in the html template...
btw, I think if we could create our own vars for html template will be very
useful so people could go here:
https://getmdl.io/customize/
and look for the colors they want and then configure it's own build in the
template
<link rel="stylesheet" href="
https://code.getmdl.io/1.2.1/material.${primary}-${accent}.min.css">
For other people will be other vars, and passing "somevar" in command line,
will get that var available in html template to use as ${somevar}
what's the framework used for this vars (velocity, other, custom...). Could
you point me to the place in source code where I can found it so I could
figure how we could deal with it? (if there's possibilities)
thanks
2016-11-30 8:30 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>
> On 11/29/16, 10:55 PM, "carlos.rovira@gmail.com on behalf of Carlos
> Rovira" <carlos.rovira@gmail.com on behalf of
> carlos.rovira@codeoscopic.com> wrote:
>
> >In MDL there is two vars in the CSS url that could change
> >
> ><link rel="stylesheet" href="
> >https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
> >
> >here "indigo" and "pink" can be configure to other colors to get other
> >kind
> >of effects in MDL
>
> IMO, the point of the template is so that the compiler can inject
> information discovered during the compilation like main class name, width
> and height from the application tag and other stuff like that. I don't
> know how others would like having the compiler start passing through other
> information from the compiler config.
>
> IMO, you could create a new bead called MaterialIndigoPink. It would
> inject the link tag.
>
> -Alex
>
>
--
Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.
De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.
Re: [FlexJS] index html template vars
Posted by Alex Harui <ah...@adobe.com>.
On 11/29/16, 10:55 PM, "carlos.rovira@gmail.com on behalf of Carlos
Rovira" <carlos.rovira@gmail.com on behalf of
carlos.rovira@codeoscopic.com> wrote:
>In MDL there is two vars in the CSS url that could change
>
><link rel="stylesheet" href="
>https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
>
>here "indigo" and "pink" can be configure to other colors to get other
>kind
>of effects in MDL
IMO, the point of the template is so that the compiler can inject
information discovered during the compilation like main class name, width
and height from the application tag and other stuff like that. I don't
know how others would like having the compiler start passing through other
information from the compiler config.
IMO, you could create a new bead called MaterialIndigoPink. It would
inject the link tag.
-Alex
Re: [FlexJS] index html template vars
Posted by Carlos Rovira <ca...@codeoscopic.com>.
In MDL there is two vars in the CSS url that could change
<link rel="stylesheet" href="
https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
here "indigo" and "pink" can be configure to other colors to get other kind
of effects in MDL
2016-11-30 6:20 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>
> On 11/29/16, 2:48 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
> wrote:
>
> >Can I create a custom var in html template?
> >if so how?
> >for example, I'd like to add to my html ${color} (just like ${body} or
> >${head}
> >Thanks
>
> No way to do it right now. How would you specify color?
>
> -Alex
>
>
--
Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.
De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.
Re: [FlexJS] index html template vars
Posted by Alex Harui <ah...@adobe.com>.
On 11/29/16, 2:48 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:
>Can I create a custom var in html template?
>if so how?
>for example, I'd like to add to my html ${color} (just like ${body} or
>${head}
>Thanks
No way to do it right now. How would you specify color?
-Alex