mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-04 05:33:10 +00:00
chore: lint
This commit is contained in:
parent
f1279666b5
commit
4717e035ee
173 changed files with 1388 additions and 1627 deletions
|
|
@ -33,7 +33,7 @@ const ConfigView = {
|
|||
|
||||
module.exports.init = async () => {
|
||||
const element = create();
|
||||
|
||||
|
||||
await CloudCmd.View();
|
||||
await loadFiles(element);
|
||||
};
|
||||
|
|
@ -47,9 +47,9 @@ function create() {
|
|||
`,
|
||||
notAppend: true,
|
||||
});
|
||||
|
||||
|
||||
Element = element;
|
||||
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
|
|
@ -63,30 +63,29 @@ function initConfig(options = {}) {
|
|||
...options,
|
||||
...ConfigView,
|
||||
};
|
||||
|
||||
|
||||
if (!options.afterShow)
|
||||
return config;
|
||||
|
||||
|
||||
checkFn('options.afterShow', options.afterShow);
|
||||
|
||||
|
||||
config.afterShow = () => {
|
||||
ConfigView.afterShow();
|
||||
options.afterShow();
|
||||
};
|
||||
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
module.exports.show = (options) => {
|
||||
if (Loading)
|
||||
return;
|
||||
|
||||
|
||||
CloudCmd.View.show(Element, initConfig(options));
|
||||
|
||||
getEditor()
|
||||
.setOptions({
|
||||
fontSize: 16,
|
||||
});
|
||||
|
||||
getEditor().setOptions({
|
||||
fontSize: 16,
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.getEditor = getEditor;
|
||||
|
|
@ -106,11 +105,11 @@ const loadFiles = async (element) => {
|
|||
const socketPath = CloudCmd.prefix;
|
||||
const prefixSocket = `${CloudCmd.prefixSocket}/${EditorName}`;
|
||||
const url = `${prefix}/${EditorName}.js`;
|
||||
|
||||
|
||||
time(`${Name} load`);
|
||||
|
||||
|
||||
await loadJS(url);
|
||||
|
||||
|
||||
const word = promisify(window[EditorName]);
|
||||
const [ed] = await tryToCatch(word, element, {
|
||||
maxSize,
|
||||
|
|
@ -118,9 +117,8 @@ const loadFiles = async (element) => {
|
|||
prefixSocket,
|
||||
socketPath,
|
||||
});
|
||||
|
||||
|
||||
timeEnd(`${Name} load`);
|
||||
editor = ed;
|
||||
Loading = false;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue