cloudcmd 16.6.0 → 16.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/ChangeLog +15 -0
  2. package/HELP.md +3 -1
  3. package/README.md +1 -1
  4. package/dist/cloudcmd.common.css +1 -1
  5. package/dist/cloudcmd.common.js +1 -1
  6. package/dist/cloudcmd.common.js.map +1 -1
  7. package/dist/cloudcmd.js.map +1 -1
  8. package/dist/modules/cloud.js.map +1 -1
  9. package/dist/modules/command-line.js.map +1 -1
  10. package/dist/modules/config.js.map +1 -1
  11. package/dist/modules/contact.js.map +1 -1
  12. package/dist/modules/edit-file-vim.js.map +1 -1
  13. package/dist/modules/edit-file.js.map +1 -1
  14. package/dist/modules/edit-names-vim.js.map +1 -1
  15. package/dist/modules/edit-names.js.map +1 -1
  16. package/dist/modules/edit.js.map +1 -1
  17. package/dist/modules/help.js.map +1 -1
  18. package/dist/modules/konsole.js.map +1 -1
  19. package/dist/modules/markdown.js.map +1 -1
  20. package/dist/modules/menu.js.map +1 -1
  21. package/dist/modules/operation.js.map +1 -1
  22. package/dist/modules/polyfill.js.map +1 -1
  23. package/dist/modules/terminal-run.js.map +1 -1
  24. package/dist/modules/terminal.js.map +1 -1
  25. package/dist/modules/upload.js.map +1 -1
  26. package/dist/modules/user-menu.js.map +1 -1
  27. package/dist/modules/view.js.map +1 -1
  28. package/dist/sw.js +1 -1
  29. package/dist/sw.js.map +1 -1
  30. package/dist/user-menu.css +1 -1
  31. package/dist-dev/cloudcmd.common.css +3 -4
  32. package/dist-dev/cloudcmd.common.js +35 -35
  33. package/dist-dev/cloudcmd.js +13 -13
  34. package/dist-dev/modules/cloud.js +1 -1
  35. package/dist-dev/modules/command-line.js +1 -1
  36. package/dist-dev/modules/config.js +2 -2
  37. package/dist-dev/modules/contact.js +1 -1
  38. package/dist-dev/modules/edit-file-vim.js +1 -1
  39. package/dist-dev/modules/edit-file.js +1 -1
  40. package/dist-dev/modules/edit-names-vim.js +1 -1
  41. package/dist-dev/modules/edit-names.js +1 -1
  42. package/dist-dev/modules/edit.js +1 -1
  43. package/dist-dev/modules/help.js +1 -1
  44. package/dist-dev/modules/konsole.js +1 -1
  45. package/dist-dev/modules/markdown.js +1 -1
  46. package/dist-dev/modules/menu.js +1 -1
  47. package/dist-dev/modules/operation.js +4 -4
  48. package/dist-dev/modules/polyfill.js +1 -1
  49. package/dist-dev/modules/terminal-run.js +1 -1
  50. package/dist-dev/modules/terminal.js +1 -1
  51. package/dist-dev/modules/upload.js +1 -1
  52. package/dist-dev/modules/user-menu.js +4 -4
  53. package/dist-dev/modules/view.js +2 -2
  54. package/dist-dev/sw.js +1 -1
  55. package/dist-dev/user-menu.css +1 -0
  56. package/package.json +7 -8
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n/* global CloudCmd */\n\n/* global Util */\n\n/* global DOM */\n\n/* global Console */\n\nCloudCmd.Konsole = exports;\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.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 loadJS = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\").js;\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\n\nconst {\n Dialog,\n CurrentInfo: Info\n} = DOM;\n\nconst rmLastSlash = a => a.replace(/\\/$/, '') || '/';\n\nlet konsole;\nconst {\n config\n} = CloudCmd;\nconst cd = currify((fn, dir) => fn(`cd ${rmLastSlash(dir)}`));\nconst Name = 'Konsole';\nlet Element;\nlet Loaded;\n\nmodule.exports.init = async () => {\n if (!config('console')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await load();\n await create();\n};\n\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\n\nmodule.exports.clear = () => {\n konsole.clear();\n};\n\nfunction getPrefix() {\n return CloudCmd.prefix + '/console';\n}\n\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/console';\n}\n\nfunction getEnv() {\n return {\n ACTIVE_DIR: DOM.getCurrentDirPath.bind(DOM),\n PASSIVE_DIR: DOM.getNotCurrentDirPath.bind(DOM),\n CURRENT_NAME: DOM.getCurrentName.bind(DOM),\n CURRENT_PATH: () => Info.path\n };\n}\n\nasync function onPath(path) {\n if (Info.dirPath === path) return;\n await CloudCmd.loadDir({\n path\n });\n}\n\nconst getDirPath = () => {\n if (config('syncConsolePath')) return Info.dirPath;\n};\n\nconst create = async () => {\n const options = {\n cwd: getDirPath(),\n env: getEnv(),\n prefix: getPrefix(),\n prefixSocket: getPrefixSocket(),\n socketPath: CloudCmd.prefix\n };\n Element = createElement('div', {\n className: 'console'\n });\n konsole = await Console(Element, options);\n konsole.on('connect', exec.with(authCheck, konsole));\n konsole.on('path', config.if('syncConsolePath', onPath));\n CloudCmd.on('active-dir', config.if('syncConsolePath', cd(konsole.handler)));\n konsole.addShortCuts({\n P: () => {\n const command = konsole.getPromptText();\n const path = DOM.getCurrentDirPath();\n konsole.setPromptText(command + path);\n }\n });\n};\n\nfunction authCheck(konsole) {\n konsole.emit('auth', config('username'), config('password'));\n konsole.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\n\nmodule.exports.show = callback => {\n if (!Loaded) return;\n if (!config('console')) return;\n CloudCmd.View.show(Element, {\n afterShow: () => {\n konsole.focus();\n exec(callback);\n }\n });\n};\n\nconst load = async () => {\n Util.time(Name + ' load');\n const prefix = getPrefix();\n const url = prefix + '/console.js';\n const [error] = await tryToCatch(loadJS, url);\n Loaded = true;\n Util.timeEnd(Name + ' load');\n if (error) return Dialog.alert(error.message, {\n cancel: false\n });\n};\n\n//# sourceURL=file://cloudcmd/client/modules/konsole.js");
166
+ eval("\n\n/* global CloudCmd */\n/* global Util */\n/* global DOM */\n/* global Console */\nCloudCmd.Konsole = exports;\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst loadJS = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\").js;\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Dialog,\n CurrentInfo: Info\n} = DOM;\nconst rmLastSlash = a => a.replace(/\\/$/, '') || '/';\nlet konsole;\nconst {\n config\n} = CloudCmd;\nconst cd = currify((fn, dir) => fn(`cd ${rmLastSlash(dir)}`));\nconst Name = 'Konsole';\nlet Element;\nlet Loaded;\nmodule.exports.init = async () => {\n if (!config('console')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await load();\n await create();\n};\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\nmodule.exports.clear = () => {\n konsole.clear();\n};\nfunction getPrefix() {\n return CloudCmd.prefix + '/console';\n}\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/console';\n}\nfunction getEnv() {\n return {\n ACTIVE_DIR: DOM.getCurrentDirPath.bind(DOM),\n PASSIVE_DIR: DOM.getNotCurrentDirPath.bind(DOM),\n CURRENT_NAME: DOM.getCurrentName.bind(DOM),\n CURRENT_PATH: () => Info.path\n };\n}\nasync function onPath(path) {\n if (Info.dirPath === path) return;\n await CloudCmd.loadDir({\n path\n });\n}\nconst getDirPath = () => {\n if (config('syncConsolePath')) return Info.dirPath;\n};\nconst create = async () => {\n const options = {\n cwd: getDirPath(),\n env: getEnv(),\n prefix: getPrefix(),\n prefixSocket: getPrefixSocket(),\n socketPath: CloudCmd.prefix\n };\n Element = createElement('div', {\n className: 'console'\n });\n konsole = await Console(Element, options);\n konsole.on('connect', exec.with(authCheck, konsole));\n konsole.on('path', config.if('syncConsolePath', onPath));\n CloudCmd.on('active-dir', config.if('syncConsolePath', cd(konsole.handler)));\n konsole.addShortCuts({\n P: () => {\n const command = konsole.getPromptText();\n const path = DOM.getCurrentDirPath();\n konsole.setPromptText(command + path);\n }\n });\n};\nfunction authCheck(konsole) {\n konsole.emit('auth', config('username'), config('password'));\n konsole.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nmodule.exports.show = callback => {\n if (!Loaded) return;\n if (!config('console')) return;\n CloudCmd.View.show(Element, {\n afterShow: () => {\n konsole.focus();\n exec(callback);\n }\n });\n};\nconst load = async () => {\n Util.time(Name + ' load');\n const prefix = getPrefix();\n const url = prefix + '/console.js';\n const [error] = await tryToCatch(loadJS, url);\n Loaded = true;\n Util.timeEnd(Name + ' load');\n if (error) return Dialog.alert(error.message, {\n cancel: false\n });\n};\n\n//# sourceURL=file://cloudcmd/client/modules/konsole.js");
167
167
 
168
168
  /***/ })
169
169
 
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n/* global CloudCmd */\n\nCloudCmd.Markdown = exports;\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\n\nconst {\n Markdown\n} = __webpack_require__(/*! ../dom/rest */ \"./client/dom/rest.js\");\n\nconst {\n alert\n} = __webpack_require__(/*! ../dom/dialog */ \"./client/dom/dialog.js\");\n\nmodule.exports.init = async () => {\n Images.show.load('top');\n await CloudCmd.View();\n};\n\nmodule.exports.show = show;\n\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\n\nasync function show(name) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const {\n positionLoad,\n relative\n } = options;\n Images.show.load(positionLoad);\n if (relative) name += '?relative';\n const [error, innerHTML] = await Markdown.read(name);\n Images.hide();\n if (error) return alert(error.message, {\n cancel: false\n });\n const className = 'help';\n const div = createElement('div', {\n className,\n innerHTML\n });\n CloudCmd.View.show(div);\n}\n\n//# sourceURL=file://cloudcmd/client/modules/markdown.js");
166
+ eval("\n\n/* global CloudCmd */\nCloudCmd.Markdown = exports;\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Markdown\n} = __webpack_require__(/*! ../dom/rest */ \"./client/dom/rest.js\");\nconst {\n alert\n} = __webpack_require__(/*! ../dom/dialog */ \"./client/dom/dialog.js\");\nmodule.exports.init = async () => {\n Images.show.load('top');\n await CloudCmd.View();\n};\nmodule.exports.show = show;\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\n};\nasync function show(name) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const {\n positionLoad,\n relative\n } = options;\n Images.show.load(positionLoad);\n if (relative) name += '?relative';\n const [error, innerHTML] = await Markdown.read(name);\n Images.hide();\n if (error) return alert(error.message, {\n cancel: false\n });\n const className = 'help';\n const div = createElement('div', {\n className,\n innerHTML\n });\n CloudCmd.View.show(div);\n}\n\n//# sourceURL=file://cloudcmd/client/modules/markdown.js");
167
167
 
168
168
  /***/ })
169
169
 
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("/* global CloudCmd, DOM */\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\n\nconst wrap = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst {\n getIdBySrc\n} = __webpack_require__(/*! ../dom/load */ \"./client/dom/load.js\");\n\nconst RESTful = __webpack_require__(/*! ../dom/rest */ \"./client/dom/rest.js\");\n\nconst {\n config,\n Key\n} = CloudCmd;\nconst {\n Buffer,\n Events,\n Dialog,\n Images\n} = DOM;\nconst Info = DOM.CurrentInfo;\nconst alertNoFiles = Dialog.alert.noFiles;\nconst uploadTo = wrap(_uploadTo);\nlet MenuShowedName;\nlet MenuContext;\nlet MenuContextFile;\nmodule.exports.ENABLED = false;\nCloudCmd.Menu = exports;\n\nmodule.exports.init = () => {\n const {\n isAuth,\n menuDataFile\n } = getFileMenuData();\n const fm = DOM.getFM();\n const menuData = getMenuData(isAuth);\n const options = getOptions({\n type: 'context'\n });\n const optionsFile = getOptions({\n type: 'file'\n });\n MenuContext = supermenu(fm, options, menuData);\n MenuContextFile = supermenu(fm, optionsFile, menuDataFile);\n MenuContext.addContextMenuListener();\n MenuContextFile.addContextMenuListener();\n Events.addKey(listener);\n};\n\nmodule.exports.hide = hide;\n\nfunction hide() {\n MenuContext.hide();\n MenuContextFile.hide();\n}\n\nmodule.exports.show = position => {\n const {\n x,\n y\n } = getPosition(position);\n MenuContext.show(x, y);\n MenuContextFile.show(x, y);\n Images.hide();\n};\n\nfunction getPosition(position) {\n if (position) return {\n x: position.x,\n y: position.y\n };\n return getCurrentPosition();\n}\n\nfunction getMenuNameByEl(el) {\n if (!el) return 'context';\n const name = DOM.getCurrentName(el);\n if (name === '..') return 'context';\n return 'contextFile';\n}\n\nfunction getOptions(_ref) {\n let {\n type\n } = _ref;\n let name;\n let func;\n\n if (type === 'context') {\n name = 'context';\n func = Key.unsetBind;\n } else if (type === 'file') {\n name = 'contextFile';\n }\n\n const options = {\n icon: true,\n beforeClose: Key.setBind,\n beforeShow: exec.with(beforeShow, func),\n beforeClick,\n name\n };\n return options;\n}\n\nfunction getMenuData(isAuth) {\n const menu = {\n 'Paste': Buffer.paste,\n 'New': {\n File: DOM.promptNewFile,\n Directory: DOM.promptNewDir\n },\n 'Upload': () => {\n CloudCmd.Upload.show();\n },\n 'Upload From Cloud': uploadFromCloud,\n '(Un)Select All': DOM.toggleAllSelectedFiles\n };\n if (isAuth) menu['Log Out'] = CloudCmd.logOut;\n return menu;\n}\n\nfunction getFileMenuData() {\n const isAuth = CloudCmd.config('auth');\n const menuBottom = getMenuData(isAuth);\n const menuTop = {\n 'View': () => {\n CloudCmd.View.show();\n },\n 'Edit': () => {\n const name = config('vim') ? 'EditFileVim' : 'EditFile';\n CloudCmd[name].show();\n },\n 'Rename': () => {\n setTimeout(DOM.renameCurrent, 100);\n },\n 'Delete': () => {\n CloudCmd.Operation.show('delete');\n },\n 'Pack': () => {\n CloudCmd.Operation.show('pack');\n },\n 'Extract': () => {\n CloudCmd.Operation.show('extract');\n },\n 'Download': preDownload,\n 'Upload To Cloud': uploadTo('Cloud'),\n 'Cut': () => {\n isCurrent(Buffer.cut, alertNoFiles);\n },\n 'Copy': () => {\n isCurrent(Buffer.copy, alertNoFiles);\n }\n };\n const menuDataFile = { ...menuTop,\n ...menuBottom\n };\n return {\n isAuth,\n menuDataFile\n };\n}\n\nfunction isCurrent(yesFn, noFn) {\n if (Info.name !== '..') return yesFn();\n noFn();\n}\n\nfunction isPath(x, y) {\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return false;\n const el = document.elementFromPoint(x, y);\n const elements = panel.querySelectorAll('[data-name=\"js-path\"] *');\n const is = ~[].indexOf.call(elements, el);\n return is;\n}\n\nfunction beforeShow(callback, params) {\n const {\n name\n } = params;\n const el = DOM.getCurrentByPosition({\n x: params.x,\n y: params.y\n });\n const menuName = getMenuNameByEl(el);\n let isShow = menuName !== 'contextFile';\n if (params.name === 'contextFile') isShow = !isShow;\n if (isShow) MenuShowedName = name;\n exec(callback);\n if (isShow) isShow = isPath(params.x, params.y);\n return isShow;\n}\n\nfunction beforeClick(name) {\n return MenuShowedName !== name;\n}\n\nasync function _uploadTo(nameModule) {\n const [error, data] = await Info.getData();\n if (error) return;\n const {\n name\n } = Info;\n CloudCmd.execFromModule(nameModule, 'uploadFile', name, data);\n CloudCmd.log('Uploading to ' + name + '...');\n}\n\nfunction uploadFromCloud() {\n Images.show.load('top');\n CloudCmd.execFromModule('Cloud', 'saveFile', async (currentName, data) => {\n const path = DOM.getCurrentDirPath() + currentName;\n const [e] = await RESTful.write(path, data);\n if (e) return;\n await CloudCmd.refresh({\n currentName\n });\n });\n}\n\nfunction preDownload() {\n download(config('packer'));\n}\n\nfunction download(type) {\n const TIME = 30 * 1000;\n const {\n prefixURL\n } = CloudCmd;\n const PACK = '/pack';\n const date = Date.now();\n const files = DOM.getActiveFiles();\n if (!files.length) return alertNoFiles();\n\n for (const file of files) {\n const selected = DOM.isSelected(file);\n const isDir = DOM.isCurrentIsDir(file);\n const path = DOM.getCurrentPath(file);\n CloudCmd.log('downloading file ' + path + '...');\n /*\n * if we send ajax request -\n * no need in hash so we escape #\n * and all other characters, like \"%\"\n */\n\n const encodedPath = encodeURI(path).replace(/#/g, '%23');\n const id = getIdBySrc(path);\n let src;\n if (isDir) src = prefixURL + PACK + encodedPath + DOM.getPackerExt(type);else src = prefixURL + FS + encodedPath + '?download';\n const element = createElement('iframe', {\n id: id + '-' + date,\n async: false,\n className: 'hidden',\n src\n });\n const {\n body\n } = document;\n const removeChild = body.removeChild.bind(body, element);\n setTimeout(removeChild, TIME);\n if (selected) DOM.toggleSelectedFile(file);\n }\n}\n\nfunction getCurrentPosition() {\n const current = Info.element;\n const rect = current.getBoundingClientRect();\n const position = {\n x: Math.round(rect.left + rect.width / 3),\n y: Math.round(rect.top)\n };\n return position;\n}\n\nfunction listener(event) {\n const {\n F9,\n ESC\n } = Key;\n const key = event.keyCode;\n const isBind = Key.isBind();\n if (!isBind) return;\n if (key === ESC) return hide();\n\n if (key === F9) {\n const position = getCurrentPosition();\n MenuContext.show(position.x, position.y);\n event.preventDefault();\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/menu.js");
166
+ eval("/* global CloudCmd, DOM */\n\n\n\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst wrap = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst supermenu = __webpack_require__(/*! supermenu */ \"./node_modules/supermenu/lib/supermenu.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n getIdBySrc\n} = __webpack_require__(/*! ../dom/load */ \"./client/dom/load.js\");\nconst RESTful = __webpack_require__(/*! ../dom/rest */ \"./client/dom/rest.js\");\nconst {\n config,\n Key\n} = CloudCmd;\nconst {\n Buffer,\n Events,\n Dialog,\n Images\n} = DOM;\nconst Info = DOM.CurrentInfo;\nconst alertNoFiles = Dialog.alert.noFiles;\nconst uploadTo = wrap(_uploadTo);\nlet MenuShowedName;\nlet MenuContext;\nlet MenuContextFile;\nmodule.exports.ENABLED = false;\nCloudCmd.Menu = exports;\nmodule.exports.init = () => {\n const {\n isAuth,\n menuDataFile\n } = getFileMenuData();\n const fm = DOM.getFM();\n const menuData = getMenuData(isAuth);\n const options = getOptions({\n type: 'context'\n });\n const optionsFile = getOptions({\n type: 'file'\n });\n MenuContext = supermenu(fm, options, menuData);\n MenuContextFile = supermenu(fm, optionsFile, menuDataFile);\n MenuContext.addContextMenuListener();\n MenuContextFile.addContextMenuListener();\n Events.addKey(listener);\n};\nmodule.exports.hide = hide;\nfunction hide() {\n MenuContext.hide();\n MenuContextFile.hide();\n}\nmodule.exports.show = position => {\n const {\n x,\n y\n } = getPosition(position);\n MenuContext.show(x, y);\n MenuContextFile.show(x, y);\n Images.hide();\n};\nfunction getPosition(position) {\n if (position) return {\n x: position.x,\n y: position.y\n };\n return getCurrentPosition();\n}\nfunction getMenuNameByEl(el) {\n if (!el) return 'context';\n const name = DOM.getCurrentName(el);\n if (name === '..') return 'context';\n return 'contextFile';\n}\nfunction getOptions(_ref) {\n let {\n type\n } = _ref;\n let name;\n let func;\n if (type === 'context') {\n name = 'context';\n func = Key.unsetBind;\n } else if (type === 'file') {\n name = 'contextFile';\n }\n const options = {\n icon: true,\n beforeClose: Key.setBind,\n beforeShow: exec.with(beforeShow, func),\n beforeClick,\n name\n };\n return options;\n}\nfunction getMenuData(isAuth) {\n const menu = {\n 'Paste': Buffer.paste,\n 'New': {\n File: DOM.promptNewFile,\n Directory: DOM.promptNewDir\n },\n 'Upload': () => {\n CloudCmd.Upload.show();\n },\n 'Upload From Cloud': uploadFromCloud,\n '(Un)Select All': DOM.toggleAllSelectedFiles\n };\n if (isAuth) menu['Log Out'] = CloudCmd.logOut;\n return menu;\n}\nfunction getFileMenuData() {\n const isAuth = CloudCmd.config('auth');\n const menuBottom = getMenuData(isAuth);\n const menuTop = {\n 'View': () => {\n CloudCmd.View.show();\n },\n 'Edit': () => {\n const name = config('vim') ? 'EditFileVim' : 'EditFile';\n CloudCmd[name].show();\n },\n 'Rename': () => {\n setTimeout(DOM.renameCurrent, 100);\n },\n 'Delete': () => {\n CloudCmd.Operation.show('delete');\n },\n 'Pack': () => {\n CloudCmd.Operation.show('pack');\n },\n 'Extract': () => {\n CloudCmd.Operation.show('extract');\n },\n 'Download': preDownload,\n 'Upload To Cloud': uploadTo('Cloud'),\n 'Cut': () => {\n isCurrent(Buffer.cut, alertNoFiles);\n },\n 'Copy': () => {\n isCurrent(Buffer.copy, alertNoFiles);\n }\n };\n const menuDataFile = {\n ...menuTop,\n ...menuBottom\n };\n return {\n isAuth,\n menuDataFile\n };\n}\nfunction isCurrent(yesFn, noFn) {\n if (Info.name !== '..') return yesFn();\n noFn();\n}\nfunction isPath(x, y) {\n const {\n panel\n } = Info;\n const isEmptyRoot = !panel;\n if (isEmptyRoot) return false;\n const el = document.elementFromPoint(x, y);\n const elements = panel.querySelectorAll('[data-name=\"js-path\"] *');\n const is = ~[].indexOf.call(elements, el);\n return is;\n}\nfunction beforeShow(callback, params) {\n const {\n name\n } = params;\n const el = DOM.getCurrentByPosition({\n x: params.x,\n y: params.y\n });\n const menuName = getMenuNameByEl(el);\n let isShow = menuName !== 'contextFile';\n if (params.name === 'contextFile') isShow = !isShow;\n if (isShow) MenuShowedName = name;\n exec(callback);\n if (isShow) isShow = isPath(params.x, params.y);\n return isShow;\n}\nfunction beforeClick(name) {\n return MenuShowedName !== name;\n}\nasync function _uploadTo(nameModule) {\n const [error, data] = await Info.getData();\n if (error) return;\n const {\n name\n } = Info;\n CloudCmd.execFromModule(nameModule, 'uploadFile', name, data);\n CloudCmd.log('Uploading to ' + name + '...');\n}\nfunction uploadFromCloud() {\n Images.show.load('top');\n CloudCmd.execFromModule('Cloud', 'saveFile', async (currentName, data) => {\n const path = DOM.getCurrentDirPath() + currentName;\n const [e] = await RESTful.write(path, data);\n if (e) return;\n await CloudCmd.refresh({\n currentName\n });\n });\n}\nfunction preDownload() {\n download(config('packer'));\n}\nfunction download(type) {\n const TIME = 30 * 1000;\n const {\n prefixURL\n } = CloudCmd;\n const PACK = '/pack';\n const date = Date.now();\n const files = DOM.getActiveFiles();\n if (!files.length) return alertNoFiles();\n for (const file of files) {\n const selected = DOM.isSelected(file);\n const isDir = DOM.isCurrentIsDir(file);\n const path = DOM.getCurrentPath(file);\n CloudCmd.log('downloading file ' + path + '...');\n /*\n * if we send ajax request -\n * no need in hash so we escape #\n * and all other characters, like \"%\"\n */\n const encodedPath = encodeURI(path).replace(/#/g, '%23');\n const id = getIdBySrc(path);\n let src;\n if (isDir) src = prefixURL + PACK + encodedPath + DOM.getPackerExt(type);else src = prefixURL + FS + encodedPath + '?download';\n const element = createElement('iframe', {\n id: id + '-' + date,\n async: false,\n className: 'hidden',\n src\n });\n const {\n body\n } = document;\n const removeChild = body.removeChild.bind(body, element);\n setTimeout(removeChild, TIME);\n if (selected) DOM.toggleSelectedFile(file);\n }\n}\nfunction getCurrentPosition() {\n const current = Info.element;\n const rect = current.getBoundingClientRect();\n const position = {\n x: Math.round(rect.left + rect.width / 3),\n y: Math.round(rect.top)\n };\n return position;\n}\nfunction listener(event) {\n const {\n F9,\n ESC\n } = Key;\n const key = event.keyCode;\n const isBind = Key.isBind();\n if (!isBind) return;\n if (key === ESC) return hide();\n if (key === F9) {\n const position = getCurrentPosition();\n MenuContext.show(position.x, position.y);\n event.preventDefault();\n }\n}\n\n//# sourceURL=file://cloudcmd/client/modules/menu.js");
167
167
 
168
168
  /***/ })
169
169
 
@@ -175,7 +175,7 @@ eval("\n\nmodule.exports = (operation, from, to) => {\n if (!to) return `${oper
175
175
  /***/ (function(module, exports, __webpack_require__) {
176
176
 
177
177
  "use strict";
178
- eval("\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst not = currify((array, value) => !array.includes(value));\nconst notOneOf = currify((a, b) => a.filter(not(b)));\n\nmodule.exports = (currentName, names, removedNames) => {\n const i = names.indexOf(currentName);\n const nextNames = notOneOf(names, removedNames);\n const {\n length\n } = nextNames;\n if (nextNames[i]) return nextNames[i];\n return nextNames[length - 1];\n};\n\n//# sourceURL=file://cloudcmd/client/modules/operation/get-next-current-name.js");
178
+ eval("\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst not = currify((array, value) => !array.includes(value));\nconst notOneOf = currify((a, b) => a.filter(not(b)));\nmodule.exports = (currentName, names, removedNames) => {\n const i = names.indexOf(currentName);\n const nextNames = notOneOf(names, removedNames);\n const {\n length\n } = nextNames;\n if (nextNames[i]) return nextNames[i];\n return nextNames[length - 1];\n};\n\n//# sourceURL=file://cloudcmd/client/modules/operation/get-next-current-name.js");
179
179
 
180
180
  /***/ }),
181
181
 
@@ -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] = 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 if (!Info.isOnePanel) CloudCmd.refresh({\n panel: panelPassive,\n noCurrent: true\n });\n CloudCmd.refresh({\n panel\n });\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");
190
+ eval("/* global CloudCmd */\n/* global Util */\n/* global DOM */\n/* global fileop */\n\n\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\nconst removeExtension = __webpack_require__(/*! ./remove-extension */ \"./client/modules/operation/remove-extension.js\");\nconst setListeners = __webpack_require__(/*! ./set-listeners */ \"./client/modules/operation/set-listeners.js\");\nconst getNextCurrentName = __webpack_require__(/*! ./get-next-current-name */ \"./client/modules/operation/get-next-current-name.js\");\nconst removeQuery = a => a.replace(/\\?.*/, '');\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);\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};\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});\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}\nconst onConnect = currify((fn, operator) => {\n setOperations(operator);\n fn();\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}\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 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 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 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 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 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}\nfunction getPacker(type) {\n if (type === 'zip') return packZipFn;\n return packTarFn;\n}\nmodule.exports.hide = () => {\n CloudCmd.View.hide();\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};\nOperation.copy = processFiles({\n type: 'copy'\n});\nOperation.move = processFiles({\n type: 'move'\n});\nOperation.delete = promptDelete;\nOperation.deleteSilent = deleteSilent;\nOperation.pack = () => {\n const isZip = config('packer') === 'zip';\n twopack('pack', isZip ? 'zip' : 'tar');\n};\nOperation.extract = () => {\n twopack('extract');\n};\n\n/**\n * prompt and delete current file or selected files\n *\n * @currentFile\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 if (n) {\n let name = '';\n for (let i = 0; i < 5 && i < n; i++) name += '\\n' + names[i];\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 const getType = isDir => isDir ? 'directory' : 'file';\n const type = getType(isDir) + ' ';\n const name = DOM.getCurrentName(current);\n msg = msgAsk + msgSel + type + name + '?';\n }\n const [cancel] = await Dialog.confirm(msg);\n if (cancel) return;\n deleteSilent(files);\n}\n\n/**\n * delete current or selected files\n *\n * @files\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/*\n * process files (copy or move)\n * @param data\n * @param operation\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\n /* eslint no-multi-spaces: 0 */\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 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 if (shouldAsk && config(option)) {\n const [cancel, newTo] = await prompt(title, to, names.map(encode));\n if (!cancel) ask(newTo);\n return;\n }\n ask(to);\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 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 if (!Info.isOnePanel) CloudCmd.refresh({\n panel: panelPassive,\n noCurrent: true\n });\n CloudCmd.refresh({\n panel\n });\n });\n }\n }\n}\nfunction checkEmpty(name, operation) {\n if (!operation) throw Error(name + ' could not be empty!');\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 switch (operation) {\n case 'extract':\n op = extractFn;\n fileFrom = {\n from: path,\n to: dirPath\n };\n currentName = removeExtension(currentName);\n break;\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 showLoad();\n op(fileFrom, error => {\n !error && CloudCmd.refresh({\n currentName\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}\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
 
@@ -199,7 +199,7 @@ eval("/* global CloudCmd */\n\n/* global Util */\n\n/* global DOM */\n\n/* globa
199
199
  /***/ (function(module, exports, __webpack_require__) {
200
200
 
201
201
  "use strict";
202
- eval("\n\nconst {\n getExt\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\n\nmodule.exports = name => {\n const ext = getExtension(name);\n return name.replace(ext, '');\n};\n\nfunction getExtension(name) {\n if (/\\.tar\\.gz$/.test(name)) return '.tar.gz';\n if (/\\.tar\\.bz2$/.test(name)) return '.tar.bz2';\n return getExt(name);\n}\n\n//# sourceURL=file://cloudcmd/client/modules/operation/remove-extension.js");
202
+ eval("\n\nconst {\n getExt\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\nmodule.exports = name => {\n const ext = getExtension(name);\n return name.replace(ext, '');\n};\nfunction getExtension(name) {\n if (/\\.tar\\.gz$/.test(name)) return '.tar.gz';\n if (/\\.tar\\.bz2$/.test(name)) return '.tar.bz2';\n return getExt(name);\n}\n\n//# sourceURL=file://cloudcmd/client/modules/operation/remove-extension.js");
203
203
 
204
204
  /***/ }),
205
205
 
@@ -211,7 +211,7 @@ eval("\n\nconst {\n getExt\n} = __webpack_require__(/*! ../../../common/util */
211
211
  /***/ (function(module, exports, __webpack_require__) {
212
212
 
213
213
  "use strict";
214
- eval("\n/* global DOM */\n\nconst forEachKey = __webpack_require__(/*! for-each-key */ \"./node_modules/for-each-key/lib/for-each-key.js\");\n\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\n\nconst format = __webpack_require__(/*! ./format */ \"./client/modules/operation/format.js\");\n\nconst {\n Dialog,\n Images\n} = DOM;\n\nmodule.exports = options => emitter => {\n const {\n operation,\n callback,\n noContinue,\n from,\n to\n } = options;\n let done;\n let lastError;\n const onAbort = wraptile(_ref => {\n let {\n emitter,\n operation\n } = _ref;\n emitter.abort();\n const msg = `${operation} aborted`;\n lastError = true;\n Dialog.alert(msg, {\n cancel: false\n });\n });\n const removeListener = emitter.removeListener.bind(emitter);\n const on = emitter.on.bind(emitter);\n const message = format(operation, from, to);\n const progress = Dialog.progress(message);\n progress.catch(onAbort({\n emitter,\n operation\n }));\n const listeners = {\n progress: value => {\n done = value === 100;\n progress.setProgress(value);\n },\n end: () => {\n Images.hide();\n forEachKey(removeListener, listeners);\n progress.remove();\n if (lastError || done) callback();\n },\n error: async error => {\n lastError = error;\n\n if (noContinue) {\n listeners.end(error);\n Dialog.alert(error);\n progress.remove();\n return;\n }\n\n const [cancel] = await Dialog.confirm(error + '\\n Continue?');\n if (!done && !cancel) return emitter.continue();\n emitter.abort();\n progress.remove();\n }\n };\n forEachKey(on, listeners);\n};\n\n//# sourceURL=file://cloudcmd/client/modules/operation/set-listeners.js");
214
+ eval("\n\n/* global DOM */\nconst forEachKey = __webpack_require__(/*! for-each-key */ \"./node_modules/for-each-key/lib/for-each-key.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst format = __webpack_require__(/*! ./format */ \"./client/modules/operation/format.js\");\nconst {\n Dialog,\n Images\n} = DOM;\nmodule.exports = options => emitter => {\n const {\n operation,\n callback,\n noContinue,\n from,\n to\n } = options;\n let done;\n let lastError;\n const onAbort = wraptile(_ref => {\n let {\n emitter,\n operation\n } = _ref;\n emitter.abort();\n const msg = `${operation} aborted`;\n lastError = true;\n Dialog.alert(msg, {\n cancel: false\n });\n });\n const removeListener = emitter.removeListener.bind(emitter);\n const on = emitter.on.bind(emitter);\n const message = format(operation, from, to);\n const progress = Dialog.progress(message);\n progress.catch(onAbort({\n emitter,\n operation\n }));\n const listeners = {\n progress: value => {\n done = value === 100;\n progress.setProgress(value);\n },\n end: () => {\n Images.hide();\n forEachKey(removeListener, listeners);\n progress.remove();\n if (lastError || done) callback();\n },\n error: async error => {\n lastError = error;\n if (noContinue) {\n listeners.end(error);\n Dialog.alert(error);\n progress.remove();\n return;\n }\n const [cancel] = await Dialog.confirm(error + '\\n Continue?');\n if (!done && !cancel) return emitter.continue();\n emitter.abort();\n progress.remove();\n }\n };\n forEachKey(on, listeners);\n};\n\n//# sourceURL=file://cloudcmd/client/modules/operation/set-listeners.js");
215
215
 
216
216
  /***/ })
217
217
 
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n/* global DOM */\n\n__webpack_require__(/*! domtokenlist-shim */ \"./node_modules/domtokenlist-shim/dist/domtokenlist.js\");\n\nconst scrollIntoViewIfNeeded = __webpack_require__(/*! scroll-into-view-if-needed */ \"./node_modules/scroll-into-view-if-needed/es/index.js\").default;\n\nDOM.scrollIntoViewIfNeeded = el => scrollIntoViewIfNeeded(el, {\n block: 'nearest'\n});\n\n//# sourceURL=file://cloudcmd/client/modules/polyfill.js");
166
+ eval("\n\n/* global DOM */\n__webpack_require__(/*! domtokenlist-shim */ \"./node_modules/domtokenlist-shim/dist/domtokenlist.js\");\nconst scrollIntoViewIfNeeded = __webpack_require__(/*! scroll-into-view-if-needed */ \"./node_modules/scroll-into-view-if-needed/es/index.js\").default;\nDOM.scrollIntoViewIfNeeded = el => scrollIntoViewIfNeeded(el, {\n block: 'nearest'\n});\n\n//# sourceURL=file://cloudcmd/client/modules/polyfill.js");
167
167
 
168
168
  /***/ })
169
169
 
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n/* global CloudCmd, gritty */\n\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\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 DOM = __webpack_require__(/*! ../dom */ \"./client/dom/index.js\");\n\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\n\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.TerminalRun = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst exitCodeStore = fullstore();\n\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(load.parallel, [js, css]);\n\n if (e) {\n const src = e.target.src.replace(window.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n\n Loaded = true;\n};\n\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n};\n\nmodule.exports.show = promisify(function () {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let fn = arguments.length > 1 ? arguments[1] : undefined;\n if (!Loaded) return fn(null, -1);\n if (!config('terminal')) return;\n create(options);\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n },\n afterClose: () => {\n fn(null, exitCodeStore());\n }\n });\n});\nmodule.exports.hide = hide;\n\nfunction hide() {\n CloudCmd.View.hide();\n}\n\nfunction getPrefix() {\n return CloudCmd.prefix + '/gritty';\n}\n\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\n\nfunction getEnv() {\n return {\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n };\n}\n\nfunction create(createOptions) {\n const {\n cwd = DOM.getCurrentDirPath(),\n command,\n autoClose,\n closeMessage = 'Press any key to close Terminal...'\n } = createOptions;\n const options = {\n cwd,\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono',\n command,\n autoRestart: false\n };\n let commandExit = false;\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(_ref => {\n let {\n domEvent\n } = _ref;\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (commandExit) hide();\n\n if (shiftKey && keyCode === Key.ESC) {\n hide();\n }\n });\n Socket.on('exit', code => {\n exitCodeStore(code);\n if (autoClose) return hide();\n terminal.write(`\\n${closeMessage}`);\n commandExit = true;\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\n\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/terminal-run.js");
166
+ eval("\n\n/* global CloudCmd, gritty */\nconst {\n promisify\n} = __webpack_require__(/*! es6-promisify */ \"./node_modules/es6-promisify/dist/promisify.mjs\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! ../dom */ \"./client/dom/index.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.TerminalRun = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst exitCodeStore = fullstore();\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(load.parallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(window.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n};\nmodule.exports.show = promisify(function () {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let fn = arguments.length > 1 ? arguments[1] : undefined;\n if (!Loaded) return fn(null, -1);\n if (!config('terminal')) return;\n create(options);\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n },\n afterClose: ( /* exec.series args */\n ) => {\n fn(null, exitCodeStore());\n }\n });\n});\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nfunction getPrefix() {\n return CloudCmd.prefix + '/gritty';\n}\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nfunction getEnv() {\n return {\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n };\n}\nfunction create(createOptions) {\n const {\n cwd = DOM.getCurrentDirPath(),\n command,\n autoClose,\n closeMessage = 'Press any key to close Terminal...'\n } = createOptions;\n const options = {\n cwd,\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono',\n command,\n autoRestart: false\n };\n let commandExit = false;\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(_ref => {\n let {\n domEvent\n } = _ref;\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (commandExit) hide();\n if (shiftKey && keyCode === Key.ESC) {\n hide();\n }\n });\n Socket.on('exit', code => {\n exitCodeStore(code);\n if (autoClose) return hide();\n terminal.write(`\\n${closeMessage}`);\n commandExit = true;\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/terminal-run.js");
167
167
 
168
168
  /***/ })
169
169
 
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n/* global CloudCmd */\n\n/* global gritty */\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\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 DOM = __webpack_require__(/*! ../dom */ \"./client/dom/index.js\");\n\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\n\nconst loadParallel = load.parallel;\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.Terminal = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\n\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(loadParallel, [js, css]);\n\n if (e) {\n const src = e.target.src.replace(window.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n\n Loaded = true;\n};\n\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n create();\n};\n\nmodule.exports.show = show;\nmodule.exports.hide = hide;\n\nfunction hide() {\n CloudCmd.View.hide();\n}\n\nfunction getPrefix() {\n return CloudCmd.prefix + '/gritty';\n}\n\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\n\nfunction getEnv() {\n return {\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n };\n}\n\nfunction create() {\n const options = {\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono'\n };\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(_ref => {\n let {\n domEvent\n } = _ref;\n const {\n keyCode,\n shiftKey\n } = domEvent;\n\n if (shiftKey && keyCode === Key.ESC) {\n hide();\n }\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\n\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\n\nfunction show() {\n if (!Loaded) return;\n if (!config('terminal')) return;\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n }\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/terminal.js");
166
+ eval("\n\n/* global CloudCmd */\n/* global gritty */\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n__webpack_require__(/*! ../../css/terminal.css */ \"./css/terminal.css\");\nconst exec = __webpack_require__(/*! execon */ \"./node_modules/execon/lib/exec.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst DOM = __webpack_require__(/*! ../dom */ \"./client/dom/index.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst loadParallel = load.parallel;\nconst {\n Dialog\n} = DOM;\nconst {\n Key,\n config\n} = CloudCmd;\nCloudCmd.Terminal = exports;\nlet Loaded;\nlet Terminal;\nlet Socket;\nconst loadAll = async () => {\n const {\n prefix\n } = CloudCmd;\n const prefixGritty = getPrefix();\n const js = `${prefixGritty}/gritty.js`;\n const css = `${prefix}/dist/terminal.css`;\n const [e] = await tryToCatch(loadParallel, [js, css]);\n if (e) {\n const src = e.target.src.replace(window.location.href, '');\n return Dialog.alert(`file ${src} could not be loaded`);\n }\n Loaded = true;\n};\nmodule.exports.init = async () => {\n if (!config('terminal')) return;\n Images.show.load('top');\n await CloudCmd.View();\n await loadAll();\n create();\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nfunction hide() {\n CloudCmd.View.hide();\n}\nfunction getPrefix() {\n return CloudCmd.prefix + '/gritty';\n}\nfunction getPrefixSocket() {\n return CloudCmd.prefixSocket + '/gritty';\n}\nfunction getEnv() {\n return {\n ACTIVE_DIR: DOM.getCurrentDirPath,\n PASSIVE_DIR: DOM.getNotCurrentDirPath,\n CURRENT_NAME: DOM.getCurrentName,\n CURRENT_PATH: DOM.getCurrentPath\n };\n}\nfunction create() {\n const options = {\n env: getEnv(),\n prefix: getPrefixSocket(),\n socketPath: CloudCmd.prefix,\n fontFamily: 'Droid Sans Mono'\n };\n const {\n socket,\n terminal\n } = gritty(document.body, options);\n Socket = socket;\n Terminal = terminal;\n Terminal.onKey(_ref => {\n let {\n domEvent\n } = _ref;\n const {\n keyCode,\n shiftKey\n } = domEvent;\n if (shiftKey && keyCode === Key.ESC) {\n hide();\n }\n });\n Socket.on('connect', exec.with(authCheck, socket));\n}\nfunction authCheck(spawn) {\n spawn.emit('auth', config('username'), config('password'));\n spawn.on('reject', () => {\n Dialog.alert('Wrong credentials!');\n });\n}\nfunction show() {\n if (!Loaded) return;\n if (!config('terminal')) return;\n CloudCmd.View.show(Terminal.element, {\n afterShow: () => {\n Terminal.focus();\n }\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/terminal.js");
167
167
 
168
168
  /***/ })
169
169
 
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("/* global CloudCmd, DOM */\n\n\nCloudCmd.Upload = exports;\n\nconst Files = __webpack_require__(/*! ../dom/files */ \"./client/dom/files.js\");\n\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\n\nconst uploadFiles = __webpack_require__(/*! ../dom/upload-files */ \"./client/dom/upload-files.js\");\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nmodule.exports.init = async () => {\n Images.show.load('top');\n await CloudCmd.View();\n};\n\nmodule.exports.show = show;\nmodule.exports.hide = hide;\n\nasync function show() {\n Images.show.load('top');\n const innerHTML = await Files.get('upload');\n const autoSize = true;\n const el = createElement('div', {\n innerHTML\n });\n CloudCmd.View.show(el, {\n autoSize,\n afterShow\n });\n const fontFamily = ['\"Droid Sans Mono\"', '\"Ubuntu Mono\"', '\"Consolas\"', 'monospace'].join(', ');\n createElement('style', {\n dataName: 'upload-css',\n innerText: `[data-name=js-upload-file-button] {\n font-family: ${fontFamily};\n font-size: 16px;\n margin: 10px 0 10px 0;\n }`\n });\n}\n\nfunction hide() {\n CloudCmd.View.hide();\n}\n\nfunction afterShow() {\n const button = DOM.getByDataName('js-upload-file-button');\n Images.hide();\n DOM.Events.add('change', button, _ref => {\n let {\n target\n } = _ref;\n const {\n files\n } = target;\n hide();\n uploadFiles(files);\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/upload.js");
166
+ eval("/* global CloudCmd, DOM */\n\n\n\nCloudCmd.Upload = exports;\nconst Files = __webpack_require__(/*! ../dom/files */ \"./client/dom/files.js\");\nconst Images = __webpack_require__(/*! ../dom/images */ \"./client/dom/images.js\");\nconst uploadFiles = __webpack_require__(/*! ../dom/upload-files */ \"./client/dom/upload-files.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nmodule.exports.init = async () => {\n Images.show.load('top');\n await CloudCmd.View();\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nasync function show() {\n Images.show.load('top');\n const innerHTML = await Files.get('upload');\n const autoSize = true;\n const el = createElement('div', {\n innerHTML\n });\n CloudCmd.View.show(el, {\n autoSize,\n afterShow\n });\n const fontFamily = ['\"Droid Sans Mono\"', '\"Ubuntu Mono\"', '\"Consolas\"', 'monospace'].join(', ');\n createElement('style', {\n dataName: 'upload-css',\n innerText: `[data-name=js-upload-file-button] {\n font-family: ${fontFamily};\n font-size: 16px;\n margin: 10px 0 10px 0;\n }`\n });\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\nfunction afterShow() {\n const button = DOM.getByDataName('js-upload-file-button');\n Images.hide();\n DOM.Events.add('change', button, _ref => {\n let {\n target\n } = _ref;\n const {\n files\n } = target;\n hide();\n uploadFiles(files);\n });\n}\n\n//# sourceURL=file://cloudcmd/client/modules/upload.js");
167
167
 
168
168
  /***/ })
169
169
 
@@ -175,7 +175,7 @@ eval("\n\nmodule.exports = menuFn => {\n const module = {};\n const fn = Funct
175
175
  /***/ (function(module, exports, __webpack_require__) {
176
176
 
177
177
  "use strict";
178
- eval("\n/* global CloudCmd, DOM */\n\n__webpack_require__(/*! ../../../css/user-menu.css */ \"./css/user-menu.css\");\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 fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\n\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nconst tryCatch = __webpack_require__(/*! try-catch */ \"./node_modules/try-catch/lib/try-catch.js\");\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst {\n codeFrameColumns\n} = __webpack_require__(/*! @babel/code-frame */ \"./node_modules/@babel/code-frame/lib/index.js\");\n\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\n\nconst Dialog = __webpack_require__(/*! ../../dom/dialog */ \"./client/dom/dialog.js\");\n\nconst getUserMenu = __webpack_require__(/*! ./get-user-menu */ \"./client/modules/user-menu/get-user-menu.js\");\n\nconst navigate = __webpack_require__(/*! ./navigate */ \"./client/modules/user-menu/navigate.js\");\n\nconst parseError = __webpack_require__(/*! ./parse-error */ \"./client/modules/user-menu/parse-error.js\");\n\nconst parseUserMenu = __webpack_require__(/*! ./parse-user-menu */ \"./client/modules/user-menu/parse-user-menu.js\");\n\nconst {\n runSelected\n} = __webpack_require__(/*! ./run */ \"./client/modules/user-menu/run.js\");\n\nconst loadCSS = load.css;\nconst sourceStore = fullstore();\nconst Name = 'UserMenu';\nCloudCmd[Name] = module.exports;\nconst {\n Key\n} = CloudCmd;\n\nmodule.exports.init = async () => {\n await Promise.all([loadCSS(`${CloudCmd.prefix}/dist/user-menu.css`), CloudCmd.View()]);\n};\n\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nconst {\n CurrentInfo\n} = DOM;\n\nasync function show() {\n Images.show.load('top');\n const {\n dirPath\n } = CurrentInfo;\n const res = await fetch(`${CloudCmd.prefix}/api/v1/user-menu?dir=${dirPath}`);\n const source = await res.text();\n const [error, userMenu] = tryCatch(getUserMenu, source);\n Images.hide();\n if (error) return Dialog.alert(getCodeFrame({\n error,\n source\n }));\n sourceStore(source);\n const {\n names,\n keys,\n items,\n settings\n } = parseUserMenu(userMenu);\n if (settings.run) return runSelected(settings.select, items, runUserMenu);\n const button = createElement('button', {\n className: 'cloudcmd-user-menu-button',\n innerText: 'User Menu',\n notAppend: true\n });\n const select = createElement('select', {\n className: 'cloudcmd-user-menu',\n innerHTML: fillTemplate(names),\n notAppend: true,\n size: 10\n });\n button.addEventListener('click', onButtonClick(userMenu, select));\n select.addEventListener('dblclick', onDblClick(userMenu));\n select.addEventListener('keydown', onKeyDown({\n keys,\n userMenu\n }));\n\n const afterShow = () => select.focus();\n\n const autoSize = true;\n CloudCmd.View.show([button, select], {\n autoSize,\n afterShow\n });\n}\n\nfunction fillTemplate(options) {\n const result = [];\n\n for (const option of options) result.push(`<option>${option}</option>`);\n\n return result.join('');\n}\n\nfunction hide() {\n CloudCmd.View.hide();\n}\n\nconst onDblClick = currify(async (items, e) => {\n const {\n value\n } = e.target;\n await runUserMenu(items[value]);\n});\nconst onButtonClick = wraptile(async (items, _ref) => {\n let {\n value\n } = _ref;\n await runUserMenu(items[value]);\n});\nconst onKeyDown = currify(async (_ref2, e) => {\n let {\n keys,\n userMenu\n } = _ref2;\n const {\n keyCode,\n target\n } = e;\n const keyName = e.key.toUpperCase();\n e.preventDefault();\n e.stopPropagation();\n let value;\n if (keyCode === Key.ESC) return hide();\n if (keyCode === Key.ENTER) value = userMenu[target.value];else if (keys[keyName]) value = keys[keyName];else return navigate(target, e);\n await runUserMenu(value);\n});\n\nconst runUserMenu = async fn => {\n hide();\n const [error] = await tryToCatch(fn, {\n DOM,\n CloudCmd,\n tryToCatch\n });\n if (!error) return;\n const source = sourceStore();\n return Dialog.alert(getCodeFrame({\n error,\n source\n }));\n};\n\nfunction getCodeFrame(_ref3) {\n let {\n error,\n source\n } = _ref3;\n const {\n code\n } = error;\n if (!code || code === 'frame') return error.message;\n const [line, column] = parseError(error);\n const start = {\n line,\n column\n };\n const location = {\n start\n };\n const frame = codeFrameColumns(source, location, {\n message: error.message,\n highlightCode: false\n });\n return `<pre>${frame}</pre>`;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/index.js");
178
+ eval("\n\n/* global CloudCmd, DOM */\n__webpack_require__(/*! ../../../css/user-menu.css */ \"./css/user-menu.css\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst fullstore = __webpack_require__(/*! fullstore */ \"./node_modules/fullstore/lib/fullstore.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst tryCatch = __webpack_require__(/*! try-catch */ \"./node_modules/try-catch/lib/try-catch.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst {\n codeFrameColumns\n} = __webpack_require__(/*! @babel/code-frame */ \"./node_modules/@babel/code-frame/lib/index.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst Dialog = __webpack_require__(/*! ../../dom/dialog */ \"./client/dom/dialog.js\");\nconst getUserMenu = __webpack_require__(/*! ./get-user-menu */ \"./client/modules/user-menu/get-user-menu.js\");\nconst navigate = __webpack_require__(/*! ./navigate */ \"./client/modules/user-menu/navigate.js\");\nconst parseError = __webpack_require__(/*! ./parse-error */ \"./client/modules/user-menu/parse-error.js\");\nconst parseUserMenu = __webpack_require__(/*! ./parse-user-menu */ \"./client/modules/user-menu/parse-user-menu.js\");\nconst {\n runSelected\n} = __webpack_require__(/*! ./run */ \"./client/modules/user-menu/run.js\");\nconst loadCSS = load.css;\nconst sourceStore = fullstore();\nconst Name = 'UserMenu';\nCloudCmd[Name] = module.exports;\nconst {\n Key\n} = CloudCmd;\nmodule.exports.init = async () => {\n await Promise.all([loadCSS(`${CloudCmd.prefix}/dist/user-menu.css`), CloudCmd.View()]);\n};\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nconst {\n CurrentInfo\n} = DOM;\nasync function show() {\n Images.show.load('top');\n const {\n dirPath\n } = CurrentInfo;\n const res = await fetch(`${CloudCmd.prefix}/api/v1/user-menu?dir=${dirPath}`);\n const source = await res.text();\n const [error, userMenu] = tryCatch(getUserMenu, source);\n Images.hide();\n if (error) return Dialog.alert(getCodeFrame({\n error,\n source\n }));\n sourceStore(source);\n const {\n names,\n keys,\n items,\n settings\n } = parseUserMenu(userMenu);\n if (settings.run) return runSelected(settings.select, items, runUserMenu);\n const button = createElement('button', {\n className: 'cloudcmd-user-menu-button',\n innerText: 'User Menu',\n notAppend: true\n });\n const select = createElement('select', {\n className: 'cloudcmd-user-menu',\n innerHTML: fillTemplate(names),\n notAppend: true,\n size: 10\n });\n button.addEventListener('click', onButtonClick(userMenu, select));\n select.addEventListener('dblclick', onDblClick(userMenu));\n select.addEventListener('keydown', onKeyDown({\n keys,\n userMenu\n }));\n const afterShow = () => select.focus();\n const autoSize = true;\n CloudCmd.View.show([button, select], {\n autoSize,\n afterShow\n });\n}\nfunction fillTemplate(options) {\n const result = [];\n for (const option of options) result.push(`<option>${option}</option>`);\n return result.join('');\n}\nfunction hide() {\n CloudCmd.View.hide();\n}\nconst onDblClick = currify(async (items, e) => {\n const {\n value\n } = e.target;\n await runUserMenu(items[value]);\n});\nconst onButtonClick = wraptile(async (items, _ref) => {\n let {\n value\n } = _ref;\n await runUserMenu(items[value]);\n});\nconst onKeyDown = currify(async (_ref2, e) => {\n let {\n keys,\n userMenu\n } = _ref2;\n const {\n keyCode,\n target\n } = e;\n const keyName = e.key.toUpperCase();\n e.preventDefault();\n e.stopPropagation();\n let value;\n if (keyCode === Key.ESC) return hide();\n if (keyCode === Key.ENTER) value = userMenu[target.value];else if (keys[keyName]) value = keys[keyName];else return navigate(target, e);\n await runUserMenu(value);\n});\nconst runUserMenu = async fn => {\n hide();\n const [error] = await tryToCatch(fn, {\n DOM,\n CloudCmd,\n tryToCatch\n });\n if (!error) return;\n const source = sourceStore();\n return Dialog.alert(getCodeFrame({\n error,\n source\n }));\n};\nfunction getCodeFrame(_ref3) {\n let {\n error,\n source\n } = _ref3;\n const {\n code\n } = error;\n if (!code || code === 'frame') return error.message;\n const [line, column] = parseError(error);\n const start = {\n line,\n column\n };\n const location = {\n start\n };\n const frame = codeFrameColumns(source, location, {\n message: error.message,\n highlightCode: false\n });\n return `<pre>${frame}</pre>`;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/index.js");
179
179
 
180
180
  /***/ }),
181
181
 
@@ -187,7 +187,7 @@ eval("\n/* global CloudCmd, DOM */\n\n__webpack_require__(/*! ../../../css/user-
187
187
  /***/ (function(module, exports, __webpack_require__) {
188
188
 
189
189
  "use strict";
190
- eval("\n\nconst {\n J,\n K,\n UP,\n DOWN\n} = __webpack_require__(/*! ../../key/key.js */ \"./client/key/key.js\");\n\nmodule.exports = (el, _ref) => {\n let {\n keyCode\n } = _ref;\n if (keyCode === DOWN || keyCode === J) return down(el);\n if (keyCode === UP || keyCode === K) return up(el);\n};\n\nfunction down(el) {\n const {\n length\n } = el;\n if (el.selectedIndex === length - 1) el.selectedIndex = 0;else ++el.selectedIndex;\n}\n\nfunction up(el) {\n const {\n length\n } = el;\n if (!el.selectedIndex) el.selectedIndex = length - 1;else --el.selectedIndex;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/navigate.js");
190
+ eval("\n\nconst {\n J,\n K,\n UP,\n DOWN\n} = __webpack_require__(/*! ../../key/key.js */ \"./client/key/key.js\");\nmodule.exports = (el, _ref) => {\n let {\n keyCode\n } = _ref;\n if (keyCode === DOWN || keyCode === J) return down(el);\n if (keyCode === UP || keyCode === K) return up(el);\n};\nfunction down(el) {\n const {\n length\n } = el;\n if (el.selectedIndex === length - 1) el.selectedIndex = 0;else ++el.selectedIndex;\n}\nfunction up(el) {\n const {\n length\n } = el;\n if (!el.selectedIndex) el.selectedIndex = length - 1;else --el.selectedIndex;\n}\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/navigate.js");
191
191
 
192
192
  /***/ }),
193
193
 
@@ -199,7 +199,7 @@ eval("\n\nconst {\n J,\n K,\n UP,\n DOWN\n} = __webpack_require__(/*! ../../
199
199
  /***/ (function(module, exports, __webpack_require__) {
200
200
 
201
201
  "use strict";
202
- eval("\n\nconst isNumber = a => typeof a === 'number';\n\nmodule.exports = error => {\n const {\n lineNumber,\n columnNumber\n } = error; // thank you firefox\n\n if (isNumber(lineNumber) && isNumber(columnNumber)) return [lineNumber, columnNumber];\n const before = error.stack.indexOf('>');\n const str = error.stack.slice(before + 1);\n const after = str.indexOf(')');\n const newStr = str.slice(1, after);\n const [line, column] = newStr.split(':');\n return [Number(line), Number(column)];\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/parse-error.js");
202
+ eval("\n\nconst isNumber = a => typeof a === 'number';\nmodule.exports = error => {\n const {\n lineNumber,\n columnNumber\n } = error;\n\n // thank you firefox\n if (isNumber(lineNumber) && isNumber(columnNumber)) return [lineNumber, columnNumber];\n const before = error.stack.indexOf('>');\n const str = error.stack.slice(before + 1);\n const after = str.indexOf(')');\n const newStr = str.slice(1, after);\n const [line, column] = newStr.split(':');\n return [Number(line), Number(column)];\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/parse-error.js");
203
203
 
204
204
  /***/ }),
205
205
 
@@ -211,7 +211,7 @@ eval("\n\nconst isNumber = a => typeof a === 'number';\n\nmodule.exports = error
211
211
  /***/ (function(module, exports, __webpack_require__) {
212
212
 
213
213
  "use strict";
214
- eval("\n\nconst {\n entries,\n assign\n} = Object;\n\nmodule.exports = userMenu => {\n const names = [];\n const keys = {};\n const items = {};\n const settings = {};\n\n for (const [str, fn] of entries(userMenu)) {\n if (str === '__settings') {\n assign(settings, userMenu[str]);\n continue;\n }\n\n if (str.startsWith('_')) {\n continue;\n }\n\n names.push(str);\n const [key, name] = str.split(' - ');\n keys[key] = fn;\n items[name] = fn;\n }\n\n return {\n names,\n keys,\n items,\n settings\n };\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/parse-user-menu.js");
214
+ eval("\n\nconst {\n entries,\n assign\n} = Object;\nmodule.exports = userMenu => {\n const names = [];\n const keys = {};\n const items = {};\n const settings = {};\n for (const [str, fn] of entries(userMenu)) {\n if (str === '__settings') {\n assign(settings, userMenu[str]);\n continue;\n }\n if (str.startsWith('_')) {\n continue;\n }\n names.push(str);\n const [key, name] = str.split(' - ');\n keys[key] = fn;\n items[name] = fn;\n }\n return {\n names,\n keys,\n items,\n settings\n };\n};\n\n//# sourceURL=file://cloudcmd/client/modules/user-menu/parse-user-menu.js");
215
215
 
216
216
  /***/ }),
217
217
 
@@ -163,7 +163,7 @@
163
163
  /***/ (function(module, exports, __webpack_require__) {
164
164
 
165
165
  "use strict";
166
- eval("\n/* global CloudCmd, DOM */\n\n__webpack_require__(/*! ../../../css/view.css */ \"./css/view.css\");\n\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\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 tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\n\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\n\nconst modal = __webpack_require__(/*! @cloudcmd/modal */ \"./node_modules/@cloudcmd/modal/lib/modal.js\");\n\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\n\nconst {\n time\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\n\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\n\nconst {\n isImage,\n isAudio,\n getType\n} = __webpack_require__(/*! ./types */ \"./client/modules/view/types.js\");\n\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\n\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\n\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\n\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\n\nconst {\n assign\n} = Object;\nconst {\n isArray\n} = Array;\nconst lifo = currify((fn, el, cb, name) => fn(name, el, cb));\nconst series = wraptile(function () {\n for (var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++) {\n a[_key] = arguments[_key];\n }\n\n for (const f of a) f();\n});\n\nconst isFn = a => typeof a === 'function';\n\nconst noop = () => {};\n\nconst addEvent = lifo(Events.add);\nconst loadCSS = load.css;\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nlet Loading = false;\nconst Name = 'View';\nCloudCmd[Name] = module.exports;\nconst Info = DOM.CurrentInfo;\nconst {\n Key\n} = CloudCmd;\n\nconst basename = a => a.split('/').pop();\n\nlet El;\nlet TemplateAudio;\nlet Overlay;\nconst Config = {\n beforeShow: () => {\n Images.hide();\n Key.unsetBind();\n },\n beforeClose: () => {\n Events.rmKey(listener);\n Key.setBind();\n },\n afterShow: () => {\n El.focus();\n },\n onOverlayClick,\n afterClose: noop,\n autoSize: false,\n helpers: {\n title: {}\n }\n};\nmodule.exports._Config = Config;\n\nmodule.exports.init = async () => {\n await loadAll();\n const events = ['click', 'contextmenu'];\n events.forEach(addEvent(Overlay, onOverlayClick));\n};\n\nasync function show(data) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const prefixURL = CloudCmd.prefixURL + FS;\n if (Loading) return;\n if (!options || options.bindKeys !== false) Events.addKey(listener);\n El = createElement('div', {\n className: 'view',\n notAppend: true\n });\n El.tabIndex = 0;\n\n if (data) {\n if (isArray(data)) El.append(...data);else El.append(data);\n modal.open(El, initConfig(options));\n return;\n }\n\n Images.show.load();\n const path = prefixURL + Info.path;\n const type = options.raw ? '' : await getType(path);\n\n switch (type) {\n default:\n return await viewFile();\n\n case 'markdown':\n return await CloudCmd.Markdown.show(Info.path);\n\n case 'html':\n return viewHtml(path);\n\n case 'image':\n return viewImage(Info.path, prefixURL);\n\n case 'media':\n return await viewMedia(path);\n\n case 'pdf':\n return viewPDF(path);\n }\n}\n\nmodule.exports._createIframe = createIframe;\n\nfunction createIframe(src) {\n const element = createElement('iframe', {\n src,\n width: '100%',\n height: '100%'\n });\n element.addEventListener('load', () => {\n element.contentWindow.addEventListener('keydown', listener);\n });\n return element;\n}\n\nmodule.exports._viewHtml = viewHtml;\n\nfunction viewHtml(src) {\n modal.open(createIframe(src), Config);\n}\n\nfunction viewPDF(src) {\n const element = createIframe(src);\n const options = assign({}, Config);\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n modal.open(element, options);\n}\n\nasync function viewMedia(path) {\n const [e, element] = await getMediaElement(path);\n if (e) return alert(e);\n const allConfig = { ...Config,\n ...{\n autoSize: true,\n afterShow: () => {\n element.querySelector('audio, video').focus();\n }\n }\n };\n modal.open(element, allConfig);\n}\n\nasync function viewFile() {\n const [error, data] = await Info.getData();\n if (error) return Images.hide();\n const element = document.createTextNode(data);\n const options = Config;\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n El.append(element);\n modal.open(El, options);\n}\n\nconst copy = a => assign({}, a);\n\nmodule.exports._initConfig = initConfig;\n\nfunction initConfig(options) {\n const config = copy(Config);\n if (!options) return config;\n const names = Object.keys(options);\n\n for (const name of names) {\n const isConfig = Boolean(config[name]);\n const item = options[name];\n\n if (!isFn(item) || !isConfig) {\n config[name] = options[name];\n continue;\n }\n\n const fn = config[name];\n config[name] = series(fn, item);\n }\n\n return config;\n}\n\nfunction hide() {\n modal.close();\n}\n\nfunction viewImage(path, prefixURL) {\n const isSupportedImage = a => isImage(a) || a === path;\n\n const makeTitle = path => ({\n href: `${prefixURL}${path}`,\n title: encode(basename(path))\n });\n\n const names = Info.files.map(DOM.getCurrentPath).filter(isSupportedImage);\n const titles = names.map(makeTitle);\n const index = names.indexOf(Info.path);\n const imageConfig = {\n index,\n autoSize: true,\n arrows: true,\n keys: true,\n helpers: {\n title: {}\n }\n };\n const config = { ...Config,\n ...imageConfig\n };\n modal.open(titles, config);\n}\n\nasync function getMediaElement(src) {\n check(src);\n const [error, template] = await tryToCatch(Files.get, 'view/media-tmpl');\n if (error) return [error];\n const {\n name\n } = Info;\n if (!TemplateAudio) TemplateAudio = template;\n const is = isAudio(name);\n const type = is ? 'audio' : 'video';\n const innerHTML = rendy(TemplateAudio, {\n src,\n type,\n name\n });\n const element = createElement('div', {\n innerHTML\n });\n return [null, element];\n}\n\nfunction check(src) {\n if (typeof src !== 'string') throw Error('src should be a string!');\n}\n/**\n * function loads css and js of FancyBox\n * @callback - executes, when everything loaded\n */\n\n\nasync function loadAll() {\n const {\n prefix\n } = CloudCmd;\n time(Name + ' load');\n Loading = true;\n await loadCSS(`${prefix}/dist/view.css`);\n Loading = false;\n}\n\nfunction onOverlayClick(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n setCurrentByPosition(position);\n}\n\nfunction setCurrentByPosition(position) {\n const element = DOM.getCurrentByPosition(position);\n if (!element) return;\n const {\n files,\n filesPassive\n } = Info;\n const isFiles = files.includes(element);\n const isFilesPassive = filesPassive.includes(element);\n if (!isFiles && !isFilesPassive) return;\n const isCurrent = DOM.isCurrentFile(element);\n if (isCurrent) return;\n DOM.setCurrentFile(element);\n}\n\nfunction listener(_ref) {\n let {\n keyCode\n } = _ref;\n if (keyCode === Key.ESC) hide();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/index.js");
166
+ eval("\n\n/* global CloudCmd, DOM */\n__webpack_require__(/*! ../../../css/view.css */ \"./css/view.css\");\nconst rendy = __webpack_require__(/*! rendy */ \"./node_modules/rendy/lib/rendy.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst wraptile = __webpack_require__(/*! wraptile */ \"./node_modules/wraptile/lib/wraptile.js\");\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst load = __webpack_require__(/*! load.js */ \"./node_modules/load.js/lib/load.js\");\nconst modal = __webpack_require__(/*! @cloudcmd/modal */ \"./node_modules/@cloudcmd/modal/lib/modal.js\");\nconst createElement = __webpack_require__(/*! @cloudcmd/create-element */ \"./node_modules/@cloudcmd/create-element/lib/create-element.js\");\nconst {\n time\n} = __webpack_require__(/*! ../../../common/util */ \"./common/util.js\");\nconst {\n FS\n} = __webpack_require__(/*! ../../../common/cloudfunc */ \"./common/cloudfunc.js\");\nconst {\n isImage,\n isAudio,\n getType\n} = __webpack_require__(/*! ./types */ \"./client/modules/view/types.js\");\nconst Files = __webpack_require__(/*! ../../dom/files */ \"./client/dom/files.js\");\nconst Events = __webpack_require__(/*! ../../dom/events */ \"./client/dom/events/index.js\");\nconst Images = __webpack_require__(/*! ../../dom/images */ \"./client/dom/images.js\");\nconst {\n encode\n} = __webpack_require__(/*! ../../../common/entity */ \"./common/entity.js\");\nconst {\n assign\n} = Object;\nconst {\n isArray\n} = Array;\nconst lifo = currify((fn, el, cb, name) => fn(name, el, cb));\nconst series = wraptile(function () {\n for (var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++) {\n a[_key] = arguments[_key];\n }\n for (const f of a) f();\n});\nconst isFn = a => typeof a === 'function';\nconst noop = () => {};\nconst addEvent = lifo(Events.add);\nconst loadCSS = load.css;\nmodule.exports.show = show;\nmodule.exports.hide = hide;\nlet Loading = false;\nconst Name = 'View';\nCloudCmd[Name] = module.exports;\nconst Info = DOM.CurrentInfo;\nconst {\n Key\n} = CloudCmd;\nconst basename = a => a.split('/').pop();\nlet El;\nlet TemplateAudio;\nlet Overlay;\nconst Config = {\n beforeShow: () => {\n Images.hide();\n Key.unsetBind();\n },\n beforeClose: () => {\n Events.rmKey(listener);\n Key.setBind();\n },\n afterShow: () => {\n El.focus();\n },\n onOverlayClick,\n afterClose: noop,\n autoSize: false,\n helpers: {\n title: {}\n }\n};\nmodule.exports._Config = Config;\nmodule.exports.init = async () => {\n await loadAll();\n const events = ['click', 'contextmenu'];\n events.forEach(addEvent(Overlay, onOverlayClick));\n};\nasync function show(data) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const prefixURL = CloudCmd.prefixURL + FS;\n if (Loading) return;\n if (!options || options.bindKeys !== false) Events.addKey(listener);\n El = createElement('div', {\n className: 'view',\n notAppend: true\n });\n El.tabIndex = 0;\n if (data) {\n if (isArray(data)) El.append(...data);else El.append(data);\n modal.open(El, initConfig(options));\n return;\n }\n Images.show.load();\n const path = prefixURL + Info.path;\n const type = options.raw ? '' : await getType(path);\n switch (type) {\n default:\n return await viewFile();\n case 'markdown':\n return await CloudCmd.Markdown.show(Info.path);\n case 'html':\n return viewHtml(path);\n case 'image':\n return viewImage(Info.path, prefixURL);\n case 'media':\n return await viewMedia(path);\n case 'pdf':\n return viewPDF(path);\n }\n}\nmodule.exports._createIframe = createIframe;\nfunction createIframe(src) {\n const element = createElement('iframe', {\n src,\n width: '100%',\n height: '100%'\n });\n element.addEventListener('load', () => {\n element.contentWindow.addEventListener('keydown', listener);\n });\n return element;\n}\nmodule.exports._viewHtml = viewHtml;\nfunction viewHtml(src) {\n modal.open(createIframe(src), Config);\n}\nfunction viewPDF(src) {\n const element = createIframe(src);\n const options = assign({}, Config);\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n modal.open(element, options);\n}\nasync function viewMedia(path) {\n const [e, element] = await getMediaElement(path);\n if (e) return alert(e);\n const allConfig = {\n ...Config,\n ...{\n autoSize: true,\n afterShow: () => {\n element.querySelector('audio, video').focus();\n }\n }\n };\n modal.open(element, allConfig);\n}\nasync function viewFile() {\n const [error, data] = await Info.getData();\n if (error) return Images.hide();\n const element = document.createTextNode(data);\n const options = Config;\n if (CloudCmd.config('showFileName')) options.title = Info.name;\n El.append(element);\n modal.open(El, options);\n}\nconst copy = a => assign({}, a);\nmodule.exports._initConfig = initConfig;\nfunction initConfig(options) {\n const config = copy(Config);\n if (!options) return config;\n const names = Object.keys(options);\n for (const name of names) {\n const isConfig = Boolean(config[name]);\n const item = options[name];\n if (!isFn(item) || !isConfig) {\n config[name] = options[name];\n continue;\n }\n const fn = config[name];\n config[name] = series(fn, item);\n }\n return config;\n}\nfunction hide() {\n modal.close();\n}\nfunction viewImage(path, prefixURL) {\n const isSupportedImage = a => isImage(a) || a === path;\n const makeTitle = path => ({\n href: `${prefixURL}${path}`,\n title: encode(basename(path))\n });\n const names = Info.files.map(DOM.getCurrentPath).filter(isSupportedImage);\n const titles = names.map(makeTitle);\n const index = names.indexOf(Info.path);\n const imageConfig = {\n index,\n autoSize: true,\n arrows: true,\n keys: true,\n helpers: {\n title: {}\n }\n };\n const config = {\n ...Config,\n ...imageConfig\n };\n modal.open(titles, config);\n}\nasync function getMediaElement(src) {\n check(src);\n const [error, template] = await tryToCatch(Files.get, 'view/media-tmpl');\n if (error) return [error];\n const {\n name\n } = Info;\n if (!TemplateAudio) TemplateAudio = template;\n const is = isAudio(name);\n const type = is ? 'audio' : 'video';\n const innerHTML = rendy(TemplateAudio, {\n src,\n type,\n name\n });\n const element = createElement('div', {\n innerHTML\n });\n return [null, element];\n}\nfunction check(src) {\n if (typeof src !== 'string') throw Error('src should be a string!');\n}\n\n/**\n * function loads css and js of FancyBox\n * @callback - executes, when everything loaded\n */\nasync function loadAll() {\n const {\n prefix\n } = CloudCmd;\n time(Name + ' load');\n Loading = true;\n await loadCSS(`${prefix}/dist/view.css`);\n Loading = false;\n}\nfunction onOverlayClick(event) {\n const position = {\n x: event.clientX,\n y: event.clientY\n };\n setCurrentByPosition(position);\n}\nfunction setCurrentByPosition(position) {\n const element = DOM.getCurrentByPosition(position);\n if (!element) return;\n const {\n files,\n filesPassive\n } = Info;\n const isFiles = files.includes(element);\n const isFilesPassive = filesPassive.includes(element);\n if (!isFiles && !isFilesPassive) return;\n const isCurrent = DOM.isCurrentFile(element);\n if (isCurrent) return;\n DOM.setCurrentFile(element);\n}\nfunction listener(_ref) {\n let {\n keyCode\n } = _ref;\n if (keyCode === Key.ESC) hide();\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/index.js");
167
167
 
168
168
  /***/ }),
169
169
 
@@ -175,7 +175,7 @@ eval("\n/* global CloudCmd, DOM */\n\n__webpack_require__(/*! ../../../css/view.
175
175
  /***/ (function(module, exports, __webpack_require__) {
176
176
 
177
177
  "use strict";
178
- eval("\n\nconst {\n extname\n} = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\n\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\n\nconst testRegExp = currify((name, reg) => reg.test(name));\n\nconst getRegExp = ext => RegExp(`\\\\.${ext}$`, 'i');\n\nconst isPDF = a => /\\.pdf$/i.test(a);\n\nconst isHTML = a => /\\.html$/.test(a);\n\nconst isMarkdown = a => /.\\.md$/.test(a);\n\nmodule.exports.getType = async path => {\n const ext = extname(path);\n if (!ext) path = await detectType(path);\n if (isPDF(path)) return 'pdf';\n if (isImage(path)) return 'image';\n if (isMedia(path)) return 'media';\n if (isHTML(path)) return 'html';\n if (isMarkdown(path)) return 'markdown';\n};\n\nmodule.exports.isImage = isImage;\n\nfunction isImage(name) {\n const images = ['jp(e|g|eg)', 'gif', 'png', 'bmp', 'webp', 'svg', 'ico'];\n return images.map(getRegExp).some(testRegExp(name));\n}\n\nfunction isMedia(name) {\n return isAudio(name) || isVideo(name);\n}\n\nmodule.exports.isAudio = isAudio;\n\nfunction isAudio(name) {\n return /\\.(mp3|ogg|m4a)$/i.test(name);\n}\n\nfunction isVideo(name) {\n return /\\.(mp4|avi|webm)$/i.test(name);\n}\n\nmodule.exports._detectType = detectType;\n\nasync function detectType(path) {\n const {\n headers\n } = await fetch(path, {\n method: 'HEAD'\n });\n\n for (const [name, value] of headers) {\n if (name === 'content-type') return `.${value.split('/').pop()}`;\n }\n\n return '';\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/types.js");
178
+ eval("\n\nconst {\n extname\n} = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst testRegExp = currify((name, reg) => reg.test(name));\nconst getRegExp = ext => RegExp(`\\\\.${ext}$`, 'i');\nconst isPDF = a => /\\.pdf$/i.test(a);\nconst isHTML = a => /\\.html$/.test(a);\nconst isMarkdown = a => /.\\.md$/.test(a);\nmodule.exports.getType = async path => {\n const ext = extname(path);\n if (!ext) path = await detectType(path);\n if (isPDF(path)) return 'pdf';\n if (isImage(path)) return 'image';\n if (isMedia(path)) return 'media';\n if (isHTML(path)) return 'html';\n if (isMarkdown(path)) return 'markdown';\n};\nmodule.exports.isImage = isImage;\nfunction isImage(name) {\n const images = ['jp(e|g|eg)', 'gif', 'png', 'bmp', 'webp', 'svg', 'ico'];\n return images.map(getRegExp).some(testRegExp(name));\n}\nfunction isMedia(name) {\n return isAudio(name) || isVideo(name);\n}\nmodule.exports.isAudio = isAudio;\nfunction isAudio(name) {\n return /\\.(mp3|ogg|m4a)$/i.test(name);\n}\nfunction isVideo(name) {\n return /\\.(mp4|avi|webm)$/i.test(name);\n}\nmodule.exports._detectType = detectType;\nasync function detectType(path) {\n const {\n headers\n } = await fetch(path, {\n method: 'HEAD'\n });\n for (const [name, value] of headers) {\n if (name === 'content-type') return `.${value.split('/').pop()}`;\n }\n return '';\n}\n\n//# sourceURL=file://cloudcmd/client/modules/view/types.js");
179
179
 
180
180
  /***/ }),
181
181
 
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 (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\n\nconst getPathName = url => new URL(url).pathname;\n\nconst date = \"Sun Oct 09 2022 20:31:13 GMT+0300 (Eastern European Summer 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");
104
+ eval("\n\nconst tryToCatch = __webpack_require__(/*! try-to-catch */ \"./node_modules/try-to-catch/lib/try-to-catch.js\");\nconst currify = __webpack_require__(/*! currify */ \"./node_modules/currify/lib/currify.js\");\nconst isDev = \"development\" === 'development';\nconst isGet = a => a.method === 'GET';\nconst isBasic = a => a.type === 'basic';\nconst wait = currify((f, e) => e.waitUntil(f()));\nconst respondWith = currify((f, e) => {\n const {\n request\n } = e;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n if (url.endsWith('/') || /\\^\\/fs/.test(pathname)) return;\n if (!isGet(request)) return;\n if (!isBasic(request)) return;\n if (pathname.startsWith('/api')) return;\n if (/^socket.io/.test(pathname)) return;\n e.respondWith(f(e));\n});\nconst getPathName = url => new URL(url).pathname;\nconst date = \"Sun Jan 15 2023 19:21:47 GMT+0200 (Eastern European Standard Time)\";\nconst NAME = `cloudcmd: ${date}`;\nconst createRequest = a => new Request(a, {\n credentials: 'same-origin'\n});\nconst getRequest = (a, request) => {\n if (a !== '/') return request;\n return createRequest('/');\n};\nself.addEventListener('install', wait(onInstall));\nself.addEventListener('fetch', respondWith(onFetch));\nself.addEventListener('activate', wait(onActivate));\nasync function onActivate() {\n console.info(`cloudcmd: sw: activate: ${NAME}`);\n await self.clients.claim();\n const keys = await caches.keys();\n const deleteCache = caches.delete.bind(caches);\n await Promise.all(keys.map(deleteCache));\n}\nasync function onInstall() {\n console.info(`cloudcmd: sw: install: ${NAME}`);\n await self.skipWaiting();\n}\nasync function onFetch(event) {\n const {\n request\n } = event;\n const {\n url\n } = request;\n const pathname = getPathName(url);\n const newRequest = getRequest(pathname, event.request);\n const cache = await caches.open(NAME);\n const response = await cache.match(request);\n if (!isDev && response) return response;\n const [e, resp] = await tryToCatch(fetch, newRequest, {\n credentials: 'same-origin'\n });\n if (e) return new Response(e.message);\n await addToCache(request, resp.clone());\n return resp;\n}\nasync function addToCache(request, response) {\n const cache = await caches.open(NAME);\n return cache.put(request, response);\n}\n\n//# sourceURL=file://cloudcmd/client/sw/sw.js");
105
105
 
106
106
  /***/ }),
107
107
 
@@ -1,6 +1,7 @@
1
1
  .cloudcmd-user-menu {
2
2
  font-size: 16px;
3
3
  font-family: 'Droid Sans Mono', 'Ubuntu Mono', 'Consolas', monospace;
4
+ border: 0;
4
5
  }
5
6
 
6
7
  .cloudcmd-user-menu:focus {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcmd",
3
- "version": "16.6.0",
3
+ "version": "16.7.0",
4
4
  "type": "commonjs",
5
5
  "commitType": "colon",
6
6
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
@@ -120,10 +120,10 @@
120
120
  "once": "^1.4.0",
121
121
  "onezip": "^5.0.0",
122
122
  "open": "^8.0.5",
123
- "package-json": "^7.0.0",
123
+ "package-json": "^8.1.0",
124
124
  "ponse": "^7.0.0",
125
125
  "pullout": "^4.0.0",
126
- "putout": "^27.0.1",
126
+ "putout": "^28.0.0",
127
127
  "redzip": "^2.0.0",
128
128
  "rendy": "^3.0.0",
129
129
  "restafary": "^11.0.0",
@@ -150,17 +150,16 @@
150
150
  "@babel/preset-env": "^7.0.0",
151
151
  "@cloudcmd/clipboard": "^2.0.0",
152
152
  "@cloudcmd/create-element": "^2.0.0",
153
- "@cloudcmd/modal": "^2.0.0",
153
+ "@cloudcmd/modal": "^3.0.0",
154
154
  "@cloudcmd/olark": "^3.0.2",
155
155
  "@cloudcmd/stub": "^4.0.1",
156
- "auto-globals": "^2.0.0",
156
+ "auto-globals": "^3.0.0",
157
157
  "babel-loader": "^8.0.0",
158
158
  "babel-plugin-macros": "^3.0.0",
159
159
  "c8": "^7.5.0",
160
160
  "cheerio": "^1.0.0-rc.5",
161
161
  "clean-css-loader": "^2.0.0",
162
162
  "codegen.macro": "^4.0.0",
163
- "coveralls": "^3.0.0",
164
163
  "css-loader": "^3.0.0",
165
164
  "css-modules-require-hook": "^4.2.3",
166
165
  "domtokenlist-shim": "^1.2.0",
@@ -191,14 +190,14 @@
191
190
  "place": "^1.1.4",
192
191
  "readjson": "^2.0.1",
193
192
  "request": "^2.76.0",
194
- "rimraf": "^3.0.0",
193
+ "rimraf": "^4.0.5",
195
194
  "scroll-into-view-if-needed": "^2.2.5",
196
195
  "serve-once": "^2.0.0",
197
196
  "serviceworker-webpack-plugin": "^1.0.1",
198
197
  "smalltalk": "^4.0.0",
199
198
  "style-loader": "^2.0.0",
200
199
  "supermenu": "^4.0.1",
201
- "supertape": "^7.1.0",
200
+ "supertape": "^8.1.0",
202
201
  "tar-stream": "^2.0.0",
203
202
  "unionfs": "^4.0.0",
204
203
  "url-loader": "^4.0.0",