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