PageSourceSearch

https://www.fhcm.paris/themes/custom/fhcm/js/anchors.js?v=10.6.17

js fhcm.paris collected 2026-09-24 17:18:36 UTC 2,768 bytes, 80 lines download raw bytes

1(function ($, Drupal) {
2  Drupal.behaviors.ecTheme = {
3    attach: function (context) {
4
5      // //add anchor to anchored links
6      // $('a').not('.processed').each(function() {
7      //   if($(this).data('anchor')) {
8      //     $(this).addClass('processed')
9      //     var anchored = $(this).attr('href') + $(this).data('anchor')
10      //     console.log(anchored)
11      //     $(this).attr('href', anchored)
12      //   }
13      // })
14
15      //add anchor names display toggle
16      $('.tabs.primary').not('.processed').each(function() {
17        window.anchorShown = true;
18        $(this).addClass('processed')
19        $(this).append('<li><a class="toggle-anchors" href="#">Ancres</a></li>');
20        $('.toggle-anchors').on('click', function(e) {
21          e.preventDefault()
22          window.anchorShown = !window.anchorShown
23        if(window.anchorShown) {
24            $('.anchor-name').remove()
25          } else {
26            $('.widget').not('.widget--cols').each(function() {
27              var el = $(this)
28              var anchorName = '<div class="anchor-name"><span class="value">#' + el.attr('id') + '</span><span class="done" style="display:none">Copié</span></div>'
29              if($('> .wrapper', el).length) {
30                $('> .wrapper', el).append(anchorName)
31              } else {
32                el.append(anchorName)
33              }
34              $('.anchor-name', el).on('click', function() {
35                var txt = $('.value', this).text()
36                var $temp = $('<input>');
37                $('body').append($temp);
38                $temp.val(txt).select();
39                document.execCommand("copy");
40                $temp.remove();
41                $('.done',this).show().delay(1000).fadeOut(600)
42              })
43            })
44          }
45        })
46      });
47
48      //
49      // $('.published.range').each(function() {
50      //   start = $('time', this).eq(0).html()
51      //   end = $('time', this).eq(1).html()
52      //   startEls = start.split(' ')
53      //   endEls = end.split(' ')
54      //
55      //   console.log (startEls)
56      //
57      //   if(startEls[2] == endEls[2]) { //remove same year
58      //     start = start.replace(startEls[2], '')
59      //   }
60      //
61      //   if(startEls[1] == endEls[1]) { //remove same month
62      //     start = start.replace(startEls[1], '')
63      //   }
64      //
65      //   $('time', this).eq(0).html(start)
66      //
67      // })
68      //
69      // //french date enhancement
70      // $('.date, .published time').each(function() {
71      //   value = $(this).html().replace(/<\!--.*?-->/g, "").replace(/(\r\n|\n|\r)/gm, "")
72      //   if(value.substr(0,2) == '1 ') {
73      //     $(this).html('1er ' + value.substr(2))
74      //   }
75      // })
76    }
77  }
78
79
80})(jQuery, Drupal);

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.