PageSourceSearch

https://n-e-f.org/templates/nef/js/template.js?1678c9

js n-e-f.org collected 2026-10-02 06:37:38 UTC 4,239 bytes, 119 lines download raw bytes

1/**
2 * @package     Joomla.Site
3 * @subpackage  Templates.Cassiopeia
4 * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
5 * @license     GNU General Public License version 2 or later; see LICENSE.txt
6 * @since       4.0.0
7 */
8
9Joomla = window.Joomla || {};
10
11(function(Joomla, document) {
12  'use strict';
13
14  function initTemplate(event) {
15    var target = event && event.target ? event.target : document;
16
17    /**
18     * Prevent clicks on buttons within a disabled fieldset
19     */
20    var fieldsets = target.querySelectorAll('fieldset.btn-group');
21    for (var i = 0; i < fieldsets.length; i++) {
22      var self = fieldsets[i];
23      if (self.getAttribute('disabled') ===  true) {
24        self.style.pointerEvents = 'none';
25        var btns = self.querySelectorAll('.btn');
26        for (var ib = 0; ib < btns.length; ib++) {
27          btns[ib].classList.add('disabled');
28        }
29      }
30    }
31
32
33    let modals = [].slice.call(document.querySelectorAll('[data-bs-toggle="modal"]'));
34    modals.map(function(modal){
35      let modalItem = modal.getAttribute('href');
36      let myModalEl =document.getElementById(modalItem.replace("#", ''));
37      myModalEl.addEventListener('hidden.bs.modal', function (event) {
38        let iframe = myModalEl.querySelector('iframe');
39        iframe.setAttribute('src', iframe.getAttribute('src'));
40      })
41    })
42
43    /**
44     * Enable tooltips
45     */
46
47    var tooltipTriggerList = [].slice.call(document.querySelectorAll('[role="tooltip"]'))
48
49    var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
50    //   $(tooltipTriggerEl).parent().add('title', jQuery(tooltipTriggerEl).html()).add("data-bs-html","true").add('data-bs-toggle',"tooltip")
51      $(tooltipTriggerEl).remove();
52    })
53    // var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
54    //   return new bootstrap.Tooltip(tooltipTriggerEl)
55    // })
56
57    var icons = [].slice.call(document.querySelectorAll('[class="icon-edit"]'))
58    var iconsList = icons.map(function (iconEL) {
59      $(iconEL).removeClass('icon-edit').removeAttr('aria-hidden').html("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-pencil-square\" viewBox=\"0 0 16 16\">\n" +
60          "  <path d=\"M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z\"/>\n" +
61          "  <path fill-rule=\"evenodd\" d=\"M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z\"/>\n" +
62          "</svg>");
63    })
64  }
65
66  document.addEventListener('DOMContentLoaded', function (event) {
67    initTemplate(event);
68
69    /**
70     * Back to top
71     */
72    var backToTop = document.getElementById('back-top');
73
74    if (backToTop) {
75
76      function checkScrollPos() {
77        if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
78          backToTop.classList.add('visible');
79        } else {
80          backToTop.classList.remove('visible')
81        }
82      }
83
84      checkScrollPos();
85
86      window.onscroll = function() {
87        checkScrollPos();
88      };
89
90      backToTop.addEventListener('click', function(event) {
91        event.preventDefault();
92        window.scrollTo(0, 0);
93      });
94    }
95
96    [].slice.call(document.head.querySelectorAll('link[rel="lazy-stylesheet"]'))
97      .forEach(function($link){
98        $link.rel = "stylesheet";
99      });
100  });
101
102  /**
103   * Initialize when a part of the page was updated
104   */
105  document.addEventListener('joomla:updated', initTemplate);
106
107  // auto display the popup
108  if(window.location.hash){
109    var popupID = window.location.hash.replace('#', '');
110    if(document.getElementById(popupID) &&  $(window.location.hash).hasClass('modal')){
111      $(window.location.hash).modal('show');
112      $(window.location.hash).on('hidden.bs.modal', function (e) {
113        history.pushState('', document.title, window.location.pathname + window.location.search);
114        location.reload();
115      })
116    }
117  }
118
119})(Joomla, document);

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.