PluginProbe ʕ •ᴥ•ʔ
Post Views Counter / 1.7.0
Post Views Counter v1.7.0
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 6 months ago admin-post.js 6 months ago admin-quick-edit.js 6 months ago admin-settings.js 6 months ago admin-widgets.js 6 months ago block-editor.js 6 months ago column-modal.js 6 months ago counter.js 6 months ago dummy.js 6 months ago frontend.js 6 months ago integration-gutenberg.js 6 months ago
admin-dashboard.js
2 lines
1 !function(e){window.addEventListener("load",function(){window.pvcUpdatePostViewsWidget(),window.pvcUpdatePostMostViewedWidget()}),e(function(){e(".pvc-accordion-header").on("click",function(t){e(t.currentTarget).closest(".pvc-accordion-item").toggleClass("pvc-collapsed");var n=e("#pvc-dashboard-accordion").find(".pvc-accordion-item"),a={};n.length>0&&e(n).each(function(t,n){var o=e(n).attr("id");o=o.replace("pvc-",""),a[o]=e(n).hasClass("pvc-collapsed")}),window.pvcUpdateUserOptions({menu_items:a})})});var t=e({});e.pvcAjaxQueue=function(n){var a,o=e.Deferred(),i=o.promise(),s=function(t){(a=e.ajax(n)).done(o.resolve).fail(o.reject).then(t,t)};return t.queue(s),i.abort=function(d){if(a)return a.abort(d);var r=t.queue(),c=e.inArray(s,r);return c>-1&&r.splice(c,1),o.rejectWith(n.context||n,[i,d,""]),i},i},window.pvcUpdateUserOptions=function(t){e.pvcAjaxQueue({url:pvcArgs.ajaxURL,type:"POST",dataType:"json",data:{action:"pvc_dashboard_user_options",nonce:pvcArgs.nonceUser,options:t},success:function(){}})},window.pvcUpdateConfig=function(t,n){return t.data=n.data,t.options.plugins.tooltip={callbacks:{title:function(e){return n.data.dates[e[0].dataIndex]}}},e.each(t.data.datasets,function(e,t){t.fill=n.design.fill,t.tension=.4,t.borderColor=n.design.borderColor,t.backgroundColor=n.design.backgroundColor,t.borderWidth=n.design.borderWidth,t.borderDash=n.design.borderDash,t.pointBorderColor=n.design.pointBorderColor,t.pointBackgroundColor=n.design.pointBackgroundColor,t.pointBorderWidth=n.design.pointBorderWidth}),t};var n=function(t,n,a){e(a).addClass("loading").find(".spinner").addClass("is-active"),e.ajax({url:pvcArgs.ajaxURL,type:"POST",dataType:"json",data:{action:"pvc_dashboard_post_most_viewed",nonce:pvcArgs.nonce,period:n,lang:pvcArgs.lang?pvcArgs.lang:""},success:function(n){e(a).removeClass("loading"),e(a).find(".spinner").removeClass("is-active"),t||o(n.dates,a),e(a).find("#pvc-post-most-viewed-content").html(n.html),d("pvc-dashboard-widget-loaded",n)}})},a=function(t,n,a){e(a).addClass("loading").find(".spinner").addClass("is-active"),e.ajax({url:pvcArgs.ajaxURL,type:"POST",dataType:"json",data:{action:"pvc_dashboard_post_views_chart",nonce:pvcArgs.nonce,period:n,lang:pvcArgs.lang?pvcArgs.lang:""},success:function(n){if(e(a).removeClass("loading"),e(a).find(".spinner").removeClass("is-active"),t){var i={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"}}};i=window.pvcUpdateConfig(i,n),window.postViewsChart=new Chart(document.getElementById("pvc-post-views-chart").getContext("2d"),i)}else o(n.dates,a),window.postViewsChart.config=window.pvcUpdateConfig(window.postViewsChart.config,n),window.postViewsChart.update();d("pvc-dashboard-widget-loaded",n)}})};window.pvcUpdatePostViewsWidget=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=e("#pvc-post-views").find(".pvc-dashboard-container");e(n).length>0&&(o(!1,n),a(!0,t,n))},window.pvcUpdatePostMostViewedWidget=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=e("#pvc-post-most-viewed").find(".pvc-dashboard-container");e(a).length>0&&(o(!1,a),n(!0,t,a))};var o=function(t,n){var a=e(n).find(".pvc-date-nav")[0];if(a){!1!==t&&(a.innerHTML=t);var o=a.getElementsByClassName("prev")[0],d=a.getElementsByClassName("next")[0],r=e(n).closest(".pvc-accordion-item").attr("id");"pvc-post-most-viewed"===r?o.addEventListener("click",function(e){e.preventDefault(),s(e.target.dataset.date)}):"pvc-post-views"===r&&o.addEventListener("click",function(e){e.preventDefault(),i(e.target.dataset.date)}),"A"===d.tagName&&("pvc-post-most-viewed"===r?d.addEventListener("click",function(e){e.preventDefault(),s(e.target.dataset.date)}):"pvc-post-views"===r&&d.addEventListener("click",function(e){e.preventDefault(),i(e.target.dataset.date)}))}},i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=e("#pvc-post-views").find(".pvc-dashboard-container");a(!1,t,n)},s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=e("#pvc-post-most-viewed").find(".pvc-dashboard-container");n(!1,t,a)},d=function(e,t){["dates","html","design"].forEach(function(e){delete t[e]});var n=new CustomEvent(e,{detail:t});window.dispatchEvent(n)}}(jQuery);
2