[wp-trac] [WordPress Trac] #6453: Thickbox images not loaded in best way

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 3 16:56:27 UTC 2009


#6453: Thickbox images not loaded in best way
--------------------------+-------------------------------------------------
 Reporter:  lmbbox        |        Owner:  anonymous
     Type:  defect (bug)  |       Status:  reopened 
 Priority:  normal        |    Milestone:  2.9      
Component:  JavaScript    |      Version:  2.8.4    
 Severity:  normal        |   Resolution:           
 Keywords:  has-patch     |  
--------------------------+-------------------------------------------------
Changes (by aaroncampbell):

  * keywords:  thickbox => has-patch


Comment:

 I suggest that we simply replace
 {{{
 var tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif";
 var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";
 }}}

 with
 {{{
 if ( typeof tb_pathToImage != 'string' ) {
         var tb_pathToImage = "../wp-
 includes/js/thickbox/loadingAnimation.gif";
 }
 if ( typeof tb_closeImage != 'string' ) {
         var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";
 }
 }}}

 It's almost no change to the actual file, users that expect it to work as
 it does will be fine, and anyone that wants to specify those variables can
 simply do it before they include thickbox, like this:
 {{{
 <script type="text/javascript">
 //<![CDATA[
 var tb_pathToImage = "/wp-includes/js/thickbox/loadingAnimation.gif";
 var tb_closeImage = "/wp-includes/js/thickbox/tb-close.png";
 //]]>
 </script>
 }}}

 I'm attaching a patch.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/6453#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list