![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/www/wp-content/themes/dt-the7/inc/admin/assets/js/ |
function dtResizeSquare(e,t,a){var i,n,s,o;return arguments.callee.dtDefIndex||(arguments.callee.dtDefIndex=dtGetDefaultIndex()),o=arguments.callee.dtDefIndex,e||(e=o),s=the7mbImageRatios[e].ratio,e<o?(n=parseInt(Math.round(t/s)),i=parseInt(Math.round(s*n))):e==o?(i=t,n=a):e>o&&(i=parseInt(Math.round(s*a)),n=parseInt(Math.round(i/s))),{w:i,h:n,desc:the7mbImageRatios[e].desc}}function dtGetDefaultIndex(){for(var e=the7mbImageRatios.length,t=1,a=1;a<=e;a++)if(1==the7mbImageRatios[a].ratio){t=a;break}return t}jQuery(document).ready((function(e){function t(e,t){1==t?e.show():e.animate({opacity:"1"},{queue:!1,duration:500}).slideDown(500)}function a(e){e.animate({opacity:"0"},{queue:!1,duration:500}).slideUp(500)}function i(i,n){var s=e("."+i.attr("data-name"));"show"==i.attr("value")&&i.is(":checked")||"show"==i.attr("value")&&i.is(":hidden")?t(s,n):("hide"==i.attr("value")&&i.is(":checked")||"hide"==i.attr("value")&&i.is(":hidden"))&&a(s),i.is('input[type="checkbox"]')&&(i.is(":checked")?t(s,n):a(s))}function n(t){var a=e(t),i=e("> input",a);a.siblings("label").removeClass("act").find("input").prop("checked",!1),i.prop("checked",!0),a.addClass("act");var n=a.parents(".dt_tabs"),s=n.next(".dt_tabs-content");"all"==i.attr("value")?(e("> div",s).hide(),e("> .dt_tab-all",s).show(),e("> .dt_arrange-by",n).not(".hide-if-js").hide(),s.removeClass("except only")):"only"==i.attr("value")?(e("> div",s).hide(),e("> .dt_tab-select",s).show(),e("> .dt_arrange-by",n).not(".hide-if-js").show(),s.removeClass("except").addClass("only")):"except"==i.attr("value")&&(e("> div",s).hide(),e("> .dt_tab-select",s).show(),e("> .dt_arrange-by",n).not(".hide-if-js").show(),s.removeClass("only").addClass("except")),"albums"==i.attr("value")?(e("> .dt_tab-select > div",s).hide(),e("> .dt_tab-select > .dt_tab-items",s).show()):"category"==i.attr("value")&&(e("> .dt_tab-select > div",s).hide(),e("> .dt_tab-select > .dt_tab-categories",s).show())}function s(t){var a=e(t),i=e("> input",a);i.prop("checked")?(i.prop("checked",!1),a.removeClass("act")):(i.prop("checked",!0),a.addClass("act"))}e(".dt_radio-img label input:checked").parent("label").addClass("act").siblings("label").removeClass("act"),e(".dt_radio-img label").on("click",(function(){e(this).addClass("act").siblings("label").removeClass("act")})),e(".dt_switcher input:checked").each((function(){i(e(this),!0)})),e(".dt_switcher").on("change",(function(t){i(e(" > input",t.currentTarget))})),e(".dt_advanced input[value=show]").each((function(){e(this).parent().addClass("act"),i(e(this),!0)})),window.the7ShowAdvancedMetaFields=function(e){var t=e.find("> input:hidden");e.addClass("act"),t.attr("value","show"),i(t)},window.the7HideAdvancedMetaFields=function(e){var t=e.find("> input:hidden");e.removeClass("act"),t.attr("value","hide"),i(t)},window.the7ToggleAdvancedMetaFields=function(e){"show"===e.find("> input:hidden").attr("value")?the7HideAdvancedMetaFields(e):the7ShowAdvancedMetaFields(e)},e(".dt_advanced").on("click",(function(t){t.preventDefault(),window.the7ToggleAdvancedMetaFields(e(this))})),e("label.dt_tab input:checked, label.dt_arrange input:checked").parent("label").addClass("act").siblings("label").removeClass("act"),e(".dt_tabs input:checked").each((function(){n(e(this).parent("label"))})),e(".dt_tabs label").on("click",(function(t){t.preventDefault(),n(e(t.currentTarget))})),e(".dt_checkbox").each((function(){var t=e(this);e("> input",t).prop("checked")?t.addClass("act"):t.removeClass("act")})),e(".dt_checkbox").on("click",(function(t){t.preventDefault(),s(e(t.currentTarget))})),e(".dt_item-cover, .dt_tab-categories > .dt_list-item > span").on("click",(function(t){s(e(t.currentTarget).parent().find(".dt_checkbox"))})),e(".dt_item-cover, .dt_tab-categories > .dt_list-item > span").on("mouseenter",(function(){e(this).parent().find(".dt_checkbox").addClass("dt_hover")})).on("mouseleave",(function(){e(this).parent().find(".dt_checkbox").removeClass("dt_hover")})),e(window).on("resize",(function(){e(".dt_tabs-content").css({"max-height":e(window).height()-150})})),e(window).trigger("resize"),{_isSlideshow:!1,_isTransOrNormal:!1,_headerTitle:e(".the7-mb-input-_dt_header_title input"),_headerBg:e(".the7-mb-input-_dt_header_background input"),_target:e(".the7-mb-input-_dt_header_header-below-slideshow"),init:function(){var t=this;t._headerTitle.on("change",(function(){t._checkTitle(e(this).val()),t._changeTargetVisibility()})),t._headerBg.on("change",(function(){t._checkBg(e(this).val()),t._changeTargetVisibility()})),t._checkTitle(t._headerTitle.filter(":checked").val()),t._checkBg(t._headerBg.filter(":checked").val()),t._changeTargetVisibility()},_checkTitle:function(e){this._isSlideshow="slideshow"===e},_checkBg:function(e){this._isTransOrNormal="normal"===e||"transparent"===e},_changeTargetVisibility:function(){this._isSlideshow&&this._isTransOrNormal?this._target.show():this._target.hide()}}.init(),{advSettings:null,bootstrap:function(){var t=this;this.advSettings=e("#adv-settings"),e('.the7-mb-input-_dt_header_title input[type="radio"]').on("change",(function(a){t.handlePageTitleDependencies(e(this).val())})),e("body").on("change","#page_template, .editor-page-attributes__template select",(function(){t.showMetaBoxesForTemplate(e(this).val())})),t.showMetaBoxesForTemplate(dtPageTemplate.templateName)},showMetaBoxesForTemplate:function(t){var a=[],i=[];dtMetaboxes.forEach((function(e){-1!==e.template.indexOf(t)&&a.push(e.id),i.push(e.id)})),this.showMetaBoxes(a,i)&&this.save(),e(".dt_advanced").each((function(){window.the7HideAdvancedMetaFields(e(this))})),e('.the7-mb-input-_dt_header_title input[type="radio"]:checked').trigger("change"),this.showTemplateSpecificFields(t)},showMetaBoxes:function(t,a){var i=this,n=!1;return a||(a=this.findMetaBoxes()),a.forEach((function(a){var s=e("#"+a);-1===t.indexOf(a)?s.hasClass("hide-if-js")||(s.addClass("hide-if-js"),n=!0):s.hasClass("hide-if-js")&&(s.removeClass("hide-if-js"),n=!0),i.advSettings&&i.advSettings.find("#"+a+"-hide").prop("checked",-1!==t.indexOf(a))})),n},findMetaBoxes:function(){return e('.postbox[id^="dt_page_box"]').map((function(){return this.id})).get()},showTemplateSpecificFields:function(t){e(".the7-mb-hidden-field.hide-if-js").each((function(a){var i=e(this),n=i.attr("data-show-on");void 0!==n&&!1!==n&&(-1===(n=n.split(",")).indexOf(t)?i.hide():i.show())}))},handlePageTitleDependencies:function(e){var t={fancy:["dt_page_box-fancy_header_options"],slideshow:["dt_page_box-slideshow_options","dt_page_box-display_slideshow"]},a=[];void 0!==t[e]&&(a=t[e]),this.showMetaBoxes(a,["dt_page_box-slideshow_options","dt_page_box-display_slideshow","dt_page_box-fancy_header_options"])},save:function(){"undefined"!=typeof postboxes&&postboxes.save_state(postboxes.page)}}.bootstrap()})),jQuery((function(e){e(".the7-mb-radio-hide-fields").each((function(){var t=e(this);t.parents(".the7-mb-field").first();t.find('input[type="radio"]').on("click",(function(a){var i=e(this).attr("data-hide-fields"),n=jQuery.data(t,"hiddenFields")||[];i=i?i.split(","):new Array;for(let t=0;t<i.length;t++){e(".the7-mb-input-"+i[t]).closest(".the7-mb-field, .the7-mb-flickering-field").hide();var s=n.indexOf(i[t]);s>-1&&n.splice(s,1)}for(let t=0;t<n.length;t++)e(".the7-mb-input-"+n[t]).closest(".the7-mb-field, .the7-mb-flickering-field").show();jQuery.data(t,"hiddenFields",i)})),t.find('input[type="radio"]:checked').trigger("click").trigger("change")})),e(".the7-mb-checkbox-hide-fields").each((function(){var t=e(this);t.parents(".the7-mb-field").first();t.find('input[type="checkbox"]').on("change",(function(t){var a=e(this),i=a.attr("data-hide-fields");if(i=i?i.split(","):new Array,a.prop("checked"))for(let t=0;t<i.length;t++)e(".the7-mb-input-"+i[t]).parent().show();else for(let t=0;t<i.length;t++)e(".the7-mb-input-"+i[t]).parent().hide()})),t.find('input[type="checkbox"]').trigger("change").trigger("change")})),e(".the7-mb-proportion_slider-wrapper .the7-mb-slider").each((function(){var t=e(this),a=t.parents(".the7-mb-proportion_slider-wrapper").find(".the7-mb-proportion_slider-prop-box"),i=parseInt(t.parents(".the7-mb-input").find("input").val()),n=[];for(var s in the7mbImageRatios)"length"!=s&&n.push(the7mbImageRatios[s].desc);var o=parseInt(Math.round(407/(n.length-1)));t.after('<div class="ui-slider-legend"><p style="width:'+o+'px;">'+n.join('</p><p style="width:'+o+'px;">')+'</p></div><div class="the7-mb-slider-prop-label"><span></span></div>');var d=dtResizeSquare(i,80,80),r=t.siblings(".the7-mb-slider-prop-label").find("span");a.css("width",d.w),a.css("height",d.h),r.text(d.desc),t.on("slide",(function(e,t){var i=dtResizeSquare(t.value,80,80);a.css("width",i.w),a.css("height",i.h),r.text(i.desc)}))}))})),jQuery(document).ready((function(e){function t(t){var a=t.reduce((function(e,t){return e+'<option value="'+t.id+'">'+t.name+"</option>"}),"");e("#the7-post-meta-presets").html(a)}function a(e){return!e.success}function i(e){try{alert(e.data.msg)}catch(e){console.log(e)}}function n(){return e(".the7-mb-field").not(".dont-save-in-preset").find(":input").serializeArray()}function s(){var t=e("#the7-post-meta-presets").val(),a=e("#the7-post-meta-save-preset, #the7-post-meta-delete-preset, #the7-post-meta-apply-preset");t?a.removeAttr("disabled"):a.attr("disabled","disabled")}e("#the7-post-meta-apply-preset").on("click",(function(t){t.preventDefault();var n=e("#post_ID").val(),s=e("#the7-post-meta-presets").val();if(""!==s){var o=e(this),d=o.text();o.addClass("active ready").text(the7MetaPresetsStrings.applyingPreset),e.post(ajaxurl,{action:"the7_meta_preset",preset_action:"apply_preset",_ajax_nonce:the7MetaPresetsNonces._ajax_nonce,postID:n,id:s}).done((function(e){if(a(e))return o.removeClass("active ready").text(d),void i(e);window.location.reload()})).fail((function(){o.removeClass("active ready").text(d)}))}})),e("#the7-post-meta-delete-preset").on("click",(function(n){n.preventDefault();var o=e("#post_ID").val(),d=e("#the7-post-meta-presets").val();""!==d&&e.post(ajaxurl,{action:"the7_meta_preset",preset_action:"delete_preset",_ajax_nonce:the7MetaPresetsNonces._ajax_nonce,postID:o,id:d}).done((function(e){if(a(e))i(e);else try{t(e.data.presetsNames),s()}catch(e){console.log(e)}}))})),e("#the7-post-meta-add-preset").on("click",(function(o){o.preventDefault();var d=prompt(the7MetaPresetsStrings.enterName,"");if(d=d.trim()){var r=e("#post_ID").val();e.post(ajaxurl,{action:"the7_meta_preset",preset_action:"add_preset",_ajax_nonce:the7MetaPresetsNonces._ajax_nonce,postID:r,title:d,meta:n()}).done((function(e){if(a(e))i(e);else try{t(e.data.presetsNames),s()}catch(e){console.log(e)}}))}})),e("#the7-post-meta-save-preset").on("click",(function(t){t.preventDefault();var s=e("#post_ID").val(),o=e("#the7-post-meta-presets").val();""!==o&&e.post(ajaxurl,{action:"the7_meta_preset",preset_action:"save_preset",_ajax_nonce:the7MetaPresetsNonces._ajax_nonce,postID:s,id:o,meta:n()}).done((function(e){a(e)?i(e):alert(the7MetaPresetsStrings.presetSaved)}))})),e("#the7-post-meta-save-defaults").on("click",(function(t){t.preventDefault();var s=e("#post_ID").val();e.post(ajaxurl,{action:"the7_meta_preset",preset_action:"save_defaults",_ajax_nonce:the7MetaPresetsNonces._ajax_nonce,postID:s,meta:n()}).done((function(e){a(e)?i(e):alert(the7MetaPresetsStrings.defaultsSaved)}))}))}));