1/** 2* 3* @package External Links Open in New Window 4* @copyright (c) 2014 RMcGirr83 5* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 6* 7*/ 8 9(function($) { // Avoid conflicts with other libraries 10 11 'use strict'; 12 13 var removeSubdomain = function (a,b){return a.split(".").slice(-(b||2)).join(".")}; 14 15 var source=removeSubdomain(location.hostname); 16 var IgnoreClasses = [ 17 'posterip', 18 'share-button', 19 'fancybox', 20 'lightbox', 21 'colorbox' 22 ]; 23 var NotInClass = true; 24 25 /** 26 * DOM READY 27 */ 28 $(function() { 29 30 $('a[href^="http://"], a[href^="https://"], a[href^="ftp://"]').filter(function(){ 31 if ($(this).parents($("div")).is('.content, .signature') && this.hostname&&removeSubdomain(this.hostname)!==source) 32 { 33 $(this).attr("title", elonw_title).addClass("elonw"); 34 } 35 }); 36 37 $(document).on('click',('a[href^="http://"], a[href^="https://"], a[href^="ftp://"]'), function() { 38 if ($(this).attr('class') !== undefined) 39 { 40 var ClassList = $(this).attr('class').split(/\s+/); 41 $(ClassList).each(function() { 42 if($.inArray(this, IgnoreClasses) !== -1) 43 { 44 NotInClass = false; 45 } 46 }); 47 } 48 if ($(this).attr('onclick') !== undefined) 49 { 50 NotInClass = false; 51 } 52 var href = $(this).attr('href'); 53 if(this.hostname && removeSubdomain(this.hostname)!==source && NotInClass) 54 { 55 window.open(href, '_blank', 'noreferrer, noopener'); 56 return false; 57 } 58 }); 59 60 $('.forum_link').each(function(){ 61 var href = $(this).attr('href'); 62 if (this.hostname && removeSubdomain(this.hostname)!==source) 63 { 64 $(this).attr("onclick","window.open(this.href);return false;").attr("rel", "nofollow, noreferrer, noopener"); 65 } 66 }); 67 68 }); 69 70})(jQuery); // Avoid conflicts with other libraries
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.