chore: lint

This commit is contained in:
coderaiser 2023-07-09 12:43:24 +03:00
parent f1279666b5
commit 4717e035ee
173 changed files with 1388 additions and 1627 deletions

View file

@ -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;
};