AlkantarClanX12

Your IP : 3.14.143.149


Current Path : /home/thanudqk/www/wp-content/plugins/wpcode-premium/build/
Upload File :
Current File : /home/thanudqk/www/wp-content/plugins/wpcode-premium/build/admin-global-pro.js

!function(){var e={812:function(){const e=window.WPCodePostMetabox||function(e,t,n){const o={l18n:t.wpcode,snippet_page:1,loaded_snippets:!1,init(){o.should_init()&&(o.init_load_snippet_chooser(),o.init_hide_insert_number())},should_init:()=>(o.snippet_chooser=n("#wpcode-choose-snippets"),o.picked_snippets=n("#wpcode-picked-snippets"),o.load_more_button=n("#wpcode-metabox-load-more"),o.search_input=n("#wpcode-search-snippets"),o.no_snippets=n("#wpcode-no-snippets-selected"),o.load_spinner=n("#wpcode-chooser-spinner"),o.snippet_chooser.length>0),init_load_snippet_chooser(){o.init_choose_event(),o.init_load_more_event(),o.init_remove_snippet(),o.init_search(),o.init_drawer(),o.maybe_show_no_snippets()},load_snippets(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=o.search_input.val();e&&(o.snippet_chooser.empty(),o.snippet_page=1),o.load_spinner.show(),n.post(ajaxurl,{action:"wpcode_load_snippets",_wpnonce:o.l18n.nonce,page:o.snippet_page,post_id:o.l18n.post_id,selected:o.get_selected_ids(),search:t}).then((function(e){o.load_spinner.hide(),e.success&&(e.data.snippets&&e.data.snippets.length>0?(o.snippet_chooser.append(e.data.snippets),o.snippet_page++,e.data.snippets.length<10?o.load_more_button.hide():o.load_more_button.show()):o.load_more_button.hide())}))},init_choose_event(){o.snippet_chooser.on("change",":checkbox",(function(){const e=n(this).val();this.checked?o.load_selected_snippet(e):o.picked_snippets.find("#wpcode-selected-snippet-"+e).remove()}))},load_selected_snippet(e){o.load_spinner.show(),n.post(ajaxurl,{action:"wpcode_load_selected_snippet",_wpnonce:o.l18n.nonce,snippet_id:e}).then((function(e){o.load_spinner.hide(),e.success&&(o.picked_snippets.append(e.data.snippet),o.maybe_show_no_snippets())}))},init_load_more_event(){o.load_more_button.on("click",(function(e){e.preventDefault(),o.load_snippets()}))},init_remove_snippet(){o.picked_snippets.on("click",".wpcode-remove-snippet-item",(function(e){e.preventDefault();const t=n(this).closest(".wpcode-selected-snippet-item"),i=t.data("id");o.snippet_chooser.find('[value="'+i+'"]').prop("checked",!1),t.remove(),o.maybe_show_no_snippets()}))},init_search(){let e=null;o.search_input.on("keyup input cut paste",(function(t){clearTimeout(e),e=setTimeout((function(){o.load_snippets(!0)}),300)}))},get_selected_ids(){const e=[];return o.picked_snippets.find(".wpcode-selected-snippet-item").each((function(){e.push(n(this).data("id"))})),e},maybe_show_no_snippets(){o.picked_snippets.find(".wpcode-selected-snippet-item").length>0?o.no_snippets.hide():o.no_snippets.show()},init_drawer(){n(".wpcode-drawer-toggle").on("click",(function(e){e.preventDefault(),o.loaded_snippets||(o.load_snippets(),o.loaded_snippets=!0),n(this).closest(".wpcode-metabox-snippets").toggleClass("wpcode-snippet-chooser-closed")}))},init_hide_insert_number(){o.picked_snippets.on("change",".wpcode-auto-insert-location-picker",(function(){const e=n(this),t=e.closest(".wpcode-selected-snippet-item").find(".wpcode-auto-insert-number-wrap");wpcode.locations_number&&wpcode.locations_number.includes(e.val())?t.removeClass("wpcode-hidden"):t.addClass("wpcode-hidden")}))}};return o}(document,window,jQuery);e.init()},29:function(){jQuery((function(e){const t=e(".wpcode-smart-tags");let n;function o(){n.removeClass("wpcode-smart-tags-open"),e(document).off("click.wpcode")}t.on("click",".wpcode-smart-tags-toggle",(function(t){t.preventDefault();const i=e(this).closest(".wpcode-smart-tags");i.toggleClass("wpcode-smart-tags-open"),n=i,e(document).on("click.wpcode",(function(t){e(t.target).closest(".wpcode-smart-tags").length||o()}))})),t.on("click",".wpcode-insert-smart-tag",(function(t){t.preventDefault();const n=e(this).closest(".wpcode-smart-tags-dropdown").data("target");!function(e,t){void 0!==window.wpcode_editor[t]&&window.wpcode_editor[t].codemirror.doc.replaceSelection(e)}(e(this).data("tag"),n),o()}))}))},570:function(){(()=>{if(void 0===wp.data)return;const e=wp.data.select("core/edit-post");null!=e&&wp.data.subscribe((()=>{if(e.areMetaBoxesInitialized()){if(void 0===window.wpcode_editor)return;jQuery.each(window.wpcode_editor,(function(e,t){t.codemirror.refresh(),t.codemirror.on("blur",(function(e,t){e.save()}))}))}}))})()},624:function(){jQuery((function(e){e(".wpcode-admin-tabs-navigation").on("click",".wpcode-admin-tabs button",(function(t){t.preventDefault();const n=e(this).data("target");e(this).addClass("active").parent().siblings().find("button").removeClass("active"),e(document.getElementById(n)).addClass("active").siblings().removeClass("active"),window.wpcode_editor&&jQuery.each(window.wpcode_editor,(function(e,t){t.codemirror.refresh()}))}))}))}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";n(624),n(570),n(812),n(29)}()}();