mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature: client: edit-file: migrate to ESM
This commit is contained in:
parent
c9f57c5f20
commit
2c2ca8eb39
3 changed files with 18 additions and 19 deletions
|
|
@ -4,9 +4,9 @@ import wraptile from 'wraptile';
|
|||
import load from 'load.js';
|
||||
import * as Util from '#common/util';
|
||||
import * as CloudFunc from '#common/cloudfunc';
|
||||
import DOM from '#dom';
|
||||
import {registerSW, listenSW} from './sw/register.mjs';
|
||||
import {initSortPanel, sortPanel} from './sort.mjs';
|
||||
import DOM from '#dom';
|
||||
import {createCloudCmd} from './client.mjs';
|
||||
import * as Listeners from './listeners/index.mjs';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
'use strict';
|
||||
|
||||
/* global CloudCmd, DOM*/
|
||||
CloudCmd.EditFile = exports;
|
||||
import Format from 'format-io';
|
||||
import {fullstore} from 'fullstore';
|
||||
import exec from 'execon';
|
||||
import supermenu from 'supermenu';
|
||||
|
||||
const Format = require('format-io');
|
||||
const {fullstore} = require('fullstore');
|
||||
const exec = require('execon');
|
||||
const supermenu = require('supermenu');
|
||||
CloudCmd.EditFile = {
|
||||
init,
|
||||
show,
|
||||
hide,
|
||||
isChanged,
|
||||
};
|
||||
|
||||
const Info = DOM.CurrentInfo;
|
||||
|
||||
|
|
@ -26,7 +29,7 @@ const ConfigView = {
|
|||
},
|
||||
};
|
||||
|
||||
module.exports.init = async () => {
|
||||
export async function init() {
|
||||
isLoading(true);
|
||||
|
||||
await CloudCmd.Edit();
|
||||
|
|
@ -36,7 +39,7 @@ module.exports.init = async () => {
|
|||
setListeners(editor);
|
||||
|
||||
isLoading(false);
|
||||
};
|
||||
}
|
||||
|
||||
function getName() {
|
||||
const {name, isDir} = Info;
|
||||
|
|
@ -47,7 +50,7 @@ function getName() {
|
|||
return name;
|
||||
}
|
||||
|
||||
module.exports.show = async (options) => {
|
||||
export async function show(options) {
|
||||
if (isLoading())
|
||||
return;
|
||||
|
||||
|
|
@ -86,11 +89,9 @@ module.exports.show = async (options) => {
|
|||
CloudCmd.Edit.show(optionsEdit);
|
||||
|
||||
return CloudCmd.Edit;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports.hide = hide;
|
||||
|
||||
function hide() {
|
||||
export function hide() {
|
||||
CloudCmd.Edit.hide();
|
||||
}
|
||||
|
||||
|
|
@ -176,9 +177,7 @@ function setMsgChanged(name) {
|
|||
MSG_CHANGED = `Do you want to save changes to ${name}?`;
|
||||
}
|
||||
|
||||
module.exports.isChanged = isChanged;
|
||||
|
||||
async function isChanged() {
|
||||
export async function isChanged() {
|
||||
const editor = CloudCmd.Edit.getEditor();
|
||||
const is = editor.isChanged();
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue