Closed (duplicate)
Project:
External Links
Version:
7.x-1.12
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
30 May 2012 at 10:55 UTC
Updated:
29 Jul 2013 at 01:59 UTC
"Allow inside tag icons" future allows to append ext icons inside a tag.
File: extlink.module
Inside function "extlink_init()" append to 'extlink' array key (line 23):
'extAllowInside'=> variable_get('extlink_allow_inside', 0),
Inside function "extlink_admin_settings()" append:
$form['extlink_allow_inside'] = array(
'#type' => 'checkbox',
'#title' => t('Allow inside <a> tag icons'),
'#return_value' => 1,
'#default_value' => variable_get('extlink_allow_inside', 0),
'#description' => t('By default icons are added after <a> tag if css "display" property is set to "inline". In some cases (like menus) those tags are displayed as "block". This option allows to append icons inside <a> tag.'),
);File: extlink.js
Line from 62 to 70:
if (Drupal.settings.extlink.extClass) { ... }
replace with
if (Drupal.settings.extlink.extClass) {
// Apply the "ext" class to all links not containing images.
var extHtml = '<span title="Odnośnik do strony zewnętrznej" class=' + Drupal.settings.extlink.extClass + '></span>';
if (parseFloat($().jquery) < 1.2) {
$(external_links).not('[img]').addClass(Drupal.settings.extlink.extClass).each(function() {
if ($(this).css('display') == 'inline') $(this).after(extHtml);
else if(Drupal.settings.extlink.extAllowInside) $(this).html($(this).html()+extHtml);
});
}
else {
$(external_links).not($(external_links).find('img').parents('a')).addClass(Drupal.settings.extlink.extClass).each(function() {
if ($(this).css('display') == 'inline') $(this).after(extHtml);
else if(Drupal.settings.extlink.extAllowInside) $(this).html($.trim($(this).html())+extHtml);
});
}
}
Line from 72 to 80:
if (Drupal.settings.extlink.mailtoClass) { ... }
replace with
if (Drupal.settings.extlink.mailtoClass) {
// Apply the "mailto" class to all mailto links not containing images.
var extHtml = '<span class=' + Drupal.settings.extlink.mailtoClass + '></span>';
if (parseFloat($().jquery) < 1.2) {
$(mailto_links).not('[img]').addClass(Drupal.settings.extlink.mailtoClass).each(function() {
if ($(this).css('display') == 'inline')
$(this).after(extHtml);
else if(Drupal.settings.extlink.extAllowInside) $(this).html($.trim($(this).html())+extHtml);
});
}
else {
$(mailto_links).not($(mailto_links).find('img').parents('a')).addClass(Drupal.settings.extlink.mailtoClass).each(function() {
if ($(this).css('display') == 'inline')
$(this).after(extHtml);
else if(Drupal.settings.extlink.extAllowInside) $(this).html($.trim($(this).html())+extHtml);
});
}
}
Comments
Comment #0.0
Maciej.S commentedDescription errata
Comment #1
elachlan commentedSee: #544074: Extlink Icon clickable link
Comment #1.0
elachlan commentedAdded missing code, reformatting.