Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jQuery fancybox, easing and mousewheel for WordPress 5.5 compatibility #154

Open
3 of 4 tasks
bobbingwide opened this issue Aug 25, 2020 · 3 comments
Open
3 of 4 tasks
Assignees
Labels
enhancement Needs documentation The changes should be documented before the issue can be closed

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Aug 25, 2020

In #153 (comment) I documented the results of testing the current version of jQuery Fancybox with WordPress 5.6 and with the new version of jQuery coming in 5.6
It's time to update.

Requirements

  • update jQuery files without affecting users of them - i.e. any invocation in [bw_jq] shouldn't need to be changed
  • new code should work with WordPress 5.5 without jQuery Migrate
  • new code should work with jQuery 3.5.1 ( expected in WordPress 5.6 ) without jQuery Migrate
  • don't worry about earlier versions of WordPress

Proposed solution

Having looked at easy-fancybox it looks like I need to update the following

jQuery file From to at least
fancybox 1.3.4 1.3.24
easing 1.3 1.4
mousewheel 3.0.4 3.1.13

or even higher versions such as https://github.com/fancyapps/fancybox

@bobbingwide
Copy link
Owner Author

bobbingwide commented Aug 25, 2020

I chose the easy-fancybox approach.

  • I copied the jquery files ( debuggable and .min versions)
  • I then added some logic to map old script file names to the new ones
  • I also copied the CSS file(s) and changed the CSS a bit to load images from the same directory... as this was how it was in the earlier version.

Testing the examples on sb/oikcom I found that some of the fancyboxes which were originally displayed as iframes no longer worked. The fancybox jQuery code displayed "

I found I needed to add type=iframe to the bw_jq shortcode.
I some cases I needed to duplicate the shortcode to improve the selector. e.g.

[bw_jq "div.gallery a" fancybox script=fancybox-1.3.4 debug=true ]
[bw_jq ".iframe div.gallery a" fancybox debug=true type=iframe]
[div class="w60p3"]
[gallery link="file" ids="8886,8905"]
[div class=iframe]
[gallery link="post" ids="8886,8905"][ediv][ediv]

Notes

  • debug=true forces the use of the debuggable jQuery files.
  • I'm not sure where easing and mousewheel are used, if at all.
  • The examples need updating with better documentation
  • The code works for all combinations of jQuery and jQuery Migrate

@bobbingwide
Copy link
Owner Author

don’t close this until documented

@bobbingwide bobbingwide added the Needs documentation The changes should be documented before the issue can be closed label Sep 6, 2020
@bobbingwide
Copy link
Owner Author

Note: Fancybox v3 ( 1.3.24 etc) is discontinued. See http://fancybox.net/howto
It's been replaced by Fancybox v4 which doesn't use jQuery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Needs documentation The changes should be documented before the issue can be closed
Projects
None yet
Development

No branches or pull requests

1 participant