PageSourceSearch

https://prema.coop/sites/default/files/js/js_vux1z-8LCJzGfx19Wy2rZIQnCu3QQV4X7PjjH3WKJLQ.js

js prema.coop collected 2026-10-06 10:56:24 UTC 29,637 bytes, 556 lines download raw bytes

1(function ($, undefined) {
2  'use strict';
3
4  /**
5   * << accessiBe widget behaviors >>
6   *
7   * @type {Drupal~behavior}
8   *
9   * @prop {Drupal~behaviorAttach} attach
10   *  Attach the accessiBe widget.
11   *
12   */
13  Drupal.behaviors.accessibe_widget = {
14    attach: function (context, settings) {
15      const
16        widget_config = settings.accessibe_widget.widget || {},
17        do_debug = settings.accessibe_widget.debug,
18        widget_defined = typeof acsbJS !== 'undefined'
19      ;
20      if (widget_defined) {
21        // Note that the init() method does not return anything.
22        acsbJS.init(widget_config);
23        console.info('accessiBe accessWidget has been loaded');
24      }
25      else {
26        console.warn('accessieBe accessWidget library not found');
27      }
28      if (do_debug) {
29        console.groupCollapsed('cwb_accessibe debugging info');
30        console.debug('widget configuration', widget_config);
31        if (widget_defined) {
32          console.trace('acsbJS', acsbJS);
33        }
34        console.groupEnd()
35      }
36    }
37  }
38})(jQuery);
39;
40/**
41* DO NOT EDIT THIS FILE.
42* See the following change record for more information,
43* https://www.drupal.org/node/2815083
44* @preserve
45**/
46(function ($, once) {
47  var deprecatedMessageSuffix = "is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the core/once library instead. See https://www.drupal.org/node/3158256";
48  var originalJQOnce = $.fn.once;
49  var originalJQRemoveOnce = $.fn.removeOnce;
50  $.fn.once = function jQueryOnce(id) {
51    Drupal.deprecationError({
52      message: "jQuery.once() ".concat(deprecatedMessageSuffix)
53    });
54    return originalJQOnce.apply(this, [id]);
55  };
56  $.fn.removeOnce = function jQueryRemoveOnce(id) {
57    Drupal.deprecationError({
58      message: "jQuery.removeOnce() ".concat(deprecatedMessageSuffix)
59    });
60    return originalJQRemoveOnce.apply(this, [id]);
61  };
62  var drupalOnce = once;
63  function augmentedOnce(id, selector, context) {
64    originalJQOnce.apply($(selector, context), [id]);
65    return drupalOnce(id, selector, context);
66  }
67  function remove(id, selector, context) {
68    originalJQRemoveOnce.apply($(selector, context), [id]);
69    return drupalOnce.remove(id, selector, context);
70  }
71  window.once = Object.assign(augmentedOnce, drupalOnce, {
72    remove: remove
73  });
74})(jQuery, once);;
75(function ($, Drupal, drupalSettings) {
76  Drupal.behaviors.mtToolTip = {
77    attach: function (context, settings) {
78      $(context).find('[data-toggle="tooltip"]').once('mtToolTipInit').tooltip();
79    }
80  };
81})(jQuery, Drupal, drupalSettings);
82;
83(function (factory) {
84    if (typeof define === 'function' && define.amd) {
85        // AMD
86        define(['jquery'], factory);
87    } else if (typeof exports === 'object') {
88        // CommonJS
89        factory(require('jquery'));
90    } else {
91        // Browser globals
92        factory(jQuery);
93    }
94}(function ($) {
95  var CountTo = function (element, options) {
96    this.$element = $(element);
97    this.options  = $.extend({}, CountTo.DEFAULTS, this.dataOptions(), options);
98    this.init();
99  };
100
101  CountTo.DEFAULTS = {
102    from: 0,               // the number the element should start at
103    to: 0,                 // the number the element should end at
104    speed: 1000,           // how long it should take to count between the target numbers
105    refreshInterval: 100,  // how often the element should be updated
106    decimals: 0,           // the number of decimal places to show
107    formatter: formatter,  // handler for formatting the value before rendering
108    onUpdate: null,        // callback method for every time the element is updated
109    onComplete: null       // callback method for when the element finishes updating
110  };
111
112  CountTo.prototype.init = function () {
113    this.value     = this.options.from;
114    this.loops     = Math.ceil(this.options.speed / this.options.refreshInterval);
115    this.loopCount = 0;
116    this.increment = (this.options.to - this.options.from) / this.loops;
117  };
118
119  CountTo.prototype.dataOptions = function () {
120    var options = {
121      from:            this.$element.data('from'),
122      to:              this.$element.data('to'),
123      speed:           this.$element.data('speed'),
124      refreshInterval: this.$element.data('refresh-interval'),
125      decimals:        this.$element.data('decimals')
126    };
127
128    var keys = Object.keys(options);
129
130    for (var i in keys) {
131      var key = keys[i];
132
133      if (typeof(options[key]) === 'undefined') {
134        delete options[key];
135      }
136    }
137
138    return options;
139  };
140
141  CountTo.prototype.update = function () {
142    this.value += this.increment;
143    this.loopCount++;
144
145    this.render();
146
147    if (typeof(this.options.onUpdate) == 'function') {
148      this.options.onUpdate.call(this.$element, this.value);
149    }
150
151    if (this.loopCount >= this.loops) {
152      clearInterval(this.interval);
153      this.value = this.options.to;
154
155      if (typeof(this.options.onComplete) == 'function') {
156        this.options.onComplete.call(this.$element, this.value);
157      }
158    }
159  };
160
161  CountTo.prototype.render = function () {
162    var formattedValue = this.options.formatter.call(this.$element, this.value, this.options);
163    this.$element.text(formattedValue);
164  };
165
166  CountTo.prototype.restart = function () {
167    this.stop();
168    this.init();
169    this.start();
170  };
171
172  CountTo.prototype.start = function () {
173    this.stop();
174    this.render();
175    this.interval = setInterval(this.update.bind(this), this.options.refreshInterval);
176  };
177
178  CountTo.prototype.stop = function () {
179    if (this.interval) {
180      clearInterval(this.interval);
181    }
182  };
183
184  CountTo.prototype.toggle = function () {
185    if (this.interval) {
186      this.stop();
187    } else {
188      this.start();
189    }
190  };
191
192  function formatter(value, options) {
193    return value.toFixed(options.decimals);
194  }
195
196  $.fn.countTo = function (option) {
197    return this.each(function () {
198      var $this   = $(this);
199      var data    = $this.data('countTo');
200      var init    = !data || typeof(option) === 'object';
201      var options = typeof(option) === 'object' ? option : {};
202      var method  = typeof(option) === 'string' ? option : 'start';
203
204      if (init) {
205        if (data) data.stop();
206        $this.data('countTo', data = new CountTo(this, options));
207      }
208
209      data[method].call(data);
210    });
211  };
212}));;
213/*!
214Waypoints - 4.0.1
215Copyright © 2011-2016 Caleb Troughton
216Licensed under the MIT license.
217https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
218*/
219!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 4,151 bytes, line 219
219this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.Context.refreshAll();for(var e in i)i[e].enabled=!0;return this},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,n.windowContext||(n.windowContext=!0,n.windowContext=new e(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s];if(null!==a.triggerPoint){var l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHe
219ight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=Math.floor(y+l-f),h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();;
220(function ($, Drupal, drupalSettings) {
221  Drupal.behaviors.mtCountTo = {
222    attach: function (context, settings) {
223      $(context).find('[data-to]').once('mtCountToInit').each(function() {
224        var stat_item = $(this);
225        var waypoints = stat_item.waypoint(function(direction) {
226          var animatedObject = $(this.element);
227            animatedObject.countTo();
228            this.destroy();
229          },{
230            offset: "90%"
231          });
232      });
233    }
234  };
235})(jQuery, Drupal, drupalSettings);
236;
237(function ($, Drupal, drupalSettings) {
238  Drupal.behaviors.inPageNav = {
239    attach: function (context, settings) {
240      $(context).find('.link--smooth-scroll').once('inPageNavInit').click(function(e) {
241        var adminHeight = parseInt($('body').css('paddingTop')) || 0;
242        var anchorDestination = this.hash;
243        e.preventDefault();
244        $('html, body').animate({
245          //scrollTop: $($(this).attr("href")).offset().top
246          scrollTop: $(anchorDestination).offset().top - drupalSettings.flashyplus.inPageNavigation.inPageNavigationOffset - adminHeight
247        }, 1000);
248        if (history.pushState) {
249          history.pushState(null, null, anchorDestination);
250        } else {
251          location.hash = anchorDestination;
252        }
253      });
254
255    }
256  };
257})(jQuery, Drupal, drupalSettings);
258;
259(function ($, Drupal, drupalSettings) {
260  Drupal.behaviors.inPageNavScrollspy = {
261    attach: function (context, settings) {
262      var target = $(".in-page-navigation").closest(".content").addClass("in-page-navigation-container");
263      $('body').addClass("in-page-navigation-active");
264      var toolbarHeight = parseInt($(context).find('body').css('paddingTop')) || 0;
265      $(context).find('body').scrollspy({
266        target: ".in-page-navigation-container",
267        offset: drupalSettings.flashyplus.inPageNavigation.inPageNavigationOffset + toolbarHeight + 1
268      });
269    }
270  };
271})(jQuery, Drupal, drupalSettings);
272;
273(function ($, undefined) {
274  $(document).ready(function () {
275    $('[data-toggle="popover"]').popover();
276  });
277})(jQuery);
278;
279/**
280 * @file
281 * External links js file.
282 */
283
284(function ($, Drupal, drupalSettings) {
285
286  'use strict';
287
288  Drupal.extlink = Drupal.extlink || {};
289
290  Drupal.extlink.attach = function (context, drupalSettings) {
291    if (typeof drupalSettings.data === 'undefined' || !drupalSettings.data.hasOwnProperty('extlink')) {
292      return;
293    }
294
295    // Define the jQuery method (either 'append' or 'prepend') of placing the
296    // icon, defaults to 'append'.
297    var extIconPlacement = 'append';
298    if (drupalSettings.data.extlink.extIconPlacement && drupalSettings.data.extlink.extIconPlacement != '0') {
299          extIconPlacement = drupalSettings.data.extlink.extIconPlacement;
300        }
301
302    // Strip the host name down, removing ports, subdomains, or www.
303    var pattern = /^(([^\/:]+?\.)*)([^\.:]{1,})((\.[a-z0-9]{1,253})*)(:[0-9]{1,5})?$/;
304    var host = window.location.host.replace(pattern, '$2$3$6');
305    var subdomain = window.location.host.replace(host, '');
306
307    // Determine what subdomains are considered internal.
308    var subdomains;
309    if (drupalSettings.data.extlink.extSubdomains) {
310      subdomains = '([^/]*\\.)?';
311    }
312    else if (subdomain === 'www.' || subdomain === '') {
313      subdomains = '(www\\.)?';
314    }
315    else {
316      subdomains = subdomain.replace('.', '\\.');
317    }
318
319    // Whitelisted domains.
320    var whitelistedDomains = false;
321    if (drupalSettings.data.extlink.whitelistedDomains) {
322      whitelistedDomains = [];
323      for (var i = 0; i < drupalSettings.data.extlink.whitelistedDomains.length; i++) {
324        whitelistedDomains.push(new RegExp('^https?:\\/\\/' + drupalSettings.data.extlink.whitelistedDomains[i].replace(/(\r\n|\n|\r)/gm,'') + '.*$', 'i'));
325      }
326    }
327
328    // Build regular expressions that define an internal link.
329    var internal_link = new RegExp('^https?://([^@]*@)?' + subdomains + host, 'i');
330
331    // Extra internal link matching.
332    var extInclude = false;
333    if (drupalSettings.data.extlink.extInclude) {
334      extInclude = new RegExp(drupalSettings.data.extlink.extInclude.replace(/\\/, '\\'), 'i');
335    }
336
337    // Extra external link matching.
338    var extExclude = false;
339    if (drupalSettings.data.extlink.extExclude) {
340      extExclude = new RegExp(drupalSettings.data.extlink.extExclude.replace(/\\/, '\\'), 'i');
341    }
342
343    // Extra external link CSS selector exclusion.
344    var extCssExclude = false;
345    if (drupalSettings.data.extlink.extCssExclude) {
346      extCssExclude = drupalSettings.data.extlink.extCssExclude;
347    }
348
349    // Extra external link CSS selector explicit.
350    var extCssExplicit = false;
351    if (drupalSettings.data.extlink.extCssExplicit) {
352      extCssExplicit = drupalSettings.data.extlink.extCssExplicit;
353    }
354
355    // Find all links which are NOT internal and begin with http as opposed
356    // to ftp://, javascript:, etc. other kinds of links.
357    // When operating on the 'this' variable, the host has been appended to
358    // all links by the browser, even local ones.
359    // In jQuery 1.1 and higher, we'd use a filter method here, but it is not
360    // available in jQuery 1.0 (Drupal 5 default).
361    var external_links = [];
362    var mailto_links = [];
363    $('a:not([data-extlink]), area:not([data-extlink])', context).each(function (el) {
364      try {
365        var url = '';
366        if (typeof this.href == 'string') {
367          url = this.href.toLowerCase();
368        }
369        // Handle SVG links (xlink:href).
370        else if (typeof this.href == 'object') {
371          url = this.href.baseVal;
372        }
373        if (url.indexOf('http') === 0
374          && ((!internal_link.test(url) && !(extExclude && extExclude.test(url))) || (extInclude && extInclude.test(url)))
375          && !(extCssExclude && $(this).is(extCssExclude))
376          && !(extCssExclude && $(this).parents(extCssExclude).length > 0)
377          && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) {
378          var match = false;
379          if (whitelistedDomains) {
380            for (var i = 0; i < whitelistedDomains.length; i++) {
381              if (whitelistedDomains[i].test(url)) {
382                match = true;
383                break;
384              }
385            }
386          }
387          if (!match) {
388            external_links.push(this);
389          }
390        }
391        // Do not include area tags with begin with mailto: (this prohibits
392        // icons from being added to image-maps).
393        else if (this.tagName !== 'AREA'
394          && url.indexOf('mailto:') === 0
395          && !(extCssExclude && $(this).parents(extCssExclude).length > 0)
396          && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) {
397          mailto_links.push(this);
398        }
399      }
400      // IE7 throws errors often when dealing with irregular links, such as:
401      // <a href="node/10"></a> Empty tags.
402      // <a href="http://user:[email protected]">example</a> User:pass syntax.
403      catch (error) {
404        return false;
405      }
406    });
407
408    if (drupalSettings.data.extlink.extClass !== '0' && drupalSettings.data.extlink.extClass !== '') {
409      Drupal.extlink.applyClassAndSpan(external_links, drupalSettings.data.extlink.extClass, extIconPlacement);
410    }
411
412    if (drupalSettings.data.extlink.mailtoClass !== '0' && drupalSettings.data.extlink.mailtoClass !== '') {
413      Drupal.extlink.applyClassAndSpan(mailto_links, drupalSettings.data.extlink.mailtoClass, extIconPlacement);
414    }
415
416    if (drupalSettings.data.extlink.extTarget) {
417      // Apply the target attribute to all links.
418      $(external_links).filter(function () {
419        // Filter out links with target set if option specified.
420        return !(drupalSettings.data.extlink.extTargetNoOverride && $(this).is('a[target]'));
421      }).attr({target: '_blank'});
422
423      // Add noopener rel attribute to combat phishing.
424      $(external_links).attr('rel', function (i, val) {
425        // If no rel attribute is present, create one with the value noopener.
426        if (val === null || typeof val === 'undefined') {
427          return 'noopener';
428        }
429        // Check to see if rel contains noopener. Add what doesn't exist.
430        if (val.indexOf('noopener') > -1) {
431          if (val.indexOf('noopener') === -1) {
432            return val + ' noopener';
433          }
434          // Noopener exists. Nothing needs to be added.
435          else {
436            return val;
437          }
438        }
439        // Else, append noopener to val.
440        else {
441          return val + ' noopener';
442        }
443      });
444    }
445
446    if (drupalSettings.data.extlink.extNofollow) {
447      $(external_links).attr('rel', function (i, val) {
448        // When the link does not have a rel attribute set it to 'nofollow'.
449        if (val === null || typeof val === 'undefined') {
450          return 'nofollow';
451        }
452        var target = 'nofollow';
453        // Change the target, if not overriding follow.
454        if (drupalSettings.data.extlink.extFollowNoOverride) {
455          target = 'follow';
456        }
457        if (val.indexOf(target) === -1) {
458          return val + ' nofollow';
459        }
460        return val;
461      });
462    }
463
464    if (drupalSettings.data.extlink.extNoreferrer) {
465      $(external_links).attr('rel', function (i, val) {
466        // When the link does not have a rel attribute set it to 'noreferrer'.
467        if (val === null || typeof val === 'undefined') {
468          return 'noreferrer';
469        }
470        if (val.indexOf('noreferrer') === -1) {
471          return val + ' noreferrer';
472        }
473        return val;
474      });
475    }
476
477    Drupal.extlink = Drupal.extlink || {};
478
479    // Set up default click function for the external links popup. This should be
480    // overridden by modules wanting to alter the popup.
481    Drupal.extlink.popupClickHandler = Drupal.extlink.popupClickHandler || function () {
482      if (drupalSettings.data.extlink.extAlert) {
483        return confirm(drupalSettings.data.extlink.extAlertText);
484      }
485    };
486
487    $(external_links).off("click.extlink");
488    $(external_links).on("click.extlink", function (e) {
489      return Drupal.extlink.popupClickHandler(e, this);
490    });
491  };
492
493  /**
494   * Apply a class and a trailing <span> to all links not containing images.
495   *
496   * @param {object[]} links
497   *   An array of DOM elements representing the links.
498   * @param {string} class_name
499   *   The class to apply to the links.
500   * @param {string} icon_placement
501   *   'append' or 'prepend' the icon to the link.
502   */
503  Drupal.extlink.applyClassAndSpan = function (links, class_name, icon_placement) {
504    var $links_to_process;
505    if (drupalSettings.data.extlink.extImgClass) {
506      $links_to_process = $(links);
507    }
508    else {
509      var links_with_images = $(links).find('img, svg').parents('a');
510      $links_to_process = $(links).not(links_with_images);
511    }
512
513    if (class_name !== '0') {
514      $links_to_process.addClass(class_name);
515    }
516
517    // Add data-extlink attribute.
518    $links_to_process.attr('data-extlink', '');
519
520    var i;
521    var length = $links_to_process.length;
522    for (i = 0; i < length; i++) {
523      var $link = $($links_to_process[i]);
524      if (drupalSettings.data.extlink.extUseFontAwesome) {
525        if (class_name === drupalSettings.data.extlink.mailtoClass) {
526          $link[icon_placement]('<span class="fa-' + class_name + ' extlink"><span class="' + drupalSettings.data.extlink.extFaMailtoClasses + '" aria-label="' + drupalSettings.data.extlink.mailtoLabel + '"></span></span>');
527        }
528        else {
529          $link[icon_placement]('<span class="fa-' + class_name + ' extlink"><span class="' + drupalSettings.data.extlink.extFaLinkClasses + '" aria-label="' + drupalSettings.data.extlink.extLabel + '"></span></span>');
530        }
531      }
532      else {
533        if (class_name === drupalSettings.data.extlink.mailtoClass) {
534          $link[icon_placement]('<svg focusable="false" class="' + class_name + '" role="img" aria-label="' + drupalSettings.data.extlink.mailtoLabel + '" xmlns="http://www.w3.org/2000/svg" viewBox="0 10 70 20"><metadata><sfw xmlns="http://ns.adobe.com/SaveForWeb/1.0/"><sliceSourceBounds y="-8160" x="-8165" width="16389" height="16384" bottomLeftOrigin="true"/><optimizationSettings><targetSettings targetSettingsID="0" fileFormat="PNG24Format"><PNG24Format transparency="true" filtered="false" interlaced="false" noMatteColor="false" matteColor="#FFFFFF"/></targetSettings></optimizationSettings></sfw></metadata><title>' + drupalSettings.data.extlink.mailtoLabel + '</title><path d="M56 14H8c-1.1 0-2 0.9-2 2v32c0 1.1 0.9 2 2 2h48c1.1 0 2-0.9 2-2V16C58 14.9 57.1 14 56 14zM50.5 18L32 33.4 13.5 18H50.5zM10 46V20.3l20.7 17.3C31.1 37.8 31.5 38 32 38s0.9-0.2 1.3-0.5L54 20.3V46H10z"/></svg>');
535        }
536        else {
537          $link[icon_placement]('<svg focusable="false" class="' + class_name + '" role="img" aria-label="' + drupalSettings.data.extlink.extLabel + '" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40"><metadata><sfw xmlns="http://ns.adobe.com/SaveForWeb/1.0/"><sliceSourceBounds y="-8160" x="-8165" width="16389" height="16384" bottomLeftOrigin="true"/><optimizationSettings><targetSettings targetSettingsID="0" fileFormat="PNG24Format"><PNG24Format transparency="true" filtered="false" interlaced="false" noMatteColor="false" matteColor="#FFFFFF"/></targetSettings></optimizationSettings></sfw></metadata><title>' + drupalSettings.data.extlink.extLabel + '</title><path d="M48 26c-1.1 0-2 0.9-2 2v26H10V18h26c1.1 0 2-0.9 2-2s-0.9-2-2-2H8c-1.1 0-2 0.9-2 2v40c0 1.1 0.9 2 2 2h40c1.1 0 2-0.9 2-2V28C50 26.9 49.1 26 48 26z"/><path d="M56 6H44c-1.1 0-2 0.9-2 2s0.9 2 2 2h7.2L30.6 30.6c-0.8 0.8-0.8 2 0 2.8C31 33.8 31.5 34 32 34s1-0.2 1.4-0.6L54 12.8V20c0 1.1 0.9 2 2 2s2-0.9 2-2V8C58 6.9 57.1 6 56 6z"/></svg>');
538        }
539      }
540    }
541  };
542
543  Drupal.behaviors.extlink = Drupal.behaviors.extlink || {};
544  Drupal.behaviors.extlink.attach = function (context, drupalSettings) {
545    // Backwards compatibility, for the benefit of modules overriding extlink
546    // functionality by defining an "extlinkAttach" global function.
547    if (typeof extlinkAttach === 'function') {
548      extlinkAttach(context);
549    }
550    else {
551      Drupal.extlink.attach(context, drupalSettings);
552    }
553  };
554
555})(jQuery, Drupal, drupalSettings);
556;

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.