Replace "TB_iframe=true" with "TB_iframe". ThickBox does not check a value of "TB_iframe" query in fact. So ThickBox opens as iframe even when "TB_iframe=false".
This commit is contained in:
1 parent
c8f60368a3
commit
be99fece52
2 files changed
+6
-6
No files matched your search
+1
-1
@@ -67,7 +67,7 @@ jQuery(function($) {
|
||||
var checkbox = $(this).nextAll("label").children("input:checkbox");
|
||||
$(this).click(function() {
|
||||
formfield = text.attr('name');
|
||||
tb_show(this.value, 'media-upload.php?type=image&post_id=' + post_id + '&TB_iframe=true');
|
||||
tb_show(this.value, 'media-upload.php?type=image&post_id=' + post_id + '&TB_iframe');
|
||||
window.send_to_editor = function(html) {
|
||||
imgurl = $('img', html).attr('src') || $(html).attr('src'); // type/library or type_url
|
||||
text.val(imgurl);
|
||||
|
||||
+5
-5
@@ -53,7 +53,7 @@ class auto_thickbox {
|
||||
return auto_thickbox::image($anchor);
|
||||
elseif ( !empty($anchor['attr']['class']) && in_array('thickbox', $anchor['attr']['class']) )
|
||||
return auto_thickbox::iframe($anchor);
|
||||
elseif ( strpos($anchor['attr']['href'], 'TB_iframe=true') !== false || strpos($anchor['attr']['href'], '#TB_inline') !== false )
|
||||
elseif ( strpos($anchor['attr']['href'], 'TB_iframe') !== false || strpos($anchor['attr']['href'], '#TB_inline') !== false )
|
||||
return $this->add_thickbox_class($anchor);
|
||||
else
|
||||
return $anchor;
|
||||
@@ -123,17 +123,17 @@ class auto_thickbox {
|
||||
* @return void
|
||||
**/
|
||||
function iframe($anchor) {
|
||||
if ( strpos($anchor['attr']['href'], 'TB_iframe=true') !== false || strpos($anchor['attr']['href'], '#TB_inline') !== false )
|
||||
if ( strpos($anchor['attr']['href'], 'TB_iframe') !== false || strpos($anchor['attr']['href'], '#TB_inline') !== false )
|
||||
return $anchor;
|
||||
if ( strpos($anchor['attr']['href'], '://') === false || strpos($anchor['attr']['href'], $_SERVER['HTTP_HOST']) !== false )
|
||||
return $anchor; // not append 'TB_iframe=true' to URL in the same domain (i.e. display as not iframe but AJAX content)
|
||||
return $anchor; // not append 'TB_iframe' to URL in the same domain (i.e. display as not iframe but AJAX content)
|
||||
|
||||
# strip anchor ref
|
||||
$href = explode('#', $anchor['attr']['href']);
|
||||
$anchor['attr']['href'] = array_shift($href);
|
||||
|
||||
$anchor['attr']['href'] .= ( ( strpos($anchor['attr']['href'], '?') === false ) ? '?' : '&' )
|
||||
. 'TB_iframe=true' . ( count($href) == 0 ? '' : '#' . implode('#', $href) );
|
||||
. 'TB_iframe' . ( count($href) == 0 ? '' : '#' . implode('#', $href) );
|
||||
|
||||
return $anchor;
|
||||
} # iframe()
|
||||
@@ -451,7 +451,7 @@ SCRIPT;
|
||||
// Additional links on the Plugins page
|
||||
function add_auto_thickbox_links($links, $file) {
|
||||
if ( $file == plugin_basename(__FILE__) ) {
|
||||
$links[] = '<a href="plugin-install.php?tab=plugin-information&plugin=auto-thickbox-plus&TB_iframe=true" class="thickbox" title="' . AUTO_THICKBOX_PLUS . '">' . $this->texts['details'] . '</a>';
|
||||
$links[] = '<a href="plugin-install.php?tab=plugin-information&plugin=auto-thickbox-plus&TB_iframe" class="thickbox" title="' . AUTO_THICKBOX_PLUS . '">' . $this->texts['details'] . '</a>';
|
||||
$links[] = '<a href="http://wordpress.org/tags/auto-thickbox-plus" target="_blank">' . __('Support', 'auto-thickbox') . '</a>';
|
||||
$links[] = '<a href="' . __('http://attosoft.info/en/', 'auto-thickbox') . 'contact/" target="_blank">' . $this->texts['contact'] . '</a>';
|
||||
$links[] = '<a href="' . __('http://attosoft.info/en/', 'auto-thickbox') . 'donate/" target="_blank">' . __('Donate', 'auto-thickbox') . '</a>';
|
||||
|
||||
Reference in new issue
Block a user