Hello, I was wondering if there's a way to make the icon display before the link, not after. I want it to appear more like a bullet. I tried messing with the css file and it didn't work :/

LOVE THIS MODULE, tia

Files: 
CommentFileSizeAuthor
#6 extlink_icon_placement-1672650-6.patch3.91 KBDrColossos
PASSED: [[SimpleTest]]: [MySQL] 29 pass(es).
[ View ]

Comments

lahode’s picture

Just change in extlink.js $(this).after by $(this).before everywhere

Something nicer would be to include the option in extlink_admin_settings, like:

  $form['extlink_place'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add icon next to external links'),
    '#return_value' => 'next',
    '#default_value' => variable_get('extlink_place', 'next'),
    '#description' => t('If checked the icon will placed next to external links.'),
  );

Then add line 24 after drupal_add_js(array('extlink' => array( :

    'extPlace'     => variable_get('extlink_place', 0),

And in your extlink.js file, change the line:

  if (Drupal.settings.extlink.extClass) {
    // Apply the "ext" class to all links not containing images.
    if (parseFloat($().jquery) < 1.2) {
      $(external_links).not('[img]').addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>'); });
    }
    else {
      $(external_links).not($(external_links).find('img').parents('a')).addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>'); });
    }
  }

  if (Drupal.settings.extlink.mailtoClass) {
    // Apply the "mailto" class to all mailto links not containing images.
    if (parseFloat($().jquery) < 1.2) {
      $(mailto_links).not('[img]').addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>'); });
    }
    else {
      $(mailto_links).not($(mailto_links).find('img').parents('a')).addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>'); });
    }
  }

by:

  if (Drupal.settings.extlink.extClass) {
    // Apply the "ext" class to all links not containing images.
    if (parseFloat($().jquery) < 1.2) {
      $(external_links).not('[img]').addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') {
          if (Drupal.settings.extlink.extPlace) {
            $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>');
          } else {
            $(this).before('<span class=' + Drupal.settings.extlink.extClass + '></span>');
          }
        }
      });
    }
    else {
      $(external_links).not($(external_links).find('img').parents('a')).addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') {
          if (Drupal.settings.extlink.extPlace) {
            $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>');
          } else {
            $(this).before('<span class=' + Drupal.settings.extlink.extClass + '></span>');
          }
        }
      });
    }
  }

  if (Drupal.settings.extlink.mailtoClass) {
    // Apply the "mailto" class to all mailto links not containing images.
    if (parseFloat($().jquery) < 1.2) {
      $(mailto_links).not('[img]').addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') {
          if (Drupal.settings.extlink.extPlace) {
            $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>');
          } else {
            $(this).before('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>');
          }
        }
      });
    }
    else {
      $(mailto_links).not($(mailto_links).find('img').parents('a')).addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') {
          if (Drupal.settings.extlink.extPlace) {
            $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>');
          } else {
            $(this).before('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>');
          }
        }
      });
    }
  }

Cheers

elachlan’s picture

Category:support» feature
Status:Active» Postponed

Could be a possible inclusion. Submit a patch and we will see about including it.

DrColossos’s picture

Version:7.x-1.12» 7.x-1.x-dev
Status:Postponed» Needs review
StatusFileSize
new2.39 KB
PASSED: [[SimpleTest]]: [MySQL] 29 pass(es).
[ View ]

Since we needed this functionallity, I created a patch from the above. I slightly changed some of the wordings and changed the way the JavaScript is handled. Created against the latest dev

DrColossos’s picture

Issue summary:View changes

This patch has been around for quite some time, also with the refactored Javascript. We would love to have this feature available without patching the module. Please check the patch and let me know if anything needs changing.

elachlan’s picture

Status:Needs review» Needs work

Could you re-roll it to the latest version?

Also I may need to get the OK from quicksketch before a release, but we should be able to include it in dev for now.

DrColossos’s picture

Status:Needs work» Needs review
StatusFileSize
new3.91 KB
PASSED: [[SimpleTest]]: [MySQL] 29 pass(es).
[ View ]

So, i finally managed to update the little patch. It's against the latest 7.x-1.x branch. I also rephrased some of the old wordings from my last patch.

  • DrColossos authored 82a9d4f on 7.x-1.x
    Fixes #1672650
    
    Signed-off-by: Lachlan Ennis <lachlan@expert1.com.au>
    
elachlan’s picture

I have pushed the change through.

Thanks you!

DamienMcKenna’s picture

Status:Needs review» Needs work

Needs an update to hook_uninstall() to remove the new variable.