2009-01-02 10:08:58 -05:00
|
|
|
|
2009-01-15 09:56:52 -05:00
|
|
|
var thickDims;
|
2009-01-02 10:08:58 -05:00
|
|
|
jQuery(document).ready(function($) {
|
|
|
|
|
2009-01-15 09:56:52 -05:00
|
|
|
thickDims = function() {
|
2009-01-02 10:08:58 -05:00
|
|
|
var tbWindow = $('#TB_window'), H = $(window).height(), 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'});
|
|
|
|
};
|
|
|
|
|
2009-02-18 17:32:42 -05:00
|
|
|
return $('a.thickbox-preview').each( function() {
|
|
|
|
var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
|
2009-01-02 10:08:58 -05:00
|
|
|
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() {
|
2009-03-15 07:04:34 -04:00
|
|
|
var alink = $(this).parents('.available-theme').find('.activatelink'), url = '', text = '';
|
2009-01-02 10:08:58 -05:00
|
|
|
|
2009-03-15 07:04:34 -04:00
|
|
|
if ( alink.length ) {
|
|
|
|
url = alink.attr('href') || '';
|
|
|
|
text = alink.html() || '';
|
|
|
|
}
|
|
|
|
|
2009-01-02 10:08:58 -05:00
|
|
|
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
|
|
|
|
$('#TB_closeAjaxWindow').css({'float':'left'});
|
|
|
|
$('#TB_ajaxWindowTitle').css({'float':'right'})
|
|
|
|
.append(' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>');
|
|
|
|
|
|
|
|
$('#TB_iframeContent').width('100%');
|
|
|
|
return false;
|
|
|
|
} );
|
|
|
|
|
|
|
|
$(window).resize( function() { thickDims() } );
|
2009-02-26 02:54:33 -05:00
|
|
|
|
|
|
|
// Theme details disclosure
|
|
|
|
$('.theme-detail').click(function () {
|
2009-03-15 07:04:34 -04:00
|
|
|
$(this).siblings('.themedetaildiv').toggle();
|
2009-02-26 02:54:33 -05:00
|
|
|
return false;
|
|
|
|
});
|
2009-01-02 10:08:58 -05:00
|
|
|
});
|
2009-01-15 09:56:52 -05:00
|
|
|
|
|
|
|
function tb_position() {
|
|
|
|
thickDims();
|
|
|
|
}
|