Make WordPress Core

Opened 15 years ago

Last modified 5 weeks ago

#10955 reopened enhancement

Replace ThickBox

Reported by: aaron_guitar's profile aaron_guitar Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.9
Component: External Libraries Keywords: dev-feedback needs-patch
Focuses: accessibility, javascript Cc:

Description

Have you thought about replacing ThickBox? It is no longer under development (as their site says) and it doesn't conform to standard jQuery plugin practices. For example, I'm trying to use it for a plugin of mine and I'm wanting to tie into the "onClose" event for ThickBox which isn't too easily done. I know I could just include one of the other plugins, like colorbox, with my plugin but I think it'd be a great service to other developers if you included a more flexible library.

(I would have assigned this to 3.0+ but the option isn't available.)

Attachments (1)

medialib2.jpg (117.2 KB) - added by azaozz 13 years ago.

Download all attachments as: .zip

Change History (63)

#1 @scribu
15 years ago

  • Component changed from General to UI
  • Milestone changed from Unassigned to Future Release

#2 follow-up: @Viper007Bond
15 years ago

  • Keywords needs-patch added
  • Milestone changed from Future Release to 3.0

ColorBox appears to be really pretty BTW.

#3 @aaron_guitar
15 years ago

Really pretty and really customizable.

#4 in reply to: ↑ 2 @edified
15 years ago

Replying to Viper007Bond:

And with a really helpful developer.
http://colorpowered.com/colorbox/
http://groups.google.com/group/colorbox/topics

8304 bytes before it zip/deflate

#5 follow-up: @caesarsgrunt
15 years ago

+1 for ColorBox. I'd never met it before, but it looks great.

#6 in reply to: ↑ 5 @scribu
15 years ago

+1 from me as well.

Offtopic:

Replying to caesarsgrunt:

+1 for ColorBox. I'd never met it before, but it looks great.

"Hello, ColorBox! How are you today?" :P

#7 follow-up: @jacobsantos
15 years ago

I've tried all of the so called alternatives and they pretty much all suck. The limitations of jQuery UI Dialog is that you can pretty much only assign one dialog at a time (unless there is a workaround that isn't obvious).

Colorbox is fine if you don't need to fine tune any scripting for the modal box. Say if you want to use any other scripting then the predefined one then you are SOL.

I would rather recommend qTip jQuery plugin instead. It is a tooltip first, but it has modal capabilities as well.

#8 in reply to: ↑ 7 @aaron_guitar
15 years ago

Replying to jacobsantos:

Colorbox is fine if you don't need to fine tune any scripting for the modal box. Say if you want to use any other scripting then the predefined one then you are SOL.

Could you give a specific example?

#9 @hakre
15 years ago

Maybe code like this one [12554]

#10 @nacin
15 years ago

  • Milestone changed from 3.0 to 3.1

#11 @freddyware
14 years ago

  • Cc frederick.ding@… added
  • Version changed from 2.9 to 3.0.1

#12 @mrmist
14 years ago

  • Version changed from 3.0.1 to 2.9

Version tracks the original report..

#13 @nacin
14 years ago

  • Milestone changed from Awaiting Triage to Future Release

#14 @Denis-de-Bernardy
13 years ago

  • Cc Denis-de-Bernardy added

#15 @aaroncampbell
13 years ago

  • Keywords 2nd-opinion added

Just started playing with colorbox because of the limitations with thickbox. It's pretty nice. I'm open to other options, but it WOULD be nice to find a replacement.

#16 @andrewryno
13 years ago

  • Cc andrewryno@… added

#17 @alex-ye
13 years ago

1+ for colorbox .

#18 @gcorne
13 years ago

  • Cc gcorne@… added

#19 @azaozz
13 years ago

  • Keywords 3.4-early added; needs-patch 2nd-opinion removed

#20 follow-up: @nacin
13 years ago

I want to suggest that I would rather to continue to monkey-patch Thickbox than replace it with another library. Replacing Thickbox means killing popups in core, not making popups prettier. Maybe once we've eliminated TB usage in core, we can shoehorn in a worthy WP-integrated replacement.

#21 in reply to: ↑ 20 @aaroncampbell
13 years ago

Replying to nacin:

Do you really think that the correct direction is no lightboxes anywhere? That feels like more of a knee-jerk reaction to their overuse and misuse on the web as a whole (and possibly in WordPress as well). I think they have their place. For example, to me it seems like it's always going to be better to browser your media library for something to insert into a post inside a lightbox. It seems like there's just too much content there to shrink that into a small section of the screen.

I'm interested in hearing (or better yet, seeing) the alternatives though.

#22 @nacin
13 years ago

The best argument for eliminating thickboxes for media handling is that by moving it inline, you can continue to work on your content while images are uploading/crunching. Not to mention drag-and-drop into the editor. See http://wpdevel.wordpress.com/2009/10/08/some-media-upload-sketches/. It's going to take some work but it can be possible.

@azaozz
13 years ago

#24 follow-up: @azaozz
13 years ago

Replying to nacin:

Agreed. Actually started on a new media library UI couple of months ago. Looks pretty similar to the plugin @scribu linked above. Had some hopes that it would make it in 3.3 but definitely going to try it for 3.4 :)


#25 @DrewAPicture
13 years ago

  • Cc xoodrew@… added

#26 @Ipstenu
13 years ago

  • Cc ipstenu@… added

#27 @chrisbliss18
13 years ago

  • Cc gaarai@… added

#28 @SergeyBiryukov
13 years ago

Closed #19975 as a duplicate.

#29 @maorb
13 years ago

  • Cc maor@… added

+1 for colorbox

#30 @toscho
13 years ago

  • Cc info@… added

#31 @sabreuse
13 years ago

  • Cc sabreuse@… added

#32 @wycks
13 years ago

jQuery UI Dialog is already bundled with the jQuery UI in WordPress.

Benefits:

Already bundled

Actively developed

Lots of options

Integrates well with jQuery and other jQuery UI features.


ps. @jacobsantos it also can support multiple instances.

#33 in reply to: ↑ 24 @andyadams
13 years ago

  • Cc aadams@… added

#34 @MatthewRuddy
12 years ago

Is this still being looked at? Thickbox is really horrific on mobile devices such as the iPad. Zooming in and out causes major problems. Unable to scroll within iframes on it as well; instead it scrolls the parent window. Doing so also completely destroys the background overlay as well.

The problem with media-upload.js overwriting the tb_position function is a serious pain as well. Makes admin thickbox functionality in the WP Admin for plugin almost impossible if they can't resize it to their needs (provided they need media-upload.js for whatever reasons). It is possible to overwrite the functionality with your own functions loaded after media-upload.js but, it seems ridiculous when the functionality is native but overwritten.

The jQuery UI dialog seems like a good alternative to me. It is already included with Wordpress, and the styling classes can easily be carried over to make it look as it already does.

Last edited 12 years ago by MatthewRuddy (previous) (diff)

#35 @dgwyer
12 years ago

+1 for jQuery UI dialog.

#36 @deltafactory
12 years ago

  • Cc jeff@… added

#37 @sc0ttkclark
12 years ago

  • Cc lol@… added
  • Keywords dev-feedback added; 3.4-early removed

This is a major pain point for development for me, can we at least add a new one and keep Thickbox for deprecated use?

#38 @sc0ttkclark
12 years ago

  • Keywords needs-patch added

#39 @scribu
12 years ago

Another contender: http://jschr.github.com/bootstrap-modal/

Not sure how dependent on Bootstrap it is, but it definitely seems to have all the functionality WP might need.

#40 @dd32
12 years ago

Another contender: ​http://jschr.github.com/bootstrap-modal/

Looks decent, but worth noting it's Apache v2 licensed, which isn't GPLv2 compatible.

#41 @ocean90
12 years ago

Why do we need another modal library? I think we should just make the new media modals more generic so that core and plugins can use them too.

#42 @sc0ttkclark
12 years ago

I was trying out the new media modal too, was anxious to switch from Thickbox to it but its not in a state to be used cleanly when I last looked. Maybe a new ticket should be used and it's use as a Thickbox replacement be one of the proposed benefits?

#43 @sabreuse
12 years ago

  • Component changed from UI to External Libraries

#44 @sc0ttkclark
12 years ago

Update: Confirmed, the new WP 3.5 Media Modal makes an excellent Thickbox killer. It's use as a replacement for Thickbox would require additional helper functions for plugins/themes to hook into, but based on the working code I'm using, this is definitely something viable!

#45 @scribu
12 years ago

Could you share the code you're currently using, Scott?

#46 @sc0ttkclark
12 years ago

Will do over the weekend / next week. Still in progress, and heavily tied to the project it's for, http://pods.io/

#47 @TobiasBg
11 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Core is moving to custom implementations with the Media Models/Views, theme browser, etc. and doesn't have a need for another external library at this time.
Thickbox itself is used less frequently and will probably be phased out in Core over time, whenever relevant areas are touched/refactored, in favor of such custom models/views. It needs to stay for backward compatibility though, as plugins might rely on it.
With #26870, efforts are being made to document the Media Models/Views code so that they can be used more easily by plugins.

#48 @sc0ttkclark
11 years ago

Doesn't sound like we need an external library, the 3.5 Media Modals have been expanded in many ways already in core and core-related projects. It's not difficult to make a Thickbox replacement modal, I just haven't had time to focus on this specifically.

I'd like to see this kept as Future Release, because Thickbox has to be replaced soon, seems modals are the best path forward.

This ticket was mentioned in IRC in #wordpress-ui by helen. View the logs.


11 years ago

#50 @sc0ttkclark
9 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Seems like modals can do iframes now, time to revisit IMO.

https://gist.github.com/pglewis/0382203399251e6914d5

Here's some example code from @pglewis which shows how iframes can be created using the WP Media Modal, code that's already in WordPress. Since this replacement takes little code, I think it's pretty viable and could be used for links that would normally open up a Thickbox in WP core.

#51 @sc0ttkclark
9 years ago

Based on code from Phil, it could be further modified to make the link dynamic too. But it's a great example of the fact this is definitely possible.

#52 @sc0ttkclark
9 years ago

Looking at the wp-includes/js/media-views.js it appears that there's some Thickbox overriding going on now, but I'm not sure it's kicking in everywhere it could in a more general way across all WP screens.

#53 @SergeyBiryukov
9 years ago

  • Milestone set to Awaiting Review

#54 @desrosj
4 years ago

#46985 was marked as a duplicate.

#55 @afercia
4 years ago

  • Focuses accessibility javascript added

#56 @afercia
4 years ago

Added the accessibility focus as the duplicate #46985 had it.

#57 @desrosj
4 years ago

  • Milestone set to Awaiting Review

This ticket was mentioned in Slack in #accessibility by alexstine. View the logs.


4 years ago

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


3 years ago

#60 @sabernhardt
3 years ago

  • Milestone changed from Awaiting Review to Future Release

We probably will need to keep patching Thickbox for plugins, but these popup links should have a better modal in WordPress core.

I found two core implementations still in use.

  • Plugin "View details" links (see also #50554) for plugins within the WP directory, which are on multiple screens: Plugins, Plugin Install, Updates, Import
  • Theme "View version x.x details" links, which appear inside the Theme details modal when there is an update available

There is also a 'thickbox' link for setting the featured image in Classic Editor, but that apparently opens the media modal.

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


13 months ago

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


5 weeks ago

Note: See TracTickets for help on using tickets.