-
-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathmain.js
90 lines (79 loc) · 2.17 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* Copyright (c) 2018. by Pablo Klaschka
*/
const showModal = require('./src/modals/mainTATModal');
const debugHelper = require("./src/helpers/debug");
async function modal(selection, root) {
try {
await showModal(selection, root);
debugHelper.log('TAT is done.')
} catch (e) {
debugHelper.log('TAT aported');
}
}
async function replaceText(selection) {
try {
debugHelper.log('replaceText()');
await (require('./src/modals/findAndReplaceModal'))(selection);
} catch (e) {
debugHelper.log('replaceText() aported');
}
}
async function exportText(selection, root) {
try {
debugHelper.log('exportText()');
await (require('./src/functions/exportText'))(root);
} catch (e) {
debugHelper.log('exportText() aported');
}
}
async function capitalize(selection) {
try {
debugHelper.log('capitalize()');
await (require('./src/functions/capitalize'))(selection);
} catch (e) {
debugHelper.log('capitalize() aported');
}
}
function trimHeight(selection) {
try {
debugHelper.log('trimHeight()');
const trim = require('./src/functions/trimHeight');
trim(selection);
} catch (e) {
debugHelper.log('trimHeight() aported');
}
}
async function lorem(selection) {
debugHelper.log('lorem()');
const lorem = require('./src/modals/loremModal');
await lorem(selection);
}
async function copyHTML(selection) {
debugHelper.log('copyHTML()');
const copyHTML = require('./src/modals/copyHTMLModal');
await copyHTML(selection);
}
async function settings(selection) {
debugHelper.log('settings()');
const settings = require('./src/modals/settingsModal');
await settings(selection);
}
async function help() {
(require('./src/functions/help'))();
debugHelper.log('help()');
}
// noinspection JSUnusedGlobalSymbols
module.exports = {
commands: {
modal: modal,
replaceText: replaceText,
exportText: exportText,
capitalize: capitalize,
lorem: lorem,
trimHeight: trimHeight,
copyHTML: copyHTML,
settings: settings,
help: help,
}
};