Browse Source

Don't count tildes.net links as external

merge-requests/14/head
Ivan Fonseca 7 years ago
parent
commit
fb4ca46e8f
No known key found for this signature in database GPG Key ID: 95A9C856EC788689
  1. 5
      tildes/static/js/behaviors/external-links-new-tabs.js

5
tildes/static/js/behaviors/external-links-new-tabs.js

@ -1,4 +1,7 @@
$.onmount('[data-js-external-links-new-tabs]', function() {
// Make all links in comment open in new tab
$(this).find('a[href^="http"]').attr('target', '_blank');
$(this).find(
'a[href^="http"]' + // Select external links
':not([href*="tildes.net"])' // But not links to tildes
).attr('target', '_blank');
});
Loading…
Cancel
Save