After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766232 - Upgrade to a recent jQuery
Upgrade to a recent jQuery
Status: RESOLVED FIXED
Product: damned-lies
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: damned-lies Maintainer(s)
damned-lies Maintainer(s)
Depends on:
Blocks: 766216
 
 
Reported: 2016-05-10 15:10 UTC by Claude Paroz
Modified: 2016-05-13 15:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
JQuery update to 2.2.3 (176.80 KB, patch)
2016-05-12 08:33 UTC, Tom Tryfonidis
none Details | Review
Tablesorter fix (1.04 KB, patch)
2016-05-12 08:40 UTC, Tom Tryfonidis
needs-work Details | Review
Fix vertumus detail JS code (1.28 KB, patch)
2016-05-12 09:01 UTC, Tom Tryfonidis
committed Details | Review
Update event method for user box (848 bytes, patch)
2016-05-12 09:28 UTC, Tom Tryfonidis
committed Details | Review
Repalce overlay windows with modals (8.95 KB, patch)
2016-05-12 14:56 UTC, Tom Tryfonidis
none Details | Review

Description Claude Paroz 2016-05-10 15:10:33 UTC
Here's Tom report about compatibility issues:

I've tested JQuery 2.x and some things are broken:

1. Sort functionality for tables
Original plugin[1] doesn't work, so i'll use this fork [2]. It also has a "saveSort" function, which might be handy to use.

[1] https://github.com/christianbach/tablesorter
[2] https://github.com/Mottie/tablesorter

2. Modal windows for reduced_po and vertimus_workflow pages
We can replace them with Bootstrap's modal dialogs and remove overlayhelpers.js and jquery-tools.js plugins.

Apparently the following are also broken with 1.9.1 version,

3. Growfield2 plugin doesn't work
I can't find a new version of growfield plugin. A good alternative is https://github.com/jackmoore/autosize

4. JS code on vertimus_detail page that un/check radio button doesn't work
Some methods are deprecated so i'll update them.

> Do you think jQuery migrate is really useful?
Yes it is, If we stick with 1.9.1 version, as it provides some deprecated features/methods for our JQuery plugins (overlayhelpers.js, jquery-tools.js).
Comment 1 Claude Paroz 2016-05-10 16:06:53 UTC
Growfield2 replacement done in https://git.gnome.org/browse/damned-lies/commit/?id=bacf76c07076e8113a48b3da3c929e734b3939fc
Comment 2 Tom Tryfonidis 2016-05-12 08:33:56 UTC
Created attachment 327679 [details] [review]
JQuery update to 2.2.3
Comment 3 Tom Tryfonidis 2016-05-12 08:40:49 UTC
Created attachment 327682 [details] [review]
Tablesorter fix

I didn't updated the tablesorter plugin as it works with the above patch. Current plugin uses a deprecated mathod ($.browser.msie [1]) but this affects only IE browser.

[1] http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed
Comment 4 Claude Paroz 2016-05-12 08:43:01 UTC
Doesn't this prepOverlay thing allows for the modal window to function properly?
Comment 5 Tom Tryfonidis 2016-05-12 09:01:02 UTC
Created attachment 327684 [details] [review]
Fix vertumus detail JS code

Check/uncheck is working for radio button.

About the toggle method, if we want to just display/hide [1] the selected divs we're ok, as the other toggle method is deprecated [2].

[1] http://api.jquery.com/toggle/
[2] http://jquery.com/upgrade-guide/1.9/#toggle-function-function-removed
Comment 6 Tom Tryfonidis 2016-05-12 09:07:18 UTC
(In reply to Claude Paroz from comment #4)
> Doesn't this prepOverlay thing allows for the modal window to function
> properly?

Yes indeed. But overlay windows for reduced_po and workflow are broken with the latest JQuery upgrade and the old versions of jquery-tools (and maybe overlayhelpers.js).

What if we use Bootstrap's modals for these pages?

https://getbootstrap.com/javascript/#modals
Comment 7 Claude Paroz 2016-05-12 09:10:06 UTC
If you want to include bootstrap anyway for the responsive design, then I'm fine with using it for overlays. Could you cook a patch that does just that?
Comment 8 Tom Tryfonidis 2016-05-12 09:28:51 UTC
Created attachment 327687 [details] [review]
Update event method for user box

jQuery.event.handle() removed in > 1.9 JQuery versions
Comment 9 Tom Tryfonidis 2016-05-12 14:56:19 UTC
Created attachment 327718 [details] [review]
Repalce overlay windows with modals

Bootstrap modals with remote content.
Comment 10 Claude Paroz 2016-05-12 19:32:17 UTC
Tom, I reworked and committed the modal replacement patch (using jQuery 1.12 for now, we can migrate to 2 when all is working well). Could you please check the result? I'll deploy if it works. Then we are almost ready for this part, I think.
Comment 11 Tom Tryfonidis 2016-05-13 08:07:32 UTC
Great Claude! Everything seems to work fine with the modals. There's only a minor bug with the popup user menu in the global bar, which can be fixed with the patch from comment #8. Besides that i can't find any other bugs.

Also, do we really need the second title in the reduced_po modal?

https://git.gnome.org/browse/damned-lies/tree/templates/help/reduced_po.html#n9
Comment 12 Claude Paroz 2016-05-13 14:55:19 UTC
Thanks for the feedback, I deployed the current code with the fixes.
Do you think it is OK to just upgrade to jQuery 2.2 now?
Comment 13 Tom Tryfonidis 2016-05-13 15:09:23 UTC
Sure why not! I use JQuery 2.2.3 on my local instance and i didn't find any other bugs.
Comment 14 Claude Paroz 2016-05-13 15:14:14 UTC
Done.