diff --git a/extlink.js b/extlink.js
index cb5a5e1..0e5a143 100644
--- a/extlink.js
+++ b/extlink.js
@@ -66,7 +66,13 @@ function extlinkAttach(context) {
$(external_links).not('[img]').addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after(''); });
}
else {
- $(external_links).not($(external_links).find('img').parents('a')).addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after(''); });
+ if (Drupal.settings.extlink.extClassImg) {
+ // Apply the "ext" class to all links, not just images.
+ $(external_links).addClass(Drupal.settings.extlink.extClass);
+ }
+ else {
+ $(external_links).not($(external_links).find('img').parents('a')).addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after(''); });
+ }
}
}
diff --git a/extlink.module b/extlink.module
index 6366255..cbc40d5 100644
--- a/extlink.module
+++ b/extlink.module
@@ -22,6 +22,7 @@ function extlink_init() {
drupal_add_js(array('extlink' => array(
'extTarget' => variable_get('extlink_target', 0),
'extClass' => variable_get('extlink_class', 'ext'),
+ 'extClassImg' => variable_get('extlink_class_img', FALSE),
'extSubdomains' => variable_get('extlink_subdomains', 1),
'extExclude' => variable_get('extlink_exclude', ''),
'extInclude' => variable_get('extlink_include', ''),
@@ -45,6 +46,14 @@ function extlink_admin_settings() {
'#description' => t('Places an !icon icon next to external links.', array('!icon' => theme('image', array('path' => drupal_get_path('module', 'extlink') . '/extlink.png', 'alt' => t('External Links icon'))))),
);
+ $form['extlink_class_img'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Imagelinks should be external links'),
+ '#return_value' => TRUE,
+ '#default_value' => variable_get('extlink_class_img', FALSE),
+ '#description' => t('If checked, imagelinks (images wrapped in an a tag) should be external links'),
+ );
+
$form['extlink_mailto_class'] = array(
'#type' => 'checkbox',
'#title' => t('Add icon to mailto links'),