Been working on this for a couple hours and finally got it to work with the code below!
Now my next issue is how can I "whitelist" certain URLs to avoid the speedbump? Since the whitelist is just a few URLs and the normal URLs are many I may just have the whitelisted URLs point to a Kentico page (so using / instead of http://) and then re-direct that page to the http link.
SLIGHT EDIT HERE:
<script type="text/javascript">
jQuery(window).load(function() {
jQuery.expr[":"].external = function(a) {
return !a.href.match(/^mailto\:/) && !a.href.match(/^tel\:/) && a.hostname != location.hostname
};
// OPEN 3RD PARTY SITE IN NEW TAB/WINDOW
jQuery('#url_link').click(function() {
window.open(this.href);
return false;
});
// ADD BOOTSTRAP DATA-TOGGLE ATTRIBUTE TO THE LINKS
jQuery('a:external').attr('data-toggle', 'modal');
jQuery('a:external').attr('data-target', '#speedbump');
jQuery("a:external").addClass("ext_link");
jQuery(function() {
jQuery('a.ext_link').click(function() {
var url = jQuery(this).attr('href');
var title = jQuery(this).attr('title');
console.log(url);
jQuery('#url_link').attr('href', url);
jQuery('h3#speedbump-title').replaceWith('<h3 id="speedbump-title">' + title + '</h3>');
jQuery('#url_link').click(function() {
jQuery('#speedbump').modal('hide')
}); // DESTROY MODAL IF USER CONTINUES
});
});
});
</script>
<div aria-hidden="true" aria-labelledby="myModalLabel" class="modal" id="speedbump" role="dialog" tabindex="-1">
<div class="modal-content modal-dialog">
<div class="modal-header"><button class="close" data-dismiss="modal" type="button">×</button>
<h3 id="speedbump-title"> </h3>
</div>
<div class="modal-body">
<p class="strong"><span style="color: rgb(0, 0, 0);">You're leaving this website</span></p>
<p><span style="color: rgb(0, 0, 0);">When you click continue you will connect to another website which we do not own or operate.</span></p>
</div>
<div class="modal-footer"><a class="btn btn-primary" id="url_link">Continue</a><span style="color: rgb(0, 0, 0);"> </span><a class="btn" data-dismiss="modal" href="#"><span style="color: rgb(0, 0, 0);">Cancel</span></a></div>
</div>
</div>