PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
desktop-mode / assets / js / apps / user-edit.min.js

user-edit.min.js in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.10, at assets/js/apps/user-edit.min.js

8 lines 7.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var openStationApp_userEdit=function(k){"use strict";function M(n,...t){return{__wpdHtml:!0,strings:n,values:t}}function R(n){return!!n&&n.__wpdHtml===!0}const S="$$wpd$$",h=/\$\$wpd\$\$(\d+)\$\$/g,O="$$wpd-node$$",P=/^\$\$wpd-node\$\$(\d+)\$\$$/,L=new Set(["style","script","textarea","title"]);function W(n){let t="",e=!1,o=null,l=!1,r=null,s="",f=!1;for(let c=0;c<n.length;c++){const i=n[c];t+=i;for(let a=0;a<i.length;a++){const d=i[a];if(l){i.startsWith("-->",a)&&(l=!1,a+=2);continue}if(r!==null){d==="<"&&i[a+1]==="/"&&i.slice(a+2,a+2+r.length).toLowerCase()===r&&(a+=1+r.length,r=null,e=!0,f=!1,s="");continue}if(o!==null){d===o&&(o=null);continue}if(e){d==='"'||d==="'"?(o=d,f=!1):d===">"?(e=!1,f=!1,L.has(s)&&(r=s),s=""):f&&(/[a-zA-Z0-9-]/.test(d)?s+=d.toLowerCase():f=!1);continue}if(i.startsWith("<!--",a)){l=!0,a+=3;continue}const u=i[a+1]??"";d==="<"&&/[a-zA-Z/!]/.test(u)&&(e=!0,s="",f=/[a-zA-Z]/.test(u))}c<n.length-1&&(t+=e||l||r!==null?`${S}${c}$$`:`<!--${O}${c}$$-->`)}return t}const b=new WeakMap;function y(n){const t=b.get(n);if(t)return t;const e=document.createElement("template");e.innerHTML=W(n);const o=[],l=(f,c)=>{if(f.nodeType===Node.ELEMENT_NODE){const d=f;for(const u of Array.from(d.attributes)){const x=u.name,m=u.value,I=x[0];if(h.test(m))if(h.lastIndex=0,I==="@"){const p=h.exec(m);h.lastIndex=0,o.push({path:c,kind:"event",name:x.slice(1),valueIndex:p?Number(p[1]):0}),d.removeAttribute(x)}else if(I==="."){const p=h.exec(m);h.lastIndex=0,o.push({path:c,kind:"prop",name:x.slice(1),valueIndex:p?Number(p[1]):0}),d.removeAttribute(x)}else if(I==="?"){const p=h.exec(m);h.lastIndex=0,o.push({path:c,kind:"bool",name:x.slice(1),valueIndex:p?Number(p[1]):0}),d.removeAttribute(x)}else{const p=[],N=[];let v=0,w;for(h.lastIndex=0;(w=h.exec(m))!==null;)p.push(m.slice(v,w.index)),N.push(Number(w[1])),v=w.index+w[0].length;p.push(m.slice(v)),o.push({path:c,kind:"attr",name:x,template:p,valueIndices:N}),d.setAttribute(x,"")}}}const i=Array.from(f.childNodes);let a=0;for(let d=0;d<i.length;d++){const u=i[d],x=d+a;if(u.nodeType===Node.COMMENT_NODE){const m=P.exec(u.data);if(m){const I=document.createTextNode("");u.parentNode.replaceChild(I,u),o.push({path:[...c,x],kind:"node",valueIndex:Number(m[1])})}continue}if(u.nodeType===Node.TEXT_NODE){const m=u.textContent||"";if(!h.test(m)){h.lastIndex=0;continue}h.lastIndex=0;const I=u.parentNode;let p=0,N;const v=[],w=[];for(h.lastIndex=0;(N=h.exec(m))!==null;){N.index>p&&v.push(document.createTextNode(m.slice(p,N.index)));const E=document.createTextNode("");v.push(E),w.push({path:[...c,x+v.length-1],kind:"node",valueIndex:Number(N[1])}),p=N.index+N[0].length}p<m.length&&v.push(document.createTextNode(m.slice(p)));for(const E of v)I.insertBefore(E,u);I.removeChild(u),a+=v.length-1,o.push(...w)}else l(u,[...c,x])}};l(e.content,[]);const s={template:e,buildParts:f=>{const c=[];for(const i of o){let a=f;for(const d of i.path)a=a.childNodes[d];i.kind==="node"?c.push({kind:"node",valueIndex:i.valueIndex,child:{anchor:a,state:null}}):i.kind==="attr"?c.push({kind:"attr",element:a,name:i.name,template:i.template,valueIndices:i.valueIndices}):i.kind==="event"?c.push({kind:"event",valueIndex:i.valueIndex,element:a,name:i.name}):i.kind==="prop"?c.push({kind:"prop",valueIndex:i.valueIndex,element:a,name:i.name}):i.kind==="bool"&&c.push({kind:"bool",valueIndex:i.valueIndex,element:a,name:i.name})}return c}};return b.set(n,s),s}const C=new WeakMap;function j(n,t){for(const e of n.nodes)if(e.parentNode!==t)return!1;return!0}function K(n,t){const e=C.get(t);if(e&&e.strings===n.strings&&j(e,t)){$(e.parts,n.values);return}const o=y(n.strings),l=o.template.content.cloneNode(!0),r=o.buildParts(l),s=Array.from(l.childNodes);for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(l),$(r,n.values),C.set(t,{strings:n.strings,parts:r,nodes:s})}function $(n,t){for(const e of n)if(e.kind==="node")T(e.child,t[e.valueIndex]);else if(e.kind==="attr"){let o=e.template[0];for(let l=0;l<e.valueIndices.length;l++)o+=_(t[e.valueIndices[l]]),o+=e.template[l+1];o!==e.last&&(e.last=o,o===""?e.element.removeAttribute(e.name):e.element.setAttribute(e.name,o))}else if(e.kind==="event"){const o=t[e.valueIndex];o!==e.current&&(e.current&&e.element.removeEventListener(e.name,e.current),o&&e.element.addEventListener(e.name,o),e.current=o)}else if(e.kind==="prop"){const o=t[e.valueIndex];o!==e.last&&(e.last=o,e.element[e.name]=o)}else if(e.kind==="bool"){const o=!!t[e.valueIndex];o!==e.last&&(e.last=o,o?e.element.setAttribute(e.name,""):e.element.removeAttribute(e.name))}}function T(n,t){if(t==null||t===!1){n.state&&(g(n.state),n.state=null);return}if(Array.isArray(t)){D(n,t);return}if(R(t)){B(n,t);return}if(t instanceof Node){X(n,t);return}z(n,_(t))}function X(n,t){const e=n.state;e?.shape==="node"&&e.node===t||(e&&g(e),A(n,[t]),n.state={shape:"node",node:t})}function z(n,t){const e=n.state;if(e?.shape==="text"){e.text!==t&&(e.node.textContent=t,e.text=t);return}e&&g(e);const o=document.createTextNode(t);A(n,[o]),n.state={shape:"text",node:o,text:t}}function B(n,t){const e=n.state;if(e?.shape==="template"&&e.strings===t.strings){$(e.parts,t.values);return}e&&g(e);const o=y(t.strings),l=o.template.content.cloneNode(!0),r=o.buildParts(l),s=Array.from(l.childNodes);A(n,[l]),$(r,t.values),n.state={shape:"template",strings:t.strings,parts:r,nodes:s}}function D(n,t){const e=n.state;if(e?.shape==="array"){const l=Math.min(e.entries.length,t.length);for(let r=0;r<l;r++)T(e.entries[r],t[r]);if(t.length<e.entries.length){for(let r=t.length;r<e.entries.length;r++){const s=e.entries[r];s.state&&g(s.state),s.anchor.remove()}e.entries.length=t.length}else for(let r=e.entries.length;r<t.length;r++){const s=document.createTextNode("");A(n,[s]);const f={anchor:s,state:null};T(f,t[r]),e.entries.push(f)}return}e&&g(e);const o=[];for(const l of t){const r=document.createTextNode("");A(n,[r]);const s={anchor:r,state:null};T(s,l),o.push(s)}n.state={shape:"array",entries:o}}function A(n,t){const e=n.anchor.parentNode;if(e)for(const o of t)e.insertBefore(o,n.anchor)}function g(n){if(n.shape==="text"){n.node.remove();return}if(n.shape==="template"){for(const t of n.parts)t.kind==="node"&&t.child.state&&(g(t.child.state),t.child.state=null);for(const t of n.nodes)t.parentNode&&t.parentNode.removeChild(t);return}if(n.shape==="node"){n.node.parentNode&&n.node.parentNode.removeChild(n.node);return}for(const t of n.entries)t.state&&g(t.state),t.anchor.remove()}function _(n){return n==null||n===!1?"":String(n)}function H(n,t){const e=t.local??{},o={id:n,hasLocal:s=>Object.prototype.hasOwnProperty.call(e,s),runLocal:(s,f,c,i)=>{const a=e[s];if(!a)return f;const d={...f},u=a(d,c,i);return u===void 0?d:u},render:s=>{K(t.view(s),s.root),t.updated?.(s)},mounted:s=>t.mounted?.(s)},{placeholder:l}=t;l&&(o.placeholder=s=>l(s));const r=window;return(r.openStationApps??(r.openStationApps={}))[n]=o,o}const Z={success:5e3,error:8e3,info:void 0},q=H("desktop-mode-user-edit",{view:({state:n})=>M`<div class="os-user-edit-window" data-os-user-edit-window-root>
2 <os-user-profile
3 os-preserve
4 data-os-user-profile-host
5 user-id=${n.userId>0?String(n.userId):""}
6 ></os-user-profile>
7 </div>`,updated:n=>{const t=n.ui(()=>({wired:!1})),e=n.root.querySelector("os-user-profile");!e||t.wired||(t.wired=!0,e.config=n.extra,e.fetch=n.fetch,e.toast=(o,l)=>n.host.toast?.({message:o,duration:Z[l??"info"]}))}});return k.default=q,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),k}({});
8