PATH:
home
/
lab2454c
/
veritserv.net
/
wp-content
/
plugins
/
user-registration-extras
/
assets
/
js
/
admin
jQuery(function(g){var h={init:function(){this.dashboard_load_event()},dashboard_load_event:function(){g(document).ready(function(){g(".user-registration-extras-dashboard-select-form").trigger("change"),g(".user-registration-extras-date-switcher").on("click",function(){if(!g(this).hasClass("is-active")){g(this).addClass("is-active");var e=g(this).attr("class").split(" ")[3];g(".user-registration-extras-date-switcher:not(."+e+")").removeClass("is-active"),g("#date-range-selector").val(""),g(".user-registration-extras-dashboard-select-form").trigger("change")}});var t={};g(".user-registration-extras-date-range-selector").on("click",function(){var e=g(this).data("id"),r=t[e];r||(r=g(this).flatpickr({mode:"range",disableMobile:!0,dateFormat:"Y-m-d","static":!0,onClose:function(e,r,t){0!==e.length&&(g(".user-registration-extras-date-switcher").removeClass("is-active"),r!==g(".user-registration-extras-date-checker").val()&&(g(".user-registration-extras-date-checker").val(r),g(".user-registration-extras-dashboard-select-form").trigger("change")))}}),t[e]=r),r&&r.open()})}),g(".user-registration-extras-dashboard-select-form").on("change",function(){var r="Week";g(".user-registration-extras-date-switcher").each(function(){var e=g("#date-range-selector").val();""!==e?r=e:g(this).hasClass("is-active")&&(r=g(this).html())});var u=g(this).val(),e={action:"user_registration_extras_dashboard_analytics",form_id:u,selected_date:r};g(".user-registration-extras-dashboard__body").html('<div class="user-registration-card ur-text-center"><div class="user-registration-card__body"><span class="ur-spinner"></span></div></div>'),g.ajax({url:user_registration_extras_script_data.ajax_url,data:e,type:"POST",success:function(e){var r=e.data.message,t=e.data.user_report,a=t.weekly_data.daily_data;g(".user-registration-extras-dashboard__body").html(r),"all"===u&&h.specific_registration_source_chart(t);var s=g("#user-registration-extras-registration-overview-chart-report-area"),i=Object.keys(a),o=[],n=[],l=[],c=[];i.forEach(function(e){o.push(a[e].new_registration_in_a_day),n.push(a[e].approved_users_in_a_day),l.push(a[e].pending_users_in_a_day),c.push(a[e].denied_users_in_a_day)});var d=new Chart(s,{type:"line",data:{datasets:[{label:"New User Registration",fill:!1,borderColor:"red",data:o},{label:"Approved Users",fill:!1,borderColor:"blue",data:n},{label:"Pending Users",fill:!1,borderColor:"#800020",data:l}],labels:i},options:{responsive:!0,legend:{display:!1},scales:{xAxes:[{ticks:{maxTicksLimit:10}}]},legendCallback:function(e){var r=[];r.push('<ul class="user-registration-extras-legend-'+e.id+' ur-d-flex ur-flex-wrap ur-mt-3 ur-mb-0">');for(var t=0;t<3;t++)r.push('<li><span class="user-registration-extras-color-tag" style="background-color:'+e.data.datasets[t].borderColor+'"></span>'),e.data.datasets[t].label&&r.push(e.data.datasets[t].label),r.push("</li>");return r.push("</ul>"),r.join("")}}});g(".user-registration-total-registration-chart").find(".user-registration-extras-registration-overview-chart-report-legends").html(d.generateLegend())}})})},specific_registration_source_chart:function(e){var r=e,t=g("#user-registration-extras-specific-form-registration-overview-chart-report-area"),a=Object.keys(r.specific_form_registration).sort(),s=[],i=[];a.forEach(function(e){s.push(r.specific_form_registration),i.push(r.specific_form_registration[e])});for(var o=[],n=0;n<a.length;n++)o.push(h.getRandomColor());var l=new Chart(t,{type:"doughnut",data:{datasets:[{backgroundColor:o,data:i}],labels:a},options:{responsive:!0,legend:{display:!1},legendCallback:function(e){var r=[];r.push('<ul class="user-registration-extras-legend-'+e.id+' ur-d-flex ur-flex-wrap ur-mt-3 ur-mb-0">');for(var t=0;t<e.data.labels.length;t++)r.push('<li><span class="user-registration-extras-color-tag" style="background-color:'+e.data.datasets[0].backgroundColor[t]+'"></span>'),e.data.labels[t]&&r.push(e.data.labels[t]),r.push("</li>");return r.push("</ul>"),r.join("")}}});g(".user-registration-specific-registration-chart").find(".user-registration-extras-specific-form-registration-overview-chart-report-legends").html(l.generateLegend())},getRandomColor:function(){for(var e="#",r=0;r<6;r++)e+="0123456789ABCDEF"[Math.floor(16*Math.random())];return e}};h.init(),g(".user-registration-extras-select-popup-type").ready(function(){"Login"===g("#select2-user_registration_extras_popup_type-container").attr("title")&&g(".single-registration-select").toggle()}),g(".user-registration-extras-select-popup-type").on("change",function(){g("#select2-user_registration_extras_popup_type-container").attr("title");g(this).closest("#mainform").find(".single-registration-select").toggle()})});
[+]
..
[-] user-registration-extras-admin-script.js
[edit]
[-] user-registration-extras-admin-script.min.js
[edit]