1; (function (window, document, $, namespace, cssClass, undefined) { 2 3 'use strict'; 4 5 var ns = window[namespace] = window[namespace] || {}; 6 var Browser = ns.helpers.browser; 7 8 // Executed once component element 9 function ShareBox($el) { 10 this.$el = $el; 11 this.$btnsWrapper = $el.find('[class*="__btns-wrapper"]'); 12 }; 13 14 ShareBox.prototype.$btnsWrapper = null; 15 ShareBox.prototype.windowOpenTarget = '_blank'; 16 ShareBox.prototype.windowOpenParams = 'toolbar=0, status=0, width=600, height=400'; 17 18 // Executed once per kind of compontent 19 ShareBox.onBoot = function () { 20 21 $(document).on('click', '.c-' + cssClass + '__btn--sharetools', function (e) { 22 e.preventDefault(); 23 24 var _this = ns.Component.getInstanceByChild(e.currentTarget); 25 // _this.$btnsWrapper.stop().fadeToggle(300); 26 27 if( !_this.$el.hasClass('active') ) { 28 if(_this.$el.is('[class*="--layout1"]')) { 29 $('body').addClass(cssClass+'--overlay-active'); 30 } 31 _this.$el.addClass('active'); 32 // _this.$btnsWrapper.stop().fadeIn(300); 33 _this.$btnsWrapper.show(); 34 } else { 35 if(_this.$el.is('[class*="--layout1"]')) { 36 $('body').removeClass(cssClass+'--overlay-active'); 37 } 38 _this.$el.removeClass('active'); 39 // _this.$btnsWrapper.stop().fadeOut(300); 40 _this.$btnsWrapper.hide(); 41 } 42 }); 43 44 $(document).on('click', '.c-' + cssClass + '__btn--facebook', function (e) { 45 e.preventDefault(); 46 47 var _this = ns.Component.getInstanceByChild(e.currentTarget); 48 var url = encodeURIComponent(e.currentTarget.dataset.url || ns.config.share.pageInfo.url || ""); 49 50 //window.open('http://www.facebook.com/sharer/sharer.php?m2w&s=100&p[url]=' + url, _this.windowOpenTarget, _this.windowOpenParams); 51 window.open('https://www.facebook.com/sharer.php?u=' + url, _this.windowOpenTarget, _this.windowOpenParams); 52 }); 53 54 $(document).on('click', '.c-' + cssClass + '__btn--twitter', function (e) { 55 e.preventDefault(); 56 57 var _this = ns.Component.getInstanceByChild(e.currentTarget); 58 var url = encodeURIComponent(e.currentTarget.dataset.url || ns.config.share.pageInfo.url || ""); 59 var title = encodeURIComponent(e.currentTarget.dataset.title || ns.config.share.pageInfo.title || ""); 60 var via = encodeURIComponent("quilivorno.it"); 61 62 window.open('https://twitter.com/intent/tweet?url=' + url + '&text=' + title + '&via=' + via, _this.windowOpenTarget, _this.windowOpenParams); 63 }); 64 65 $(document).on('click', '.c-' + cssClass + '__btn--whatsapp', function (e) { 66 e.preventDefault(); 67 68 var _this = ns.Component.getInstanceByChild(e.currentTarget); 69 var url = encodeURIComponent(e.currentTarget.dataset.url || ns.config.share.pageInfo.url || ""); 70 71 window.open('https://wa.me/?text=' + url, _this.windowOpenTarget, _this.windowOpenParams); 72 }); 73 74 $(document).on('click', '.c-' + cssClass + '__btn--telegram', function (e) { 75 e.preventDefault(); 76 77 var _this = ns.Component.getInstanceByChild(e.currentTarget); 78 var url = encodeURIComponent(e.currentTarget.dataset.url || ns.config.share.pageInfo.url || ""); 79 80 window.open('https://t.me/share/url?url=' + url, _this.windowOpenTarget, _this.windowOpenParams); 81 }); 82 83 // $(document).on('click', '.c-' + cssClass + '__btn--pinterest', function (e) { 84 // e.preventDefault(); 85 86 // var _this = ns.Component.getInstanceByChild(e.currentTarget); 87 88 // var title = _this.$btnsWrapper.attr('data-title'); 89 // var url = _this.$btnsWrapper.attr('data-url'); 90 // var image = _this.$btnsWrapper.attr('data-image'); 91 92 // window.open('http://pinterest.com/pin/create/button/?url=' + url + '&media=' + image + '&description=' + title, _this.windowOpenTarget, _this.windowOpenParams); 93 // }); 94 95 // $(document).on('click', '.c-' + cssClass + '__btn--linkedin', function (e) { 96 // e.preventDefault(); 97 98 // var _this = ns.Component.getInstanceByChild(e.currentTarget); 99 // var title = _this.$btnsWrapper.attr('data-title'); 100 // var url = _this.$btnsWrapper.attr('data-url'); 101 102 // window.open('https://www.linkedin.com/shareArticle?mini=true&url=' + url + '&title=' + title, _this.windowOpenTarget, _this.windowOpenParams); 103 // }); 104 105 // $(document).on('click', '.c-' + cssClass + '__btn--mail', function (e) { 106 // e.preventDefault(); 107 108 // var _this = ns.Component.getInstanceByChild(e.currentTarget); 109 110 // var subject = 'quilivornoo site'; 111 // var title = _this.$btnsWrapper.attr('data-title'); 112 // var url = _this.$btnsWrapper.attr('data-url'); 113 114 // window.open('mailto:?subject=' + subject + '&body=' + title + ' ' + url, _this.windowOpenTarget, _this.windowOpenParams); 115 // }); 116 117 }; 118 119 // Add the component in the library 120 ns.Component.add(ShareBox); 121 122})(window, document, jQuery, 'zaux', 'sharebox');
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.