cloudcmd 17.2.1 → 17.3.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.
Files changed (74) hide show
  1. package/ChangeLog +6 -0
  2. package/HELP.md +6 -5
  3. package/README.md +1 -1
  4. package/bin/cloudcmd.mjs +11 -4
  5. package/dist/cloudcmd.common.js +3 -3
  6. package/dist/cloudcmd.common.js.map +1 -1
  7. package/dist/cloudcmd.css +1 -1
  8. package/dist/cloudcmd.js +1 -1
  9. package/dist/cloudcmd.js.map +1 -1
  10. package/dist/index.html +1 -1
  11. package/dist/modules/cloud.js +1 -1
  12. package/dist/modules/cloud.js.map +1 -1
  13. package/dist/modules/command-line.js +1 -1
  14. package/dist/modules/command-line.js.map +1 -1
  15. package/dist/modules/config.js +1 -1
  16. package/dist/modules/config.js.map +1 -1
  17. package/dist/modules/contact.js +1 -1
  18. package/dist/modules/contact.js.map +1 -1
  19. package/dist/modules/edit-file-vim.js +1 -1
  20. package/dist/modules/edit-file-vim.js.map +1 -1
  21. package/dist/modules/edit-file.js +1 -1
  22. package/dist/modules/edit-file.js.map +1 -1
  23. package/dist/modules/edit-names-vim.js +1 -1
  24. package/dist/modules/edit-names-vim.js.map +1 -1
  25. package/dist/modules/edit-names.js +1 -1
  26. package/dist/modules/edit-names.js.map +1 -1
  27. package/dist/modules/edit.js +1 -1
  28. package/dist/modules/edit.js.map +1 -1
  29. package/dist/modules/help.js +1 -1
  30. package/dist/modules/help.js.map +1 -1
  31. package/dist/modules/konsole.js +1 -1
  32. package/dist/modules/konsole.js.map +1 -1
  33. package/dist/modules/markdown.js +1 -1
  34. package/dist/modules/markdown.js.map +1 -1
  35. package/dist/modules/menu.js +1 -1
  36. package/dist/modules/menu.js.map +1 -1
  37. package/dist/modules/operation.js +1 -1
  38. package/dist/modules/operation.js.map +1 -1
  39. package/dist/modules/polyfill.js +1 -1
  40. package/dist/modules/polyfill.js.map +1 -1
  41. package/dist/modules/terminal-run.js +1 -1
  42. package/dist/modules/terminal-run.js.map +1 -1
  43. package/dist/modules/terminal.js +1 -1
  44. package/dist/modules/terminal.js.map +1 -1
  45. package/dist/modules/upload.js +1 -1
  46. package/dist/modules/upload.js.map +1 -1
  47. package/dist/modules/user-menu.js +1 -1
  48. package/dist/modules/user-menu.js.map +1 -1
  49. package/dist/modules/view.js +1 -1
  50. package/dist/modules/view.js.map +1 -1
  51. package/dist/sw.js +4 -2
  52. package/dist/themes/dark.css +1 -0
  53. package/dist/themes/light.css +1 -0
  54. package/dist-dev/cloudcmd.css +2 -10
  55. package/dist-dev/cloudcmd.js +35 -1
  56. package/dist-dev/index.html +3 -0
  57. package/dist-dev/modules/config.js +1 -1
  58. package/dist-dev/sw.js +4 -2
  59. package/dist-dev/themes/dark.css +49 -0
  60. package/dist-dev/themes/light.css +9 -0
  61. package/json/config.json +1 -0
  62. package/json/help.json +1 -0
  63. package/man/cloudcmd.1 +1 -0
  64. package/package.json +1 -1
  65. package/server/cloudcmd.mjs +3 -3
  66. package/server/{columns.js → columns.mjs} +13 -12
  67. package/server/columns.spec.mjs +40 -0
  68. package/server/{route.js → route.mjs} +24 -23
  69. package/server/route.spec.mjs +1 -1
  70. package/server/theme.mjs +33 -0
  71. package/server/themes.spec.mjs +31 -0
  72. package/server/{validate.js → validate.mjs} +24 -10
  73. package/server/validate.spec.mjs +30 -1
  74. package/tmpl/config.hbs +7 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["file://cloudcmd/modules/view.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","20","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","176","94","rendy","currify","wraptile","tryToCatch","load","modal","createElement","time","FS","isImage","isAudio","getType","Files","Events","Images","encode","assign","isArray","Array","lifo","fn","el","cb","series","a","f","isFn","addEvent","add","loadCSS","css","show","async","options","prefixURL","CloudCmd","Loading","bindKeys","addKey","listener","El","className","notAppend","tabIndex","append","open","initConfig","path","Info","raw","error","getData","hide","element","document","createTextNode","Config","config","title","viewFile","Markdown","viewHtml","names","files","map","DOM","getCurrentPath","filter","titles","href","split","pop","imageConfig","index","indexOf","autoSize","arrows","keys","helpers","viewImage","e","src","Error","check","template","TemplateAudio","is","innerHTML","type","getMediaElement","alert","allConfig","afterShow","querySelector","focus","viewMedia","createIframe","viewPDF","CurrentInfo","Key","beforeShow","unsetBind","beforeClose","rmKey","setBind","onOverlayClick","afterClose","width","height","addEventListener","contentWindow","_Config","init","DIR_DIST","loadAll","forEach","Overlay","_createIframe","_viewHtml","isConfig","Boolean","item","close","event","position","getCurrentByPosition","filesPassive","isFiles","includes","isFilesPassive","isCurrentFile","setCurrentFile","setCurrentByPosition","x","clientX","y","clientY","keyCode","ESC","_initConfig","98","extname","testRegExp","reg","test","getRegExp","ext","RegExp","some","detectType","headers","fetch","method","isVideo","isHTML","isMarkdown","_detectType"],"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,G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O,GAlCTvG,EAAOD,QAAQ4C,QAAUqB,UAGvB,OAFY6G,EAAQ9F,KACVA,QAAasG,EAAWtG,IALjB,UAAUiG,KAMjBjG,GAAc,MACpBtC,EAAQsC,GAAc,QAWnBrC,EADQrC,EATH0E,IAgBd,SAAiB1E,GACf,MAAO,qBAAqB2K,KAAK3K,GAPToL,CAAQpL,GAVN,QAPbmD,IAAK,UAAUwH,KAAKxH,GAQ7BkI,CAAO3G,GAAc,OAPRvB,IAAK,SAASwH,KAAKxH,GAQhCmI,CAAW5G,GAAc,gBAA7B,EAVYvB,IAiBGnD,GALjBL,EAAOD,QAAQ0C,QAAUA,EAQzBzC,EAAOD,QAAQ2C,QAAUA,EAOzB1C,EAAOD,QAAQ6L,YAAcP","file":"./modules/view.js","sourceRoot":""}
1
+ {"version":3,"sources":["file://cloudcmd/modules/view.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","20","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","178","95","rendy","currify","wraptile","tryToCatch","load","modal","createElement","time","FS","isImage","isAudio","getType","Files","Events","Images","encode","assign","isArray","Array","lifo","fn","el","cb","series","a","f","isFn","addEvent","add","loadCSS","css","show","async","options","prefixURL","CloudCmd","Loading","bindKeys","addKey","listener","El","className","notAppend","tabIndex","append","open","initConfig","path","Info","raw","error","getData","hide","element","document","createTextNode","Config","config","title","viewFile","Markdown","viewHtml","names","files","map","DOM","getCurrentPath","filter","titles","href","split","pop","imageConfig","index","indexOf","autoSize","arrows","keys","helpers","viewImage","e","src","Error","check","template","TemplateAudio","is","innerHTML","type","getMediaElement","alert","allConfig","afterShow","querySelector","focus","viewMedia","createIframe","viewPDF","CurrentInfo","Key","beforeShow","unsetBind","beforeClose","rmKey","setBind","onOverlayClick","afterClose","width","height","addEventListener","contentWindow","_Config","init","DIR_DIST","loadAll","forEach","Overlay","_createIframe","_viewHtml","isConfig","Boolean","item","close","event","position","getCurrentByPosition","filesPassive","isFiles","includes","isFilesPassive","isCurrentFile","setCurrentFile","setCurrentByPosition","x","clientX","y","clientY","keyCode","ESC","_initConfig","99","extname","testRegExp","reg","test","getRegExp","ext","RegExp","some","detectType","headers","fetch","method","isVideo","isHTML","isMarkdown","_detectType"],"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,EAAgBT,OAAQF,IAAK,CAG/C,IAFA,IAAIe,EAAiBJ,EAAgBX,GACjCgB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeb,OAAQe,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BV,EAAgBW,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOnB,IAAK,GAC5Bc,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAA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AAUA,EAQzBzC,EAAOD,QAAQ2C,QAAUA,EAOzB1C,EAAOD,QAAQ6L,YAAcP","file":"./modules/view.js","sourceRoot":""}
package/dist/sw.js CHANGED
@@ -1,9 +1,11 @@
1
1
  var serviceWorkerOption = {
2
2
  "assets": [
3
3
  "/columns/name-size-date.css",
4
- "/columns/name-size.css"
4
+ "/columns/name-size.css",
5
+ "/themes/dark.css",
6
+ "/themes/light.css"
5
7
  ]
6
8
  };
7
9
 
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=n(3),u="development"===r.env.NODE_ENV,c=i((t,e)=>e.waitUntil(t())),s=i((t,e)=>{const{request:n}=e,{url:r}=n,o=a(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)))}),a=t=>new URL(t).pathname,f="cloudcmd: Fri Mar 29 2024 10:32:51 GMT+0200 (Eastern European Standard Time)",l=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",c((async function(){console.info("cloudcmd: sw: install: "+f),await self.skipWaiting()}))),self.addEventListener("fetch",s((async function(t){const{request:e}=t,{url:n}=e,r=a(n),i=l(r,t.request),c=await caches.open(f),s=await c.match(e);if(!u&&s)return s;const[d,h]=await o(fetch,i,{credentials:"same-origin"});return d?new Response(d.message):(await async function(t,e){return(await caches.open(f)).put(t,e)}(e,h.clone()),h)}))),self.addEventListener("activate",c((async function(){console.info("cloudcmd: sw: activate: "+f),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var s,a=[],f=!1,l=-1;function d(){f&&s&&(f=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!f){var t=c(d);f=!0;for(var e=a.length;e;){for(s=a,a=[];++l<e;)s&&s[l].run();l=-1,e=a.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new p(t,e)),1!==a.length||f||c(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},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}]);
10
+ !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=n(3),u="development"===r.env.NODE_ENV,c=i((t,e)=>e.waitUntil(t())),s=i((t,e)=>{const{request:n}=e,{url:r}=n,o=a(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)))}),a=t=>new URL(t).pathname,f="cloudcmd: Fri Mar 29 2024 13:28:34 GMT+0200 (Eastern European Standard Time)",l=(t,e)=>"/"!==t?e:(t=>new Request(t,{credentials:"same-origin"}))("/");self.addEventListener("install",c((async function(){console.info("cloudcmd: sw: install: "+f),await self.skipWaiting()}))),self.addEventListener("fetch",s((async function(t){const{request:e}=t,{url:n}=e,r=a(n),i=l(r,t.request),c=await caches.open(f),s=await c.match(e);if(!u&&s)return s;const[d,h]=await o(fetch,i,{credentials:"same-origin"});return d?new Response(d.message):(await async function(t,e){return(await caches.open(f)).put(t,e)}(e,h.clone()),h)}))),self.addEventListener("activate",c((async function(){console.info("cloudcmd: sw: activate: "+f),await self.clients.claim();const t=await caches.keys(),e=caches.delete.bind(caches);await Promise.all(t.map(e))})))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var s,a=[],f=!1,l=-1;function d(){f&&s&&(f=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!f){var t=c(d);f=!0;for(var e=a.length;e;){for(s=a,a=[];++l<e;)s&&s[l].run();l=-1,e=a.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new p(t,e)),1!==a.length||f||c(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},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
11
  //# sourceMappingURL=sw.js.map
@@ -0,0 +1 @@
1
+ :root{--link-color:#317bf9;--border-color:rgba(49,123,249,0.4);--background:#22272e;--column-color:#727e8c;--icon-color:#478be6;--button-background:#22272e;--internal-background:#373e47}.view{background:var(--internal-background)!important;color:var(--column-color)!important}.view a{color:var(--link-color)!important}.smalltalk .button-strip button,.smalltalk .page,.smalltalk header,.smalltalk input{background:var(--internal-background)!important;color:var(--link-color)!important;text-shadow:none!important}.cloudcmd-user-menu,.cloudcmd-user-menu-button{background:var(--internal-background)!important;color:var(--link-color)!important}.jqconsole{background:#373e47!important}.jqconsole-prompt,.log-msg{color:var(--column-color)!important}.menu{color:var(--link-color)!important;background:var(--internal-background)!important}
@@ -0,0 +1 @@
1
+ :root{--link-color:#00f;--selected-menu-item-color:#317bf9;--border-color:rgba(49,123,249,0.4);--background:#fff;--column-color:#000;--icon-color:#222;--button-background:#fff}
@@ -1,12 +1,3 @@
1
- :root {
2
- --link-color: blue;
3
- --selected-menu-item-color: #317bf9;
4
- --border-color: rgb(49 123 249 / 40%);
5
- --background: white;
6
- --column-color: black;
7
- --icon-color: #222;
8
- --button-background: white;
9
- }
10
1
  /*
11
2
  @import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);
12
3
  */
@@ -135,6 +126,7 @@ code {
135
126
  -ms-user-select: initial;
136
127
  -o-user-select: initial;
137
128
  user-select: text;
129
+ color: var(--column-color);
138
130
  }
139
131
 
140
132
  .panel,
@@ -763,4 +755,4 @@ a:active {
763
755
  overflow-y: hidden;
764
756
  }
765
757
  }
766
- /* @import url(./themes/dark.css); */
758
+
@@ -175,7 +175,19 @@ eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modul
175
175
  /***/ (function(module, exports, __webpack_require__) {
176
176
 
177
177
  "use strict";
178
- eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n__webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\n__webpack_require__(/*! ../css/nojs.css */ \"./css/nojs.css\");\n__webpack_require__(/*! ../css/columns/name-size-date.css */ \"./css/columns/name-size-date.css\");\n__webpack_require__(/*! ../css/columns/name-size.css */ \"./css/columns/name-size.css\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n registerSW,\n listenSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nmodule.exports = window.CloudCmd = async config => {\n window.Util = __webpack_require__(/*! ../common/util */ \"./common/util.js\");\n window.CloudFunc = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n window.DOM = __webpack_require__(/*! ./dom */ \"./client/dom/index.js\");\n window.CloudCmd = __webpack_require__(/*! ./client */ \"./client/client.js\");\n await register(config);\n __webpack_require__(/*! ./listeners */ \"./client/listeners/index.js\");\n __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n __webpack_require__(/*! ./sort */ \"./client/sort.js\");\n const prefix = getPrefix(config.prefix);\n window.CloudCmd.init(prefix, config);\n};\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile(async config => {\n if (isDev) return;\n const {\n DOM\n } = window;\n const prefix = getPrefix(config.prefix);\n await load.js(`${prefix}/dist/cloudcmd.common.js`);\n await load.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n window.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await registerSW(prefix);\n listenSW(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd/client/cloudcmd.js");
178
+ eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\n__webpack_require__(/*! ./css */ \"./client/css.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst {\n registerSW,\n listenSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\nconst isDev = process.env.NODE_ENV === 'development';\nmodule.exports = window.CloudCmd = async config => {\n window.Util = __webpack_require__(/*! ../common/util */ \"./common/util.js\");\n window.CloudFunc = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n window.DOM = __webpack_require__(/*! ./dom */ \"./client/dom/index.js\");\n window.CloudCmd = __webpack_require__(/*! ./client */ \"./client/client.js\");\n await register(config);\n __webpack_require__(/*! ./listeners */ \"./client/listeners/index.js\");\n __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n __webpack_require__(/*! ./sort */ \"./client/sort.js\");\n const prefix = getPrefix(config.prefix);\n window.CloudCmd.init(prefix, config);\n};\nfunction getPrefix(prefix) {\n if (!prefix) return '';\n if (!prefix.indexOf('/')) return prefix;\n return `/${prefix}`;\n}\nconst onUpdateFound = wraptile(async config => {\n if (isDev) return;\n const {\n DOM\n } = window;\n const prefix = getPrefix(config.prefix);\n await load.js(`${prefix}/dist/cloudcmd.common.js`);\n await load.js(`${prefix}/dist/cloudcmd.js`);\n console.log('cloudcmd: sw: updated');\n DOM.Events.removeAll();\n window.CloudCmd(config);\n});\nasync function register(config) {\n const {\n prefix\n } = config;\n const sw = await registerSW(prefix);\n listenSW(sw, 'updatefound', onUpdateFound(config));\n}\n\n//# sourceURL=file://cloudcmd/client/cloudcmd.js");
179
+
180
+ /***/ }),
181
+
182
+ /***/ "./client/css.js":
183
+ /*!***********************!*\
184
+ !*** ./client/css.js ***!
185
+ \***********************/
186
+ /*! no static exports found */
187
+ /***/ (function(module, exports, __webpack_require__) {
188
+
189
+ "use strict";
190
+ eval("\n\n__webpack_require__(/*! ../css/main.css */ \"./css/main.css\");\n__webpack_require__(/*! ../css/nojs.css */ \"./css/nojs.css\");\n__webpack_require__(/*! ../css/columns/name-size-date.css */ \"./css/columns/name-size-date.css\");\n__webpack_require__(/*! ../css/columns/name-size.css */ \"./css/columns/name-size.css\");\n__webpack_require__(/*! ../css/themes/light.css */ \"./css/themes/light.css\");\n__webpack_require__(/*! ../css/themes/dark.css */ \"./css/themes/dark.css\");\n\n//# sourceURL=file://cloudcmd/client/css.js");
179
191
 
180
192
  /***/ }),
181
193
 
@@ -389,6 +401,28 @@ eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd
389
401
 
390
402
  eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd/css/nojs.css");
391
403
 
404
+ /***/ }),
405
+
406
+ /***/ "./css/themes/dark.css":
407
+ /*!*****************************!*\
408
+ !*** ./css/themes/dark.css ***!
409
+ \*****************************/
410
+ /*! no static exports found */
411
+ /***/ (function(module, exports) {
412
+
413
+ eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd/css/themes/dark.css");
414
+
415
+ /***/ }),
416
+
417
+ /***/ "./css/themes/light.css":
418
+ /*!******************************!*\
419
+ !*** ./css/themes/light.css ***!
420
+ \******************************/
421
+ /*! no static exports found */
422
+ /***/ (function(module, exports) {
423
+
424
+ eval("// removed by extract-text-webpack-plugin\n\n//# sourceURL=file://cloudcmd/css/themes/light.css");
425
+
392
426
  /***/ })
393
427
 
394
428
  /******/ });
@@ -15,6 +15,9 @@
15
15
  <style data-name="columns">
16
16
  {{ columns }}
17
17
  </style>
18
+ <style data-name="themes">
19
+ {{ themes }}
20
+ </style>
18
21
  </head>
19
22
  <body>
20
23
  <div class="fm">{{ fm }}</div>
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n\n/* global CloudCmd, DOM, io */\n__webpack_require__(/*! ../../../css/config.css */ \"./css/config.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst squad = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst input = __webpack_require__(/*! ./input */ \"./client/modules/config/input.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst {\n getTitle\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n Dialog,\n setTitle\n} = DOM;\nconst Name = 'Config';\nCloudCmd[Name] = module.exports;\nconst loadSocket = promisify(DOM.loadSocket);\nconst showLoad = () => {\n Images.show.load('top');\n};\nconst addKey = currify((fn, input) => {\n Events.addKey(input, fn);\n return input;\n});\nconst addChange = currify((fn, input) => {\n Events.add('change', input, fn);\n return input;\n});\nconst Config = {};\nlet Template;\nconst loadCSS = load.css;\nmodule.exports.init = async () => {\n if (!CloudCmd.config('configDialog')) return;\n showLoad();\n const {\n prefix\n } = CloudCmd;\n [Template] = await Promise.all([Files.get('config-tmpl'), loadSocket(), loadCSS(`${prefix}/dist/config.css`), CloudCmd.View()]);\n initSocket();\n};\nconst {\n config,\n Key\n} = CloudCmd;\nlet Element;\nfunction getHost() {\n const {\n host,\n origin,\n protocol\n } = location;\n return origin || `${protocol}//${host}`;\n}\nfunction initSocket() {\n const href = getHost();\n const {\n prefixSocket,\n prefix\n } = CloudCmd;\n const ONE_MINUTE = 60 * 1000;\n const socket = io.connect(href + prefixSocket + '/config', {\n reconnectionAttempts: Infinity,\n reconnectionDelay: ONE_MINUTE,\n path: `${prefix}/socket.io`\n });\n const save = data => {\n onSave(data);\n socket.send(data);\n };\n authCheck(socket);\n socket.on('connect', () => {\n Config.save = save;\n });\n socket.on('message', onSave);\n socket.on('log', CloudCmd.log);\n socket.on('disconnect', () => {\n Config.save = saveHttp;\n });\n socket.on('err', Dialog.alert);\n}\nfunction authCheck(socket) {\n socket.emit('auth', config('username'), config('password'));\n socket.on('reject', wraptile(Dialog.alert, 'Wrong credentials!'));\n}\nConfig.save = saveHttp;\nmodule.exports.show = show;\nasync function show() {\n if (!CloudCmd.config('configDialog')) return;\n await fillTemplate();\n}\nasync function fillTemplate() {\n const [error, config] = await tryToCatch(Files.get, 'config');\n if (error) return Dialog.alert('Could not load config!');\n const {\n editor,\n packer,\n columns,\n configAuth,\n ...obj\n } = input.convert(config);\n obj[`${editor}-selected`] = 'selected';\n obj[`${packer}-selected`] = 'selected';\n obj[`${columns}-selected`] = 'selected';\n obj.configAuth = configAuth ? '' : 'hidden';\n const innerHTML = rendy(Template, obj);\n Element = createElement('form', {\n className: 'config',\n innerHTML\n });\n const inputs = document.querySelectorAll('input, select', Element);\n const [inputFirst] = inputs;\n let afterShow;\n if (inputFirst) {\n onAuthChange(inputFirst.checked);\n afterShow = inputFirst.focus.bind(inputFirst);\n }\n const getTarget = ({\n target\n }) => target;\n const handleChange = squad(onChange, getTarget);\n Array.from(inputs).map(addKey(onKey)).map(addChange(handleChange));\n const autoSize = true;\n CloudCmd.View.show(Element, {\n autoSize,\n afterShow\n });\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nasync function onChange(el) {\n const obj = {};\n const name = input.getName(el);\n const data = input.getValue(name, Element);\n if (name === 'name') onNameChange(data);else if (name === 'auth') onAuthChange(data);\n obj[name] = data;\n await Config.save(obj);\n}\nfunction onSave(obj) {\n for (const name of Object.keys(obj)) {\n const data = obj[name];\n CloudCmd._config(name, data);\n input.setValue(name, data, Element);\n }\n}\nasync function saveHttp(obj) {\n const {\n RESTful\n } = DOM;\n const [e] = await RESTful.Config.write(obj);\n if (e) return;\n onSave(obj);\n}\nfunction onAuthChange(checked) {\n const elUsername = input.getElementByName('username', Element);\n const elPassword = input.getElementByName('password', Element);\n elUsername.disabled = elPassword.disabled = !checked;\n}\nfunction onNameChange(name) {\n setTitle(getTitle({\n name\n }));\n}\nasync function onKey({\n keyCode,\n target\n}) {\n switch (keyCode) {\n case Key.ESC:\n return hide();\n case Key.ENTER:\n return await onChange(target);\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/config/index.js");
166
+ eval("\n\n/* global CloudCmd, DOM, io */\n__webpack_require__(/*! ../../../css/config.css */ \"./css/config.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst squad = __webpack_require__(/*! squad */ \"./node_modules/squad/lib/squad.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst input = __webpack_require__(/*! ./input */ \"./client/modules/config/input.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst {\n getTitle\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n Dialog,\n setTitle\n} = DOM;\nconst Name = 'Config';\nCloudCmd[Name] = module.exports;\nconst loadSocket = promisify(DOM.loadSocket);\nconst showLoad = () => {\n Images.show.load('top');\n};\nconst addKey = currify((fn, input) => {\n Events.addKey(input, fn);\n return input;\n});\nconst addChange = currify((fn, input) => {\n Events.add('change', input, fn);\n return input;\n});\nconst Config = {};\nlet Template;\nconst loadCSS = load.css;\nmodule.exports.init = async () => {\n if (!CloudCmd.config('configDialog')) return;\n showLoad();\n const {\n prefix\n } = CloudCmd;\n [Template] = await Promise.all([Files.get('config-tmpl'), loadSocket(), loadCSS(`${prefix}/dist/config.css`), CloudCmd.View()]);\n initSocket();\n};\nconst {\n config,\n Key\n} = CloudCmd;\nlet Element;\nfunction getHost() {\n const {\n host,\n origin,\n protocol\n } = location;\n return origin || `${protocol}//${host}`;\n}\nfunction initSocket() {\n const href = getHost();\n const {\n prefixSocket,\n prefix\n } = CloudCmd;\n const ONE_MINUTE = 60 * 1000;\n const socket = io.connect(href + prefixSocket + '/config', {\n reconnectionAttempts: Infinity,\n reconnectionDelay: ONE_MINUTE,\n path: `${prefix}/socket.io`\n });\n const save = data => {\n onSave(data);\n socket.send(data);\n };\n authCheck(socket);\n socket.on('connect', () => {\n Config.save = save;\n });\n socket.on('message', onSave);\n socket.on('log', CloudCmd.log);\n socket.on('disconnect', () => {\n Config.save = saveHttp;\n });\n socket.on('err', Dialog.alert);\n}\nfunction authCheck(socket) {\n socket.emit('auth', config('username'), config('password'));\n socket.on('reject', wraptile(Dialog.alert, 'Wrong credentials!'));\n}\nConfig.save = saveHttp;\nmodule.exports.show = show;\nasync function show() {\n if (!CloudCmd.config('configDialog')) return;\n await fillTemplate();\n}\nasync function fillTemplate() {\n const [error, config] = await tryToCatch(Files.get, 'config');\n if (error) return Dialog.alert('Could not load config!');\n const {\n editor,\n packer,\n columns,\n theme,\n configAuth,\n ...obj\n } = input.convert(config);\n obj[`${editor}-selected`] = 'selected';\n obj[`${packer}-selected`] = 'selected';\n obj[`${columns}-selected`] = 'selected';\n obj[`${theme}-selected`] = 'selected';\n obj.configAuth = configAuth ? '' : 'hidden';\n const innerHTML = rendy(Template, obj);\n Element = createElement('form', {\n className: 'config',\n innerHTML\n });\n const inputs = document.querySelectorAll('input, select', Element);\n const [inputFirst] = inputs;\n let afterShow;\n if (inputFirst) {\n onAuthChange(inputFirst.checked);\n afterShow = inputFirst.focus.bind(inputFirst);\n }\n const getTarget = ({\n target\n }) => target;\n const handleChange = squad(onChange, getTarget);\n Array.from(inputs).map(addKey(onKey)).map(addChange(handleChange));\n const autoSize = true;\n CloudCmd.View.show(Element, {\n autoSize,\n afterShow\n });\n}\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nasync function onChange(el) {\n const obj = {};\n const name = input.getName(el);\n const data = input.getValue(name, Element);\n if (name === 'name') onNameChange(data);else if (name === 'auth') onAuthChange(data);\n obj[name] = data;\n await Config.save(obj);\n}\nfunction onSave(obj) {\n for (const name of Object.keys(obj)) {\n const data = obj[name];\n CloudCmd._config(name, data);\n input.setValue(name, data, Element);\n }\n}\nasync function saveHttp(obj) {\n const {\n RESTful\n } = DOM;\n const [e] = await RESTful.Config.write(obj);\n if (e) return;\n onSave(obj);\n}\nfunction onAuthChange(checked) {\n const elUsername = input.getElementByName('username', Element);\n const elPassword = input.getElementByName('password', Element);\n elUsername.disabled = elPassword.disabled = !checked;\n}\nfunction onNameChange(name) {\n setTitle(getTitle({\n name\n }));\n}\nasync function onKey({\n keyCode,\n target\n}) {\n switch (keyCode) {\n case Key.ESC:\n return hide();\n case Key.ENTER:\n return await onChange(target);\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/config/index.js");
167
167
 
168
168
  /***/ }),
169
169
 
package/dist-dev/sw.js CHANGED
@@ -1,7 +1,9 @@
1
1
  var serviceWorkerOption = {
2
2
  "assets": [
3
3
  "/columns/name-size-date.css",
4
- "/columns/name-size.css"
4
+ "/columns/name-size.css",
5
+ "/themes/dark.css",
6
+ "/themes/light.css"
5
7
  ]
6
8
  };
7
9
 
@@ -101,7 +103,7 @@ var serviceWorkerOption = {
101
103
  /***/ (function(module, exports, __webpack_require__) {
102
104
 
103
105
  "use strict";
104
- eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\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 = process.env.NODE_ENV === '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 = \"Fri Mar 29 2024 10:33:02 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");
106
+ eval("\n\nconst process = __webpack_require__(/*! node:process */ \"./node_modules/process/browser.js\");\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 = process.env.NODE_ENV === '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 = \"Fri Mar 29 2024 13:28:49 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
107
 
106
108
  /***/ }),
107
109
 
@@ -0,0 +1,49 @@
1
+ :root {
2
+ --link-color: #317bf9;
3
+ --border-color: rgb(49 123 249 / 40%);
4
+ --background: #22272e;
5
+ --column-color: #727e8c;
6
+ --icon-color: #478be6;
7
+ --button-background: #22272e;
8
+ --internal-background: #373e47;
9
+ }
10
+
11
+ .view {
12
+ background: var(--internal-background) !important;
13
+ color: var(--column-color) !important;
14
+ }
15
+ .view a {
16
+ color: var(--link-color) !important;
17
+ }
18
+
19
+ .smalltalk .page,
20
+ .smalltalk header,
21
+ .smalltalk .button-strip button,
22
+ .smalltalk input {
23
+ background: var(--internal-background) !important;
24
+ color: var(--link-color) !important;
25
+ text-shadow: none !important;
26
+ }
27
+
28
+ .cloudcmd-user-menu,
29
+ .cloudcmd-user-menu-button {
30
+ background: var(--internal-background) !important;
31
+ color: var(--link-color) !important;
32
+ }
33
+
34
+ .jqconsole {
35
+ background: #373e47 !important;
36
+ }
37
+
38
+ .jqconsole-prompt {
39
+ color: var(--column-color) !important;
40
+ }
41
+
42
+ .log-msg {
43
+ color: var(--column-color) !important;
44
+ }
45
+
46
+ .menu {
47
+ color: var(--link-color) !important;
48
+ background: var(--internal-background) !important;
49
+ }
@@ -0,0 +1,9 @@
1
+ :root {
2
+ --link-color: blue;
3
+ --selected-menu-item-color: #317bf9;
4
+ --border-color: rgb(49 123 249 / 40%);
5
+ --background: white;
6
+ --column-color: black;
7
+ --icon-color: #222;
8
+ --button-background: white;
9
+ }
package/json/config.json CHANGED
@@ -34,6 +34,7 @@
34
34
  "showFileName": false,
35
35
  "vim": false,
36
36
  "columns": "name-size-date-owner-mode",
37
+ "theme": "light",
37
38
  "export": false,
38
39
  "exportToken": "root",
39
40
  "import": false,
package/json/help.json CHANGED
@@ -32,6 +32,7 @@
32
32
  "--terminal-auto-restart ": "restart command on exit",
33
33
  "--vim ": "enable vim hot keys",
34
34
  "--columns ": "set visible columns",
35
+ "--theme ": "set theme 'light' or 'dark'",
35
36
  "--export ": "enable export of config through a server",
36
37
  "--export-token ": "authorization token used by export server",
37
38
  "--import ": "enable import of config",
package/man/cloudcmd.1 CHANGED
@@ -55,6 +55,7 @@ programs in browser from any computer, mobile or tablet device.
55
55
  --terminal-auto-restart restart command on exit
56
56
  --vim enable vim hot keys
57
57
  --columns set visible columns
58
+ --theme set theme 'light' or 'dark'
58
59
  --export enable export of config through a server
59
60
  --export-token authorization token used by export server
60
61
  --import enable import of config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "17.2.1",
3
+ "version": "17.3.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "File manager for the web with console and editor",
@@ -20,8 +20,8 @@ import {createConfig, configPath} from './config.js';
20
20
  import modulas from './modulas.js';
21
21
  import userMenu from './user-menu.mjs';
22
22
  import rest from './rest/index.js';
23
- import route from './route.js';
24
- import validate from './validate.js';
23
+ import route from './route.mjs';
24
+ import * as validate from './validate.mjs';
25
25
  import prefixer from './prefixer.js';
26
26
  import terminal from './terminal.js';
27
27
  import distribute from './distribute/index.js';
@@ -64,7 +64,7 @@ function cloudcmd(params) {
64
64
  if (/root/.test(name))
65
65
  validate.root(value, config);
66
66
 
67
- if (/editor|packer|columns/.test(name))
67
+ if (/editor|packer|themes/.test(name))
68
68
  validate[name](value);
69
69
 
70
70
  if (/prefix/.test(name))
@@ -1,13 +1,14 @@
1
- 'use strict';
2
-
3
- const fullstore = require('fullstore');
4
- const process = require('node:process');
5
- const path = require('node:path');
6
- const fs = require('node:fs');
7
-
8
- const {nanomemoize} = require('nano-memoize');
9
- const readFilesSync = require('@cloudcmd/read-files-sync');
10
-
1
+ import path, {dirname} from 'node:path';
2
+ import {fileURLToPath} from 'node:url';
3
+ import process from 'node:process';
4
+ import fs from 'node:fs';
5
+ import fullstore from 'fullstore';
6
+ import nanomemoizeDefault from 'nano-memoize';
7
+ import readFilesSync from '@cloudcmd/read-files-sync';
8
+
9
+ const {nanomemoize} = nanomemoizeDefault;
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
11
12
  const isMap = (a) => /\.map$/.test(a);
12
13
  const not = (fn) => (a) => !fn(a);
13
14
 
@@ -19,9 +20,9 @@ const defaultColumns = {
19
20
  const _isDev = fullstore(process.env.NODE_ENV === 'development');
20
21
  const getDist = (isDev) => isDev ? 'dist-dev' : 'dist';
21
22
 
22
- module.exports.isDev = _isDev;
23
+ export const isDev = _isDev;
23
24
 
24
- module.exports.getColumns = ({isDev = _isDev()} = {}) => {
25
+ export const getColumns = ({isDev = _isDev()} = {}) => {
25
26
  const columns = readFilesSyncMemo(isDev);
26
27
 
27
28
  return {
@@ -0,0 +1,40 @@
1
+ import {dirname} from 'node:path';
2
+ import {fileURLToPath} from 'node:url';
3
+ import test from 'supertape';
4
+ import fs from 'node:fs';
5
+ import {getColumns, isDev} from './columns.mjs';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+
10
+ test('columns: prod', (t) => {
11
+ const columns = getColumns({
12
+ isDev: false,
13
+ });
14
+
15
+ t.equal(columns[''], '');
16
+ t.end();
17
+ });
18
+
19
+ test('columns: dev', (t) => {
20
+ const columns = getColumns({
21
+ isDev: true,
22
+ });
23
+
24
+ const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
25
+
26
+ t.equal(columns['name-size-date'], css);
27
+ t.end();
28
+ });
29
+
30
+ test('columns: no args', (t) => {
31
+ const currentIsDev = isDev();
32
+ isDev(true);
33
+ const columns = getColumns();
34
+
35
+ const css = fs.readFileSync(`${__dirname}/../css/columns/name-size-date.css`, 'utf8');
36
+ isDev(currentIsDev);
37
+
38
+ t.equal(columns['name-size-date'], css);
39
+ t.end();
40
+ });
@@ -1,24 +1,23 @@
1
- 'use strict';
2
-
3
- const {extname} = require('node:path');
4
-
5
- const _win32 = require('win32');
6
- const ponse = require('ponse');
7
- const rendy = require('rendy');
8
- const format = require('format-io');
9
- const currify = require('currify');
10
- const wraptile = require('wraptile');
11
- const tryToCatch = require('try-to-catch');
12
- const once = require('once');
13
- const pipe = require('pipe-io');
14
- const {contentType} = require('mime-types');
15
-
16
- const root = require(`./root`);
17
- const prefixer = require(`./prefixer`);
18
- const CloudFunc = require(`../common/cloudfunc`);
19
- const {getColumns} = require(`./columns`);
20
- const Template = require(`./template`);
1
+ import {createRequire} from 'node:module';
2
+ import {extname} from 'node:path';
3
+ import _win32 from 'win32';
4
+ import ponse from 'ponse';
5
+ import rendy from 'rendy';
6
+ import format from 'format-io';
7
+ import currify from 'currify';
8
+ import wraptile from 'wraptile';
9
+ import tryToCatch from 'try-to-catch';
10
+ import once from 'once';
11
+ import pipe from 'pipe-io';
12
+ import {contentType} from 'mime-types';
13
+ import root from './root.js';
14
+ import prefixer from './prefixer.js';
15
+ import CloudFunc from '../common/cloudfunc.js';
16
+ import Template from './template.js';
17
+ import {getColumns} from './columns.mjs';
18
+ import {getThemes} from './theme.mjs';
21
19
 
20
+ const require = createRequire(import.meta.url);
22
21
  const {stringify} = JSON;
23
22
  const {FS} = CloudFunc;
24
23
 
@@ -46,7 +45,7 @@ const getReadDir = (config, {win32 = _win32} = {}) => {
46
45
  /**
47
46
  * routing of server queries
48
47
  */
49
- module.exports = currify((config, options, request, response, next) => {
48
+ export default currify((config, options, request, response, next) => {
50
49
  const name = ponse.getPathName(request);
51
50
  const isFS = RegExp(`^/$|^${FS}`).test(name);
52
51
 
@@ -61,7 +60,7 @@ module.exports = currify((config, options, request, response, next) => {
61
60
  }).catch(next);
62
61
  });
63
62
 
64
- module.exports._getReadDir = getReadDir;
63
+ export const _getReadDir = getReadDir;
65
64
 
66
65
  async function route({config, options, request, response}) {
67
66
  const name = ponse.getPathName(request);
@@ -166,6 +165,7 @@ function indexProcessing(config, options) {
166
165
  prefix: getPrefix(config),
167
166
  config: stringify(config('*')),
168
167
  columns: getColumns()[config('columns')],
168
+ themes: getThemes()[config('theme')],
169
169
  });
170
170
 
171
171
  return data;
@@ -184,7 +184,8 @@ function buildIndex(config, html, data) {
184
184
  });
185
185
  }
186
186
 
187
- module.exports._hideKeysPanel = hideKeysPanel;
187
+ export const _hideKeysPanel = hideKeysPanel;
188
+
188
189
  function hideKeysPanel(html) {
189
190
  const keysPanel = '<div id="js-keyspanel" class="{{ className }}"';
190
191
  const keysPanelRegExp = '<div id="?js-keyspanel"? class="?{{ className }}"?';
@@ -6,7 +6,7 @@ import tryToCatch from 'try-to-catch';
6
6
  import {test, stub} from 'supertape';
7
7
  import serveOnce from 'serve-once';
8
8
  import cloudcmd from './cloudcmd.mjs';
9
- import {_getReadDir} from './route.js';
9
+ import {_getReadDir} from './route.mjs';
10
10
 
11
11
  const __filename = fileURLToPath(import.meta.url);
12
12
  const __dirname = dirname(__filename);
@@ -0,0 +1,33 @@
1
+ import path, {dirname} from 'node:path';
2
+ import {fileURLToPath} from 'node:url';
3
+ import process from 'node:process';
4
+ import fs from 'node:fs';
5
+ import fullstore from 'fullstore';
6
+ import nanomemoizeDefault from 'nano-memoize';
7
+ import readFilesSync from '@cloudcmd/read-files-sync';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ const isMap = (a) => /\.map$/.test(a);
12
+ const not = (fn) => (a) => !fn(a);
13
+
14
+ const _isDev = fullstore(process.env.NODE_ENV === 'development');
15
+ const getDist = (isDev) => isDev ? 'dist-dev' : 'dist';
16
+
17
+ export const isDev = _isDev;
18
+
19
+ export const getThemes = ({isDev = _isDev()} = {}) => {
20
+ return readFilesSyncMemo(isDev);
21
+ };
22
+
23
+ const {nanomemoize} = nanomemoizeDefault;
24
+
25
+ const readFilesSyncMemo = nanomemoize((isDev) => {
26
+ const dist = getDist(isDev);
27
+ const themesDir = path.join(__dirname, '..', dist, 'themes');
28
+ const names = fs
29
+ .readdirSync(themesDir)
30
+ .filter(not(isMap));
31
+
32
+ return readFilesSync(themesDir, names, 'utf8');
33
+ });
@@ -0,0 +1,31 @@
1
+ import {dirname} from 'node:path';
2
+ import {fileURLToPath} from 'node:url';
3
+ import test from 'supertape';
4
+ import fs from 'node:fs';
5
+ import {getThemes, isDev} from './theme.mjs';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+
10
+ test('themes: dev', (t) => {
11
+ const themes = getThemes({
12
+ isDev: true,
13
+ });
14
+
15
+ const css = fs.readFileSync(`${__dirname}/../css/themes/dark.css`, 'utf8');
16
+
17
+ t.equal(themes.dark, css);
18
+ t.end();
19
+ });
20
+
21
+ test('themes: no args', (t) => {
22
+ const currentIsDev = isDev();
23
+ isDev(true);
24
+ const themes = getThemes();
25
+
26
+ const css = fs.readFileSync(`${__dirname}/../css/themes/light.css`, 'utf8');
27
+ isDev(currentIsDev);
28
+
29
+ t.equal(themes.light, css);
30
+ t.end();
31
+ });