PageSourceSearch

https://euskelec.eus/wp-content/themes/pom/assets/js/website-init.js?ver=1.0.33.300

js euskelec.eus collected 2026-10-08 03:06:02 UTC 10,967 bytes, 326 lines download raw bytes

1/*!-----------------------------------------------------------------
2  Name: POM theme with visual builder
3  Version: 1.3.0
4  Author: POM Design & Development S.L.
5  Website: https://pom.es
6  Purchase: https://pom.es
7  Support: https://pom.es
8  License:
9  Copyright 2017.
10-------------------------------------------------------------------*/
11;(function() {
12'use strict';
13
14/*------------------------------------------------------------------
15
16  Theme Options
17
18-------------------------------------------------------------------*/
19var options = {
20    enableSearchAutofocus: true,
21    enableActionLikeAnimation: true,
22    enableShortcuts: true,
23    enableMouseParallax: true,
24    scrollToAnchorSpeed: 700,
25    parallaxSpeed: 0.8,
26    cookieSettings: webData.cookieSettings,
27
28    // @TODO remove some options
29    templates: {
30        secondaryNavbarBackItem: webData.secondaryNavbarBackItem,
31
32        likeAnimationLiked: webData.likeAnimationLiked,
33        likeAnimationDisliked: webData.likeAnimationDisliked,
34
35        plainVideoIcon: webData.plainVideoIcon,
36        plainVideoLoadIcon: webData.plainVideoLoadIcon,
37        fullscreenVideoClose: webData.fullscreenVideoClose,
38        gifIcon: webData.gifIcon,
39
40        quickViewPortfolio: webData.quickViewPortfolio,
41        quickViewStore: webData.quickViewStore,
42        quickViewCloseIcon: webData.quickViewCloseIcon,
43
44        audioPlaylistButton: webData.audioPlaylistButton,
45        audioPlainButton: webData.audioPlainButton,
46
47        instagram: webData.instagram,
48        instagramLoadingText: webData.instagramLoadingText,
49        instagramFailText: webData.instagramFailText,
50        instagramApiPath: webData.instagramApiPath,
51
52        twitter: webData.twitter,
53        twitterLoadingText: webData.twitterLoadingText,
54        twitterFailText: webData.twitterFailText,
55        twitterApiPath: webData.twitterApiPath,
56
57        countdown: webData.countdown,
58    },
59
60    shortcuts: {
61        toggleSearch: 's',
62        showSearch: '',
63        closeSearch: 'esc',
64
65        toggleShare: 'n',
66        showShare: '',
67        closeShare: 'esc',
68
69        closeFullscreenVideo: 'esc',
70
71        closeQuckView: 'esc',
72
73        audioPlayerPlayPause: 'shift+p',
74        audioPlayerPlay: '',
75        audioPlayerPause: '',
76        audioPlayerForward: 'shift+right',
77        audioPlayerBackward: 'shift+left',
78        audioPlayerVolumeUp: 'shift+up',
79        audioPlayerVolumeDown: 'shift+down',
80        audioPlayerMute: 'shift+m',
81        audioPlayerLoop: 'shift+l',
82        audioPlayerShuffle: 'shift+s',
83        audioPlayerPlaylist: 'shift+a',
84        audioPlayerPin: 'shift+r',
85
86        postLike: 'l',
87        postDislike: 'd',
88        postScrollToComments: 'c',
89
90        toggleSideLeftNavbar: 'alt+l',
91        openSideLeftNavbar: '',
92        closeSideLeftNavbar: 'esc',
93
94        toggleSideRightNavbar: 'alt+r',
95        openSideRightNavbar: '',
96        closeSideRightNavbar: 'esc',
97
98        toggleFullscreenNavbar: 'alt+f',
99        openFullscreenNavbar: '',
100        closeFullscreenNavbar: 'esc'
101    },
102    events: {
103        actionHeart: function actionHeart(params) {
104            params.updateIcon();
105
106            // fake timeout for demonstration
107            // Change on AJAX request or something
108            setTimeout(function () {
109                var result = params.currentNum + (params.type === 'like' ? 1 : -1);
110                params.updateNum(result);
111            }, 300);
112        },
113        actionLike: function actionLike(params) {
114            params.updateIcon();
115
116            // fake timeout for demonstration
117            // Change on AJAX request or something
118            setTimeout(function () {
119                var additional = 0;
120                if (params.type === 'like') {
121                    if (params.isLiked) {
122                        additional = -2;
123                    }
124                    if (params.isDisliked) {
125                        additional = 1;
126                    }
127                }
128                if (params.type === 'dislike') {
129                    if (params.isLiked) {
130                        additional = -1;
131                    }
132                    if (params.isDisliked) {
133                        additional = 2;
134                    }
135                }
136                var result = params.currentNum + (params.type === 'like' ? 1 : -1) + additional;
137                params.updateNum(result);
138            }, 300);
139        },
140        quickViewOpen: function quickViewOpen($quickView) {},
141        beforeQuickViewClose: function beforeQuickViewClose($quickView) {},
142        quickViewClosed: function quickViewClosed($quickView) {},
143        beforeQuickViewLoad: function beforeQuickViewLoad($frameDoc) {},
144        quickViewLoad: function quickViewLoad($frameDoc) {},
145        quickViewLoaded: function quickViewLoaded($frameDoc) {}
146    }
147};
148
149if (typeof POM !== 'undefined') {
150    POM.setOptions(options);
151    POM.init();
152}
153}());
154
155jQuery(document).ready(function($){
156
157    $('a[href^="#"]').not('.nav-link, .toc-item, [data-toggle="collapse"]').on('click',function (e) {
158        e.preventDefault();
159
160        var $target = $(this.hash);
161        POM.scrollTo($target.offset().top - 40);
162        /*$('html, body').stop().animate({
163            'scrollTop': $target.offset().top - 40
164        }, 1000, 'swing');*/
165    });
166
167    // Row module
168    $('.go_to_section_arrow_button').click(function () {
169        //Go to the next visible element
170        POM.scrollTo($($(this).parents('.web-box').siblings().filter('.web-box:visible')[0]));
171    });
172
173    //Gallery module - Adjusts the height of all photos to match the lower image
174    var allDivs = $('.web-same-dimensions');
175    var dvSmallest = allDivs[0];
176    $(allDivs).each(function() {
177        if ($(this).height() < $(dvSmallest).height())
178            dvSmallest = $(this);
179    });
180    var finalHeight = $(dvSmallest).height();
181    $('.web-same-dimensions').each(function() {
182        $(this).height(finalHeight);
183    });
184
185    //Video module
186    $(".web-plain-video").children('video').css({"width": "100%"});
187
188    //Tabs module
189    //@TODO find a better way (e.g. data-active ...)
190    $('.nav-tabs > .nav-item:first > a').addClass('active');
191    $('.tab-content > .tab-pane:first').addClass('active show');
192
193    //Modal module
194    $('[data-toggle="modal"]').click(function(){
195        var $that = $($(this).data('target'));
196        var checkExist = setInterval(function() {
197            if ($('.modal-backdrop').length) {
198                var backdrop = $('.modal-backdrop:last');
199                console.log($(backdrop).insertAfter($that));
200                clearInterval(checkExist);
201            }
202        }, 100); // check every 100ms
203
204    });
205
206    $('.web-modal').each(function() {
207        var modal = $(this);
208        modal[0].remove();
209        $('body').append(modal[0]);
210    });
211
212    if ( !$('.close').hasClass('openOnce') ) {
213        localStorage.setItem("popUp", "0");
214    }
215
216    //Open popup on page load
217    if ( $('.web-btn').hasClass('openPopup') ) {
218        if ( $(this).attr("data-open") || $(this).attr("data-open") !== 0) {
219            var time = $('.openPopup').attr("data-open");
220        } else {
221            var time = 10;
222        }
223        if ( localStorage.getItem("popUp") !== '1' ) {
224            setTimeout(function() {
225                $('.openPopup').trigger('click');
226            }, time);
227        }
228    }
229
230    //Set cookie on modal close
231    if ( $('.close').hasClass('openOnce') ) {
232        $(document).click(function() {
233            localStorage.setItem("popUp", "1");
234        });
235    }
236
237    // Open pop-up if user is absent for x time
238    // if ( $('button[class^="openAfter-"]') ) {
239    //
240    //     var check = "openAfter-";
241    //     $('[class^="openAfter-"], [class*=" openAfter-"]').each(function () {
242    //
243    //         // get absent time by class
244    //         var cls = $.map(this.className.split(' '), function (val, i) {
245    //             if (val.indexOf(check) > -1) {
246    //                 return val.slice(check.length, val.length)
247    //             }
248    //         });
249    //         var absentTime =  cls.join(' ');
250    //
251    //         // pass from minutes to milliseconds
252    //         var milliseconds = absentTime * 60000;
253    //
254    //         // action if mouse doesn't move
255    //         var timeoutid = 0;
256    //         $('body').mousemove(function() {
257    //             clearTimeout(timeoutid);
258    //             timeoutid = setTimeout(function() {
259    //                 $('.openPopup').trigger('click');
260    //             }, milliseconds);
261    //         });
262    //
263    //     });
264    // }
265
266    // Open pop-up if tab gets inactive
267    $([window, document]).focusout(function(){
268        $('.openInReturn').trigger('click');
269    });
270
271    // Table of contents module
272    $('article').find('h2, h3, h4').each(function(i){
273        $(this).attr('data-index', i);
274    });
275
276    $('.toc-list a').click( function(e) {
277        e.preventDefault();
278
279        var id = $(this).attr('href').replace('#toc-link-', '');
280
281        var elem = $('[data-index="' + id + '"]');
282        $('html,body').animate({
283            scrollTop: elem.offset().top},
284        'slow');
285    });
286
287    //Init cookie notice
288    if( typeof POM.options.cookieSettings !== 'undefined' ){
289        var cookieSettings = POM.options.cookieSettings;
290        var compactClass = cookieSettings.compactStyle ? "eupopup-style-compact" : "";
291
292        //If the option selected is top, prepend the cookie notice to the body
293        if(cookieSettings.layout == 'eupopup-top'){
294            $('body').prepend("<div class='eupopup eupopup-block " + compactClass + "'></div>");
295        } else{ //If not, just add the class to the body tag
296            $('body').addClass('eupopup ' + cookieSettings.layout + ' ' + compactClass);
297        }
298
299        //Init the cookie notice
300        $(document).euCookieLawPopup().init(cookieSettings);
301
302        if(cookieSettings.compactStyle && cookieSettings.layout == 'eupopup-top'){
303            $('.eupopup-container').removeClass('eupopup-style-compact');
304        }
305    }
306});
307
308jQuery.extend(jQuery.validator.messages, {
309    required: webData.validatori18n.required,
310    remote: webData.validatori18n.remote,
311    email: webData.validatori18n.email,
312    url: webData.validatori18n.url,
313    date: webData.validatori18n.date,
314    dateISO: webData.validatori18n.dateISO,
315    number: webData.validatori18n.number,
316    digits: webData.validatori18n.digits,
317    creditcard: webData.validatori18n.creditcard,
318    equalTo: webData.validatori18n.equalTo,
319    accept: webData.validatori18n.accept,
320    maxlength: jQuery.validator.format(webData.validatori18n.maxlength),
321    minlength: jQuery.validator.format(webData.validatori18n.minlength),
322    rangelength: jQuery.validator.format(webData.validatori18n.rangelength),
323    range: jQuery.validator.format(webData.validatori18n.range),
324    max: jQuery.validator.format(webData.validatori18n.max),
325    min: jQuery.validator.format(webData.validatori18n.min)
326});

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.