cloudcmd 16.9.0 → 16.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +14 -0
- package/HELP.md +3 -1
- package/README.md +1 -1
- package/dist/modules/user-menu.js +1 -1
- package/dist/modules/user-menu.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist-dev/modules/user-menu.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/package.json +1 -1
- package/static/user-menu.js +30 -29
package/ChangeLog
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
2023.01.19, v16.10.0
|
|
2
|
+
|
|
3
|
+
fix:
|
|
4
|
+
- lint: eslint-plugin-node -> eslint-plugin-n
|
|
5
|
+
- lint: eslint-plugin-node -> eslint-plugin-n
|
|
6
|
+
|
|
7
|
+
feature:
|
|
8
|
+
- client: user-menu: navigate: add support of \D + [JK] to speed up vim navigation
|
|
9
|
+
|
|
10
|
+
2023.01.18, v16.9.1
|
|
11
|
+
|
|
12
|
+
fix:
|
|
13
|
+
- static: user-menu: convert flac to mp3
|
|
14
|
+
|
|
1
15
|
2023.01.17, v16.9.0
|
|
2
16
|
|
|
3
17
|
feature:
|
package/HELP.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cloud Commander v16.
|
|
1
|
+
# Cloud Commander v16.10.0
|
|
2
2
|
|
|
3
3
|
### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
|
|
4
4
|
|
|
@@ -1085,6 +1085,8 @@ There are a lot of ways to be involved in `Cloud Commander` development:
|
|
|
1085
1085
|
|
|
1086
1086
|
## Version history
|
|
1087
1087
|
|
|
1088
|
+
- *2023.01.19*, **[v16.10.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.10.0)**
|
|
1089
|
+
- *2023.01.18*, **[v16.9.1](//github.com/coderaiser/cloudcmd/releases/tag/v16.9.1)**
|
|
1088
1090
|
- *2023.01.17*, **[v16.9.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.9.0)**
|
|
1089
1091
|
- *2023.01.16*, **[v16.8.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.8.0)**
|
|
1090
1092
|
- *2023.01.15*, **[v16.7.0](//github.com/coderaiser/cloudcmd/releases/tag/v16.7.0)**
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Cloud Commander v16.
|
|
1
|
+
# Cloud Commander v16.10.0 [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Codacy][CodacyIMG]][CodacyURL] [![Gitter][GitterIMGURL]][GitterURL]
|
|
2
2
|
|
|
3
3
|
### [Main][MainURL] [Blog][BlogURL] [Support][SupportURL] [Demo][DemoURL]
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var r,u,c=t[0],i=t[1],
|
|
1
|
+
!function(e){function t(t){for(var r,u,c=t[0],i=t[1],l=t[2],d=0,f=[];d<c.length;d++)u=c[d],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&f.push(o[u][0]),o[u]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(a&&a(t);f.length;)f.shift()();return s.push.apply(s,l||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],r=!0,c=1;c<n.length;c++){var i=n[c];0!==o[i]&&(r=!1)}r&&(s.splice(t--,1),e=u(u.s=n[0]))}return e}var r={},o={19:0},s=[];function u(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=r,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)u.d(n,r,function(t){return e[t]}.bind(null,r));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var a=i;s.push([117,0]),n()}({117:function(e,t,n){"use strict";n(182);const r=n(0),o=n(8),s=n(7),u=n(4),c=n(2),i=n(27),l=n(3),{codeFrameColumns:a}=n(118),d=n(1),f=n(9),p=n(133),m=n(134),y=n(135),h=n(136),{runSelected:x}=n(137),b=u.css,C=s();CloudCmd.UserMenu=e.exports;const{Key:g}=CloudCmd;e.exports.init=async()=>{await Promise.all([b(CloudCmd.prefix+"/dist/user-menu.css"),CloudCmd.View()])},e.exports.show=async function(){d.show.load("top");const{dirPath:e}=w,t=await fetch(`${CloudCmd.prefix}/api/v1/user-menu?dir=${e}`),n=await t.text(),[r,o]=i(p,n);if(d.hide(),r)return f.alert(P({error:r,source:n}));C(n);const{names:s,keys:u,items:l,settings:a}=h(o);if(a.run)return x(a.select,l,I);const m=c("button",{className:"cloudcmd-user-menu-button",innerText:"User Menu",notAppend:!0}),y=c("select",{className:"cloudcmd-user-menu",innerHTML:v(s),notAppend:!0,size:10});m.addEventListener("click",M(o,y)),y.addEventListener("dblclick",k(o)),y.addEventListener("keydown",j({keys:u,userMenu:o}));CloudCmd.View.show([m,y],{autoSize:!0,afterShow:()=>y.focus()})},e.exports.hide=O;const{CurrentInfo:w}=DOM;function v(e){const t=[];for(const n of e)t.push(`<option>${n}</option>`);return t.join("")}function O(){CloudCmd.View.hide()}const k=r(async(e,t)=>{const{value:n}=t.target;await I(e[n])}),M=o(async(e,t)=>{let{value:n}=t;await I(e[n])}),j=r(async(e,t)=>{let{keys:n,userMenu:r}=e;const{keyCode:o,target:s}=t,u=t.key.toUpperCase();let c;if(t.preventDefault(),t.stopPropagation(),o===g.ESC)return O();if(o===g.ENTER)c=r[s.value];else{if(!n[u])return m(s,t);c=n[u]}await I(c)}),I=async e=>{O();const[t]=await l(e,{DOM:DOM,CloudCmd:CloudCmd,tryToCatch:l});if(!t)return;const n=C();return f.alert(P({error:t,source:n}))};function P(e){let{error:t,source:n}=e;const{code:r}=t;if(!r||"frame"===r)return t.message;const[o,s]=y(t);return`<pre>${a(n,{start:{line:o,column:s}},{message:t.message,highlightCode:!1})}</pre>`}},133:function(e,t,n){"use strict";e.exports=e=>{const t={};return Function("module",e)(t),t.exports}},134:function(e,t,n){"use strict";const r=n(7),{J:o,K:s,UP:u,DOWN:c}=n(36),i=r(1);e.exports=(e,t)=>{let{key:n,keyCode:r}=t;if(/^\d+$/.test(n)&&i(Number(n)),r===c||r===o){const t=i();return i(1),function(e,t){const{length:n}=e;e.selectedIndex===n-1?e.selectedIndex=0:e.selectedIndex+=t;e.selectedIndex<0&&(e.selectedIndex=n-1)}(e,t)}if(r===u||r===s){const t=i();return i(1),function(e,t){const{length:n}=e;e.selectedIndex?e.selectedIndex-=t:e.selectedIndex=n-1;e.selectedIndex<0&&(e.selectedIndex=0)}(e,t)}}},135:function(e,t,n){"use strict";const r=e=>"number"==typeof e;e.exports=e=>{const{lineNumber:t,columnNumber:n}=e;if(r(t)&&r(n))return[t,n];const o=e.stack.indexOf(">"),s=e.stack.slice(o+1),u=s.indexOf(")"),c=s.slice(1,u),[i,l]=c.split(":");return[Number(i),Number(l)]}},136:function(e,t,n){"use strict";const{entries:r,assign:o}=Object;e.exports=e=>{const t=[],n={},s={},u={};for(const[c,i]of r(e)){if("__settings"===c){o(u,e[c]);continue}if(c.startsWith("_"))continue;t.push(c);const[r,l]=c.split(" - ");n[r]=i,s[l]=i}return{names:t,keys:n,items:s,settings:u}}},137:function(e,t,n){"use strict";e.exports.runSelected=async(e,t,n)=>{for(const r of e)await n(t[r])}},182:function(e,t){}});
|
|
2
2
|
//# sourceMappingURL=user-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file://cloudcmd/modules/user-menu.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","19","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","117","currify","wraptile","fullstore","load","createElement","tryCatch","tryToCatch","codeFrameColumns","Images","Dialog","getUserMenu","navigate","parseError","parseUserMenu","runSelected","loadCSS","css","sourceStore","CloudCmd","Key","init","async","Promise","all","prefix","View","show","dirPath","CurrentInfo","res","fetch","source","text","error","userMenu","hide","alert","getCodeFrame","names","keys","items","settings","run","select","runUserMenu","button","className","innerText","notAppend","innerHTML","fillTemplate","size","addEventListener","onButtonClick","onDblClick","onKeyDown","autoSize","afterShow","focus","DOM","options","option","join","e","target","_ref","_ref2","keyCode","keyName","toUpperCase","preventDefault","stopPropagation","ESC","ENTER","fn","_ref3","code","message","line","column","start","highlightCode","133","menuFn","Function","134","J","K","UP","DOWN","el","selectedIndex","down","up","135","isNumber","a","lineNumber","columnNumber","before","stack","indexOf","str","after","newStr","split","
|
|
1
|
+
{"version":3,"sources":["file://cloudcmd/modules/user-menu.js"],"names":["modules","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","19","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","117","currify","wraptile","fullstore","load","createElement","tryCatch","tryToCatch","codeFrameColumns","Images","Dialog","getUserMenu","navigate","parseError","parseUserMenu","runSelected","loadCSS","css","sourceStore","CloudCmd","Key","init","async","Promise","all","prefix","View","show","dirPath","CurrentInfo","res","fetch","source","text","error","userMenu","hide","alert","getCodeFrame","names","keys","items","settings","run","select","runUserMenu","button","className","innerText","notAppend","innerHTML","fillTemplate","size","addEventListener","onButtonClick","onDblClick","onKeyDown","autoSize","afterShow","focus","DOM","options","option","join","e","target","_ref","_ref2","keyCode","keyName","toUpperCase","preventDefault","stopPropagation","ESC","ENTER","fn","_ref3","code","message","line","column","start","highlightCode","133","menuFn","Function","134","J","K","UP","DOWN","store","el","test","Number","count","selectedIndex","down","up","135","isNumber","a","lineNumber","columnNumber","before","stack","indexOf","str","after","newStr","split","136","entries","assign","startsWith","137","selectedItems","selected","182"],"mappings":"CAAS,SAAUA,GAET,SAASC,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDH,EAAQG,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCO,EAASC,QACdD,EAASS,OAATT,GAOD,OAHAU,EAAgBH,KAAKI,MAAMD,EAAiBZ,GAAkB,IAGvDc,IAER,SAASA,IAER,IADA,IAAIC,EACId,EAAI,EAAGA,EAAIW,EA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GAAOe,OAAOd,MAKzB+B,IACA,SAAU7I,EAAQD,EAASJ,GAEjC,aAGA,MAAMmJ,QACJA,EAAOC,OACPA,GACErK,OACJsB,EAAOD,QAAUkE,IACf,MAAMI,EAAQ,GACRC,EAAO,GACPC,EAAQ,GACRC,EAAW,GACjB,IAAK,MAAOiE,EAAKhC,KAAOqC,EAAQ7E,GAAW,CACzC,GAAY,eAARwE,EAAsB,CACxBM,EAAOvE,EAAUP,EAASwE,IAC1B,SAEF,GAAIA,EAAIO,WAAW,KACjB,SAEF3E,EAAMtF,KAAK0J,GACX,MAAOrH,EAAKf,GAAQoI,EAAIG,MAAM,OAC9BtE,EAAKlD,GAAOqF,EACZlC,EAAMlE,GAAQoG,EAEhB,MAAO,CACLpC,QACAC,OACAC,QACAC,cAMEyE,IACA,SAAUjJ,EAAQD,EAASJ,GAEjC,aAGAK,EAAOD,QAAQ8C,YAAcO,MAAO8F,EAAe3E,EAAOI,KACxD,IAAK,MAAMwE,KAAYD,QACfvE,EAAYJ,EAAM4E,MAMtBC,IACA,SAAUpJ,EAAQD","file":"./modules/user-menu.js","sourceRoot":""}
|
package/dist/sw.js
CHANGED
|
@@ -5,5 +5,5 @@ var serviceWorkerOption = {
|
|
|
5
5
|
]
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=o((t,e)=>e.waitUntil(t())),c=o((t,e)=>{const{request:n}=e,{url:r}=n,o=u(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),u=t=>new URL(t).pathname,a="cloudcmd:
|
|
8
|
+
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";const r=n(1),o=n(2),i=o((t,e)=>e.waitUntil(t())),c=o((t,e)=>{const{request:n}=e,{url:r}=n,o=u(r);r.endsWith("/")||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(o.startsWith("/api")||/^socket.io/.test(o)||e.respondWith(t(e)))}),u=t=>new URL(t).pathname,a="cloudcmd: Thu Jan 19 2023 22:49:08 GMT+0200 (Eastern European Standard Time)",s=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",i((async function(){console.info("cloudcmd: sw: install: "+a),await self.skipWaiting()}))),self.addEventListener("fetch",c((async function(t){const{request:e}=t,{url:n}=e,o=u(n),i=s(o,t.request),c=await caches.open(a),f=await c.match(e);if(f)return f;const[l,d]=await r(fetch,i,{credentials:"same-origin"});return l?new Response(l.message):(await async function(t,e){return(await caches.open(a)).put(t,e)}(e,d.clone()),d)}))),self.addEventListener("activate",i((async function(){console.info("cloudcmd: sw: activate: "+a),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e,n){"use strict";t.exports=async(t,...e)=>{!function(t){if("function"!=typeof t)throw Error("fn should be a function!")}(t);try{return[null,await t(...e)]}catch(t){return[t]}}},function(t,e,n){"use strict";const r=(t,...e)=>{if(function(t){if("function"!=typeof t)throw Error("fn should be function!")}(t),e.length>=t.length)return t(...e);const n=(...n)=>r(t,...e,...n),o=t.length-e.length-1;return(t=>[function(e){return t(...arguments)},function(e,n){return t(...arguments)},function(e,n,r){return t(...arguments)},function(e,n,r,o){return t(...arguments)},function(e,n,r,o,i){return t(...arguments)}])(n)[o]||n};t.exports=r}]);
|
|
9
9
|
//# sourceMappingURL=sw.js.map
|
|
@@ -187,7 +187,7 @@ eval("\n\n/* global CloudCmd, DOM */\n__webpack_require__(/*! ../../../css/user-
|
|
|
187
187
|
/***/ (function(module, exports, __webpack_require__) {
|
|
188
188
|
|
|
189
189
|
"use strict";
|
|
190
|
-
eval("\n\nconst {\n J,\n K,\n UP,\n DOWN\n} = __webpack_require__(/*! ../../key/key.js */ \"./client/key/key.js\");\nmodule.exports = (el, _ref) => {\n let {\n keyCode\n } = _ref;\n if (keyCode === DOWN || keyCode === J) return down(el);\n if (keyCode === UP || keyCode === K) return up(el);\n};\nfunction down(el) {\n const {\n length\n } = el;\n if (el.selectedIndex === length - 1) el.selectedIndex = 0;else
|
|
190
|
+
eval("\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst {\n J,\n K,\n UP,\n DOWN\n} = __webpack_require__(/*! ../../key/key.js */ \"./client/key/key.js\");\nconst store = fullstore(1);\nconst isDigit = a => /^\\d+$/.test(a);\nmodule.exports = (el, _ref) => {\n let {\n key,\n keyCode\n } = _ref;\n if (isDigit(key)) {\n store(Number(key));\n }\n if (keyCode === DOWN || keyCode === J) {\n const count = store();\n store(1);\n return down(el, count);\n }\n if (keyCode === UP || keyCode === K) {\n const count = store();\n store(1);\n return up(el, count);\n }\n};\nfunction down(el, count) {\n const {\n length\n } = el;\n if (el.selectedIndex === length - 1) el.selectedIndex = 0;else el.selectedIndex += count;\n if (el.selectedIndex < 0) el.selectedIndex = length - 1;\n}\nfunction up(el, count) {\n const {\n length\n } = el;\n if (!el.selectedIndex) el.selectedIndex = length - 1;else el.selectedIndex -= count;\n if (el.selectedIndex < 0) el.selectedIndex = 0;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/navigate.js");
|
|
191
191
|
|
|
192
192
|
/***/ }),
|
|
193
193
|
|
package/dist-dev/sw.js
CHANGED
|
@@ -101,7 +101,7 @@ var serviceWorkerOption = {
|
|
|
101
101
|
/***/ (function(module, exports, __webpack_require__) {
|
|
102
102
|
|
|
103
103
|
"use strict";
|
|
104
|
-
eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"
|
|
104
|
+
eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Thu Jan 19 2023 22:49:21 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js");
|
|
105
105
|
|
|
106
106
|
/***/ }),
|
|
107
107
|
|
package/package.json
CHANGED
package/static/user-menu.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const RENAME_FILE = 'Rename file';
|
|
4
|
-
const CDN = 'https://cdn.jsdelivr.net/gh/cloudcmd/user-menu@';
|
|
4
|
+
const CDN = 'https://cdn.jsdelivr.net/gh/cloudcmd/user-menu@1.1.1';
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
'__settings': {
|
|
@@ -13,46 +13,47 @@ module.exports = {
|
|
|
13
13
|
[`F2 - ${RENAME_FILE}`]: async ({DOM}) => {
|
|
14
14
|
await DOM.renameCurrent();
|
|
15
15
|
},
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
'F6 - Copy URL to current file': async ({DOM}) => {
|
|
18
|
-
const {copyURLToCurrentFile} = await import(`${CDN}
|
|
18
|
+
const {copyURLToCurrentFile} = await import(`${CDN}/menu/copy-url-to-current-file.js`);
|
|
19
19
|
await copyURLToCurrentFile({DOM});
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
'R - cd /': async ({CloudCmd}) => {
|
|
23
23
|
await CloudCmd.changeDir('/');
|
|
24
24
|
},
|
|
25
25
|
'Y - Convert YouTube to MP3': async ({CloudCmd, DOM}) => {
|
|
26
|
-
const {convertYouTubeToMp3} = await import(`${CDN}
|
|
26
|
+
const {convertYouTubeToMp3} = await import(`${CDN}/menu/convert-youtube-to-mp3.js`);
|
|
27
27
|
await convertYouTubeToMp3({CloudCmd, DOM});
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
'F - Convert flac to mp3 [ffmpeg]': async ({CloudCmd, DOM}) => {
|
|
31
|
-
const {convertFlacToMp3} = await import(`${CDN}
|
|
31
|
+
const {convertFlacToMp3} = await import(`${CDN}/menu/ffmpeg.js`);
|
|
32
32
|
await convertFlacToMp3({CloudCmd, DOM});
|
|
33
33
|
},
|
|
34
34
|
'M - Convert mpeg to mp3 [ffmpeg]': async ({CloudCmd, DOM}) => {
|
|
35
|
-
const {convertMp4ToMp3} = await import(`${CDN}
|
|
35
|
+
const {convertMp4ToMp3} = await import(`${CDN}/menu/ffmpeg.js`);
|
|
36
36
|
await convertMp4ToMp3({CloudCmd, DOM});
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
'C - Create User Menu File': async ({DOM, CloudCmd}) => {
|
|
40
|
-
const {
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const {
|
|
41
|
+
Dialog,
|
|
42
|
+
CurrentInfo,
|
|
43
|
+
} = DOM;
|
|
44
|
+
const currentFile = DOM.getCurrentByName('.cloudcmd.menu.js');
|
|
45
|
+
|
|
43
46
|
if (currentFile) {
|
|
44
47
|
const [cancel] = await Dialog.confirm(`Looks like file '.cloudcmd.menu.js' already exists. Overwrite?`);
|
|
45
|
-
|
|
48
|
+
|
|
46
49
|
if (cancel)
|
|
47
50
|
return;
|
|
48
51
|
}
|
|
49
|
-
|
|
50
|
-
const {CurrentInfo} = DOM;
|
|
52
|
+
|
|
51
53
|
const {dirPath} = CurrentInfo;
|
|
52
54
|
const path = `${dirPath}.cloudcmd.menu.js`;
|
|
53
55
|
const {prefix} = CloudCmd;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
|
|
56
57
|
const data = await readDefaultMenu({prefix});
|
|
57
58
|
await createDefaultMenu({
|
|
58
59
|
path,
|
|
@@ -68,25 +69,25 @@ module.exports = {
|
|
|
68
69
|
getCurrentByName,
|
|
69
70
|
selectFile,
|
|
70
71
|
} = DOM;
|
|
71
|
-
|
|
72
|
+
|
|
72
73
|
const {
|
|
73
74
|
files,
|
|
74
75
|
filesPassive,
|
|
75
76
|
panel,
|
|
76
77
|
panelPassive,
|
|
77
78
|
} = CurrentInfo;
|
|
78
|
-
|
|
79
|
+
|
|
79
80
|
const names = getFilenames(files);
|
|
80
81
|
const namesPassive = getFilenames(filesPassive);
|
|
81
|
-
|
|
82
|
+
|
|
82
83
|
const selectedNames = compare(names, namesPassive);
|
|
83
84
|
const selectedNamesPassive = compare(namesPassive, names);
|
|
84
|
-
|
|
85
|
+
|
|
85
86
|
selectNames(selectedNames, panel, {
|
|
86
87
|
selectFile,
|
|
87
88
|
getCurrentByName,
|
|
88
89
|
});
|
|
89
|
-
|
|
90
|
+
|
|
90
91
|
selectNames(selectedNamesPassive, panelPassive, {
|
|
91
92
|
selectFile,
|
|
92
93
|
getCurrentByName,
|
|
@@ -96,19 +97,19 @@ module.exports = {
|
|
|
96
97
|
|
|
97
98
|
async function createDefaultMenu({path, data, DOM, CloudCmd}) {
|
|
98
99
|
const {IO} = DOM;
|
|
99
|
-
|
|
100
|
+
|
|
100
101
|
await IO.write(path, data);
|
|
101
102
|
await CloudCmd.refresh();
|
|
102
|
-
|
|
103
|
+
|
|
103
104
|
DOM.setCurrentByName('.cloudcmd.menu.js');
|
|
104
|
-
|
|
105
|
+
|
|
105
106
|
await CloudCmd.EditFile.show();
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
async function readDefaultMenu({prefix}) {
|
|
109
110
|
const res = await fetch(`${prefix}/api/v1/user-menu/default`);
|
|
110
111
|
const data = await res.text();
|
|
111
|
-
|
|
112
|
+
|
|
112
113
|
return data;
|
|
113
114
|
}
|
|
114
115
|
|
|
@@ -123,14 +124,14 @@ function selectNames(names, panel, {selectFile, getCurrentByName}) {
|
|
|
123
124
|
module.exports._compare = compare;
|
|
124
125
|
function compare(a, b) {
|
|
125
126
|
const result = [];
|
|
126
|
-
|
|
127
|
+
|
|
127
128
|
for (const el of a) {
|
|
128
129
|
if (b.includes(el))
|
|
129
130
|
continue;
|
|
130
|
-
|
|
131
|
+
|
|
131
132
|
result.push(el);
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
+
|
|
134
135
|
return result;
|
|
135
136
|
}
|
|
136
137
|
|