PluginProbe
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder / 1.0.8
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder v1.0.8
3.6.0 3.5.0 trunk 1.0.10 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.6.1 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5 1.5.1 All 110 releases
buttonizer-multifunctional-button / js / buttonizer.js

buttonizer.js in Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder 1.0.8, at js/buttonizer.js

101 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var buttonizer = {
2 settings: {
3 buttonizerOpened: false,
4 buttonizerHasOpened: false,
5 wHeight: 0,
6 scrollBarTop: 0,
7 showAfter: 0,
8 exitIntent: 0,
9 exitIntentText: 'Are you looking for this?',
10 currentPageUrl: '',
11 currentPageTitle: '',
12 showedExitIntent: false,
13 animated: false,
14 },
15 init: function(options) {
16 options = jQuery.extend({
17 scrollBarTop: 0,
18 showAfter: 0,
19 exitIntent: 0,
20 exitIntentText: 'Are you looking for this?'
21 }, options);
22
23 this.settings.scrollBarTop = options.scrollBarTop;
24 this.settings.showAfter = options.showAfter;
25 this.settings.wHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
26 this.settings.exitIntent = options.exitIntent;
27 this.settings.exitIntentText = options.exitIntentText;
28
29 document.addEventListener('DOMContentLoaded', this.ready);
30 },
31 ready: function() {
32 if(document.getElementById("buttonizer-sys") != null) {
33 document.addEventListener("click", function(e) {
34 if(buttonizer.settings.buttonizerOpened && !document.getElementById("buttonizer-button").contains(e.target)) {
35 document.getElementById("buttonizer-sys").className = 'buttonizer_inner';
36 buttonizer.settings.buttonizerOpened = false;
37
38 if(document.querySelector("#buttonizer-sys .buttonizer_head .text") != null) {
39 document.querySelector("#buttonizer-sys .buttonizer_head .text").remove();
40 }
41 }
42 }, false);
43
44 document.getElementById("buttonizer-sys").addEventListener("click", function() {
45 if(buttonizer.settings.buttonizerOpened == true) {
46 document.getElementById("buttonizer-sys").className = 'buttonizer_inner';
47 buttonizer.settings.buttonizerOpened = false;
48
49 if(document.querySelector("#buttonizer-sys .buttonizer_head .text") != null) {
50 if(document.querySelector("#buttonizer-sys .buttonizer_head .text").hasClass('noremove')) {
51 document.querySelector("#buttonizer-sys .buttonizer_head .text").remove();
52 }
53 }
54 }else{
55 document.getElementById("buttonizer-sys").className = 'buttonizer_inner opened';
56 buttonizer.settings.buttonizerOpened = true;
57 }
58 });
59
60 // Attenton animation
61 if(document.getElementById("buttonizer-button").getAttribute('attention-animation') != 'none') {
62 setInterval(function() {
63 if(!buttonizer.settings.buttonizerOpened) {
64 document.getElementById("buttonizer-button").setAttribute("attention-trigger", "true");
65
66 setTimeout(function() {
67 document.getElementById("buttonizer-button").setAttribute("attention-trigger", "false");
68 }, 2000);
69 }
70 }, 10000);
71 }
72 }
73
74
75 /* Premium Code Stripped by Freemius */
76
77 }
78 }
79
80 function onButtonizerClickEvent(text) {
81 if (typeof ga == 'function') {
82 ga('send', 'event', {
83 eventCategory: 'Buttonizer',
84 eventAction: document.location.href,
85 eventLabel: text
86 });
87 }
88 }
89
90 function onButtonizerButtonFacebook() {
91 window.open('http://www.facebook.com/sharer.php?u='+ document.location.href +'&t='+ document.title +'', 'popupFacebook', 'width=610, height=480, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;
92 }
93
94 function onButtonizerButtonTwitter() {
95 window.open('https://twitter.com/intent/tweet?text='+ document.title +'&url='+ document.location.href +'', 'popupTwitter', 'width=610, height=480, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;
96 }
97
98 function onButtonizerButtonLinkedin() {
99 window.open('http://www.linkedin.com/shareArticle?mini=true&url='+ document.location.href +'&title='+ document.title +'&summary='+ document.title +'', 'popupLinkedIn', 'width=610, height=480, resizable=0, toolbar=0, menubar=0, status=0, location=0, scrollbars=0'); return false;
100 }
101