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
block-editor.min.js
4 years ago
column-modal.js
6 months ago
counter.js
6 months ago
dummy.js
6 months ago
frontend.js
6 months ago
column-modal.js
2 lines
| 1 | !function(a){if(void 0!==a){var o=null,e=null;if("undefined"!=typeof pvcColumnModal){var t=function(o,e){var t=a(".pvc-modal-chart-container");t.addClass("loading"),t.find(".spinner").addClass("is-active"),a.ajax({url:pvcColumnModal.ajaxURL,type:"POST",dataType:"json",data:{action:"pvc_column_chart",nonce:pvcColumnModal.nonce,post_id:o,period:e},success:function(a){a.success?n(a.data):l(a.data.message||pvcColumnModal.i18n.error)},error:function(){l(pvcColumnModal.i18n.error)},complete:function(){t.removeClass("loading"),t.find(".spinner").removeClass("is-active")}})},n=function(e){var t=document.getElementById("pvc-modal-chart");if(t){o&&(o.destroy(),o=null),a(".pvc-modal-error").remove(),a(t).show(),a(".pvc-modal-views-label").text(pvcColumnModal.i18n.summary),a(".pvc-modal-count").text(e.total_views.toLocaleString()),a(".pvc-modal-dates").html(e.dates_html);var n={type:"line",data:e.data,options:{maintainAspectRatio:!1,responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{title:function(a){return e.data.dates[a[0].dataIndex]},label:function(a){var o=a.parsed.y,e=1===o?pvcColumnModal.i18n.view:pvcColumnModal.i18n.views;return"".concat(o.toLocaleString()," ").concat(e)}}}},scales:{x:{display:!0,grid:{display:!1}},y:{display:!0,beginAtZero:!0,ticks:{precision:0},grid:{color:"rgba(0, 0, 0, 0.05)"}}}}};e.design&&n.data.datasets.forEach(function(a){Object.assign(a,e.design),a.tension=.4}),o=new Chart(t.getContext("2d"),n)}},l=function(e){o&&(o.destroy(),o=null),a(".pvc-modal-summary").text(""),a(".pvc-modal-dates").html("");var t=a(".pvc-modal-chart-container");t.removeClass("loading"),t.find(".spinner").removeClass("is-active"),a(".pvc-modal-error").remove(),t.before('<p class="pvc-modal-error">'.concat(e,"</p>")),t.find("canvas").hide()};a(function(){0!==a("#pvc-chart-modal").length&&"undefined"!=typeof MicroModal&&(MicroModal.init({disableScroll:!0,awaitCloseAnimation:!0}),1)&&(a(document).on("click",".pvc-view-chart",function(n){n.preventDefault();var l=a(n.currentTarget),i=l.data("post-id"),c=l.data("post-title");i&&function(o,t){if(!o)return!1;e=o,a("#pvc-modal-title").text(t);var n=a(".pvc-modal-chart-container");return n.addClass("loading"),n.find(".spinner").addClass("is-active"),a(".pvc-modal-views-label").text(""),a(".pvc-modal-count").text(""),a(".pvc-modal-dates").html(""),!0}(i,c)&&"undefined"!=typeof MicroModal&&MicroModal.show("pvc-chart-modal",{onShow:function(){e&&t(e,"")},onClose:function(){o&&(o.destroy(),o=null),e=null,function(){a("#pvc-modal-title").text(""),a(".pvc-modal-views-label").text(""),a(".pvc-modal-count").text(""),a(".pvc-modal-dates").html("");var o=a(".pvc-modal-chart-container");o.removeClass("loading"),o.find(".spinner").removeClass("is-active"),a(".pvc-modal-error").remove()}()},disableScroll:!0,awaitCloseAnimation:!0})}),a(document).on("click",".pvc-modal-nav-prev, .pvc-modal-nav-next",function(o){o.preventDefault();var n=a(o.currentTarget);if(!n.hasClass("pvc-disabled")){var l=n.data("period");l&&e&&t(e,l)}}))})}}}(jQuery); |
| 2 |