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...@apache.org> on 2017/01/20 00:15:41 UTC
[FlexJS] MDL Dialog working cross browser
Hi,
MDL Dialog is working. But:
The good: Is working...in Chrome, Safari and Firefox
The bad: Don't like the dirty implementation
a) I used Harbs suggestion to invoke the dialogPolyfill ->
window[“dialogPolyfill”].registerDialog(dialog)
That works, and go that route since I didn't find the way to make a
@extern. Hope Alex could teach me changing my implementation with the
@extern or guide me...but I spend several hours trying things since I don't
find any doc to learn on how to do it.
b) inject_html is working from a CDN, finally the errors was a silly
mistake I did declaring the urls, but... hope Alex could implement the
proposal of insert the scripts (css and js) in SWC, since it seems to me
that depends on a hosted version that is not the official one, doesn't like
me. (We get MDL script from MDL site...and I think that is ok since is
the official web of MDL, but we as well can do the same and insert the MDL
scripts in SWC).
c) Rest of methods had to change to brackets notation as well....awful
for example dialog["show"](); instead of dialog.show();
This is due to the fact that Chrome know about HTMLDialogElement but Safari
/ Firefox doesn't so we must downgrade to use HTMLElement, and this class
doesn't have the referred methods. So I think that notation here, although
awful is valid, since I don't know other way to make it work...
In resume. Things are working, but hope we could change some of this points
since is not a good implementation IMHO
Thanks
--
Carlos Rovira
http://about.me/carlosrovira
Re: [FlexJS] MDL Dialog working cross browser
Posted by Carlos Rovira <ca...@codeoscopic.com>.
Ok Alex, I change to your proposal and is working ok
I think we can close here.
As a bonus, if you finaly work on allow resources in SWC let me know to
change the dialogPolyfill from be injected from a CDN to hosted in the MDL
SWC
Thanks!
Carlos
2017-01-21 0:21 GMT+01:00 Alex Harui <ah...@adobe.com>:
> OK, I think I get it.
>
> The code "if (!dialog.showModal)" is a test for a dynamic property being
> added, but when dialog is declared as HTMLDialogElement, it assumes the
> object has a showModal method.
>
> IMO, it is a bug that dialog.showModal in an if condition outputs a call
> to Language.closure, but really, this sort of test isn't safe across
> platforms. You might want to try using "in":
>
> if (!("showModal" in dialog))
>
> -Alex
>
> On 1/20/17, 2:58 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
> wrote:
>
> >I send too quickly. I want to ask you if the sentence
> >
> >*f (!dialog.showModal) {*
> >
> >not working could be considered a bug, or maybe here the brackets notation
> >is correct
> >
> >btw, I think that without count this issue, all is right now :)
> >
> >
> >
> >
> >2017-01-20 23:55 GMT+01:00 Carlos Rovira <ca...@codeoscopic.com>:
> >
> >> Hi Alex
> >>
> >> in the code below you can see that at the end dialog.showModal() works
> >>now
> >> (as well dialog.close())
> >> but
> >>
> >> *if (!dialog.showModal) {*
> >>
> >> not works. to make it works I change to : if (!dialog["showModal"]) {
> >>
> >>
> >>
> >> org.apache.flex.mdl.Dialog.prototype.showModal = function() {
> >> if (!this.lockDialogCreation) {
> >> this.lockDialogCreation = true;
> >> if (org.apache.flex.mdl.Application.topLevelApplication != null) {
> >> org.apache.flex.mdl.Application.topLevelApplication.
> >> addElement(this);
> >> }
> >> if (!org.apache.flex.utils.Language.closure(this.dialog.showModal,
> >> this.dialog, 'showModal')) {. *<-- line 88 is not working.*
> >> dialogPolyfill.registerDialog(this.dialog);
> >> }
> >> }
> >> this.dialog.showModal(); *<-- This is working right *
> >> };
> >>
> >> 2017-01-20 22:31 GMT+01:00 Alex Harui <ah...@adobe.com>:
> >>
> >>> The link appears to show a stack trace. What is the Dialog.js code
> >>>around
> >>> those line numbers?
> >>>
> >>> -Alex
> >>>
> >>> On 1/20/17, 12:09 PM, "carlos.rovira@gmail.com on behalf of Carlos
> >>> Rovira"
> >>> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
> >>> wrote:
> >>>
> >>> >Hi Alex,
> >>> >
> >>> >I modified as you said:
> >>> >
> >>> >/**
> >>> > * @flexjsignorecoercion
> >>>org.apache.flex.core.WrappedHTMLElement
> >>> >* @flexjsignorecoercion HTMLDialogElement
> >>> > */
> >>> > COMPILE::JS
> >>> > override protected function createElement():
> WrappedHTMLElement
> >>> > {
> >>> > typeNames = "mdl-dialog";
> >>> >
> >>> > dialog = document.createElement('dialog') as
> >>> >HTMLDialogElement;
> >>> >element = dialog as WrappedHTMLElement;
> >>> >
> >>> >
> >>> >Now the error is diferent:
> >>> >
> >>> >goog.bindNative_ = function(fn, selfObj, var_args) {
> >>> > return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
> >>> > <-- TypeError: undefined is not an object (evaluating 'fn.call')
> >>> >};
> >>> >
> >>> >
> >>> >See the image :
> >>> >
> >>> >http://imgur.com/fM9CeL5
> >>> >
> >>> >
> >>> >
> >>> >2017-01-20 18:55 GMT+01:00 Alex Harui <ah...@adobe.com>:
> >>> >
> >>> >>
> >>> >>
> >>> >> On 1/20/17, 9:47 AM, "carlos.rovira@gmail.com on behalf of Carlos
> >>> >>Rovira"
> >>> >> <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org>
> >>>wrote:
> >>> >>
> >>> >> >sorry in
> >>> >> >
> >>> >> >http://caniuse.com/#feat=dialog
> >>> >> >
> >>> >> ><http://caniuse.com/#feat=dialog>Safari 10 is in red and so "not
> >>> >> >supported"
> >>> >> >
> >>> >> >And for that reason we are forced to use brackets notation and
> >>> >>HTMLElement
> >>> >> >right?
> >>> >>
> >>> >> I still don't understand why you need brackets.
> >>> >>
> >>> >> FWIW, you can use:
> >>> >> @flexjsignorecoercion HTMLDialogElement
> >>> >>
> >>> >> This will get rid of the Language.as call, but I don't know what
> >>> >> createElement will return.
> >>> >>
> >>> >> I thought you said you somehow got this to work on Safari and FF but
> >>> >> couldn't call the show method without ["show"]. I still don't
> >>> >>understand
> >>> >> what the dialog variable is pointing to if you couldn't get past the
> >>> >> createElement call. But if Safari returns something that is an
> >>> >> HTMLElement with a show method, you should be able to call
> >>> dialog.show()
> >>> >> if you skip the Language.as check by using @flexjsignorecoercion
> >>> >>
> >>> >> HTH,
> >>> >> -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.
> >>>
> >>>
> >>
> >>
> >> --
> >>
> >> Carlos Rovira
> >> Director General
> >> M: +34 607 22 60 05 <607%2022%2060%2005>
> >> 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.
>
>
--
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] MDL Dialog working cross browser
Posted by Alex Harui <ah...@adobe.com>.
OK, I think I get it.
The code "if (!dialog.showModal)" is a test for a dynamic property being
added, but when dialog is declared as HTMLDialogElement, it assumes the
object has a showModal method.
IMO, it is a bug that dialog.showModal in an if condition outputs a call
to Language.closure, but really, this sort of test isn't safe across
platforms. You might want to try using "in":
if (!("showModal" in dialog))
-Alex
On 1/20/17, 2:58 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:
>I send too quickly. I want to ask you if the sentence
>
>*f (!dialog.showModal) {*
>
>not working could be considered a bug, or maybe here the brackets notation
>is correct
>
>btw, I think that without count this issue, all is right now :)
>
>
>
>
>2017-01-20 23:55 GMT+01:00 Carlos Rovira <ca...@codeoscopic.com>:
>
>> Hi Alex
>>
>> in the code below you can see that at the end dialog.showModal() works
>>now
>> (as well dialog.close())
>> but
>>
>> *if (!dialog.showModal) {*
>>
>> not works. to make it works I change to : if (!dialog["showModal"]) {
>>
>>
>>
>> org.apache.flex.mdl.Dialog.prototype.showModal = function() {
>> if (!this.lockDialogCreation) {
>> this.lockDialogCreation = true;
>> if (org.apache.flex.mdl.Application.topLevelApplication != null) {
>> org.apache.flex.mdl.Application.topLevelApplication.
>> addElement(this);
>> }
>> if (!org.apache.flex.utils.Language.closure(this.dialog.showModal,
>> this.dialog, 'showModal')) {. *<-- line 88 is not working.*
>> dialogPolyfill.registerDialog(this.dialog);
>> }
>> }
>> this.dialog.showModal(); *<-- This is working right *
>> };
>>
>> 2017-01-20 22:31 GMT+01:00 Alex Harui <ah...@adobe.com>:
>>
>>> The link appears to show a stack trace. What is the Dialog.js code
>>>around
>>> those line numbers?
>>>
>>> -Alex
>>>
>>> On 1/20/17, 12:09 PM, "carlos.rovira@gmail.com on behalf of Carlos
>>> Rovira"
>>> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
>>> wrote:
>>>
>>> >Hi Alex,
>>> >
>>> >I modified as you said:
>>> >
>>> >/**
>>> > * @flexjsignorecoercion
>>>org.apache.flex.core.WrappedHTMLElement
>>> >* @flexjsignorecoercion HTMLDialogElement
>>> > */
>>> > COMPILE::JS
>>> > override protected function createElement():WrappedHTMLElement
>>> > {
>>> > typeNames = "mdl-dialog";
>>> >
>>> > dialog = document.createElement('dialog') as
>>> >HTMLDialogElement;
>>> >element = dialog as WrappedHTMLElement;
>>> >
>>> >
>>> >Now the error is diferent:
>>> >
>>> >goog.bindNative_ = function(fn, selfObj, var_args) {
>>> > return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
>>> > <-- TypeError: undefined is not an object (evaluating 'fn.call')
>>> >};
>>> >
>>> >
>>> >See the image :
>>> >
>>> >http://imgur.com/fM9CeL5
>>> >
>>> >
>>> >
>>> >2017-01-20 18:55 GMT+01:00 Alex Harui <ah...@adobe.com>:
>>> >
>>> >>
>>> >>
>>> >> On 1/20/17, 9:47 AM, "carlos.rovira@gmail.com on behalf of Carlos
>>> >>Rovira"
>>> >> <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org>
>>>wrote:
>>> >>
>>> >> >sorry in
>>> >> >
>>> >> >http://caniuse.com/#feat=dialog
>>> >> >
>>> >> ><http://caniuse.com/#feat=dialog>Safari 10 is in red and so "not
>>> >> >supported"
>>> >> >
>>> >> >And for that reason we are forced to use brackets notation and
>>> >>HTMLElement
>>> >> >right?
>>> >>
>>> >> I still don't understand why you need brackets.
>>> >>
>>> >> FWIW, you can use:
>>> >> @flexjsignorecoercion HTMLDialogElement
>>> >>
>>> >> This will get rid of the Language.as call, but I don't know what
>>> >> createElement will return.
>>> >>
>>> >> I thought you said you somehow got this to work on Safari and FF but
>>> >> couldn't call the show method without ["show"]. I still don't
>>> >>understand
>>> >> what the dialog variable is pointing to if you couldn't get past the
>>> >> createElement call. But if Safari returns something that is an
>>> >> HTMLElement with a show method, you should be able to call
>>> dialog.show()
>>> >> if you skip the Language.as check by using @flexjsignorecoercion
>>> >>
>>> >> HTH,
>>> >> -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.
>>>
>>>
>>
>>
>> --
>>
>> Carlos Rovira
>> Director General
>> M: +34 607 22 60 05 <607%2022%2060%2005>
>> 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] MDL Dialog working cross browser
Posted by Carlos Rovira <ca...@codeoscopic.com>.
I send too quickly. I want to ask you if the sentence
*f (!dialog.showModal) {*
not working could be considered a bug, or maybe here the brackets notation
is correct
btw, I think that without count this issue, all is right now :)
2017-01-20 23:55 GMT+01:00 Carlos Rovira <ca...@codeoscopic.com>:
> Hi Alex
>
> in the code below you can see that at the end dialog.showModal() works now
> (as well dialog.close())
> but
>
> *if (!dialog.showModal) {*
>
> not works. to make it works I change to : if (!dialog["showModal"]) {
>
>
>
> org.apache.flex.mdl.Dialog.prototype.showModal = function() {
> if (!this.lockDialogCreation) {
> this.lockDialogCreation = true;
> if (org.apache.flex.mdl.Application.topLevelApplication != null) {
> org.apache.flex.mdl.Application.topLevelApplication.
> addElement(this);
> }
> if (!org.apache.flex.utils.Language.closure(this.dialog.showModal,
> this.dialog, 'showModal')) {. *<-- line 88 is not working.*
> dialogPolyfill.registerDialog(this.dialog);
> }
> }
> this.dialog.showModal(); *<-- This is working right *
> };
>
> 2017-01-20 22:31 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>> The link appears to show a stack trace. What is the Dialog.js code around
>> those line numbers?
>>
>> -Alex
>>
>> On 1/20/17, 12:09 PM, "carlos.rovira@gmail.com on behalf of Carlos
>> Rovira"
>> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
>> wrote:
>>
>> >Hi Alex,
>> >
>> >I modified as you said:
>> >
>> >/**
>> > * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
>> >* @flexjsignorecoercion HTMLDialogElement
>> > */
>> > COMPILE::JS
>> > override protected function createElement():WrappedHTMLElement
>> > {
>> > typeNames = "mdl-dialog";
>> >
>> > dialog = document.createElement('dialog') as
>> >HTMLDialogElement;
>> >element = dialog as WrappedHTMLElement;
>> >
>> >
>> >Now the error is diferent:
>> >
>> >goog.bindNative_ = function(fn, selfObj, var_args) {
>> > return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
>> > <-- TypeError: undefined is not an object (evaluating 'fn.call')
>> >};
>> >
>> >
>> >See the image :
>> >
>> >http://imgur.com/fM9CeL5
>> >
>> >
>> >
>> >2017-01-20 18:55 GMT+01:00 Alex Harui <ah...@adobe.com>:
>> >
>> >>
>> >>
>> >> On 1/20/17, 9:47 AM, "carlos.rovira@gmail.com on behalf of Carlos
>> >>Rovira"
>> >> <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
>> >>
>> >> >sorry in
>> >> >
>> >> >http://caniuse.com/#feat=dialog
>> >> >
>> >> ><http://caniuse.com/#feat=dialog>Safari 10 is in red and so "not
>> >> >supported"
>> >> >
>> >> >And for that reason we are forced to use brackets notation and
>> >>HTMLElement
>> >> >right?
>> >>
>> >> I still don't understand why you need brackets.
>> >>
>> >> FWIW, you can use:
>> >> @flexjsignorecoercion HTMLDialogElement
>> >>
>> >> This will get rid of the Language.as call, but I don't know what
>> >> createElement will return.
>> >>
>> >> I thought you said you somehow got this to work on Safari and FF but
>> >> couldn't call the show method without ["show"]. I still don't
>> >>understand
>> >> what the dialog variable is pointing to if you couldn't get past the
>> >> createElement call. But if Safari returns something that is an
>> >> HTMLElement with a show method, you should be able to call
>> dialog.show()
>> >> if you skip the Language.as check by using @flexjsignorecoercion
>> >>
>> >> HTH,
>> >> -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.
>>
>>
>
>
> --
>
> Carlos Rovira
> Director General
> M: +34 607 22 60 05 <607%2022%2060%2005>
> 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] MDL Dialog working cross browser
Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Alex
in the code below you can see that at the end dialog.showModal() works now
(as well dialog.close())
but
*if (!dialog.showModal) {*
not works. to make it works I change to : if (!dialog["showModal"]) {
org.apache.flex.mdl.Dialog.prototype.showModal = function() {
if (!this.lockDialogCreation) {
this.lockDialogCreation = true;
if (org.apache.flex.mdl.Application.topLevelApplication != null) {
org.apache.flex.mdl.Application.topLevelApplication.addElement(this);
}
if (!org.apache.flex.utils.Language.closure(this.dialog.showModal,
this.dialog, 'showModal')) {. *<-- line 88 is not working.*
dialogPolyfill.registerDialog(this.dialog);
}
}
this.dialog.showModal(); *<-- This is working right *
};
2017-01-20 22:31 GMT+01:00 Alex Harui <ah...@adobe.com>:
> The link appears to show a stack trace. What is the Dialog.js code around
> those line numbers?
>
> -Alex
>
> On 1/20/17, 12:09 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com>
> wrote:
>
> >Hi Alex,
> >
> >I modified as you said:
> >
> >/**
> > * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
> >* @flexjsignorecoercion HTMLDialogElement
> > */
> > COMPILE::JS
> > override protected function createElement():WrappedHTMLElement
> > {
> > typeNames = "mdl-dialog";
> >
> > dialog = document.createElement('dialog') as
> >HTMLDialogElement;
> >element = dialog as WrappedHTMLElement;
> >
> >
> >Now the error is diferent:
> >
> >goog.bindNative_ = function(fn, selfObj, var_args) {
> > return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
> > <-- TypeError: undefined is not an object (evaluating 'fn.call')
> >};
> >
> >
> >See the image :
> >
> >http://imgur.com/fM9CeL5
> >
> >
> >
> >2017-01-20 18:55 GMT+01:00 Alex Harui <ah...@adobe.com>:
> >
> >>
> >>
> >> On 1/20/17, 9:47 AM, "carlos.rovira@gmail.com on behalf of Carlos
> >>Rovira"
> >> <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
> >>
> >> >sorry in
> >> >
> >> >http://caniuse.com/#feat=dialog
> >> >
> >> ><http://caniuse.com/#feat=dialog>Safari 10 is in red and so "not
> >> >supported"
> >> >
> >> >And for that reason we are forced to use brackets notation and
> >>HTMLElement
> >> >right?
> >>
> >> I still don't understand why you need brackets.
> >>
> >> FWIW, you can use:
> >> @flexjsignorecoercion HTMLDialogElement
> >>
> >> This will get rid of the Language.as call, but I don't know what
> >> createElement will return.
> >>
> >> I thought you said you somehow got this to work on Safari and FF but
> >> couldn't call the show method without ["show"]. I still don't
> >>understand
> >> what the dialog variable is pointing to if you couldn't get past the
> >> createElement call. But if Safari returns something that is an
> >> HTMLElement with a show method, you should be able to call dialog.show()
> >> if you skip the Language.as check by using @flexjsignorecoercion
> >>
> >> HTH,
> >> -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.
>
>
--
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] MDL Dialog working cross browser
Posted by Alex Harui <ah...@adobe.com>.
The link appears to show a stack trace. What is the Dialog.js code around
those line numbers?
-Alex
On 1/20/17, 12:09 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:
>Hi Alex,
>
>I modified as you said:
>
>/**
> * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
>* @flexjsignorecoercion HTMLDialogElement
> */
> COMPILE::JS
> override protected function createElement():WrappedHTMLElement
> {
> typeNames = "mdl-dialog";
>
> dialog = document.createElement('dialog') as
>HTMLDialogElement;
>element = dialog as WrappedHTMLElement;
>
>
>Now the error is diferent:
>
>goog.bindNative_ = function(fn, selfObj, var_args) {
> return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
> <-- TypeError: undefined is not an object (evaluating 'fn.call')
>};
>
>
>See the image :
>
>http://imgur.com/fM9CeL5
>
>
>
>2017-01-20 18:55 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>>
>>
>> On 1/20/17, 9:47 AM, "carlos.rovira@gmail.com on behalf of Carlos
>>Rovira"
>> <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
>>
>> >sorry in
>> >
>> >http://caniuse.com/#feat=dialog
>> >
>> ><http://caniuse.com/#feat=dialog>Safari 10 is in red and so "not
>> >supported"
>> >
>> >And for that reason we are forced to use brackets notation and
>>HTMLElement
>> >right?
>>
>> I still don't understand why you need brackets.
>>
>> FWIW, you can use:
>> @flexjsignorecoercion HTMLDialogElement
>>
>> This will get rid of the Language.as call, but I don't know what
>> createElement will return.
>>
>> I thought you said you somehow got this to work on Safari and FF but
>> couldn't call the show method without ["show"]. I still don't
>>understand
>> what the dialog variable is pointing to if you couldn't get past the
>> createElement call. But if Safari returns something that is an
>> HTMLElement with a show method, you should be able to call dialog.show()
>> if you skip the Language.as check by using @flexjsignorecoercion
>>
>> HTH,
>> -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] MDL Dialog working cross browser
Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Alex,
I modified as you said:
/**
* @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
* @flexjsignorecoercion HTMLDialogElement
*/
COMPILE::JS
override protected function createElement():WrappedHTMLElement
{
typeNames = "mdl-dialog";
dialog = document.createElement('dialog') as HTMLDialogElement;
element = dialog as WrappedHTMLElement;
Now the error is diferent:
goog.bindNative_ = function(fn, selfObj, var_args) {
return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));
<-- TypeError: undefined is not an object (evaluating 'fn.call')
};
See the image :
http://imgur.com/fM9CeL5
2017-01-20 18:55 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>
> On 1/20/17, 9:47 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
>
> >sorry in
> >
> >http://caniuse.com/#feat=dialog
> >
> ><http://caniuse.com/#feat=dialog>Safari 10 is in red and so "not
> >supported"
> >
> >And for that reason we are forced to use brackets notation and HTMLElement
> >right?
>
> I still don't understand why you need brackets.
>
> FWIW, you can use:
> @flexjsignorecoercion HTMLDialogElement
>
> This will get rid of the Language.as call, but I don't know what
> createElement will return.
>
> I thought you said you somehow got this to work on Safari and FF but
> couldn't call the show method without ["show"]. I still don't understand
> what the dialog variable is pointing to if you couldn't get past the
> createElement call. But if Safari returns something that is an
> HTMLElement with a show method, you should be able to call dialog.show()
> if you skip the Language.as check by using @flexjsignorecoercion
>
> HTH,
> -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] MDL Dialog working cross browser
Posted by Alex Harui <ah...@adobe.com>.
On 1/20/17, 9:47 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
>sorry in
>
>http://caniuse.com/#feat=dialog
>
><http://caniuse.com/#feat=dialog>Safari 10 is in red and so "not
>supported"
>
>And for that reason we are forced to use brackets notation and HTMLElement
>right?
I still don't understand why you need brackets.
FWIW, you can use:
@flexjsignorecoercion HTMLDialogElement
This will get rid of the Language.as call, but I don't know what
createElement will return.
I thought you said you somehow got this to work on Safari and FF but
couldn't call the show method without ["show"]. I still don't understand
what the dialog variable is pointing to if you couldn't get past the
createElement call. But if Safari returns something that is an
HTMLElement with a show method, you should be able to call dialog.show()
if you skip the Language.as check by using @flexjsignorecoercion
HTH,
-Alex
Re: [FlexJS] MDL Dialog working cross browser
Posted by Carlos Rovira <ca...@apache.org>.
sorry in
http://caniuse.com/#feat=dialog
<http://caniuse.com/#feat=dialog>Safari 10 is in red and so "not supported"
And for that reason we are forced to use brackets notation and HTMLElement
right?
2017-01-20 18:45 GMT+01:00 Carlos Rovira <ca...@apache.org>:
> Hi Alex
>
> 2017-01-20 17:57 GMT+01:00 Alex Harui <ah...@adobe.com>:
>>
>>
>> I guess I still don't understand. What code is referencing
>> HTMLDialogElement? Or is the code calling
>> createElement("HTMLDialogElement")?
>>
>> And then, in Safari, what is the dialog variable pointing to and how can
>> it have a "show" method? Whatever it is pointing to, if you can call
>> dialog["show"] you should also be able to call dialog.show at runtime.
>> The runtime should not care.
>>
>
> Just uploaded "Dialog.as" in MDL library. Please take a look, I introduced
> comments in the lines affected
>
> You can find:
>
> COMPILE::JS
> private var dialog:HTMLElement; //HTMLDialogElement
>
> dialog should be HTMLDialogElement to be able to do:
>
> dialog.showModal()
>
> instead of current:
>
> dialog["showModal"]();
>
> The reason that dialog is declared as "HTMLElement" instead
> "HTMLDialogElement" is due the fact that Safari (and suppose Firefox too)
> gives error since doesn't recognize the second. When I click the button
> SHOW DIALOG safari throws:
>
> org.apache.flex.mdl.Dialog.prototype.createElement = function() {
> this.typeNames = "mdl-dialog";
> this.dialog = org.apache.flex.utils.Language.as(document.createElement('dialog'),
> HTMLDialogElement); <---- ReferenceError: Can't find variable:
> HTMLDialogElement
> ...
>
> While Chrome works ok.
>
> But Safari should work since I'm with latest 10.0.2
>
> http://caniuse.com/#feat=dialog
>
> So maybe is our problem?
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>
--
Carlos Rovira
http://about.me/carlosrovira
Re: [FlexJS] MDL Dialog working cross browser
Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex
2017-01-20 17:57 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>
> I guess I still don't understand. What code is referencing
> HTMLDialogElement? Or is the code calling
> createElement("HTMLDialogElement")?
>
> And then, in Safari, what is the dialog variable pointing to and how can
> it have a "show" method? Whatever it is pointing to, if you can call
> dialog["show"] you should also be able to call dialog.show at runtime.
> The runtime should not care.
>
Just uploaded "Dialog.as" in MDL library. Please take a look, I introduced
comments in the lines affected
You can find:
COMPILE::JS
private var dialog:HTMLElement; //HTMLDialogElement
dialog should be HTMLDialogElement to be able to do:
dialog.showModal()
instead of current:
dialog["showModal"]();
The reason that dialog is declared as "HTMLElement" instead
"HTMLDialogElement" is due the fact that Safari (and suppose Firefox too)
gives error since doesn't recognize the second. When I click the button
SHOW DIALOG safari throws:
org.apache.flex.mdl.Dialog.prototype.createElement = function() {
this.typeNames = "mdl-dialog";
this.dialog =
org.apache.flex.utils.Language.as(document.createElement('dialog'),
HTMLDialogElement); <---- ReferenceError: Can't find variable:
HTMLDialogElement
...
While Chrome works ok.
But Safari should work since I'm with latest 10.0.2
http://caniuse.com/#feat=dialog
So maybe is our problem?
--
Carlos Rovira
http://about.me/carlosrovira
Re: [FlexJS] MDL Dialog working cross browser
Posted by Alex Harui <ah...@adobe.com>.
On 1/20/17, 3:04 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
>Hi Alex
>
>2017-01-20 1:25 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>>
>>
>> Are you sure you have to do this?
>
>
>Of Course no If I can solve :)
>
>
>> IMO, if the typedefs have an
>> HTMLDialogElement with a "show" method, the compiler should let you call
>> dialog.show(). If dialog["show"] works in Safari/FireFox then it sounds
>> more like a typedefs issue than a runtime issue.
>>
>
>The problem is that Safari reports error saying that he doesn't know what
>is HTMLDialogElement
>If Safari will recognize it, I'm sure it will come with the rest of
>methods
>(show, showModal, close,...)
>
>In other words, FlexJS is compiling ok HTMLDialogElement, and Chrome works
>ok, but in Safari console gives error.
>So I think we have no solution right?
>
I guess I still don't understand. What code is referencing
HTMLDialogElement? Or is the code calling
createElement("HTMLDialogElement")?
And then, in Safari, what is the dialog variable pointing to and how can
it have a "show" method? Whatever it is pointing to, if you can call
dialog["show"] you should also be able to call dialog.show at runtime.
The runtime should not care.
-Alex
Re: [FlexJS] MDL Dialog working cross browser
Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex
2017-01-20 1:25 GMT+01:00 Alex Harui <ah...@adobe.com>:
>
>
> Are you sure you have to do this?
Of Course no If I can solve :)
> IMO, if the typedefs have an
> HTMLDialogElement with a "show" method, the compiler should let you call
> dialog.show(). If dialog["show"] works in Safari/FireFox then it sounds
> more like a typedefs issue than a runtime issue.
>
The problem is that Safari reports error saying that he doesn't know what
is HTMLDialogElement
If Safari will recognize it, I'm sure it will come with the rest of methods
(show, showModal, close,...)
In other words, FlexJS is compiling ok HTMLDialogElement, and Chrome works
ok, but in Safari console gives error.
So I think we have no solution right?
--
Carlos Rovira
http://about.me/carlosrovira
Re: [FlexJS] MDL Dialog working cross browser
Posted by Alex Harui <ah...@adobe.com>.
On 1/19/17, 4:15 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
>c) Rest of methods had to change to brackets notation as well....awful
>
>for example dialog["show"](); instead of dialog.show();
>
>This is due to the fact that Chrome know about HTMLDialogElement but
>Safari
>/ Firefox doesn't so we must downgrade to use HTMLElement, and this class
>doesn't have the referred methods. So I think that notation here, although
>awful is valid, since I don't know other way to make it work...
Are you sure you have to do this? IMO, if the typedefs have an
HTMLDialogElement with a "show" method, the compiler should let you call
dialog.show(). If dialog["show"] works in Safari/FireFox then it sounds
more like a typedefs issue than a runtime issue.
-Alex