https://www.beethovenfm.cl/htdocs/content/themes/uc-radio-beethoven/dist/js/custom.min.js?ver=4.0.15
vendor: 3,595 bytes, lines 1-88
1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40/******/ } 41/******/ }; 42/******/ 43/******/ // define __esModule on exports 44/******/ __webpack_require__.r = function(exports) { 45/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47/******/ } 48/******/ Object.defineProperty(exports, '__esModule', { value: true }); 49/******/ }; 50/******/ 51/******/ // create a fake namespace object 52/******/ // mode & 1: value is a module id, require it 53/******/ // mode & 2: merge all properties of value into the ns 54/******/ // mode & 4: return value when already ns object 55/******/ // mode & 8|1: behave like require 56/******/ __webpack_require__.t = function(value, mode) { 57/******/ if(mode & 1) value = __webpack_require__(value); 58/******/ if(mode & 8) return value; 59/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60/******/ var ns = Object.create(null); 61/******/ __webpack_require__.r(ns); 62/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64/******/ return ns; 65/******/ }; 66/******/ 67/******/ // getDefaultExport function for compatibility with non-harmony modules 68/******/ __webpack_require__.n = function(module) { 69/******/ var getter = module && module.__esModule ? 70/******/ function getDefault() { return module['default']; } : 71/******/ function getModuleExports() { return module; }; 72/******/ __webpack_require__.d(getter, 'a', getter); 73/******/ return getter; 74/******/ }; 75/******/ 76/******/ // Object.prototype.hasOwnProperty.call 77/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78/******/ 79/******/ // __webpack_public_path__ 80/******/ __webpack_require__.p = "/"; 81/******/ 82/******/ 83/******/ // Load entry module and return exports 84/******/ return __webpack_require__(__webpack_require__.s = 2); 85/******/ }) 86/************************************************************************/ 87/******/ ({ 88
89/***/ "./assets/js/custom.js": 90/*!*****************************!*\ 91 !*** ./assets/js/custom.js ***! 92 \*****************************/ 93/*! no exports provided */ 94/***/ (function(module, __webpack_exports__, __webpack_require__) { 95 96"use strict"; 97__webpack_require__.r(__webpack_exports__); 98/* harmony import */ var _kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./kit */ "./assets/js/kit.js"); 99 100function startOfWeek() { 101 var date = new Date(); 102 var diff = date.getDate() - date.getDay() + (date.getDay() === 0 ? -6 : 1); 103 return new Date(date.setDate(diff)); 104} 105function addDays(dateObj, numDays) { 106 dateObj.setDate(dateObj.getDate() + numDays); 107 return dateObj; 108} 109function DisableDates(date) { 110 var string = $.datepicker.formatDate('dd/mm/yy', date); 111 return [dates.indexOf(string) == -1]; 112} 113$(function () { 114 setUpCalendars(); 115 $('#tipo-evento').change(function () { 116 console.log('tipo-evento change'); 117 getEvents('', $(this).val()); 118 }); 119 $('#tipo-podcast').change(function () { 120 getPodcasts('', $(this).val(), ''); 121 }); 122 $('#search-events-btn').on('click', function (e) { 123 e.preventDefault(); 124 var s_str = $('#search-event').val(); 125 if (s_str !== '') { 126 window.history.pushState(null, null, window.location.pathname); 127 getEvents(s_str, 'all'); 128 } 129 }); 130 $('#search-podcast-btn').on('click', function (e) { 131 e.preventDefault(); 132 var s_str = $('#search-podcast').val(); 133 if (s_str !== '') { 134 window.history.pushState(null, null, window.location.pathname); 135 getPodcasts(s_str, 'all', ''); 136 } 137 }); 138 $('#search-post-btn').on('click', function (e) { 139 e.preventDefault(); 140 var s_str = $('#search-post').val(); 141 if (s_str !== '') { 142 window.history.pushState(null, null, window.location.pathname); 143 getEntries('all', s_str); 144 } 145 }); 146 $('#search-btn').on('click', function (e) { 147 e.preventDefault(); 148 var s_str = $('#search-field').val(); 149 if (s_str !== '') { 150 getSearch(s_str); 151 } 152 }); 153 $('.tag-event').on('click', function (e) { 154 if (window.location.pathname != '/') { 155 e.preventDefault(); 156 window.history.pushState(null, null, window.location.pathname); 157 var id_cat = $(this).data('id'); 158 triggerSelect('tipo-evento', id_cat); 159 } 160 }); 161 $('.tag-post').on('click', function (e) { 162 if (window.location.pathname != '/') { 163 e.preventDefault(); 164 window.history.pushState(null, null, window.location.pathname); 165 var id_cat = $(this).data('id'); 166 triggerSelect('category', id_cat); 167 } 168 }); 169 $('#category').change(function () { 170 getEntries($(this).val(), ''); 171 }); 172 $("#datepicker-podcast").datepicker({ 173 dateFormat: 'dd/mm/yy', 174 firstDay: 1, 175 //minDate: '-1y', 176 max_date: '0', 177 onSelect: function onSelect(date) { 178 console.log('onselect DATE podcast', date); 179 getPodcasts('', 'all', date); 180 } 181 }, $.datepicker.regional['es']); 182 $(window).keydown(function (event) { 183 if (event.keyCode == 13) { 184 event.preventDefault(); 185 return false; 186 } 187 }); 188}); 189$(document).ready(function () { 190 formatInputs(); 191 checkCatAndTriggerEvent(); 192 193 /*const date = $('#datepicker-podcast').val(); 194 const select = $('#tipo-podcast').val(); 195 const text = $('#search-podcast').val(); 196 const button = $('#search-podcast-btn') 197 if (date != '' || select != "all" || date != "" || text != '') { 198 button.trigger('click') 199 console.log("doy click") 200 }*/ 201}); 202 203$(document).bind('gform_confirmation_loaded', function (event, formId) { 204 if ([3].includes(formId) && $('#bajada_form_contact').length > 0) { 205 $('#bajada_form_contact').hide(); 206 } 207}); 208function checkCatAndTriggerEvent() { 209 var urlParams = new URLSearchParams(window.location.search); 210 if (urlParams.has('cat')) { 211 var id_cat = urlParams.get('cat'); 212 window.history.pushState(null, null, window.location.pathname); 213 if ($('#tipo-evento').length > 0) { 214 triggerSelect('tipo-evento', id_cat); 215 } 216 if ($('#tipo-podcast').length > 0) { 217 triggerSelect('tipo-podcast', id_cat); 218 } 219 if ($('#tipo-podcast').length > 0) { 220 triggerSelect('tipo-podcast', id_cat); 221 } 222 if ($('#category').length > 0) { 223 triggerSelect('category', id_cat); 224 } 225 } 226} 227function triggerSelect(id_select, id_cat) { 228 $('#' + id_select).val(id_cat); 229 $('#' + id_select).trigger('change'); 230} 231function getProgramming(date) { 232 $.ajax({ 233 url: themosis.ajaxurl, 234 // Global access to the WordPress ajax handler file 235 type: 'POST', 236 dataType: 'json', 237 data: { 238 action: 'get_programming', 239 // Your custom hook/action name 240 security: themosis.nonce, 241 // A nonce value defined by the user with the "add-posts" action 242 date: date 243 }, 244 success: function success(response) { 245 $("#programming-div").html(response.data); 246 new _kit__WEBPACK_IMPORTED_MODULE_0__["Accordion"](); 247 } 248 }); 249} 250function setUpCalendars() { 251 var dates = []; 252 $.ajax({ 253 url: themosis.ajaxurl, 254 // Global access to the WordPress ajax handler file 255 type: 'POST', 256 dataType: 'json', 257 data: { 258 action: 'get_programming_dates', 259 // Your custom hook/action name 260 security: themosis.nonce // A nonce value defined by the user with the "add-posts" action 261 }, 262 263 success: function success(response) { 264 dates = response.data; 265 266 // Datepicker 267 $("#datepicker-new").datepicker({ 268 dateFormat: 'dd/mm/yy', 269 firstDay: 1, 270 beforeShowDay: function beforeShowDay(date) { 271 //Show only available 272 var string = $.datepicker.formatDate('yy-mm-dd', date); 273 if ($.inArray(string, dates) !== -1) { 274 return [true, "", "Available"]; 275 } else { 276 return [false, "", "unAvailable"]; 277 } 278 }, 279 // minDate: min_date, 280 // max_date: '+1w', 281 onSelect: function onSelect(date) { 282 getProgramming(date); 283 } 284 }, $.datepicker.regional['es']); 285 $("#datepicker-mobile-new").datepicker({ 286 dateFormat: 'dd/mm/yy', 287 firstDay: 1, 288 beforeShowDay: function beforeShowDay(date) { 289 //Show only available 290 var string = $.datepicker.formatDate('yy-mm-dd', date); 291 if ($.inArray(string, dates) !== -1) { 292 return [true, "", "Available"]; 293 } else { 294 return [false, "", "unAvailable"]; 295 } 296 }, 297 onSelect: function onSelect(date) { 298 getProgramming(date);
299 $('#modal-calendar').modal('hide'); 300 } 301 }, $.datepicker.regional['es']); 302 } 303 }); 304} 305function getEvents(s, category) { 306 var destacados = []; 307 var hiddens = $("form#search-events").find('input:hidden'); 308 hiddens.each(function () { 309 destacados.push(parseInt($(this).val())); 310 }); 311 var urlParams = new URLSearchParams(window.location.search); 312 $.ajax({ 313 url: themosis.ajaxurl, 314 // Global access to the WordPress ajax handler file 315 type: 'POST', 316 dataType: 'json', 317 data: { 318 action: 'get_events', 319 // Your custom hook/action name 320 security: themosis.nonce, 321 // A nonce value defined by the user with the "add-posts" action 322 destacado: destacados, 323 search: s === undefined ? '' : s, 324 category: category, 325 pag: urlParams.has('pag') ? urlParams.get('pag') : 1 326 }, 327 success: function success(response) { 328 $("#list-events").html(response.data); 329 } 330 }); 331} 332function getPodcasts(s, category, date) { 333 var urlParams = new URLSearchParams(window.location.search); 334 335 // Obtén los valores de los campos 336 var text = $('#search-podcast').val(); 337 var select = $('#tipo-podcast').val(); 338 var fecha = $('#datepicker-podcast').val(); 339 340 // Obtiene la URL actual del enlace 341 var currentUrl = window.location.href; 342 343 // Parsea la URL actual para manejar los parámetros existentes 344 var url = new URL(currentUrl); 345 346 // Obtiene los parámetros existentes 347 var params = new URLSearchParams(url.search); 348 349 // Agrega parámetros adicionales según los valores de los campos 350 if (text !== "") { 351 params.set("text", text); 352 } else { 353 // Elimina el parámetro si no hay valor 354 params["delete"]("text"); 355 } 356 if (select !== "") { 357 params.set("cate", select); 358 } else { 359 // Elimina el parámetro si no hay valor 360 params["delete"]("cate"); 361 } 362 if (date !== "") { 363 params.set("date", date); 364 } else { 365 // Elimina el parámetro si no hay valor 366 params["delete"]("date"); 367 } 368 params["delete"]("pag"); 369 370 // Actualiza la URL con los nuevos parámetros 371 url.search = params.toString(); 372 373 // Obtén la URL actualizada 374 var newUrl = url.toString(); 375 376 // Realiza la redirección a la nueva URL 377 window.location.href = newUrl; 378 379 /* $.ajax({ 380 url: themosis.ajaxurl, // Global access to the WordPress ajax handler file 381 type: 'POST', 382 dataType: 'json', 383 data: { 384 action: 'get_podcasts', // Your custom hook/action name 385 security: themosis.nonce, // A nonce value defined by the user with the "add-posts" action 386 search: s === undefined ? '' : s, 387 date: date === undefined ? '' : date, 388 category: category, 389 pag: urlParams.has('pag') ? urlParams.get('pag') : 1, 390 select : select, 391 text : text, 392 fecha : fecha 393 }, 394 success : function( response ) { 395 $("#list-podcasts").html(response.data); 396 } 397 });*/ 398} 399 400function getEntries(category, s, type) { 401 var urlParams = new URLSearchParams(window.location.search); 402 $.ajax({ 403 url: themosis.ajaxurl, 404 // Global access to the WordPress ajax handler file 405 type: 'POST', 406 dataType: 'json', 407 data: { 408 action: 'get_entries', 409 // Your custom hook/action name 410 security: themosis.nonce, 411 // A nonce value defined by the user with the "add-posts" action 412 category: category, 413 type: type === undefined ? '' : type, 414 search: s === undefined ? '' : s, 415 pag: urlParams.has('pag') ? urlParams.get('pag') : 1 416 }, 417 success: function success(response) { 418 $("#list-posts").html(response.data); 419 } 420 }); 421} 422function getSearch(s) { 423 var urlParams = new URLSearchParams(window.location.search); 424 $.ajax({ 425 url: themosis.ajaxurl, 426 // Global access to the WordPress ajax handler file 427 type: 'POST', 428 dataType: 'json', 429 data: { 430 action: 'get_search', 431 // Your custom hook/action name 432 security: themosis.nonce, 433 // A nonce value defined by the user with the "add-posts" action 434 texto: s === undefined ? '' : s,
435 pag: urlParams.has('pag') ? urlParams.get('pag') : 1 436 }, 437 success: function success(response) { 438 $("#list-results").html(response.data); 439 } 440 }); 441} 442function validInputRutField() { 443 var rut_input = $("li.rut > div.ginput_container_text > input[type='text']"); 444 rut_input.rut({ 445 formatOn: 'keyup', 446 validateOn: 'blur' 447 }); 448 rut_input.on('rutInvalido', function () { 449 $(this).css('color', 'red'); 450 }); 451 rut_input.on('rutValido', function () { 452 $(this).css('color', 'black'); 453 }); 454} 455function formatInputs() { 456 $('.large').each(function () { 457 $(this).removeClass('large').addClass('uc-input-style'); 458 }); 459 $('.large').each(function () { 460 $(this).removeClass('large').addClass('uc-input-style'); 461 }); 462 $('.gform_button.button').each(function () { 463 $(this).addClass('uc-btn'); 464 $(this).addClass('btn-cta'); 465 $(this).addClass('btn-inline'); 466 }); 467 $('.gfield_checkbox > li').each(function () { 468 $(this).addClass('uc-checkbox'); 469 $(this).children(':checkbox').addClass('uc-checkbox__input'); 470 $(this).children('label').addClass('uc-checkbox__label'); 471 }); 472 $('.ginput_container.ginput_container_textarea > textarea').each(function () { 473 $(this).addClass('uc-input-style'); 474 }); 475 validInputRutField(); 476} 477$(document).on('gform_post_render', function () { 478 formatInputs(); 479}); 480 481// .firefox 482var isFF = true; 483var addRule = function (style) { 484 var sheet = document.head.appendChild(style).sheet; 485 return function (selector, css) { 486 if (isFF) { 487 if (sheet.cssRules.length > 0) { 488 sheet.deleteRule(0); 489 } 490 try { 491 sheet.insertRule(selector + "{" + css + "}", 0); 492 } catch (ex) { 493 isFF = false; 494 } 495 } 496 }; 497}(document.createElement("style")); 498 499// .chrome styling 500$('.progress-container input').on('input', function () { 501 $(this).css('background', 'linear-gradient(to right, #E67D15 0%, #E67D15 ' + this.value + '%, #fff ' + this.value + '%, white 100%)'); 502}); 503 504/***/ }), 505
506/***/ "./assets/js/kit.js": 507/*!**************************!*\ 508 !*** ./assets/js/kit.js ***! 509 \**************************/ 510/*! exports provided: Accordion */ 511/***/ (function(module, __webpack_exports__, __webpack_require__) { 512 513"use strict"; 514__webpack_require__.r(__webpack_exports__); 515/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return Accordion; }); 516function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 517function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 518function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } 519function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } 520function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } 521function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } 522var Accordion = /*#__PURE__*/function () { 523 function Accordion() { 524 _classCallCheck(this, Accordion); 525 this.list_class = { 526 titleClass: 'js-accordion-title', 527 contentClass: 'js-accordion-content', 528 active_element: 'js-accordion-active-element' 529 }; 530 this.render(); 531 } 532 _createClass(Accordion, [{ 533 key: "render", 534 value: function render() { 535 var _this = this; 536 /* Obtendremos a todos los elementos */ 537 this.elements = document.querySelectorAll('[data-collapse]'); 538 this.elements.forEach(function (element) { 539 element.classList.add(_this.list_class.titleClass); 540 element.addEventListener('click', function (e) { 541 return _this.onClick(e); 542 }); 543 element.href = 'javascript:void(0);'; 544 }); 545 this.closeAll(); 546 } 547 }, { 548 key: "getParent", 549 value: function getParent(element) { 550 return typeof element.parentElement == 'undefined' || element.parentElement == null ? null : typeof element.parentElement.dataset.accordion != 'undefined' ? element.parentElement : this.getParent(element.parentElement); 551 } 552 }, { 553 key: "onClick", 554 value: function onClick(e) { 555 var _this2 = this; 556 var element = e.target; 557 var parent = this.getParent(element); 558 if (parent == null) { 559 var _targets = document.querySelectorAll('[data-toggle="' + element.dataset.collapse + '"]'); 560 _targets.forEach(function (item) { 561 _this2.toggle(item, element); 562 }); 563 return; 564 } 565 var targets = parent.querySelectorAll('[data-toggle="' + element.dataset.collapse + '"]'); 566 if (element.dataset.open == "true") { 567 this.toggle(element, element); 568 return; 569 } 570 571 /* SALVANDO ESTADOS */ 572 573 this.closeAll(parent, targets); 574 targets.forEach(function (item) { 575 _this2.toggle(item, element); 576 }); 577 } 578 }, { 579 key: "closeAll", 580 value: function closeAll(parent, objectives) { 581 var _this3 = this; 582 var isFirst = typeof parent == 'undefined'; 583 var container = isFirst ? document : parent; 584 var targets = container.querySelectorAll('[data-toggle]');
585 targets.forEach(function (item) { 586 if (typeof objectives == 'undefined') { 587 /* 588 if (isFirst){ 589 item.classList.add(this.contentClass); 590 if (typeof(item.dataset.open) != 'undefined' && item.dataset.open != "false"){ 591 this.toggle(item); 592 return; 593 } 594 } 595 item.dataset.open = false; 596 item.style.height = 0; */ 597 _this3.operate(item, isFirst, container); 598 return; 599 } 600 objectives.forEach(function (obj) { 601 if (obj == item) { 602 return; 603 } 604 _this3.operate(item, isFirst, container); 605 /* 606 if (isFirst){ 607 item.classList.add(this.contentClass); 608 if (typeof(item.dataset.open) != 'undefined' && item.dataset.open != "false"){ 609 this.toggle(item); 610 return; 611 } 612 } 613 item.dataset.open = false; 614 item.style.height = 0; */ 615 }); 616 }); 617 } 618 }, { 619 key: "operate", 620 value: function operate(item, isFirst, container) { 621 var _this4 = this; 622 if (isFirst) { 623 item.classList.add(this.list_class.contentClass); 624 if (typeof item.dataset.open != 'undefined' && item.dataset.open != "false") { 625 this.toggle(item); 626 return; 627 } 628 } 629 item.dataset.open = false; 630 item.style.height = 0; 631 var parent = container.querySelectorAll('[data-collapse="' + item.dataset.toggle + '"]'); 632 if (typeof parent[0] != 'undefined') { 633 parent.forEach(function (par) { 634 par.classList.remove(_this4.list_class.active_element); 635 }); 636 return; 637 } 638 if (typeof parent.classList == 'undefined') { 639 return; 640 } 641 parent.classList.remove(this.list_class.active_element); 642 } 643 }, { 644 key: "toggle", 645 value: function toggle(el, parent) { 646 // getting the height every time in case 647 // the content was updated dynamically 648 649 var height = el.scrollHeight; 650 if (el.style.height === '0px' || el.style.height === '') { 651 el.style.height = height + 'px'; 652 el.setAttribute('data-open', 'true'); 653 if (typeof parent != 'undefined') { 654 parent.classList.add(this.list_class.active_element); 655 } 656 } else { 657 el.style.height = 0; 658 el.setAttribute('data-open', 'false'); 659 if (typeof parent != 'undefined') { 660 parent.classList.remove(this.list_class.active_element); 661 } 662 } 663 } 664 }]); 665 return Accordion; 666}(); 667 668 669/***/ })
669, 670 671/***/ 2: 672/*!***********************************!*\ 673 !*** multi ./assets/js/custom.js ***! 674 \***********************************/ 675/*! no static exports found */ 676/***/ (function(module, exports, __webpack_require__) { 677 678module.exports = __webpack_require__(/*! /Volumes/data_mac/proyectos/uc-radio-beethoven/htdocs/content/themes/uc-radio-beethoven/assets/js/custom.js */"./assets/js/custom.js"); 679 680 681/***/ }) 682 683/******/ });
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.