maildev@lists.thunderbird.net

Thunderbird email developers

View all threads

How to get datepicker and timepicker in XUL in TB68

JK
Jonathan Kamens
Sat, Mar 30, 2019 5:13 PM

I'm trying to port an add-on to Thunderbird 68 as a legacy add-on, i.e.,
not a WebExtension.

My add-on uses datepicker and timepicker. These are gone in TB 68.

My understanding is that the recommendation is to use html:input type="date" and html:input type="time".

I tried this:

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?>

<window xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox>
<label value="Date:"/>
<html:input type="date"/>
<label value="Time:"/>
<html:input type="time"/>
</hbox>
</window>

This is what the resulting window looks like:

I tried cribbing from Lightning, like this (i would rather not do this
as my ultimate solution, because I don't want to depend on Lightning
being installed and enabled, but I figured it was a useful thought
exercise):

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> <hbox> <label value="Date:"/> <datepicker/> <label value="Time:"/> <timepicker/> </hbox> </window>

This is what the resulting window looks like:

I'm stumped. Can someone help me get this to work?

Thanks,

Jonathan Kamens

I'm trying to port an add-on to Thunderbird 68 as a legacy add-on, i.e., not a WebExtension. My add-on uses `datepicker` and `timepicker`. These are gone in TB 68. My understanding is that the recommendation is to use `html:input type="date"` and `html:input type="time"`. I tried this: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> <window xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox> <label value="Date:"/> <html:input type="date"/> <label value="Time:"/> <html:input type="time"/> </hbox> </window> This is what the resulting window looks like: I tried cribbing from Lightning, like this (i would rather not do this as my ultimate solution, because I don't want to depend on Lightning being installed and enabled, but I figured it was a useful thought exercise): <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> <hbox> <label value="Date:"/> <datepicker/> <label value="Time:"/> <timepicker/> </hbox> </window> This is what the resulting window looks like: I'm stumped. Can someone help me get this to work? Thanks, Jonathan Kamens
JK
Jörg Knobloch
Sat, Mar 30, 2019 5:57 PM

On 30 Mar 2019 18:13, Jonathan Kamens via Maildev wrote:

My add-on uses datepicker and timepicker. These are gone in TB 68.

Yes, they are gone.

For Lighting, I think you're missing some stuff, take a look at:

https://hg.mozilla.org/comm-central/rev/14de040ec19dcc699bc4081c70ff19169f527a48

In some cases "customElements.js" is needed.

As for the proper HTML way, that's apparently broken :-( -
https://bugzilla.mozilla.org/show_bug.cgi?id=1527615

Jörg.

On 30 Mar 2019 18:13, Jonathan Kamens via Maildev wrote: > My add-on uses `datepicker` and `timepicker`. These are gone in TB 68. Yes, they are gone. For Lighting, I think you're missing some stuff, take a look at: https://hg.mozilla.org/comm-central/rev/14de040ec19dcc699bc4081c70ff19169f527a48 In some cases "customElements.js" is needed. As for the proper HTML way, that's apparently broken :-( - https://bugzilla.mozilla.org/show_bug.cgi?id=1527615 Jörg.
JK
Jonathan Kamens
Sat, Mar 30, 2019 6:35 PM

Even with the much-expanded XUL file shown below (I threw in the whole
kitchen sink to see if any of it would help), datepicker and timepicker
don't work, i.e., the window that pops up still looks exactly like the
screenshot I posted in my last email.

  jik

Ref:

<?xml version="1.0"?> <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/content/bindings.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/calendar-alarms.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/widgets/minimonth.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/calendar-attendees.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-event-dialog.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/content/calendar-event-dialog.css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/primaryToolbar.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/messenger.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/dialogs/calendar-event-dialog.css"?> <!DOCTYPE window [ <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
<!ENTITY % dtd3 SYSTEM "chrome://calendar/locale/calendar-event-dialog.dtd" > %dtd3;
<!ENTITY % dtd4 SYSTEM "chrome://calendar/locale/preferences/timezones.dtd" > %dtd4;

]>

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://lightning/content/lightning-item-iframe.js"/> <script type="application/javascript" src="chrome://calendar/content/calendar-dialog-utils.js"/> <script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/> <script type="application/javascript" src="chrome://calendar/content/calApplicationUtils.js"/> <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/> <script type="application/javascript" src="chrome://global/content/printUtils.js"/> <script type="application/javascript" src="chrome://calendar/content/calendar-statusbar.js"/> <script type="application/javascript" src="chrome://messenger/content/customElements.js"/> <script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> <hbox> <label value="Date:"/> <datepicker/> <label value="Time:"/> <timepicker/> </hbox> </window>

On 3/30/19 1:57 PM, Jörg Knobloch wrote:

On 30 Mar 2019 18:13, Jonathan Kamens via Maildev wrote:

My add-on uses datepicker and timepicker. These are gone in TB 68.

Yes, they are gone.

For Lighting, I think you're missing some stuff, take a look at:

https://hg.mozilla.org/comm-central/rev/14de040ec19dcc699bc4081c70ff19169f527a48

In some cases "customElements.js" is needed.

As for the proper HTML way, that's apparently broken :-( -
https://bugzilla.mozilla.org/show_bug.cgi?id=1527615

Jörg.


Maildev mailing list
Maildev@lists.thunderbird.net
http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net

Even with the much-expanded XUL file shown below (I threw in the whole kitchen sink to see if any of it would help), datepicker and timepicker don't work, i.e., the window that pops up still looks exactly like the screenshot I posted in my last email.   jik Ref: <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/content/bindings.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/calendar-alarms.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/widgets/minimonth.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/calendar-attendees.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-event-dialog.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/content/calendar-event-dialog.css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/primaryToolbar.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/messenger.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar-common/skin/dialogs/calendar-event-dialog.css"?> <!DOCTYPE window [ <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1; <!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2; <!ENTITY % dtd3 SYSTEM "chrome://calendar/locale/calendar-event-dialog.dtd" > %dtd3; <!ENTITY % dtd4 SYSTEM "chrome://calendar/locale/preferences/timezones.dtd" > %dtd4; ]> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://lightning/content/lightning-item-iframe.js"/> <script type="application/javascript" src="chrome://calendar/content/calendar-dialog-utils.js"/> <script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/> <script type="application/javascript" src="chrome://calendar/content/calApplicationUtils.js"/> <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/> <script type="application/javascript" src="chrome://global/content/printUtils.js"/> <script type="application/javascript" src="chrome://calendar/content/calendar-statusbar.js"/> <script type="application/javascript" src="chrome://messenger/content/customElements.js"/> <script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> <hbox> <label value="Date:"/> <datepicker/> <label value="Time:"/> <timepicker/> </hbox> </window> On 3/30/19 1:57 PM, Jörg Knobloch wrote: > On 30 Mar 2019 18:13, Jonathan Kamens via Maildev wrote: >> My add-on uses `datepicker` and `timepicker`. These are gone in TB 68. > > Yes, they are gone. > > For Lighting, I think you're missing some stuff, take a look at: > > https://hg.mozilla.org/comm-central/rev/14de040ec19dcc699bc4081c70ff19169f527a48 > > > In some cases "customElements.js" is needed. > > As for the proper HTML way, that's apparently broken :-( - > https://bugzilla.mozilla.org/show_bug.cgi?id=1527615 > > Jörg. > > > > _______________________________________________ > Maildev mailing list > Maildev@lists.thunderbird.net > http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net > >
JK
Jörg Knobloch
Sat, Mar 30, 2019 7:12 PM

On 30 Mar 2019 19:35, Jonathan Kamens via Maildev wrote:

Even with the much-expanded XUL file shown below (I threw in the whole
kitchen sink to see if any of it would help), datepicker and
timepicker don't work, i.e., the window that pops up still looks
exactly like the screenshot I posted in my last email.

OK, I won 2 of 3, now going for the third ;-)

Somehow the datepicker must work, see
https://searchfox.org/comm-central/search?q=%3Cdatepicker&case=false&regexp=false&path=

I noticed that the <window> and <dialog> panels on which the datepicker
is placed all have an onload function set.

This is just a "pattern matching" approach, but perhaps you can try
something along the lines of:

onload="document.getElementById("you-picker-id").value = Date.now();"

Jörg.

On 30 Mar 2019 19:35, Jonathan Kamens via Maildev wrote: > Even with the much-expanded XUL file shown below (I threw in the whole > kitchen sink to see if any of it would help), datepicker and > timepicker don't work, i.e., the window that pops up still looks > exactly like the screenshot I posted in my last email. OK, I won 2 of 3, now going for the third ;-) Somehow the datepicker must work, see https://searchfox.org/comm-central/search?q=%3Cdatepicker&case=false&regexp=false&path= I noticed that the <window> and <dialog> panels on which the datepicker is placed all have an onload function set. This is just a "pattern matching" approach, but perhaps you can try something along the lines of: onload="document.getElementById("you-picker-id").value = Date.now();" Jörg.
JK
Jonathan Kamens
Sat, Mar 30, 2019 8:04 PM

Alas, no change. Also, there are no messages in the error console when I
open the window.

On 3/30/19 3:12 PM, Jörg Knobloch wrote:

On 30 Mar 2019 19:35, Jonathan Kamens via Maildev wrote:

Even with the much-expanded XUL file shown below (I threw in the
whole kitchen sink to see if any of it would help), datepicker and
timepicker don't work, i.e., the window that pops up still looks
exactly like the screenshot I posted in my last email.

OK, I won 2 of 3, now going for the third ;-)

Somehow the datepicker must work, see
https://searchfox.org/comm-central/search?q=%3Cdatepicker&case=false&regexp=false&path=

I noticed that the <window> and <dialog> panels on which the
datepicker is placed all have an onload function set.

This is just a "pattern matching" approach, but perhaps you can try
something along the lines of:

onload="document.getElementById("you-picker-id").value = Date.now();"

Jörg.


Maildev mailing list
Maildev@lists.thunderbird.net
http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net

Alas, no change. Also, there are no messages in the error console when I open the window. On 3/30/19 3:12 PM, Jörg Knobloch wrote: > On 30 Mar 2019 19:35, Jonathan Kamens via Maildev wrote: >> Even with the much-expanded XUL file shown below (I threw in the >> whole kitchen sink to see if any of it would help), datepicker and >> timepicker don't work, i.e., the window that pops up still looks >> exactly like the screenshot I posted in my last email. > > OK, I won 2 of 3, now going for the third ;-) > > Somehow the datepicker must work, see > https://searchfox.org/comm-central/search?q=%3Cdatepicker&case=false&regexp=false&path= > > I noticed that the <window> and <dialog> panels on which the > datepicker is placed all have an onload function set. > > This is just a "pattern matching" approach, but perhaps you can try > something along the lines of: > > onload="document.getElementById("you-picker-id").value = Date.now();" > > Jörg. > > > _______________________________________________ > Maildev mailing list > Maildev@lists.thunderbird.net > http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net > >
GL
Geoff Lankow
Sun, Mar 31, 2019 1:49 AM

Here's a test file I've been using while remaking the menulist and
date/time pickers. It's not perfect but should give something to go on.

GL

On 31/03/19 06:13, Jonathan Kamens via Maildev wrote:

I'm trying to port an add-on to Thunderbird 68 as a legacy add-on,
i.e., not a WebExtension.

My add-on uses datepicker and timepicker. These are gone in TB 68.

My understanding is that the recommendation is to use html:input type="date" and html:input type="time".

I tried this:

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?>

<window xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox>
<label value="Date:"/>
<html:input type="date"/>
<label value="Time:"/>
<html:input type="time"/>
</hbox>
</window>

This is what the resulting window looks like:

I tried cribbing from Lightning, like this (i would rather not do this
as my ultimate solution, because I don't want to depend on Lightning
being installed and enabled, but I figured it was a useful thought
exercise):

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> <hbox> <label value="Date:"/> <datepicker/> <label value="Time:"/> <timepicker/> </hbox> </window>

This is what the resulting window looks like:

I'm stumped. Can someone help me get this to work?

Thanks,

Jonathan Kamens


Maildev mailing list
Maildev@lists.thunderbird.net
http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net

Here's a test file I've been using while remaking the menulist and date/time pickers. It's not perfect but should give something to go on. GL On 31/03/19 06:13, Jonathan Kamens via Maildev wrote: > > I'm trying to port an add-on to Thunderbird 68 as a legacy add-on, > i.e., not a WebExtension. > > My add-on uses `datepicker` and `timepicker`. These are gone in TB 68. > > My understanding is that the recommendation is to use `html:input > type="date"` and `html:input type="time"`. > > I tried this: > > <?xml version="1.0"?> > <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> > <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> > > <window xmlns:html="http://www.w3.org/1999/xhtml" > xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> > <hbox> > <label value="Date:"/> > <html:input type="date"/> > <label value="Time:"/> > <html:input type="time"/> > </hbox> > </window> > > This is what the resulting window looks like: > > I tried cribbing from Lightning, like this (i would rather not do this > as my ultimate solution, because I don't want to depend on Lightning > being installed and enabled, but I figured it was a useful thought > exercise): > > <?xml version="1.0"?> > <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> > <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> > <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> > > <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> > <script type="application/javascript" > src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> > <hbox> > <label value="Date:"/> > <datepicker/> > <label value="Time:"/> > <timepicker/> > </hbox> > </window> > > This is what the resulting window looks like: > > I'm stumped. Can someone help me get this to work? > > Thanks, > > Jonathan Kamens > > > _______________________________________________ > Maildev mailing list > Maildev@lists.thunderbird.net > http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net
JK
Jonathan Kamens
Sun, Mar 31, 2019 3:14 AM

OK, this is /very weird/.

The following XUL file successfully displays a datepicker and timepicker
in the 2019-03-29 nightly build:

<?xml version="1.0"?> <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/menulist.css"?>

<page align="start" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox>
<menulist> </menulist>
</hbox>
<hbox align="baseline">
<label value="Date:"/>
<datepicker/>
<label value="Time:"/>
<timepicker/>
</hbox>

<script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/> <script type="application/javascript" src="chrome://messenger/content/customElements.js"/> <script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> </page> However, if I remove the two lines shown in red, the datepicker and timepicker no longer display correctly. wut?   jik On 3/30/19 9:49 PM, Geoff Lankow wrote:

Here's a test file I've been using while remaking the menulist and
date/time pickers. It's not perfect but should give something to go on.

GL

On 31/03/19 06:13, Jonathan Kamens via Maildev wrote:

I'm trying to port an add-on to Thunderbird 68 as a legacy add-on,
i.e., not a WebExtension.

My add-on uses datepicker and timepicker. These are gone in TB 68.

My understanding is that the recommendation is to use html:input type="date" and html:input type="time".

I tried this:

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?>

<window xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox>
<label value="Date:"/>
<html:input type="date"/>
<label value="Time:"/>
<html:input type="time"/>
</hbox>
</window>

This is what the resulting window looks like:

I tried cribbing from Lightning, like this (i would rather not do
this as my ultimate solution, because I don't want to depend on
Lightning being installed and enabled, but I figured it was a useful
thought exercise):

<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> <hbox> <label value="Date:"/> <datepicker/> <label value="Time:"/> <timepicker/> </hbox> </window>

This is what the resulting window looks like:

I'm stumped. Can someone help me get this to work?

Thanks,

Jonathan Kamens


Maildev mailing list
Maildev@lists.thunderbird.net
http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net

OK, this is /very weird/. The following XUL file successfully displays a datepicker and timepicker in the 2019-03-29 nightly build: <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/menulist.css"?> <page align="start" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox> <menulist> </menulist> </hbox> <hbox align="baseline"> <label value="Date:"/> <datepicker/> <label value="Time:"/> <timepicker/> </hbox> <script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/> <script type="application/javascript" src="chrome://messenger/content/customElements.js"/> <script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> </page> However, if I remove the two lines shown in red, the datepicker and timepicker no longer display correctly. wut?   jik On 3/30/19 9:49 PM, Geoff Lankow wrote: > > Here's a test file I've been using while remaking the menulist and > date/time pickers. It's not perfect but should give something to go on. > > GL > > On 31/03/19 06:13, Jonathan Kamens via Maildev wrote: >> >> I'm trying to port an add-on to Thunderbird 68 as a legacy add-on, >> i.e., not a WebExtension. >> >> My add-on uses `datepicker` and `timepicker`. These are gone in TB 68. >> >> My understanding is that the recommendation is to use `html:input >> type="date"` and `html:input type="time"`. >> >> I tried this: >> >> <?xml version="1.0"?> >> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> >> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> >> >> <window xmlns:html="http://www.w3.org/1999/xhtml" >> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> >> <hbox> >> <label value="Date:"/> >> <html:input type="date"/> >> <label value="Time:"/> >> <html:input type="time"/> >> </hbox> >> </window> >> >> This is what the resulting window looks like: >> >> I tried cribbing from Lightning, like this (i would rather not do >> this as my ultimate solution, because I don't want to depend on >> Lightning being installed and enabled, but I figured it was a useful >> thought exercise): >> >> <?xml version="1.0"?> >> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> >> <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?> >> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> >> >> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> >> <script type="application/javascript" >> src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> >> <hbox> >> <label value="Date:"/> >> <datepicker/> >> <label value="Time:"/> >> <timepicker/> >> </hbox> >> </window> >> >> This is what the resulting window looks like: >> >> I'm stumped. Can someone help me get this to work? >> >> Thanks, >> >> Jonathan Kamens >> >> >> _______________________________________________ >> Maildev mailing list >> Maildev@lists.thunderbird.net >> http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net > > _______________________________________________ > Maildev mailing list > Maildev@lists.thunderbird.net > http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net
GL
Geoff Lankow
Sun, Mar 31, 2019 6:54 AM

Wow, that I've never seen that is a coincidence. It seems that the
script to create the menulist custom element is only loaded if there is
a menulist
https://searchfox.org/mozilla-central/rev/73e1da0906e711285c15b0fa5472263c01cbd3f2/toolkit/content/customElements.js#523.
All the places where we have datepickers also have one or more menulists.

I guess the easiest way to deal with that is to put
chrome://global/content/elements/menulist.js in a script tag if your
document doesn't have a menulist.

GL

On 31/03/19 16:14, Jonathan Kamens via Maildev wrote:

OK, this is /very weird/.

The following XUL file successfully displays a datepicker and
timepicker in the 2019-03-29 nightly build:

<?xml version="1.0"?> <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/menulist.css"?>

<page align="start" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox>
<menulist> </menulist>
</hbox>
<hbox align="baseline">
<label value="Date:"/>
<datepicker/>
<label value="Time:"/>
<timepicker/>
</hbox>
<script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/>
<script type="application/javascript" src="chrome://messenger/content/customElements.js"/>
<script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/>
</page>

However, if I remove the two lines shown in red, the datepicker and
timepicker no longer display correctly.

wut?

  jik

Wow, that I've never seen that is a coincidence. It seems that the script to create the menulist custom element is only loaded if there is a menulist <https://searchfox.org/mozilla-central/rev/73e1da0906e711285c15b0fa5472263c01cbd3f2/toolkit/content/customElements.js#523>. All the places where we have datepickers also have one or more menulists. I guess the easiest way to deal with that is to put chrome://global/content/elements/menulist.js in a script tag if your document doesn't have a menulist. GL On 31/03/19 16:14, Jonathan Kamens via Maildev wrote: > > OK, this is /very weird/. > > The following XUL file successfully displays a datepicker and > timepicker in the 2019-03-29 nightly build: > > <?xml version="1.0"?> > <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?> > <?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?> > <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> > <?xml-stylesheet type="text/css" href="chrome://messenger/skin/menulist.css"?> > > <page align="start" > xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> > <hbox> > <menulist> </menulist> > </hbox> > <hbox align="baseline"> > <label value="Date:"/> > <datepicker/> > <label value="Time:"/> > <timepicker/> > </hbox> > <script type="application/javascript" > src="chrome://calendar/content/calendar-ui-utils.js"/> > <script type="application/javascript" > src="chrome://messenger/content/customElements.js"/> > <script type="application/javascript" > src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> > </page> > > However, if I remove the two lines shown in red, the datepicker and > timepicker no longer display correctly. > > wut? > >   jik >
MM
Magnus Melin
Sun, Mar 31, 2019 11:22 AM

Let's actually fix that in code
https://bugzilla.mozilla.org/show_bug.cgi?id=1540522. Creating a
menulist by code is enough to trigger the creation so it's available.

Fixing <input type="date"> and <input type="time"> is hopefully also on
the horizon for 68.

 -Magnus

On 31-03-2019 09:54, Geoff Lankow wrote:

Wow, that I've never seen that is a coincidence. It seems that the
script to create the menulist custom element is only loaded if there
is a menulist
https://searchfox.org/mozilla-central/rev/73e1da0906e711285c15b0fa5472263c01cbd3f2/toolkit/content/customElements.js#523.
All the places where we have datepickers also have one or more menulists.

I guess the easiest way to deal with that is to put
chrome://global/content/elements/menulist.js in a script tag if your
document doesn't have a menulist.

GL

On 31/03/19 16:14, Jonathan Kamens via Maildev wrote:

OK, this is /very weird/.

The following XUL file successfully displays a datepicker and
timepicker in the 2019-03-29 nightly build:

<?xml version="1.0"?> <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?> <?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/menulist.css"?>

<page align="start" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox>
<menulist> </menulist>
</hbox>
<hbox align="baseline">
<label value="Date:"/>
<datepicker/>
<label value="Time:"/>
<timepicker/>
</hbox>
<script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/>
<script type="application/javascript" src="chrome://messenger/content/customElements.js"/>
<script type="application/javascript" src="chrome://calendar/content/datetimepickers/datetimepickers.js"/>
</page>

However, if I remove the two lines shown in red, the datepicker and
timepicker no longer display correctly.

wut?

  jik

Let's actually fix that in code <https://bugzilla.mozilla.org/show_bug.cgi?id=1540522>. Creating a menulist by code is enough to trigger the creation so it's available. Fixing <input type="date"> and <input type="time"> is hopefully also on the horizon for 68.  -Magnus On 31-03-2019 09:54, Geoff Lankow wrote: > > Wow, that I've never seen that is a coincidence. It seems that the > script to create the menulist custom element is only loaded if there > is a menulist > <https://searchfox.org/mozilla-central/rev/73e1da0906e711285c15b0fa5472263c01cbd3f2/toolkit/content/customElements.js#523>. > All the places where we have datepickers also have one or more menulists. > > I guess the easiest way to deal with that is to put > chrome://global/content/elements/menulist.js in a script tag if your > document doesn't have a menulist. > > GL > > On 31/03/19 16:14, Jonathan Kamens via Maildev wrote: >> >> OK, this is /very weird/. >> >> The following XUL file successfully displays a datepicker and >> timepicker in the 2019-03-29 nightly build: >> >> <?xml version="1.0"?> >> <?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?> >> <?xml-stylesheet type="text/css" href="chrome://calendar/content/widgets/calendar-widget-bindings.css"?> >> <?xml-stylesheet type="text/css" href="chrome://lightning-common/skin/datetimepickers.css"?> >> <?xml-stylesheet type="text/css" href="chrome://messenger/skin/menulist.css"?> >> >> <page align="start" >> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> >> <hbox> >> <menulist> </menulist> >> </hbox> >> <hbox align="baseline"> >> <label value="Date:"/> >> <datepicker/> >> <label value="Time:"/> >> <timepicker/> >> </hbox> >> <script type="application/javascript" >> src="chrome://calendar/content/calendar-ui-utils.js"/> >> <script type="application/javascript" >> src="chrome://messenger/content/customElements.js"/> >> <script type="application/javascript" >> src="chrome://calendar/content/datetimepickers/datetimepickers.js"/> >> </page> >> >> However, if I remove the two lines shown in red, the datepicker and >> timepicker no longer display correctly. >> >> wut? >> >>   jik >> > > _______________________________________________ > Maildev mailing list > Maildev@lists.thunderbird.net > http://lists.thunderbird.net/mailman/listinfo/maildev_lists.thunderbird.net
JK
Jonathan Kamens
Sun, Mar 31, 2019 11:57 AM

On 3/31/19 2:54 AM, Geoff Lankow wrote:

I guess the easiest way to deal with that is to put
chrome://global/content/elements/menulist.js in a script tag if your
document doesn't have a menulist.

Alas, that doesn't work. This will have to be fixed in Lightning, I
think. I mean, I could do something convoluted like create a hidden
menulist in my XUL, but I think perhaps I will wait until either this is
fixed in Lightning or html:input type="time|date" is fixed.

  jik

On 3/31/19 2:54 AM, Geoff Lankow wrote: > I guess the easiest way to deal with that is to put > chrome://global/content/elements/menulist.js in a script tag if your > document doesn't have a menulist. Alas, that doesn't work. This will have to be fixed in Lightning, I think. I mean, I could do something convoluted like create a hidden menulist in my XUL, but I think perhaps I will wait until either this is fixed in Lightning or html:input type="time|date" is fixed.   jik