You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Olaf Krueger <ma...@olafkrueger.net> on 2017/12/27 22:03:44 UTC

How to capture the ACE Editor with Royale?

Hi,
I am working on our "Royale Try-it-now app" and would like to capture the JS
ACE-Editor [1].
(I first chose ACE over the Monaco editor cause ACE supports AS3 and latter
does not support mobile)
Thanks to Piotr's Patreon stuff I stumbled over the 'inject_html' feature
but I am not sure if this is 
the way to go here.
Could somebody point me in the right direction how to use ACE with Royale?

Thanks,
Olaf


[1] https://ace.c9.io/



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: How to capture the ACE Editor with Royale?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Hi Alex,
I just remember that you've already shared this "BatchScanner" article
sometimes ago ;-)
Thanks for not getting tired doing this!

Olaf
 



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: How to capture the ACE Editor with Royale?

Posted by Gabe Harbs <ha...@gmail.com>.
FWIW, to prevent good warnings, you either need externs, or get the global using window[“ace”].

> On Dec 29, 2017, at 9:13 AM, Olaf Krueger <ma...@olafkrueger.net> wrote:
> 
> Hi Alex,
> unbelievable, but I've overlooked that these are static methods... I should
> sleep at night instead of doing this stuff ;-)
> 
> Thanks,
> Olaf
> 
> 
> 
> --
> Sent from: http://apache-royale-users.20374.n8.nabble.com/


Re: How to capture the ACE Editor with Royale?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Hi Alex,
unbelievable, but I've overlooked that these are static methods... I should
sleep at night instead of doing this stuff ;-)

Thanks,
Olaf



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: How to capture the ACE Editor with Royale?

Posted by Alex Harui <ah...@adobe.com>.
IIRC, the cordova plugin creates a 'global' object
cordova.plugin.barcodeScanner and the JS code has to call:
  cordova.plugin.barcodeScanner.xcan();

I think I could have just created a global function scan() in the package
cordova.plugin.barcodeScanner, but it was useful to have a all-static
Singleton with some private properties.

For the ACE Editor, it looks like they also create a global "ace" object.

HTH,
-Alex



On 12/28/17, 2:33 PM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:

>Just for understanding:
>Is there no need to instantiate a 'barcodeScanner' object here [1] cause
>this class is marked as 'externs' (TypeDefs) and so it just calls some JS
>functions?
>
>Thanks,
>Olaf
>
>[1]
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
>m%2Fapache%2Froyale-tourjs%2Fblob%2Fdevelop%2Fcordova%2FBatchScanner%2FBat
>chScanner%2Fsrc%2Fmain%2Fflex%2FBatchScanner.mxml%23L79&data=02%7C01%7Caha
>rui%40adobe.com%7Cc426e00753b749ca0d6808d54e4305b8%7Cfa7b1b5a7b34438794aed
>2c178decee1%7C0%7C0%7C636500972142334129&sdata=Oepk%2F8G0CCBbmbHcrceY5A8Ea
>LRFsXjG6hAxyGE6VWs%3D&reserved=0
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7Cc426e
>00753b749ca0d6808d54e4305b8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36500972142334129&sdata=%2FinDh8GFOzL2uzt9AWtlHlNKhxn54SmMjsArDpX1K%2F4%3D
>&reserved=0


Re: How to capture the ACE Editor with Royale?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Just for understanding:
Is there no need to instantiate a 'barcodeScanner' object here [1] cause
this class is marked as 'externs' (TypeDefs) and so it just calls some JS
functions?

Thanks,
Olaf

[1]
https://github.com/apache/royale-tourjs/blob/develop/cordova/BatchScanner/BatchScanner/src/main/flex/BatchScanner.mxml#L79



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Re: How to capture the ACE Editor with Royale?

Posted by Alex Harui <ah...@adobe.com>.
Hi Olaf,

I would recommend using inject_html to inject the script that loads the
ace.js file.

The rest of the code in their example [2] seems to be part of the setup,
so it is probably better to have that in AS.  You may want to create a
typedefs library for the ACEEditor as well. See: [3] for an example of how
I did something similar.

HTH,
-Alex

[2] https://ace.c9.io/#nav=embedding
[3] 
https://github.com/apache/royale-tourjs/blob/develop/cordova/BatchScanner/B
atchScanner/src/main/resources/top.html


On 12/27/17, 2:03 PM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:

>Hi,
>I am working on our "Royale Try-it-now app" and would like to capture the
>JS
>ACE-Editor [1].
>(I first chose ACE over the Monaco editor cause ACE supports AS3 and
>latter
>does not support mobile)
>Thanks to Piotr's Patreon stuff I stumbled over the 'inject_html' feature
>but I am not sure if this is
>the way to go here.
>Could somebody point me in the right direction how to use ACE with Royale?
>
>Thanks,
>Olaf
>
>
>[1] 
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Face.c9.io
>%2F&data=02%7C01%7Caharui%40adobe.com%7Cd82c0ffc2d434994605c08d54d75b534%7
>Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636500090315084894&sdata=cnRKq
>FrBcVvaKSyySh6d%2FeTVbDq%2B6c0timcLpMMZBOE%3D&reserved=0
>
>
>
>--
>Sent from: 
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7Cd82c0
>ffc2d434994605c08d54d75b534%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36500090315084894&sdata=99NDB9dC3e0WeZfhEYdwMTtlXpQU6ETQrHjqtNXxKW4%3D&res
>erved=0