mirror of
https://github.com/10h30/trestle.git
synced 2026-06-05 15:09:35 +09:00
Simplified JS http/https external link code.
This commit is contained in:
@@ -18,7 +18,7 @@ jQuery(document).ready(function() {
|
||||
|
||||
// External Links
|
||||
var h = window.location.host.toLowerCase();
|
||||
jQuery('[href^="http://"],[href^="https://"]').not('[href*="' + h + '"]').addClass('external-link').attr("target", "_blank");
|
||||
jQuery('[href^="http"]').not('[href*="' + h + '"]').addClass('external-link').attr("target", "_blank");
|
||||
|
||||
// Add classes to different types of links
|
||||
jQuery('a[href^="mailto:"]').addClass('email-link');
|
||||
|
||||
Reference in New Issue
Block a user