cloudcmd 15.9.9 → 15.9.13
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 +22 -0
- package/HELP.md +6 -4
- package/README.md +1 -1
- package/dist/cloudcmd.common.js +1 -1
- package/dist/cloudcmd.common.js.map +1 -1
- package/dist/cloudcmd.css +1 -1
- package/dist/cloudcmd.js +1 -1
- package/dist/cloudcmd.js.map +1 -1
- package/dist/modules/operation.js +1 -1
- package/dist/modules/operation.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist-dev/cloudcmd.common.js +2 -2
- package/dist-dev/cloudcmd.css +9 -9
- package/dist-dev/cloudcmd.js +3 -3
- package/dist-dev/config.css +6 -6
- package/dist-dev/modules/operation.js +1 -1
- package/dist-dev/sw.js +1 -1
- package/dist-dev/view.css +1 -1
- package/package.json +3 -3
- package/server/cloudcmd.js +5 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){function t(t){for(var o,a,c=t[0],s=t[1],l=t[2],f=0,p=[];f<c.length;f++)a=c[f],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&p.push(r[a][0]),r[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(u&&u(t);p.length;)p.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,c=1;c<n.length;c++){var s=n[c];0!==r[s]&&(o=!1)}o&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},r={13:0},i=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;i.push([107,0]),n()}({107:function(e,t,n){"use strict";const o=n(0),r=n(8),{promisify:i}=n(15),a=n(5),c=n(4),s=n(3),{encode:l}=n(17),u=n(108),f=n(109),p=n(112);CloudCmd.Operation=t;const{config:m}=CloudCmd,{Dialog:d,Images:g}=DOM,h=r((function(e,t){const n=r(t),o=r(d.alert);e.on("accept",n(e)),e.on("reject",o("Wrong credentials!")),e.emit("auth",m("username"),m("password"))})),y={};let O,v,C,b,M,D,x;const w=DOM.CurrentInfo,k=g.show.load.bind(null,"top"),P=o((async function(e,t){let n,o,r,i,a,c="",s="",u=[];t?(c=t.from,s=t.to,u=t.names,r=w.panel):(c=w.dirPath,s=DOM.getNotCurrentDirPath(),n=DOM.getSelectedFiles(),u=DOM.getFilenames(n),t={},i=!0,r=w.panelPassive);u.length||u.push(DOM.getCurrentName());const[f]=u,p=DOM.getCurrentByName(f,r);if(!t&&j())return;const{type:g}=e,h="copy"===g,y=h?"confirmCopy":"confirmMove",O=h?"Copy":"Rename/Move",b=h?v:C;if(i&&m(y)){const[e,t]=function(e,t,n){const o=n.length,[r]=n;e+=" ",n.length>1?e+=o+" file(s)":e+='"'+r+'"';return e+=" to",d.prompt(e,t)}(O,s,u.map(l));return void(e||M(t))}function M(e){if(a=c!==e&&e,a&&!i||!p)return r();const n=`"${f}" already exist. Overwrite?`;function r(){k(),o={from:c,to:e,names:u},b(o,async()=>{await DOM.Storage.remove(c);const{panel:e,panelPassive:n}=w;w.isOnePanel||CloudCmd.refresh({panel:n,noCurrent:!0}),CloudCmd.refresh({panel:e},()=>{const e=f||t.names[0];DOM.setCurrentByName(e)})})}d.confirm(n,{cancel:!1}).then(r)}M(s)})),j=()=>{const{length:e}=DOM.getActiveFiles(),t=Boolean(!e);return t?d.alert.noFiles():t};e.exports.init=i(e=>{k(),a.series([DOM.loadSocket,async e=>{if(m("dropbox"))return e();const{prefix:t,prefixSocket:n}=CloudCmd;await async function(){const{prefix:e}=CloudCmd,t=e+"/fileop/fileop.js",[n]=await s(c.js,t);n&&d.alert(n.message);O=!0}(),await async function(e,t,n){t+="/fileop";const o=await fileop({prefix:e,socketPrefix:t});o.on("connect",h(o,F(n)))}(t,n,e)},e=>{O=!0,g.hide(),e()}],e)});const F=o((e,t)=>{!function(e){x=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Tar",callback:n,noContinue:!0,from:o,to:r});e.tar(o,r,i).then(a)},D=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Zip",callback:n,noContinue:!0,from:o,to:r});e.zip(o,r,i).then(a)},b=(t,n,o)=>{t=t.replace(/\?.*/,"");const r=f({operation:"Delete",callback:o,from:t});e.remove(t,n).then(r)},v=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Copy",callback:n,from:o,to:r,names:i});e.copy(o,r,i).then(a)},C=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Move",callback:n,from:o,to:r});e.move(o,r,i).then(a)},M=(t,n)=>{let{from:o,to:r}=t;const i=f({operation:"Extract",callback:n,noContinue:!0,from:o,to:r});e.extract(o,r).then(i)}}(t),e()});function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DOM.getActiveFiles();const t="?files",n=w.dirPath;if(j())return;k();const o=DOM.getFilenames(e),r=DOM.CurrentInfo.files.map(DOM.getCurrentName),i=DOM.getCurrentName(),a=p(i,r,o);b(n+t,o,async()=>{await CloudCmd.refresh();const e=w.files.map(DOM.getCurrentName).includes(i)?i:a;DOM.setCurrentByName(e)})}function N(e,t){let n,o,r=w.name;const{path:i,dirPath:a}=w,c=DOM.getActiveFiles(),s=DOM.getFilenames(c);if(function(e,t){if(!t)throw Error(e+" could not be empty!")}("operation",e),!s.length)return d.alert.noFiles();switch(e){case"extract":n=M,o={from:i,to:a},r=u(r);break;case"pack":n=function(e){return"zip"===e?D:x}(t),s.length>1&&(r=w.dir),r+=DOM.getPackerExt(t),o={from:a,to:a+r,names:s}}k(),n(o,e=>{!e&&CloudCmd.refresh({currentName:r})})}e.exports.hide=()=>{CloudCmd.View.hide()},e.exports.show=(e,t)=>{if(O)return"copy"===e?y.copy(t):"move"===e?y.move(t):"delete"===e?y.delete():"delete:silent"===e?y.deleteSilent():"pack"===e?y.pack():"extract"===e?y.extract():void 0},y.copy=P({type:"copy"}),y.move=P({type:"move"}),y.delete=async function(){if(j())return;const e="Do you really want to delete the ",t=DOM.getActiveFiles(),n=DOM.getFilenames(t),o=n.length;let r;if(o){let t="";for(let e=0;e<5&&e<o;e++)t+="\n"+n[e];o>=5&&(t+="\n..."),r=e+"selected "+o+" files/directories?\n"+l(t)}else{const t=DOM.getCurrentFile(),n=DOM.isCurrentIsDir(t),o=(e=>e?"directory":"file")(n)+" ",i=DOM.getCurrentName(t);r=e+"selected "+o+i+"?"}const[i]=await d.confirm(r);if(i)return;S(t)},y.deleteSilent=S,y.pack=()=>{N("pack","zip"===m("packer")?"zip":"tar")},y.extract=()=>{N("extract")}},108:function(e,t,n){"use strict";const{getExt:o}=n(9);e.exports=e=>{const t=function(e){return/\.tar\.gz$/.test(e)?".tar.gz":/\.tar\.bz2$/.test(e)?".tar.bz2":o(e)}(e);return e.replace(t,"")}},109:function(e,t,n){"use strict";const{Dialog:o,Images:r}=DOM,i=n(110),a=n(8),c=n(111);e.exports=e=>t=>{const{operation:n,callback:s,noContinue:l,from:u,to:f}=e;let p,m;const d=a(e=>{let{emitter:t,operation:n}=e;t.abort();const r=n+" aborted";m=!0,o.alert(r,{cancel:!1})}),g=t.removeListener.bind(t),h=t.on.bind(t),y=c(n,u,f),O=o.progress(y);O.catch(d({emitter:t,operation:n}));const v={progress:e=>{p=100===e,O.setProgress(e)},end:()=>{r.hide(),i(g,v),O.remove(),(m||p)&&s()},error:async e=>{if(m=e,l)return v.end(e),o.alert(e),void O.remove();const[n]=await o.confirm(e+"\n Continue?");if(!p&&!n)return t.continue();t.abort(),O.remove()}};i(h,v)}},111:function(e,t,n){"use strict";e.exports=(e,t,n)=>n?`${e} ${t} -> ${n}`:`${e} ${t}`},112:function(e,t,n){"use strict";const o=n(0),r=o((e,t)=>!e.includes(t)),i=o((e,t)=>e.filter(r(t)));e.exports=(e,t,n)=>{const o=t.indexOf(e),r=i(t,n),{length:a}=r;return r[o]?r[o]:r[a-1]}}});
|
|
1
|
+
!function(e){function t(t){for(var o,a,c=t[0],s=t[1],l=t[2],f=0,p=[];f<c.length;f++)a=c[f],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&p.push(r[a][0]),r[a]=0;for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e[o]=s[o]);for(u&&u(t);p.length;)p.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],o=!0,c=1;c<n.length;c++){var s=n[c];0!==r[s]&&(o=!1)}o&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},r={13:0},i=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/dist/";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;i.push([107,0]),n()}({107:function(e,t,n){"use strict";const o=n(0),r=n(8),{promisify:i}=n(15),a=n(5),c=n(4),s=n(3),{encode:l}=n(17),u=n(108),f=n(109),p=n(112);CloudCmd.Operation=t;const{config:m}=CloudCmd,{Dialog:d,Images:g}=DOM,h=r((function(e,t){const n=r(t),o=r(d.alert);e.on("accept",n(e)),e.on("reject",o("Wrong credentials!")),e.emit("auth",m("username"),m("password"))})),y={};let O,v,C,b,M,D,x;const w=DOM.CurrentInfo,k=g.show.load.bind(null,"top"),P=o((async function(e,t){let n,o,r,i,a,c="",s="",u=[];t?(c=t.from,s=t.to,u=t.names,r=w.panel):(c=w.dirPath,s=DOM.getNotCurrentDirPath(),n=DOM.getSelectedFiles(),u=DOM.getFilenames(n),t={},i=!0,r=w.panelPassive);u.length||u.push(DOM.getCurrentName());const[f]=u,p=DOM.getCurrentByName(f,r);if(!t&&j())return;const{type:g}=e,h="copy"===g,y=h?"confirmCopy":"confirmMove",O=h?"Copy":"Rename/Move",b=h?v:C;if(i&&m(y)){const[e,t]=await async function(e,t,n){const o=n.length,[r]=n;e+=" ",n.length>1?e+=o+" file(s)":e+='"'+r+'"';return e+=" to",await d.prompt(e,t)}(O,s,u.map(l));return void(e||M(t))}function M(e){if(a=c!==e&&e,a&&!i||!p)return r();const n=`"${f}" already exist. Overwrite?`;function r(){k(),o={from:c,to:e,names:u},b(o,async()=>{await DOM.Storage.remove(c);const{panel:e,panelPassive:n}=w;w.isOnePanel||CloudCmd.refresh({panel:n,noCurrent:!0}),CloudCmd.refresh({panel:e},()=>{const e=f||t.names[0];DOM.setCurrentByName(e)})})}d.confirm(n,{cancel:!1}).then(r)}M(s)})),j=()=>{const{length:e}=DOM.getActiveFiles(),t=Boolean(!e);return t?d.alert.noFiles():t};e.exports.init=i(e=>{k(),a.series([DOM.loadSocket,async e=>{if(m("dropbox"))return e();const{prefix:t,prefixSocket:n}=CloudCmd;await async function(){const{prefix:e}=CloudCmd,t=e+"/fileop/fileop.js",[n]=await s(c.js,t);n&&d.alert(n.message);O=!0}(),await async function(e,t,n){t+="/fileop";const o=await fileop({prefix:e,socketPrefix:t});o.on("connect",h(o,F(n)))}(t,n,e)},e=>{O=!0,g.hide(),e()}],e)});const F=o((e,t)=>{!function(e){x=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Tar",callback:n,noContinue:!0,from:o,to:r});e.tar(o,r,i).then(a)},D=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Zip",callback:n,noContinue:!0,from:o,to:r});e.zip(o,r,i).then(a)},b=(t,n,o)=>{t=t.replace(/\?.*/,"");const r=f({operation:"Delete",callback:o,from:t});e.remove(t,n).then(r)},v=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Copy",callback:n,from:o,to:r,names:i});e.copy(o,r,i).then(a)},C=(t,n)=>{let{from:o,to:r,names:i}=t;const a=f({operation:"Move",callback:n,from:o,to:r});e.move(o,r,i).then(a)},M=(t,n)=>{let{from:o,to:r}=t;const i=f({operation:"Extract",callback:n,noContinue:!0,from:o,to:r});e.extract(o,r).then(i)}}(t),e()});function S(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DOM.getActiveFiles();const t="?files",n=w.dirPath;if(j())return;k();const o=DOM.getFilenames(e),r=DOM.CurrentInfo.files.map(DOM.getCurrentName),i=DOM.getCurrentName(),a=p(i,r,o);b(n+t,o,async()=>{await CloudCmd.refresh();const e=w.files.map(DOM.getCurrentName).includes(i)?i:a;DOM.setCurrentByName(e)})}function N(e,t){let n,o,r=w.name;const{path:i,dirPath:a}=w,c=DOM.getActiveFiles(),s=DOM.getFilenames(c);if(function(e,t){if(!t)throw Error(e+" could not be empty!")}("operation",e),!s.length)return d.alert.noFiles();switch(e){case"extract":n=M,o={from:i,to:a},r=u(r);break;case"pack":n=function(e){return"zip"===e?D:x}(t),s.length>1&&(r=w.dir),r+=DOM.getPackerExt(t),o={from:a,to:a+r,names:s}}k(),n(o,e=>{!e&&CloudCmd.refresh({currentName:r})})}e.exports.hide=()=>{CloudCmd.View.hide()},e.exports.show=(e,t)=>{if(O)return"copy"===e?y.copy(t):"move"===e?y.move(t):"delete"===e?y.delete():"delete:silent"===e?y.deleteSilent():"pack"===e?y.pack():"extract"===e?y.extract():void 0},y.copy=P({type:"copy"}),y.move=P({type:"move"}),y.delete=async function(){if(j())return;const e="Do you really want to delete the ",t=DOM.getActiveFiles(),n=DOM.getFilenames(t),o=n.length;let r;if(o){let t="";for(let e=0;e<5&&e<o;e++)t+="\n"+n[e];o>=5&&(t+="\n..."),r=e+"selected "+o+" files/directories?\n"+l(t)}else{const t=DOM.getCurrentFile(),n=DOM.isCurrentIsDir(t),o=(e=>e?"directory":"file")(n)+" ",i=DOM.getCurrentName(t);r=e+"selected "+o+i+"?"}const[i]=await d.confirm(r);if(i)return;S(t)},y.deleteSilent=S,y.pack=()=>{N("pack","zip"===m("packer")?"zip":"tar")},y.extract=()=>{N("extract")}},108:function(e,t,n){"use strict";const{getExt:o}=n(9);e.exports=e=>{const t=function(e){return/\.tar\.gz$/.test(e)?".tar.gz":/\.tar\.bz2$/.test(e)?".tar.bz2":o(e)}(e);return e.replace(t,"")}},109:function(e,t,n){"use strict";const{Dialog:o,Images:r}=DOM,i=n(110),a=n(8),c=n(111);e.exports=e=>t=>{const{operation:n,callback:s,noContinue:l,from:u,to:f}=e;let p,m;const d=a(e=>{let{emitter:t,operation:n}=e;t.abort();const r=n+" aborted";m=!0,o.alert(r,{cancel:!1})}),g=t.removeListener.bind(t),h=t.on.bind(t),y=c(n,u,f),O=o.progress(y);O.catch(d({emitter:t,operation:n}));const v={progress:e=>{p=100===e,O.setProgress(e)},end:()=>{r.hide(),i(g,v),O.remove(),(m||p)&&s()},error:async e=>{if(m=e,l)return v.end(e),o.alert(e),void O.remove();const[n]=await o.confirm(e+"\n Continue?");if(!p&&!n)return t.continue();t.abort(),O.remove()}};i(h,v)}},111:function(e,t,n){"use strict";e.exports=(e,t,n)=>n?`${e} ${t} -> ${n}`:`${e} ${t}`},112:function(e,t,n){"use strict";const o=n(0),r=o((e,t)=>!e.includes(t)),i=o((e,t)=>e.filter(r(t)));e.exports=(e,t,n)=>{const o=t.indexOf(e),r=i(t,n),{length:a}=r;return r[o]?r[o]:r[a-1]}}});
|
|
2
2
|
//# sourceMappingURL=operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file://cloudcmd/modules/operation.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","13","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","107","currify","wraptile","promisify","exec","load","tryToCatch","encode","removeExtension","setListeners","getNextCurrentName","CloudCmd","config","Dialog","Images","DOM","authCheck","spawn","ok","accept","alertDialog","alert","on","emit","Operation","Loaded","copyFn","moveFn","deleteFn","extractFn","packZipFn","packTarFn","Info","CurrentInfo","showLoad","show","processFiles","async","options","selFiles","files","panel","shouldAsk","from","to","names","dirPath","getNotCurrentDirPath","getSelectedFiles","getFilenames","panelPassive","getCurrentName","sameName","getCurrentByName","noFilesCheck","type","isCopy","option","title","operation","cancel","newTo","msg","prompt","map","ask","go","str","Storage","remove","isOnePanel","refresh","noCurrent","currentName","setCurrentByName","confirm","then","getActiveFiles","is","Boolean","noFiles","init","callback","series","loadSocket","prefix","prefixSocket","file","error","js","message","loadAll","socketPrefix","fn","operator","fileop","onConnect","initOperations","hide","_ref","listen","noContinue","tar","_ref2","zip","replace","_ref3","copy","_ref4","move","_ref5","extract","setOperations","deleteSilent","arguments","undefined","query","path","removedNames","nextCurrentName","includes","twopack","op","fileFrom","activeFiles","Error","checkEmpty","getPacker","dir","getPackerExt","View","delete","pack","msgAsk","current","getCurrentFile","isDir","isCurrentIsDir","getType","108","getExt","ext","test","getExtension","109","forEachKey","format","emitter","done","lastError","onAbort","abort","removeListener","progress","catch","listeners","setProgress","end","continue","111","112","not","array","notOneOf","a","b","filter","indexOf","nextNames"],"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,EAA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HAsD,EAAUE,IAAIrE,GACd3E,EAAOQ,MAAMmE,QACbiE,EAASpF,SAIX,MAAOT,SAAgB/C,EAAO8D,QAAQa,EAAQ,gBAC9C,IAAK4D,IAASxF,EAAQ,OAAOuF,EAAQW,WACrCX,EAAQI,QACRE,EAASpF,WAGb4E,EAAW3H,EAAIqI,KAKXI,IACA,SAAU7L,EAAQD,EAASJ,GAEjC,aAGAK,EAAOD,QAAU,CAAC0F,EAAWhB,EAAMC,IAC5BA,EACE,GAAGe,KAAahB,QAAWC,IADlB,GAAGe,KAAahB,KAM5BqH,IACA,SAAU9L,EAAQD,EAASJ,GAEjC,aAGA,MAAMoC,EAAUpC,EAAoB,GAE9BoM,EAAMhK,EAAQ,CAACiK,EAAOlL,KAAWkL,EAAM1C,SAASxI,IAChDmL,EAAWlK,EAAQ,CAACmK,EAAGC,IAAMD,EAAEE,OAAOL,EAAII,KAEhDnM,EAAOD,QAAU,CAACwG,EAAa5B,EAAOyE,KACpC,MAAM7K,EAAIoG,EAAM0H,QAAQ9F,GAClB+F,EAAYL,EAAStH,EAAOyE,IAC5B3K,OACJA,GACE6N,EACJ,OAAIA,EAAU/N,GAAW+N,EAAU/N,GAC5B+N,EAAU7N,EAAS","file":"./modules/operation.js","sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["file://cloudcmd/modules/operation.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","13","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","107","currify","wraptile","promisify","exec","load","tryToCatch","encode","removeExtension","setListeners","getNextCurrentName","CloudCmd","config","Dialog","Images","DOM","authCheck","spawn","ok","accept","alertDialog","alert","on","emit","Operation","Loaded","copyFn","moveFn","deleteFn","extractFn","packZipFn","packTarFn","Info","CurrentInfo","showLoad","show","processFiles","async","options","selFiles","files","panel","shouldAsk","from","to","names","dirPath","getNotCurrentDirPath","getSelectedFiles","getFilenames","panelPassive","getCurrentName","sameName","getCurrentByName","noFilesCheck","type","isCopy","option","title","operation","cancel","newTo","msg","prompt","map","ask","go","str","Storage","remove","isOnePanel","refresh","noCurrent","currentName","setCurrentByName","confirm","then","getActiveFiles","is","Boolean","noFiles","init","callback","series","loadSocket","prefix","prefixSocket","file","error","js","message","loadAll","socketPrefix","fn","operator","fileop","onConnect","initOperations","hide","_ref","listen","noContinue","tar","_ref2","zip","replace","_ref3","copy","_ref4","move","_ref5","extract","setOperations","deleteSilent","arguments","undefined","query","path","removedNames","nextCurrentName","includes","twopack","op","fileFrom","activeFiles","Error","checkEmpty","getPacker","dir","getPackerExt","View","delete","pack","msgAsk","current","getCurrentFile","isDir","isCurrentIsDir","getType","108","getExt","ext","test","getExtension","109","forEachKey","format","emitter","done","lastError","onAbort","abort","removeListener","progress","catch","listeners","setProgress","end","continue","111","112","not","array","notOneOf","a","b","filter","indexOf","nextNames"],"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,EAA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,EAAiB,MAAVpK,EACPyK,EAASG,YAAY5K,IAEvB6K,IAAK,KACH/I,EAAOoF,OACP+C,EAAWO,EAAgBG,GAC3BF,EAASpF,UACLgF,GAAaD,IAAMlE,KAEzBM,MAAOnD,UAGL,GAFAgH,EAAY7D,EAERa,EAIF,OAHAsD,EAAUE,IAAIrE,GACd3E,EAAOQ,MAAMmE,QACbiE,EAASpF,SAIX,MAAOT,SAAgB/C,EAAO8D,QAAQa,EAAQ,gBAC9C,IAAK4D,IAASxF,EAAQ,OAAOuF,EAAQW,WACrCX,EAAQI,QACRE,EAASpF,WAGb4E,EAAW3H,EAAIqI,KAKXI,IACA,SAAU7L,EAAQD,EAASJ,GAEjC,aAGAK,EAAOD,QAAU,CAAC0F,EAAWhB,EAAMC,IAC5BA,EACE,GAAGe,KAAahB,QAAWC,IADlB,GAAGe,KAAahB,KAM5BqH,IACA,SAAU9L,EAAQD,EAASJ,GAEjC,aAGA,MAAMoC,EAAUpC,EAAoB,GAE9BoM,EAAMhK,EAAQ,CAACiK,EAAOlL,KAAWkL,EAAM1C,SAASxI,IAChDmL,EAAWlK,EAAQ,CAACmK,EAAGC,IAAMD,EAAEE,OAAOL,EAAII,KAEhDnM,EAAOD,QAAU,CAACwG,EAAa5B,EAAOyE,KACpC,MAAM7K,EAAIoG,EAAM0H,QAAQ9F,GAClB+F,EAAYL,EAAStH,EAAOyE,IAC5B3K,OACJA,GACE6N,EACJ,OAAIA,EAAU/N,GAAW+N,EAAU/N,GAC5B+N,EAAU7N,EAAS","file":"./modules/operation.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);/\/$/.test(r)||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(/^\/api/.test(o)||/^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);/\/$/.test(r)||/\^\/fs/.test(o)||"GET"===n.method&&(t=>"basic"===t.type)(n)&&(/^\/api/.test(o)||/^socket.io/.test(o)||e.respondWith(t(e)))}),u=t=>new URL(t).pathname,a="cloudcmd: Thu Dec 23 2021 12:10:40 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
|
|
@@ -44,7 +44,7 @@ eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_mo
|
|
|
44
44
|
/***/ (function(module, exports, __webpack_require__) {
|
|
45
45
|
|
|
46
46
|
"use strict";
|
|
47
|
-
eval("\n/* global CloudCmd */\n\nconst philip = __webpack_require__(/*! philip */ \"./node_modules/philip/legacy/philip.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst DOM = __webpack_require__(/*! . */ \"./client/dom/index.js\");\n\nconst Dialog = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\n\nconst {\n getCurrentDirPath: getPathWhenRootEmpty\n} = DOM;\n\nmodule.exports = items => {\n if (items.length) Images.show('top');\n const entries = Array.from(items).map(item =>
|
|
47
|
+
eval("\n/* global CloudCmd */\n\nconst philip = __webpack_require__(/*! philip */ \"./node_modules/philip/legacy/philip.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst DOM = __webpack_require__(/*! . */ \"./client/dom/index.js\");\n\nconst Dialog = __webpack_require__(/*! ./dialog */ \"./client/dom/dialog.js\");\n\nconst {\n getCurrentDirPath: getPathWhenRootEmpty\n} = DOM;\n\nmodule.exports = items => {\n if (items.length) Images.show('top');\n const entries = Array.from(items).map(item => item.webkitGetAsEntry());\n const dirPath = getPathWhenRootEmpty();\n const path = dirPath.replace(/\\/$/, '');\n const progress = Dialog.progress('Uploading...');\n progress.catch(() => {\n Dialog.alert('Upload aborted');\n uploader.abort();\n });\n const uploader = philip(entries, (type, name, data, i, n, callback) => {\n const {\n prefixURL\n } = CloudCmd;\n const full = prefixURL + FS + path + name;\n let upload;\n\n switch (type) {\n case 'file':\n upload = uploadFile(full, data);\n break;\n\n case 'directory':\n upload = uploadDir(full);\n break;\n }\n\n upload.on('end', callback);\n upload.on('progress', count => {\n const current = percent(i, n);\n const next = percent(i + 1, n);\n const max = next - current;\n const value = current + percent(count, 100, max);\n progress.setProgress(value);\n });\n });\n uploader.on('error', error => {\n Dialog.alert(error);\n uploader.abort();\n });\n uploader.on('end', CloudCmd.refresh);\n};\n\nfunction percent(i, n) {\n let per = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;\n return Math.round(i * per / n);\n}\n\nfunction uploadFile(url, data) {\n return DOM.load.put(url, data);\n}\n\nfunction uploadDir(url) {\n return DOM.load.put(url + '?dir');\n}\n\n//# sourceURL=file://cloudcmd/client/dom/directory.js");
|
|
48
48
|
|
|
49
49
|
/***/ }),
|
|
50
50
|
|
|
@@ -164,7 +164,7 @@ eval("\n/* global CloudCmd */\n\nconst rendy = __webpack_require__(/*! rendy */
|
|
|
164
164
|
/***/ (function(module, exports, __webpack_require__) {
|
|
165
165
|
|
|
166
166
|
"use strict";
|
|
167
|
-
eval("\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\n\nconst jonny = __webpack_require__(/*! jonny */ \"./node_modules/jonny/lib/jonny.js\");\n\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nmodule.exports.getIdBySrc = getIdBySrc;\n/**\n * Function gets id by src\n * @param src\n *\n * Example: http://domain.com/1.js -> 1_js\n */\n\nfunction getIdBySrc(src) {\n const isStr = itype.string(src);\n if (!isStr) return;\n if (src.includes(':')) src += '-join';\n const num = src.lastIndexOf('/') + 1;\n const sub = src.substr(src, num);\n const id = src.replace(sub, '').replace(/\\./g, '-');\n return id;\n}\n/**\n * load file countent via ajax\n *\n * @param params\n */\n\n\nmodule.exports.ajax = params => {\n const p = params;\n const isObject = itype.object(p.data);\n const isArray = itype.array(p.data);\n const isArrayBuf = itype(p.data) === 'arraybuffer';\n const type = p.type || p.method || 'GET';\n const {\n headers = {}\n } = p;\n const xhr = new XMLHttpRequest();\n xhr.open(type, p.url, true);\n\n for (const name of Object.keys(headers)) {\n const value = headers[name];\n xhr.setRequestHeader(name, value);\n }\n\n if (p.responseType) xhr.responseType = p.responseType;\n let data;\n if (!isArrayBuf && isObject || isArray) data = jonny.stringify(p.data);else data = p.data;\n\n xhr.onreadystatechange = event => {\n const xhr = event.target;\n const OK = 200;\n if (xhr.readyState !== xhr.DONE) return;\n Images.clearProgress();\n const TYPE_JSON = 'application/json';\n const type = xhr.getResponseHeader('content-type');\n if (xhr.status !== OK) return exec(p.error, xhr);\n const notText = p.dataType !== 'text';\n const isContain = type.includes(TYPE_JSON);\n let data = xhr.response;\n if (type && isContain && notText) data = jonny.parse(xhr.response) || xhr.response;\n exec(p.success, data, xhr.statusText, xhr);\n };\n\n xhr.send(data);\n};\n\nmodule.exports.put = (url, body) => {\n const emitter = Emitify();\n const xhr = new XMLHttpRequest();\n url = encodeURI(url).replace(/#/g, '%23');\n xhr.open('put', url, true);\n\n xhr.upload.onprogress = event => {\n if (!event.lengthComputable) return;\n const percent = event.loaded / event.total * 100;\n const count = Math.round(percent);\n emitter.emit('progress', count);\n };\n\n xhr.onreadystatechange = () => {\n const over = xhr.readyState === xhr.DONE;\n const OK = 200;\n if (!over) return;\n if (xhr.status === OK) return emitter.emit('end');\n const error = Error(xhr.responseText);\n emitter.emit('error', error);\n };\n\n xhr.send(body);\n return emitter;\n};\n\n//# sourceURL=file://cloudcmd/client/dom/load.js");
|
|
167
|
+
eval("\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\n\nconst jonny = __webpack_require__(/*! jonny */ \"./node_modules/jonny/lib/jonny.js\");\n\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst Images = __webpack_require__(/*! ./images */ \"./client/dom/images.js\");\n\nmodule.exports.getIdBySrc = getIdBySrc;\n/**\n * Function gets id by src\n * @param src\n *\n * Example: http://domain.com/1.js -> 1_js\n */\n\nfunction getIdBySrc(src) {\n const isStr = itype.string(src);\n if (!isStr) return;\n if (src.includes(':')) src += '-join';\n const num = src.lastIndexOf('/') + 1;\n const sub = src.substr(src, num);\n const id = src.replace(sub, '').replace(/\\./g, '-');\n return id;\n}\n/**\n * load file countent via ajax\n *\n * @param params\n */\n\n\nmodule.exports.ajax = params => {\n const p = params;\n const isObject = itype.object(p.data);\n const isArray = itype.array(p.data);\n const isArrayBuf = itype(p.data) === 'arraybuffer';\n const type = p.type || p.method || 'GET';\n const {\n headers = {}\n } = p;\n const xhr = new XMLHttpRequest();\n xhr.open(type, p.url, true);\n\n for (const name of Object.keys(headers)) {\n const value = headers[name];\n xhr.setRequestHeader(name, value);\n }\n\n if (p.responseType) xhr.responseType = p.responseType;\n let data;\n if (!isArrayBuf && isObject || isArray) data = jonny.stringify(p.data);else data = p.data;\n\n xhr.onreadystatechange = event => {\n const xhr = event.target;\n const OK = 200;\n if (xhr.readyState !== xhr.DONE) return;\n Images.clearProgress();\n const TYPE_JSON = 'application/json';\n const type = xhr.getResponseHeader('content-type');\n if (xhr.status !== OK) return exec(p.error, xhr);\n const notText = p.dataType !== 'text';\n const isContain = type.includes(TYPE_JSON);\n let data = xhr.response;\n if (type && isContain && notText) data = jonny.parse(xhr.response) || xhr.response;\n exec(p.success, data, xhr.statusText, xhr);\n };\n\n xhr.send(data);\n};\n\nmodule.exports.put = (url, body) => {\n const emitter = Emitify();\n const xhr = new XMLHttpRequest();\n url = encodeURI(url).replace(/#/g, '%23');\n xhr.open('put', url, true);\n\n xhr.upload.onprogress = event => {\n if (!event.lengthComputable) return;\n const percent = event.loaded / event.total * 100;\n const count = Math.round(percent);\n emitter.emit('progress', count);\n };\n\n xhr.onreadystatechange = () => {\n const over = xhr.readyState === xhr.DONE;\n const OK = 200;\n if (!over) return;\n\n if (xhr.status === OK) {\n emitter.emit('progress', 100);\n return emitter.emit('end');\n }\n\n const error = Error(xhr.responseText);\n emitter.emit('error', error);\n };\n\n xhr.send(body);\n return emitter;\n};\n\n//# sourceURL=file://cloudcmd/client/dom/load.js");
|
|
168
168
|
|
|
169
169
|
/***/ }),
|
|
170
170
|
|
package/dist-dev/cloudcmd.css
CHANGED
|
@@ -82,8 +82,8 @@ body {
|
|
|
82
82
|
margin: 0;
|
|
83
83
|
}
|
|
84
84
|
:root {
|
|
85
|
-
--color:
|
|
86
|
-
--color-transparent:
|
|
85
|
+
--color: rgb(49 123 249);
|
|
86
|
+
--color-transparent: rgb(49 123 249 / 40%);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
html {
|
|
@@ -112,7 +112,7 @@ body, pre, code {
|
|
|
112
112
|
|
|
113
113
|
.fm, .keyspanel {
|
|
114
114
|
cursor : default;
|
|
115
|
-
-webkit-tap-highlight-color:
|
|
115
|
+
-webkit-tap-highlight-color: rgb(0 0 0 / 0%);
|
|
116
116
|
-webkit-user-select : none;
|
|
117
117
|
-moz-user-select : none;
|
|
118
118
|
-ms-user-select : none;
|
|
@@ -159,7 +159,7 @@ body, pre, code {
|
|
|
159
159
|
.error::before {
|
|
160
160
|
font-family : 'Fontello';
|
|
161
161
|
font-size : 14px;
|
|
162
|
-
color : rgb(222
|
|
162
|
+
color : rgb(222 41 41);
|
|
163
163
|
cursor : default;
|
|
164
164
|
content : '\e800';
|
|
165
165
|
}
|
|
@@ -255,7 +255,7 @@ a:hover, a:active {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
.selected-file, .selected-file .name > a {
|
|
258
|
-
color: rgb(254
|
|
258
|
+
color: rgb(254 159 224);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
.panel-right {
|
|
@@ -273,7 +273,7 @@ a:hover, a:active {
|
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
.selected-panel {
|
|
276
|
-
border-color:
|
|
276
|
+
border-color: rgb(254 159 224 / 40%);
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
.keyspanel {
|
|
@@ -620,7 +620,7 @@ a:hover, a:active {
|
|
|
620
620
|
}
|
|
621
621
|
|
|
622
622
|
.file::before, .file-link::before {
|
|
623
|
-
color:
|
|
623
|
+
color: rgb(26 224 124 / 56%);
|
|
624
624
|
content: '\e80d';
|
|
625
625
|
}
|
|
626
626
|
|
|
@@ -630,7 +630,7 @@ a:hover, a:active {
|
|
|
630
630
|
|
|
631
631
|
/* меняем иконки на шрифтовые */
|
|
632
632
|
.mini-icon {
|
|
633
|
-
color :
|
|
633
|
+
color : rgb(246 224 124 / 56%);
|
|
634
634
|
font : 16px 'Fontello';
|
|
635
635
|
background-image: none;
|
|
636
636
|
padding : 1%;
|
|
@@ -658,7 +658,7 @@ a:hover, a:active {
|
|
|
658
658
|
}
|
|
659
659
|
|
|
660
660
|
.archive::before, .archive-link {
|
|
661
|
-
color:
|
|
661
|
+
color: rgb(26 224 124 / 56%);
|
|
662
662
|
content: '\e81d';
|
|
663
663
|
}
|
|
664
664
|
|
package/dist-dev/cloudcmd.js
CHANGED
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
/***/ (function(module, exports, __webpack_require__) {
|
|
164
164
|
|
|
165
165
|
"use strict";
|
|
166
|
-
eval("\n/* global DOM */\n\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst {\n addSlashToEnd\n} = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\n\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isDev = \"development\" === 'development';\n\nconst Images = __webpack_require__(/*! ./dom/images */ \"./client/dom/images.js\");\n\nconst {\n unregisterSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\n\nconst getJsonFromFileTable = __webpack_require__(/*! ./get-json-from-file-table */ \"./client/get-json-from-file-table.js\");\n\nconst Key = __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n\nconst noJS = a => a.replace(/.js$/, '');\n\nconst {\n apiURL,\n formatMsg,\n buildFromJSON\n} = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst loadModule = __webpack_require__(/*! ./load-module */ \"./client/load-module.js\");\n\ninherits(CloudCmdProto, Emitify);\nmodule.exports = new CloudCmdProto(DOM);\nload.addErrorListener((e, src) => {\n const msg = `file ${src} could not be loaded`;\n Images.show.error(msg);\n});\n\nfunction CloudCmdProto(DOM) {\n let Listeners;\n\n const log = function () {\n if (!isDev) return;\n console.log(...arguments);\n };\n\n Emitify.call(this);\n const CloudCmd = this;\n const Info = DOM.CurrentInfo;\n const {\n Storage,\n Files\n } = DOM;\n this.log = log;\n this.prefix = '';\n this.prefixSocket = '';\n this.prefixURL = '';\n this.DIRCLIENT = '/dist/';\n this.DIRCLIENT_MODULES = this.DIRCLIENT + 'modules/';\n this.MIN_ONE_PANEL_WIDTH = 1155;\n this.HOST = location.origin || location.protocol + '//' + location.host;\n const TITLE = 'Cloud Commander';\n this.TITLE = TITLE;\n this.sort = {\n left: 'name',\n right: 'name'\n };\n this.order = {\n left: 'asc',\n right: 'asc'\n };\n /**\n * Функция привязываеться ко всем ссылкам и\n * загружает содержимое каталогов\n *\n * @param params - {\n * paramLink - ссылка\n * needRefresh - необходимость обязательной загрузки данных с сервера\n * panel\n * }\n * @param callback\n */\n\n this.loadDir = async params => {\n const p = params;\n const refresh = p.isRefresh;\n const {\n panel,\n history,\n noCurrent,\n currentName\n } = p;\n let panelChanged;\n\n if (!noCurrent && panel && panel !== Info.panel) {\n DOM.changePanel();\n panelChanged = true;\n }\n\n let imgPosition;\n if (panelChanged || refresh || !history) imgPosition = 'top';\n Images.show.load(imgPosition, panel);\n const path = addSlashToEnd(p.path);\n /* загружаем содержимое каталога */\n\n await ajaxLoad(path, {\n refresh,\n history,\n noCurrent,\n currentName\n }, panel);\n };\n /**\n * Конструктор CloudClient, который\n * выполняет весь функционал по\n * инициализации\n */\n\n\n this.init = async (prefix, config) => {\n CloudCmd.prefix = prefix;\n CloudCmd.prefixURL = `${prefix}${apiURL}`;\n CloudCmd.prefixSocket = config.prefixSocket;\n\n CloudCmd.config = key => config[key];\n\n CloudCmd.config.if = currify((key, fn, a) => config[key] && fn(a));\n\n CloudCmd._config = (key, value) => {\n /*\n * should be called from config.js only\n * after successful update on server\n */\n if (key === 'password') return;\n config[key] = value;\n };\n\n if (config.oneFilePanel) CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;\n if (!document.body.scrollIntoViewIfNeeded) await load.js(prefix + CloudCmd.DIRCLIENT_MODULES + 'polyfill.js');\n await initModules();\n await baseInit();\n await loadStyle();\n CloudCmd.route(location.hash);\n };\n\n async function loadStyle() {\n const {\n prefix\n } = CloudCmd;\n const name = prefix + '/dist/cloudcmd.common.css';\n await load.css(name);\n }\n\n this.route = path => {\n const query = path.split('/');\n if (!path) return;\n const [kebabModule] = query;\n const module = noJS(pascalCase(kebabModule.slice(1)));\n const file = query[1];\n const current = DOM.getCurrentByName(file);\n\n if (file && !current) {\n const msg = formatMsg('set current file', file, 'error');\n CloudCmd.log(msg);\n return;\n }\n\n DOM.setCurrentFile(current);\n CloudCmd.execFromModule(module, 'show');\n };\n\n this.logOut = async () => {\n const url = CloudCmd.prefix + '/logout';\n\n const error = () => document.location.reload();\n\n const {\n prefix\n } = CloudCmd;\n await DOM.Storage.clear();\n unregisterSW(prefix);\n DOM.load.ajax({\n url,\n error\n });\n };\n\n const initModules = async () => {\n CloudCmd.Key = Key;\n CloudCmd.Key.bind();\n const [, modules] = await tryToCatch(Files.get, 'modules');\n const showLoad = Images.show.load;\n const doBefore = {\n edit: showLoad,\n menu: showLoad\n };\n\n const load = (name, path, dobefore) => {\n loadModule({\n name,\n path,\n dobefore\n });\n };\n\n if (!modules) return;\n\n for (const module of modules.local) {\n load(null, module, doBefore[module]);\n }\n };\n\n async function saveCurrentName(currentName) {\n await Storage.set('current-name', currentName);\n }\n\n async function baseInit() {\n const files = DOM.getFiles();\n CloudCmd.on('current-file', DOM.updateCurrentInfo);\n CloudCmd.on('current-name', saveCurrentName);\n const name = await Storage.get('current-name');\n const currentFile = name && DOM.getCurrentByName(name) || files[0];\n /* выделяем строку с первым файлом */\n\n if (files) DOM.setCurrentFile(currentFile, {\n // when hash is present\n // it should be handled with this.route\n // overwre otherwise\n history: !location.hash\n });\n const dirPath = DOM.getCurrentDirPath();\n Listeners = CloudCmd.Listeners;\n Listeners.init();\n const panels = getPanels();\n panels.forEach(Listeners.setOnPanel);\n Listeners.initKeysPanel();\n if (!CloudCmd.config('dirStorage')) return;\n const data = await Storage.get(dirPath);\n if (!data) await Storage.setJson(dirPath, getJsonFromFileTable());\n }\n\n function getPanels() {\n const panels = ['left'];\n if (CloudCmd.config('oneFilePanel')) return panels;\n return [...panels, 'right'];\n }\n\n this.execFromModule = async function (moduleName, funcName) {\n await CloudCmd[moduleName]();\n const func = CloudCmd[moduleName][funcName];\n\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n func(...args);\n };\n\n this.refresh = async function () {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n panel = Info.panel,\n currentName\n } = options;\n const path = DOM.getCurrentDirPath(panel);\n const isRefresh = true;\n const history = false;\n const noCurrent = options ? options.noCurrent : false;\n await CloudCmd.loadDir({\n path,\n isRefresh,\n history,\n panel,\n noCurrent,\n currentName\n });\n };\n /**\n * Функция загружает json-данные о Файловой Системе\n * через ajax-запрос.\n * @param path - каталог для чтения\n * @param options\n * { refresh, history } - необходимость обновить данные о каталоге\n * @param panel\n * @param callback\n *\n */\n\n\n async function ajaxLoad(path) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let panel = arguments.length > 2 ? arguments[2] : undefined;\n const {\n RESTful\n } = DOM;\n CloudCmd.log('reading dir: \"' + path + '\";');\n const dirStorage = CloudCmd.config('dirStorage');\n const json = dirStorage && (await Storage.getJson(path));\n const name = options.currentName || Info.name;\n const {\n noCurrent,\n refresh\n } = options;\n if (!refresh && json) return await createFileTable(json, panel, options);\n const position = DOM.getPanelPosition(panel);\n const sort = CloudCmd.sort[position];\n const order = CloudCmd.order[position];\n const query = rendy('?sort={{ sort }}&order={{ order }}', {\n sort,\n order\n });\n const [, newObj] = await RESTful.read(path + query, 'json');\n if (!newObj) return; // that's OK, error handled by RESTful\n\n options.sort = sort;\n options.order = order;\n await createFileTable(newObj, panel, options);\n if (refresh && !noCurrent) DOM.setCurrentByName(name);\n if (!CloudCmd.config('dirStorage')) return;\n Storage.setJson(path, newObj);\n }\n /**\n * Функция строит файловую таблицу\n * @param json - данные о файлах\n * @param panelParam\n * @param history\n * @param callback\n */\n\n\n async function createFileTable(data, panelParam, options) {\n const {\n history,\n noCurrent\n } = options;\n const names = ['file', 'path', 'link', 'pathLink'];\n const [error, [file, path, link, pathLink]] = await tryToCatch(Files.get, names);\n if (error) return DOM.Dialog.alert(error.responseText);\n const panel = panelParam || DOM.getPanel();\n const {\n prefix\n } = CloudCmd;\n const {\n dir,\n name\n } = Info;\n const {\n childNodes\n } = panel;\n let i = childNodes.length;\n\n while (i--) panel.removeChild(panel.lastChild);\n\n panel.innerHTML = buildFromJSON({\n sort: options.sort,\n order: options.order,\n data,\n id: panel.id,\n prefix,\n template: {\n file,\n path,\n pathLink,\n link\n }\n });\n Listeners.setOnPanel(panel);\n\n if (!noCurrent) {\n let current;\n if (name === '..' && dir !== '/') current = DOM.getCurrentByName(dir);\n if (!current) [current] = DOM.getFiles(panel);\n DOM.setCurrentFile(current, {\n history\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n }\n }\n\n this.goToParentDir = async () => {\n const {\n dir,\n dirPath,\n parentDirPath,\n panel\n } = Info;\n if (dirPath === parentDirPath) return;\n const path = parentDirPath;\n await CloudCmd.loadDir({\n path\n });\n const current = DOM.getCurrentByName(dir);\n const [first] = DOM.getFiles(panel);\n DOM.setCurrentFile(current || first, {\n history\n });\n };\n}\n\n//# sourceURL=file://cloudcmd/client/client.js");
|
|
166
|
+
eval("\n/* global DOM */\n\nconst Emitify = __webpack_require__(/*! emitify */ \"./node_modules/emitify/lib/emitify.js\");\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\n\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst {\n addSlashToEnd\n} = __webpack_require__(/*! format-io */ \"./node_modules/format-io/lib/format.js\");\n\nconst pascalCase = __webpack_require__(/*! just-pascal-case */ \"./node_modules/just-pascal-case/index.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isDev = \"development\" === 'development';\n\nconst Images = __webpack_require__(/*! ./dom/images */ \"./client/dom/images.js\");\n\nconst {\n unregisterSW\n} = __webpack_require__(/*! ./sw/register */ \"./client/sw/register.js\");\n\nconst getJsonFromFileTable = __webpack_require__(/*! ./get-json-from-file-table */ \"./client/get-json-from-file-table.js\");\n\nconst Key = __webpack_require__(/*! ./key */ \"./client/key/index.js\");\n\nconst noJS = a => a.replace(/.js$/, '');\n\nconst {\n apiURL,\n formatMsg,\n buildFromJSON\n} = __webpack_require__(/*! ../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst loadModule = __webpack_require__(/*! ./load-module */ \"./client/load-module.js\");\n\ninherits(CloudCmdProto, Emitify);\nmodule.exports = new CloudCmdProto(DOM);\nload.addErrorListener((e, src) => {\n const msg = `file ${src} could not be loaded`;\n Images.show.error(msg);\n});\n\nfunction CloudCmdProto(DOM) {\n let Listeners;\n\n const log = function () {\n if (!isDev) return;\n console.log(...arguments);\n };\n\n Emitify.call(this);\n const CloudCmd = this;\n const Info = DOM.CurrentInfo;\n const {\n Storage,\n Files\n } = DOM;\n this.log = log;\n this.prefix = '';\n this.prefixSocket = '';\n this.prefixURL = '';\n this.DIRCLIENT = '/dist/';\n this.DIRCLIENT_MODULES = this.DIRCLIENT + 'modules/';\n this.MIN_ONE_PANEL_WIDTH = 1155;\n this.HOST = location.origin || location.protocol + '//' + location.host;\n const TITLE = 'Cloud Commander';\n this.TITLE = TITLE;\n this.sort = {\n left: 'name',\n right: 'name'\n };\n this.order = {\n left: 'asc',\n right: 'asc'\n };\n /**\n * Функция привязываеться ко всем ссылкам и\n * загружает содержимое каталогов\n *\n * @param params - {\n * paramLink - ссылка\n * needRefresh - необходимость обязательной загрузки данных с сервера\n * panel\n * }\n * @param callback\n */\n\n this.loadDir = async params => {\n const p = params;\n const refresh = p.isRefresh;\n const {\n panel,\n history = true,\n noCurrent,\n currentName\n } = p;\n let panelChanged;\n\n if (!noCurrent && panel && panel !== Info.panel) {\n DOM.changePanel();\n panelChanged = true;\n }\n\n let imgPosition;\n if (panelChanged || refresh || !history) imgPosition = 'top';\n Images.show.load(imgPosition, panel);\n const path = addSlashToEnd(p.path);\n /* загружаем содержимое каталога */\n\n await ajaxLoad(path, {\n refresh,\n history,\n noCurrent,\n currentName\n }, panel);\n };\n /**\n * Конструктор CloudClient, который\n * выполняет весь функционал по\n * инициализации\n */\n\n\n this.init = async (prefix, config) => {\n CloudCmd.prefix = prefix;\n CloudCmd.prefixURL = `${prefix}${apiURL}`;\n CloudCmd.prefixSocket = config.prefixSocket;\n\n CloudCmd.config = key => config[key];\n\n CloudCmd.config.if = currify((key, fn, a) => config[key] && fn(a));\n\n CloudCmd._config = (key, value) => {\n /*\n * should be called from config.js only\n * after successful update on server\n */\n if (key === 'password') return;\n config[key] = value;\n };\n\n if (config.oneFilePanel) CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;\n if (!document.body.scrollIntoViewIfNeeded) await load.js(prefix + CloudCmd.DIRCLIENT_MODULES + 'polyfill.js');\n await initModules();\n await baseInit();\n await loadStyle();\n CloudCmd.route(location.hash);\n };\n\n async function loadStyle() {\n const {\n prefix\n } = CloudCmd;\n const name = prefix + '/dist/cloudcmd.common.css';\n await load.css(name);\n }\n\n this.route = path => {\n const query = path.split('/');\n if (!path) return;\n const [kebabModule] = query;\n const module = noJS(pascalCase(kebabModule.slice(1)));\n const file = query[1];\n const current = DOM.getCurrentByName(file);\n\n if (file && !current) {\n const msg = formatMsg('set current file', file, 'error');\n CloudCmd.log(msg);\n return;\n }\n\n DOM.setCurrentFile(current);\n CloudCmd.execFromModule(module, 'show');\n };\n\n this.logOut = async () => {\n const url = CloudCmd.prefix + '/logout';\n\n const error = () => document.location.reload();\n\n const {\n prefix\n } = CloudCmd;\n await DOM.Storage.clear();\n unregisterSW(prefix);\n DOM.load.ajax({\n url,\n error\n });\n };\n\n const initModules = async () => {\n CloudCmd.Key = Key;\n CloudCmd.Key.bind();\n const [, modules] = await tryToCatch(Files.get, 'modules');\n const showLoad = Images.show.load;\n const doBefore = {\n edit: showLoad,\n menu: showLoad\n };\n\n const load = (name, path, dobefore) => {\n loadModule({\n name,\n path,\n dobefore\n });\n };\n\n if (!modules) return;\n\n for (const module of modules.local) {\n load(null, module, doBefore[module]);\n }\n };\n\n async function saveCurrentName(currentName) {\n await Storage.set('current-name', currentName);\n }\n\n async function baseInit() {\n const files = DOM.getFiles();\n CloudCmd.on('current-file', DOM.updateCurrentInfo);\n CloudCmd.on('current-name', saveCurrentName);\n const name = await Storage.get('current-name');\n const currentFile = name && DOM.getCurrentByName(name) || files[0];\n /* выделяем строку с первым файлом */\n\n if (files) DOM.setCurrentFile(currentFile, {\n // when hash is present\n // it should be handled with this.route\n // overwre otherwise\n history: !location.hash\n });\n const dirPath = DOM.getCurrentDirPath();\n Listeners = CloudCmd.Listeners;\n Listeners.init();\n const panels = getPanels();\n panels.forEach(Listeners.setOnPanel);\n Listeners.initKeysPanel();\n if (!CloudCmd.config('dirStorage')) return;\n const data = await Storage.get(dirPath);\n if (!data) await Storage.setJson(dirPath, getJsonFromFileTable());\n }\n\n function getPanels() {\n const panels = ['left'];\n if (CloudCmd.config('oneFilePanel')) return panels;\n return [...panels, 'right'];\n }\n\n this.execFromModule = async function (moduleName, funcName) {\n await CloudCmd[moduleName]();\n const func = CloudCmd[moduleName][funcName];\n\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n func(...args);\n };\n\n this.refresh = async function () {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const {\n panel = Info.panel,\n currentName\n } = options;\n const path = DOM.getCurrentDirPath(panel);\n const isRefresh = true;\n const history = false;\n const noCurrent = options ? options.noCurrent : false;\n await CloudCmd.loadDir({\n path,\n isRefresh,\n history,\n panel,\n noCurrent,\n currentName\n });\n };\n /**\n * Функция загружает json-данные о Файловой Системе\n * через ajax-запрос.\n * @param path - каталог для чтения\n * @param options\n * { refresh, history } - необходимость обновить данные о каталоге\n * @param panel\n * @param callback\n *\n */\n\n\n async function ajaxLoad(path) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let panel = arguments.length > 2 ? arguments[2] : undefined;\n const {\n RESTful\n } = DOM;\n CloudCmd.log('reading dir: \"' + path + '\";');\n const dirStorage = CloudCmd.config('dirStorage');\n const json = dirStorage && (await Storage.getJson(path));\n const name = options.currentName || Info.name;\n const {\n noCurrent,\n refresh\n } = options;\n if (!refresh && json) return await createFileTable(json, panel, options);\n const position = DOM.getPanelPosition(panel);\n const sort = CloudCmd.sort[position];\n const order = CloudCmd.order[position];\n const query = rendy('?sort={{ sort }}&order={{ order }}', {\n sort,\n order\n });\n const [, newObj] = await RESTful.read(path + query, 'json');\n if (!newObj) return; // that's OK, error handled by RESTful\n\n options.sort = sort;\n options.order = order;\n await createFileTable(newObj, panel, options);\n if (refresh && !noCurrent) DOM.setCurrentByName(name);\n if (!CloudCmd.config('dirStorage')) return;\n Storage.setJson(path, newObj);\n }\n /**\n * Функция строит файловую таблицу\n * @param json - данные о файлах\n * @param panelParam\n * @param history\n * @param callback\n */\n\n\n async function createFileTable(data, panelParam, options) {\n const {\n history,\n noCurrent\n } = options;\n const names = ['file', 'path', 'link', 'pathLink'];\n const [error, [file, path, link, pathLink]] = await tryToCatch(Files.get, names);\n if (error) return DOM.Dialog.alert(error.responseText);\n const panel = panelParam || DOM.getPanel();\n const {\n prefix\n } = CloudCmd;\n const {\n dir,\n name\n } = Info;\n const {\n childNodes\n } = panel;\n let i = childNodes.length;\n\n while (i--) panel.removeChild(panel.lastChild);\n\n panel.innerHTML = buildFromJSON({\n sort: options.sort,\n order: options.order,\n data,\n id: panel.id,\n prefix,\n template: {\n file,\n path,\n pathLink,\n link\n }\n });\n Listeners.setOnPanel(panel);\n\n if (!noCurrent) {\n let current;\n if (name === '..' && dir !== '/') current = DOM.getCurrentByName(dir);\n if (!current) [current] = DOM.getFiles(panel);\n DOM.setCurrentFile(current, {\n history\n });\n CloudCmd.emit('active-dir', Info.dirPath);\n }\n }\n\n this.goToParentDir = async () => {\n const {\n dir,\n dirPath,\n parentDirPath,\n panel\n } = Info;\n if (dirPath === parentDirPath) return;\n const path = parentDirPath;\n await CloudCmd.loadDir({\n path\n });\n const current = DOM.getCurrentByName(dir);\n const [first] = DOM.getFiles(panel);\n DOM.setCurrentFile(current || first, {\n history\n });\n };\n}\n\n//# sourceURL=file://cloudcmd/client/client.js");
|
|
167
167
|
|
|
168
168
|
/***/ }),
|
|
169
169
|
|
|
@@ -211,7 +211,7 @@ eval("\n\nmodule.exports.createBinder = () => {\n let binded = false;\n return
|
|
|
211
211
|
/***/ (function(module, exports, __webpack_require__) {
|
|
212
212
|
|
|
213
213
|
"use strict";
|
|
214
|
-
eval("\n/* global CloudCmd, DOM */\n\nconst Info = DOM.CurrentInfo;\n\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\n\nconst Buffer = __webpack_require__(/*! ../dom/buffer */ \"./client/dom/buffer.js\");\n\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\n\nconst KEY = __webpack_require__(/*! ./key */ \"./client/key/key.js\");\n\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/index.js\");\n\nconst setCurrentByChar = __webpack_require__(/*! ./set-current-by-char */ \"./client/key/set-current-by-char.js\");\n\nconst {\n createBinder\n} = __webpack_require__(/*! ./binder */ \"./client/key/binder.js\");\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n\nconst Chars = fullstore();\n\nconst toggleVim = keyCode => {\n const {\n _config,\n config\n } = CloudCmd;\n\n if (keyCode === KEY.ESC) {\n _config('vim', !config('vim'));\n }\n};\n\nChars([]);\nconst {\n assign\n} = Object;\nconst binder = createBinder();\nmodule.exports = assign(binder, KEY);\n\nmodule.exports.bind = () => {\n Events.addKey(listener, true);\n binder.setBind();\n};\n\nmodule.exports._listener = listener;\n\nfunction getChar(event) {\n /*\n * event.keyIdentifier deprecated in chrome v51\n * but event.key is absent in chrome <= v51\n */\n const {\n key,\n shift,\n keyCode,\n keyIdentifier\n } = event;\n const char = key || fromCharCode(keyIdentifier);\n const symbol = getSymbol(shift, keyCode);\n return [symbol, char];\n}\n\nasync function listener(event) {\n const {\n keyCode\n } = event; // strange chrome bug calles listener twice\n // in second time event misses a lot fields\n\n if (typeof event.altKey === 'undefined') return;\n const alt = event.altKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const isBetween = keyCode >= KEY.ZERO && keyCode <= KEY.Z;\n const isNumpad = /Numpad/.test(event.code);\n const [symbol, char] = getChar(event);\n if (!binder.isBind()) return;\n toggleVim(keyCode);\n const isVim = CloudCmd.config('vim');\n if (!isVim && !isNumpad && !alt && !ctrl && !meta && (isBetween || symbol)) return setCurrentByChar(char, Chars);\n Chars([]);\n await switchKey(event);\n if (keyCode >= KEY.F1 && keyCode <= KEY.F10) return;\n if (isVim) vim(char, event);\n}\n\nfunction getSymbol(shift, keyCode) {\n switch (keyCode) {\n case KEY.DOT:\n return '.';\n\n case KEY.HYPHEN:\n return shift ? '_' : '-';\n\n case KEY.EQUAL:\n return shift ? '+' : '=';\n }\n\n return '';\n}\n\nfunction fromCharCode(keyIdentifier) {\n const code = keyIdentifier.substring(2);\n const hex = parseInt(code, 16);\n const char = String.fromCharCode(hex);\n return char;\n}\n\nasync function switchKey(event) {\n let i;\n let isSelected;\n let prev;\n let next;\n let current = Info.element;\n let dataName;\n const {\n name,\n panel,\n path,\n isDir\n } = Info;\n const {\n Operation,\n loadDir,\n config\n } = CloudCmd;\n const {\n keyCode\n } = event;\n const alt = event.altKey;\n const shift = event.shiftKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n\n if (current) {\n prev = current.previousSibling;\n next = current.nextSibling;\n }\n\n switch (keyCode) {\n case KEY.TAB:\n DOM.changePanel();\n event.preventDefault();\n break;\n\n case KEY.INSERT:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n\n case KEY.INSERT_MAC:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n\n case KEY.DELETE:\n if (shift) Operation.show('delete:silent');else Operation.show('delete');\n break;\n\n case KEY.ASTERISK:\n DOM.toggleAllSelectedFiles(current);\n break;\n\n case KEY.PLUS:\n DOM.expandSelection();\n event.preventDefault();\n break;\n\n case KEY.MINUS:\n DOM.shrinkSelection();\n event.preventDefault();\n break;\n\n case KEY.F1:\n CloudCmd.Help.show();\n event.preventDefault();\n break;\n\n case KEY.F2:\n CloudCmd.UserMenu.show();\n break;\n\n case KEY.F3:\n event.preventDefault();\n if (Info.isDir) await loadDir({\n path\n });else if (shift) CloudCmd.View.show(null, {\n raw: true\n });else if (ctrlMeta) CloudCmd.sortPanel('name');else CloudCmd.View.show();\n break;\n\n case KEY.F4:\n if (config('vim')) CloudCmd.EditFileVim.show();else CloudCmd.EditFile.show();\n event.preventDefault();\n break;\n\n case KEY.F5:\n if (ctrlMeta) CloudCmd.sortPanel('date');else if (alt) Operation.show('pack');else Operation.show('copy');\n event.preventDefault();\n break;\n\n case KEY.F6:\n if (ctrlMeta) CloudCmd.sortPanel('size');else if (shift) DOM.renameCurrent(current);else Operation.show('move');\n event.preventDefault();\n break;\n\n case KEY.F7:\n if (shift) DOM.promptNewFile();else DOM.promptNewDir();\n event.preventDefault();\n break;\n\n case KEY.F8:\n Operation.show('delete');\n event.preventDefault();\n break;\n\n case KEY.F9:\n if (alt) Operation.show('extract');else CloudCmd.Menu.show();\n event.preventDefault();\n break;\n\n case KEY.F10:\n CloudCmd.Config.show();\n event.preventDefault();\n break;\n\n case KEY.TRA:\n event.preventDefault();\n if (shift) return CloudCmd.Terminal.show();\n CloudCmd.Konsole.show();\n break;\n\n case KEY.BRACKET_CLOSE:\n CloudCmd.Konsole.show();\n event.preventDefault();\n break;\n\n case KEY.SPACE:\n event.preventDefault();\n if (!isDir || name === '..') isSelected = true;else isSelected = DOM.isSelected(current);\n if (!isSelected) await DOM.loadCurrentSize(current);\n DOM.toggleSelectedFile(current);\n break;\n\n case KEY.U:\n if (ctrlMeta) {\n DOM.swapPanels();\n event.preventDefault();\n }\n\n break;\n\n /* navigation on file table: *\n * in case of pressing button 'up', *\n * select previous row */\n\n case KEY.UP:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(prev);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'down', *\n * select next row */\n\n case KEY.DOWN:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(next);\n event.preventDefault();\n break;\n\n case KEY.LEFT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-right') DOM.duplicatePanel();\n break;\n\n case KEY.RIGHT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-left') DOM.duplicatePanel();\n break;\n\n /* in case of pressing button 'Home', *\n * go to top element */\n\n case KEY.HOME:\n DOM.setCurrentFile(Info.first);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'End', select last element */\n\n case KEY.END:\n DOM.setCurrentFile(Info.last);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page down проматываем экран */\n\n case KEY.PAGE_DOWN:\n DOM.scrollByPages(panel, 1);\n\n for (i = 0; i < 30; i++) {\n if (!current.nextSibling) break;\n current = current.nextSibling;\n }\n\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page up проматываем экран */\n\n case KEY.PAGE_UP:\n DOM.scrollByPages(panel, -1);\n\n for (i = 0; i < 30; i++) {\n if (!current.previousSibling) break;\n current = current.previousSibling;\n }\n\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n case KEY.ENTER:\n if (Info.isDir) await loadDir({\n path\n });else CloudCmd.View.show();\n break;\n\n case KEY.BACKSPACE:\n CloudCmd.goToParentDir();\n event.preventDefault();\n break;\n\n case KEY.BACKSLASH:\n if (ctrlMeta) await loadDir({\n path: '/'\n });\n break;\n\n case KEY.A:\n if (ctrlMeta) {\n DOM.selectAllFiles();\n event.preventDefault();\n }\n\n break;\n\n case KEY.G:\n if (alt) {\n DOM.goToDirectory();\n event.preventDefault();\n }\n\n break;\n\n case KEY.M:\n if (ctrlMeta) {\n if (config('vim')) CloudCmd.EditNamesVim.show();else CloudCmd.EditNames.show();\n event.preventDefault();\n }\n\n break;\n\n case KEY.P:\n if (!ctrlMeta) return;\n event.preventDefault();\n clipboard.writeText(Info.dirPath).catch(CloudCmd.log);\n break;\n\n /**\n * обновляем страницу,\n * загружаем содержимое каталога\n * при этом данные берём всегда с\n * сервера, а не из кэша\n * (обновляем кэш)\n */\n\n case KEY.R:\n if (ctrlMeta) {\n CloudCmd.log('reloading page...\\n');\n CloudCmd.refresh();\n event.preventDefault();\n }\n\n break;\n\n case KEY.C:\n if (ctrlMeta) Buffer.copy();\n break;\n\n case KEY.X:\n if (ctrlMeta) Buffer.cut();\n break;\n\n case KEY.V:\n if (ctrlMeta) Buffer.paste();\n break;\n\n case KEY.Z:\n if (ctrlMeta) Buffer.clear();\n break;\n\n /* чистим хранилище */\n\n case KEY.D:\n if (ctrlMeta) {\n CloudCmd.log('clearing storage...');\n await DOM.Storage.clear();\n CloudCmd.log('storage cleared');\n event.preventDefault();\n }\n\n break;\n }\n}\n\n//# sourceURL=file://cloudcmd/client/key/index.js");
|
|
214
|
+
eval("\n/* global CloudCmd, DOM */\n\nconst Info = DOM.CurrentInfo;\n\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\n\nconst Buffer = __webpack_require__(/*! ../dom/buffer */ \"./client/dom/buffer.js\");\n\nconst Events = __webpack_require__(/*! ../dom/events */ \"./client/dom/events/index.js\");\n\nconst KEY = __webpack_require__(/*! ./key */ \"./client/key/key.js\");\n\nconst vim = __webpack_require__(/*! ./vim */ \"./client/key/vim/index.js\");\n\nconst setCurrentByChar = __webpack_require__(/*! ./set-current-by-char */ \"./client/key/set-current-by-char.js\");\n\nconst {\n createBinder\n} = __webpack_require__(/*! ./binder */ \"./client/key/binder.js\");\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n\nconst Chars = fullstore();\n\nconst toggleVim = keyCode => {\n const {\n _config,\n config\n } = CloudCmd;\n\n if (keyCode === KEY.ESC) {\n _config('vim', !config('vim'));\n }\n};\n\nconst isUndefined = a => typeof a === 'undefined';\n\nChars([]);\nconst {\n assign\n} = Object;\nconst binder = createBinder();\nmodule.exports = assign(binder, KEY);\n\nmodule.exports.bind = () => {\n Events.addKey(listener, true);\n binder.setBind();\n};\n\nmodule.exports._listener = listener;\n\nfunction getChar(event) {\n /*\n * event.keyIdentifier deprecated in chrome v51\n * but event.key is absent in chrome <= v51\n */\n const {\n key,\n shift,\n keyCode,\n keyIdentifier\n } = event;\n const char = key || fromCharCode(keyIdentifier);\n const symbol = getSymbol(shift, keyCode);\n return [symbol, char];\n}\n\nasync function listener(event) {\n const {\n keyCode\n } = event; // strange chrome bug calles listener twice\n // in second time event misses a lot fields\n\n if (isUndefined(event.altKey)) return;\n const alt = event.altKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const isBetween = keyCode >= KEY.ZERO && keyCode <= KEY.Z;\n const isNumpad = /Numpad/.test(event.code);\n const [symbol, char] = getChar(event);\n if (!binder.isBind()) return;\n toggleVim(keyCode);\n const isVim = CloudCmd.config('vim');\n if (!isVim && !isNumpad && !alt && !ctrl && !meta && (isBetween || symbol)) return setCurrentByChar(char, Chars);\n Chars([]);\n await switchKey(event);\n if (keyCode >= KEY.F1 && keyCode <= KEY.F10) return;\n if (isVim) vim(char, event);\n}\n\nfunction getSymbol(shift, keyCode) {\n switch (keyCode) {\n case KEY.DOT:\n return '.';\n\n case KEY.HYPHEN:\n return shift ? '_' : '-';\n\n case KEY.EQUAL:\n return shift ? '+' : '=';\n }\n\n return '';\n}\n\nfunction fromCharCode(keyIdentifier) {\n const code = keyIdentifier.substring(2);\n const hex = parseInt(code, 16);\n const char = String.fromCharCode(hex);\n return char;\n}\n\nasync function switchKey(event) {\n let i;\n let isSelected;\n let prev;\n let next;\n let current = Info.element;\n let dataName;\n const {\n name,\n panel,\n path,\n isDir\n } = Info;\n const {\n Operation,\n loadDir,\n config\n } = CloudCmd;\n const {\n keyCode\n } = event;\n const alt = event.altKey;\n const shift = event.shiftKey;\n const ctrl = event.ctrlKey;\n const meta = event.metaKey;\n const ctrlMeta = ctrl || meta;\n\n if (current) {\n prev = current.previousSibling;\n next = current.nextSibling;\n }\n\n switch (keyCode) {\n case KEY.TAB:\n DOM.changePanel();\n event.preventDefault();\n break;\n\n case KEY.INSERT:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n\n case KEY.INSERT_MAC:\n DOM.toggleSelectedFile(current).setCurrentFile(next);\n break;\n\n case KEY.DELETE:\n if (shift) Operation.show('delete:silent');else Operation.show('delete');\n break;\n\n case KEY.ASTERISK:\n DOM.toggleAllSelectedFiles(current);\n break;\n\n case KEY.PLUS:\n DOM.expandSelection();\n event.preventDefault();\n break;\n\n case KEY.MINUS:\n DOM.shrinkSelection();\n event.preventDefault();\n break;\n\n case KEY.F1:\n CloudCmd.Help.show();\n event.preventDefault();\n break;\n\n case KEY.F2:\n CloudCmd.UserMenu.show();\n break;\n\n case KEY.F3:\n event.preventDefault();\n if (Info.isDir) await loadDir({\n path\n });else if (shift) CloudCmd.View.show(null, {\n raw: true\n });else if (ctrlMeta) CloudCmd.sortPanel('name');else CloudCmd.View.show();\n break;\n\n case KEY.F4:\n if (config('vim')) CloudCmd.EditFileVim.show();else CloudCmd.EditFile.show();\n event.preventDefault();\n break;\n\n case KEY.F5:\n if (ctrlMeta) CloudCmd.sortPanel('date');else if (alt) Operation.show('pack');else Operation.show('copy');\n event.preventDefault();\n break;\n\n case KEY.F6:\n if (ctrlMeta) CloudCmd.sortPanel('size');else if (shift) DOM.renameCurrent(current);else Operation.show('move');\n event.preventDefault();\n break;\n\n case KEY.F7:\n if (shift) DOM.promptNewFile();else DOM.promptNewDir();\n event.preventDefault();\n break;\n\n case KEY.F8:\n Operation.show('delete');\n event.preventDefault();\n break;\n\n case KEY.F9:\n if (alt) Operation.show('extract');else CloudCmd.Menu.show();\n event.preventDefault();\n break;\n\n case KEY.F10:\n CloudCmd.Config.show();\n event.preventDefault();\n break;\n\n case KEY.TRA:\n event.preventDefault();\n if (shift) return CloudCmd.Terminal.show();\n CloudCmd.Konsole.show();\n break;\n\n case KEY.BRACKET_CLOSE:\n CloudCmd.Konsole.show();\n event.preventDefault();\n break;\n\n case KEY.SPACE:\n event.preventDefault();\n if (!isDir || name === '..') isSelected = true;else isSelected = DOM.isSelected(current);\n if (!isSelected) await DOM.loadCurrentSize(current);\n DOM.toggleSelectedFile(current);\n break;\n\n case KEY.U:\n if (ctrlMeta) {\n DOM.swapPanels();\n event.preventDefault();\n }\n\n break;\n\n /* navigation on file table: *\n * in case of pressing button 'up', *\n * select previous row */\n\n case KEY.UP:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(prev);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'down', *\n * select next row */\n\n case KEY.DOWN:\n if (shift) DOM.toggleSelectedFile(current);\n DOM.setCurrentFile(next);\n event.preventDefault();\n break;\n\n case KEY.LEFT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-right') DOM.duplicatePanel();\n break;\n\n case KEY.RIGHT:\n if (!alt) return;\n event.preventDefault();\n dataName = Info.panel.getAttribute('data-name');\n if (dataName === 'js-left') DOM.duplicatePanel();\n break;\n\n /* in case of pressing button 'Home', *\n * go to top element */\n\n case KEY.HOME:\n DOM.setCurrentFile(Info.first);\n event.preventDefault();\n break;\n\n /* in case of pressing button 'End', select last element */\n\n case KEY.END:\n DOM.setCurrentFile(Info.last);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page down проматываем экран */\n\n case KEY.PAGE_DOWN:\n DOM.scrollByPages(panel, 1);\n\n for (i = 0; i < 30; i++) {\n if (!current.nextSibling) break;\n current = current.nextSibling;\n }\n\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n /* если нажали клавишу page up проматываем экран */\n\n case KEY.PAGE_UP:\n DOM.scrollByPages(panel, -1);\n\n for (i = 0; i < 30; i++) {\n if (!current.previousSibling) break;\n current = current.previousSibling;\n }\n\n DOM.setCurrentFile(current);\n event.preventDefault();\n break;\n\n case KEY.ENTER:\n if (Info.isDir) await loadDir({\n path\n });else CloudCmd.View.show();\n break;\n\n case KEY.BACKSPACE:\n CloudCmd.goToParentDir();\n event.preventDefault();\n break;\n\n case KEY.BACKSLASH:\n if (ctrlMeta) await loadDir({\n path: '/'\n });\n break;\n\n case KEY.A:\n if (ctrlMeta) {\n DOM.selectAllFiles();\n event.preventDefault();\n }\n\n break;\n\n case KEY.G:\n if (alt) {\n DOM.goToDirectory();\n event.preventDefault();\n }\n\n break;\n\n case KEY.M:\n if (ctrlMeta) {\n if (config('vim')) CloudCmd.EditNamesVim.show();else CloudCmd.EditNames.show();\n event.preventDefault();\n }\n\n break;\n\n case KEY.P:\n if (!ctrlMeta) return;\n event.preventDefault();\n clipboard.writeText(Info.dirPath).catch(CloudCmd.log);\n break;\n\n /**\n * обновляем страницу,\n * загружаем содержимое каталога\n * при этом данные берём всегда с\n * сервера, а не из кэша\n * (обновляем кэш)\n */\n\n case KEY.R:\n if (ctrlMeta) {\n CloudCmd.log('reloading page...\\n');\n CloudCmd.refresh();\n event.preventDefault();\n }\n\n break;\n\n case KEY.C:\n if (ctrlMeta) Buffer.copy();\n break;\n\n case KEY.X:\n if (ctrlMeta) Buffer.cut();\n break;\n\n case KEY.V:\n if (ctrlMeta) Buffer.paste();\n break;\n\n case KEY.Z:\n if (ctrlMeta) Buffer.clear();\n break;\n\n /* чистим хранилище */\n\n case KEY.D:\n if (ctrlMeta) {\n CloudCmd.log('clearing storage...');\n await DOM.Storage.clear();\n CloudCmd.log('storage cleared');\n event.preventDefault();\n }\n\n break;\n }\n}\n\n//# sourceURL=file://cloudcmd/client/key/index.js");
|
|
215
215
|
|
|
216
216
|
/***/ }),
|
|
217
217
|
|
|
@@ -295,7 +295,7 @@ eval("\n\nmodule.exports = (indexFrom, indexTo, files) => {\n if (indexFrom < i
|
|
|
295
295
|
/***/ (function(module, exports, __webpack_require__) {
|
|
296
296
|
|
|
297
297
|
"use strict";
|
|
298
|
-
eval("/* global DOM, CloudCmd */\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\n\nconst getRange = __webpack_require__(/*! ./get-range */ \"./client/listeners/get-range.js\");\n\nconst getIndex = currify(__webpack_require__(/*! ./get-index */ \"./client/listeners/get-index.js\"));\n\nconst uploadFiles = __webpack_require__(/*! ../dom/upload-files */ \"./client/dom/upload-files.js\");\n\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst NBSP_REG = RegExp(String.fromCharCode(160), 'g');\nconst SPACE = ' ';\n\nmodule.exports.init = async () => {\n await Promise.all([contextMenu(), dragndrop(), unload(), pop(), resize(), header(), config()]);\n};\n\nCloudCmd.Listeners = module.exports;\n\nconst unselect = event => {\n const isMac = /Mac/.test(window.navigator.platform);\n const {\n shiftKey,\n metaKey,\n ctrlKey\n } = event;\n if (shiftKey || isMac && metaKey || ctrlKey) return;\n DOM.unselectFiles();\n};\n\nconst execAll = currify((funcs, event) => {\n for (const fn of funcs) fn(event);\n});\nconst Info = DOM.CurrentInfo;\nconst {\n Events\n} = DOM;\nconst EventsFiles = {\n mousedown: exec.with(execIfNotUL, setCurrentFileByEvent),\n click: execAll([onClick, unselect]),\n dragstart: exec.with(execIfNotUL, onDragStart),\n dblclick: exec.with(execIfNotUL, onDblClick),\n touchstart: exec.with(execIfNotUL, onTouch)\n};\nlet EXT;\n\nfunction header() {\n const fm = DOM.getFM();\n\n const isDataset = el => el.dataset;\n\n const isPanel = el => {\n return /^js-(left|right)$/.test(el.dataset.name);\n };\n\n Events.addClick(fm, event => {\n const el = event.target;\n const parent = el.parentElement;\n if (parent.dataset.name !== 'js-fm-header') return;\n const name = (el.dataset.name || '').replace('js-', '');\n if (!/^(name|size|date)$/.test(name)) return;\n const panel = getPath(el).filter(isDataset).filter(isPanel).pop();\n CloudCmd.sortPanel(name, panel);\n });\n}\n\nfunction getPath(el) {\n let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n if (!el) return path;\n return getPath(el.parentElement, path.concat(el));\n}\n\nasync function config() {\n const [, config] = await tryToCatch(DOM.Files.get, 'config');\n const type = config === null || config === void 0 ? void 0 : config.packer;\n EXT = DOM.getPackerExt(type);\n}\n\nmodule.exports.initKeysPanel = () => {\n const keysElement = DOM.getById('js-keyspanel');\n if (!keysElement) return;\n Events.addClick(keysElement, _ref => {\n let {\n target\n } = _ref;\n const {\n id\n } = target;\n\n const operation = name => {\n const {\n Operation\n } = CloudCmd;\n const fn = Operation.show.bind(null, name);\n return fn;\n };\n\n const clickFuncs = {\n 'f1': CloudCmd.Help.show,\n 'f2': initF2,\n 'f3': CloudCmd.View.show,\n 'f4': CloudCmd.EditFile.show,\n 'f5': operation('copy'),\n 'f6': operation('move'),\n 'f7': DOM.promptNewDir,\n 'f8': operation('delete'),\n 'f9': CloudCmd.Menu.show,\n 'f10': CloudCmd.Config.show,\n '~': CloudCmd.Konsole.show,\n 'shift~': CloudCmd.Terminal.show,\n 'contact': CloudCmd.Contact.show\n };\n exec(clickFuncs[id]);\n });\n};\n\nfunction initF2() {\n CloudCmd.UserMenu.show();\n}\n\nconst getPanel = side => {\n if (!itype.string(side)) return side;\n return DOM.getByDataName('js-' + side);\n};\n\nmodule.exports.setOnPanel = side => {\n const panel = getPanel(side);\n const filesElement = DOM.getByDataName('js-files', panel);\n const pathElement = DOM.getByDataName('js-path', panel);\n /* ставим загрузку гифа на клик*/\n\n Events.addClick(pathElement, getPathListener(panel));\n Events.add(filesElement, EventsFiles);\n};\n\nfunction getPathListener(panel) {\n return onPathElementClick.bind(null, panel);\n}\n\nfunction isNoCurrent(panel) {\n const infoPanel = Info.panel;\n if (!infoPanel) return true;\n const namePanel = panel.getAttribute('data-name');\n const nameInfoPanel = infoPanel.getAttribute('data-name');\n return namePanel !== nameInfoPanel;\n}\n\nfunction decodePath(path) {\n const url = CloudCmd.HOST;\n const {\n prefix\n } = CloudCmd;\n const prefixReg = RegExp('^' + prefix + FS);\n return decodeURI(path).replace(url, '').replace(prefixReg, '') // browser doesn't replace % -> %25% do it for him\n .replace('%%', '%25%').replace(NBSP_REG, SPACE) || '/';\n}\n\nasync function onPathElementClick(panel, event) {\n event.preventDefault();\n const element = event.target;\n const attr = element.getAttribute('data-name');\n const noCurrent = isNoCurrent(panel);\n if (attr === 'js-copy-path') return copyPath(element);\n if (attr === 'js-refresh') return CloudCmd.refresh({\n panel,\n noCurrent\n });\n if (attr !== 'js-path-link') return;\n const {\n href\n } = element;\n const path = decodePath(href);\n await CloudCmd.loadDir({\n path,\n isRefresh: false,\n panel: noCurrent ? panel : Info.panel\n });\n}\n\nfunction copyPath(el) {\n clipboard.writeText(el.parentElement.title).then(CloudCmd.log).catch(CloudCmd.log);\n}\n\nfunction execIfNotUL(callback, event) {\n const {\n target\n } = event;\n const {\n tagName\n } = target;\n if (tagName !== 'UL') callback(event);\n}\n\nfunction onClick(event) {\n event.preventDefault();\n changePanel(event.target);\n}\n\nfunction toggleSelect(key, files) {\n const isMac = /Mac/.test(window.navigator.platform);\n if (!key) throw Error('key should not be undefined!');\n const [file] = files;\n if (isMac && key.meta || key.ctrl) return DOM.toggleSelectedFile(file);\n if (key.shift) return files.map(DOM.selectFile);\n}\n\nfunction changePanel(element) {\n const {\n panel\n } = Info;\n const files = DOM.getByDataName('js-files', panel);\n const ul = getULElement(element);\n if (ul !== files) DOM.changePanel();\n}\n\nasync function onDblClick(event) {\n event.preventDefault();\n const current = getLIElement(event.target);\n const isDir = DOM.isCurrentIsDir(current);\n const path = DOM.getCurrentPath(current);\n if (!isDir) return CloudCmd.View.show();\n await CloudCmd.loadDir({\n path\n });\n}\n\nasync function onTouch(event) {\n const current = getLIElement(event.target);\n const isDir = DOM.isCurrentIsDir(current);\n if (!isDir) return;\n const isCurrent = DOM.isCurrentFile(current);\n if (!isCurrent) return;\n await CloudCmd.loadDir({\n path: DOM.getCurrentPath(current)\n });\n}\n/*\n * download file from browser to desktop\n * in Chrome (HTML5)\n */\n\n\nfunction onDragStart(event) {\n const {\n prefixURL\n } = CloudCmd;\n const element = getLIElement(event.target);\n const {\n isDir\n } = Info;\n let link = DOM.getCurrentLink(element);\n let name = DOM.getCurrentName(element);\n /* if it's directory - adding json extension */\n\n if (isDir) {\n name += EXT;\n link = document.createElement('a');\n link.textContent = name;\n link.href = prefixURL + '/pack' + Info.path + EXT;\n }\n\n event.dataTransfer.setData('DownloadURL', 'application/octet-stream' + ':' + name + ':' + link);\n}\n\nfunction getLIElement(element) {\n if (!element) return element;\n\n while (element.tagName !== 'LI') element = element.parentElement;\n\n return element;\n}\n\nfunction getULElement(element) {\n while (element.tagName !== 'UL') element = element.parentElement;\n\n return element;\n}\n\nfunction setCurrentFileByEvent(event) {\n const BUTTON_LEFT = 0;\n const key = {\n alt: event.altKey,\n ctrl: event.ctrlKey,\n meta: event.metaKey,\n shift: event.shiftKey\n };\n const element = getLIElement(event.target);\n const fromName = Info.name;\n DOM.setCurrentFile(element);\n const toName = Info.name;\n let files = [];\n if (key.shift) files = getFilesRange(fromName, toName);else files.push(Info.element);\n if (event.button === BUTTON_LEFT) toggleSelect(key, files);\n}\n\nfunction getFilesRange(from, to) {\n const files = DOM.getAllFiles();\n const names = DOM.getFilenames(files);\n const getNameIndex = getIndex(names);\n const indexFrom = getNameIndex(from);\n const indexTo = getNameIndex(to);\n return getRange(indexFrom, indexTo, files);\n}\n\nfunction contextMenu() {\n const fm = DOM.getFM();\n Events.addOnce('contextmenu', fm, event => {\n CloudCmd.Menu.show({\n x: event.clientX,\n y: event.clientY\n });\n });\n Events.addContextMenu(fm, event => {\n CloudCmd.Menu.ENABLED || event.preventDefault();\n });\n}\n\nfunction dragndrop() {\n const panels = DOM.getByClassAll('panel');\n\n const select = _ref2 => {\n let {\n target\n } = _ref2;\n target.classList.add('selected-panel');\n };\n\n const unselect = _ref3 => {\n let {\n target\n } = _ref3;\n target.classList.remove('selected-panel');\n };\n\n const onDrop = event => {\n const {\n files,\n items\n } = event.dataTransfer;\n const {\n length: filesCount\n } = files;\n event.preventDefault();\n if (filesCount && (!items || !items.length || !items[0].webkitGetAsEntry)) return uploadFiles(files);\n\n const isFile = item => item.kind === 'file';\n\n const dirFiles = Array.from(items).filter(isFile);\n if (dirFiles.length) return DOM.uploadDirectory(dirFiles);\n const {\n Operation\n } = CloudCmd;\n const operation = event.shiftKey ? 'move' : 'copy';\n return Operation.show(operation);\n };\n /**\n * In Mac OS Chrome dropEffect = 'none'\n * so drop do not firing up when try\n * to upload file from download bar\n */\n\n\n const onDragOver = event => {\n const {\n dataTransfer\n } = event;\n const {\n effectAllowed\n } = dataTransfer;\n if (/move|linkMove/.test(effectAllowed)) dataTransfer.dropEffect = 'move';else dataTransfer.dropEffect = 'copy';\n event.preventDefault();\n };\n\n for (const panel of panels) Events.add('dragover', panel, onDragOver).add('drop', panel, onDrop).add('dragenter', select).add(['dragleave', 'drop'], unselect);\n}\n\nfunction unload() {\n DOM.Events.add(['unload', 'beforeunload'], event => {\n const {\n Key\n } = CloudCmd;\n const isBind = Key === null || Key === void 0 ? void 0 : Key.isBind();\n if (isBind) return;\n event.preventDefault();\n return 'Please make sure that you saved all work.';\n });\n}\n\nfunction pop() {\n Events.add('popstate', async _ref4 => {\n let {\n state\n } = _ref4;\n const path = (state || '').replace(FS, '');\n if (!path) return CloudCmd.route(location.hash);\n const history = false;\n await CloudCmd.loadDir({\n path,\n history\n });\n });\n}\n\nfunction resize() {\n Events.add('resize', () => {\n const is = window.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH;\n if (!is) return;\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return;\n const name = panel.getAttribute('data-name');\n const isLeft = name === 'js-left';\n if (isLeft) return;\n DOM.changePanel();\n });\n}\n\n//# sourceURL=file://cloudcmd/client/listeners/index.js");
|
|
298
|
+
eval("/* global DOM, CloudCmd */\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst itype = __webpack_require__(/*! itype */ \"./node_modules/itype/lib/itype.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst clipboard = __webpack_require__(/*! @cloudcmd/clipboard */ \"./node_modules/@cloudcmd/clipboard/lib/clipboard.js\");\n\nconst getRange = __webpack_require__(/*! ./get-range */ \"./client/listeners/get-range.js\");\n\nconst getIndex = currify(__webpack_require__(/*! ./get-index */ \"./client/listeners/get-index.js\"));\n\nconst uploadFiles = __webpack_require__(/*! ../dom/upload-files */ \"./client/dom/upload-files.js\");\n\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst NBSP_REG = RegExp(String.fromCharCode(160), 'g');\nconst SPACE = ' ';\n\nmodule.exports.init = async () => {\n await Promise.all([contextMenu(), dragndrop(), unload(), pop(), resize(), header(), config()]);\n};\n\nCloudCmd.Listeners = module.exports;\n\nconst unselect = event => {\n const isMac = /Mac/.test(window.navigator.platform);\n const {\n shiftKey,\n metaKey,\n ctrlKey\n } = event;\n if (shiftKey || isMac && metaKey || ctrlKey) return;\n DOM.unselectFiles();\n};\n\nconst execAll = currify((funcs, event) => {\n for (const fn of funcs) fn(event);\n});\nconst Info = DOM.CurrentInfo;\nconst {\n Events\n} = DOM;\nconst EventsFiles = {\n mousedown: exec.with(execIfNotUL, setCurrentFileByEvent),\n click: execAll([onClick, unselect]),\n dragstart: exec.with(execIfNotUL, onDragStart),\n dblclick: exec.with(execIfNotUL, onDblClick),\n touchstart: exec.with(execIfNotUL, onTouch)\n};\nlet EXT;\n\nfunction header() {\n const fm = DOM.getFM();\n\n const isDataset = el => el.dataset;\n\n const isPanel = el => {\n return /^js-(left|right)$/.test(el.dataset.name);\n };\n\n Events.addClick(fm, event => {\n const el = event.target;\n const parent = el.parentElement;\n if (parent.dataset.name !== 'js-fm-header') return;\n const name = (el.dataset.name || '').replace('js-', '');\n if (!/^(name|size|date)$/.test(name)) return;\n const panel = getPath(el).filter(isDataset).filter(isPanel).pop();\n CloudCmd.sortPanel(name, panel);\n });\n}\n\nfunction getPath(el) {\n let path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n if (!el) return path;\n return getPath(el.parentElement, path.concat(el));\n}\n\nasync function config() {\n const [, config] = await tryToCatch(DOM.Files.get, 'config');\n const type = config === null || config === void 0 ? void 0 : config.packer;\n EXT = DOM.getPackerExt(type);\n}\n\nmodule.exports.initKeysPanel = () => {\n const keysElement = DOM.getById('js-keyspanel');\n if (!keysElement) return;\n Events.addClick(keysElement, _ref => {\n let {\n target\n } = _ref;\n const {\n id\n } = target;\n\n const operation = name => {\n const {\n Operation\n } = CloudCmd;\n const fn = Operation.show.bind(null, name);\n return fn;\n };\n\n const clickFuncs = {\n 'f1': CloudCmd.Help.show,\n 'f2': CloudCmd.UserMenu.show,\n 'f3': CloudCmd.View.show,\n 'f4': CloudCmd.EditFile.show,\n 'f5': operation('copy'),\n 'f6': operation('move'),\n 'f7': DOM.promptNewDir,\n 'f8': operation('delete'),\n 'f9': CloudCmd.Menu.show,\n 'f10': CloudCmd.Config.show,\n '~': CloudCmd.Konsole.show,\n 'shift~': CloudCmd.Terminal.show,\n 'contact': CloudCmd.Contact.show\n };\n exec(clickFuncs[id]);\n });\n};\n\nconst getPanel = side => {\n if (!itype.string(side)) return side;\n return DOM.getByDataName('js-' + side);\n};\n\nmodule.exports.setOnPanel = side => {\n const panel = getPanel(side);\n const filesElement = DOM.getByDataName('js-files', panel);\n const pathElement = DOM.getByDataName('js-path', panel);\n /* ставим загрузку гифа на клик*/\n\n Events.addClick(pathElement, getPathListener(panel));\n Events.add(filesElement, EventsFiles);\n};\n\nfunction getPathListener(panel) {\n return onPathElementClick.bind(null, panel);\n}\n\nfunction isNoCurrent(panel) {\n const infoPanel = Info.panel;\n if (!infoPanel) return true;\n const namePanel = panel.getAttribute('data-name');\n const nameInfoPanel = infoPanel.getAttribute('data-name');\n return namePanel !== nameInfoPanel;\n}\n\nfunction decodePath(path) {\n const url = CloudCmd.HOST;\n const {\n prefix\n } = CloudCmd;\n const prefixReg = RegExp('^' + prefix + FS);\n return decodeURI(path).replace(url, '').replace(prefixReg, '') // browser doesn't replace % -> %25% do it for him\n .replace('%%', '%25%').replace(NBSP_REG, SPACE) || '/';\n}\n\nasync function onPathElementClick(panel, event) {\n event.preventDefault();\n const element = event.target;\n const attr = element.getAttribute('data-name');\n const noCurrent = isNoCurrent(panel);\n if (attr === 'js-copy-path') return copyPath(element);\n if (attr === 'js-refresh') return CloudCmd.refresh({\n panel,\n noCurrent\n });\n if (attr !== 'js-path-link') return;\n const {\n href\n } = element;\n const path = decodePath(href);\n await CloudCmd.loadDir({\n path,\n isRefresh: false,\n panel: noCurrent ? panel : Info.panel\n });\n}\n\nfunction copyPath(el) {\n clipboard.writeText(el.parentElement.title).then(CloudCmd.log).catch(CloudCmd.log);\n}\n\nfunction execIfNotUL(callback, event) {\n const {\n target\n } = event;\n const {\n tagName\n } = target;\n if (tagName !== 'UL') callback(event);\n}\n\nfunction onClick(event) {\n event.preventDefault();\n changePanel(event.target);\n}\n\nfunction toggleSelect(key, files) {\n const isMac = /Mac/.test(window.navigator.platform);\n if (!key) throw Error('key should not be undefined!');\n const [file] = files;\n if (isMac && key.meta || key.ctrl) return DOM.toggleSelectedFile(file);\n if (key.shift) return files.map(DOM.selectFile);\n}\n\nfunction changePanel(element) {\n const {\n panel\n } = Info;\n const files = DOM.getByDataName('js-files', panel);\n const ul = getULElement(element);\n if (ul !== files) DOM.changePanel();\n}\n\nasync function onDblClick(event) {\n event.preventDefault();\n const current = getLIElement(event.target);\n const isDir = DOM.isCurrentIsDir(current);\n const path = DOM.getCurrentPath(current);\n if (!isDir) return CloudCmd.View.show();\n await CloudCmd.loadDir({\n path\n });\n}\n\nasync function onTouch(event) {\n const current = getLIElement(event.target);\n const isDir = DOM.isCurrentIsDir(current);\n if (!isDir) return;\n const isCurrent = DOM.isCurrentFile(current);\n if (!isCurrent) return;\n await CloudCmd.loadDir({\n path: DOM.getCurrentPath(current)\n });\n}\n/*\n * download file from browser to desktop\n * in Chrome (HTML5)\n */\n\n\nfunction onDragStart(event) {\n const {\n prefixURL\n } = CloudCmd;\n const element = getLIElement(event.target);\n const {\n isDir\n } = Info;\n let link = DOM.getCurrentLink(element);\n let name = DOM.getCurrentName(element);\n /* if it's directory - adding json extension */\n\n if (isDir) {\n name += EXT;\n link = document.createElement('a');\n link.textContent = name;\n link.href = prefixURL + '/pack' + Info.path + EXT;\n }\n\n event.dataTransfer.setData('DownloadURL', 'application/octet-stream' + ':' + name + ':' + link);\n}\n\nfunction getLIElement(element) {\n if (!element) return element;\n\n while (element.tagName !== 'LI') element = element.parentElement;\n\n return element;\n}\n\nfunction getULElement(element) {\n while (element.tagName !== 'UL') element = element.parentElement;\n\n return element;\n}\n\nfunction setCurrentFileByEvent(event) {\n const BUTTON_LEFT = 0;\n const key = {\n alt: event.altKey,\n ctrl: event.ctrlKey,\n meta: event.metaKey,\n shift: event.shiftKey\n };\n const element = getLIElement(event.target);\n const fromName = Info.name;\n DOM.setCurrentFile(element);\n const toName = Info.name;\n let files = [];\n if (key.shift) files = getFilesRange(fromName, toName);else files.push(Info.element);\n if (event.button === BUTTON_LEFT) toggleSelect(key, files);\n}\n\nfunction getFilesRange(from, to) {\n const files = DOM.getAllFiles();\n const names = DOM.getFilenames(files);\n const getNameIndex = getIndex(names);\n const indexFrom = getNameIndex(from);\n const indexTo = getNameIndex(to);\n return getRange(indexFrom, indexTo, files);\n}\n\nfunction contextMenu() {\n const fm = DOM.getFM();\n Events.addOnce('contextmenu', fm, event => {\n CloudCmd.Menu.show({\n x: event.clientX,\n y: event.clientY\n });\n });\n Events.addContextMenu(fm, event => {\n CloudCmd.Menu.ENABLED || event.preventDefault();\n });\n}\n\nfunction dragndrop() {\n const panels = DOM.getByClassAll('panel');\n\n const select = _ref2 => {\n let {\n target\n } = _ref2;\n target.classList.add('selected-panel');\n };\n\n const unselect = _ref3 => {\n let {\n target\n } = _ref3;\n target.classList.remove('selected-panel');\n };\n\n const onDrop = event => {\n const {\n files,\n items\n } = event.dataTransfer;\n const {\n length: filesCount\n } = files;\n event.preventDefault();\n if (filesCount && (!items || !items.length || !items[0].webkitGetAsEntry)) return uploadFiles(files);\n\n const isFile = item => item.kind === 'file';\n\n const dirFiles = Array.from(items).filter(isFile);\n if (dirFiles.length) return DOM.uploadDirectory(dirFiles);\n const {\n Operation\n } = CloudCmd;\n const operation = event.shiftKey ? 'move' : 'copy';\n return Operation.show(operation);\n };\n /**\n * In Mac OS Chrome dropEffect = 'none'\n * so drop do not firing up when try\n * to upload file from download bar\n */\n\n\n const onDragOver = event => {\n const {\n dataTransfer\n } = event;\n const {\n effectAllowed\n } = dataTransfer;\n if (/move|linkMove/.test(effectAllowed)) dataTransfer.dropEffect = 'move';else dataTransfer.dropEffect = 'copy';\n event.preventDefault();\n };\n\n for (const panel of panels) Events.add('dragover', panel, onDragOver).add('drop', panel, onDrop).add('dragenter', select).add(['dragleave', 'drop'], unselect);\n}\n\nfunction unload() {\n DOM.Events.add(['unload', 'beforeunload'], event => {\n const {\n Key\n } = CloudCmd;\n const isBind = Key === null || Key === void 0 ? void 0 : Key.isBind();\n if (isBind) return;\n event.preventDefault();\n return 'Please make sure that you saved all work.';\n });\n}\n\nfunction pop() {\n Events.add('popstate', async _ref4 => {\n let {\n state\n } = _ref4;\n const path = (state || '').replace(FS, '');\n if (!path) return CloudCmd.route(location.hash);\n const history = false;\n await CloudCmd.loadDir({\n path,\n history\n });\n });\n}\n\nfunction resize() {\n Events.add('resize', () => {\n const is = window.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH;\n if (!is) return;\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return;\n const name = panel.getAttribute('data-name');\n const isLeft = name === 'js-left';\n if (isLeft) return;\n DOM.changePanel();\n });\n}\n\n//# sourceURL=file://cloudcmd/client/listeners/index.js");
|
|
299
299
|
|
|
300
300
|
/***/ }),
|
|
301
301
|
|
package/dist-dev/config.css
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
line-height: 1.5;
|
|
21
21
|
color: #555;
|
|
22
22
|
border: 1px solid #ccc;
|
|
23
|
-
-webkit-box-shadow: inset 0 1px 1px
|
|
24
|
-
-moz-box-shadow: inset 0 1px 1px
|
|
25
|
-
box-shadow: inset 0 1px 1px
|
|
23
|
+
-webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%);
|
|
24
|
+
-moz-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%);
|
|
25
|
+
box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%);
|
|
26
26
|
-webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
|
|
27
27
|
-moz-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
|
|
28
28
|
-o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
.config .form-control:focus {
|
|
45
45
|
border-color: #66afe9;
|
|
46
46
|
outline: 0;
|
|
47
|
-
-webkit-box-shadow: inset 0 1px 1px
|
|
48
|
-
-moz-box-shadow: inset 0 1px 1px
|
|
49
|
-
box-shadow: inset 0 1px 1px
|
|
47
|
+
-webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%), 0 0 1px rgb(102 175 233 / 60%);
|
|
48
|
+
-moz-box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%), 0 0 1px rgb(102 175 233 / 60%);
|
|
49
|
+
box-shadow: inset 0 1px 1px rgb(0 0 0 / 7.5%), 0 0 1px rgb(102 175 233 / 60%);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.config .form-control:focus:invalid:focus {
|
|
@@ -187,7 +187,7 @@ eval("\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/cu
|
|
|
187
187
|
/***/ (function(module, exports, __webpack_require__) {
|
|
188
188
|
|
|
189
189
|
"use strict";
|
|
190
|
-
eval("/* global CloudCmd */\n\n/* global Util */\n\n/* global DOM */\n\n/* global fileop */\n\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\n\nconst removeExtension = __webpack_require__(/*! ./remove-extension */ \"./client/modules/operation/remove-extension.js\");\n\nconst setListeners = __webpack_require__(/*! ./set-listeners */ \"./client/modules/operation/set-listeners.js\");\n\nconst getNextCurrentName = __webpack_require__(/*! ./get-next-current-name */ \"./client/modules/operation/get-next-current-name.js\");\n\nconst removeQuery = a => a.replace(/\\?.*/, '');\n\nconst Name = 'Operation';\nCloudCmd[Name] = exports;\nconst {\n config\n} = CloudCmd;\nconst {\n Dialog,\n Images\n} = DOM;\nconst authCheck = wraptile(_authCheck);\nconst Operation = {};\nlet Loaded;\nlet copyFn;\nlet moveFn;\nlet deleteFn;\nlet extractFn;\nlet packZipFn;\nlet packTarFn;\nconst Info = DOM.CurrentInfo;\nconst showLoad = Images.show.load.bind(null, 'top');\nconst processFiles = currify(_processFiles);\n\nconst noFilesCheck = () => {\n const {\n length\n } = DOM.getActiveFiles();\n const is = Boolean(!length);\n if (is) return Dialog.alert.noFiles();\n return is;\n};\n\nmodule.exports.init = promisify(callback => {\n showLoad();\n exec.series([DOM.loadSocket, async callback => {\n if (config('dropbox')) return callback();\n const {\n prefix,\n prefixSocket\n } = CloudCmd;\n await loadAll();\n await initOperations(prefix, prefixSocket, callback);\n }, callback => {\n Loaded = true;\n Images.hide();\n callback();\n }], callback);\n});\n\nfunction _authCheck(spawn, ok) {\n const accept = wraptile(ok);\n const alertDialog = wraptile(Dialog.alert);\n spawn.on('accept', accept(spawn));\n spawn.on('reject', alertDialog('Wrong credentials!'));\n spawn.emit('auth', config('username'), config('password'));\n}\n\nconst onConnect = currify((fn, operator) => {\n setOperations(operator);\n fn();\n});\n\nasync function initOperations(prefix, socketPrefix, fn) {\n socketPrefix = `${socketPrefix}/fileop`;\n const operator = await fileop({\n prefix,\n socketPrefix\n });\n operator.on('connect', authCheck(operator, onConnect(fn)));\n}\n\nfunction setOperations(operator) {\n packTarFn = (_ref, callback) => {\n let {\n from,\n to,\n names\n } = _ref;\n const operation = 'Tar';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.tar(from, to, names).then(listen);\n };\n\n packZipFn = (_ref2, callback) => {\n let {\n from,\n to,\n names\n } = _ref2;\n const operation = 'Zip';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.zip(from, to, names).then(listen);\n };\n\n deleteFn = (from, files, callback) => {\n from = removeQuery(from);\n const operation = 'Delete';\n const listen = setListeners({\n operation,\n callback,\n from\n });\n operator.remove(from, files).then(listen);\n };\n\n copyFn = (_ref3, callback) => {\n let {\n from,\n to,\n names\n } = _ref3;\n const operation = 'Copy';\n const listen = setListeners({\n operation,\n callback,\n from,\n to,\n names\n });\n operator.copy(from, to, names).then(listen);\n };\n\n moveFn = (_ref4, callback) => {\n let {\n from,\n to,\n names\n } = _ref4;\n const operation = 'Move';\n const listen = setListeners({\n operation,\n callback,\n from,\n to\n });\n operator.move(from, to, names).then(listen);\n };\n\n extractFn = (_ref5, callback) => {\n let {\n from,\n to\n } = _ref5;\n const operation = 'Extract';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.extract(from, to).then(listen);\n };\n}\n\nfunction getPacker(type) {\n if (type === 'zip') return packZipFn;\n return packTarFn;\n}\n\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\n\nmodule.exports.show = (operation, data) => {\n if (!Loaded) return;\n if (operation === 'copy') return Operation.copy(data);\n if (operation === 'move') return Operation.move(data);\n if (operation === 'delete') return Operation.delete();\n if (operation === 'delete:silent') return Operation.deleteSilent();\n if (operation === 'pack') return Operation.pack();\n if (operation === 'extract') return Operation.extract();\n};\n\nOperation.copy = processFiles({\n type: 'copy'\n});\nOperation.move = processFiles({\n type: 'move'\n});\nOperation.delete = promptDelete;\nOperation.deleteSilent = deleteSilent;\n\nOperation.pack = () => {\n const isZip = config('packer') === 'zip';\n twopack('pack', isZip ? 'zip' : 'tar');\n};\n\nOperation.extract = () => {\n twopack('extract');\n};\n/**\n * prompt and delete current file or selected files\n *\n * @currentFile\n */\n\n\nasync function promptDelete() {\n if (noFilesCheck()) return;\n const msgAsk = 'Do you really want to delete the ';\n const msgSel = 'selected ';\n const files = DOM.getActiveFiles();\n const names = DOM.getFilenames(files);\n const n = names.length;\n let msg;\n\n if (n) {\n let name = '';\n\n for (let i = 0; i < 5 && i < n; i++) name += '\\n' + names[i];\n\n if (n >= 5) name += '\\n...';\n msg = msgAsk + msgSel + n + ' files/directories?\\n' + encode(name);\n } else {\n const current = DOM.getCurrentFile();\n const isDir = DOM.isCurrentIsDir(current);\n\n const getType = isDir => isDir ? 'directory' : 'file';\n\n const type = getType(isDir) + ' ';\n const name = DOM.getCurrentName(current);\n msg = msgAsk + msgSel + type + name + '?';\n }\n\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n deleteSilent(files);\n}\n/**\n * delete current or selected files\n *\n * @files\n */\n\n\nfunction deleteSilent() {\n let files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DOM.getActiveFiles();\n const query = '?files';\n const path = Info.dirPath;\n if (noFilesCheck()) return;\n showLoad();\n const removedNames = DOM.getFilenames(files);\n const names = DOM.CurrentInfo.files.map(DOM.getCurrentName);\n const currentName = DOM.getCurrentName();\n const nextCurrentName = getNextCurrentName(currentName, names, removedNames);\n deleteFn(path + query, removedNames, async () => {\n await CloudCmd.refresh();\n const names = Info.files.map(DOM.getCurrentName);\n const isCurrent = names.includes(currentName);\n const name = isCurrent ? currentName : nextCurrentName;\n DOM.setCurrentByName(name);\n });\n}\n/*\n * process files (copy or move)\n * @param data\n * @param operation\n */\n\n\nasync function _processFiles(options, data) {\n let selFiles;\n let files;\n let panel;\n let shouldAsk;\n let ok;\n let from = '';\n let to = '';\n let names = [];\n /* eslint no-multi-spaces: 0 */\n\n if (data) {\n from = data.from;\n to = data.to;\n names = data.names;\n panel = Info.panel;\n } else {\n from = Info.dirPath;\n to = DOM.getNotCurrentDirPath();\n selFiles = DOM.getSelectedFiles();\n names = DOM.getFilenames(selFiles);\n data = {};\n shouldAsk = true;\n panel = Info.panelPassive;\n }\n\n if (!names.length) names.push(DOM.getCurrentName());\n const [name] = names;\n const sameName = DOM.getCurrentByName(name, panel);\n if (!data && noFilesCheck()) return;\n const {\n type\n } = options;\n const isCopy = type === 'copy';\n const option = isCopy ? 'confirmCopy' : 'confirmMove';\n const title = isCopy ? 'Copy' : 'Rename/Move';\n const operation = isCopy ? copyFn : moveFn;\n\n if (shouldAsk && config(option)) {\n const [cancel, newTo] = prompt(title, to, names.map(encode));\n if (!cancel) ask(newTo);\n return;\n }\n\n ask(to);\n\n function ask(to) {\n ok = from !== to && to;\n if (ok && !shouldAsk || !sameName) return go();\n const str = `\"${name}\" already exist. Overwrite?`;\n const cancel = false;\n Dialog.confirm(str, {\n cancel\n }).then(go);\n\n function go() {\n showLoad();\n files = {\n from,\n to,\n names\n };\n operation(files, async () => {\n await DOM.Storage.remove(from);\n const {\n panel,\n panelPassive\n } = Info;\n\n const setCurrent = () => {\n const currentName = name || data.names[0];\n DOM.setCurrentByName(currentName);\n };\n\n if (!Info.isOnePanel) CloudCmd.refresh({\n panel: panelPassive,\n noCurrent: true\n });\n CloudCmd.refresh({\n panel\n }, setCurrent);\n });\n }\n }\n}\n\nfunction checkEmpty(name, operation) {\n if (!operation) throw Error(name + ' could not be empty!');\n}\n\nfunction twopack(operation, type) {\n let op;\n let fileFrom;\n let currentName = Info.name;\n const {\n path,\n dirPath\n } = Info;\n const activeFiles = DOM.getActiveFiles();\n const names = DOM.getFilenames(activeFiles);\n checkEmpty('operation', operation);\n if (!names.length) return Dialog.alert.noFiles();\n\n switch (operation) {\n case 'extract':\n op = extractFn;\n fileFrom = {\n from: path,\n to: dirPath\n };\n currentName = removeExtension(currentName);\n break;\n\n case 'pack':\n op = getPacker(type);\n if (names.length > 1) currentName = Info.dir;\n currentName += DOM.getPackerExt(type);\n fileFrom = {\n from: dirPath,\n to: dirPath + currentName,\n names\n };\n break;\n }\n\n showLoad();\n op(fileFrom, error => {\n !error && CloudCmd.refresh({\n currentName\n });\n });\n}\n\nfunction prompt(msg, to, names) {\n const n = names.length;\n const [name] = names;\n msg += ' ';\n if (names.length > 1) msg += n + ' file(s)';else msg += '\"' + name + '\"';\n msg += ' to';\n return Dialog.prompt(msg, to);\n}\n\nasync function loadAll() {\n const {\n prefix\n } = CloudCmd;\n const file = `${prefix}/fileop/fileop.js`;\n const [error] = await tryToCatch(load.js, file);\n if (error) Dialog.alert(error.message);\n Loaded = true;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/operation/index.js");
|
|
190
|
+
eval("/* global CloudCmd */\n\n/* global Util */\n\n/* global DOM */\n\n/* global fileop */\n\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\n\nconst removeExtension = __webpack_require__(/*! ./remove-extension */ \"./client/modules/operation/remove-extension.js\");\n\nconst setListeners = __webpack_require__(/*! ./set-listeners */ \"./client/modules/operation/set-listeners.js\");\n\nconst getNextCurrentName = __webpack_require__(/*! ./get-next-current-name */ \"./client/modules/operation/get-next-current-name.js\");\n\nconst removeQuery = a => a.replace(/\\?.*/, '');\n\nconst Name = 'Operation';\nCloudCmd[Name] = exports;\nconst {\n config\n} = CloudCmd;\nconst {\n Dialog,\n Images\n} = DOM;\nconst authCheck = wraptile(_authCheck);\nconst Operation = {};\nlet Loaded;\nlet copyFn;\nlet moveFn;\nlet deleteFn;\nlet extractFn;\nlet packZipFn;\nlet packTarFn;\nconst Info = DOM.CurrentInfo;\nconst showLoad = Images.show.load.bind(null, 'top');\nconst processFiles = currify(_processFiles);\n\nconst noFilesCheck = () => {\n const {\n length\n } = DOM.getActiveFiles();\n const is = Boolean(!length);\n if (is) return Dialog.alert.noFiles();\n return is;\n};\n\nmodule.exports.init = promisify(callback => {\n showLoad();\n exec.series([DOM.loadSocket, async callback => {\n if (config('dropbox')) return callback();\n const {\n prefix,\n prefixSocket\n } = CloudCmd;\n await loadAll();\n await initOperations(prefix, prefixSocket, callback);\n }, callback => {\n Loaded = true;\n Images.hide();\n callback();\n }], callback);\n});\n\nfunction _authCheck(spawn, ok) {\n const accept = wraptile(ok);\n const alertDialog = wraptile(Dialog.alert);\n spawn.on('accept', accept(spawn));\n spawn.on('reject', alertDialog('Wrong credentials!'));\n spawn.emit('auth', config('username'), config('password'));\n}\n\nconst onConnect = currify((fn, operator) => {\n setOperations(operator);\n fn();\n});\n\nasync function initOperations(prefix, socketPrefix, fn) {\n socketPrefix = `${socketPrefix}/fileop`;\n const operator = await fileop({\n prefix,\n socketPrefix\n });\n operator.on('connect', authCheck(operator, onConnect(fn)));\n}\n\nfunction setOperations(operator) {\n packTarFn = (_ref, callback) => {\n let {\n from,\n to,\n names\n } = _ref;\n const operation = 'Tar';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.tar(from, to, names).then(listen);\n };\n\n packZipFn = (_ref2, callback) => {\n let {\n from,\n to,\n names\n } = _ref2;\n const operation = 'Zip';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.zip(from, to, names).then(listen);\n };\n\n deleteFn = (from, files, callback) => {\n from = removeQuery(from);\n const operation = 'Delete';\n const listen = setListeners({\n operation,\n callback,\n from\n });\n operator.remove(from, files).then(listen);\n };\n\n copyFn = (_ref3, callback) => {\n let {\n from,\n to,\n names\n } = _ref3;\n const operation = 'Copy';\n const listen = setListeners({\n operation,\n callback,\n from,\n to,\n names\n });\n operator.copy(from, to, names).then(listen);\n };\n\n moveFn = (_ref4, callback) => {\n let {\n from,\n to,\n names\n } = _ref4;\n const operation = 'Move';\n const listen = setListeners({\n operation,\n callback,\n from,\n to\n });\n operator.move(from, to, names).then(listen);\n };\n\n extractFn = (_ref5, callback) => {\n let {\n from,\n to\n } = _ref5;\n const operation = 'Extract';\n const listen = setListeners({\n operation,\n callback,\n noContinue: true,\n from,\n to\n });\n operator.extract(from, to).then(listen);\n };\n}\n\nfunction getPacker(type) {\n if (type === 'zip') return packZipFn;\n return packTarFn;\n}\n\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\n\nmodule.exports.show = (operation, data) => {\n if (!Loaded) return;\n if (operation === 'copy') return Operation.copy(data);\n if (operation === 'move') return Operation.move(data);\n if (operation === 'delete') return Operation.delete();\n if (operation === 'delete:silent') return Operation.deleteSilent();\n if (operation === 'pack') return Operation.pack();\n if (operation === 'extract') return Operation.extract();\n};\n\nOperation.copy = processFiles({\n type: 'copy'\n});\nOperation.move = processFiles({\n type: 'move'\n});\nOperation.delete = promptDelete;\nOperation.deleteSilent = deleteSilent;\n\nOperation.pack = () => {\n const isZip = config('packer') === 'zip';\n twopack('pack', isZip ? 'zip' : 'tar');\n};\n\nOperation.extract = () => {\n twopack('extract');\n};\n/**\n * prompt and delete current file or selected files\n *\n * @currentFile\n */\n\n\nasync function promptDelete() {\n if (noFilesCheck()) return;\n const msgAsk = 'Do you really want to delete the ';\n const msgSel = 'selected ';\n const files = DOM.getActiveFiles();\n const names = DOM.getFilenames(files);\n const n = names.length;\n let msg;\n\n if (n) {\n let name = '';\n\n for (let i = 0; i < 5 && i < n; i++) name += '\\n' + names[i];\n\n if (n >= 5) name += '\\n...';\n msg = msgAsk + msgSel + n + ' files/directories?\\n' + encode(name);\n } else {\n const current = DOM.getCurrentFile();\n const isDir = DOM.isCurrentIsDir(current);\n\n const getType = isDir => isDir ? 'directory' : 'file';\n\n const type = getType(isDir) + ' ';\n const name = DOM.getCurrentName(current);\n msg = msgAsk + msgSel + type + name + '?';\n }\n\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n deleteSilent(files);\n}\n/**\n * delete current or selected files\n *\n * @files\n */\n\n\nfunction deleteSilent() {\n let files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DOM.getActiveFiles();\n const query = '?files';\n const path = Info.dirPath;\n if (noFilesCheck()) return;\n showLoad();\n const removedNames = DOM.getFilenames(files);\n const names = DOM.CurrentInfo.files.map(DOM.getCurrentName);\n const currentName = DOM.getCurrentName();\n const nextCurrentName = getNextCurrentName(currentName, names, removedNames);\n deleteFn(path + query, removedNames, async () => {\n await CloudCmd.refresh();\n const names = Info.files.map(DOM.getCurrentName);\n const isCurrent = names.includes(currentName);\n const name = isCurrent ? currentName : nextCurrentName;\n DOM.setCurrentByName(name);\n });\n}\n/*\n * process files (copy or move)\n * @param data\n * @param operation\n */\n\n\nasync function _processFiles(options, data) {\n let selFiles;\n let files;\n let panel;\n let shouldAsk;\n let ok;\n let from = '';\n let to = '';\n let names = [];\n /* eslint no-multi-spaces: 0 */\n\n if (data) {\n from = data.from;\n to = data.to;\n names = data.names;\n panel = Info.panel;\n } else {\n from = Info.dirPath;\n to = DOM.getNotCurrentDirPath();\n selFiles = DOM.getSelectedFiles();\n names = DOM.getFilenames(selFiles);\n data = {};\n shouldAsk = true;\n panel = Info.panelPassive;\n }\n\n if (!names.length) names.push(DOM.getCurrentName());\n const [name] = names;\n const sameName = DOM.getCurrentByName(name, panel);\n if (!data && noFilesCheck()) return;\n const {\n type\n } = options;\n const isCopy = type === 'copy';\n const option = isCopy ? 'confirmCopy' : 'confirmMove';\n const title = isCopy ? 'Copy' : 'Rename/Move';\n const operation = isCopy ? copyFn : moveFn;\n\n if (shouldAsk && config(option)) {\n const [cancel, newTo] = await prompt(title, to, names.map(encode));\n if (!cancel) ask(newTo);\n return;\n }\n\n ask(to);\n\n function ask(to) {\n ok = from !== to && to;\n if (ok && !shouldAsk || !sameName) return go();\n const str = `\"${name}\" already exist. Overwrite?`;\n const cancel = false;\n Dialog.confirm(str, {\n cancel\n }).then(go);\n\n function go() {\n showLoad();\n files = {\n from,\n to,\n names\n };\n operation(files, async () => {\n await DOM.Storage.remove(from);\n const {\n panel,\n panelPassive\n } = Info;\n\n const setCurrent = () => {\n const currentName = name || data.names[0];\n DOM.setCurrentByName(currentName);\n };\n\n if (!Info.isOnePanel) CloudCmd.refresh({\n panel: panelPassive,\n noCurrent: true\n });\n CloudCmd.refresh({\n panel\n }, setCurrent);\n });\n }\n }\n}\n\nfunction checkEmpty(name, operation) {\n if (!operation) throw Error(name + ' could not be empty!');\n}\n\nfunction twopack(operation, type) {\n let op;\n let fileFrom;\n let currentName = Info.name;\n const {\n path,\n dirPath\n } = Info;\n const activeFiles = DOM.getActiveFiles();\n const names = DOM.getFilenames(activeFiles);\n checkEmpty('operation', operation);\n if (!names.length) return Dialog.alert.noFiles();\n\n switch (operation) {\n case 'extract':\n op = extractFn;\n fileFrom = {\n from: path,\n to: dirPath\n };\n currentName = removeExtension(currentName);\n break;\n\n case 'pack':\n op = getPacker(type);\n if (names.length > 1) currentName = Info.dir;\n currentName += DOM.getPackerExt(type);\n fileFrom = {\n from: dirPath,\n to: dirPath + currentName,\n names\n };\n break;\n }\n\n showLoad();\n op(fileFrom, error => {\n !error && CloudCmd.refresh({\n currentName\n });\n });\n}\n\nasync function prompt(msg, to, names) {\n const n = names.length;\n const [name] = names;\n msg += ' ';\n if (names.length > 1) msg += n + ' file(s)';else msg += '\"' + name + '\"';\n msg += ' to';\n return await Dialog.prompt(msg, to);\n}\n\nasync function loadAll() {\n const {\n prefix\n } = CloudCmd;\n const file = `${prefix}/fileop/fileop.js`;\n const [error] = await tryToCatch(load.js, file);\n if (error) Dialog.alert(error.message);\n Loaded = true;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/operation/index.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\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isDev = \"development\" === 'development';\n\nconst isGet = a => a.method === 'GET';\n\nconst isBasic = a => a.type === 'basic';\n\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 (/\\/$/.test(url) || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (/^\\/api/.test(pathname)) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\n\nconst getPathName = url => new URL(url).pathname;\n\nconst date = \"
|
|
104
|
+
eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst isDev = \"development\" === 'development';\n\nconst isGet = a => a.method === 'GET';\n\nconst isBasic = a => a.type === 'basic';\n\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 (/\\/$/.test(url) || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (/^\\/api/.test(pathname)) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\n\nconst getPathName = url => new URL(url).pathname;\n\nconst date = \"Thu Dec 23 2021 12:10:53 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\n\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\n\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\n\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\n\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}\n\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\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}\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/dist-dev/view.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcmd",
|
|
3
|
-
"version": "15.9.
|
|
3
|
+
"version": "15.9.13",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
5
|
"description": "File manager for the web with console and editor",
|
|
6
6
|
"homepage": "http://cloudcmd.io",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"package-json": "^7.0.0",
|
|
121
121
|
"ponse": "^6.0.0",
|
|
122
122
|
"pullout": "^4.0.0",
|
|
123
|
-
"putout": "^
|
|
123
|
+
"putout": "^23.0.0",
|
|
124
124
|
"redzip": "^2.0.0",
|
|
125
125
|
"rendy": "^3.0.0",
|
|
126
126
|
"restafary": "^10.0.0",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"emitify": "^4.0.1",
|
|
165
165
|
"eslint": "^8.0.1",
|
|
166
166
|
"eslint-plugin-node": "^11.0.0",
|
|
167
|
-
"eslint-plugin-putout": "^
|
|
167
|
+
"eslint-plugin-putout": "^12.2.0",
|
|
168
168
|
"extract-text-webpack-plugin": "^4.0.0-alpha.0",
|
|
169
169
|
"gritty": "^6.0.0",
|
|
170
170
|
"gunzip-maybe": "^1.3.1",
|