文件操作 - index.js
返回文件管理
返回主菜单
删除本文件
文件: /home/acihmzbq/public_html/wp-content/plugins/wp-menu-icons/build/navmenu/js/index.js
编辑文件内容
/*! For license information please see index.js.LICENSE.txt */ (()=>{var e={972(e,t){var n;!function(){"use strict";var a={}.hasOwnProperty;function l(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var o=l.apply(null,n);o&&e.push(o)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var r in n)a.call(n,r)&&n[r]&&e.push(r)}}}return e.join(" ")}e.exports?(l.default=l,e.exports=l):void 0===(n=function(){return l}.apply(t,[]))||(e.exports=n)}()}},t={};function n(a){var l=t[a];if(void 0!==l)return l.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.element,a=window.wp.i18n,l=window.wpmi.store,i=window.wpmi.components;function o({icon:t,settings:n}){return(0,e.createElement)("div",{className:"wpmi__icon-preview attachment-info"},(0,e.createElement)("div",{className:"thumbnail thumbnail-image"},(0,e.createElement)("i",{className:t})),(0,e.createElement)("div",{className:"details"},(0,e.createElement)("div",{className:"filename"},t),(0,e.createElement)("div",{className:"uploaded"},n.align),(0,e.createElement)("div",{className:"file-size"},n.size," ",(0,e.createElement)("em",null,"(em)"))))}const r=window.wp.components,{WPMI_PREFIX:c}=wpmi_navmenu;function s({settings:t,onChangeSettings:n}){const l=e=>{const{name:a,value:l}=e.target,i={...t,[a]:l};n(i)};return(0,e.createElement)("div",{className:"attachment-info"},(0,e.createElement)("form",null,(0,e.createElement)("label",{className:"setting"},(0,e.createElement)("span",null,(0,a.__)("Hide Label","wp-menu-icons")),(0,e.createElement)("select",{id:c+"-input-label",className:c+"-input",name:"label",onChange:l,value:t.label},(0,e.createElement)("option",{value:""},(0,a.__)("No","wp-menu-icons")),(0,e.createElement)("option",{value:"1"},(0,a.__)("Yes","wp-menu-icons")))),(0,e.createElement)("label",{className:"setting"},(0,e.createElement)("span",null,(0,a.__)("Position","wp-menu-icons")),(0,e.createElement)("select",{id:c+"-input-position",className:c+"-input",name:"position",onChange:l,value:t.position},(0,e.createElement)("option",{value:"before"},(0,a.__)("Before","wp-menu-icons")),(0,e.createElement)("option",{value:"after"},(0,a.__)("After","wp-menu-icons")))),(0,e.createElement)("label",{className:"setting"},(0,e.createElement)("span",null,(0,a.__)("Vertical Align","wp-menu-icons")),(0,e.createElement)("select",{id:c+"-input-align",className:c+"-input",name:"align",onChange:l,value:t.align},(0,e.createElement)("option",{value:"top"},"Top"),(0,e.createElement)("option",{value:"middle"},"Middle"),(0,e.createElement)("option",{value:"bottom"},"Bottom"))),(0,e.createElement)("label",{className:"setting"},(0,e.createElement)("span",null,(0,a.__)("Size","wp-menu-icons")," ",(0,e.createElement)("em",null,"(em)")),(0,e.createElement)("input",{id:c+"-input-size",className:c+"-input",name:"size",type:"number",min:"0.1",step:"0.1",onChange:l,value:t.size})),(0,e.createElement)(r.ColorPicker,{value:t.color,onChangeComplete:e=>n({...t,color:e.hex})}),(0,e.createElement)("label",{className:"wpmi-color-picker"},(0,e.createElement)("span",{className:"container"}))))}function m({settings:t,onChangeSettings:n}){const l={...t};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{tabIndex:"0",className:"attachment-details save-ready"},(0,e.createElement)("h2",null,(0,a.__)("Icon","wp-menu-icons"),(0,e.createElement)("span",{className:"settings-save-status"},(0,e.createElement)("span",{className:"spinner"}),(0,e.createElement)("span",{className:"saved"},(0,a.__)("Saved","wp-menu-icons"))))),(0,e.createElement)(o,{icon:t.icon,settings:l}),(0,e.createElement)(s,{settings:t,onChangeSettings:n}))}const u=window.lodash;function p({settings:t,prevSettings:n,onSave:l,onRemove:i}){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"media-toolbar-secondary"}),(0,e.createElement)("div",{className:"media-toolbar-primary search-form"},(0,e.createElement)("button",{type:"button",className:"button media-button button-large button-primary media-button-select save",onClick:e=>{e.preventDefault();const n=document.getElementById("menu-item-"+t.id),a=document.getElementById("menu-item-settings-"+t.id);a.querySelectorAll("#wpmi-input-label").forEach(e=>e.value=t.label),a.querySelectorAll("#wpmi-input-position").forEach(e=>e.value=t.position),a.querySelectorAll("#wpmi-input-align").forEach(e=>e.value=t.align),a.querySelectorAll("#wpmi-input-size").forEach(e=>e.value=t.size),a.querySelectorAll("#wpmi-input-icon").forEach(e=>e.value=t.icon),a.querySelectorAll("#wpmi-input-color").forEach(e=>e.value=t.color);const i=n.querySelector(".menu-item-wpmi_icon"),o=n.querySelector(".menu-item-wpmi_plus");i&&i.remove();const r=document.createElement("i");r.className="menu-item-wpmi_icon "+t.icon,o.after(r),l()},disabled:(0,u.isEqual)(t,n)},(0,a.__)("Save","wp-menu-icons")),(0,e.createElement)("button",{type:"button",className:"button media-button button-large button-secondary remove",onClick:e=>{e.preventDefault();const n=document.getElementById("menu-item-"+t.id),a=document.getElementById("menu-item-settings-"+t.id);a.querySelectorAll("#wpmi-input-label").forEach(e=>e.value=""),a.querySelectorAll("#wpmi-input-position").forEach(e=>e.value=""),a.querySelectorAll("#wpmi-input-align").forEach(e=>e.value=""),a.querySelectorAll("#wpmi-input-size").forEach(e=>e.value=""),a.querySelectorAll("#wpmi-input-icon").forEach(e=>e.value=""),a.querySelectorAll("#wpmi-input-color").forEach(e=>e.value="");const l=n.querySelector(".menu-item-wpmi_icon");l&&l.remove(),i()}},(0,a.__)("Remove","wp-menu-icons"))))}const{WPMI_PLUGIN_NAME:d,WPMI_PREFIX:v,WPMI_PREMIUM_SELL_URL:E}=wpmi_navmenu,g=()=>{const{currentLibrary:n,isResolvingCurrentLibrary:o}=(0,l.useCurrentLibrary)(),{iconMap:r,isLoadingIconMap:c,filterIcons:s}=(0,l.useCurrentLibraryIconMap)(),[u,g]=(0,t.useState)(!1),[b,w]=(0,t.useState)(""),[f,y]=(0,t.useState)({}),[h,_]=(0,t.useState)({}),S=()=>g(!1),N=e=>{const t=e.id.split("-")[2],n=document.getElementById("menu-item-settings-"+t),a={label:n.querySelector("#wpmi-input-label").value,position:n.querySelector("#wpmi-input-position").value,align:n.querySelector("#wpmi-input-align").value,size:n.querySelector("#wpmi-input-size").value,icon:n.querySelector("#wpmi-input-icon").value,color:n.querySelector("#wpmi-input-color").value,id:t};y(a),_(a),g(!0)},I={settings:f,onChangeSettings:y},q={settings:f,prevSettings:h,onSave:S,onRemove:S};return(0,t.useEffect)(()=>{document.querySelectorAll(".menu-item-wpmi_open").forEach(e=>e.addEventListener("click",e=>{e.preventDefault();const t=e.target.closest("li");t&&N(t)}));const e=document.getElementById("menu-to-edit");e&&new MutationObserver(e=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)"li"===e.nodeName.toLowerCase()&&e.querySelector(".menu-item-wpmi_open").addEventListener("click",t=>{t.preventDefault(),N(e)})}).observe(e,{childList:!0})},[]),(0,e.createElement)(i.Modal,{title:d,pluginPrefix:v,show:u,onClose:S,premiumSelURL:E,premiumTitle:"Premium",tabTitle:n?.label,toolbar:!0,toolbarSearchIn:n?.label,onChangeToolbar:w,sidebarContent:(0,e.createElement)(m,{...I}),footerContent:(0,e.createElement)(p,{...q})},o&&c?(0,e.createElement)(i.Spinner,null):r.length>0?(0,e.createElement)(i.IconMap,{iconMap:s(b),onChangeIcon:e=>y({...f,icon:e}),icon:f.icon}):(0,a.__)("The library does not contain icons","wp-menu-icons"))};var b=n(972),w=n.n(b);const{WPMI_PREFIX:f}=wpmi_navmenu,y=document.querySelector(".menu-edit"),h=document.createElement("input");function _(){const{libraries:n,isResolvingLibraries:o,hasResolvedLibraries:r,hasLibraries:c}=(0,l.useLibraries)(),{currentLibrary:s,currentLibraryName:m,setCurrentLibraryName:u}=(0,l.useCurrentLibrary)(),{settings:p,hasResolvedSettings:d}=(0,l.useSettingsEntities)(),v=e=>u(e.target.value);return(0,t.useEffect)(()=>{s&&(h.value=m)},[m,s]),!o||r||d?c?(0,e.createElement)("div",{id:`tabs-panel-${f}-themes`,className:"tabs-panel tabs-panel-active"},(0,e.createElement)("ul",{id:f+"-themes-checklist",className:"categorychecklist form-no-clear"},n.filter(e=>p.active_libraries.includes(e.name)).map(({name:t,label:n,type:a,is_loaded:l})=>{const i="uploaded"===a;return(0,e.createElement)("li",{key:t},(0,e.createElement)("label",{className:w()("menu-item-title",i&&"wpmi__premium-badge")},(0,e.createElement)("input",{type:"radio",className:f+"-item-checkbox",name:f+"_font",disabled:!l,value:t,checked:t===m,onChange:v}),n))}))):(0,e.createElement)("div",null,(0,a.__)("There are no active libraries.","wp-menu-icons"),";"):(0,e.createElement)(i.Spinner,null)}h.type="hidden",h.id="wpmi_font",h.name="wpmi_font",y&&y.append(h);const{WPMI_PREFIX:S}=wpmi_navmenu;var N;N=()=>{const n=document.createElement("div");document.querySelector("body").append(n);const a=document.getElementById(`posttype-${S}-themes`);n&&(0,t.render)((0,e.createElement)(g,null),n),a&&(0,t.render)((0,e.createElement)(_,null),a)},/comp|inter|loaded/.test(document.readyState)?N():document.addEventListener("DOMContentLoaded",N,!1)})()})();
修改文件时间
将文件时间修改为当前时间的前一年
删除文件