CHANGED: Replaced the word "Content" with "HTML"
* Replaced "Content" with "HTML" * s/Content/HTML/g * Added "_img" * s/auto_resize/auto_resize_img/g * s/margin_win/margin_win_img/g * Replaced "_content" with "_html" * s/auto_resize_content/auto_resize_html/g * s/move_content/move_html/g * s/resize_content/resize_html/g * s/bgcolor_content/bgcolor_html/g * s/margin_win_content/margin_win_html/g * Added transition code of options for v1.8 or earlier
This commit is contained in:
1 parent
9fb49e5820
commit
8a902905ed
5 files changed
+86
-58
No files matched your search
+15
-15
@@ -112,10 +112,10 @@ class auto_thickbox_options {
|
||||
<tr>
|
||||
<th scope="row"><?php $this->util->_e('Auto Resize'); ?></th>
|
||||
<td>
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[auto_resize]"<?php $this->util->checked($this->options['auto_resize'], 'on'); ?> />
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[auto_resize_img]"<?php $this->util->checked($this->options['auto_resize_img'], 'on'); ?> />
|
||||
<?php echo $this->texts['image']; ?></label>
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[auto_resize_content]"<?php $this->util->checked($this->options['auto_resize_content'], 'on'); ?> />
|
||||
<?php $this->util->_e('Content'); ?></label>
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[auto_resize_html]"<?php $this->util->checked($this->options['auto_resize_html'], 'on'); ?> />
|
||||
HTML</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -253,11 +253,11 @@ class auto_thickbox_options {
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (<?php $this->util->_e('Content'); ?>)</th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (HTML)</th>
|
||||
<td>
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[drag_content_move]"<?php $this->util->checked($this->options['drag_content_move'], 'on'); ?> />
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[drag_html_move]"<?php $this->util->checked($this->options['drag_html_move'], 'on'); ?> />
|
||||
<?php $this->util->_e('Move'); ?></label>
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[drag_content_resize]"<?php $this->util->checked($this->options['drag_content_resize'], 'on'); ?> />
|
||||
<label class="item"><input type="checkbox" name="auto-thickbox-plus[drag_html_resize]"<?php $this->util->checked($this->options['drag_html_resize'], 'on'); ?> />
|
||||
<?php $this->util->_e('Resize'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -317,7 +317,7 @@ class auto_thickbox_options {
|
||||
$bgcolor_title_trans = $this->options['bgcolor_title'] == 'transparent';
|
||||
$bgcolor_cap_trans = $this->options['bgcolor_cap'] == 'transparent';
|
||||
$bgcolor_img_trans = $this->options['bgcolor_img'] == 'transparent';
|
||||
$bgcolor_content_trans = $this->options['bgcolor_content'] == 'transparent';
|
||||
$bgcolor_html_trans = $this->options['bgcolor_html'] == 'transparent';
|
||||
$bgcolor_bg_trans = $this->options['bgcolor_bg'] == 'transparent';
|
||||
$border_win_none = $this->options['border_win'] == 'none';
|
||||
$border_img_tl_none = $this->options['border_img_tl'] == 'none';
|
||||
@@ -355,7 +355,7 @@ class auto_thickbox_options {
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php $this->util->_e('Size'); ?></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (<?php $this->util->_e('Content'); ?>)</th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (HTML)</th>
|
||||
<td>
|
||||
<label class="item"><?php $this->util->_e('Width'); ?>
|
||||
<input type="number" min="0" step="10" name="auto-thickbox-plus[win_width]" value="<?php echo $this->options['win_width']; ?>" class="small-text" /> px</label>
|
||||
@@ -480,12 +480,12 @@ class auto_thickbox_options {
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (<?php $this->util->_e('Content'); ?>)</th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (HTML)</th>
|
||||
<td>
|
||||
<input type="text" class="colortext" name="auto-thickbox-plus[bgcolor_content]" value="<?php echo $this->options['bgcolor_content']; ?>"<?php $this->util->disabled($bgcolor_content_trans); ?> />
|
||||
<input type="text" class="colortext" name="auto-thickbox-plus[bgcolor_html]" value="<?php echo $this->options['bgcolor_html']; ?>"<?php $this->util->disabled($bgcolor_html_trans); ?> />
|
||||
<a href="#" class="pickcolor colorpreview hide-if-no-js"></a>
|
||||
<input type="button" class="pickcolor button hide-if-no-js" value="<?php echo $text_sel_color; ?>" />
|
||||
<label><input type="checkbox" name="auto-thickbox-plus[bgcolor_content]" value="transparent"<?php $this->util->checked($bgcolor_content_trans); ?> onclick="disableOption(this)" />
|
||||
<label><input type="checkbox" name="auto-thickbox-plus[bgcolor_html]" value="transparent"<?php $this->util->checked($bgcolor_html_trans); ?> onclick="disableOption(this)" />
|
||||
<?php $this->util->_e('Transparent'); ?></label>
|
||||
<br /><div class="colorpicker"></div>
|
||||
</td>
|
||||
@@ -506,14 +506,14 @@ class auto_thickbox_options {
|
||||
<th scope="row"><a href="<?php $this->util->_e('https://developer.mozilla.org/en/CSS/margin'); ?>" target="_blank"><?php $this->util->_e('Margin'); ?></a></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (<?php echo $this->texts['image']; ?>)</th>
|
||||
<td>
|
||||
<input type="number" min="0" name="auto-thickbox-plus[margin_win]" value="<?php echo $this->options['margin_win']; ?>" class="small-text" /> px
|
||||
<input type="number" min="0" name="auto-thickbox-plus[margin_win_img]" value="<?php echo $this->options['margin_win_img']; ?>" class="small-text" /> px
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (<?php $this->util->_e('Content'); ?>)</th>
|
||||
<th scope="row"><?php $this->util->_e('Window'); ?> (HTML)</th>
|
||||
<td>
|
||||
<input type="number" min="0" name="auto-thickbox-plus[margin_win_content]" value="<?php echo $this->options['margin_win_content']; ?>" class="small-text" /> px
|
||||
<input type="number" min="0" name="auto-thickbox-plus[margin_win_html]" value="<?php echo $this->options['margin_win_html']; ?>" class="small-text" /> px
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -935,7 +935,7 @@ class auto_thickbox_options {
|
||||
register_setting( $this->option_group, 'auto-thickbox-plus', array(&$this, 'options_callback') );
|
||||
}
|
||||
|
||||
var $checkboxes_on = array('wp_gallery', 'thickbox_text', 'auto_resize', 'auto_resize_content',
|
||||
var $checkboxes_on = array('wp_gallery', 'thickbox_text', 'auto_resize_img', 'auto_resize_html',
|
||||
'key_close_esc', 'key_close_enter',
|
||||
'key_prev_angle', 'key_prev_left',
|
||||
'key_next_angle', 'key_next_right',
|
||||
|
||||
+49
-22
@@ -268,10 +268,10 @@ SCRIPT;
|
||||
if ( $this->options['builtin_res'] == 'off') {
|
||||
$script = '';
|
||||
|
||||
if ( !$this->is_default_options('auto_resize') )
|
||||
$script .= "tb_options.auto_resize = " . var_export($this->options['auto_resize'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('auto_resize_content') )
|
||||
$script .= "tb_options.auto_resize_content = " . var_export($this->options['auto_resize_content'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('auto_resize_img') )
|
||||
$script .= "tb_options.auto_resize_img = " . var_export($this->options['auto_resize_img'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('auto_resize_html') )
|
||||
$script .= "tb_options.auto_resize_html = " . var_export($this->options['auto_resize_html'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('effect_open') )
|
||||
$script .= "tb_options.effect_open = '{$this->options['effect_open']}';\n";
|
||||
if ( !$this->is_default_options('effect_close') )
|
||||
@@ -300,10 +300,10 @@ SCRIPT;
|
||||
$script .= "tb_options.move_img = " . var_export($this->options['drag_img_move'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('drag_img_resize') )
|
||||
$script .= "tb_options.resize_img = " . var_export($this->options['drag_img_resize'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('drag_content_move') )
|
||||
$script .= "tb_options.move_content = " . var_export($this->options['drag_content_move'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('drag_content_resize') )
|
||||
$script .= "tb_options.resize_content = " . var_export($this->options['drag_content_resize'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('drag_html_move') )
|
||||
$script .= "tb_options.move_html = " . var_export($this->options['drag_html_move'] == 'on', true) . ";\n";
|
||||
if ( !$this->is_default_options('drag_html_resize') )
|
||||
$script .= "tb_options.resize_html = " . var_export($this->options['drag_html_resize'] == 'on', true) . ";\n";
|
||||
$keys_close = array();
|
||||
if ( $this->options['key_close_esc'] == 'on' ) $keys_close[] = 27;
|
||||
if ( $this->options['key_close_enter'] == 'on' ) $keys_close[] = 13;
|
||||
@@ -348,10 +348,10 @@ SCRIPT;
|
||||
$script .= "tb_options.win_width = {$this->options['win_width']};\n";
|
||||
if ( !$this->is_default_options('win_height') )
|
||||
$script .= "tb_options.win_height = {$this->options['win_height']};\n";
|
||||
if ( !$this->is_default_options('margin_win') )
|
||||
$script .= "tb_options.margin_win = {$this->options['margin_win']};\n";
|
||||
if ( !$this->is_default_options('margin_win_content') )
|
||||
$script .= "tb_options.margin_win_content = {$this->options['margin_win_content']};\n";
|
||||
if ( !$this->is_default_options('margin_win_img') )
|
||||
$script .= "tb_options.margin_win_img = {$this->options['margin_win_img']};\n";
|
||||
if ( !$this->is_default_options('margin_win_html') )
|
||||
$script .= "tb_options.margin_win_html = {$this->options['margin_win_html']};\n";
|
||||
|
||||
if ( !$this->is_default_options('ref_title') )
|
||||
$script .= "tb_options.ref_title = [{$this->options['ref_title']}];\n";
|
||||
@@ -403,9 +403,9 @@ SCRIPT;
|
||||
}
|
||||
if ( !$this->is_default_options('bgcolor_img') )
|
||||
$style .= "#TB_window.TB_imageContent { background-color:{$this->options['bgcolor_img']}; }\n";
|
||||
if ( !$this->is_default_options('bgcolor_content') ) {
|
||||
$style .= "#TB_window.TB_ajaxContent,#TB_window.TB_iframeContent,#TB_ajaxContent,#TB_iframeContent,#TB_ajaxContentMarginTop,#TB_ajaxContentMarginBottom { background-color:{$this->options['bgcolor_content']}; }\n";
|
||||
$style .= "::-webkit-scrollbar-corner { background-color:{$this->options['bgcolor_content']}; }\n";
|
||||
if ( !$this->is_default_options('bgcolor_html') ) {
|
||||
$style .= "#TB_window.TB_ajaxContent,#TB_window.TB_iframeContent,#TB_ajaxContent,#TB_iframeContent,#TB_ajaxContentMarginTop,#TB_ajaxContentMarginBottom { background-color:{$this->options['bgcolor_html']}; }\n";
|
||||
$style .= "::-webkit-scrollbar-corner { background-color:{$this->options['bgcolor_html']}; }\n";
|
||||
}
|
||||
if ( !$this->is_default_options('bgcolor_bg') )
|
||||
$style .= ".TB_overlayBG { background-color:{$this->options['bgcolor_bg']}; }\n";
|
||||
@@ -586,8 +586,8 @@ SCRIPT;
|
||||
'thickbox_text' => 'on',
|
||||
'thickbox_target' => 'off',
|
||||
'no_thickbox' => 'nothickbox no_thickbox ',
|
||||
'auto_resize' => 'on',
|
||||
'auto_resize_content' => 'off',
|
||||
'auto_resize_img' => 'on',
|
||||
'auto_resize_html' => 'off',
|
||||
'builtin_res' => 'off',
|
||||
'script_place' => 'header',
|
||||
'mobile_support' => 'no_margin',
|
||||
@@ -609,8 +609,8 @@ SCRIPT;
|
||||
'wheel_bg' => 'scroll',
|
||||
'drag_img_move' => 'off',
|
||||
'drag_img_resize' => 'off',
|
||||
'drag_content_move' => 'off',
|
||||
'drag_content_resize' => 'off',
|
||||
'drag_html_move' => 'off',
|
||||
'drag_html_resize' => 'off',
|
||||
'key_close_esc' => 'on',
|
||||
'key_close_enter' => 'on',
|
||||
'key_prev_angle' => 'on',
|
||||
@@ -641,11 +641,11 @@ SCRIPT;
|
||||
'bgcolor_title' => '#e8e8e8',
|
||||
'bgcolor_cap' => 'transparent',
|
||||
'bgcolor_img' => 'white',
|
||||
'bgcolor_content' => 'white',
|
||||
'bgcolor_html' => 'white',
|
||||
'bgcolor_bg' => 'black',
|
||||
'margin_img' => '15',
|
||||
'margin_win' => '15',
|
||||
'margin_win_content' => '30',
|
||||
'margin_win_img' => '15',
|
||||
'margin_win_html' => '30',
|
||||
'border_win' => '1px solid #555',
|
||||
'border_width_win' => '1',
|
||||
'border_style_win' => 'solid',
|
||||
@@ -756,6 +756,33 @@ SCRIPT;
|
||||
$updateOption = true;
|
||||
}
|
||||
|
||||
// XXX: transition code for v1.8 or earlier
|
||||
if (isset($this->options['auto_resize'])) {
|
||||
$this->options['auto_resize_img'] = $this->options['auto_resize'];
|
||||
unset($this->options['auto_resize']);
|
||||
$updateOption = true;
|
||||
}
|
||||
if (isset($this->options['margin_win'])) {
|
||||
$this->options['margin_win_img'] = $this->options['margin_win'];
|
||||
unset($this->options['margin_win']);
|
||||
$updateOption = true;
|
||||
}
|
||||
if (isset($this->options['drag_content_move'])) {
|
||||
$this->options['drag_html_move'] = $this->options['drag_content_move'];
|
||||
unset($this->options['drag_content_move']);
|
||||
$updateOption = true;
|
||||
}
|
||||
if (isset($this->options['drag_content_resize'])) {
|
||||
$this->options['drag_html_resize'] = $this->options['drag_content_resize'];
|
||||
unset($this->options['drag_content_resize']);
|
||||
$updateOption = true;
|
||||
}
|
||||
if (isset($this->options['bgcolor_content'])) {
|
||||
$this->options['bgcolor_html'] = $this->options['bgcolor_content'];
|
||||
unset($this->options['bgcolor_content']);
|
||||
$updateOption = true;
|
||||
}
|
||||
|
||||
if ($this->is_default_options('post_id')) {
|
||||
$args = array(
|
||||
'post_status' => 'draft',
|
||||
|
||||
+3
-2
@@ -277,10 +277,11 @@ You can localize the plugin with [Poedit](http://www.poedit.net/) and "languages
|
||||
|
||||
= Latest Version =
|
||||
* NEW: Mobile support for small-screen devices such as iPhone, Android, Symbian, BlackBerry and Windows Phone
|
||||
* NEW: Enhanced Auto Resize feature so that it works even when resizing browser window, even when showing iframe/ajax/inline content. Changed "Enabled" option to "Image/Content" option at "General - Auto Resize" setting.
|
||||
* NEW: Enhanced Auto Resize feature so that it works even when resizing browser window, even when showing iframe/ajax/inline content. Changed "Enabled" option to "Image/HTML" option at "General - Auto Resize" setting.
|
||||
* NEW: "General - Mobile Support" options that has "No Window Margin"/"No ThickBox" option and "Width"/"Height" option
|
||||
* NEW: "View - Margin - Window (Image/Content)" option
|
||||
* NEW: "View - Margin - Window (Image/HTML)" option
|
||||
* CHANGED: Removed CSS hacks for IE6. Replaced CSS Expression with JavaScript.
|
||||
* CHANGED: Replaced the word "Content" with "HTML"
|
||||
* FIXED: Invalid positioning. some mobile browsers, such as older iOS (iPhone/iPad/iPod touch) and older Android, do not support `position:fixed` style.
|
||||
* FIXED: Gallery images cannot be displayed in gallery style with [Cleaner Gallery](http://wordpress.org/extend/plugins/cleaner-gallery/)
|
||||
|
||||
|
||||
+13
-13
@@ -17,8 +17,8 @@ jQuery(document).ready(function(){ // delay for combined JS
|
||||
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
|
||||
var tb_options = {
|
||||
auto_resize: true,
|
||||
auto_resize_content: false,
|
||||
auto_resize_img: true,
|
||||
auto_resize_html: false,
|
||||
click_img: "close",
|
||||
click_end: "loop",
|
||||
click_bg: "close",
|
||||
@@ -30,9 +30,9 @@ var tb_options = {
|
||||
keys_first: [36], // Home
|
||||
keys_last: [35], // End
|
||||
move_img: false,
|
||||
move_content: false,
|
||||
move_html: false,
|
||||
resize_img: false,
|
||||
resize_content: false,
|
||||
resize_html: false,
|
||||
position_title: "top",
|
||||
position_cap: "bottom",
|
||||
mobile_support: "no_margin",
|
||||
@@ -40,8 +40,8 @@ var tb_options = {
|
||||
small_height: 480,
|
||||
win_width: 600,
|
||||
win_height: 400,
|
||||
margin_win: 15,
|
||||
margin_win_content: 30,
|
||||
margin_win_img: 15,
|
||||
margin_win_html: 30,
|
||||
ref_title: ['link-title', 'link-name'],
|
||||
ref_cap: ['link-title', 'link-name'],
|
||||
effect_open: "none",
|
||||
@@ -575,9 +575,9 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
|
||||
});
|
||||
}
|
||||
|
||||
if (tb_options.move_content)
|
||||
if (tb_options.move_html)
|
||||
jQuery("#TB_window").bind("mousedown.thickbox", function (e) { return tb_move(e, url.indexOf('TB_iframe') != -1 ? "iframe" : "ajax"); });
|
||||
if (tb_options.resize_content) {
|
||||
if (tb_options.resize_html) {
|
||||
tb_resize_init();
|
||||
jQuery("#TB_Resize").bind("mousedown.thickbox", function (e) { return tb_resize(e, url.indexOf('TB_iframe') != -1 ? "iframe" : "ajax"); });
|
||||
}
|
||||
@@ -775,7 +775,7 @@ function tb_reposition(params) {
|
||||
var imgSize = tb_getSize(jQuery("#TB_Image"));
|
||||
|
||||
var pageSize = tb_getPageSize();
|
||||
var winMargin = (pageSize[0] <= tb_options.small_width || pageSize[1] <= tb_options.small_height) ? 0 : tb_options.margin_win * 2;
|
||||
var winMargin = (pageSize[0] <= tb_options.small_width || pageSize[1] <= tb_options.small_height) ? 0 : tb_options.margin_win_img * 2;
|
||||
|
||||
// Resizing large images - orginal by Christian Montoya edited by me.
|
||||
var x = jQuery(window).width() - (winBorderSize[0] - winSize[0] + imgMarginSize[0] - imgSize[0]) - winMargin;
|
||||
@@ -788,7 +788,7 @@ function tb_reposition(params) {
|
||||
tb_fitWidth = Math.round(tb_fitWidth * (y / tb_fitHeight));
|
||||
tb_fitHeight = y;
|
||||
}
|
||||
tb_fitToWindow = tb_options.auto_resize && (imageWidth > x || imageHeight > y);
|
||||
tb_fitToWindow = tb_options.auto_resize_img && (imageWidth > x || imageHeight > y);
|
||||
if (tb_fitToWindow) {
|
||||
imageWidth = tb_fitWidth;
|
||||
imageHeight = tb_fitHeight;
|
||||
@@ -819,7 +819,7 @@ function tb_reposition_html(url, params) {
|
||||
var winSize = tb_getSize(jQuery("#TB_window"));
|
||||
|
||||
var pageSize = tb_getPageSize();
|
||||
var winMargin = (pageSize[0] <= tb_options.small_width || pageSize[1] <= tb_options.small_height) ? 0 : tb_options.margin_win_content * 2;
|
||||
var winMargin = (pageSize[0] <= tb_options.small_width || pageSize[1] <= tb_options.small_height) ? 0 : tb_options.margin_win_html * 2;
|
||||
|
||||
var x = jQuery(window).width() - (winBorderSize[0] - winSize[0]) - winMargin;
|
||||
var y = jQuery(window).height() - (winBorderSize[1] - winSize[1]) - winMargin;
|
||||
@@ -833,8 +833,8 @@ function tb_reposition_html(url, params) {
|
||||
y -= innerSize[1] - size[1] + tb_getSize(jQuery("#TB_title"))[1];
|
||||
}
|
||||
|
||||
TB_WIDTH = params['width'] ? Math.min(params['width']*1, x) : (tb_options.auto_resize_content ? x : tb_options.win_width); //defaults to 600 if no paramaters were added to URL
|
||||
TB_HEIGHT = params['height'] ? Math.min(params['height']*1, y) : (tb_options.auto_resize_content ? y : tb_options.win_height); //defaults to 400 if no paramaters were added to URL
|
||||
TB_WIDTH = params['width'] ? Math.min(params['width']*1, x) : (tb_options.auto_resize_html ? x : tb_options.win_width); //defaults to 600 if no paramaters were added to URL
|
||||
TB_HEIGHT = params['height'] ? Math.min(params['height']*1, y) : (tb_options.auto_resize_html ? y : tb_options.win_height); //defaults to 400 if no paramaters were added to URL
|
||||
ajaxContentW = TB_WIDTH;
|
||||
ajaxContentH = TB_HEIGHT;
|
||||
|
||||
|
||||
Vendored
+6
-6
@@ -1,5 +1,5 @@
|
||||
jQuery(document).ready(function(){"string"!=typeof tb_pathToImage&&(tb_pathToImage=thickboxL10n.loadingAnimation);"string"!=typeof tb_closeImage&&(tb_closeImage=thickboxL10n.closeImage)});
|
||||
var tb_options={auto_resize:!0,auto_resize_content:!1,click_img:"close",click_end:"loop",click_bg:"close",wheel_img:"prev_next",wheel_bg:"scroll",keys_close:[27,13],keys_prev:[188,37],keys_next:[190,39],keys_first:[36],keys_last:[35],move_img:!1,move_content:!1,resize_img:!1,resize_content:!1,position_title:"top",position_cap:"bottom",mobile_support:"no_margin",small_width:480,small_height:480,win_width:600,win_height:400,margin_win:15,margin_win_content:30,ref_title:["link-title","link-name"],ref_cap:["link-title",
|
||||
var tb_options={auto_resize_img:!0,auto_resize_html:!1,click_img:"close",click_end:"loop",click_bg:"close",wheel_img:"prev_next",wheel_bg:"scroll",keys_close:[27,13],keys_prev:[188,37],keys_next:[190,39],keys_first:[36],keys_last:[35],move_img:!1,move_html:!1,resize_img:!1,resize_html:!1,position_title:"top",position_cap:"bottom",mobile_support:"no_margin",small_width:480,small_height:480,win_width:600,win_height:400,margin_win_img:15,margin_win_html:30,ref_title:["link-title","link-name"],ref_cap:["link-title",
|
||||
"link-name"],effect_open:"none",effect_close:"fade",effect_trans:"none",effect_title:"none",effect_cap:"none",effect_speed:"fast",debug:!1};
|
||||
jQuery(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox");imgLoader=new Image;imgLoader.src=tb_pathToImage;var a,c=navigator.userAgent,b=(a=c.match(/AppleWebKit\/([0-9]+)/))&&534>a[1],d=(a=c.match(/Opera Mobi\/([0-9]+)/))&&7458>a[1],e=(a=c.match(/Fennec\/([0-9]+)/))&&6>a[1];notSupportedPositionFixed="undefined"==typeof document.body.style.maxHeight||/(iPhone|iPod|iPad)/.test(navigator.platform)&&b||-1<c.indexOf("Android")&&b||window.operamini&&"[object OperaMini]"===Object.prototype.toString.call(window.operamini)||
|
||||
d||e||window.palmGetResource&&b||-1<c.indexOf("MeeGo")&&-1<c.indexOf("NokiaBrowser/8.5.0")});function tb_init(a){jQuery.isFunction(jQuery().live)?jQuery(a).live("click",tb_click):jQuery(a).bind("click",tb_click)}
|
||||
@@ -31,7 +31,7 @@ tb_options.effect_cap)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("
|
||||
"<div id='TB_ajaxContent'></div>","true"!=f.modal)switch(tb_options.position_title){case "top":jQuery("#TB_window").append(TB_Title+TB_Ajax).addClass("TB_ajaxContent TB_titleTop");break;case "bottom":jQuery("#TB_window").append(TB_Ajax+TB_Title).addClass("TB_ajaxContent TB_titleBottom");break;case "none":jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent TB_titleNone")}else jQuery("#TB_overlay").unbind(),jQuery("#TB_window").append(TB_Ajax).addClass("TB_ajaxContent"),jQuery("#TB_ajaxContent").addClass("TB_modal");
|
||||
else jQuery("#TB_ajaxContent")[0].scrollTop=0,jQuery("#TB_ajaxWindowTitle").html(a);jQuery("#TB_closeWindowButton").click(tb_remove);if(-1!=c.indexOf("TB_inline"))jQuery("#TB_ajaxContent").append(jQuery("#"+f.inlineId).children()),jQuery("#TB_window").bind("tb_unload",function(){jQuery("#"+f.inlineId).append(jQuery("#TB_ajaxContent").children())}),tb_reposition_html(c,f),jQuery(window).bind("resize.thickbox",function(){tb_reposition_html(c,f)}),jQuery("#TB_load").remove(),tb_open(),tb_roundCorner("iframe");
|
||||
else if(-1!=c.indexOf("TB_iframe"))tb_reposition_html(c,f),jQuery(window).bind("resize.thickbox",function(){tb_reposition_html(c,f)}),(!("onload"in jQuery("#TB_iframeContent")[0])&&"function"!=typeof jQuery("#TB_iframeContent")[0].onload||".pdf"==g)&&tb_showIframe();else{var i=-1==c.indexOf("?")?"?":"&";jQuery("#TB_ajaxContent").load(c+=i+"random="+(new Date).getTime(),function(){tb_reposition_html(c,f);jQuery(window).bind("resize.thickbox",function(){tb_reposition_html(c,f)});jQuery("#TB_load").remove();
|
||||
tb_open();tb_roundCorner("ajax")})}tb_options.move_content&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,-1!=c.indexOf("TB_iframe")?"iframe":"ajax")});tb_options.resize_content&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,-1!=c.indexOf("TB_iframe")?"iframe":"ajax")}));"none"!=tb_options.effect_title&&(jQuery("#TB_title").addClass("hover"),"zoom"==tb_options.effect_title&&jQuery("#TB_title").css({left:"50%",marginLeft:-TB_WIDTH/
|
||||
tb_open();tb_roundCorner("ajax")})}tb_options.move_html&&jQuery("#TB_window").bind("mousedown.thickbox",function(a){return tb_move(a,-1!=c.indexOf("TB_iframe")?"iframe":"ajax")});tb_options.resize_html&&(tb_resize_init(),jQuery("#TB_Resize").bind("mousedown.thickbox",function(a){return tb_resize(a,-1!=c.indexOf("TB_iframe")?"iframe":"ajax")}));"none"!=tb_options.effect_title&&(jQuery("#TB_title").addClass("hover"),"zoom"==tb_options.effect_title&&jQuery("#TB_title").css({left:"50%",marginLeft:-TB_WIDTH/
|
||||
2}),jQuery("#TB_window").bind("mouseenter.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title)}).bind("mouseleave.thickbox",function(){tb_hover(jQuery("#TB_title"),tb_options.effect_title,!0)}));"true"!=f.modal&&jQuery(document).bind("keyup.thickbox",function(a){if(-1!=jQuery.inArray(a.which,tb_options.keys_close))return a.stopImmediatePropagation(),jQuery(document).triggerHandler("wp_CloseOnEscape",[{event:a,what:"thickbox",cb:tb_remove}])||tb_remove(),!1})}}catch(v){tb_options.debug&&
|
||||
alert(v)}}
|
||||
function tb_open(){"hidden"==jQuery("#TB_window").css("visibility")&&jQuery("#TB_window").css("visibility","visible");var a=jQuery("#TB_window").is(".TB_Transition")?tb_options.effect_trans:tb_options.effect_open;tb_effectView(a,!1);var c=function(){tb_effectView(a)};switch(a){case "zoom":jQuery("#TB_window").height(jQuery("#TB_window").height());notSupportedPositionFixed&&"relative"!=jQuery("body").css("position")&&jQuery("#TB_window").css({marginTop:-jQuery("#TB_window").height()/2,top:jQuery(window).height()/2+
|
||||
@@ -45,11 +45,11 @@ function tb_remove(){tb_effectView(tb_options.effect_close,!1);var a=function(){
|
||||
a);break;case "fade":jQuery("#TB_window").fadeOut(tb_options.effect_speed,a);break;default:a()}jQuery("#TB_load").remove();jQuery(document).add(window).unbind(".thickbox");return!1}
|
||||
function tb_position(){var a=TB_WIDTH+jQuery("#TB_window").outerWidth()-jQuery("#TB_window").width(),c=TB_HEIGHT+jQuery("#TB_window").outerHeight()-jQuery("#TB_window").height(),b=-parseInt(a/2,10),d=-parseInt(c/2,10),e=notSupportedPositionFixed;!e&&"absolute"==jQuery("#TB_window").css("position")&&(b+=jQuery(document).scrollLeft(),d+=jQuery(document).scrollTop());jQuery("#TB_window").css({marginLeft:b+"px",width:TB_WIDTH+"px"});e||jQuery("#TB_window").css({marginTop:d+"px"});"relative"==jQuery("body").css("position")&&
|
||||
(d=tb_getPageSize(),e&&(b=parseInt((d[0]-a)/2,10)+jQuery(document).scrollLeft(),d=parseInt((d[1]-c)/2,10)+jQuery(document).scrollTop(),jQuery("#TB_window").css({marginLeft:b+"px",marginTop:d+"px",top:"0",left:"0"})))}
|
||||
function tb_reposition(a){jQuery("#TB_window").width(jQuery(window).width());var c=0==jQuery("#TB_Image").height();c&&jQuery("#TB_Image").height(imgPreloader.height);var b=tb_getSize(jQuery("#TB_window"),"border"),d=tb_getSize(jQuery("#TB_window")),e=tb_getSize(jQuery("#TB_Image"),"margin"),g=tb_getSize(jQuery("#TB_Image")),j=tb_getPageSize(),f=j[0]<=tb_options.small_width||j[1]<=tb_options.small_height?0:2*tb_options.margin_win,j=jQuery(window).width()-(b[0]-d[0]+e[0]-g[0])-f,b=jQuery(window).height()-
|
||||
(b[1]-g[1])-f,f=a.width?Math.min(1*a.width,imgPreloader.width):imgPreloader.width,i=a.height?Math.min(1*a.height,imgPreloader.height):imgPreloader.height;tb_fitWidth=j;tb_fitHeight=Math.round(i*(j/f));tb_fitHeight>b&&(tb_fitWidth=Math.round(tb_fitWidth*(b/tb_fitHeight)),tb_fitHeight=b);if(tb_fitToWindow=tb_options.auto_resize&&(f>j||i>b))f=tb_fitWidth,i=tb_fitHeight;jQuery("#TB_Image").attr("width",f).attr("height",i);c&&jQuery("#TB_Image").height(i);TB_WIDTH=f+(e[0]-g[0]);TB_HEIGHT=i+(d[1]-g[1]);
|
||||
function tb_reposition(a){jQuery("#TB_window").width(jQuery(window).width());var c=0==jQuery("#TB_Image").height();c&&jQuery("#TB_Image").height(imgPreloader.height);var b=tb_getSize(jQuery("#TB_window"),"border"),d=tb_getSize(jQuery("#TB_window")),e=tb_getSize(jQuery("#TB_Image"),"margin"),g=tb_getSize(jQuery("#TB_Image")),j=tb_getPageSize(),f=j[0]<=tb_options.small_width||j[1]<=tb_options.small_height?0:2*tb_options.margin_win_img,j=jQuery(window).width()-(b[0]-d[0]+e[0]-g[0])-f,b=jQuery(window).height()-
|
||||
(b[1]-g[1])-f,f=a.width?Math.min(1*a.width,imgPreloader.width):imgPreloader.width,i=a.height?Math.min(1*a.height,imgPreloader.height):imgPreloader.height;tb_fitWidth=j;tb_fitHeight=Math.round(i*(j/f));tb_fitHeight>b&&(tb_fitWidth=Math.round(tb_fitWidth*(b/tb_fitHeight)),tb_fitHeight=b);if(tb_fitToWindow=tb_options.auto_resize_img&&(f>j||i>b))f=tb_fitWidth,i=tb_fitHeight;jQuery("#TB_Image").attr("width",f).attr("height",i);c&&jQuery("#TB_Image").height(i);TB_WIDTH=f+(e[0]-g[0]);TB_HEIGHT=i+(d[1]-g[1]);
|
||||
TB_WIDTH<1*a.width&&(TB_WIDTH=1*a.width,jQuery("#TB_Image").css({marginLeft:"auto",marginRight:"auto"}));TB_HEIGHT<1*a.height&&(TB_HEIGHT=1*a.height);jQuery("#TB_ImageClick > a").height(tb_getSize(jQuery("#TB_Image"),"margin")[1]);tb_position()}
|
||||
function tb_reposition_html(a,c){var b=tb_getSize(jQuery("#TB_window"),"border"),d=tb_getSize(jQuery("#TB_window")),e=tb_getPageSize(),g=e[0]<=tb_options.small_width||e[1]<=tb_options.small_height?0:2*tb_options.margin_win_content,e=jQuery(window).width()-(b[0]-d[0])-g,b=jQuery(window).height()-(b[1]-d[1])-g;-1!=a.indexOf("TB_iframe")?(e-=2*("\v"=="v"?10:8),b-=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1]):(d=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),g=tb_getSize(jQuery("#TB_ajaxContent")),
|
||||
e-=d[0]-g[0],b-=d[1]-g[1]+tb_getSize(jQuery("#TB_title"))[1]);TB_WIDTH=c.width?Math.min(1*c.width,e):tb_options.auto_resize_content?e:tb_options.win_width;TB_HEIGHT=c.height?Math.min(1*c.height,b):tb_options.auto_resize_content?b:tb_options.win_height;ajaxContentW=TB_WIDTH;ajaxContentH=TB_HEIGHT;-1!=a.indexOf("TB_iframe")?(ajaxContentW+=2*("\v"=="v"?10:8),ajaxContentH+=2*("\v"=="v"?15:8),jQuery("#TB_iframeContent").attr("style","width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;")):"block"!=jQuery("#TB_window").css("display")?
|
||||
function tb_reposition_html(a,c){var b=tb_getSize(jQuery("#TB_window"),"border"),d=tb_getSize(jQuery("#TB_window")),e=tb_getPageSize(),g=e[0]<=tb_options.small_width||e[1]<=tb_options.small_height?0:2*tb_options.margin_win_html,e=jQuery(window).width()-(b[0]-d[0])-g,b=jQuery(window).height()-(b[1]-d[1])-g;-1!=a.indexOf("TB_iframe")?(e-=2*("\v"=="v"?10:8),b-=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1]):(d=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),g=tb_getSize(jQuery("#TB_ajaxContent")),
|
||||
e-=d[0]-g[0],b-=d[1]-g[1]+tb_getSize(jQuery("#TB_title"))[1]);TB_WIDTH=c.width?Math.min(1*c.width,e):tb_options.auto_resize_html?e:tb_options.win_width;TB_HEIGHT=c.height?Math.min(1*c.height,b):tb_options.auto_resize_html?b:tb_options.win_height;ajaxContentW=TB_WIDTH;ajaxContentH=TB_HEIGHT;-1!=a.indexOf("TB_iframe")?(ajaxContentW+=2*("\v"=="v"?10:8),ajaxContentH+=2*("\v"=="v"?15:8),jQuery("#TB_iframeContent").attr("style","width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;")):"block"!=jQuery("#TB_window").css("display")?
|
||||
jQuery("#TB_ajaxContent").attr("style","width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;"):(jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px",jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px");-1!=a.indexOf("TB_iframe")?(TB_WIDTH+=2*("\v"=="v"?10:8),TB_HEIGHT+=2*("\v"=="v"?15:8)+tb_getSize(jQuery("#TB_title"))[1]):(d=tb_getSize(jQuery("#TB_ajaxContent"),"padding"),g=tb_getSize(jQuery("#TB_ajaxContent")),TB_WIDTH+=d[0]-g[0],TB_HEIGHT+=d[1]-g[1]+tb_getSize(jQuery("#TB_title"))[1]);
|
||||
tb_position()}function tb_parseQuery(a){var c={};if(!a)return c;for(var a=a.substring(a.indexOf("?")+1),a=a.split(/[;&]/),b=0;b<a.length;b++){var d=a[b].split("=");if(d&&2==d.length){var e=unescape(d[0]),d=unescape(d[1]),d=d.replace(/\+/g," ");c[e]=d}}return c}
|
||||
function tb_getPageSize(){var a=document.documentElement;return arrayPageSize=[window.innerWidth||self.innerWidth||a&&a.clientWidth||document.body.clientWidth,window.innerHeight||self.innerHeight||a&&a.clientHeight||document.body.clientHeight]}function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();if(-1!=a.indexOf("mac")&&-1!=a.indexOf("firefox"))return!0}
|
||||
|
||||
Reference in new issue
Block a user