PageSourceSearch

https://www.diariodemediacion.es/wp-content/plugins/click-datos-lo…/assets/js/click-datos-lopd-js.js?ver=2.3.0

js diariodemediacion.es collected 2026-09-26 02:37:27 UTC 7,589 bytes, 179 lines download raw bytes

1//All the cookie setting stuff
2function catapultSetCookie(cookieName, cookieValue, nDays) {
3    var today = new Date();
4    var expire = new Date();
5    if (nDays == null || nDays == 0)
6        nDays = 1;
7    expire.setTime(today.getTime() + 3600000 * 24 * nDays);
8    document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString() + "; path=/";
9}
10function catapultReadCookie(cookieName) {
11    var theCookie = " " + document.cookie;
12    var ind = theCookie.indexOf(" " + cookieName + "=");
13    if (ind == -1)
14        ind = theCookie.indexOf(";" + cookieName + "=");
15    if (ind == -1 || cookieName == "")
16        return "";
17    var ind1 = theCookie.indexOf(";", ind + 1);
18    if (ind1 == -1)
19        ind1 = theCookie.length;
20    // Returns true if the versions match
21    return cdlopd_vars.version == unescape(theCookie.substring(ind + cookieName.length + 2, ind1));
22}
23function catapultDeleteCookie(cookieName) {
24    document.cookie = cookieName + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
25}
26function catapultAcceptCookies(dias) {
27    catapultSetCookie('catAccCookies', cdlopd_vars.version, dias);
28    jQuery("html").removeClass('has-cookie-bar');
29    jQuery("html").css("margin-top", "0");
30    jQuery("#catapult-cookie-bar").fadeOut();
31    document.location.reload(true);
32}
33
34function catapultDenyCookies(dias) {
35    catapultSetCookie('catAccCookiesDeny', cdlopd_vars.version, dias);
36    jQuery("body").removeClass('has-cookie-bar');    
37    jQuery("html").css("margin-top", "0");
38    jQuery("#catapult-cookie-bar").fadeOut();
39}
40
41//function cookiesinaceptarnirechazar() {
42//    var date = new Date();
43//    date.setTime(date.getTime() + (5 * 60 * 1000));
44//    var expires = ";expires=" + date.toGMTString();
45//    document.cookie = "catAccCookiesUnan = 1" + expires + "; path=/";
46//    jQuery("html").removeClass('has-cookie-bar');
47//    jQuery("html").css("margin-top", "0");
48//    jQuery("#catapult-cookie-bar").fadeOut();
49//}
50
51// The function called by the timer
52/*function cdlopdCloseNotification() {
53    catapultAcceptCookies();
54
55}*/
56// The function called if first page only is specified
57
58/*jQuery(document).ready(function ($) {
59    $('.x_close').on('click', function () {
60        catapultAcceptCookies();
61    });
62});*/
63
64function saveCookieAceptar(dias){
65    var base_url = window.location.href;
66    var url = base_url;
67    jQuery(document).ready(function($){
68        $.ajax({
69            'url': url,
70            'type': 'POST',
71            'success': function (data) {
72                if (data) {
73                    var url = base_url;
74                    $.ajax({
75                        'url': url,
76                        'type': 'POST',
77                        'success': function (response) {
78                            if (response) {
79                                catapultSetCookie('catAccCookies', cdlopd_vars.version, dias);
80                                jQuery("html").removeClass('has-cookie-bar');
81                                jQuery("html").css("margin-top", "0");
82                                jQuery("#catapult-cookie-bar").fadeOut();
83                                location.reload();
84                            }
85                        }
86                    });
87                }
88            }
89        });
90    });    
91}
92
93function obtenerCookie(clave) {
94    var name = clave + "=";
95    var ca = document.cookie.split(';');
96    for (var i = 0; i < ca.length; i++) {
97        var c = ca[i];
98        while (c.charAt(0) === ' ')
99            c = c.substring(1);
100        if (c.indexOf(name) === 0)
101            return c.substring(name.length, c.length);
102    }
103    return "";
104}
105
106function comprobarCookie(clave) {
107    var cookie = obtenerCookie(clave);
108    if (cookie !== "") {
109        return true;
110    }
111    return false;
112}
113
114jQuery(document).ready(function(){
115    if (document.getElementById('opcionCookie') === null || document.getElementById('opcionCookie') === undefined) {
116        var opcion = 'botones';
117        jQuery('.cdlopd-right-side').html('<button id="catapultCookieAceptar" tabindex=0 onclick="catapultAcceptCookies();">Aceptar</button><button id="catapultCookieRechazar" tabindex=0 onclick="catapultDenyCookies();">Rechazar</button>');
118    }
119    else{
120        var opcion = document.getElementById('opcionCookie').value;
121    }
122    var url = document.getElementById('pag_informacion');
123    if(url == window.location.href){
124        if(opcion === 'scroll'){
125            jQuery(document).ready(function(){
126                jQuery(window).scroll(function (e){
127                    var scrollTop = jQuery(window).scrollTop();
128                    var docHeight = jQuery(document).height();
129                    var winHeight = jQuery(window).height();
130                    var scrollPercent = (scrollTop) / (docHeight - winHeight);
131                    var scrollPercentRounded = Math.round(scrollPercent * 100);
132                    var diasAceptar = document.getElementById('scrollCaducidad').value;
133                    var diasRechazar = document.getElementById('caducidadRechazar').value;
134                    var textAceptar = document.getElementById('textAceptar').value;
135                    var textRechazar = document.getElementById('textRechazar').value;
136                    var scrollCookies = document.getElementById("texto_scroll");
137                    var textoScroll = document.getElementById('textoScroll').value;
138                    if(!comprobarCookie('catAccCookies')){
139                        if(scrollPercentRounded >= 90){
140                            scrollCookies.innerHTML = '<button id="catapultCookieAceptar" \n\
141                            tabindex=0 onclick="catapultAcceptCookies('+diasAceptar+');">'+textAceptar+
142                            '</button><button id="catapultCookieRechazar" \n\
143                            tabindex=0 onclick="catapultDenyCookies('+diasRechazar+');">'+textRechazar+'</button>';
144                        }
145                        else{
146                            scrollCookies.innerHTML = '<p>'+textoScroll+'</p>';
147                        }
148                    }
149                });
150            });
151        }
152    }
153    else{
154        if (opcion === 'scroll') {
155            jQuery(document).ready(function () {
156                jQuery(window).scroll(function (e) {
157                    var scrollTop = jQuery(window).scrollTop();
158                    var docHeight = jQuery(document).height();
159                    var winHeight = jQuery(window).height();
160                    var scrollPercent = (scrollTop) / (docHeight - winHeight);
161                    var scrollPercentRounded = Math.round(scrollPercent * 100);
162                    var dias = document.getElementById('scrollCaducidad').value;
163                    var porcentaje_scroll = parseFloat(document.getElementById('porcent_scroll').value);
164                    if (!comprobarCookie('catAccCookies')) {
165                        if (scrollPercentRounded > porcentaje_scroll) {
166                            catapultSetCookie('catAccCookies', cdlopd_vars.version, dias);
167                            jQuery("html").removeClass('has-cookie-bar');
168                            jQuery("html").css("margin-top", "0");
169                            jQuery("#catapult-cookie-bar").fadeOut();
170                            location.reload();
171                        }
172                    }
173                });
174            });
175        }
176    }
177    
178});
179

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.