芝麻web文件管理V1.00
编辑当前文件:/home/r5772835/public_html/blog.ycreate.jp/wp-content/themes/swell/build/js/admin/settings.min.js
!function(){"use strict";const e=async(e,n,t=undefined,s=undefined)=>{const o=new URLSearchParams;Object.keys(n).forEach((e=>{o.append(e,n[e])})),(async(e,n,t,s)=>{var o,l;const a=null===(o=window)||void 0===o||null===(l=o.swellVars)||void 0===l?void 0:l.restUrl;void 0!==a&&fetch(a+e,n).then((e=>{if(e.ok)return e.json();throw new TypeError(`Failed callRestApi: ${e.status}`)})).then((e=>{t&&t(e)})).catch((t=>{console.error(t),console.error("route:"+e,n),s&&s()}))})(e,{method:"POST",body:o},t,s)};var n;addEventListener("DOMContentLoaded",(function(){var n,t;const{swellText:s}=window,o=null===(n=window)||void 0===n||null===(t=n.swlApiSettings)||void 0===t?void 0:t.nonce;if(void 0===o)return;const l={_wpnonce:o},a=document.getElementById("swell_settings_btn___do_update_action");null!==a&&a.addEventListener("click",(n=>{n.preventDefault(),e("swell-do-update-action",l,(e=>{alert(e),location.reload()}),(()=>{alert(s.updateFailed)}))}));const i=n=>{window.confirm(s.resetConfirm)&&(l.action=n,e("swell-reset-settings",l,(e=>{alert(e)}),(()=>{alert(s.resetFailed)})))},c=document.getElementById("swell_settings_btn___reset_settings");null!==c&&c.addEventListener("click",(e=>{e.preventDefault(),i("customizer")}));const r=document.getElementById("swell_settings_btn___reset_pv");null!==r&&r.addEventListener("click",(e=>{e.preventDefault(),i("pv")}))})),(n=window.jQuery)((function(){function e(e){const n=e.find(".__style").val(),t=e.find(".__width").val();let s=e.find(".__color").val();const o=e.find(".__customColor").val();"custom"===s&&(s=o);const l=n+" "+t+"px "+s;e.find(".__previwBox").css("border",l),e.find(".__hidden").val(l)}n('[id="swell_options[use_delay_js]"]').change((function(){n(".-delay-js").toggleClass("-disable")})),n('[id="swell_options[use_json_ld]"]').change((function(){n(".-json_ld").toggleClass("-disable")})),n('[name="swell_options[use_pjax]"]').change((function(){const e=n(this).val();console.log(e),"pjax"===e?(n('[data-key="pjax_prevent_pages"]').removeClass("-disable"),n('[data-key="prefetch_prevent_keys"]').addClass("-disable")):"prefetch"===e?(n('[data-key="pjax_prevent_pages"]').addClass("-disable"),n('[data-key="prefetch_prevent_keys"]').removeClass("-disable")):(n('[data-key="pjax_prevent_pages"]').addClass("-disable"),n('[data-key="prefetch_prevent_keys"]').addClass("-disable"))})),n(".swl-menu.-list").find(".__list_color").change((function(){const e=n(this),t=e.val(),s=e.attr("data-key");document.documentElement.style.setProperty("--"+s,t),t||document.documentElement.style.removeProperty("--"+s,t)})),function(){const e=n(".swl-menu.-capbox"),t=e.find(".__dark"),s=e.find(".__light");t.change((function(){const e=n(this),t=e.val(),s=e.parents(".swl-menu.-capbox");s.find(".cap_box_ttl").css("background",t),s.find(".cap_box_content").css("border-color",t)})),s.change((function(){const e=n(this),t=e.val();e.parents(".swl-menu.-capbox").find(".cap_box_content").css("background",t)}))}(),n(".swl-menu.-faq").find(".__faq_color").change((function(){const e=n(this),t=e.val(),s=e.attr("data-key");document.documentElement.style.setProperty("--"+s,t)})),n(".swl-menu.-cell").find(".__cellIcon").change((function(){const e=n(this),t=e.val(),s=e.attr("data-target");document.querySelector(`.swl-menu.-cell .__preview [data-icon="${s}"]`).style.setProperty("--cell-icon-color",t)})),function(){const e=n(".swell-menu-balloon"),t=e.find(".-bg"),s=e.find(".-border");t.change((function(){const e=n(this),t=e.val(),s=e.parents(".__settings").next();s.find(".c-balloon__text").css("background",t),s.find(".c-balloon__before").css("border-right-color",t)})),s.change((function(){const e=n(this),t=e.val();e.parents(".__settings").next().find(".c-balloon__text").css("border-color",t)}))}(),function(){const t=n(".swell-menu-border"),s=t.find(".__style"),o=t.find(".__width"),l=t.find(".__color"),a=t.find(".__customColor");s.change((function(){e(n(this).parents(".swell-menu-border"))})),o.change((function(){e(n(this).parents(".swell-menu-border"))})),l.change((function(){const t=n(this),s=t.val(),o=t.parents(".swell-menu-border"),l=o.find(".-customColor");"custom"===s?l.removeClass("u-none"):l.addClass("u-none"),e(o)})),a.change((function(){e(n(this).parents(".swell-menu-border"))}))}(),function(){const e=n(".swl-setting__body"),t=n(".swell-menu-iconbox"),s=t.find(".__icon_small_type"),o=t.find(".__icon_big_type");s.change((function(){const t=n(this).val();e.attr("data-type-small",t)})),o.change((function(){const t=n(this).val();e.attr("data-type-big",t)}))}(),n(".swell-menu-iconbox").find(".__icon_color").change((function(){const e=n(this),t=e.val(),s=e.attr("data-key");document.documentElement.style.setProperty("--"+s,t)})),n(".swell-menu-blogcard").find(".__blogcard").change((function(){const e=n(this),t=e.val();e.parents(".swell-menu-blogcard").find(".p-blogCard").attr("data-type",t)})),n(".swell-menu-blockquote").find(".__blockquote").change((function(){const e=n(this),t=e.val();e.parents(".swell-menu-blockquote").find(".__blockquote").attr("data-type",t)})),function(){const e=n(".swell-menu-marker");e.find(".__type").change((function(){const t=n(this).val();e.attr("data-type",t)})),e.find(".__orange").change((function(){const e=n(this).val();document.documentElement.style.setProperty("--color_mark_orange",e)})),e.find(".__yellow").change((function(){const e=n(this).val();document.documentElement.style.setProperty("--color_mark_yellow",e)})),e.find(".__green").change((function(){const e=n(this).val();document.documentElement.style.setProperty("--color_mark_green",e)})),e.find(".__blue").change((function(){const e=n(this).val();document.documentElement.style.setProperty("--color_mark_blue",e)}))}(),function(){const e=n(".swell-menu-btn");e.find(".__gradation").change((function(){const t=n(this).prop("checked");e.attr("data-is-grad",Number(t))}));const t={red:document.querySelectorAll(".__preview .swell-block-button.red_"),blue:document.querySelectorAll(".__preview .swell-block-button.blue_"),green:document.querySelectorAll(".__preview .swell-block-button.green_")},s=(e,n)=>{t[n].forEach((n=>{n.style.setProperty("--the-btn-color",e),n.style.setProperty("--the-solid-shadow",function(e,n,t){n=n||1,t=t||0;let s=parseInt(e.substring(1,3),16),o=parseInt(e.substring(3,5),16),l=parseInt(e.substring(5,7),16);return 0!==t&&(s=Math.round(s+s*t),s=Math.min(s,255),o=Math.round(o+o*t),o=Math.min(o,255),l=Math.round(l+l*t),l=Math.min(l,255)),`rgba(${s},${o},${l},${n})`}(e,1,-.25))}))},o=(e,n)=>{t[n].forEach((n=>{n.style.setProperty("--the-btn-color2",e)}))};e.find(".__red").change((function(){s(n(this).val(),"red")})),e.find(".__red2").change((function(){o(n(this).val(),"red")})),e.find(".__blue").change((function(){s(n(this).val(),"blue")})),e.find(".__blue2").change((function(){o(n(this).val(),"blue")})),e.find(".__green").change((function(){s(n(this).val(),"green")})),e.find(".__green2").change((function(){o(n(this).val(),"green")})),e.find('[name="swell_editors[btn_radius_normal]"]').change((function(){n(".is-style-btn_normal").css("--the-btn-radius",n(this).val())})),e.find('[name="swell_editors[btn_radius_solid]"]').change((function(){n(".is-style-btn_solid").css("--the-btn-radius",n(this).val())})),e.find('[name="swell_editors[btn_radius_shiny]"]').change((function(){n(".is-style-btn_shiny").css("--the-btn-radius",n(this).val())})),e.find('[name="swell_editors[btn_radius_line]"]').change((function(){n(".is-style-btn_line").css("--the-btn-radius",n(this).val())}))}(),function(){const e=n(".swell-menu-set");function t(e,n){const t=e.parents(".__field"),s=e.parents(".swell-menu-set");t.find(".__choices input").prop("checked",!1),s.find(`.__preview .${n}`).removeClass().addClass(n)}e.find(".__toggle-bold").change((function(){const e=n(this),t=e.prop("checked"),s=e.parents(".swell-menu-set");t?s.find(".__preview .swl-txt").addClass("u-fw-bold"):s.find(".__preview .swl-txt").removeClass("u-fw-bold")})),e.find(".__toggle-italic").change((function(){const e=n(this),t=e.prop("checked"),s=e.parents(".swell-menu-set");t?s.find(".__preview .swl-txt").addClass("u-fs-italic"):s.find(".__preview .swl-txt").removeClass("u-fs-italic")})),e.find(".__toggle-color").change((function(){const e=n(this),t=e.prop("checked");e.parents(".__field").attr("data-is-enable",Number(t))})),e.find(".__color").change((function(){const e=n(this),t=e.val();let s=`has-swl-${t}-color`;"white"===t||"black"===t?s=`has-${t}-color`:"main_thin"===t&&(s="has-swl-main-thin-color"),e.parents(".swell-menu-set").find(".__preview .swl-inline-color").removeClass().addClass(`swl-inline-color ${s}`)})),e.find(".__clear.-color").click((function(){t(n(this),"swl-inline-color")})),e.find(".__toggle-bg").change((function(){const e=n(this),t=e.prop("checked");e.parents(".__field").attr("data-is-enable",Number(t))})),e.find(".__bg").change((function(){const e=n(this),t=e.val();let s=`has-swl-${t}-background-color`;"white"===t||"black"===t?s=`has-${t}-background-color`:"main_thin"===t&&(s="has-swl-main-thin-background-color"),e.parents(".swell-menu-set").find(".__preview .swl-bg-color").removeClass().addClass(`swl-bg-color ${s}`)})),e.find(".__clear.-bg").click((function(){t(n(this),"swl-bg-color")})),e.find(".__toggle-marker").change((function(){const e=n(this),t=e.prop("checked");e.parents(".__field").attr("data-is-enable",Number(t))})),e.find(".__marker").change((function(){const e=n(this),t=`mark_${e.val()}`;e.parents(".swell-menu-set").find(".__preview .swl-marker").removeClass().addClass(`swl-marker ${t}`)})),e.find(".__clear.-marker").click((function(){t(n(this),"swl-marker")})),e.find(".__toggle-font-size").change((function(){const e=n(this),t=e.prop("checked"),s=e.parents(".swell-menu-set"),o=e.parents(".__field");o.attr("data-is-enable",Number(t)),o.find(".__choices input").prop("checked",!1),o.attr("data-is-enable",Number(t)),o.find(".__choices input").prop("checked",!1),s.find(".__preview .swl-fz").removeClass().addClass("swl-fz")})),e.find(".__font-size input").change((function(){const e=n(this),t=`u-fz-${e.val()}`;e.parents(".swell-menu-set").find(".__preview .swl-fz").removeClass().addClass(`swl-fz ${t}`)})),e.find(".__clear.-fz").click((function(){t(n(this),"swl-fz")}))}()}))}();