PageSourceSearch

https://secretariageneral.gov.co/themes/custom/secretaria_general/js/custom.js?tm37ef

js secretariageneral.gov.co collected 2026-10-01 12:25:03 UTC 5,367 bytes, 178 lines download raw bytes

1/**
2 * @file
3 * Global utilities.
4 *
5 */
6(function ($, Drupal) {
7  "use strict";
8
9  var $sede_electronica_sg = (function () {
10    return {
11      scrollTopPage: function () {
12        $('.scroll-to-top').click(function () {
13          $('html, body').animate({ scrollTop: 0 }, "slow");
14          return false;
15        });
16
17        $('.scroll-to-top').hover(
18          function () {
19            $(this).addClass("active");
20          }, function () {
21            $(this).removeClass("active");
22          }
23        )
24
25        $('.scroll-to-top button').focus(function () {
26          $(this).parent().addClass("active");
27        });
28
29        $('.scroll-to-top button').click(function () {
30          $(this).parent().removeClass("active");
31          $('#contrast-func').focus();
32        });
33
34      },
35      accesibilityMenu: function () {
36        $('#navbarSupportedContent > ul > li > a').focus(function () {
37          $('#navbarSupportedContent > ul > li').removeClass('force-show');
38          $(this).parent().addClass('force-show');
39        });
40
41        $(document).click(function () {
42          $('#navbarSupportedContent > ul > li').removeClass('force-show');
43        });
44      },
45    }
46  }());
47
48  $sede_electronica_sg.scrollTopPage();
49  $sede_electronica_sg.accesibilityMenu();
50
51  $(window).scroll(function () {
52    var scroll = $(window).scrollTop();
53    if (scroll > 600) {
54      $(".scroll-to-top").fadeIn();
55    } else {
56      $(".scroll-to-top").fadeOut();
57    }
58  });
59
60  Drupal.behaviors.secretaria_general = {
61    attach: function () {
62      $('#cboxPrevious').attr("aria-label", "Previous").html("Anterior");
63      $('#cboxNext').attr("aria-label", "cboxNext").html("Siguiente");
64      $('#cboxSlideshow').attr("aria-label", "cboxSlideshow").html("Slide");
65
66      // Accesibility functions
67      var contrast_on = false; // Flag for identify status of contrast
68      var classes = ["f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10"];
69      var classIndex = 5;
70
71      $("#contrast-func").click(function () {
72        togleContrast();
73      });
74
75      /**
76       * Add or remove high contrast class to html on event click
77       * over element with id contrast-funct (block accesibility)
78       */
79      function togleContrast() {
80        if (contrast_on) {
81          $("html").removeClass("hight-contrast");
82          contrast_on = false;
83        } else {
84          $("html").addClass("hight-contrast");
85          contrast_on = true;
86        }
87      }
88
89      $("#font-less-func").click(function () {
90        let previousClass = classIndex;
91        classIndex--;
92        classIndex = classIndex < 0 ? 0 : classIndex;
93        changeClass(previousClass, classIndex);
94      });
95
96      $("#font-plus-func").click(function () {
97        let previousClass = classIndex;
98        classIndex++;
99        classIndex =
100          classIndex == classes.length ? classes.length - 1 : classIndex;
101        changeClass(previousClass, classIndex);
102      });
103
104      function changeClass(previous, next) {
105        if (previous != next) {
106          var htmlElement = $("html");
107          htmlElement.removeClass(classes[previous]);
108          htmlElement.addClass(classes[next]);
109        }
110      }
111    },
112  };
113
114  /*videos home*/
115  $( document ).ready(function() {
116    /*condicion de validación de la existencia del componente*/
117    if(document.querySelector(".view-videos-inicio")){
118        /*selector del contenedor*/
119        var contenido = document.querySelector(".view-videos-inicio");
120        /*selector de las slide*/
121        var slide = contenido.querySelectorAll(".slide");
122        for(var i = 0; i < slide.length; i++){
123          /*selector de las imagenes dentro de cada slide*/
124          var imagen = slide[i].querySelectorAll("img");
125          for(var j = 0; j< imagen.length; j++){
126            /*Asignación de alt*/
127            imagen[j].alt=slide[i].innerText;
128          }
129        }
130    }
131  });
132
133 /*inicio desarrollo menú */
134 $(document).ready(function($) {
135  var tgItem = document.getElementById("toggle-expand");
136  tgItem.parentElement.innerHTML="";
137  var menu = document.querySelector(".menuppal");
138  var dropdown = menu.querySelectorAll(".dropdown");
139  
140  for(var i = 0; i < dropdown.length; i++){                
141    // if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {              
142        if($(dropdown[i].children[0]).hasClass('dropdown-item')){
143          //$(dropdown[i].children[0]).removeAttr('href');
144        }
145    // }
146      $(dropdown[i]).on('touchstart mouseenter', function(e){
147        for(var i=0; i< this.children.length; i++){
148              $(this.children[i]).toggleClass('show');
149        }
150
151      });
152      $(dropdown[i]).on('touchstart mouseleave', function(e){
153            for(var i=0; i< this.children.length; i++){
154                  $(this.children[i]).toggleClass('show');
155            }
156      });
157  } 
158});
159
160
161  //organigrama
162  if (jQuery(window).width() < 570) {
163    jQuery(".move").detach().appendTo(jQuery(".container-move"));
164  }
165  else {
166    jQuery(".move").detach().appendTo(jQuery(".container-static"));
167  }
168  jQuery(window).resize(function () {
169    if (jQuery(window).width() < 570) {
170      jQuery(".move").detach().appendTo(jQuery(".container-move"));
171    }
172    else {
173      jQuery(".move").detach().appendTo(jQuery(".container-static"));
174    }
175  });
176
177
178})(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.