You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Carlos Rovira <ca...@apache.org> on 2018/09/20 10:12:59 UTC

Re: [royale-asjs] branch develop updated: Add type declaration, plus make sure callback is defined

Hi,

do we have something like this for CSS files?
I was thinking in add to JewelExample a "theme selector", and I think it
could be great to add the css on the fly

thanks

Carlos


El jue., 20 sept. 2018 a las 12:03, <yi...@apache.org> escribió:

> This is an automated email from the ASF dual-hosted git repository.
>
> yishayw pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>
>
> The following commit(s) were added to refs/heads/develop by this push:
>      new 7441707  Add type declaration, plus make sure callback is defined
> 7441707 is described below
>
> commit 7441707fb929c0c43b11c8a9088c78b24eccac7d
> Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
> AuthorDate: Thu Sep 20 13:03:27 2018 +0300
>
>     Add type declaration, plus make sure callback is defined
> ---
>  .../src/main/royale/org/apache/royale/utils/js/loadJavascript.as   | 7
> +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
> index 26b2d70..b6ade28 100644
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
> @@ -28,10 +28,13 @@ package org.apache.royale.utils.js
>     * @royaleignorecoercion HTMLScriptElement
>     */
>    COMPILE::JS
> -  public function loadJavascript(url:String,callback:Function=null)
> +  public function loadJavascript(url:String,callback:Function=null):void
>    {
>      var script:HTMLScriptElement = document.createElement('script') as
> HTMLScriptElement;
> -    script.onload = callback;
> +       if (callback)
> +       {
> +                   script.onload = callback;
> +       }
>      script.src = url;
>      document.head.appendChild(script);
>    }
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: Add type declaration, plus make sure callback is defined

Posted by Carlos Rovira <ca...@apache.org>.
Thanks Harbs,
If nobody comes first I'll add that class as I try to add the theme
selector to Jewel Example, hopefully some time in the next days

El jue., 20 sept. 2018 a las 12:22, Harbs (<ha...@gmail.com>)
escribió:

> The only thing we have for css is addDynamicSelector which I don’t think
> does what you want.
>
> Loading a css file should be almost the same as JS.
>
> > On Sep 20, 2018, at 1:12 PM, Carlos Rovira <ca...@apache.org>
> wrote:
> >
> > Hi,
> >
> > do we have something like this for CSS files?
> > I was thinking in add to JewelExample a "theme selector", and I think it
> > could be great to add the css on the fly
> >
> > thanks
> >
> > Carlos
> >
> >
> > El jue., 20 sept. 2018 a las 12:03, <yi...@apache.org> escribió:
> >
> >> This is an automated email from the ASF dual-hosted git repository.
> >>
> >> yishayw pushed a commit to branch develop
> >> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> >>
> >>
> >> The following commit(s) were added to refs/heads/develop by this push:
> >>     new 7441707  Add type declaration, plus make sure callback is
> defined
> >> 7441707 is described below
> >>
> >> commit 7441707fb929c0c43b11c8a9088c78b24eccac7d
> >> Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
> >> AuthorDate: Thu Sep 20 13:03:27 2018 +0300
> >>
> >>    Add type declaration, plus make sure callback is defined
> >> ---
> >> .../src/main/royale/org/apache/royale/utils/js/loadJavascript.as   | 7
> >> +++++--
> >> 1 file changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git
> >>
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
> >>
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
> >> index 26b2d70..b6ade28 100644
> >> ---
> >>
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
> >> +++
> >>
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
> >> @@ -28,10 +28,13 @@ package org.apache.royale.utils.js
> >>    * @royaleignorecoercion HTMLScriptElement
> >>    */
> >>   COMPILE::JS
> >> -  public function loadJavascript(url:String,callback:Function=null)
> >> +  public function
> loadJavascript(url:String,callback:Function=null):void
> >>   {
> >>     var script:HTMLScriptElement = document.createElement('script') as
> >> HTMLScriptElement;
> >> -    script.onload = callback;
> >> +       if (callback)
> >> +       {
> >> +                   script.onload = callback;
> >> +       }
> >>     script.src = url;
> >>     document.head.appendChild(script);
> >>   }
> >>
> >>
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch develop updated: Add type declaration, plus make sure callback is defined

Posted by Harbs <ha...@gmail.com>.
The only thing we have for css is addDynamicSelector which I don’t think does what you want.

Loading a css file should be almost the same as JS.

> On Sep 20, 2018, at 1:12 PM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Hi,
> 
> do we have something like this for CSS files?
> I was thinking in add to JewelExample a "theme selector", and I think it
> could be great to add the css on the fly
> 
> thanks
> 
> Carlos
> 
> 
> El jue., 20 sept. 2018 a las 12:03, <yi...@apache.org> escribió:
> 
>> This is an automated email from the ASF dual-hosted git repository.
>> 
>> yishayw pushed a commit to branch develop
>> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>> 
>> 
>> The following commit(s) were added to refs/heads/develop by this push:
>>     new 7441707  Add type declaration, plus make sure callback is defined
>> 7441707 is described below
>> 
>> commit 7441707fb929c0c43b11c8a9088c78b24eccac7d
>> Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
>> AuthorDate: Thu Sep 20 13:03:27 2018 +0300
>> 
>>    Add type declaration, plus make sure callback is defined
>> ---
>> .../src/main/royale/org/apache/royale/utils/js/loadJavascript.as   | 7
>> +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>> 
>> diff --git
>> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
>> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
>> index 26b2d70..b6ade28 100644
>> ---
>> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
>> +++
>> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/js/loadJavascript.as
>> @@ -28,10 +28,13 @@ package org.apache.royale.utils.js
>>    * @royaleignorecoercion HTMLScriptElement
>>    */
>>   COMPILE::JS
>> -  public function loadJavascript(url:String,callback:Function=null)
>> +  public function loadJavascript(url:String,callback:Function=null):void
>>   {
>>     var script:HTMLScriptElement = document.createElement('script') as
>> HTMLScriptElement;
>> -    script.onload = callback;
>> +       if (callback)
>> +       {
>> +                   script.onload = callback;
>> +       }
>>     script.src = url;
>>     document.head.appendChild(script);
>>   }
>> 
>> 
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira