[wp-trac] [WordPress Trac] #6453: Thickbox images not loaded in best way (was: Thickbox)
WordPress Trac
wp-trac at lists.automattic.com
Fri Jul 10 19:26:58 UTC 2009
#6453: Thickbox images not loaded in best way
-------------------------+--------------------------------------------------
Reporter: lmbbox | Owner: anonymous
Type: enhancement | Status: reopened
Priority: normal | Milestone: 2.9
Component: JavaScript | Version: 2.5
Severity: normal | Resolution:
Keywords: thickbox |
-------------------------+--------------------------------------------------
Changes (by TobiasBg):
* priority: low => normal
* type: defect (bug) => enhancement
* milestone: => 2.9
Comment:
I agree, that this not the optimal way to load those images, as more and
more people use the included JS-libs in WordPress (I personally use the
thickbox for a gallery, which is located on several subpages, where
therefore the "../wp-includes/js/..." path is not working. And changing it
manually to "/wp-includes/js/..." only works for WP installation not in a
sub folder.)
Therefore I'd like to make two maybe better suggestion to load those
images:
1.) This actually derived from Denis' answer: If we need the {blog root},
just let's get it: From a wp_localize_script call which will then give it
to us just like a localized string.
2.) Even better would be CSS: We load the thickbox.css anyway, so why not
move the paths there? They could even stay relative to the wp-includes
folder, like they are now.
To then show them, we add a CSS class to the relative places in the JS
file. So instead of loading them directly we just put them as background
images of a <div> with a CSS class. That way nobody will ever have to
touch those paths again as they work from anywhere on the site if the
thickbox.js and thickbox.css are included correctly.
Do those suggestions make sense?
Maybe their implementation could be done in one step together with #10278
which deals with localizing the thickbox.js.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/6453#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list