PageSourceSearch

https://www.neuchatelville.ch/typo3temp/assets/compressed/LinkHand…b7a441e05476f0da8c0a696ae0bc0.js?1783607210

js neuchatelville.ch collected 2026-10-02 05:13:42 UTC 1,184 bytes, 36 lines download raw bytes

1/**
2 * LinkHandler
3 *
4 * Forçage de l'ouverture des liens externes et des liens vers des fichiers dans un nouvel onglet (UX)
5 */
6(function ($) {
7    $.fn.LinkHandler = function (options) {
8        var opts = $.extend({}, $.fn.LinkHandler.defaults, options);
9    };
10
11    var host = window.location.hostname;
12
13    // Tous les liens externes: ouverture forcée dans un nouvel onglet, sauf pour les liens du même domaine
14    // au cas où il y a un mix de pages https et http sur le même site
15    $('a[href^="http://"]')
16        .not('a[href^="http://' + host + '"]')
17        .not('a[href^="https://' + host + '"]')
18        .attr('target', '_blank');
19
20    $('a[href^="https://"]')
21        .not('a[href^="http://' + host + '"]')
22        .not('a[href^="https://' + host + '"]')
23        .attr('target', '_blank');
24
25    var filetypes = /\.(jpg|jpeg|gif|tiff|zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i;
26
27    // Pour tous les liens vers des fichiers: ouverture dans un nouvel onglet
28    $('a').each(function () {
29        var match = this.href.match(filetypes);
30
31        if (match) {
32            $(this).attr('target', '_blank');
33        }
34    });
35
36}(jQuery));

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.