PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.14
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.14
7.8.14 7.8.14.1 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 3 years ago ad.min.js 2 years ago admin.min.js 4 days ago front.min.js 4 days ago preview.min.js 1 month ago shared-tutorials.min.js 5 months ago shared-ui.min.js 5 months ago wordpress-popup.min.js 1 month ago wp-dashboard.min.js 10 months 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(){this.$widget.find("#hustle-analytics-apply").on("click",t=>this.trackingAndDaysUpdated(t)),this.$widget.find(".hustle-options-chart .hustle-option").on("click",t=>this.moduleTypeSelected(t)),this.$widget.find(".hustle-options-embed .hustle-option").on("click",t=>this.displayTypeSelected(t)),this.setDaysLabels(),this.setModuleType(this.$widget.find(".hustle-options-chart .hustle-option.hustle-active").data("module-type")),this.retrieveData(),this.$widget.find("#hustle-dashboard-widget-reload-cache").on("click",t=>this.reloadCache(t))},trackingAndDaysUpdated(t){t.preventDefault();const 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(){const t=-1*this.activeDaysRange;this.daysLabels=hustleVars.days_labels.slice(t)},retrieveData(e=!1){const a=this,i=this.$widget.data("nonce"),s=this.$widget.find(".hustle-message-empty"),o={_ajax_nonce:i,action:"hustle_get_wp_dashboard_widget_data",days:this.activeDaysRange,delete_cache:e,trackingType:this.activeTrackingType};t.ajax({url:ajaxurl,type:"POST",data:o,success(t){t.success&&t.data?(a.trackingData=t.data.data,a.totalsData=t.data.totals,a.buildChart(),a.updateTotals(),a.showLastUpdated(t.data.last_updated)):s.show()},error(){s.show(),a.showLastUpdated(!1)}})},moduleTypeSelected(e){const a=t(e.currentTarget),i=a.data("moduleType");this.setModuleType(i)&&(this.markButtonAsSelected(a),this.buildChart())},setModuleType(t){const 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(e){if(!["embedded","social_sharing"].includes(this.activeModuleType))return;const a=t(e.currentTarget),i=a.data("displayType");"floating"===i&&"social_sharing"!==this.activeModuleType||(this.markButtonAsSelected(a),this.activeDisplayType=i,this.buildChart())},markButtonAsSelected(t){t.siblings(".hustle-option").removeClass("hustle-active").attr("aria-selected",!1),t.addClass("hustle-active").attr("aria-selected",!0)},buildTrackingActionSelect(){const t=this.$widget.find("#hustle-analytics-show"),e=["popup","slidein","embedded"],a=!hustleVars.active_module_types.some(t=>e.includes(t));let i="";const s=Object.assign({},hustleVars.tracking_actions);("social_sharing"===this.activeModuleType||a)&&(delete s.cta_conversion,delete s.optin_conversion,"cta_conversion"!==this.activeTrackingType&&"optin_conversion"!==this.activeTrackingType||(this.activeTrackingType="view"));for(const t in s)i+=`<option value="${t}" ${t===this.activeTrackingType?"selected":""}>${s[t]}</option>`;t.html(i)},updateTotals(){const t=this.totalsData,e=t=>`<span class="sui-icon-arrow-${t} sui-sm" aria-hidden="true"></span>`;for(const a in t){const i=this.$widget.find(`.hustle-options-chart .hustle-option[data-module-type="${a}"]`),s=i.find(".hustle-option--value"),o=i.find(".hustle-option--trend"),l=t[a],d=l[this.activeTrackingType].total,n=l[this.activeTrackingType].trend;let r="";o.removeClass("hustle-up"),o.removeClass("hustle-down"),0!==n&&(0<n?(o.addClass("hustle-up"),r+=e("up")):(o.addClass("hustle-down"),r+=e("down"))),s.text(d),r+=n+"%",o.html(r)}},formatDataForChart(){const t=this.trackingData,e=this.activeModuleType,a=this.activeDisplayType,i=this.activeTrackingType,s=this.$widget.find(".hustle-message-empty");let o={},l={},d=e,n=!1;try{if(["popup","slidein","overall"].includes(e)||"total"===a)o=t[d];else{if("floating"===a&&"social_sharing"!==e)throw!1;d=e+"_"+a,o=t[d]}if(void 0===o)throw!1;if(n=0===this.totalsData.overall.view.total&&0===this.totalsData.overall.conversion.total,!o||!Object.keys(o).length)throw!1;if(l=o[i],void 0===l||!Object.keys(l).length)throw!1;l=Object.values(l)}catch(t){n=!0,l=Array(parseInt(this.activeDaysRange)).fill(0)}return n?s.show():s.hide(),l},buildChart(){const 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)},showLastUpdated(e){if(t(".hustle-dashboard-widget-loader").hide(),!e||"1 second"===e)return void t(".hustle-dashboard-widget-heading-extra").hide();const a=hustleVars.last_updated_ago.replace("{time}",_.escape(e));t("#hustle-dashboard-widget-last-updated").text(a),t(".hustle-dashboard-widget-heading-extra").show()},reloadCache(e){e.preventDefault(),t(".hustle-dashboard-widget-loader").show(),t("#hustle-dashboard-widget-last-updated").text(hustleVars.loading),t(".hustle-dashboard-widget-heading-extra").show(),this.retrieveData(!0)},createNewChart(t){const e=this.$widget.find("#hustle-analytics-chart"),a=hustleVars.tracking_actions[this.activeTrackingType],i={labels:this.daysLabels,datasets:t},s={responsive:!0,maintainAspectRatio:!1,scales:{y:{grid:{display:!0,color:"#F8F8F8",zeroLineColor:"#F8F8F8",drawBorder:!1},ticks:{color:"#72777C",font:{size:11}}},x:{grid:{display:!1,zeroLineColor:"rgba(0,0,0,0)",drawBorder:!1},ticks:{color:"#72777C",font:{size:11}}}},elements:{line:{tension:0},point:{radius:.5}},plugins:{legend:{display:!1},tooltip:{padding:{x:12,y: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(t){return t[0].formattedValue+" "+a},label(t){return t.label}}}}};this.theChart=new Chart(e[0],{type:"line",fill:"start",data:i,options:s})}}).init()}(jQuery);