]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/theme-preview.js
Wordpress 3.2.1
[autoinstalls/wordpress.git] / wp-admin / js / theme-preview.js
index f4f85e8bf895030d7ec8dadbf4911ea5564c1dee..f942b51fd2bb1c26dfffd2ff90d445e13d755799 100644 (file)
@@ -1,44 +1 @@
-
-jQuery(function($) {
-       if ( 'undefined' == typeof $.fn.pngFix )
-               $.fn.pngFix = function() { return this; }
-
-       var thickDims = function() {
-               var tbWindow = $('#TB_window');
-               var H = $(window).height();
-               var W = $(window).width();
-
-               if ( tbWindow.size() ) {
-                       tbWindow.width( W - 90 ).height( H - 60 );
-                       $('#TB_iframeContent').width( W - 90 ).height( H - 90 );
-                       tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
-                       if ( typeof document.body.style.maxWidth != 'undefined' )
-                               tbWindow.css({'top':'30px','margin-top':'0'});
-               };
-
-               return $('a.thickbox').each( function() {
-                       var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
-                       if ( ! href ) return;
-                       href = href.replace(/&width=[0-9]+/g, '');
-                       href = href.replace(/&height=[0-9]+/g, '');
-                       $(this).attr( 'href', href + '&width=' + ( W - 110 ) + '&height=' + ( H - 100 ) );
-               });
-       };
-
-       thickDims()
-       .click( function() {
-               var alink = $(this).parents('.available-theme').find('.activatelink');
-               var url = alink.attr('href');
-               var text = alink.html();
-
-               $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
-               $('#TB_closeAjaxWindow').css({'float':'left'});
-               $('#TB_ajaxWindowTitle').css({'float':'right'})
-                       .append('&nbsp;<a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>');
-
-               $('#TB_iframeContent').width('100%');
-               return false;
-       } );
-
-       $(window).resize( function() { thickDims() } );
-});
+var thickDims,tbWidth,tbHeight;jQuery(document).ready(function(a){thickDims=function(){var f=a("#TB_window"),d=a(window).height(),b=a(window).width(),c,e;c=(tbWidth&&tbWidth<b-90)?tbWidth:b-90;e=(tbHeight&&tbHeight<d-60)?tbHeight:d-60;if(f.size()){f.width(c).height(e);a("#TB_iframeContent").width(c).height(e-27);f.css({"margin-left":"-"+parseInt((c/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:"30px","margin-top":"0"})}}};thickDims();a(window).resize(function(){thickDims()});a("a.thickbox-preview").click(function(){tb_click.call(this);var d=a(this).parents(".available-theme").find(".activatelink"),e="",b=a(this).attr("href"),c,f;if(tbWidth=b.match(/&tbWidth=[0-9]+/)){tbWidth=parseInt(tbWidth[0].replace(/[^0-9]+/g,""),10)}else{tbWidth=a(window).width()-90}if(tbHeight=b.match(/&tbHeight=[0-9]+/)){tbHeight=parseInt(tbHeight[0].replace(/[^0-9]+/g,""),10)}else{tbHeight=a(window).height()-60}if(d.length){c=d.attr("href")||"";f=d.attr("title")||"";e='&nbsp; <a href="'+c+'" target="_top" class="tb-theme-preview-link">'+f+"</a>"}else{f=a(this).attr("title")||"";e='&nbsp; <span class="tb-theme-preview-link">'+f+"</span>"}a("#TB_title").css({"background-color":"#222",color:"#dfdfdf"});a("#TB_closeAjaxWindow").css({"float":"left"});a("#TB_ajaxWindowTitle").css({"float":"right"}).html(e);a("#TB_iframeContent").width("100%");thickDims();return false});a(".theme-detail").click(function(){a(this).siblings(".themedetaildiv").toggle();return false})});
\ No newline at end of file