PageSourceSearch

https://novbis.ru/sites/all/modules/extlink-6.x-1.11/extlink/extlink.js?o

js novbis.ru collected 2026-10-05 00:09:17 UTC 5,295 bytes, 123 lines download raw bytes

1var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
2if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
3{
4  let window = _____WB$wombat$assign$function_____("window");
5  let self = _____WB$wombat$assign$function_____("self");
6  let document = _____WB$wombat$assign$function_____("document");
7  let location = _____WB$wombat$assign$function_____("location");
8  let top = _____WB$wombat$assign$function_____("top");
9  let parent = _____WB$wombat$assign$function_____("parent");
10  let frames = _____WB$wombat$assign$function_____("frames");
11  let opener = _____WB$wombat$assign$function_____("opener");
12
13// $Id: extlink.js,v 1.4.2.12 2010/05/26 01:25:56 quicksketch Exp $
14(function ($) {
15
16function extlinkAttach(context) {
17  // Strip the host name down, removing ports, subdomains, or www.
18  var pattern = /^(([^\/:]+?\.)*)([^\.:]{4,})((\.[a-z]{1,4})*)(:[0-9]{1,5})?$/;
19  var host = window.location.host.replace(pattern, '$3$4');
20  var subdomain = window.location.host.replace(pattern, '$1');
21
22  // Determine what subdomains are considered internal.
23  if (Drupal.settings.extlink.extSubdomains) {
24    var subdomains = "([^/]*\\.)?";
25  }
26  else if (subdomain == 'www.' || subdomain == '') {
27    var subdomains = "(www\\.)?";
28  }
29  else {
30    var subdomains = subdomain.replace(".", "\\.");
31  }
32
33  // Build regular expressions that define an internal link.
34  var internal_link = new RegExp("^http?://" + subdomains + host, "i");
35
36  // Extra internal link matching.
37  var extInclude = false;
38  if (Drupal.settings.extlink.extInclude) {
39    extInclude = new RegExp(Drupal.settings.extlink.extInclude.replace(/\\/, '\\'));
40  }
41
42  // Extra external link matching.
43  var extExclude = false;
44  if (Drupal.settings.extlink.extExclude) {
45    extExclude = new RegExp(Drupal.settings.extlink.extExclude.replace(/\\/, '\\'));
46  }
47
48  // Find all links which are NOT internal and begin with http (as opposed
49  // to ftp://, javascript:, etc. other kinds of links.
50  // When operating on the 'this' variable, the host has been appended to
51  // all links by the browser, even local ones.
52  // In jQuery 1.1 and higher, we'd use a filter method here, but it is not
53  // available in jQuery 1.0 (Drupal 5 default).
54  var external_links = new Array();
55  var mailto_links = new Array();
56  $("a:not(." + Drupal.settings.extlink.extClass + ", ." + Drupal.settings.extlink.mailtoClass + ")", context).each(function(el) {
57    try {
58      var url = this.href.toLowerCase();
59      if (url.indexOf('http') == 0 && (!url.match(internal_link) || (extInclude && url.match(extInclude))) && !(extExclude && url.match(extExclude))) {
60        external_links.push(this);
61      }
62      else if (url.indexOf('mailto:') == 0) {
63        mailto_links.push(this);
64      }
65    }
66    // IE7 throws errors often when dealing with irregular links, such as:
67    // <a href="node/10"></a> Empty tags.
68    // <a href="#">example</a> User:pass syntax.
69    catch(error) {
70      return false;
71    }
72  });
73
74  if (Drupal.settings.extlink.extClass) {
75    // Apply the "ext" class to all links not containing images.
76    if (parseFloat($().jquery) < 1.2) {
77      $(external_links).not('[img]').addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>'); });
78    }
79    else {
80      $(external_links).not($(external_links).find('img').parents('a')).addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>'); });
81    }
82  }
83
84  if (Drupal.settings.extlink.mailtoClass) {
85    // Apply the "mailto" class to all mailto links not containing images.
86    if (parseFloat($().jquery) < 1.2) {
87      $(mailto_links).not('[img]').addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>'); });
88    }
89    else {
90      $(mailto_links).not($(mailto_links).find('img').parents('a')).addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>'); });
91    }
92  }
93
94  if (Drupal.settings.extlink.extTarget) {
95    // Apply the target attribute to all links.
96    $(external_links).attr('target', Drupal.settings.extlink.extTarget);
97  }
98
99  if (Drupal.settings.extlink.extAlert) {
100    // Add pop-up click-through dialog.
101    $(external_links).click(function(e) {
102     return confirm(Drupal.settings.extlink.extAlertText);
103    });
104  }
105
106  // Work around for Internet Explorer box model problems.
107  if (($.support && !($.support.boxModel === undefined) && !$.support.boxModel) || ($.browser.msie && parseInt($.browser.version) <= 7)) {
108    $('span.ext, span.mailto').css('display', 'inline-block');
109  }
110}
111
112Drupal.behaviors.extlink = function(context) {
113  extlinkAttach(context);
114}
115
116})(jQuery);
117
118
119}
120/*
121     */
122/*
123*/

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.