1(function(Drupal, $, once, Cookies) { 'use strict'; 2 3 // Class creation 4 var Popin = function(el) { this.init(el); } 5 var P = Popin.prototype; 6 7 // Parameters 8 P.popinOffset = 60; 9 10 // ====================================== 11 // @function init(el) 12 // __ constructor 13 // ====================================== 14 P.init = function(el) { 15 var GET = new URLSearchParams(location.search); 16 var commune = GET.get('commune'); 17 18 if (commune !== null && commune === "false" && $(el).hasClass('popin-reseaux-sociaux') ) { 19 this.$container = $(el); 20 this.$cookieName = this.$container.data('popin-value') 21 this.$cookieTTL = parseInt(this.$container.data('popin-ttl')); 22 // init du cookie 23 this.$container.addClass('initialised'); 24 this.$container.addClass('active'); 25 Cookies.set(this.$cookieName, 1, { expires: this.$cookieTTL, path: '/' }); 26 } 27 } 28 29 // text en gras et error en organ et gras 30 31 // ====================================== 32 // @function onKeyDown() 33 // 34 // ====================================== 35 P.onKeyDown = function(e) { 36 switch (e.keyCode) { 37 case 27: // echap 38 this.close(); 39 break; 40 } 41 } 42 43 // ====================================== 44 // @function onClickAction() 45 // 46 // ====================================== 47 P.onClickAction = function(e) { 48 var action = e.currentTarget.attributes['data-action'].value; 49 e.preventDefault(); 50 51 switch (action) { 52 case 'close': 53 this.close(); 54 break; 55 } 56 } 57 58 // ====================================== 59 // @function open() 60 // 61 // ====================================== 62 P.open = function(e) { 63 this.$container.addClass('active'); 64 } 65 66 // ====================================== 67 // @function close() 68 // 69 // ====================================== 70 P.close = function(e) { 71 this.$container.removeClass('active'); 72 } 73 74 // set the Class to global scope 75 window.Popin = Popin; 76 77 78 // Instanciation 79 var nbCheckPopinMax = 5, 80 checkPopinInterval = 0, 81 nbCheckPopin = 0; 82 83 var createPopins = function() { 84 $('.popin').each(function() { 85 if (!$(this).hasClass('initialised')) { 86 new Popin(this); 87 } 88 }); 89 90 if (++nbCheckPopin >= nbCheckPopinMax) { 91 clearInterval(checkPopinInterval); 92 } 93 } 94 95 var checkPopinsJs = function() { 96 checkPopinInterval = setInterval(createPopins, 1000); 97 } 98 createPopins(); 99 checkPopinsJs(); 100 101})(Drupal, jQuery, once, Cookies);
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.