]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/thickbox/thickbox.js
Wordpress 3.0
[autoinstalls/wordpress.git] / wp-includes / js / thickbox / thickbox.js
index 6a56f23d0e7838a9b65c619968790782e5271c19..b4ff03090d7f57881dfcf8f9cad377981adcec04 100644 (file)
@@ -23,14 +23,16 @@ jQuery(document).ready(function(){
 
 //add thickbox to href & area elements that have a class of .thickbox
 function tb_init(domChunk){
-       jQuery(domChunk).click(function(){
+       jQuery(domChunk).live('click', tb_click);
+}
+
+function tb_click(){
        var t = this.title || this.name || null;
        var a = this.href || this.alt;
        var g = this.rel || false;
        tb_show(t,a,g);
        this.blur();
        return false;
-       });
 }
 
 function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
@@ -40,7 +42,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
                        jQuery("body","html").css({height: "100%", width: "100%"});
                        jQuery("html").css("overflow","hidden");
                        if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
-                               jQuery("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
+                               jQuery("body").append("<iframe id='TB_HideSelect'>"+thickboxL10n.noiframes+"</iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
                                jQuery("#TB_overlay").click(tb_remove);
                        }
                }else{//all others
@@ -198,10 +200,10 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
                                        urlNoQuery = url.split('TB_');
                                        jQuery("#TB_iframeContent").remove();
                                        if(params['modal'] != "true"){//iframe no modal
-                                               jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='" + tb_closeImage + "' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
+                                               jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='" + tb_closeImage + "' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>");
                                        }else{//iframe modal
                                        jQuery("#TB_overlay").unbind();
-                                               jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
+                                               jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>"+thickboxL10n.noiframes+"</iframe>");
                                        }
                        }else{// not an iframe, ajax
                                        if(jQuery("#TB_window").css("display") != "block"){
@@ -231,7 +233,7 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
                                        jQuery("#TB_window").css({display:"block"});
                                }else if(url.indexOf('TB_iframe') != -1){
                                        tb_position();
-                                       if($.browser.safari){//safari needs help because it will not fire iframe onload
+                                       if(jQuery.browser.safari){//safari needs help because it will not fire iframe onload
                                                jQuery("#TB_load").remove();
                                                jQuery("#TB_window").css({display:"block"});
                                        }