2009-01-02 10:08:58 -05:00
|
|
|
|
2009-03-19 20:14:57 -04:00
|
|
|
var thickDims, tbWidth, tbHeight;
|
2009-01-02 10:08:58 -05:00
|
|
|
jQuery(document).ready(function($) {
|
|
|
|
|
2009-01-15 09:56:52 -05:00
|
|
|
thickDims = function() {
|
2009-03-19 20:14:57 -04:00
|
|
|
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
|
|
|
|
|
|
|
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 90;
|
|
|
|
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 60;
|
2009-01-02 10:08:58 -05:00
|
|
|
|
|
|
|
if ( tbWindow.size() ) {
|
2009-03-19 20:14:57 -04:00
|
|
|
tbWindow.width(w).height(h);
|
|
|
|
$('#TB_iframeContent').width(w).height(h - 27);
|
|
|
|
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
|
2009-01-02 10:08:58 -05:00
|
|
|
if ( typeof document.body.style.maxWidth != 'undefined' )
|
|
|
|
tbWindow.css({'top':'30px','margin-top':'0'});
|
2009-03-19 20:14:57 -04:00
|
|
|
}
|
2009-01-02 10:08:58 -05:00
|
|
|
};
|
|
|
|
|
2009-03-19 20:14:57 -04:00
|
|
|
thickDims();
|
|
|
|
$(window).resize( function() { thickDims() } );
|
|
|
|
|
|
|
|
$('a.thickbox-preview').click( function() {
|
2010-04-07 09:52:12 -04:00
|
|
|
tb_click.call(this);
|
|
|
|
|
2009-03-19 20:14:57 -04:00
|
|
|
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
|
|
|
|
|
2009-05-24 19:47:49 -04:00
|
|
|
if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
|
2009-03-19 20:14:57 -04:00
|
|
|
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
|
|
|
else
|
|
|
|
tbWidth = $(window).width() - 90;
|
|
|
|
|
2009-05-24 19:47:49 -04:00
|
|
|
if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
|
2009-03-19 20:14:57 -04:00
|
|
|
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
|
|
|
else
|
|
|
|
tbHeight = $(window).height() - 60;
|
2009-01-02 10:08:58 -05:00
|
|
|
|
2009-03-15 07:04:34 -04:00
|
|
|
if ( alink.length ) {
|
|
|
|
url = alink.attr('href') || '';
|
2009-03-19 20:14:57 -04:00
|
|
|
text = alink.attr('title') || '';
|
|
|
|
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
|
|
|
} else {
|
|
|
|
text = $(this).attr('title') || '';
|
|
|
|
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
2009-03-15 07:04:34 -04:00
|
|
|
}
|
2009-03-19 20:14:57 -04:00
|
|
|
|
|
|
|
$('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
|
2009-01-02 10:08:58 -05:00
|
|
|
$('#TB_closeAjaxWindow').css({'float':'left'});
|
2009-03-19 20:14:57 -04:00
|
|
|
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
2009-01-02 10:08:58 -05:00
|
|
|
|
|
|
|
$('#TB_iframeContent').width('100%');
|
2009-03-19 20:14:57 -04:00
|
|
|
thickDims();
|
2010-05-03 16:26:11 -04:00
|
|
|
|
2009-01-02 10:08:58 -05:00
|
|
|
return false;
|
|
|
|
} );
|
|
|
|
|
2009-03-19 20:14:57 -04:00
|
|
|
// Theme details
|
2009-02-26 02:54:33 -05:00
|
|
|
$('.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-03-19 20:14:57 -04:00
|
|
|
|
2009-01-02 10:08:58 -05:00
|
|
|
});
|
2009-01-15 09:56:52 -05:00
|
|
|
|