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:
Diffstat (limited to 'static/js/main.js')
-rw-r--r--static/js/main.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/static/js/main.js b/static/js/main.js
index 52cb8f5..f9ae3ab 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -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?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
+ `;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=n+100,r=!1,a=!1,d=!1,u=!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 c(i){l(k,i=>{e.style.top=-i*o+"px",t.style.top=i*o+n+"px"},1e3,()=>{d=!1,a=!1,u=!1,r=!1})}return{loading:()=>{r||(r=!0,function(i){l(k,i=>{e.style.top=-(1-i)*o+"px",t.style.top=(1-i)*o+n+"px"},1e3,i)}(()=>{a=!0,u&&c()}))},loaded:()=>{r&&(d||(d=!0,a?c():u=!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