PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.3.7
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.3.7
7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / assets / js / wp-dashboard.min.js
wordpress-popup / assets / js Last commit date
vendor 5 years ago adblock.js 5 years ago admin.debug.js 5 years ago admin.min.js 5 years ago front.debug.js 5 years ago front.min.js 5 years ago preview.debug.js 5 years ago preview.min.js 5 years ago shared-ui.min.js 5 years ago wp-dashboard.debug.js 5 years ago wp-dashboard.min.js 5 years ago
wp-dashboard.min.js
1 lines
1 !function(t){"use strict";({$widget:t(".hustle-widget"),activeModuleType:"",activeDisplayType:"total",activeTrackingType:"conversion",activeDaysRange:"7",trackingData:{},totalsData:{},daysLabels:[],theChart:null,init:function(){var t=this;this.$widget.find("#hustle-analytics-apply").on("click",function(e){return t.trackingAndDaysUpdated(e)}),this.$widget.find(".hustle-options-chart .hustle-option").on("click",function(e){return t.moduleTypeSelected(e)}),this.$widget.find(".hustle-options-embed .hustle-option").on("click",function(e){return t.displayTypeSelected(e)}),this.setDaysLabels(),this.setModuleType(this.$widget.find(".hustle-options-chart .hustle-option.hustle-active").data("module-type")),this.retrieveData()},trackingAndDaysUpdated:function(t){t.preventDefault();var e=this.activeDaysRange;if(this.activeTrackingType=this.$widget.find("#hustle-analytics-show").val(),this.activeDaysRange=this.$widget.find("#hustle-analytics-data").val(),this.setDaysLabels(),e===this.activeDaysRange)return this.buildChart(),void this.updateTotals();this.retrieveData()},setDaysLabels:function(){var t=-1*this.activeDaysRange;this.daysLabels=hustleVars.days_labels.slice(t)},retrieveData:function(){var e=this,i=this.$widget.data("nonce"),a=this.$widget.find(".hustle-message-empty"),s={_ajax_nonce:i,action:"hustle_get_wp_dashboard_widget_data",days:this.activeDaysRange,trackingType:this.activeTrackingType};t.ajax({url:ajaxurl,type:"POST",data:s,success:function(t){t.success&&t.data?(e.trackingData=t.data.data,e.totalsData=t.data.totals,e.buildChart(),e.updateTotals()):a.show()},error:function(){a.show()}})},moduleTypeSelected:function(e){var i=t(e.currentTarget),a=i.data("moduleType");this.setModuleType(a)&&(this.markButtonAsSelected(i),this.buildChart())},setModuleType:function(t){var e=this.$widget.find(".hustle-options-embed");if(["slidein","popup","overall"].includes(t))e.hide();else if("social_sharing"===t)e.show(),e.find('[data-display-type="floating"]').show();else{if("embedded"!==t)return!1;e.show(),e.find('[data-display-type="floating"]').hide()}return this.activeModuleType=t,this.buildTrackingActionSelect(),!0},displayTypeSelected:function(e){if(["embedded","social_sharing"].includes(this.activeModuleType)){var i=t(e.currentTarget),a=i.data("displayType");"floating"===a&&"social_sharing"!==this.activeModuleType||(this.markButtonAsSelected(i),this.activeDisplayType=a,this.buildChart())}},markButtonAsSelected:function(t){t.siblings(".hustle-option").removeClass("hustle-active").attr("aria-selected",!1),t.addClass("hustle-active").attr("aria-selected",!0)},buildTrackingActionSelect:function(){var t=this.$widget.find("#hustle-analytics-show"),e=["popup","slidein","embedded"],i=!hustleVars.active_module_types.some(function(t){return e.includes(t)}),a="",s=Object.assign({},hustleVars.tracking_actions);for(var n in("social_sharing"===this.activeModuleType||i)&&(delete s.cta_conversion,delete s.optin_conversion,"cta_conversion"!==this.activeTrackingType&&"optin_conversion"!==this.activeTrackingType||(this.activeTrackingType="view")),s){var o=n===this.activeTrackingType?"selected":"";a+='<option value="'.concat(n,'" ').concat(o,">").concat(s[n],"</option>")}t.html(a)},updateTotals:function(){var t=this.totalsData,e=function(t){return'<span class="sui-icon-arrow-'.concat(t,' sui-sm" aria-hidden="true"></span>')};for(var i in t){var a=this.$widget.find('.hustle-options-chart .hustle-option[data-module-type="'.concat(i,'"]')),s=a.find(".hustle-option--value"),n=a.find(".hustle-option--trend"),o=t[i],l=o[this.activeTrackingType].total,r=o[this.activeTrackingType].trend,d="";n.removeClass("hustle-up"),n.removeClass("hustle-down"),0!==r&&(0<r?(n.addClass("hustle-up"),d+=e("up")):(n.addClass("hustle-down"),d+=e("down"))),s.text(l),d+=r+"%",n.html(d)}},formatDataForChart:function(){var t=this.trackingData,e=this.activeModuleType,i=this.activeDisplayType,a=this.activeTrackingType,s=this.$widget.find(".hustle-message-empty"),n={},o={},l=e,r=!1;try{if(["popup","slidein","overall"].includes(e)||"total"===i)n=t[l];else{if("floating"===i&&"social_sharing"!==e)throw!1;n=t[l=e+"_"+i]}if(void 0===n)throw!1;if(r=0===this.totalsData.overall.view.total&&0===this.totalsData.overall.conversion.total,!n||!Object.keys(n).length)throw!1;if(void 0===(o=n[a])||!Object.keys(o).length)throw!1;o=Object.values(o)}catch(t){r=!0,o=Array(parseInt(this.activeDaysRange)).fill(0)}return r?s.show():s.hide(),o},buildChart:function(){var t=this.formatDataForChart(),e=[{label:hustleVars.tracking_actions[this.activeTrackingType],data:t,backgroundColor:["transparent"],borderColor:["#0085BA"],borderWidth:2,pointRadius:0,pointHitRadius:20,pointHoverRadius:4,pointHoverBorderColor:"#0085BA",pointHoverBackgroundColor:"#FFFFFF"}];this.theChart&&this.theChart.destroy(),this.createNewChart(e)},createNewChart:function(t){var e=this.$widget.find("#hustle-analytics-chart"),i=hustleVars.tracking_actions[this.activeTrackingType],a={labels:this.daysLabels,datasets:t},s={responsive:!0,maintainAspectRatio:!1,legend:{display:!1},scales:{yAxes:[{gridLines:{display:!0,color:"#F8F8F8",zeroLineColor:"#F8F8F8",drawBorder:!1},ticks:{fontColor:"#72777C",fontSize:11}}],xAxes:[{gridLines:{display:!1,zeroLineColor:"rgba(0,0,0,0)",drawBorder:!1},ticks:{fontColor:"#72777C",fontSize:11}}]},elements:{line:{tension:0},point:{radius:.5}},tooltips:{xPadding:12,yPadding:8,backgroundColor:"#333333",titleFontColor:"#FFFFFF",titleFontSize:15,titleFontFamily:"Roboto",titleFontStyle:"normal",titleAlign:"left",titleSpacing:0,titleMarginBottom:2,bodyFontColor:"#AAAAAA",bodyFontSize:11,bodyFontFamily:"Roboto",bodyFontStyle:"normal",bodyAlign:"left",cornerRadius:4,displayColors:!1,callbacks:{title:function(t){return t[0].yLabel+" "+i},label:function(t){return t.xLabel}}}};this.theChart=new Chart(e[0],{type:"line",fill:"start",data:a,options:s})}}).init()}(jQuery);