mp-wp_genesis 1
mp-wp_genesis 2 jQuery(function($) {
mp-wp_genesis 3 if ( 'undefined' == typeof $.fn.pngFix )
mp-wp_genesis 4 $.fn.pngFix = function() { return this; }
mp-wp_genesis 5
mp-wp_genesis 6 var thickDims = function() {
mp-wp_genesis 7 var tbWindow = $('#TB_window');
mp-wp_genesis 8 var H = $(window).height();
mp-wp_genesis 9 var W = $(window).width();
mp-wp_genesis 10
mp-wp_genesis 11 if ( tbWindow.size() ) {
mp-wp_genesis 12 tbWindow.width( W - 90 ).height( H - 60 );
mp-wp_genesis 13 $('#TB_iframeContent').width( W - 90 ).height( H - 90 );
mp-wp_genesis 14 tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
mp-wp_genesis 15 if ( typeof document.body.style.maxWidth != 'undefined' )
mp-wp_genesis 16 tbWindow.css({'top':'30px','margin-top':'0'});
mp-wp_genesis 17 };
mp-wp_genesis 18
mp-wp_genesis 19 return $('a.thickbox').each( function() {
mp-wp_genesis 20 var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
mp-wp_genesis 21 if ( ! href ) return;
mp-wp_genesis 22 href = href.replace(/&width=[0-9]+/g, '');
mp-wp_genesis 23 href = href.replace(/&height=[0-9]+/g, '');
mp-wp_genesis 24 $(this).attr( 'href', href + '&width=' + ( W - 110 ) + '&height=' + ( H - 100 ) );
mp-wp_genesis 25 });
mp-wp_genesis 26 };
mp-wp_genesis 27
mp-wp_genesis 28 thickDims()
mp-wp_genesis 29 .click( function() {
mp-wp_genesis 30 var alink = $(this).parents('.available-theme').find('.activatelink');
mp-wp_genesis 31 var url = alink.attr('href');
mp-wp_genesis 32 var text = alink.html();
mp-wp_genesis 33
mp-wp_genesis 34 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
mp-wp_genesis 35 $('#TB_closeAjaxWindow').css({'float':'left'});
mp-wp_genesis 36 $('#TB_ajaxWindowTitle').css({'float':'right'})
mp-wp_genesis 37 .append(' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>');
mp-wp_genesis 38
mp-wp_genesis 39 $('#TB_iframeContent').width('100%');
mp-wp_genesis 40 return false;
mp-wp_genesis 41 } );
mp-wp_genesis 42
mp-wp_genesis 43 $(window).resize( function() { thickDims() } );
mp-wp_genesis 44 });