I wanted extlink to operate on image links as well. Currently, the javascript that processes links specifically excludes them (probably to avoid putting little icons after the images, which would be weird).

But we're not using the icons, instead, extlink_extra provides a colorbox option, and for that to work the image links need the "ext" class applied.

This patch adds a variable, extlink_class_img which defaults to FALSE (so no change in behavior. If you set it to TRUE in your settings.php file however, it should catch imagelinks as well. It's a little rough (I didnt add it to the admin screen, variable not removed on uninstall) but if there's interest I will improve it.

Files: 
CommentFileSizeAuthor
#12 extlink-1857612-12.patch2.35 KBelachlan
PASSED: [[SimpleTest]]: [MySQL] 29 pass(es). View
#6 extlink_apply_to_images-1857612-6.patch2.43 KBrj
PASSED: [[SimpleTest]]: [MySQL] 29 pass(es). View
#4 extlink_apply_to_images-1857612-4.patch2.36 KBrj
FAILED: [[SimpleTest]]: [MySQL] 27 pass(es), 1 fail(s), and 0 exception(s). View
#1 extlink-apply-to-images-1857612-1.patch2.39 KBrj
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch extlink-apply-to-images-1857612-1.patch. Unable to apply patch. See the log in the details link for more information. View
extlink-apply-to-images.patch1.84 KBkscheirer
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch extlink-apply-to-images.patch. Unable to apply patch. See the log in the details link for more information. View

Comments

rj’s picture

FileSize
2.39 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch extlink-apply-to-images-1857612-1.patch. Unable to apply patch. See the log in the details link for more information. View

+1 for this.

New patch attached that includes a checkbox on the admin screen to enable/disable.

elachlan’s picture

Title:Apply class to image links too» Add option to add icon to image links
Version:7.x-1.12» 7.x-1.13
Assigned:kscheirer» Unassigned
Status:Needs review» Needs work

As we have extlink_mailto_class as a variable I would like to follow the naming convention and make the variable extlink_img_class.

Also the administration menu item should appear below the mailto. We should treat it as a separate option.

elachlan’s picture

Version:7.x-1.13» 7.x-1.x-dev

If you re-roll the patch I will see about it's inclusion.

rj’s picture

Status:Needs work» Needs review
FileSize
2.36 KB
FAILED: [[SimpleTest]]: [MySQL] 27 pass(es), 1 fail(s), and 0 exception(s). View

See attached.

Status:Needs review» Needs work

The last submitted patch, extlink_apply_to_images-1857612-4.patch, failed testing.

rj’s picture

Status:Needs work» Needs review
FileSize
2.43 KB
PASSED: [[SimpleTest]]: [MySQL] 29 pass(es). View

This should be better.

Status:Needs review» Needs work

The last submitted patch, extlink_apply_to_images-1857612-6.patch, failed testing.

elachlan’s picture

Tests are failing at the moment. I am currently fixing it. Sorry!

rj’s picture

Yeah I saw it was coming from extlink.test, let me know when I should resubmit.

elachlan’s picture

Status:Needs work» Needs review
elachlan’s picture

Status:Needs review» Needs work

I might get you to re-roll once the changes in Issues #1329786: JS refactoring are completed.

elachlan’s picture

Status:Needs work» Needs review
FileSize
2.35 KB
PASSED: [[SimpleTest]]: [MySQL] 29 pass(es). View

Re-rolled the patch. Looks like it's working. Let me know what you think.

rj’s picture

Looks good!

elachlan’s picture

Status:Needs review» Patch (to be ported)

Committed to Git.

DamienMcKenna’s picture

Version:7.x-1.x-dev» 8.x-1.x-dev
Issue summary:View changes

Moving to the correct branch.

elachlan’s picture

I believe the new setting wasn't added to extlink.settings.yml

Its in all other places.