Changeset 2031392
- Timestamp:
- 02/15/2019 12:40:29 PM (7 years ago)
- Location:
- yeloni-free-exit-popup/trunk
- Files:
-
- 4 edited
-
admin-interface/src/partials/home.html (modified) (1 diff)
-
client/dist/client.min.js (modified) (97 diffs)
-
wordpress/client-wordpress.js (modified) (3 diffs)
-
yetience-plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
yeloni-free-exit-popup/trunk/admin-interface/src/partials/home.html
r2027421 r2031392 1 1 <div class="container" ng-hide="R.readyToSave"> 2 <div class="col-md-11 yel-premium-features-on-list yel-no-left" id="yel-popup-feedback-inpage" ng-show="yelShowFeedback()"> 3 <div class="yel-popup-feedback-inpage"> 4 <small class="yel-popup-feedback-inpage-close" ng-click="hide_inpage_popup_feedback(feedback)"><i class="fa fa-close"></i></small> 5 <div> 6 <b><span class="glyphicon glyphicon-thumbs-up"></span> Congratulations on setting up your first 7 Widget</b><br> 8 9 <span>If your Popup doesn't work as expected, <a href="https://yeloni.com/support" target="_blank"><b>please 10 let us 11 know here.</b></a></span> 12 </div> 13 <div class="popup-feedback-questions"></div> 14 </div> 15 </div> 16 2 17 <div class="row"> 3 18 <div class="col-md-12"> -
yeloni-free-exit-popup/trunk/client/dist/client.min.js
r2029975 r2031392 1 1 var Autience = null 2 2 3 window.defineAutience = function (autience_callback) {3 window.defineAutience = function (autience_callback) { 4 4 5 5 var cycle = null, … … 19 19 executors: {}, 20 20 lifecycle_executed: false, 21 yeloniTriggerPopup: function (widget_id) {22 var matching_widget = Autience.setup.widgets.filter(function (widget) {21 yeloniTriggerPopup: function (widget_id) { 22 var matching_widget = Autience.setup.widgets.filter(function (widget) { 23 23 return widget.code == widget_id 24 24 }) … … 30 30 31 31 }, 32 yeloniTriggerAllPopups: function () {32 yeloniTriggerAllPopups: function () { 33 33 console.log('Triggering all popups from customjs event') 34 Autience.setup.widgets.map(function (widget) {34 Autience.setup.widgets.map(function (widget) { 35 35 Autience.executors.displayWidget(widget) 36 36 }) … … 38 38 } 39 39 40 lifecycles.forEach(function (l) {41 42 Autience.lifecycle[l] = [function () {40 lifecycles.forEach(function (l) { 41 42 Autience.lifecycle[l] = [function () { 43 43 //console.log('in ' + l + ' lifecycle') 44 44 return true … … 49 49 50 50 //simple functions with no dependencies 51 Autience.executors.defineUtils = function () {51 Autience.executors.defineUtils = function () { 52 52 53 53 //1. Ajax object - shifted to common 54 54 55 55 //2b. autience utils sendEvent 56 Autience.utils.sendEvent = function (event, data) {56 Autience.utils.sendEvent = function (event, data) { 57 57 58 58 return … … 95 95 96 96 //3a. emitAutienceEvent 97 Autience.utils.emitAutienceEvent = function (eventName, forget) {97 Autience.utils.emitAutienceEvent = function (eventName, forget) { 98 98 eventName = "autience_" + eventName 99 99 //only emit if this event was not already emitted … … 129 129 130 130 //3b. listenAutienceEvent 131 Autience.utils.listenAutienceEvent = function (eventName, fn) {131 Autience.utils.listenAutienceEvent = function (eventName, fn) { 132 132 var autience_event = "autience_" + eventName 133 133 Autience.utils.listen(document, autience_event, fn) … … 135 135 136 136 //3c. delayed Listener 137 Autience.utils.delayedListenAutienceEvent = function (autience_event, delay, fn) {138 Autience.listenAutienceEvent(autience_event, function () {137 Autience.utils.delayedListenAutienceEvent = function (autience_event, delay, fn) { 138 Autience.listenAutienceEvent(autience_event, function () { 139 139 setTimeout(fn, delay) 140 140 }) … … 142 142 143 143 //4. getting document height 144 Autience.utils.getDocHeight = function () {144 Autience.utils.getDocHeight = function () { 145 145 var D = document 146 146 return Math.max( … … 152 152 153 153 //5. createCookies 154 Autience.utils.createCookie = function (name, value, permanent) {154 Autience.utils.createCookie = function (name, value, permanent) { 155 155 var cookie = name + "=" + value + ";path=/" 156 156 if (permanent) { … … 163 163 } 164 164 165 Autience.utils.readCookie = function (name) {165 Autience.utils.readCookie = function (name) { 166 166 var nameEQ = name + "="; 167 167 var ca = document.cookie.split(';'); … … 176 176 177 177 //6. bind function on all elements with the clas 178 Autience.utils.executeOnClass = function (class_name, fn) {178 Autience.utils.executeOnClass = function (class_name, fn) { 179 179 var els = document.getElementsByClassName(class_name) 180 180 if (els) { … … 185 185 } 186 186 187 Autience.utils.executeOnId = function (id, fn) {187 Autience.utils.executeOnId = function (id, fn) { 188 188 var el = document.getElementById(id) 189 189 if (el) { … … 192 192 } 193 193 194 Autience.utils.idListen = function (id, event, fn) {195 Autience.utils.executeOnId(id, function (el) {194 Autience.utils.idListen = function (id, event, fn) { 195 Autience.utils.executeOnId(id, function (el) { 196 196 Autience.utils.listen(el, event, fn) 197 197 }) … … 200 200 201 201 //7. Listen on elements by class name 202 Autience.utils.classListen = function (class_name, evt, fn) {203 Autience.utils.executeOnClass(class_name, function (el) {202 Autience.utils.classListen = function (class_name, evt, fn) { 203 Autience.utils.executeOnClass(class_name, function (el) { 204 204 Autience.utils.listen(el, 'click', fn) 205 205 }) … … 207 207 208 208 //8. Execute array of functions without input 209 Autience.utils.cycle = function (fn_array, widget) {209 Autience.utils.cycle = function (fn_array, widget) { 210 210 211 211 if (fn_array) { … … 217 217 218 218 //9. Execute validators in sequence and return true if all are valid 219 Autience.utils.checkCycle = function (fn_array, inp) {219 Autience.utils.checkCycle = function (fn_array, inp) { 220 220 if (fn_array) { 221 221 for (var i = 0; i < fn_array.length; i++) { … … 230 230 231 231 //10. get a smart setting value 232 Autience.utils.smartSetting = function (extension, key) {232 Autience.utils.smartSetting = function (extension, key) { 233 233 if (autience_settings && autience_settings.smart && autience_settings.smart[extension]) { 234 234 return autience_settings.smart[extension][key] … … 237 237 238 238 //11. close widget 239 Autience.utils.closeWidget = function (widget) {239 Autience.utils.closeWidget = function (widget) { 240 240 Autience.utils.cycle(Autience.lifecycle.close, widget) 241 241 Autience.utils.cycle(Autience.lifecycle.afterClose, widget) … … 244 244 245 245 //12. base64 decoding 246 Autience.utils.decode = function (s) {246 Autience.utils.decode = function (s) { 247 247 if (window.atob) { 248 248 try { … … 284 284 } 285 285 286 Autience.utils.nestedValue = function (obj, fields) {286 Autience.utils.nestedValue = function (obj, fields) { 287 287 288 288 var nested = obj … … 299 299 } 300 300 301 Autience.utils.stripAndExecuteScript = function (text) {301 Autience.utils.stripAndExecuteScript = function (text) { 302 302 var scripts = ''; 303 var cleaned = text.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function () {303 var cleaned = text.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function () { 304 304 scripts += arguments[1] + '\n'; 305 305 return ''; … … 319 319 } 320 320 321 Autience.utils.emitLinkClick = function (url, target, evt) {321 Autience.utils.emitLinkClick = function (url, target, evt) { 322 322 Autience.current_link = url 323 323 Autience.current_target = target … … 354 354 } 355 355 356 Autience.utils.redirect = function (url, target) {356 Autience.utils.redirect = function (url, target) { 357 357 if (!target) { 358 358 window.location = url … … 362 362 } 363 363 364 Autience.utils.isDefined = function (a) {364 Autience.utils.isDefined = function (a) { 365 365 return (typeof a != 'undefined') 366 366 } 367 367 368 Autience.utils.isMobile = function () {368 Autience.utils.isMobile = function () { 369 369 if (/Mobi/.test(navigator.userAgent)) { 370 370 return true … … 373 373 } 374 374 375 Autience.utils.randomString = function () {375 Autience.utils.randomString = function () { 376 376 var text = ""; 377 377 var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; … … 383 383 } 384 384 385 Autience.utils.hasFeature = function (feature) {385 Autience.utils.hasFeature = function (feature) { 386 386 if (Autience.setup && Autience.setup.package_id != 'default') { 387 387 return true … … 403 403 404 404 //define Listeners for the common events 405 Autience.executors.defineListeners = function () {405 Autience.executors.defineListeners = function () { 406 406 //console.log('defining autience listeners') 407 407 Autience.listeners = [{ 408 408 target: document, 409 409 trigger: 'scroll', 410 reaction: function () {410 reaction: function () { 411 411 var ratio = (window.innerHeight + window.scrollY) / (Autience.utils.getDocHeight()); 412 412 var percentage = 25 * Math.floor(ratio * 4.1) //percentage is in multiples of 25 … … 418 418 target: document.body, 419 419 trigger: 'mouseout', 420 reaction: function (e) {420 reaction: function (e) { 421 421 e = e ? e : window.event; 422 422 var from = e.relatedTarget || e.toElement; … … 431 431 target: document.getElementsByTagName('a'), 432 432 trigger: 'click', 433 reaction: function (evt_obj, evt_name, el) {433 reaction: function (evt_obj, evt_name, el) { 434 434 Autience.utils.emitLinkClick(el.href, el.getAttribute('target'), evt_obj) 435 435 }, … … 438 438 target: window, 439 439 trigger: 'hashchange', 440 reaction: function (evt_obj, evt_name, el) {440 reaction: function (evt_obj, evt_name, el) { 441 441 //alert('in hashchange '+ window.location.hash ) 442 442 if (Autience.hash_set) { … … 450 450 target: window, 451 451 trigger: 'popstate', 452 reaction: function (evt_obj, evt_name, el) {452 reaction: function (evt_obj, evt_name, el) { 453 453 Autience.utils.emitAutienceEvent('back') 454 454 }, … … 459 459 460 460 461 Autience.executors.bindListeners = function () {461 Autience.executors.bindListeners = function () { 462 462 //iterate through all the listeners and bind them 463 463 //console.log('binding autience listeners') … … 465 465 triggers = null 466 466 467 Autience.listeners.forEach(function (listener) {467 Autience.listeners.forEach(function (listener) { 468 468 469 469 //if trigger is a string, put the single string in an array … … 474 474 } 475 475 476 triggers.forEach(function (trigger) {476 triggers.forEach(function (trigger) { 477 477 if (listener.target.length) { 478 478 … … 491 491 } 492 492 493 Autience.executors.displayWidget = function (widget) {493 Autience.executors.displayWidget = function (widget) { 494 494 console.log('Call for displayWidget') 495 495 Autience.utils.cycle(Autience.lifecycle.display, widget) 496 496 } 497 497 498 Autience.executors.runWidgetCycle = function (widget) {498 Autience.executors.runWidgetCycle = function (widget) { 499 499 500 500 var cycle = Autience.utils.cycle … … 509 509 } 510 510 511 Autience.executors.runLifecycles = function () {511 Autience.executors.runLifecycles = function () { 512 512 //console.log('Starting widget lifecycle') 513 513 if (Autience.lifecycle_executed) { … … 522 522 //Autience.setup = JSON.parse(decodeURIComponent(autience_setup)) 523 523 // console.log(Autience.setup) 524 console.log('yeloni client is loaded with ' + Autience.setup.widgets.length + ' widgets ')524 //console.log('yeloni client is loaded with ' + Autience.setup.widgets.length + ' widgets ') 525 525 //Autience.utils.sendEvent('client_script_loaded') 526 526 527 Autience.setup.widgets.forEach(function (widget) {527 Autience.setup.widgets.forEach(function (widget) { 528 528 Autience.executors.runWidgetCycle(widget) 529 529 }) … … 549 549 } 550 550 } else { 551 setTimeout(function () {551 setTimeout(function () { 552 552 assignAutienceListen(callback) 553 553 }, 500) … … 555 555 } 556 556 557 assignAutienceListen(function () {557 assignAutienceListen(function () { 558 558 //console.log('in callback of assignAutienceListen') 559 559 Autience.executors.defineUtils() … … 566 566 567 567 }; 568 569 568 window.defineAutienceWhen = function (yetience_callback) { 570 569 … … 622 621 //attach listener to display when the event occurs 623 622 Autience.lifecycle.onPageLoad.push(function (widget) { 624 console.log('Attaching display on trigger')623 // console.log('Attaching display on trigger') 625 624 //first check if the widget is enabled 626 625 if (Autience.utils.nestedValue(widget, ['configuration', 'what', 'enable'])) { … … 677 676 function displayPopupOnEvent(autience_event, delay, links_to_match, prevent_redirect) { 678 677 //Listen to the defined event and run the display lifecycle 679 console.log('Attached Event Listener for Popup for event ', autience_event)678 //console.log('Attached Event Listener for Popup for event ', autience_event) 680 679 Autience.utils.listenAutienceEvent(autience_event, function (evt) { 681 console.log('Autience event triggered ', autience_event)682 console.log('Autience event is' + autience_event + ' Check if the clicked link matches ', evt)680 // console.log('Autience event triggered ', autience_event) 681 // console.log('Autience event is' + autience_event + ' Check if the clicked link matches ', evt) 683 682 684 683 if (matchingLink(links_to_match)) { … … 895 894 } 896 895 }; 897 window.defineAutienceWhere = function (yetience_callback) {896 window.defineAutienceWhere = function (yetience_callback) { 898 897 // //for display by contain url 899 Autience.lifecycle.displayValidation.push(function (widget) {898 Autience.lifecycle.displayValidation.push(function (widget) { 900 899 //honor show on homepage condition 901 900 if (location.pathname == '/' && (Autience.utils.nestedValue(widget, ['configuration', 'where', 'home']) == true)) { … … 926 925 927 926 //for show by match url 928 Autience.lifecycle.displayValidation.push(function (widget) {927 Autience.lifecycle.displayValidation.push(function (widget) { 929 928 // console.log('location.pathname is ' + location.pathname) 930 929 // console.log(widget.configuration.where) … … 954 953 }) 955 954 956 Autience.lifecycle.displayValidation.push(function (widget) {955 Autience.lifecycle.displayValidation.push(function (widget) { 957 956 //return true = show, false = show 958 957 var showAdmin = widget.configuration.showAdmin … … 973 972 }) 974 973 // //for display by contain url 975 Autience.lifecycle.displayValidation.push(function (widget) {974 Autience.lifecycle.displayValidation.push(function (widget) { 976 975 //return true = show, false = hide 977 976 //honor show on homepage condition … … 1004 1003 1005 1004 //for hide by match url 1006 Autience.lifecycle.displayValidation.push(function (widget) {1005 Autience.lifecycle.displayValidation.push(function (widget) { 1007 1006 //return true = show, false = hide 1008 1007 // console.log('location.pathname is ' + location.pathname) … … 1032 1031 }) 1033 1032 1034 Autience.lifecycle.displayValidation.push(function (widget) {1033 Autience.lifecycle.displayValidation.push(function (widget) { 1035 1034 //return true = show, false = hide 1036 1035 var showAdmin = widget.configuration.showAdmin … … 1051 1050 }) 1052 1051 1053 Autience.lifecycle.displayValidation.push(function (widget) {1052 Autience.lifecycle.displayValidation.push(function (widget) { 1054 1053 var isMobile = Autience.utils.isMobile() 1055 1054 … … 1073 1072 1074 1073 //show on specific pages 1075 Autience.lifecycle.displayValidation.push(function (widget) {1074 Autience.lifecycle.displayValidation.push(function (widget) { 1076 1075 var where = widget.configuration.where 1077 1076 var cat = null … … 1082 1081 autience_is_home = autience_is_home || (window.location.pathname == '/') || (window.location.pathname == '') 1083 1082 if (autience_is_home) { 1084 console.log('where.home is ', where.home)1083 //console.log('where.home is ', where.home) 1085 1084 return where.home 1086 1085 } … … 1144 1143 1145 1144 //for hide on specific pages 1146 Autience.lifecycle.displayValidation.push(function (widget) {1145 Autience.lifecycle.displayValidation.push(function (widget) { 1147 1146 var where = widget.configuration.where 1148 1147 var cat = null … … 1150 1149 var where_titles_hide = widget.configuration.where_titles_hide 1151 1150 1152 console.log('widget is')1153 console.log(widget)1151 // console.log('widget is') 1152 // console.log(widget) 1154 1153 1155 1154 if (where.showOrHide == 'hide' && where.hideOn && where.hideOn.hideselector) { … … 1212 1211 } 1213 1212 }; 1214 1215 1213 window.defineAutienceHow = function (yetience_callback) { 1216 1214 //Make sure that Action button shows up above anything else 1217 1215 Autience.lifecycle.postRender.push(function (widget) { 1218 console.log('Adding zindex to action buttons')1216 //console.log('Adding zindex to action buttons') 1219 1217 var button_classes = ['yel-cta-wrapper', 'yel-arrow-wrapper', 'yel-circle-wrapper', 'yel-cta-button'] 1220 1218 button_classes.map(function (this_class) { … … 1296 1294 Autience.lifecycle.render.push(function (widget) { 1297 1295 1298 console.log("WIDGET IS --")1299 console.dir(widget)1296 // console.log("WIDGET IS --") 1297 // console.dir(widget) 1300 1298 1301 1299 //create a new widget with a wrapper if it does not already exist … … 1311 1309 1312 1310 //console.log("widget.placementType:"+ widget.placementType) 1313 console.log('Type of Popup- ' + typeOfWidget)1311 // console.log('Type of Popup- ' + typeOfWidget) 1314 1312 1315 1313 switch (typeOfWidget) { 1316 1314 case "Popups": 1317 console.log("THIS IS OF TYPE - Popups");1315 // console.log("THIS IS OF TYPE - Popups"); 1318 1316 widgetDiv.style.visibility = 'hidden' 1319 1317 widgetDiv.className = "yel-popup-main-wrapper" … … 1332 1330 1333 1331 case "ActionButtons": 1334 console.log("THIS IS OF TYPE - ActionButtons");1332 // console.log("THIS IS OF TYPE - ActionButtons"); 1335 1333 widgetDiv.className = "yel-ab-main-wrapper" 1336 1334 … … 1376 1374 case "InpostWidgets": 1377 1375 //code 1378 console.log("THIS IS OF TYPE - InpostWidgets");1376 //console.log("THIS IS OF TYPE - InpostWidgets"); 1379 1377 1380 1378 var articles = document.getElementsByTagName("article"); … … 1404 1402 1405 1403 case "Sliders": 1406 console.log("THIS IS OF TYPE - Sliders");1404 // console.log("THIS IS OF TYPE - Sliders"); 1407 1405 widgetDiv.className = "yel-slider-main-wrapper" 1408 1406 … … 1420 1418 1421 1419 case "Bars": 1422 console.log("THIS IS OF TYPE - Bars");1423 widgetDiv.className = "yel-bars-main-wrapper"1420 //console.log("THIS IS OF TYPE - Bars"); 1421 // widgetDiv.className = "yel-bars-main-wrapper" 1424 1422 1425 1423 //THIS NEEDS TO BE WRITTEN BETTER HERE … … 1464 1462 case "Sidebar": 1465 1463 //code 1466 console.log("THIS IS OF TYPE - Sidebar");1464 // console.log("THIS IS OF TYPE - Sidebar"); 1467 1465 break; 1468 1466 … … 1592 1590 } 1593 1591 }; 1594 window.defineAutienceWhom = function (yetience_callback) {1592 window.defineAutienceWhom = function (yetience_callback) { 1595 1593 if (Autience) { 1596 Autience.lifecycle.display.push(function (widget) {1594 Autience.lifecycle.display.push(function (widget) { 1597 1595 //create cookies as required 1598 1596 Autience.utils.createCookie("autience-displayed-visitor-" + widget.code, true, true) … … 1601 1599 }) 1602 1600 1603 Autience.lifecycle.displayValidation.push(function (widget) {1601 Autience.lifecycle.displayValidation.push(function (widget) { 1604 1602 1605 1603 if ((Autience.utils.nestedValue(widget, ['configuration', 'whom', 'limitByReferrerSetting']))) { 1606 console.log('limitByReferrerSetting is set to ' + widget.configuration.whom.limitByReferrerSetting)1604 //console.log('limitByReferrerSetting is set to ' + widget.configuration.whom.limitByReferrerSetting) 1607 1605 //this is fallback for the old version of plugin where the setting was set to default 1608 1606 if (Autience.utils.nestedValue(widget, ['configuration', 'whom', 'limitByReferrerSetting']) == 'default') { … … 1623 1621 // console.log('comparing ' + referrer_array[i].text + ' to ' + document.referrer) 1624 1622 if (document.referrer.indexOf(referrer_array[i].text) > 0) { 1625 console.log('Disable on referrer is enabled for ' + referrer_array[i].text)1623 // console.log('Disable on referrer is enabled for ' + referrer_array[i].text) 1626 1624 isFound = true 1627 1625 } … … 1639 1637 1640 1638 1641 Autience.lifecycle.displayValidation.push(function (widget) {1639 Autience.lifecycle.displayValidation.push(function (widget) { 1642 1640 1643 1641 1644 1642 1645 1643 // if (widget.configuration.whom.cta == true) 1646 if ((Autience.utils.nestedValue(widget, ['configuration', 'whom', 'cta'])) == true) 1647 console.log('cta is set to ' + widget.configuration.whom.cta) 1644 // if ((Autience.utils.nestedValue(widget, ['configuration', 'whom', 'cta'])) == true) 1645 // console.log('cta is set to ' + widget.configuration.whom.cta) 1646 1648 1647 if (Autience.utils.readCookie("autience-visitor-subscribed-" + widget.code)) { 1649 1648 console.log('visitor subscribed, do not show popup') … … 1655 1654 1656 1655 1657 Autience.lifecycle.displayValidation.push(function (widget) {1656 Autience.lifecycle.displayValidation.push(function (widget) { 1658 1657 if (Autience.utils.nestedValue(widget, ['configuration', 'whom', 'once'])) { 1659 1658 // console.log('once is ' + widget.configuration.whom.once) … … 1661 1660 case 'visitor': 1662 1661 if (Autience.utils.readCookie("autience-displayed-visitor-" + widget.code)) { 1663 console.log('visitor cookie exists')1662 //console.log('visitor cookie exists') 1664 1663 return false 1665 1664 } … … 1667 1666 case 'session': 1668 1667 if (Autience.utils.readCookie("autience-displayed-session-" + widget.code)) { 1669 console.log('session cookie exists')1668 //console.log('session cookie exists') 1670 1669 return false 1671 1670 } … … 1688 1687 1689 1688 }; 1690 1691 window.defineAutienceClose = function(yetience_callback) { 1689 window.defineAutienceClose = function (yetience_callback) { 1692 1690 1693 1691 //this function changes the close image url based on the url's http or https 1694 Autience.lifecycle.postRender.push(function (widget) {1692 Autience.lifecycle.postRender.push(function (widget) { 1695 1693 //check the browser url to see if its http or https 1696 1694 var yel_current_url = window.location.href … … 1706 1704 if (yel_img_url.indexOf('https:') < 0) { 1707 1705 //image is from an http source 1708 console.log("url is https and image is from an http source ")1709 yel_div_list[yel_lt].src = yel_div_list[yel_lt].src.replace('http://', 'https://');1706 //console.log("url is https and image is from an http source ") 1707 yel_div_list[yel_lt].src = yel_div_list[yel_lt].src.replace('http://', 'https://'); 1710 1708 } 1711 1709 … … 1714 1712 } else { 1715 1713 //url is http - do nothing! 1716 console.log("a http url " + window.location.href)1714 //console.log("a http url " + window.location.href) 1717 1715 } 1718 1716 }) … … 1755 1753 //attach close functionality to the close button 1756 1754 //close button has an id called autience-close-widget_id 1757 Autience.lifecycle.postRender.push(function (widget) {1758 Autience.utils.classListen('autience-close-' + widget.code, 'click', function (el) {1755 Autience.lifecycle.postRender.push(function (widget) { 1756 Autience.utils.classListen('autience-close-' + widget.code, 'click', function (el) { 1759 1757 Autience.utils.closeWidget(widget) 1760 1758 }) 1761 1759 }) 1762 1760 1763 Autience.lifecycle.postRender.push(function (widget) {1764 1765 Autience.utils.idListen('autience-close-' + widget.code, 'click', function (el) {1761 Autience.lifecycle.postRender.push(function (widget) { 1762 1763 Autience.utils.idListen('autience-close-' + widget.code, 'click', function (el) { 1766 1764 //if the user clicks the close button on a link trigger, check if we need to redirect 1767 1765 … … 1774 1772 1775 1773 //hiding the facebook page like after popup close - only for facebook-page-like theme 1776 Autience.lifecycle.postRender.push(function (widget) {1777 1778 Autience.utils.idListen('autience-close-' + widget.code, 'click', function (el) {1774 Autience.lifecycle.postRender.push(function (widget) { 1775 1776 Autience.utils.idListen('autience-close-' + widget.code, 'click', function (el) { 1779 1777 if (document.getElementById("yel-facebook-popup")) { 1780 1778 document.getElementById("yel-facebook-popup").display = "none"; … … 1784 1782 1785 1783 //for close clicking outside 1786 Autience.lifecycle.postRender.push(function (widget) {1787 if (Autience.utils.nestedValue(widget, ['configuration', 'close', 'outside'])) {1788 //console.log('close on clicking outside')1789 1790 Autience.utils.classListen('yel-popup-main-wrapper', 'click', function() {1791 //console.log('clicked outside')1792 Autience.utils.closeWidget(widget)1793 })1794 Autience.utils.classListen('yel-popup-template', 'click', function(e) {1795 e.stopPropagation();1796 })1797 }1798 }) //close lifecycle1784 Autience.lifecycle.postRender.push(function (widget) { 1785 if (Autience.utils.nestedValue(widget, ['configuration', 'close', 'outside'])) { 1786 //console.log('close on clicking outside') 1787 1788 Autience.utils.classListen('yel-popup-main-wrapper', 'click', function () { 1789 //console.log('clicked outside') 1790 Autience.utils.closeWidget(widget) 1791 }) 1792 Autience.utils.classListen('yel-popup-template', 'click', function (e) { 1793 e.stopPropagation(); 1794 }) 1795 } 1796 }) //close lifecycle 1799 1797 1800 1798 1801 1799 //adding event listeners for analytics 1802 Autience.lifecycle.postRender.push(function (widget) {1800 Autience.lifecycle.postRender.push(function (widget) { 1803 1801 1804 1802 … … 1817 1815 if (typeof ga === "function") { 1818 1816 //listening for linkedimage clicks 1819 Autience.utils.classListen('yel-atr-linked-image', 'click', function (el) {1817 Autience.utils.classListen('yel-atr-linked-image', 'click', function (el) { 1820 1818 //send the popup display event 1821 1819 //alert('pinterest follow clicked22') … … 1824 1822 1825 1823 //listening for linkedtext clicks 1826 Autience.utils.classListen('yel-atr-linked-text', 'click', function (el) {1824 Autience.utils.classListen('yel-atr-linked-text', 'click', function (el) { 1827 1825 //send the popup display event 1828 1826 ga('send', 'event', yel_popup_name, 'Linked-Text-Click'); … … 1831 1829 //listening for button clicks 1832 1830 //========do something for yes no buttons 1833 Autience.utils.classListen('yel-atr-button', 'click', function (el) {1831 Autience.utils.classListen('yel-atr-button', 'click', function (el) { 1834 1832 //send the popup display event 1835 1833 ga('send', 'event', yel_popup_name, 'Button-Click'); 1836 1834 }); 1837 1835 1838 Autience.utils.classListen('yel-yes-button', 'click', function (el) {1836 Autience.utils.classListen('yel-yes-button', 'click', function (el) { 1839 1837 //send the popup display event 1840 1838 ga('send', 'event', yel_popup_name, 'Yes-Button-Click'); 1841 1839 }); 1842 Autience.utils.classListen('yel-no-button', 'click', function (el) {1840 Autience.utils.classListen('yel-no-button', 'click', function (el) { 1843 1841 //send the popup display event 1844 1842 ga('send', 'event', yel_popup_name, 'No-Button-Click'); 1845 1843 }); 1846 1844 1847 Autience.utils.classListen('yel-pinterest-follow-image', 'click', function (el) {1845 Autience.utils.classListen('yel-pinterest-follow-image', 'click', function (el) { 1848 1846 //send the popup display event 1849 1847 //alert('pinterest follow clicked') … … 1852 1850 1853 1851 //social share popup begin 1854 Autience.utils.idListen('autience-network-pinterest', 'click', function (el) {1852 Autience.utils.idListen('autience-network-pinterest', 'click', function (el) { 1855 1853 //send the popup display event 1856 1854 ga('send', 'event', yel_popup_name, 'Pinterest-Follow-Click'); 1857 1855 }); 1858 Autience.utils.idListen('autience-network-facebook', 'click', function (el) {1856 Autience.utils.idListen('autience-network-facebook', 'click', function (el) { 1859 1857 //send the popup display event 1860 1858 ga('send', 'event', yel_popup_name, 'facebook-Follow-Click'); 1861 1859 }); 1862 Autience.utils.idListen('autience-network-twitter', 'click', function (el) {1860 Autience.utils.idListen('autience-network-twitter', 'click', function (el) { 1863 1861 //send the popup display event 1864 1862 ga('send', 'event', yel_popup_name, 'twitter-Follow-Click'); 1865 1863 }); 1866 Autience.utils.idListen('autience-network-googleplus', 'click', function (el) {1864 Autience.utils.idListen('autience-network-googleplus', 'click', function (el) { 1867 1865 //send the popup display event 1868 1866 ga('send', 'event', yel_popup_name, 'googleplus-Follow-Click'); 1869 1867 }); 1870 Autience.utils.idListen('autience-network-linkedin', 'click', function (el) {1868 Autience.utils.idListen('autience-network-linkedin', 'click', function (el) { 1871 1869 //send the popup display event 1872 1870 ga('send', 'event', yel_popup_name, 'linkedin-Follow-Click'); 1873 1871 }); 1874 Autience.utils.idListen('autience-network-reddit', 'click', function (el) {1872 Autience.utils.idListen('autience-network-reddit', 'click', function (el) { 1875 1873 //send the popup display event 1876 1874 ga('send', 'event', yel_popup_name, 'reddit-Follow-Click'); 1877 1875 }); 1878 Autience.utils.idListen('autience-network-whatsapp', 'click', function (el) {1876 Autience.utils.idListen('autience-network-whatsapp', 'click', function (el) { 1879 1877 //send the popup display event 1880 1878 ga('send', 'event', yel_popup_name, 'whatsapp-Follow-Click'); 1881 1879 }); 1882 Autience.utils.idListen('autience-network-flipboard', 'click', function (el) {1880 Autience.utils.idListen('autience-network-flipboard', 'click', function (el) { 1883 1881 //send the popup display event 1884 1882 ga('send', 'event', yel_popup_name, 'flipboard-Follow-Click'); 1885 1883 }); 1886 Autience.utils.idListen('autience-network-baidu', 'click', function (el) {1884 Autience.utils.idListen('autience-network-baidu', 'click', function (el) { 1887 1885 //send the popup display event 1888 1886 ga('send', 'event', yel_popup_name, 'baidu-Follow-Click'); 1889 1887 }); 1890 Autience.utils.idListen('autience-network-sinaweibo', 'click', function (el) {1888 Autience.utils.idListen('autience-network-sinaweibo', 'click', function (el) { 1891 1889 //send the popup display event 1892 1890 ga('send', 'event', yel_popup_name, 'sinaweibo-Follow-Click'); 1893 1891 }); 1894 Autience.utils.idListen('autience-network-slashdot', 'click', function (el) {1892 Autience.utils.idListen('autience-network-slashdot', 'click', function (el) { 1895 1893 //send the popup display event 1896 1894 ga('send', 'event', yel_popup_name, 'slashdot-Follow-Click'); 1897 1895 }); 1898 Autience.utils.idListen('autience-network-vkontakte', 'click', function (el) {1896 Autience.utils.idListen('autience-network-vkontakte', 'click', function (el) { 1899 1897 //send the popup display event 1900 1898 ga('send', 'event', yel_popup_name, 'vkontakte-Follow-Click'); … … 1903 1901 1904 1902 //email popup subscribe event 1905 Autience.utils.classListen('yel-ep-submit-button', 'click', function (el) {1903 Autience.utils.classListen('yel-ep-submit-button', 'click', function (el) { 1906 1904 //send the popup display event 1907 1905 ga('send', 'event', yel_popup_name, 'Subscribe-Button-Click'); 1908 1906 }); 1909 Autience.utils.classListen('yel-email-popup-button-large', 'click', function (el) {1907 Autience.utils.classListen('yel-email-popup-button-large', 'click', function (el) { 1910 1908 //send the popup display event 1911 1909 ga('send', 'event', yel_popup_name, 'Subscribe-Button-Click'); … … 1919 1917 1920 1918 1921 Autience.lifecycle.close.push(function (widget) {1919 Autience.lifecycle.close.push(function (widget) { 1922 1920 document.getElementById(widget.code).style.visibility = 'hidden' 1923 1921 if (widget.default_display) { … … 1928 1926 1929 1927 //close the zopim window if needed 1930 Autience.lifecycle.close.push(function (widget) {1928 Autience.lifecycle.close.push(function (widget) { 1931 1929 if (typeof $zopim != 'undefined') { 1932 1930 $zopim.livechat.window.hide(); … … 1936 1934 1937 1935 //send an analytics event is applicable 1938 Autience.lifecycle.close.push(function (widget) {1936 Autience.lifecycle.close.push(function (widget) { 1939 1937 1940 1938 … … 1960 1958 1961 1959 1962 Autience.lifecycle.postRender.push(function (widget) {1960 Autience.lifecycle.postRender.push(function (widget) { 1963 1961 //Show an alertbox before the browser window closes 1964 console.log('before close') 1965 console.log(widget) 1962 1966 1963 1967 1964 if (Autience.utils.nestedValue(widget, ['configuration', 'close', 'alert'])) { 1968 window.onbeforeunload = function (e) {1965 window.onbeforeunload = function (e) { 1969 1966 return Autience.utils.nestedValue(widget, ['configuration', 'close', 'message']) 1970 1967 }; … … 1976 1973 } 1977 1974 }; 1978 1979 1975 window.defineAutienceEmail = function (yetience_callback) { 1980 1976 //console.log('injecting email.js') … … 2227 2223 2228 2224 }; 2229 window.defineAutienceGDPR = function (yetience_callback) {2225 window.defineAutienceGDPR = function (yetience_callback) { 2230 2226 //console.log('injecting email.js') 2231 2227 if (Autience) { 2232 2228 2233 Autience.lifecycle.postRender.push(function (widget) {2234 console.log('Inside GDPR client side code')2229 Autience.lifecycle.postRender.push(function (widget) { 2230 // console.log('Inside GDPR client side code') 2235 2231 toggleSubmitButton(widget) 2236 2232 2237 Autience.utils.classListen('yel-gdpr-checkbox-' + widget.code, 'click', function (el) {2233 Autience.utils.classListen('yel-gdpr-checkbox-' + widget.code, 'click', function (el) { 2238 2234 toggleSubmitButton(widget) 2239 2235 }) … … 2253 2249 var num_checked = 0 2254 2250 2255 console.log('checkboxes ', gdpr_checkboxes)2251 // console.log('checkboxes ', gdpr_checkboxes) 2256 2252 2257 2253 var show_consent = Autience.utils.nestedValue(widget, ['components', 'gdprPlaceholder', 'values', 'showConsentCheckbox']) 2258 2254 var show_terms = Autience.utils.nestedValue(widget, ['components', 'gdprPlaceholder', 'values', 'showTermsOfService']) || Autience.utils.nestedValue(widget, ['components', 'gdprPlaceholder', 'values', 'showPrivacyPolicy']) 2259 console.log("consent = ",show_consent," show terms = ",show_terms);2255 // console.log("consent = ", show_consent, " show terms = ", show_terms); 2260 2256 var num_to_be_checked = show_consent + show_terms 2261 2257 … … 2264 2260 num_checked = num_checked + gdpr_checkboxes[i].checked 2265 2261 } 2266 console.log('num_to_be_checked ', num_to_be_checked, 'num_checked ', num_checked)2262 // console.log('num_to_be_checked ', num_to_be_checked, 'num_checked ', num_checked) 2267 2263 2268 2264 var submit_button = document.getElementById(submit_id) … … 2282 2278 2283 2279 }; 2284 2285 2280 window.defineAutienceSocial = function(yetience_callback) { 2286 2281 //console.log('injecting social.js') … … 2548 2543 } 2549 2544 2550 window.defineAutienceActionButton = function (yetience_callback) {2545 window.defineAutienceActionButton = function (yetience_callback) { 2551 2546 //honor disable widget setting 2552 2547 2553 Autience.lifecycle.displayValidation.push(function (widget) {2548 Autience.lifecycle.displayValidation.push(function (widget) { 2554 2549 //return true = show, false = hide 2555 2550 if (isActionButtonTheme(widget.themeType)) { … … 2557 2552 2558 2553 if (widget_enabled) { 2559 console.log('enabled')2554 //console.log('enabled') 2560 2555 return true 2561 2556 } else { 2562 console.log('disabled')2557 // console.log('disabled') 2563 2558 return false 2564 2559 } … … 2570 2565 2571 2566 //Keep the button on screen when "no" is clicked in yes no popup 2572 Autience.lifecycle.postRender.push(function (widget) {2567 Autience.lifecycle.postRender.push(function (widget) { 2573 2568 if (isActionButtonTheme(widget.themeType) && widget.theme == "action-button-yesno") { 2574 2569 … … 2576 2571 // if (widget.components.button1Link.values.operation == 'close') { 2577 2572 if ((Autience.utils.nestedValue(widget, ['components', 'button1Link', 'values', 'operation'])) == 'close') { 2578 Autience.utils.classListen('yel-yes-button', 'click', function (el) {2573 Autience.utils.classListen('yel-yes-button', 'click', function (el) { 2579 2574 document.getElementsByClassName("yel-ab-main-wrapper")[0].style.visibility = "visible" 2580 2575 document.getElementById("yel-main-box-wrapper").style.display = "none" … … 2587 2582 // if (widget.components.button2Link.values.operation == 'close') { 2588 2583 if ((Autience.utils.nestedValue(widget, ['components', 'button2Link', 'values', 'operation'])) == 'close') { 2589 Autience.utils.classListen('yel-no-button', 'click', function (el) {2584 Autience.utils.classListen('yel-no-button', 'click', function (el) { 2590 2585 document.getElementsByClassName("yel-ab-main-wrapper")[0].style.visibility = "visible" 2591 2586 document.getElementById("yel-main-box-wrapper").style.display = "none" … … 2598 2593 2599 2594 //close on closing small popup 2600 Autience.lifecycle.postRender.push(function (widget) {2595 Autience.lifecycle.postRender.push(function (widget) { 2601 2596 if (isActionButtonTheme(widget.themeType)) { 2602 Autience.utils.classListen('yel-arrow-box-close', 'click', function (el) {2603 console.log('yel-arrow-box-close clicked')2597 Autience.utils.classListen('yel-arrow-box-close', 'click', function (el) { 2598 //console.log('yel-arrow-box-close clicked') 2604 2599 document.getElementById("yel-arrow-wrapper").style.display = "none" 2605 2600 }) … … 2608 2603 2609 2604 //close on closing Large popup 2610 Autience.lifecycle.postRender.push(function (widget) {2605 Autience.lifecycle.postRender.push(function (widget) { 2611 2606 if (isActionButtonTheme(widget.themeType)) { 2612 Autience.utils.classListen('yel-mb-close', 'click', function (el) {2613 console.log('yel-main-box-close clicked')2607 Autience.utils.classListen('yel-mb-close', 'click', function (el) { 2608 //console.log('yel-main-box-close clicked') 2614 2609 document.getElementById("yel-main-box-wrapper").style.display = "none" 2615 2610 }) … … 2618 2613 2619 2614 //big popup on clicking button 2620 Autience.lifecycle.postRender.push(function (widget) {2615 Autience.lifecycle.postRender.push(function (widget) { 2621 2616 if (isActionButtonTheme(widget.themeType)) { 2622 2617 document.getElementsByClassName("yel-main-box-wrapper")[0].style.display = "none"; 2623 Autience.utils.classListen('yel-cta-button', 'click', function (el) {2618 Autience.utils.classListen('yel-cta-button', 'click', function (el) { 2624 2619 //Open big popup 2625 2620 //set css as display:block for yel-main-box-wrapper -
yeloni-free-exit-popup/trunk/wordpress/client-wordpress.js
r1776621 r2031392 1 1 //1. load loader.js 2 2 //2. once loader.js is loaded, load the client dependencies 3 console.log('inside client-wordpress.js')3 //console.log('inside client-wordpress.js') 4 4 5 window.loadYetience = function (yetience_callback) {5 window.loadYetience = function (yetience_callback) { 6 6 7 7 if (window.yetience && window.yetience.path) { … … 9 9 window.yetience_load_app_called = true 10 10 //console.log('calling window.yetience.loadApp') 11 window.yetience.loadApp(window.yetience.path + "/client", function () {11 window.yetience.loadApp(window.yetience.path + "/client", function () { 12 12 //console.log('completed window.yetience.loadApp') 13 13 window.yetience.all_scripts_loaded = true 14 //make sure that all other scripts are loaded before calling this14 //make sure that all other scripts are loaded before calling this 15 15 16 if (yetience_callback){16 if (yetience_callback) { 17 17 yetience_callback() 18 18 } … … 20 20 }) 21 21 } 22 22 23 23 }; -
yeloni-free-exit-popup/trunk/yetience-plugin.php
r2029975 r2031392 4 4 Plugin URI: # 5 5 Description: Exit Popups are the best way to engage visitors leaving your website. Show offers, social buttons, email signup forms or customize it as you like. 6 Version: 9.0. 26 Version: 9.0.3 7 7 Author: Jayasri Nagrale 8 8 Author URI: http://www.yeloni.com
Note: See TracChangeset
for help on using the changeset viewer.