PageSourceSearch

https://iprev.df.gov.br/o/gdf-iprev-lf7_4-ce-theme/js/main.js?brow…=js&languageId=pt_BR&t=1783113546000

js iprev.df.gov.br collected 2026-09-30 04:11:10 UTC 7,797 bytes, 258 lines download raw bytes

1/*1783113544000*/
2/**
3 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 2.1 of the License, or (at your option)
8 * any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 */
15
16/* eslint-disable prefer-arrow-callback */
17
18AUI().ready(
19  /*
20    Esta função é carregada quando todo o HTML, não incluindo os portlets, é 
21    carregado.
22  */
23
24  function () {}
25);
26
27Liferay.Portlet.ready(
28  /*
29    Esta função é carregada após cada portlet na página.
30
31    portletId: o id do portlet atual
32    node: o objeto Alloy Node do portlet atual
33  */
34
35  function (_portletId, _node) {}
36);
37
38Liferay.on(
39  "allPortletsReady",
40
41  /*
42    Esta função é carregada quando tudo, incluindo os portlets, está na 
43    página.
44  */
45
46  function () {
47    //acessibilidade alto contraste
48    $("#checkboxAcessibilidade").change(function () {
49      if ($(this).is(":checked")) {
50        $("body").addClass("alto-contraste");
51        $(".info-contraste").text("Alto contraste ligado");
52      } else {
53        $("body").removeClass("alto-contraste");
54        $(".info-contraste").text("Alto contraste desligado");
55      }
56    });
57
58    //acessibilidade font-size
59
60    var accessibilityFontSize =
61      typeof accessibilityFontSize !== "undefined" ? accessibilityFontSize : 4;
62    var originalFontSizes = [];
63
64    // Store original font sizes of elements
65    $("h1, h2, h3, h4, h5, p, a, li").each(function (i, el) {
66      originalFontSizes.push({ el: el, value: $(this).css("font-size") });
67    });
68
69    // Handle font size change from the range input
70    $(document).on("input change", "#sizeFont", function () {
71      var value = $(this).val();
72      accessibilityFontSize = value;
73      adjustFontSize(value);
74      $.post(
75        "/",
76        { accessibility: 1, accessibility_font: value },
77        function (response) {
78          console.log(response);
79        }
80      );
81    });
82
83    // Function to adjust font sizes based on the given size value
84    function adjustFontSize(size) {
85      originalFontSizes.forEach(function (item) {
86        var newSize = parseFloat(item.value) * (size / 4);
87        $(item.el).css("font-size", newSize + "px");
88      });
89    }
90
91    // Initial setting of font size
92    adjustFontSize(accessibilityFontSize);
93
94    // Adicionar a data de atualização
95    // if (Liferay.lastModifiedDate) {
96    //   const parsingOpts = {
97    //     minimumIntegerDigits: 2,
98    //     useGrouping: false,
99    //   };
100    //   const getDateHour = (date) =>
101    //     date.getHours().toLocaleString("pt-BR", parsingOpts) +
102    //     "h" +
103    //     date.getMinutes().toLocaleString("pt-BR", parsingOpts);
104    //   const date = Liferay.lastModifiedDate;
105    //   const lastModifiedString =
106    //     "Atualizado em " +
107    //     date.toLocaleDateString("pt-BR") +
108    //     " às " +
109    //     getDateHour(date);
110    //   const lastModifiedHtml = `<div class="portlet">${lastModifiedString}</div>`;
111    //   $("#main-content > div > div:last-child > div > div:first-child").prepend(
112    //     lastModifiedHtml
113    //   );
114    // }
115
116    /* VLIBRAS */
117    if (window.VLibras) {
118      new window.VLibras.Widget('https://vlibras.gov.br/app');
119    } else {
120      console.warn('VLibras não está disponível');
121    }
122
123    /* ANIMAÇÃO DA ÂNCORA */
124    $("#content a[href*='#']:not([data-toggle='tab']").click(function (e) {
125      e.preventDefault();
126      var aid = $(this).attr("href");
127      $("html,body").animate({ scrollTop: $(aid).offset().top }, "slow");
128    });
129
130    $("a").each(function () {
131      if ($(this).attr("href") && $(this).attr("href").includes("/web/guest")) {
132        $(this).attr("href", $(this).attr("href").replace("/web/guest", ""));
133      }
134    });
135  }
136);
137
138$(document).ready(function () {
139  var hoverTimeout;
140  var closeTimeout;
141
142  function openDropdown(dropdown) {
143    hoverTimeout = setTimeout(function () {
144      $(".dropdown-toggle", dropdown).trigger("click");
145    }, 200);
146  }
147
148  function closeDropdown(dropdown) {
149    clearTimeout(hoverTimeout);
150    dropdown.find(".dropdown-menu").removeClass("show");
151  }
152
153  $(".dropdown[data-dropdown-action='hover']").mouseenter(function () {
154    openDropdown($(this));
155  });
156
157  $(".dropdown[data-dropdown-action='hover']").mouseleave(function () {
158    clearTimeout(hoverTimeout);
159  });
160
161  $(".dropdown[data-dropdown-action='hover']").mouseleave(function () {
162    var dropdown = $(this);
163    closeTimeout = setTimeout(function () {
164      if (!dropdown.is(":hover")) {
165        closeDropdown(dropdown);
166      }
167    }, 200);
168  });
169
170  $(".dropdown[data-dropdown-action='hover']").mouseleave(function () {
171    var dropdown = $(this);
172    var dropdownMenu = dropdown.find(".dropdown-menu");
173
174    clearTimeout(closeTimeout);
175    if (dropdownMenu.hasClass("show")) {
176      closeTimeout = setTimeout(function () {
177        $(document).trigger("click");
178      }, 200);
179    }
180  });
181
182  // Fechar o dropdown ao clicar em um link do menu (exceto se tiver submenu)
183  $(".dropdown[data-dropdown-action='hover'] .dropdown-menu a").on("click", function (e) {
184    var dropdown = $(this).closest(".dropdown[data-dropdown-action='hover']");
185    if (!$(this).hasClass("has-children")) {
186      closeDropdown(dropdown);
187    }
188    e.stopPropagation();
189  });
190
191  // Alternar visibilidade do submenu ao clicar no botão
192  $(".dropdown[data-dropdown-action='hover'] button.btn-dropchild").on("click", function (e) {
193    $(this).next("ul.dropdown-menu").toggle();
194    e.stopPropagation();
195    e.preventDefault();
196  });
197
198  // Comportamento de estilo do menu
199  $(".dropdown-menu-item, .dropdown").each(function () {
200    var dropdownMenu = $(this).children(".dropdown-menu");
201    var navLink = $(this).children("a.active, a.has-children");
202
203    dropdownMenu.hover(
204      function () {
205        navLink.addClass("blue-background");
206      },
207      function () {
208        navLink.removeClass("blue-background");
209      }
210    );
211  });
212});
213
214/* Disable SPA */
215Liferay.on("beforeNavigate", function (event) {
216  if (
217    event.path.indexOf("control_panel") !== -1 ||
218    (document.location.href.indexOf("control_panel") !== -1 &&
219      event.path.indexOf("control_panel") === -1)
220  ) {
221    document.location.href = event.path;
222  }
223  Liferay.lastModifiedDate = null;
224});
225
226// Liferay.on('beforeNavigate', function(event) {
227//     var url = new URL(event.path);
228//
229//     if (url.searchParams.has('p_l_back_url')) {
230//         url.searchParams.delete('p_l_back_url');
231//         event.path = url.toString();
232//     }
233// });
234
235Liferay.on("allPortletsReady", function (event) {
236  var url = new URL(window.location.href);
237
238  if (url.searchParams.has("p_l_back_url")) {
239    url.searchParams.delete("p_l_back_url");
240
241    window.history.replaceState(null, "", url.toString());
242  }
243  if (url.searchParams.has("p_l_back_url_title")) {
244    url.searchParams.delete("p_l_back_url_title");
245
246    window.history.replaceState(null, "", url.toString());
247  }
248});
249
250// JS que faz com que o comportamento da busca leve para o portal atual do iprev
251// Liferay.on("allPortletsReady", function() {
252//   $('#searchForm').submit(function(event) {
253//     event.preventDefault(); // Impede o envio padrão do formulário
254//     var searchTerm = $('#searchInput').val();
255//     var newUrl = 'https://www.iprev.df.gov.br/?s=' + encodeURIComponent(searchTerm);
256//     window.location.href = newUrl; // Redireciona para a nova URL com o termo de busca
257//   });
258// });

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.