From 28652e62322065e8bf52caddcd34161b4d0df9cd Mon Sep 17 00:00:00 2001 From: attosoft Date: Sun, 20 May 2012 13:05:06 +0000 Subject: [PATCH] Add "General - Auto ThickBox - Links with target attribute" option. `class="thickbox"` is not added to links with target attribute by default. --- auto-thickbox-options.php | 4 +++- auto-thickbox.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/auto-thickbox-options.php b/auto-thickbox-options.php index fab2e08..449b9b2 100644 --- a/auto-thickbox-options.php +++ b/auto-thickbox-options.php @@ -88,7 +88,9 @@ jQuery(function($) { + (<a href="image">text</a>)
+ diff --git a/auto-thickbox.php b/auto-thickbox.php index 13e4c3a..c5e1e2d 100644 --- a/auto-thickbox.php +++ b/auto-thickbox.php @@ -64,7 +64,8 @@ class auto_thickbox { * @return anchor $anchor **/ function image($anchor) { - if ( $this->options['thickbox_text'] == 'off' && !preg_match("/^\s*<\s*img\s.+?>\s*$/is", $anchor['body']) ) + if ( ($this->options['thickbox_text'] == 'off' && !preg_match("/^\s*<\s*img\s.+?>\s*$/is", $anchor['body'])) + || ($this->options['thickbox_target'] == 'off' && !empty($anchor['attr']['target'])) ) return $anchor; if ( !$anchor['attr']['class'] ) { @@ -423,6 +424,7 @@ SCRIPT; $this->options_def = array( 'thickbox_style' => 'single', 'thickbox_text' => 'on', + 'thickbox_target' => 'off', 'auto_resize' => 'on', 'builtin_res' => 'off', 'script_place' => 'header',