Hi,

This could be a great module for a paranoid industry like ours (pharma). I have to ensure that all external links are made obvious to the reader and that they are reminded that we are not responsible for the content of a third party website.

So, I've tried to add such a message to pop up when the link is clicked on. My coding skills are pretty non-existant so you'll have to take the below with a pinch of salt but it does work...

$(function() {
  $('a[@href^=http]').not('[@href*=sharepoint]')
    .addClass('external-link')
    .click(function() {
      var agree = window.confirm('Please be aware that you are about to leave xyx.com to an external website hosted by a third party.\n\nxyz Ltd, abc Ltd, our sponsors and partners do not accept responsibility for content held within external websites linking to or from xyz.com. The content of any such website in no way represents the opinions of the xyx Ltd, abc Ltd, our sponsors or our partners.\n\nClick OK to visit the external website...');
      if (agree)
        window.location = this.href;

      return false;
    });
});

So, I can make all this happen manually but I don't really have the knowledge to make this fit nicely into the module as a whole. Ideally, it would be great to have an option in the admin section to turn on/off the warning dialog and a text box to enter the specific warning.

Cheers

Rick Lawson.

Comments

quicksketch’s picture

An interesting idea. I already felt dirty enough adding the "Open in New Window" option, this seems like yet another extreme annoyance that we'd be making easily enabled on sites. I'm not entirely closed to the suggestion, but I'd prefer to leave it out.

Steve Dondley’s picture

+1 for this. I'm working on a bank website that needs this feature to comply with government regs. Hopefully I can supply a patch to this.

jonahan’s picture

Hola. I needed to do something similar and after checking out many options got something that works. Perhaps it can be incorporated into External Links someday...

Anyhow, the deal is thus:

We needed to see if a link was external or not, and if external do a popup where they would see a disclaimer and then be able to hit "OK" or "Cancel"

Here's the code...

  $('a').filter(function() {
	    return this.hostname && this.hostname !== location.hostname;
	  })
	  .click(function () { 
		  var x=window.confirm('You are about to proceed to an offsite link.  Auglaize County has no control over the content of this site.  Click OK to proceed.');
			var val = false;
			if (x)
				val = true;
			else
				val = false;
			return val;
 
        });

More info here:
http://www.jonahan.com/content/jquery-external-link-disclaimer-alert-aka...

quicksketch’s picture

Status: Active » Fixed

This has been added by the contributed patch in #294843: Popup warning.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.