Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jacobsun/edidor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsun6eal <jacob.sun.meta@gmail.com>2019-05-20 09:14:52 +0300
committersun6eal <jacob.sun.meta@gmail.com>2019-05-20 09:14:52 +0300
commitd078c91674ef0d0f7c9f93aa88bcb4ebafcf40f8 (patch)
tree2e4a39f91e74703deb2e8d09687541587f4dff93
parent935fb9933033c56115ffa7c7ece3e5648ae77bd5 (diff)
update
-rw-r--r--src/index.js2
-rw-r--r--src/js/loader.js2
-rw-r--r--static/js/main.js4
3 files changed, 2 insertions, 6 deletions
diff --git a/src/index.js b/src/index.js
index eb112df..7b6b303 100644
--- a/src/index.js
+++ b/src/index.js
@@ -11,12 +11,10 @@ import {
import { getLoader } from './js/loader'
const loader = getLoader()
onEvent('DOMContentLoaded', e => {
- console.log('page loaded!', Date.now())
loader.loading()
const doms = {}
doms.pane = qs('.sidebar')
doms.main = qs('.main')
- doms.cloak = qs('#cloak')
doms.paneLeft = doms.pane.getBoundingClientRect().left
tryLoadMode(doms, loader)
tryRestoreSidebar(doms)
diff --git a/src/js/loader.js b/src/js/loader.js
index 7987f74..3058887 100644
--- a/src/js/loader.js
+++ b/src/js/loader.js
@@ -28,7 +28,6 @@ export function getLoader () {
}
}
const loading = () => {
- console.log('loading', ticket)
if (ticket) return
ticket = true
close(() => {
@@ -39,7 +38,6 @@ export function getLoader () {
})
}
const loaded = () => {
- console.log('loaded: ', ticket, opening)
if (!ticket) return
if (opening) return
opening = true
diff --git a/static/js/main.js b/static/js/main.js
index bf8650d..52cb8f5 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -1,4 +1,4 @@
-!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){},function(e,t,n){(function(t){var n="Expected a function",o=NaN,i="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,s="object"==typeof self&&self&&self.Object===Object&&self,f=c||s||Function("return this")(),m=Object.prototype.toString,p=Math.max,h=Math.min,g=function(){return f.Date.now()};function w(e,t,o){var i,r,a,d,l,u,c=0,s=!1,f=!1,m=!0;if("function"!=typeof e)throw new TypeError(n);function w(t){var n=i,o=r;return i=r=void 0,c=t,d=e.apply(o,n)}function v(e){var n=e-u;return void 0===u||n>=t||n<0||f&&e-c>=a}function x(){var e=g();if(v(e))return k(e);l=setTimeout(x,function(e){var n=t-(e-u);return f?h(n,a-(e-c)):n}(e))}function k(e){return l=void 0,m&&i?w(e):(i=r=void 0,d)}function M(){var e=g(),n=v(e);if(i=arguments,r=this,u=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(x,t),s?w(e):d}(u);if(f)return l=setTimeout(x,t),w(u)}return void 0===l&&(l=setTimeout(x,t)),d}return t=b(t)||0,y(o)&&(s=!!o.leading,a=(f="maxWait"in o)?p(b(o.maxWait)||0,t):a,m="trailing"in o?!!o.trailing:m),M.cancel=function(){void 0!==l&&clearTimeout(l),c=0,i=u=r=l=void 0},M.flush=function(){return void 0===l?d:k(g())},M}function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&m.call(e)==i}(e))return o;if(y(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=y(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=d.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?o:+e}e.exports=function(e,t,o){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(n);return y(o)&&(i="leading"in o?!!o.leading:i,r="trailing"in o?!!o.trailing:r),w(e,t,{leading:i,maxWait:t,trailing:r})}}).call(this,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t);n(0);const o=n(1);function i(e,t=document.body){return"string"==typeof t&&(t=document.querySelector(t)),t.querySelector(e)}function r(e,t={},...n){const o=document.createElement(e);return Object.keys(t).forEach(e=>{o.setAttribute(e,t[e])}),n.forEach(e=>{"string"==typeof e&&(e=document.createTextNode(e)),o.appendChild(e)}),o}function a(e,t){return"string"==typeof e&&(e=i(e)),e.classList.remove(t),e}function d(e,t){return"string"==typeof e&&(e=i(e)),e.classList.add(t),e}function l(e,t){return"string"==typeof e&&(e=i(e)),e.classList.contains(t)}function u(e,t){"string"==typeof e&&(e=i(e)),Object.keys(t).forEach(n=>{e.style[n]=t[n]})}function c(e,t,n=0,r=document.body,a={}){"string"==typeof r&&(r=i(r)),n>0?r.addEventListener(e,o(t,n),a):r.addEventListener(e,t,a)}const s={};function f(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function m(e){return e.duration?Math.min(function(e){const[t]=window.performance.getEntriesByName(e);return t?window.performance.now()-t.startTime:(window.performance.mark(e),0)}(e.id)/e.duration,1):1}s.get=(e=>window.localStorage.getItem(e)),s.set=((e,t)=>{null==t?t="":"string"!=typeof t&&(t=JSON.stringify(t)),window.localStorage.setItem(e,t)});const p={darkCode:["c","f","6","9"],lightCode:["a","b","c","d","e","f"],textCode:["1a2a3a","2a3a4a","3a4a5a","4a5a6a","5a6a7a","6a7a8a","7a8a9a"],grayCode:["aaa","bbb","ccc","ddd"],lightGrayCode:["e2e2e2","e7e7e7","ececec"],deepGrayCode:["222","333","444"],dark:()=>{let e="";for(let t=0;3!==t;t++){let t=p.darkCode[f(0,p.darkCode.length)];e+=t+t}return"#"+e},light:()=>{let e="";for(let t=0;6!==t;t++)e+=p.lightCode[f(0,p.lightCode.length)];return"#"+e},gray:()=>{let e=f(0,p.grayCode.length);return"#"+p.grayCode[e]},lightGray:()=>{let e=f(0,p.lightGrayCode.length);return"#"+p.lightGrayCode[e]},deepGray:()=>{let e=f(0,p.deepGrayCode.length);return"#"+p.deepGrayCode[e]},text:(e=0,t=7)=>{let n=f(e,t);return"#"+p.textCode[n]}};p.deepText=p.text.bind(p,0,2),p.mediumText=p.text.bind(p,2,5),p.lightText=p.text.bind(p,5,6);var h=function(e,...t){return function(){let n=e.slice();return t.forEach((e,t)=>{n[t]+=p[e]()}),n.join("").replace(/\s{2}/gm," ")}}`
+!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){},function(e,t,n){(function(t){var n="Expected a function",o=NaN,i="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,s="object"==typeof self&&self&&self.Object===Object&&self,f=c||s||Function("return this")(),m=Object.prototype.toString,p=Math.max,h=Math.min,g=function(){return f.Date.now()};function w(e,t,o){var i,r,a,d,u,l,c=0,s=!1,f=!1,m=!0;if("function"!=typeof e)throw new TypeError(n);function w(t){var n=i,o=r;return i=r=void 0,c=t,d=e.apply(o,n)}function v(e){var n=e-l;return void 0===l||n>=t||n<0||f&&e-c>=a}function x(){var e=g();if(v(e))return k(e);u=setTimeout(x,function(e){var n=t-(e-l);return f?h(n,a-(e-c)):n}(e))}function k(e){return u=void 0,m&&i?w(e):(i=r=void 0,d)}function M(){var e=g(),n=v(e);if(i=arguments,r=this,l=e,n){if(void 0===u)return function(e){return c=e,u=setTimeout(x,t),s?w(e):d}(l);if(f)return u=setTimeout(x,t),w(l)}return void 0===u&&(u=setTimeout(x,t)),d}return t=b(t)||0,y(o)&&(s=!!o.leading,a=(f="maxWait"in o)?p(b(o.maxWait)||0,t):a,m="trailing"in o?!!o.trailing:m),M.cancel=function(){void 0!==u&&clearTimeout(u),c=0,i=l=r=u=void 0},M.flush=function(){return void 0===u?d:k(g())},M}function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&m.call(e)==i}(e))return o;if(y(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=y(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=d.test(e);return n||u.test(e)?l(e.slice(2),n?2:8):a.test(e)?o:+e}e.exports=function(e,t,o){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(n);return y(o)&&(i="leading"in o?!!o.leading:i,r="trailing"in o?!!o.trailing:r),w(e,t,{leading:i,maxWait:t,trailing:r})}}).call(this,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t);n(0);const o=n(1);function i(e,t=document.body){return"string"==typeof t&&(t=document.querySelector(t)),t.querySelector(e)}function r(e,t={},...n){const o=document.createElement(e);return Object.keys(t).forEach(e=>{o.setAttribute(e,t[e])}),n.forEach(e=>{"string"==typeof e&&(e=document.createTextNode(e)),o.appendChild(e)}),o}function a(e,t){return"string"==typeof e&&(e=i(e)),e.classList.remove(t),e}function d(e,t){return"string"==typeof e&&(e=i(e)),e.classList.add(t),e}function u(e,t){return"string"==typeof e&&(e=i(e)),e.classList.contains(t)}function l(e,t){"string"==typeof e&&(e=i(e)),Object.keys(t).forEach(n=>{e.style[n]=t[n]})}function c(e,t,n=0,r=document.body,a={}){"string"==typeof r&&(r=i(r)),n>0?r.addEventListener(e,o(t,n),a):r.addEventListener(e,t,a)}const s={};function f(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function m(e){return e.duration?Math.min(function(e){const[t]=window.performance.getEntriesByName(e);return t?window.performance.now()-t.startTime:(window.performance.mark(e),0)}(e.id)/e.duration,1):1}s.get=(e=>window.localStorage.getItem(e)),s.set=((e,t)=>{null==t?t="":"string"!=typeof t&&(t=JSON.stringify(t)),window.localStorage.setItem(e,t)});const p={darkCode:["c","f","6","9"],lightCode:["a","b","c","d","e","f"],textCode:["1a2a3a","2a3a4a","3a4a5a","4a5a6a","5a6a7a","6a7a8a","7a8a9a"],grayCode:["aaa","bbb","ccc","ddd"],lightGrayCode:["e2e2e2","e7e7e7","ececec"],deepGrayCode:["222","333","444"],dark:()=>{let e="";for(let t=0;3!==t;t++){let t=p.darkCode[f(0,p.darkCode.length)];e+=t+t}return"#"+e},light:()=>{let e="";for(let t=0;6!==t;t++)e+=p.lightCode[f(0,p.lightCode.length)];return"#"+e},gray:()=>{let e=f(0,p.grayCode.length);return"#"+p.grayCode[e]},lightGray:()=>{let e=f(0,p.lightGrayCode.length);return"#"+p.lightGrayCode[e]},deepGray:()=>{let e=f(0,p.deepGrayCode.length);return"#"+p.deepGrayCode[e]},text:(e=0,t=7)=>{let n=f(e,t);return"#"+p.textCode[n]}};p.deepText=p.text.bind(p,0,2),p.mediumText=p.text.bind(p,2,5),p.lightText=p.text.bind(p,5,6);var h=function(e,...t){return function(){let n=e.slice();return t.forEach((e,t)=>{n[t]+=p[e]()}),n.join("").replace(/\s{2}/gm," ")}}`
.wild-mode code {
background: ${"lightGray"}
}
@@ -71,4 +71,4 @@
.wild-mode .footer .icon {
background: ${"deepGray"};
}
- `;function g(e){const t={last:!1,resizing:!1,resizable:!1};function n(t,n=4){return Math.abs(t-e.pane.getBoundingClientRect().right)<=n}function o(n){t.resizing=!1;let o=e.pane.getBoundingClientRect();!function(e){if(e<=10)return;s.set("sidebar_width",e)}(o.right-o.left)}c("mousedown",e=>{t.resizable&&(t.resizing=!0)},0),c("mouseup",o,0),c("keydown",e=>{e.ctrlKey&&66===e.keyCode&&y()},0),c("touchstart",e=>{t.resizing=n(e.touches[0].clientX,10)}),c("touchend",o),function(e,t,n=document.body){c("mousemove",t=>{e({clientX:t.clientX,clientY:t.clientY,type:t.type})},t,n,{passive:!0}),c("touchmove",t=>{e({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY,type:t.type})},t,n,{passive:!0})}(function(o){t.resizable=n(o.clientX),t.resizing?function(t){let n=t-e.paneLeft;n<=10?d(e.pane,"hide"):w(n)}(o.clientX):"mousemove"===o.type&&o.clientX>10&&t.last!==t.resizable&&(t.resizable?u(document.body,{cursor:"ew-resize"}):u(document.body,{cursor:"auto"}),t.last=t.resizable)},50,i(".middle"))}function w(e,t="px"){u(i(".sidebar"),{width:e+"px"}),u(i(".main"),{marginLeft:e+"px"})}function y(e,t){return l(e.pane,"hide")?(a(e.pane,"hide"),s.set("is_sidebar_hide","0")):(d(e.pane,"hide"),s.set("is_sidebar_hide","1")),t.preventDefault(),t.stopPropagation(),!1}const b=e=>{l(document.body,e)||d(function(e,t){return"string"==typeof e&&(e=i(e)),e.className="",e}(document.body),e),s.set("mode",e)};function v(e,t){c("click",e=>{a(".dialog","show")},0,".close-dialog"),c("click",e=>{const n=i("#theme-name").value.trim();n?/^[a-zA-Z\s-]+$/.test(n)?"light"!==n&&"dark"!==n&&"wild"!==n?(t.loading(),function(e){let t=function(e){let t=s.get("wild_style"),n=e.replace(/\s/g,"-");return t=t.replace(/wild-mode/g,`${n}-mode`),function(e,t){return`/*\nHugo Edidor theme wild mode exported.\nhomepage: https://github.com/jacobsun/edidor\nUsage:\n1. Throw me to your site root folder/static/css directory, you can rename me to whatever you like.\n2. Copy the code below to your config file.\n\n--------\n[[menu.main]]\nparent = "Theme"\nidentifier = "${e}"\nname = "${t}"\nurl = "#"\nweight = 30\n--------\n\n3. Change the field 'name' and 'weight' to whatever you like. Leave others alone, and don't add your custom field, hugo doesn't support that, though I really hope so :/.\n*/`}(n,e)+t}(e);!function(e,t){const n=r("a",{href:"data:text/plain;charset=utf-8,"+encodeURIComponent(t),download:e,style:{display:"none"}});document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e+".css",t)}(n),a(".dialog","show"),t.loaded()):window.alert("Mess up builtin themes."):window.alert("Only English letters, space, hyphens are allowed."):window.alert("Name is required.")},0,".export")}(function e(t){function n(e){return Math.pow(e,t)}return t=+t,n.exponent=e,n})(3),function e(t){function n(e){return 1-Math.pow(1-e,t)}return t=+t,n.exponent=e,n}(3),function e(t){function n(e){return((e*=2)<=1?Math.pow(e,t):2-Math.pow(2-e,t))/2}return t=+t,n.exponent=e,n}(3),Math.PI;(function e(t){function n(e){return e*e*((t+1)*e-t)}return t=+t,n.overshoot=e,n})(1.70158),function e(t){function n(e){return--e*e*((t+1)*e+t)+1}return t=+t,n.overshoot=e,n}(1.70158),function e(t){function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return t=+t,n.overshoot=e,n}(1.70158);var x=2*Math.PI,k=(function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=x);function i(e){return t*Math.pow(2,10*--e)*Math.sin((o-e)/n)}return i.amplitude=function(t){return e(t,n*x)},i.period=function(n){return e(t,n)},i}(1,.3),function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=x);function i(e){return 1-t*Math.pow(2,-10*(e=+e))*Math.sin((e+o)/n)}return i.amplitude=function(t){return e(t,n*x)},i.period=function(n){return e(t,n)},i}(1,.3));(function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=x);function i(e){return((e=2*e-1)<0?t*Math.pow(2,10*e)*Math.sin((o-e)/n):2-t*Math.pow(2,-10*e)*Math.sin((o+e)/n))/2}return i.amplitude=function(t){return e(t,n*x)},i.period=function(n){return e(t,n)},i})(1,.3);const M=function(){let e=i(".top"),t=i(".bottom"),n=document.documentElement.clientHeight/2,o=!1,r=!1,a=!1,d=!1;const l=(e,t,n,o=(()=>{}))=>{const i=()=>{let n=Math.min(e(m(r)),1);n<1?(t(n),window.requestAnimationFrame(i)):(window.performance.clearMarks(r.id),t(n),o())},r={duration:n,id:window.requestAnimationFrame(i)}};function u(i){l(k,o=>{e.style.top=-o*n+"px",t.style.top=o*n+n+"px"},1e3,()=>{a=!1,r=!1,d=!1,o=!1})}return{loading:()=>{console.log("loading",o),o||(o=!0,function(o){l(k,o=>{e.style.top=-(1-o)*n+"px",t.style.top=(1-o)*n+n+"px"},1e3,o)}(()=>{r=!0,d&&u()}))},loaded:()=>{console.log("loaded: ",o,a),o&&(a||(a=!0,r?u():d=!0))}}}();c("DOMContentLoaded",e=>{console.log("page loaded!",Date.now()),M.loading();const t={};t.pane=i(".sidebar"),t.main=i(".main"),t.cloak=i("#cloak"),t.paneLeft=t.pane.getBoundingClientRect().left,function(e,t){let n=s.get("mode");if(n&&b(n),"wild-mode"===n){let e=r("style",{class:"wild-ele"},s.get("wild_style"));document.body.appendChild(e)}t.loaded()}(0,M),function(e){w(s.get("sidebar_width")),"1"===s.get("is_sidebar_hide")?d(e.pane,"hide"):a(e.pane,"hide")}(t),function(e){c("click",y.bind(null,e),0,".toggle-sidebar")}(t),function(e,t){c("click",e=>{if(e.preventDefault(),e.stopPropagation(),"theme-switcher-button"===e.target.id)return;if(l(e.target,"export-wild"))return d(".dialog","show"),void i("#theme-name").focus();let n=e.target.dataset.theme;if(n){if(t.loading(),b(n+"-mode"),"wild"===n){const e=i(".wild-ele"),t=h();e?e.innerText=t:document.body.appendChild(r("style",{class:"wild-ele"},t)),s.set("wild_style",t)}t.loaded()}else console.error('Theme name not found, probably missing an "Identifier" field in Config file.')},0,"#theme-switcher")}(0,M),g(t),v(0,M)},0,document)}]); \ No newline at end of file
+ `;function g(e){const t={last:!1,resizing:!1,resizable:!1};function n(t,n=4){return Math.abs(t-e.pane.getBoundingClientRect().right)<=n}function o(n){t.resizing=!1;let o=e.pane.getBoundingClientRect();!function(e){if(e<=10)return;s.set("sidebar_width",e)}(o.right-o.left)}c("mousedown",e=>{t.resizable&&(t.resizing=!0)},0),c("mouseup",o,0),c("keydown",e=>{e.ctrlKey&&66===e.keyCode&&y()},0),c("touchstart",e=>{t.resizing=n(e.touches[0].clientX,10)}),c("touchend",o),function(e,t,n=document.body){c("mousemove",t=>{e({clientX:t.clientX,clientY:t.clientY,type:t.type})},t,n,{passive:!0}),c("touchmove",t=>{e({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY,type:t.type})},t,n,{passive:!0})}(function(o){t.resizable=n(o.clientX),t.resizing?function(t){let n=t-e.paneLeft;n<=10?d(e.pane,"hide"):w(n)}(o.clientX):"mousemove"===o.type&&o.clientX>10&&t.last!==t.resizable&&(t.resizable?l(document.body,{cursor:"ew-resize"}):l(document.body,{cursor:"auto"}),t.last=t.resizable)},50,i(".middle"))}function w(e,t="px"){l(i(".sidebar"),{width:e+"px"}),l(i(".main"),{marginLeft:e+"px"})}function y(e,t){return u(e.pane,"hide")?(a(e.pane,"hide"),s.set("is_sidebar_hide","0")):(d(e.pane,"hide"),s.set("is_sidebar_hide","1")),t.preventDefault(),t.stopPropagation(),!1}const b=e=>{u(document.body,e)||d(function(e,t){return"string"==typeof e&&(e=i(e)),e.className="",e}(document.body),e),s.set("mode",e)};function v(e,t){c("click",e=>{a(".dialog","show")},0,".close-dialog"),c("click",e=>{const n=i("#theme-name").value.trim();n?/^[a-zA-Z\s-]+$/.test(n)?"light"!==n&&"dark"!==n&&"wild"!==n?(t.loading(),function(e){let t=function(e){let t=s.get("wild_style"),n=e.replace(/\s/g,"-");return t=t.replace(/wild-mode/g,`${n}-mode`),function(e,t){return`/*\nHugo Edidor theme wild mode exported.\nhomepage: https://github.com/jacobsun/edidor\nUsage:\n1. Throw me to your site root folder/static/css directory, you can rename me to whatever you like.\n2. Copy the code below to your config file.\n\n--------\n[[menu.main]]\nparent = "Theme"\nidentifier = "${e}"\nname = "${t}"\nurl = "#"\nweight = 30\n--------\n\n3. Change the field 'name' and 'weight' to whatever you like. Leave others alone, and don't add your custom field, hugo doesn't support that, though I really hope so :/.\n*/`}(n,e)+t}(e);!function(e,t){const n=r("a",{href:"data:text/plain;charset=utf-8,"+encodeURIComponent(t),download:e,style:{display:"none"}});document.body.appendChild(n),n.click(),document.body.removeChild(n)}(e+".css",t)}(n),a(".dialog","show"),t.loaded()):window.alert("Mess up builtin themes."):window.alert("Only English letters, space, hyphens are allowed."):window.alert("Name is required.")},0,".export")}(function e(t){function n(e){return Math.pow(e,t)}return t=+t,n.exponent=e,n})(3),function e(t){function n(e){return 1-Math.pow(1-e,t)}return t=+t,n.exponent=e,n}(3),function e(t){function n(e){return((e*=2)<=1?Math.pow(e,t):2-Math.pow(2-e,t))/2}return t=+t,n.exponent=e,n}(3),Math.PI;(function e(t){function n(e){return e*e*((t+1)*e-t)}return t=+t,n.overshoot=e,n})(1.70158),function e(t){function n(e){return--e*e*((t+1)*e+t)+1}return t=+t,n.overshoot=e,n}(1.70158),function e(t){function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return t=+t,n.overshoot=e,n}(1.70158);var x=2*Math.PI,k=(function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=x);function i(e){return t*Math.pow(2,10*--e)*Math.sin((o-e)/n)}return i.amplitude=function(t){return e(t,n*x)},i.period=function(n){return e(t,n)},i}(1,.3),function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=x);function i(e){return 1-t*Math.pow(2,-10*(e=+e))*Math.sin((e+o)/n)}return i.amplitude=function(t){return e(t,n*x)},i.period=function(n){return e(t,n)},i}(1,.3));(function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=x);function i(e){return((e=2*e-1)<0?t*Math.pow(2,10*e)*Math.sin((o-e)/n):2-t*Math.pow(2,-10*e)*Math.sin((o+e)/n))/2}return i.amplitude=function(t){return e(t,n*x)},i.period=function(n){return e(t,n)},i})(1,.3);const M=function(){let e=i(".top"),t=i(".bottom"),n=document.documentElement.clientHeight/2,o=!1,r=!1,a=!1,d=!1;const u=(e,t,n,o=(()=>{}))=>{const i=()=>{let n=Math.min(e(m(r)),1);n<1?(t(n),window.requestAnimationFrame(i)):(window.performance.clearMarks(r.id),t(n),o())},r={duration:n,id:window.requestAnimationFrame(i)}};function l(i){u(k,o=>{e.style.top=-o*n+"px",t.style.top=o*n+n+"px"},1e3,()=>{a=!1,r=!1,d=!1,o=!1})}return{loading:()=>{o||(o=!0,function(o){u(k,o=>{e.style.top=-(1-o)*n+"px",t.style.top=(1-o)*n+n+"px"},1e3,o)}(()=>{r=!0,d&&l()}))},loaded:()=>{o&&(a||(a=!0,r?l():d=!0))}}}();c("DOMContentLoaded",e=>{M.loading();const t={};t.pane=i(".sidebar"),t.main=i(".main"),t.paneLeft=t.pane.getBoundingClientRect().left,function(e,t){let n=s.get("mode");if(n&&b(n),"wild-mode"===n){let e=r("style",{class:"wild-ele"},s.get("wild_style"));document.body.appendChild(e)}t.loaded()}(0,M),function(e){w(s.get("sidebar_width")),"1"===s.get("is_sidebar_hide")?d(e.pane,"hide"):a(e.pane,"hide")}(t),function(e){c("click",y.bind(null,e),0,".toggle-sidebar")}(t),function(e,t){c("click",e=>{if(e.preventDefault(),e.stopPropagation(),"theme-switcher-button"===e.target.id)return;if(u(e.target,"export-wild"))return d(".dialog","show"),void i("#theme-name").focus();let n=e.target.dataset.theme;if(n){if(t.loading(),b(n+"-mode"),"wild"===n){const e=i(".wild-ele"),t=h();e?e.innerText=t:document.body.appendChild(r("style",{class:"wild-ele"},t)),s.set("wild_style",t)}t.loaded()}else console.error('Theme name not found, probably missing an "Identifier" field in Config file.')},0,"#theme-switcher")}(0,M),g(t),v(0,M)},0,document)}]); \ No newline at end of file