File Editor
Directories:
.. (Back)
Files:
admin-dashboard.js
admin-notice.js
admin-plugins.js
admin-welcome.js
admin.js
admin.min.js
front-welcome.js
front.js
front.min.js
Create New File
Create
Edit File: admin.min.js
!function(e){e(function(){function n(n,t,o){if(n.removeClass("loading"),n.find(".spinner").replaceWith(t),!o){var s=n.find("table tbody"),a=n.find("table").find("tbody tr").toArray(),c=!0;n.pagination({dataSource:a,pageSize:10,showPrevious:!0,showNext:!0,callback:function(n,t){if(c){c=!1;return}for(let o of(s.find("tr").hide(),n))e(o).show()}})}}e(".cn_color").wpColorPicker(),e('.cn-consent-log-item input[type="checkbox"]').on("change",function(){var t=e(this),o=t.closest("tr"),s=o.attr("id")+"_details",a="#"+s,c=o.attr("id")+"_row";if(t.is(":checked")){if(e("#"+c).remove(),e(a).length&&1===e(a).data("status"))e(a).show();else{var i=null;e(a).length?(e(a).show(),(i=e(a+" .cn-consent-logs-data")).addClass("loading"),i.html('<span class="spinner is-active"></span>')):(o.after(cnArgs.consentLogsTemplate),o.next().attr("id",s),i=e(a+" .cn-consent-logs-data")),e.ajax({url:cnArgs.ajaxURL,type:"POST",dataType:"json",data:{action:"cn_get_consent_logs_by_date",nonce:cnArgs.nonceConsentLogs,date:t.closest("tr").data("date")}}).done(function(t){t.success?(e(a).data("status",1),n(i,t.data,!1)):(e(a).data("status",0),n(i,cnArgs.consentLogsError,!0))}).fail(function(t){e(a).data("status",0),n(i,cnArgs.consentLogsError,!0)})}}else e(a).hide(),e(a).after('<tr id="'+c+'" class="cn-consent-logs-row"><td colspan="6"></td></tr>')}),e("#cn_app_purge_cache a").on("click",function(n){n.preventDefault();var t=this;e(t).parent().addClass("loading").append('<span class="spinner is-active" style="float: none"></span>');var o={action:"cn_purge_cache",nonce:cnArgs.nonce};cnArgs.network&&(o.cn_network=1),e.ajax({url:cnArgs.ajaxURL,type:"POST",dataType:"json",data:o}).always(function(n){e(t).parent().find(".spinner").remove()})}),e('input[name="cookie_notice_options[global_override]"]').on("change",function(){e(".cookie-notice-settings form").toggleClass("cn-options-disabled")}),e("#cn_refuse_opt").on("change",function(){e(this).is(":checked")?e("#cn_refuse_opt_container").slideDown("fast"):e("#cn_refuse_opt_container").slideUp("fast")}),e("#cn_revoke_cookies").on("change",function(){e(this).is(":checked")?e("#cn_revoke_opt_container").slideDown("fast"):e("#cn_revoke_opt_container").slideUp("fast")}),e("#cn_see_more").on("change",function(){e(this).is(":checked")?e("#cn_see_more_opt").slideDown("fast"):e("#cn_see_more_opt").slideUp("fast")}),e("#cn_on_scroll").on("change",function(){e(this).is(":checked")?e("#cn_on_scroll_offset").slideDown("fast"):e("#cn_on_scroll_offset").slideUp("fast")}),e("#cn_conditional_display_opt").on("change",function(){e(this).is(":checked")?e("#cn_conditional_display_opt_container").slideDown("fast"):e("#cn_conditional_display_opt_container").slideUp("fast")}),e("#cn_see_more_link-custom, #cn_see_more_link-page").on("change",function(){"custom"===e("#cn_see_more_link-custom:checked").val()?e("#cn_see_more_opt_page").slideUp("fast",function(){e("#cn_see_more_opt_link").slideDown("fast")}):"page"===e("#cn_see_more_link-page:checked").val()&&e("#cn_see_more_opt_link").slideUp("fast",function(){e("#cn_see_more_opt_page").slideDown("fast")})}),e("#cn_refuse_code_fields").find("a").on("click",function(n){n.preventDefault(),e("#cn_refuse_code_fields").find("a").removeClass("nav-tab-active"),e(".refuse-code-tab").removeClass("active");var t=e(this).attr("id").replace("-tab","");e("#"+t).addClass("active"),e(this).addClass("nav-tab-active")}),e(document).on("click",".add-rule-group",function(n){n.preventDefault();var t=e("#rules-group-template").html(),o=e("#rules-groups"),s=o.find(".rules-group"),a=s.length>0?parseInt(s.last().attr("id").split("-")[2])+1:1;t=(t=t.replace(/__GROUP_ID__/g,a)).replace(/__RULE_ID__/g,1),o.append('<div class="rules-group" id="rules-group-'+a+'">'+t+"</div>"),o.find(".rules-group").last().fadeIn("fast")}),e(document).on("click",".remove-rule",function(n){n.preventDefault(),1===e(this).closest("tbody").find("tr").length?e(this).closest(".rules-group").fadeOut("fast",function(){e(this).remove()}):e(this).closest("tr").fadeOut("fast",function(){e(this).remove()})}),e(document).on("change",".rule-type",function(){var n=e(this),t=n.closest("tr").find("td.value"),o=t.find("select"),s=t.find(".spinner");o.hide(),s.fadeIn("fast").css("visibility","visible"),e.post(ajaxurl,{action:"cn-get-group-rules-values",cn_param:n.val(),cn_nonce:cnArgs.nonceConditional}).done(function(n){s.hide().css("visibility","hidden");try{var t=e.parseJSON(n);o.fadeIn("fast").find("option").remove().end().append(t.select)}catch(a){}}).fail(function(){})})}),e(document).on("click","input#reset_cookie_notice_options",function(){return confirm(cnArgs.resetToDefaults)})}(jQuery);
Save Changes
Rename File
Rename