Broken DateTime widget

49 views
Skip to first unread message

Lukas Zdych

unread,
May 18, 2013, 2:57:19 PM5/18/13
to ko...@googlegroups.com
Hi all,

I'm very new to Kotti / Pyramid and I like it more and more .. but I have currently one silly issue with a DateTime widget on fresh Kotti and my contenttype addon which I'm playing with. When I click the datetime field in a form I get the following error in the js console.

Safari / Chrome:
"Uncaught TypeError: Cannot read property 'msie' of undefined"

Firefox:
TypeError: $.browser is undefined

(the same in some community addons like kotti_calendar's event)

Just in case that matters my schema looks like this:

class ExampleSchema(ContentSchema):
    """Schema for add / edit forms of example content type"""

    my_date = SchemaNode(
        DateTime(),
        missing=None,
    )

Any ideas what I'm missing?

Thank you

Lukas

Andreas Kaiser

unread,
May 19, 2013, 8:19:04 AM5/19/13
to ko...@googlegroups.com

On 18.05.2013, at 20:57, Lukas Zdych <lukas...@gmail.com> wrote:

> I'm very new to Kotti / Pyramid and I like it more and more

Glad you like it!

> .. but I have currently one silly issue with a DateTime widget on fresh Kotti and my contenttype addon which I'm playing with. When I click the datetime field in a form I get the following error in the js console.
>
> Safari / Chrome:
> "Uncaught TypeError: Cannot read property 'msie' of undefined"
>
> Firefox:
> TypeError: $.browser is undefined

This error can be seen quite often these days and is caused by a jQuery
plugin that is not (yet) compatible with jQuery 1.9 (in 1.9 $.browser
has been removed).

A quick fix / workaround to get you going again would be to downgrade
jQuery to 1.8.2:

pip uninstall js.jquery && pip install js.jquery==1.8.2

> (the same in some community addons like kotti_calendar's event)

I'll try to find the jQuery plugin that causes the issue (should be
fairly easy with your detailed report) and see if there's a newer
version of it that is compatible with jQuery 1.9. If there is such a
newer version, I'll update the package that provides the plugin and pin
the new version in Kotti's requirements.txt. If there's no such newer
version we'll need (at least temporarily) pin js.jquery to 1.8.2 in the
requirements.txt.

Whatever the solution will be, you can expect a permanent fix for the
issue very soon.

> Any ideas what I'm missing?

Nothing really… ;)


Thanks for reporting,

Andreas

Lukas Zdych

unread,
May 19, 2013, 12:11:37 PM5/19/13
to ko...@googlegroups.com
Hi Andreas,

-- 
Lukas Zdych
Sent with Sparrow

On Sunday, May 19, 2013 at 2:19 PM, Andreas Kaiser wrote:


On 18.05.2013, at 20:57, Lukas Zdych <lukas...@gmail.com> wrote:

I'm very new to Kotti / Pyramid and I like it more and more

Glad you like it!

.. but I have currently one silly issue with a DateTime widget on fresh Kotti and my contenttype addon which I'm playing with. When I click the datetime field in a form I get the following error in the js console.

Safari / Chrome:
"Uncaught TypeError: Cannot read property 'msie' of undefined"

Firefox:
TypeError: $.browser is undefined

This error can be seen quite often these days and is caused by a jQuery
plugin that is not (yet) compatible with jQuery 1.9 (in 1.9 $.browser
has been removed).

A quick fix / workaround to get you going again would be to downgrade
jQuery to 1.8.2:

pip uninstall js.jquery && pip install js.jquery==1.8.2
- ahh .. how simple .. I should be able to find it out too if giving it more time .. but as I'm new to Kotti there is so much new and it's easier to ask here before I'll dive into it and get stuck for ages (in worst case)

- thank you this really works 

(the same in some community addons like kotti_calendar's event)

I'll try to find the jQuery plugin that causes the issue (should be
fairly easy with your detailed report) and see if there's a newer
version of it that is compatible with jQuery 1.9. If there is such a
newer version, I'll update the package that provides the plugin and pin
the new version in Kotti's requirements.txt. If there's no such newer
version we'll need (at least temporarily) pin js.jquery to 1.8.2 in the
requirements.txt.
- the error is occurring in js.jqueryui 1.8.24 :: jquery.ui.datepicker.js:L1605

Whatever the solution will be, you can expect a permanent fix for the
issue very soon.
- since js.jqueryui 1.8.24 is currently the lastest one I think we should temporarily pin js.jquery 1.8.2 as you suggested

Cheers and thank you for help

Lukas

Any ideas what I'm missing?

Nothing really… ;)


Thanks for reporting,

Andreas

--
You received this message because you are subscribed to a topic in the Google Groups "Kotti" group.
To unsubscribe from this group and all its topics, send an email to kotti+un...@googlegroups.com.

Andreas Kaiser

unread,
May 19, 2013, 1:11:40 PM5/19/13
to ko...@googlegroups.com

On 19.05.2013, at 18:11, Lukas Zdych <lukas...@gmail.com> wrote:

> On Sunday, May 19, 2013 at 2:19 PM, Andreas Kaiser wrote:
>
>> I'll try to find the jQuery plugin that causes the issue (should be
>> fairly easy with your detailed report) and see if there's a newer
>> version of it that is compatible with jQuery 1.9. If there is such a
>> newer version, I'll update the package that provides the plugin and pin
>> the new version in Kotti's requirements.txt. If there's no such newer
>> version we'll need (at least temporarily) pin js.jquery to 1.8.2 in the
>> requirements.txt.
> - the error is occurring in js.jqueryui 1.8.24 :: jquery.ui.datepicker.js:L1605
>>
>> Whatever the solution will be, you can expect a permanent fix for the
>> issue very soon.
> - since js.jqueryui 1.8.24 is currently the lastest one I think we should temporarily pin js.jquery 1.8.2 as you suggested

I prefer to make a 1.10.3 release of js.jqueryui, which I'm already
working on. Expect it later today or tomorrow…

> Cheers and thank you for help

You're welcome!


Andreas

Lukas Zdych

unread,
May 19, 2013, 1:13:54 PM5/19/13
to ko...@googlegroups.com
- even better if you can do so .. god bless you :-) 

Cheers and thank you for help

You're welcome!


Andreas

Lukas

Andreas Kaiser

unread,
May 20, 2013, 8:57:13 AM5/20/13
to ko...@googlegroups.com

On 19.05.2013, at 19:13, Lukas Zdych <lukas...@gmail.com> wrote:

> On Sunday, May 19, 2013 at 7:11 PM, Andreas Kaiser wrote:
>>
>> On 19.05.2013, at 18:11, Lukas Zdych <lukas...@gmail.com> wrote:
>>
>>> On Sunday, May 19, 2013 at 2:19 PM, Andreas Kaiser wrote:
>>>
>>>> I'll try to find the jQuery plugin that causes the issue (should be
>>>> fairly easy with your detailed report) and see if there's a newer
>>>> version of it that is compatible with jQuery 1.9. If there is such a
>>>> newer version, I'll update the package that provides the plugin and pin
>>>> the new version in Kotti's requirements.txt. If there's no such newer
>>>> version we'll need (at least temporarily) pin js.jquery to 1.8.2 in the
>>>> requirements.txt.
>>> - the error is occurring in js.jqueryui 1.8.24 :: jquery.ui.datepicker.js:L1605
>>>>
>>>> Whatever the solution will be, you can expect a permanent fix for the
>>>> issue very soon.
>>> - since js.jqueryui 1.8.24 is currently the lastest one I think we should temporarily pin js.jquery 1.8.2 as you suggested
>>
>> I prefer to make a 1.10.3 release of js.jqueryui, which I'm already
>> working on. Expect it later today or tomorrow…

FYI: I released js.jqueryui 1.10.3 last night and updated Kotti's
requirements.txt accordingly (on the Github master branch – not released
on PyPI yet). This should fix your issue.

However: building the new js.jqueryui was more work than expected.
jQueryUI changed quite a bit: new modules, different inter module
dependencies than in previous versions, and more.

Therefore, because jQueryUI and Twitter Bootstrap are rather "clashing"
frameworks (i.e. not meant to complement each other) and because it
would simply be nice to get rid of the additional number of requests and
transfered volume caused by jQueryUI, I'd like to start (another)
attempt to get rid of jQueryUI in Kotti.

If I don't miss something Kotti has one direct and one indirect
dependency on jQueryUI:

- The direct is the tags widget.

I've opened an issue for that:
https://github.com/Kotti/Kotti/issues/229.

Maybe we should even consider to build our own widget based on one
of the mentioned plugins with additional autocompletion of tags that
have been previously assigned to other content in a site.

- The indirect dependency is the date- / datetime- widgets in
deform_bootstrap. There are some Bootstrap plugins that could
(should) be used instead: http://bootsnipp.com/resources#5

The required changes for these two should be doable with limited effort
and have a rather great benefit. Or am I missing something else that
makes it harder?


Andreas

Jeff Pittman

unread,
May 20, 2013, 1:51:34 PM5/20/13
to ko...@googlegroups.com
The alternatives look to have good potential. Sounds like a simpler arrangement.

For the time pickers, I like the up and down arrows instead of the sliders we have in the current one: http://jdewit.github.io/bootstrap-timepicker/

Jeff
> --
> You received this message because you are subscribed to the Google Groups "Kotti" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kotti+un...@googlegroups.com.

Lukas Zdych

unread,
May 20, 2013, 3:27:41 PM5/20/13
to ko...@googlegroups.com
Sounds like a very good idea to me Andreas (personally would vote for the second one tags widget: http://welldonethings.com/tags/manager - typeahead version looks great) and I also like arrows rather then sliders Jeff.

Lukas
Reply all
Reply to author
Forward
0 new messages