"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&#347;nik do strony zewn&#281;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

Maciej.S’s picture

Issue summary: View changes

Description errata

elachlan’s picture

Status: Patch (to be ported) » Closed (duplicate)
elachlan’s picture

Issue summary: View changes

Added missing code, reformatting.