PluginProbe ʕ •ᴥ•ʔ
Post Views Counter / 1.7.3
Post Views Counter v1.7.3
1.7.13 1.7.12 1.7.11 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.2 1.3.2.1 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.7.0 1.7.1 1.7.10 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9
post-views-counter / js / admin-dashboard.js
post-views-counter / js Last commit date
admin-dashboard.js 5 months ago admin-post.js 5 months ago admin-quick-edit.js 5 months ago admin-settings.js 5 months ago admin-theme.js 5 months ago admin-widgets.js 5 months ago block-editor.js 5 months ago column-modal.js 5 months ago counter.js 5 months ago dummy.js 5 months ago frontend.js 5 months ago integration-gutenberg.js 5 months ago
admin-dashboard.js
5 lines
1 ;(function($, window, document){
2 !function($){window.addEventListener("load",function(){window.pvcUpdatePostViewsWidget(),window.pvcUpdatePostMostViewedWidget()}),$(function(){$(".pvc-accordion-header").on("click",function(e){$(e.currentTarget).closest(".pvc-accordion-item").toggleClass("pvc-collapsed");var t=$("#pvc-dashboard-accordion").find(".pvc-accordion-item"),n={};t.length>0&&$(t).each(function(e,t){var a=$(t).attr("id");a=a.replace("pvc-",""),n[a]=$(t).hasClass("pvc-collapsed")}),window.pvcUpdateUserOptions({menu_items:n})})});var e=$({});$.pvcAjaxQueue=function(t){var n,a=$.Deferred(),o=a.promise(),i=function(e){(n=$.ajax(t)).done(a.resolve).fail(a.reject).then(e,e)};return e.queue(i),o.abort=function(s){if(n)return n.abort(s);var d=e.queue(),r=$.inArray(i,d);return r>-1&&d.splice(r,1),a.rejectWith(t.context||t,[o,s,""]),o},o},window.pvcUpdateUserOptions=function(e){$.pvcAjaxQueue({url:pvcArgs.ajaxURL,type:"POST",dataType:"json",data:{action:"pvc_dashboard_user_options",nonce:pvcArgs.nonceUser,options:e},success:function(){}})},window.pvcUpdateConfig=function(e,t){return e.data=t.data,e.options.plugins.tooltip={callbacks:{title:function(e){return t.data.dates[e[0].dataIndex]}}},$.each(e.data.datasets,function(e,n){n.fill=t.design.fill,n.tension=.4,n.borderColor=t.design.borderColor,n.backgroundColor=t.design.backgroundColor,n.borderWidth=t.design.borderWidth,n.borderDash=t.design.borderDash,n.pointBorderColor=t.design.pointBorderColor,n.pointBackgroundColor=t.design.pointBackgroundColor,n.pointBorderWidth=t.design.pointBorderWidth}),e};var t=function(e,t,n){$(n).addClass("loading").find(".spinner").addClass("is-active"),$.ajax({url:pvcArgs.ajaxURL,type:"POST",dataType:"json",data:{action:"pvc_dashboard_post_most_viewed",nonce:pvcArgs.nonce,period:t,lang:pvcArgs.lang?pvcArgs.lang:""},success:function(t){$(n).removeClass("loading"),$(n).find(".spinner").removeClass("is-active"),e||a(t.dates,n),$(n).find("#pvc-post-most-viewed-content").html(t.html),s("pvc-dashboard-widget-loaded",t)}})},n=function(e,t,n){$(n).addClass("loading").find(".spinner").addClass("is-active"),$.ajax({url:pvcArgs.ajaxURL,type:"POST",dataType:"json",data:{action:"pvc_dashboard_post_views_chart",nonce:pvcArgs.nonce,period:t,lang:pvcArgs.lang?pvcArgs.lang:""},success:function(t){if($(n).removeClass("loading"),$(n).find(".spinner").removeClass("is-active"),e){var o={type:"line",options:{maintainAspectRatio:!1,responsive:!0,plugins:{legend:{display:!0,position:"bottom",align:"center",fullSize:!0,onHover:function(e){e.native.target.style.cursor="pointer"},onLeave:function(e){e.native.target.style.cursor="default"},onClick:function(e,t,n){var a=t.datasetIndex,o=n.chart,i=o.getDatasetMeta(a);i.hidden=!!o.isDatasetVisible(a),o.update(),window.pvcUpdateUserOptions({post_type:o.data.datasets[a].post_type,hidden:i.hidden})},labels:{boxWidth:8,boxHeight:8,font:{size:13,weight:"normal",family:"'-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'sans-serif'"},padding:10,usePointStyle:!1,textAlign:"center"}}},scales:{x:{display:!0,title:{display:!1}},y:{display:!0,grace:0,beginAtZero:!0,title:{display:!1},ticks:{precision:0,maxTicksLimit:12}}},hover:{mode:"label"}}};o=window.pvcUpdateConfig(o,t),window.postViewsChart=new Chart(document.getElementById("pvc-post-views-chart").getContext("2d"),o)}else a(t.dates,n),window.postViewsChart.config=window.pvcUpdateConfig(window.postViewsChart.config,t),window.postViewsChart.update();s("pvc-dashboard-widget-loaded",t)}})};window.pvcUpdatePostViewsWidget=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=$("#pvc-post-views").find(".pvc-dashboard-container");$(t).length>0&&(a(!1,t),n(!0,e,t))},window.pvcUpdatePostMostViewedWidget=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=$("#pvc-post-most-viewed").find(".pvc-dashboard-container");$(n).length>0&&(a(!1,n),t(!0,e,n))};var a=function(e,t){var n=$(t).find(".pvc-date-nav")[0];if(n){!1!==e&&(n.innerHTML=e);var a=n.getElementsByClassName("prev")[0],s=n.getElementsByClassName("next")[0],d=$(t).closest(".pvc-accordion-item").attr("id");"pvc-post-most-viewed"===d?a.addEventListener("click",function(e){e.preventDefault(),i(e.target.dataset.date)}):"pvc-post-views"===d&&a.addEventListener("click",function(e){e.preventDefault(),o(e.target.dataset.date)}),"A"===s.tagName&&("pvc-post-most-viewed"===d?s.addEventListener("click",function(e){e.preventDefault(),i(e.target.dataset.date)}):"pvc-post-views"===d&&s.addEventListener("click",function(e){e.preventDefault(),o(e.target.dataset.date)}))}},o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=$("#pvc-post-views").find(".pvc-dashboard-container");n(!1,e,t)},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=$("#pvc-post-most-viewed").find(".pvc-dashboard-container");t(!1,e,n)},s=function(e,t){["dates","html","design"].forEach(function(e){delete t[e]});var n=new CustomEvent(e,{detail:t});window.dispatchEvent(n)}}(jQuery);
3
4 })(jQuery, window, document);
5