iobroker.imap 0.1.2 → 0.2.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.
- package/README.md +19 -4
- package/admin/blockly.js +654 -694
- package/io-package.json +34 -31
- package/lib/Connection.js +11 -7
- package/lib/imap_event.js +32 -7
- package/main.js +17 -3
- package/package.json +19 -19
package/admin/blockly.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable no-var */
|
|
2
2
|
/* eslint-disable no-undef */
|
|
3
3
|
// @ts-nocheck
|
|
4
|
-
|
|
4
|
+
'use strict';
|
|
5
5
|
|
|
6
|
-
if (typeof goog !==
|
|
7
|
-
goog.provide(
|
|
8
|
-
goog.require(
|
|
6
|
+
if (typeof goog !== 'undefined') {
|
|
7
|
+
goog.provide('Blockly.JavaScript.Sendto');
|
|
8
|
+
goog.require('Blockly.JavaScript');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
Blockly.Translate =
|
|
@@ -20,434 +20,447 @@ Blockly.Translate =
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/// --- SendTo imap --------------------------------------------------
|
|
23
|
-
Blockly.Words[
|
|
24
|
-
en:
|
|
25
|
-
de:
|
|
26
|
-
ru:
|
|
27
|
-
pt:
|
|
28
|
-
nl:
|
|
29
|
-
fr:
|
|
30
|
-
it:
|
|
31
|
-
es:
|
|
32
|
-
pl:
|
|
33
|
-
uk:
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
Blockly.Words[
|
|
37
|
-
en:
|
|
38
|
-
de:
|
|
39
|
-
ru:
|
|
40
|
-
pt:
|
|
41
|
-
nl:
|
|
42
|
-
fr:
|
|
43
|
-
it:
|
|
44
|
-
es:
|
|
45
|
-
pl:
|
|
46
|
-
uk:
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
Blockly.Words[
|
|
50
|
-
en:
|
|
51
|
-
de:
|
|
52
|
-
ru:
|
|
53
|
-
pt:
|
|
54
|
-
nl:
|
|
55
|
-
fr:
|
|
56
|
-
it:
|
|
57
|
-
es:
|
|
58
|
-
pl:
|
|
59
|
-
uk:
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
Blockly.Words[
|
|
63
|
-
en:
|
|
64
|
-
de:
|
|
65
|
-
ru:
|
|
66
|
-
pt:
|
|
67
|
-
nl:
|
|
68
|
-
fr:
|
|
69
|
-
it:
|
|
70
|
-
es:
|
|
71
|
-
pl:
|
|
72
|
-
uk:
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
Blockly.Words[
|
|
76
|
-
en:
|
|
77
|
-
de:
|
|
78
|
-
ru:
|
|
79
|
-
pt:
|
|
80
|
-
nl:
|
|
81
|
-
fr:
|
|
82
|
-
it:
|
|
83
|
-
es:
|
|
84
|
-
pl:
|
|
85
|
-
uk:
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
Blockly.Words[
|
|
89
|
-
en:
|
|
90
|
-
de:
|
|
91
|
-
ru:
|
|
92
|
-
pt:
|
|
93
|
-
nl:
|
|
94
|
-
fr:
|
|
95
|
-
it:
|
|
96
|
-
es:
|
|
97
|
-
pl:
|
|
98
|
-
uk:
|
|
99
|
-
|
|
100
|
-
};
|
|
101
|
-
Blockly.Words[
|
|
102
|
-
en:
|
|
103
|
-
de:
|
|
104
|
-
ru:
|
|
105
|
-
pt:
|
|
106
|
-
nl:
|
|
107
|
-
fr:
|
|
108
|
-
it:
|
|
109
|
-
es:
|
|
110
|
-
pl:
|
|
111
|
-
uk:
|
|
112
|
-
|
|
113
|
-
};
|
|
114
|
-
Blockly.Words[
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
};
|
|
127
|
-
Blockly.Words[
|
|
128
|
-
en:
|
|
129
|
-
de:
|
|
130
|
-
ru:
|
|
131
|
-
pt:
|
|
132
|
-
nl:
|
|
133
|
-
fr:
|
|
134
|
-
it:
|
|
135
|
-
es:
|
|
136
|
-
pl:
|
|
137
|
-
uk:
|
|
138
|
-
|
|
139
|
-
};
|
|
140
|
-
Blockly.Words[
|
|
141
|
-
en:
|
|
142
|
-
de:
|
|
143
|
-
ru:
|
|
144
|
-
pt:
|
|
145
|
-
nl:
|
|
146
|
-
fr:
|
|
147
|
-
it:
|
|
148
|
-
es:
|
|
149
|
-
pl:
|
|
150
|
-
uk:
|
|
151
|
-
|
|
152
|
-
};
|
|
153
|
-
Blockly.Words[
|
|
154
|
-
en:
|
|
155
|
-
de:
|
|
156
|
-
ru:
|
|
157
|
-
pt:
|
|
158
|
-
nl:
|
|
159
|
-
fr:
|
|
160
|
-
it:
|
|
161
|
-
es:
|
|
162
|
-
pl:
|
|
163
|
-
uk:
|
|
164
|
-
|
|
165
|
-
};
|
|
166
|
-
Blockly.Words[
|
|
167
|
-
en:
|
|
168
|
-
de:
|
|
169
|
-
ru:
|
|
170
|
-
pt:
|
|
171
|
-
nl:
|
|
172
|
-
fr:
|
|
173
|
-
it:
|
|
174
|
-
es:
|
|
175
|
-
pl:
|
|
176
|
-
uk:
|
|
177
|
-
|
|
178
|
-
};
|
|
179
|
-
Blockly.Words[
|
|
180
|
-
en:
|
|
181
|
-
de:
|
|
182
|
-
ru:
|
|
183
|
-
pt:
|
|
184
|
-
nl:
|
|
185
|
-
fr:
|
|
186
|
-
it:
|
|
187
|
-
es:
|
|
188
|
-
pl:
|
|
189
|
-
uk:
|
|
190
|
-
|
|
191
|
-
};
|
|
192
|
-
Blockly.Words[
|
|
193
|
-
en:
|
|
194
|
-
de:
|
|
195
|
-
ru:
|
|
196
|
-
pt:
|
|
197
|
-
nl:
|
|
198
|
-
fr:
|
|
199
|
-
it:
|
|
200
|
-
es:
|
|
201
|
-
pl:
|
|
202
|
-
uk:
|
|
203
|
-
|
|
204
|
-
};
|
|
205
|
-
Blockly.Words[
|
|
206
|
-
en:
|
|
207
|
-
de:
|
|
208
|
-
ru:
|
|
209
|
-
pt:
|
|
210
|
-
nl:
|
|
211
|
-
fr:
|
|
212
|
-
it:
|
|
213
|
-
es:
|
|
214
|
-
pl:
|
|
215
|
-
uk:
|
|
216
|
-
|
|
217
|
-
};
|
|
218
|
-
Blockly.Words[
|
|
219
|
-
en:
|
|
220
|
-
de:
|
|
221
|
-
ru:
|
|
222
|
-
pt:
|
|
223
|
-
nl:
|
|
224
|
-
fr:
|
|
225
|
-
it:
|
|
226
|
-
es:
|
|
227
|
-
pl:
|
|
228
|
-
uk:
|
|
229
|
-
|
|
230
|
-
};
|
|
231
|
-
Blockly.Words[
|
|
232
|
-
en:
|
|
233
|
-
de:
|
|
234
|
-
ru:
|
|
235
|
-
pt:
|
|
236
|
-
nl:
|
|
237
|
-
fr:
|
|
238
|
-
it:
|
|
239
|
-
es:
|
|
240
|
-
pl:
|
|
241
|
-
uk:
|
|
242
|
-
|
|
243
|
-
};
|
|
244
|
-
Blockly.Words[
|
|
245
|
-
en:
|
|
246
|
-
de:
|
|
247
|
-
ru:
|
|
248
|
-
pt:
|
|
249
|
-
nl:
|
|
250
|
-
fr:
|
|
251
|
-
it:
|
|
252
|
-
es:
|
|
253
|
-
pl:
|
|
254
|
-
uk:
|
|
255
|
-
|
|
256
|
-
};
|
|
257
|
-
Blockly.Words[
|
|
258
|
-
en:
|
|
259
|
-
de:
|
|
260
|
-
ru:
|
|
261
|
-
pt:
|
|
262
|
-
nl:
|
|
263
|
-
fr:
|
|
264
|
-
it:
|
|
265
|
-
es:
|
|
266
|
-
pl:
|
|
267
|
-
uk:
|
|
268
|
-
|
|
269
|
-
};
|
|
270
|
-
Blockly.Words[
|
|
271
|
-
en:
|
|
272
|
-
de:
|
|
273
|
-
ru:
|
|
274
|
-
pt:
|
|
275
|
-
nl:
|
|
276
|
-
fr:
|
|
277
|
-
it:
|
|
278
|
-
es:
|
|
279
|
-
pl:
|
|
280
|
-
uk:
|
|
281
|
-
|
|
282
|
-
};
|
|
283
|
-
Blockly.Words[
|
|
284
|
-
en:
|
|
285
|
-
de:
|
|
286
|
-
ru:
|
|
287
|
-
pt:
|
|
288
|
-
nl:
|
|
289
|
-
fr:
|
|
290
|
-
it:
|
|
291
|
-
es:
|
|
292
|
-
pl:
|
|
293
|
-
uk:
|
|
294
|
-
|
|
295
|
-
};
|
|
296
|
-
Blockly.Words[
|
|
297
|
-
en:
|
|
298
|
-
de:
|
|
299
|
-
ru:
|
|
300
|
-
pt:
|
|
301
|
-
nl:
|
|
302
|
-
fr:
|
|
303
|
-
it:
|
|
304
|
-
es:
|
|
305
|
-
pl:
|
|
306
|
-
uk:
|
|
307
|
-
|
|
308
|
-
};
|
|
309
|
-
Blockly.Words[
|
|
310
|
-
en:
|
|
311
|
-
de:
|
|
312
|
-
ru:
|
|
313
|
-
pt:
|
|
314
|
-
nl:
|
|
315
|
-
fr:
|
|
316
|
-
it:
|
|
317
|
-
es:
|
|
318
|
-
pl:
|
|
319
|
-
uk:
|
|
320
|
-
|
|
321
|
-
};
|
|
322
|
-
Blockly.Words[
|
|
323
|
-
en:
|
|
324
|
-
de:
|
|
325
|
-
ru:
|
|
326
|
-
pt:
|
|
327
|
-
nl:
|
|
328
|
-
fr:
|
|
329
|
-
it:
|
|
330
|
-
es:
|
|
331
|
-
pl:
|
|
332
|
-
uk:
|
|
333
|
-
|
|
334
|
-
};
|
|
335
|
-
Blockly.Words[
|
|
336
|
-
en:
|
|
337
|
-
de:
|
|
338
|
-
ru:
|
|
339
|
-
pt:
|
|
340
|
-
nl:
|
|
341
|
-
fr:
|
|
342
|
-
it:
|
|
343
|
-
es:
|
|
344
|
-
pl:
|
|
345
|
-
uk:
|
|
346
|
-
|
|
347
|
-
};
|
|
348
|
-
Blockly.Words[
|
|
349
|
-
en:
|
|
350
|
-
de:
|
|
351
|
-
ru:
|
|
352
|
-
pt:
|
|
353
|
-
nl:
|
|
354
|
-
fr:
|
|
355
|
-
it:
|
|
356
|
-
es:
|
|
357
|
-
pl:
|
|
358
|
-
uk:
|
|
359
|
-
|
|
360
|
-
};
|
|
361
|
-
Blockly.Words[
|
|
362
|
-
en:
|
|
363
|
-
de:
|
|
364
|
-
ru:
|
|
365
|
-
pt:
|
|
366
|
-
nl:
|
|
367
|
-
fr:
|
|
368
|
-
it:
|
|
369
|
-
es:
|
|
370
|
-
pl:
|
|
371
|
-
uk:
|
|
372
|
-
|
|
373
|
-
};
|
|
374
|
-
Blockly.Words[
|
|
375
|
-
en:
|
|
376
|
-
de:
|
|
377
|
-
ru:
|
|
378
|
-
pt:
|
|
379
|
-
nl:
|
|
380
|
-
fr:
|
|
381
|
-
it:
|
|
382
|
-
es:
|
|
383
|
-
pl:
|
|
384
|
-
uk:
|
|
385
|
-
|
|
386
|
-
};
|
|
387
|
-
Blockly.
|
|
23
|
+
Blockly.Words['no_instance_found'] = {
|
|
24
|
+
en: 'No instance found',
|
|
25
|
+
de: 'Keine Instanz gefunden',
|
|
26
|
+
ru: 'Не найден',
|
|
27
|
+
pt: 'Nenhuma instância encontrada',
|
|
28
|
+
nl: 'Geen instantie gevonden',
|
|
29
|
+
fr: 'Aucune instance trouvée',
|
|
30
|
+
it: 'Nessun caso trovato',
|
|
31
|
+
es: 'No hay caso encontrado',
|
|
32
|
+
pl: 'Brak',
|
|
33
|
+
uk: 'Не знайдено',
|
|
34
|
+
'zh-cn': '未找到实例',
|
|
35
|
+
};
|
|
36
|
+
Blockly.Words['imap'] = {
|
|
37
|
+
en: 'IMAP',
|
|
38
|
+
de: 'IMAP',
|
|
39
|
+
ru: 'ИМАП',
|
|
40
|
+
pt: 'IMAPEL',
|
|
41
|
+
nl: 'IMAP',
|
|
42
|
+
fr: 'IMAP',
|
|
43
|
+
it: 'IMAP',
|
|
44
|
+
es: 'IMAP',
|
|
45
|
+
pl: 'IMAP',
|
|
46
|
+
uk: 'ІМ\'Я',
|
|
47
|
+
'zh-cn': 'IMAP',
|
|
48
|
+
};
|
|
49
|
+
Blockly.Words['imap_search'] = {
|
|
50
|
+
en: 'Search',
|
|
51
|
+
de: 'Suche',
|
|
52
|
+
ru: 'Поиск',
|
|
53
|
+
pt: 'Pesquisar',
|
|
54
|
+
nl: 'Zoek',
|
|
55
|
+
fr: 'Recherche',
|
|
56
|
+
it: 'Ricerca',
|
|
57
|
+
es: 'Buscar',
|
|
58
|
+
pl: 'Search Search',
|
|
59
|
+
uk: 'Пошук',
|
|
60
|
+
'zh-cn': '建 议',
|
|
61
|
+
};
|
|
62
|
+
Blockly.Words['imap_fetch'] = {
|
|
63
|
+
en: 'Use FETCH direct (without search)',
|
|
64
|
+
de: 'Verwende FETCH direkt (ohne Suche)',
|
|
65
|
+
ru: 'Используйте FETCH прямой (без поиска)',
|
|
66
|
+
pt: 'Use FETCH direto (sem pesquisa)',
|
|
67
|
+
nl: 'Gebruik FETCH direct',
|
|
68
|
+
fr: 'Utilisez FETCH direct (sans recherche)',
|
|
69
|
+
it: 'Utilizzare FETCH direttamente (senza ricerca)',
|
|
70
|
+
es: 'Use FETCH directo (sin búsqueda)',
|
|
71
|
+
pl: 'Wykorzystywanie FETCH (bez wyszukiwania)',
|
|
72
|
+
uk: 'Використовуйте FETCH прямо (без пошуку)',
|
|
73
|
+
'zh-cn': 'FETCH 直接用途(未经查询)',
|
|
74
|
+
};
|
|
75
|
+
Blockly.Words['imap_bodies'] = {
|
|
76
|
+
en: 'BODIES:',
|
|
77
|
+
de: 'BODIES:',
|
|
78
|
+
ru: 'ТЕЛА:',
|
|
79
|
+
pt: 'ÓRGÃOS:',
|
|
80
|
+
nl: 'BODIES:',
|
|
81
|
+
fr: 'ORGANES :',
|
|
82
|
+
it: 'BODIES:',
|
|
83
|
+
es: 'ÓRGANOS:',
|
|
84
|
+
pl: 'BODIES:',
|
|
85
|
+
uk: 'БОДИ:',
|
|
86
|
+
'zh-cn': 'BODIES:',
|
|
87
|
+
};
|
|
88
|
+
Blockly.Words['imap_flags'] = {
|
|
89
|
+
en: 'Flag action (addFlags, delFlags or setFlags).',
|
|
90
|
+
de: 'Flaggenaktion (addFlags, delFlags oder setFlags.).',
|
|
91
|
+
ru: 'Флаг действия (addFlags, delFlags или setFlags.).',
|
|
92
|
+
pt: 'Ação da bandeira (addFlags, delFlags ou setFlags.).',
|
|
93
|
+
nl: 'Flag actie (addFlags, delFlags of setFlags).',
|
|
94
|
+
fr: 'Action du drapeau (addFlags, delFlags ou setFlags.).',
|
|
95
|
+
it: 'Azione della bandiera (addFlags, delFlags o setFlags.).',
|
|
96
|
+
es: 'Acción de bandera (addFlags, delFlags o setFlags.).',
|
|
97
|
+
pl: 'Flaga (addFlags, delFlags lub setFlags).',
|
|
98
|
+
uk: 'Прапор дії (addFlags, delFlags або setFlags.).',
|
|
99
|
+
'zh-cn': '滞后行动(滞后、冲绳或四国).',
|
|
100
|
+
};
|
|
101
|
+
Blockly.Words['imap_flagtype'] = {
|
|
102
|
+
en: 'Set Flags',
|
|
103
|
+
de: 'Flaggen festlegen',
|
|
104
|
+
ru: 'Установите флаги',
|
|
105
|
+
pt: 'Conjunto de bandeiras',
|
|
106
|
+
nl: 'Set Flags',
|
|
107
|
+
fr: 'Set Drapeaux',
|
|
108
|
+
it: 'Set Bandiere',
|
|
109
|
+
es: 'Set Flags',
|
|
110
|
+
pl: 'Flaga',
|
|
111
|
+
uk: 'Комплект Прапорів',
|
|
112
|
+
'zh-cn': 'A. 排减量',
|
|
113
|
+
};
|
|
114
|
+
Blockly.Words['imap_tooltip_flags'] = {
|
|
115
|
+
en: 'Flags available (Seen,Answered,Flagged,Deleted or Draft)',
|
|
116
|
+
de: 'Flaggen verfügbar (Seen,Answered,Flagged,Deleted oder Draft)',
|
|
117
|
+
ru: 'Имеющиеся флаги (Seen,Answered,Flagged,Deleted или Draft)',
|
|
118
|
+
pt: 'Bandeiras disponíveis (Seen,Answered,Flagged,Deleted ou Draft)',
|
|
119
|
+
nl: 'Vlaggen beschikbaar (Seen,Answered,Flagged,Deleted of Draft)',
|
|
120
|
+
fr: 'Drapeaux disponibles (Envoyé,Réponse,Draps ou Draft)',
|
|
121
|
+
it: 'Bandiere disponibili (Vendita,Risposta,Flagged,Deleted o Draft)',
|
|
122
|
+
es: 'Banderas disponibles (ver,Respuesta,Flagged,Deleted o Draft)',
|
|
123
|
+
pl: 'Flagi dostępne (Seen,Answered,Flagged,Deleted lub Draft)',
|
|
124
|
+
uk: 'Прапори доступні (Seen,Answered,Flagged,Deleted або Draft)',
|
|
125
|
+
'zh-cn': '可用的滞留(见、Answered、Flag、注释、手或空洞无见)',
|
|
126
|
+
};
|
|
127
|
+
Blockly.Words['imap_uid'] = {
|
|
128
|
+
'en': 'UID number',
|
|
129
|
+
'de': 'UID-Nummer',
|
|
130
|
+
'ru': 'UID номер',
|
|
131
|
+
'pt': 'Número do UID',
|
|
132
|
+
'nl': 'UID nummer',
|
|
133
|
+
'fr': 'Numéro UID',
|
|
134
|
+
'it': 'Numero UID',
|
|
135
|
+
'es': 'Número de UID',
|
|
136
|
+
'pl': 'Liczba UID',
|
|
137
|
+
'uk': 'UID номер',
|
|
138
|
+
'zh-cn': 'IDID编号'
|
|
139
|
+
};
|
|
140
|
+
Blockly.Words['imap_choose'] = {
|
|
141
|
+
en: 'select mailbox',
|
|
142
|
+
de: 'Postfach auswählen',
|
|
143
|
+
ru: 'выбрать почтовый ящик',
|
|
144
|
+
pt: 'selecionar caixa de correio',
|
|
145
|
+
nl: 'kies postbus',
|
|
146
|
+
fr: 'sélectionner la boîte aux lettres',
|
|
147
|
+
it: 'selezionare casella postale',
|
|
148
|
+
es: 'selecto buzón de correo',
|
|
149
|
+
pl: 'mailbox',
|
|
150
|
+
uk: 'виберіть поштову скриньку',
|
|
151
|
+
'zh-cn': '选择邮件箱',
|
|
152
|
+
};
|
|
153
|
+
Blockly.Words['imap_max'] = {
|
|
154
|
+
en: 'max. emails',
|
|
155
|
+
de: 'max. e-mails',
|
|
156
|
+
ru: 'макс. email',
|
|
157
|
+
pt: 'max. e-mails',
|
|
158
|
+
nl: 'max. e-mails',
|
|
159
|
+
fr: 'max. e-mails',
|
|
160
|
+
it: 'max. e-mail',
|
|
161
|
+
es: 'max. correos electrónicos',
|
|
162
|
+
pl: 'max. e-mail',
|
|
163
|
+
uk: 'макс. новини',
|
|
164
|
+
'zh-cn': '页: 1 电子邮件',
|
|
165
|
+
};
|
|
166
|
+
Blockly.Words['imap_all'] = {
|
|
167
|
+
en: 'All',
|
|
168
|
+
de: 'Alle',
|
|
169
|
+
ru: 'Все',
|
|
170
|
+
pt: 'Todos',
|
|
171
|
+
nl: 'Allen',
|
|
172
|
+
fr: 'Tout',
|
|
173
|
+
it: 'Tutti',
|
|
174
|
+
es: 'Todos',
|
|
175
|
+
pl: 'Cały',
|
|
176
|
+
uk: 'Всі',
|
|
177
|
+
'zh-cn': '一. 导言',
|
|
178
|
+
};
|
|
179
|
+
Blockly.Words['imap_name'] = {
|
|
180
|
+
en: 'IMAP mailbox',
|
|
181
|
+
de: 'IMAP Mailbox',
|
|
182
|
+
ru: 'IMAP почтовый ящик',
|
|
183
|
+
pt: 'Caixa de correio IMAP',
|
|
184
|
+
nl: 'IMAP mailbox',
|
|
185
|
+
fr: 'Boîte aux lettres IMAP',
|
|
186
|
+
it: 'IMAP mailbox',
|
|
187
|
+
es: 'Buzón de correo IMAP',
|
|
188
|
+
pl: 'IMAP mailbox',
|
|
189
|
+
uk: 'Поштова скринька IMAP',
|
|
190
|
+
'zh-cn': 'IMAP 邮件箱',
|
|
191
|
+
};
|
|
192
|
+
Blockly.Words['imap_mailparser'] = {
|
|
193
|
+
en: 'Use Mailparser',
|
|
194
|
+
de: 'Mailparser verwenden',
|
|
195
|
+
ru: 'Используйте Mailparser',
|
|
196
|
+
pt: 'Use o Mailparser',
|
|
197
|
+
nl: 'Gebruik Mailparser',
|
|
198
|
+
fr: 'Utiliser Mailparser',
|
|
199
|
+
it: 'Utilizzare Mailparser',
|
|
200
|
+
es: 'Use Mailparser',
|
|
201
|
+
pl: 'Mailparser',
|
|
202
|
+
uk: 'Використовуйте підписку',
|
|
203
|
+
'zh-cn': '使用邮件',
|
|
204
|
+
};
|
|
205
|
+
Blockly.Words['imap_log'] = {
|
|
206
|
+
en: 'Loglevel',
|
|
207
|
+
de: 'Loglevel',
|
|
208
|
+
ru: 'Войти',
|
|
209
|
+
pt: 'Nível de log',
|
|
210
|
+
nl: 'Loglevel',
|
|
211
|
+
fr: 'Loglevel',
|
|
212
|
+
it: 'Livello di registro',
|
|
213
|
+
es: 'Nivel de estudios',
|
|
214
|
+
pl: 'Logos',
|
|
215
|
+
uk: 'Увійти',
|
|
216
|
+
'zh-cn': '后勤问题',
|
|
217
|
+
};
|
|
218
|
+
Blockly.Words['imap_log_none'] = {
|
|
219
|
+
en: 'none',
|
|
220
|
+
de: 'kein',
|
|
221
|
+
ru: 'нет',
|
|
222
|
+
pt: 'nenhum',
|
|
223
|
+
nl: 'niemand',
|
|
224
|
+
fr: 'aucun',
|
|
225
|
+
it: 'nessuno',
|
|
226
|
+
es: 'ninguno',
|
|
227
|
+
pl: 'żaden',
|
|
228
|
+
uk: 'немає',
|
|
229
|
+
'zh-cn': '无',
|
|
230
|
+
};
|
|
231
|
+
Blockly.Words['imap_log_info'] = {
|
|
232
|
+
en: 'info',
|
|
233
|
+
de: 'info',
|
|
234
|
+
ru: 'инфо',
|
|
235
|
+
pt: 'info',
|
|
236
|
+
nl: 'info',
|
|
237
|
+
fr: 'info',
|
|
238
|
+
it: 'info',
|
|
239
|
+
es: 'info',
|
|
240
|
+
pl: 'info',
|
|
241
|
+
uk: 'контакти',
|
|
242
|
+
'zh-cn': '导 言',
|
|
243
|
+
};
|
|
244
|
+
Blockly.Words['imap_log_debug'] = {
|
|
245
|
+
en: 'debug',
|
|
246
|
+
de: 'debug',
|
|
247
|
+
ru: 'дебаг',
|
|
248
|
+
pt: 'depuração',
|
|
249
|
+
nl: 'debug',
|
|
250
|
+
fr: 'debug',
|
|
251
|
+
it: 'debug',
|
|
252
|
+
es: 'debug',
|
|
253
|
+
pl: 'debug',
|
|
254
|
+
uk: 'напляскване',
|
|
255
|
+
'zh-cn': '黑暗',
|
|
256
|
+
};
|
|
257
|
+
Blockly.Words['imap_log_warn'] = {
|
|
258
|
+
en: 'warn',
|
|
259
|
+
de: 'warnen',
|
|
260
|
+
ru: 'предупреждение',
|
|
261
|
+
pt: 'avisem',
|
|
262
|
+
nl: 'waarschuwing',
|
|
263
|
+
fr: 'prévenir',
|
|
264
|
+
it: 'avvertire avvertire',
|
|
265
|
+
es: 'warn',
|
|
266
|
+
pl: 'ostrzegać',
|
|
267
|
+
uk: 'про нас',
|
|
268
|
+
'zh-cn': '战争',
|
|
269
|
+
};
|
|
270
|
+
Blockly.Words['imap_log_error'] = {
|
|
271
|
+
en: 'error',
|
|
272
|
+
de: 'fehler',
|
|
273
|
+
ru: 'ошибка',
|
|
274
|
+
pt: 'erro',
|
|
275
|
+
nl: 'error',
|
|
276
|
+
fr: 'erreur',
|
|
277
|
+
it: 'errore',
|
|
278
|
+
es: 'error',
|
|
279
|
+
pl: 'błąd',
|
|
280
|
+
uk: 'про нас',
|
|
281
|
+
'zh-cn': '错误',
|
|
282
|
+
};
|
|
283
|
+
Blockly.Words['imap_anyInstance'] = {
|
|
284
|
+
en: 'All Instances',
|
|
285
|
+
de: 'Alle Instanzen',
|
|
286
|
+
ru: 'Все Instances',
|
|
287
|
+
pt: 'Todas as instâncias',
|
|
288
|
+
nl: 'Alle instanties',
|
|
289
|
+
fr: 'All Instances',
|
|
290
|
+
it: 'Tutti i ricorsi',
|
|
291
|
+
es: 'All Instances',
|
|
292
|
+
pl: 'All Instances (ang.)',
|
|
293
|
+
uk: 'Всі Інстанції',
|
|
294
|
+
'zh-cn': '所有案件',
|
|
295
|
+
};
|
|
296
|
+
Blockly.Words['imap_tooltip'] = {
|
|
297
|
+
en: 'Change search query',
|
|
298
|
+
de: 'Suchanfrage ändern',
|
|
299
|
+
ru: 'Изменить запрос поиска',
|
|
300
|
+
pt: 'Alterar consulta de pesquisa',
|
|
301
|
+
nl: 'Verander de zoektocht',
|
|
302
|
+
fr: 'Changer de recherche query',
|
|
303
|
+
it: 'Cambia query di ricerca',
|
|
304
|
+
es: 'Cambiar la consulta de búsqueda',
|
|
305
|
+
pl: 'Wyszukiwanie',
|
|
306
|
+
uk: 'Зміна запиту запиту',
|
|
307
|
+
'zh-cn': '改变搜寻',
|
|
308
|
+
};
|
|
309
|
+
Blockly.Words['imap_tooltip_data'] = {
|
|
310
|
+
en: 'Use current search query.',
|
|
311
|
+
de: 'Aktuelle Suchanfrage verwenden.',
|
|
312
|
+
ru: 'Используйте текущий запрос поиска.',
|
|
313
|
+
pt: 'Use a consulta de pesquisa atual.',
|
|
314
|
+
nl: 'Gebruik de huidige zoektocht.',
|
|
315
|
+
fr: 'Utilisez la requête de recherche actuelle.',
|
|
316
|
+
it: 'Utilizzare query di ricerca corrente.',
|
|
317
|
+
es: 'Utilice la consulta de búsqueda actual.',
|
|
318
|
+
pl: 'Użycie aktualnych zapytań.',
|
|
319
|
+
uk: 'Використовуйте поточний пошук запиту.',
|
|
320
|
+
'zh-cn': '使用目前的搜寻。.'
|
|
321
|
+
};
|
|
322
|
+
Blockly.Words['imap_tooltip_request'] = {
|
|
323
|
+
en: 'Own search query',
|
|
324
|
+
de: 'Eigene Suchanfrage',
|
|
325
|
+
ru: 'Собственный поисковый запрос',
|
|
326
|
+
pt: 'Própria consulta de pesquisa',
|
|
327
|
+
nl: 'Eigen zoektocht',
|
|
328
|
+
fr: 'Own search query',
|
|
329
|
+
it: 'Ricerca propria query',
|
|
330
|
+
es: 'Own search query',
|
|
331
|
+
pl: 'Wyszukiwarka',
|
|
332
|
+
uk: 'Власний пошуковий запит',
|
|
333
|
+
'zh-cn': '查询',
|
|
334
|
+
};
|
|
335
|
+
Blockly.Words['imap_help'] = {
|
|
336
|
+
en: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
337
|
+
de: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
338
|
+
ru: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
339
|
+
pt: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
340
|
+
nl: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
341
|
+
fr: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
342
|
+
it: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
343
|
+
es: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
344
|
+
pl: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
345
|
+
uk: 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
346
|
+
'zh-cn': 'https://github.com/Lucky-ESA/ioBroker.imap/blob/master/README.md',
|
|
347
|
+
};
|
|
348
|
+
Blockly.Words['imap_with_result'] = {
|
|
349
|
+
en: 'with result',
|
|
350
|
+
de: 'mit ergebnis',
|
|
351
|
+
ru: 'с результатом',
|
|
352
|
+
pt: 'com resultado',
|
|
353
|
+
nl: 'met resultaat',
|
|
354
|
+
fr: 'avec résultat',
|
|
355
|
+
it: 'con risultato',
|
|
356
|
+
es: 'con resultado',
|
|
357
|
+
pl: 'wynik',
|
|
358
|
+
uk: 'з результатом',
|
|
359
|
+
'zh-cn': '结果',
|
|
360
|
+
};
|
|
361
|
+
Blockly.Words['imap_data'] = {
|
|
362
|
+
en: 'Emails data',
|
|
363
|
+
de: 'E-Mail-Daten',
|
|
364
|
+
ru: 'Данные по электронной почте',
|
|
365
|
+
pt: 'Dados de e-mail',
|
|
366
|
+
nl: 'E-mails',
|
|
367
|
+
fr: 'Emails data',
|
|
368
|
+
it: 'Dati e-mail',
|
|
369
|
+
es: 'Datos de correo electrónico',
|
|
370
|
+
pl: 'Data emaili',
|
|
371
|
+
uk: 'Дані електронної пошти',
|
|
372
|
+
'zh-cn': '电子邮件数据',
|
|
373
|
+
};
|
|
374
|
+
Blockly.Words['imap_data_json'] = {
|
|
375
|
+
en: 'Emails as JSON',
|
|
376
|
+
de: 'E-Mails als JSON',
|
|
377
|
+
ru: 'Email как JSON',
|
|
378
|
+
pt: 'Emails como JSON',
|
|
379
|
+
nl: 'E-mails als JSON',
|
|
380
|
+
fr: 'Courriels comme JSON',
|
|
381
|
+
it: 'E-mail come JSON',
|
|
382
|
+
es: 'Correos electrónicos como JSON',
|
|
383
|
+
pl: 'Email jako JSON',
|
|
384
|
+
uk: 'Електронна пошта: json',
|
|
385
|
+
'zh-cn': 'Email as JSON',
|
|
386
|
+
};
|
|
387
|
+
Blockly.Words['imap_data_seqno'] = {
|
|
388
|
+
en: 'Last sequence numbers',
|
|
389
|
+
de: 'Letzte Sequenznummern',
|
|
390
|
+
ru: 'Последние номера последовательности',
|
|
391
|
+
pt: 'Últimos números de sequência',
|
|
392
|
+
nl: 'Laatste sequenties',
|
|
393
|
+
fr: 'Derniers numéros de séquence',
|
|
394
|
+
it: 'Ultimo numero di sequenza',
|
|
395
|
+
es: 'Últimos números de secuencia',
|
|
396
|
+
pl: 'Liczba ostatnia',
|
|
397
|
+
uk: 'Останні номери послідовності',
|
|
398
|
+
'zh-cn': '最后一组',
|
|
399
|
+
};
|
|
400
|
+
Blockly.Sendto.blocks['imap'] =
|
|
388
401
|
'<block type="imap">' +
|
|
389
|
-
' <
|
|
390
|
-
"
|
|
391
|
-
' <value name="IMAPNAME">' +
|
|
392
|
-
" </value>" +
|
|
402
|
+
' <field name="INSTANCE"></field>' +
|
|
403
|
+
' <field name="IMAPNAME"></field>' +
|
|
393
404
|
' <value name="SEARCH">' +
|
|
394
405
|
' <shadow type="text">' +
|
|
395
406
|
' <field name="TEXT">["UNSEEN"]</field>' +
|
|
396
|
-
|
|
397
|
-
|
|
407
|
+
' </shadow>' +
|
|
408
|
+
' </value>' +
|
|
398
409
|
' <value name="MAX">' +
|
|
399
410
|
' <shadow type="math_number">' +
|
|
400
411
|
' <field name="NUM">20</field>' +
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
' <
|
|
404
|
-
|
|
405
|
-
"</block>";
|
|
412
|
+
' </shadow>' +
|
|
413
|
+
' </value>' +
|
|
414
|
+
' <field name="LOG"></field>' +
|
|
415
|
+
'</block>';
|
|
406
416
|
|
|
407
|
-
Blockly.Blocks[
|
|
417
|
+
Blockly.Blocks['imap'] = {
|
|
408
418
|
init: function () {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
419
|
+
const options_user = [];
|
|
420
|
+
const options_instance = [];
|
|
421
|
+
|
|
422
|
+
options_user.push([Blockly.Translate('imap_all'), 'all']);
|
|
423
|
+
|
|
424
|
+
if (typeof main !== 'undefined' && main.instances) {
|
|
425
|
+
for (let i = 0; i < main.instances.length; i++) {
|
|
426
|
+
const m = main.instances[i].match(/^system.adapter.imap.(\d+)$/);
|
|
415
427
|
if (m) {
|
|
416
|
-
|
|
417
|
-
options_instance.push([
|
|
428
|
+
const n = parseInt(m[1], 10);
|
|
429
|
+
options_instance.push(['imap.' + n, '.' + n]);
|
|
418
430
|
if (main.objects[main.instances[i]].native.hosts) {
|
|
419
|
-
for (
|
|
420
|
-
//Checking active in the main.js.
|
|
421
|
-
|
|
422
|
-
options_user.push([n +
|
|
431
|
+
for (let a = 0; a < main.objects[main.instances[i]].native.hosts.length; a++) {
|
|
432
|
+
// Checking active in the main.js.
|
|
433
|
+
const id = main.objects[main.instances[i]].native.hosts[a].user;
|
|
434
|
+
options_user.push([n + '.' + id, id]);
|
|
423
435
|
}
|
|
424
436
|
}
|
|
425
437
|
}
|
|
426
438
|
}
|
|
427
439
|
}
|
|
440
|
+
if (options_instance.length == 0) options_instance.push([Blockly.Translate('no_instance_found'), '']);
|
|
428
441
|
|
|
429
|
-
this.appendDummyInput(
|
|
430
|
-
.appendField(Blockly.Translate(
|
|
431
|
-
.appendField(new Blockly.FieldDropdown(options_instance),
|
|
432
|
-
this.appendDummyInput(
|
|
433
|
-
.appendField(Blockly.Translate(
|
|
434
|
-
.appendField(new Blockly.FieldDropdown(options_user),
|
|
442
|
+
this.appendDummyInput('INSTANCE')
|
|
443
|
+
.appendField(Blockly.Translate('imap'))
|
|
444
|
+
.appendField(new Blockly.FieldDropdown(options_instance), 'INSTANCE');
|
|
445
|
+
this.appendDummyInput('IMAPNAME')
|
|
446
|
+
.appendField(Blockly.Translate('imap_name'))
|
|
447
|
+
.appendField(new Blockly.FieldDropdown(options_user), 'IMAPNAME');
|
|
435
448
|
|
|
436
|
-
this.appendValueInput(
|
|
449
|
+
this.appendValueInput('SEARCH').appendField(Blockly.Translate('imap_search'));
|
|
437
450
|
|
|
438
|
-
this.appendValueInput(
|
|
451
|
+
this.appendValueInput('MAX').appendField(Blockly.Translate('imap_max'));
|
|
439
452
|
|
|
440
|
-
this.appendDummyInput(
|
|
441
|
-
.appendField(Blockly.Translate(
|
|
453
|
+
this.appendDummyInput('LOG')
|
|
454
|
+
.appendField(Blockly.Translate('imap_log'))
|
|
442
455
|
.appendField(
|
|
443
456
|
new Blockly.FieldDropdown([
|
|
444
|
-
[Blockly.Translate(
|
|
445
|
-
[Blockly.Translate(
|
|
446
|
-
[Blockly.Translate(
|
|
447
|
-
[Blockly.Translate(
|
|
448
|
-
[Blockly.Translate(
|
|
457
|
+
[Blockly.Translate('imap_log_none'), ''],
|
|
458
|
+
[Blockly.Translate('imap_log_debug'), 'debug'],
|
|
459
|
+
[Blockly.Translate('imap_log_info'), 'log'],
|
|
460
|
+
[Blockly.Translate('imap_log_warn'), 'warn'],
|
|
461
|
+
[Blockly.Translate('imap_log_error'), 'error'],
|
|
449
462
|
]),
|
|
450
|
-
|
|
463
|
+
'LOG',
|
|
451
464
|
);
|
|
452
465
|
|
|
453
466
|
this.setInputsInline(false);
|
|
@@ -455,387 +468,344 @@ Blockly.Blocks["imap"] = {
|
|
|
455
468
|
this.setNextStatement(true, null);
|
|
456
469
|
|
|
457
470
|
this.setColour(Blockly.Sendto.HUE);
|
|
458
|
-
|
|
459
|
-
this.
|
|
471
|
+
|
|
472
|
+
this.setTooltip(Blockly.Translate('imap_tooltip'));
|
|
473
|
+
this.setHelpUrl(Blockly.Translate('imap_help'));
|
|
460
474
|
},
|
|
461
475
|
};
|
|
462
476
|
|
|
463
|
-
Blockly.JavaScript[
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
477
|
+
Blockly.JavaScript['imap'] = function (block) {
|
|
478
|
+
const dropdown_instance = block.getFieldValue('INSTANCE');
|
|
479
|
+
const logLevel = block.getFieldValue('LOG');
|
|
480
|
+
const value_name = block.getFieldValue('IMAPNAME');
|
|
481
|
+
const value_search = Blockly.JavaScript.valueToCode(block, 'SEARCH', Blockly.JavaScript.ORDER_ATOMIC);
|
|
482
|
+
const value_max = Blockly.JavaScript.valueToCode(block, 'MAX', Blockly.JavaScript.ORDER_ATOMIC);
|
|
469
483
|
|
|
470
|
-
|
|
484
|
+
let logText = '';
|
|
471
485
|
if (logLevel) {
|
|
472
|
-
logText =
|
|
473
|
-
"console." + logLevel + "(\"imap: " + value_max + " + " + value_name + "\");\n";
|
|
474
|
-
} else {
|
|
475
|
-
logText = "";
|
|
486
|
+
logText = `console.${logLevel}('imap: ' + ${value_max} + ' ' + ${value_name});\n`;
|
|
476
487
|
}
|
|
477
488
|
|
|
478
|
-
return (
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
"'});\n" +
|
|
488
|
-
logText
|
|
489
|
-
);
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
Blockly.Sendto.blocks["imap_request"] =
|
|
489
|
+
return `sendTo('imap${dropdown_instance}', 'getBlockly', {\n` +
|
|
490
|
+
` search: ${value_search},\n` +
|
|
491
|
+
` max: ${value_max},\n` +
|
|
492
|
+
` device: '${value_name}',\n` +
|
|
493
|
+
`});\n${logText}`;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
Blockly.Sendto.blocks['imap_request'] =
|
|
497
|
+
'<sep gap="5"></sep>' +
|
|
493
498
|
'<block type="imap_request">' +
|
|
494
|
-
' <
|
|
495
|
-
"
|
|
496
|
-
' <value name="IMAPNAME">' +
|
|
497
|
-
" </value>" +
|
|
499
|
+
' <field name="INSTANCE"></field>' +
|
|
500
|
+
' <field name="IMAPNAME"></field>' +
|
|
498
501
|
' <value name="SEARCH">' +
|
|
499
502
|
' <shadow type="text">' +
|
|
500
|
-
' <field name="TEXT">["ALL", ["SINCE", "May 20,
|
|
501
|
-
|
|
502
|
-
|
|
503
|
+
' <field name="TEXT">["ALL", ["SINCE", "May 20, 2024"]]</field>' +
|
|
504
|
+
' </shadow>' +
|
|
505
|
+
' </value>' +
|
|
503
506
|
' <value name="FETCH">' +
|
|
504
507
|
' <shadow type="text">' +
|
|
505
508
|
' <field name="TEXT">{"fetch": false, "uid": [1,2,3,4]}</field>' +
|
|
506
|
-
|
|
507
|
-
|
|
509
|
+
' </shadow>' +
|
|
510
|
+
' </value>' +
|
|
508
511
|
' <value name="BODIES">' +
|
|
509
512
|
' <shadow type="text">' +
|
|
510
513
|
' <field name="TEXT">{bodies: "", markSeen: false}</field>' +
|
|
511
|
-
|
|
512
|
-
|
|
514
|
+
' </shadow>' +
|
|
515
|
+
' </value>' +
|
|
513
516
|
' <value name="MAX">' +
|
|
514
517
|
' <shadow type="math_number">' +
|
|
515
518
|
' <field name="NUM">20</field>' +
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
' <
|
|
519
|
-
"
|
|
520
|
-
' <
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
"</block>";
|
|
525
|
-
|
|
526
|
-
Blockly.Blocks["imap_request"] = {
|
|
519
|
+
' </shadow>' +
|
|
520
|
+
' </value>' +
|
|
521
|
+
' <field name="MAILPARSER"></field>' +
|
|
522
|
+
' <field name="LOG"></field>' +
|
|
523
|
+
' <field name="STATEMENT"></field>' +
|
|
524
|
+
'</block>';
|
|
525
|
+
|
|
526
|
+
Blockly.Blocks['imap_request'] = {
|
|
527
527
|
init: function () {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
528
|
+
const options_user = [];
|
|
529
|
+
const options_instance = [];
|
|
530
|
+
|
|
531
|
+
options_user.push([Blockly.Translate('imap_choose'), 'all']);
|
|
532
|
+
|
|
533
|
+
if (typeof main !== 'undefined' && main.instances) {
|
|
534
|
+
for (let i = 0; i < main.instances.length; i++) {
|
|
535
|
+
const m = main.instances[i].match(/^system.adapter.imap.(\d+)$/);
|
|
534
536
|
if (m) {
|
|
535
|
-
|
|
536
|
-
options_instance.push([
|
|
537
|
+
const n = parseInt(m[1], 10);
|
|
538
|
+
options_instance.push(['imap.' + n, '.' + n]);
|
|
537
539
|
if (main.objects[main.instances[i]].native.hosts) {
|
|
538
|
-
for (
|
|
539
|
-
//Checking active in the main.js.
|
|
540
|
-
|
|
541
|
-
options_user.push([n +
|
|
540
|
+
for (let a = 0; a < main.objects[main.instances[i]].native.hosts.length; a++) {
|
|
541
|
+
// Checking active in the main.js.
|
|
542
|
+
const id = main.objects[main.instances[i]].native.hosts[a].user;
|
|
543
|
+
options_user.push([n + '.' + id, id]);
|
|
542
544
|
}
|
|
543
545
|
}
|
|
544
546
|
}
|
|
545
547
|
}
|
|
546
548
|
}
|
|
549
|
+
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate('no_instance_found'), '']);
|
|
547
550
|
|
|
548
|
-
this.appendDummyInput(
|
|
549
|
-
.appendField(Blockly.Translate(
|
|
550
|
-
.appendField(new Blockly.FieldDropdown(options_instance),
|
|
551
|
+
this.appendDummyInput('INSTANCE')
|
|
552
|
+
.appendField(Blockly.Translate('imap'))
|
|
553
|
+
.appendField(new Blockly.FieldDropdown(options_instance), 'INSTANCE');
|
|
551
554
|
|
|
552
|
-
this.appendDummyInput(
|
|
553
|
-
.appendField(Blockly.Translate(
|
|
554
|
-
.appendField(new Blockly.FieldDropdown(options_user),
|
|
555
|
+
this.appendDummyInput('IMAPNAME')
|
|
556
|
+
.appendField(Blockly.Translate('imap_name'))
|
|
557
|
+
.appendField(new Blockly.FieldDropdown(options_user), 'IMAPNAME');
|
|
555
558
|
|
|
556
|
-
this.appendValueInput(
|
|
559
|
+
this.appendValueInput('SEARCH').appendField(Blockly.Translate('imap_search'));
|
|
557
560
|
|
|
558
|
-
this.appendValueInput(
|
|
561
|
+
this.appendValueInput('FETCH').appendField(Blockly.Translate('imap_fetch'));
|
|
559
562
|
|
|
560
|
-
this.appendValueInput(
|
|
563
|
+
this.appendValueInput('BODIES').appendField(Blockly.Translate('imap_bodies'));
|
|
561
564
|
|
|
562
|
-
this.appendValueInput(
|
|
565
|
+
this.appendValueInput('MAX').appendField(Blockly.Translate('imap_max'));
|
|
563
566
|
|
|
564
|
-
this.appendDummyInput(
|
|
565
|
-
.appendField(Blockly.Translate(
|
|
566
|
-
.appendField(new Blockly.FieldCheckbox(
|
|
567
|
+
this.appendDummyInput('MAILPARSER')
|
|
568
|
+
.appendField(Blockly.Translate('imap_mailparser'))
|
|
569
|
+
.appendField(new Blockly.FieldCheckbox('TRUE'), 'MAILPARSER');
|
|
567
570
|
|
|
568
|
-
this.appendDummyInput(
|
|
569
|
-
.appendField(Blockly.Translate(
|
|
571
|
+
this.appendDummyInput('LOG')
|
|
572
|
+
.appendField(Blockly.Translate('imap_log'))
|
|
570
573
|
.appendField(
|
|
571
574
|
new Blockly.FieldDropdown([
|
|
572
|
-
[Blockly.Translate(
|
|
573
|
-
[Blockly.Translate(
|
|
574
|
-
[Blockly.Translate(
|
|
575
|
-
[Blockly.Translate(
|
|
576
|
-
[Blockly.Translate(
|
|
575
|
+
[Blockly.Translate('imap_log_none'), ''],
|
|
576
|
+
[Blockly.Translate('imap_log_debug'), 'debug'],
|
|
577
|
+
[Blockly.Translate('imap_log_info'), 'log'],
|
|
578
|
+
[Blockly.Translate('imap_log_warn'), 'warn'],
|
|
579
|
+
[Blockly.Translate('imap_log_error'), 'error'],
|
|
577
580
|
]),
|
|
578
|
-
|
|
581
|
+
'LOG',
|
|
579
582
|
);
|
|
580
|
-
this.appendStatementInput(
|
|
583
|
+
this.appendStatementInput('STATEMENT').setCheck(null);
|
|
581
584
|
|
|
582
585
|
this.setInputsInline(false);
|
|
583
586
|
this.setPreviousStatement(true, null);
|
|
584
587
|
this.setNextStatement(true, null);
|
|
585
588
|
|
|
586
589
|
this.setColour(Blockly.Sendto.HUE);
|
|
587
|
-
|
|
588
|
-
this.
|
|
590
|
+
|
|
591
|
+
this.setTooltip(Blockly.Translate('imap_tooltip_request'));
|
|
592
|
+
this.setHelpUrl(Blockly.Translate('imap_help'));
|
|
589
593
|
},
|
|
590
594
|
};
|
|
591
595
|
|
|
592
|
-
Blockly.JavaScript[
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
596
|
+
Blockly.JavaScript['imap_request'] = function (block) {
|
|
597
|
+
const dropdown_instance = block.getFieldValue('INSTANCE');
|
|
598
|
+
const logLevel = block.getFieldValue('LOG');
|
|
599
|
+
const value_name = block.getFieldValue('IMAPNAME');
|
|
600
|
+
const value_search = Blockly.JavaScript.valueToCode(block, 'SEARCH', Blockly.JavaScript.ORDER_ATOMIC);
|
|
601
|
+
const value_fetch = Blockly.JavaScript.valueToCode(block, 'FETCH', Blockly.JavaScript.ORDER_ATOMIC);
|
|
602
|
+
const value_bodie = Blockly.JavaScript.valueToCode(block, 'BODIES', Blockly.JavaScript.ORDER_ATOMIC);
|
|
603
|
+
const value_max = Blockly.JavaScript.valueToCode(block, 'MAX', Blockly.JavaScript.ORDER_ATOMIC);
|
|
604
|
+
let value_parse = block.getFieldValue('MAILPARSER');
|
|
605
|
+
|
|
606
|
+
if (value_parse === 'TRUE' || value_parse === 'true' || value_parse === true) {
|
|
602
607
|
value_parse = true;
|
|
603
608
|
} else {
|
|
604
609
|
value_parse = false;
|
|
605
610
|
}
|
|
606
611
|
|
|
607
|
-
|
|
608
|
-
if (value_fetch !== null && value_fetch !==
|
|
609
|
-
if (typeof value_fetch ===
|
|
610
|
-
para_fetch =
|
|
612
|
+
let para_fetch = '';
|
|
613
|
+
if (value_fetch !== null && value_fetch !== '') {
|
|
614
|
+
if (typeof value_fetch === 'object') {
|
|
615
|
+
para_fetch = `JSON.parse(${JSON.stringify(value_fetch)})`;
|
|
611
616
|
} else {
|
|
612
|
-
para_fetch =
|
|
617
|
+
para_fetch = `JSON.parse(${value_fetch})`;
|
|
613
618
|
}
|
|
614
619
|
}
|
|
615
620
|
|
|
616
|
-
|
|
617
|
-
text += ' name: "' + value_name + '",\n';
|
|
618
|
-
text += " max: " + value_max + ",\n";
|
|
619
|
-
text += " search: " + value_search + ",\n";
|
|
620
|
-
text += " fetch: " + para_fetch + ",\n";
|
|
621
|
-
text += " bodie: " + value_bodie + ",\n";
|
|
622
|
-
text += " parse: " + value_parse + ",\n";
|
|
623
|
-
text += "}";
|
|
624
|
-
|
|
625
|
-
var args = [];
|
|
626
|
-
args.push('\n "name": "' + value_name + '"');
|
|
627
|
-
args.push('\n "max": ' + value_max);
|
|
628
|
-
args.push('\n "search": ' + value_search);
|
|
629
|
-
args.push('\n "fetch": ' + value_fetch);
|
|
630
|
-
args.push('\n "bodie": ' + value_bodie);
|
|
631
|
-
args.push('\n "parse": ' + value_parse);
|
|
632
|
-
var logText;
|
|
621
|
+
let logText = '';
|
|
633
622
|
if (logLevel) {
|
|
634
|
-
logText =
|
|
635
|
-
} else {
|
|
636
|
-
logText = "";
|
|
623
|
+
logText = `console.${logLevel}('imap_request: ' + ${value_max} + ' ${value_name}');\n`;
|
|
637
624
|
}
|
|
638
|
-
|
|
639
|
-
statement = Blockly.JavaScript.statementToCode(block,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
625
|
+
|
|
626
|
+
const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT');
|
|
627
|
+
const command = 'getIMAPRequest';
|
|
628
|
+
|
|
629
|
+
return `sendTo('imap${dropdown_instance}', '${command}', {\n` +
|
|
630
|
+
` name: '${value_name}',\n` +
|
|
631
|
+
` max: ${value_max},\n` +
|
|
632
|
+
` search: ${value_search},\n` +
|
|
633
|
+
` fetch: ${para_fetch || 'null'},\n` +
|
|
634
|
+
` bodie: ${value_bodie},\n` +
|
|
635
|
+
` parse: ${value_bodie},\n` +
|
|
636
|
+
`}, async (result) => {\n` +
|
|
649
637
|
statement +
|
|
650
|
-
|
|
651
|
-
logText
|
|
652
|
-
);
|
|
638
|
+
`});\n${logText}`;
|
|
653
639
|
};
|
|
654
640
|
|
|
655
|
-
Blockly.Sendto.blocks[
|
|
641
|
+
Blockly.Sendto.blocks['imap_data'] =
|
|
642
|
+
'<sep gap="5"></sep>' +
|
|
656
643
|
'<block type="imap_data">' +
|
|
657
|
-
' <
|
|
658
|
-
"
|
|
659
|
-
' <
|
|
660
|
-
"
|
|
661
|
-
' <
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
' <value name="STATEMENT">' +
|
|
666
|
-
" </value>" +
|
|
667
|
-
"</block>";
|
|
668
|
-
|
|
669
|
-
Blockly.Blocks["imap_data"] = {
|
|
644
|
+
' <field name="INSTANCE"></field>' +
|
|
645
|
+
' <field name="IMAPNAME"></field>' +
|
|
646
|
+
' <field name="IMAPVALUE"></field>' +
|
|
647
|
+
' <field name="LOG"></field>' +
|
|
648
|
+
' <field name="STATEMENT"></field>' +
|
|
649
|
+
'</block>';
|
|
650
|
+
|
|
651
|
+
Blockly.Blocks['imap_data'] = {
|
|
670
652
|
init: function () {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
653
|
+
const options_user = [];
|
|
654
|
+
const options_instance = [];
|
|
655
|
+
|
|
656
|
+
options_user.push([Blockly.Translate('imap_choose'), 'all']);
|
|
657
|
+
|
|
658
|
+
if (typeof main !== 'undefined' && main.instances) {
|
|
659
|
+
for (let i = 0; i < main.instances.length; i++) {
|
|
660
|
+
const m = main.instances[i].match(/^system.adapter.imap.(\d+)$/);
|
|
677
661
|
if (m) {
|
|
678
|
-
|
|
679
|
-
options_instance.push([
|
|
662
|
+
const n = parseInt(m[1], 10);
|
|
663
|
+
options_instance.push(['imap.' + n, '.' + n]);
|
|
680
664
|
if (main.objects[main.instances[i]].native.hosts) {
|
|
681
|
-
for (
|
|
665
|
+
for (let a = 0; a < main.objects[main.instances[i]].native.hosts.length; a++) {
|
|
682
666
|
//Checking active in the main.js.
|
|
683
|
-
|
|
684
|
-
options_user.push([n +
|
|
667
|
+
const id = main.objects[main.instances[i]].native.hosts[a].user;
|
|
668
|
+
options_user.push([n + '.' + id, id]);
|
|
685
669
|
}
|
|
686
670
|
}
|
|
687
671
|
}
|
|
688
672
|
}
|
|
689
673
|
}
|
|
674
|
+
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate('no_instance_found'), '']);
|
|
690
675
|
|
|
691
|
-
this.appendDummyInput(
|
|
692
|
-
.appendField(Blockly.Translate(
|
|
693
|
-
.appendField(new Blockly.FieldDropdown(options_instance),
|
|
676
|
+
this.appendDummyInput('INSTANCE')
|
|
677
|
+
.appendField(Blockly.Translate('imap'))
|
|
678
|
+
.appendField(new Blockly.FieldDropdown(options_instance), 'INSTANCE');
|
|
694
679
|
|
|
695
|
-
this.appendDummyInput(
|
|
696
|
-
.appendField(Blockly.Translate(
|
|
697
|
-
.appendField(new Blockly.FieldDropdown(options_user),
|
|
680
|
+
this.appendDummyInput('IMAPNAME')
|
|
681
|
+
.appendField(Blockly.Translate('imap_name'))
|
|
682
|
+
.appendField(new Blockly.FieldDropdown(options_user), 'IMAPNAME');
|
|
698
683
|
|
|
699
|
-
this.appendDummyInput(
|
|
700
|
-
.appendField(Blockly.Translate(
|
|
684
|
+
this.appendDummyInput('IMAPVALUE')
|
|
685
|
+
.appendField(Blockly.Translate('imap_data'))
|
|
701
686
|
.appendField(
|
|
702
687
|
new Blockly.FieldDropdown([
|
|
703
|
-
[Blockly.Translate(
|
|
704
|
-
[Blockly.Translate(
|
|
688
|
+
[Blockly.Translate('imap_data_json'), 'data'],
|
|
689
|
+
[Blockly.Translate('imap_data_seqno'), 'seqno'],
|
|
705
690
|
]),
|
|
706
|
-
|
|
691
|
+
'IMAPVALUE',
|
|
707
692
|
);
|
|
708
693
|
|
|
709
|
-
this.appendDummyInput(
|
|
710
|
-
.appendField(Blockly.Translate(
|
|
694
|
+
this.appendDummyInput('LOG')
|
|
695
|
+
.appendField(Blockly.Translate('imap_log'))
|
|
711
696
|
.appendField(
|
|
712
697
|
new Blockly.FieldDropdown([
|
|
713
|
-
[Blockly.Translate(
|
|
714
|
-
[Blockly.Translate(
|
|
715
|
-
[Blockly.Translate(
|
|
716
|
-
[Blockly.Translate(
|
|
717
|
-
[Blockly.Translate(
|
|
698
|
+
[Blockly.Translate('imap_log_none'), ''],
|
|
699
|
+
[Blockly.Translate('imap_log_debug'), 'debug'],
|
|
700
|
+
[Blockly.Translate('imap_log_info'), 'log'],
|
|
701
|
+
[Blockly.Translate('imap_log_warn'), 'warn'],
|
|
702
|
+
[Blockly.Translate('imap_log_error'), 'error'],
|
|
718
703
|
]),
|
|
719
|
-
|
|
704
|
+
'LOG',
|
|
720
705
|
);
|
|
721
|
-
this.appendStatementInput(
|
|
706
|
+
this.appendStatementInput('STATEMENT').setCheck(null);
|
|
722
707
|
|
|
723
708
|
this.setInputsInline(false);
|
|
724
709
|
this.setPreviousStatement(true, null);
|
|
725
710
|
this.setNextStatement(true, null);
|
|
726
711
|
|
|
727
712
|
this.setColour(Blockly.Sendto.HUE);
|
|
728
|
-
this.setTooltip(Blockly.Translate(
|
|
729
|
-
this.setHelpUrl(Blockly.Translate(
|
|
713
|
+
this.setTooltip(Blockly.Translate('imap_tooltip_data'));
|
|
714
|
+
this.setHelpUrl(Blockly.Translate('imap_help'));
|
|
730
715
|
},
|
|
731
716
|
};
|
|
732
717
|
|
|
733
|
-
Blockly.JavaScript[
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
718
|
+
Blockly.JavaScript['imap_data'] = function (block) {
|
|
719
|
+
const dropdown_instance = block.getFieldValue('INSTANCE');
|
|
720
|
+
const logLevel = block.getFieldValue('LOG');
|
|
721
|
+
const value_name = block.getFieldValue('IMAPNAME');
|
|
722
|
+
const value_value = block.getFieldValue('IMAPVALUE');
|
|
738
723
|
|
|
739
|
-
|
|
740
|
-
text += ' name: "' + value_name + '",\n';
|
|
741
|
-
text += ' value: "' + value_value + '",\n';
|
|
742
|
-
text += "}";
|
|
743
|
-
|
|
744
|
-
var args = [];
|
|
745
|
-
args.push('\n "name": "' + value_name + '"');
|
|
746
|
-
args.push('\n "value": "' + value_value + '"');
|
|
747
|
-
var logText;
|
|
724
|
+
let logText = '';
|
|
748
725
|
if (logLevel) {
|
|
749
|
-
logText =
|
|
750
|
-
} else {
|
|
751
|
-
logText = "";
|
|
726
|
+
logText = `console.${logLevel}('imap_data: ${value_name}');\n`;
|
|
752
727
|
}
|
|
753
|
-
|
|
754
|
-
statement = Blockly.JavaScript.statementToCode(block,
|
|
755
|
-
|
|
756
|
-
return (
|
|
757
|
-
'
|
|
758
|
-
|
|
759
|
-
'
|
|
760
|
-
command +
|
|
761
|
-
'", ' +
|
|
762
|
-
text +
|
|
763
|
-
", async function (result) {\n " +
|
|
728
|
+
|
|
729
|
+
const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT');
|
|
730
|
+
|
|
731
|
+
return `sendTo('imap${dropdown_instance}', 'getIMAPData', {\n` +
|
|
732
|
+
` name: '${value_name}',\n` +
|
|
733
|
+
` value: '${value_value}',\n` +
|
|
734
|
+
'}, async (result) => {\n' +
|
|
764
735
|
statement +
|
|
765
|
-
|
|
766
|
-
logText
|
|
767
|
-
);
|
|
736
|
+
`});\n${logText}`;
|
|
768
737
|
};
|
|
769
|
-
Blockly.Sendto.blocks[
|
|
738
|
+
Blockly.Sendto.blocks['imap_flag'] =
|
|
739
|
+
'<sep gap="5"></sep>' +
|
|
770
740
|
'<block type="imap_flag">' +
|
|
771
|
-
' <
|
|
772
|
-
"
|
|
773
|
-
' <value name="IMAPNAME">' +
|
|
774
|
-
" </value>" +
|
|
741
|
+
' <field name="INSTANCE"></field>' +
|
|
742
|
+
' <field name="IMAPNAME"></field>' +
|
|
775
743
|
' <value name="FLAG">' +
|
|
776
744
|
' <shadow type="text">' +
|
|
777
745
|
' <field name="TEXT">setFlags</field>' +
|
|
778
|
-
|
|
779
|
-
|
|
746
|
+
' </shadow>' +
|
|
747
|
+
' </value>' +
|
|
780
748
|
' <value name="FLAGTYPE">' +
|
|
781
749
|
' <shadow type="text">' +
|
|
782
750
|
' <field name="TEXT">Seen</field>' +
|
|
783
|
-
|
|
784
|
-
|
|
751
|
+
' </shadow>' +
|
|
752
|
+
' </value>' +
|
|
785
753
|
' <value name="UIDNO">' +
|
|
786
754
|
' <shadow type="math_number">' +
|
|
787
755
|
' <field name="NUM">0</field>' +
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
' <
|
|
791
|
-
|
|
792
|
-
"</block>";
|
|
756
|
+
' </shadow>' +
|
|
757
|
+
' </value>' +
|
|
758
|
+
' <field name="LOG"></field>' +
|
|
759
|
+
'</block>';
|
|
793
760
|
|
|
794
|
-
Blockly.Blocks[
|
|
761
|
+
Blockly.Blocks['imap_flag'] = {
|
|
795
762
|
init: function () {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
763
|
+
const options_user = [];
|
|
764
|
+
const options_instance = [];
|
|
765
|
+
|
|
766
|
+
options_user.push([Blockly.Translate('imap_choose'), 'all']);
|
|
767
|
+
|
|
768
|
+
if (typeof main !== 'undefined' && main.instances) {
|
|
769
|
+
for (let i = 0; i < main.instances.length; i++) {
|
|
770
|
+
const m = main.instances[i].match(/^system.adapter.imap.(\d+)$/);
|
|
802
771
|
if (m) {
|
|
803
|
-
|
|
804
|
-
options_instance.push([
|
|
772
|
+
const n = parseInt(m[1], 10);
|
|
773
|
+
options_instance.push(['imap.' + n, '.' + n]);
|
|
805
774
|
if (main.objects[main.instances[i]].native.hosts) {
|
|
806
|
-
for (
|
|
807
|
-
//Checking active in the main.js.
|
|
808
|
-
|
|
809
|
-
options_user.push([n +
|
|
775
|
+
for (let a = 0; a < main.objects[main.instances[i]].native.hosts.length; a++) {
|
|
776
|
+
// Checking active in the main.js.
|
|
777
|
+
const id = main.objects[main.instances[i]].native.hosts[a].user;
|
|
778
|
+
options_user.push([n + '.' + id, id]);
|
|
810
779
|
}
|
|
811
780
|
}
|
|
812
781
|
}
|
|
813
782
|
}
|
|
814
783
|
}
|
|
784
|
+
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate('no_instance_found'), '']);
|
|
815
785
|
|
|
816
|
-
this.appendDummyInput(
|
|
817
|
-
.appendField(Blockly.Translate(
|
|
818
|
-
.appendField(new Blockly.FieldDropdown(options_instance),
|
|
786
|
+
this.appendDummyInput('INSTANCE')
|
|
787
|
+
.appendField(Blockly.Translate('imap'))
|
|
788
|
+
.appendField(new Blockly.FieldDropdown(options_instance), 'INSTANCE');
|
|
819
789
|
|
|
820
|
-
this.appendDummyInput(
|
|
821
|
-
.appendField(Blockly.Translate(
|
|
822
|
-
.appendField(new Blockly.FieldDropdown(options_user),
|
|
790
|
+
this.appendDummyInput('IMAPNAME')
|
|
791
|
+
.appendField(Blockly.Translate('imap_name'))
|
|
792
|
+
.appendField(new Blockly.FieldDropdown(options_user), 'IMAPNAME');
|
|
823
793
|
|
|
824
|
-
this.appendValueInput(
|
|
825
|
-
this.appendValueInput(
|
|
826
|
-
this.appendValueInput(
|
|
794
|
+
this.appendValueInput('FLAG').appendField(Blockly.Translate('imap_flags'));
|
|
795
|
+
this.appendValueInput('FLAGTYPE').appendField(Blockly.Translate('imap_flagtype'));
|
|
796
|
+
this.appendValueInput('UIDNO').appendField(Blockly.Translate('imap_uid'));
|
|
827
797
|
|
|
828
|
-
this.appendDummyInput(
|
|
829
|
-
.appendField(Blockly.Translate(
|
|
798
|
+
this.appendDummyInput('LOG')
|
|
799
|
+
.appendField(Blockly.Translate('imap_log'))
|
|
830
800
|
.appendField(
|
|
831
801
|
new Blockly.FieldDropdown([
|
|
832
|
-
[Blockly.Translate(
|
|
833
|
-
[Blockly.Translate(
|
|
834
|
-
[Blockly.Translate(
|
|
835
|
-
[Blockly.Translate(
|
|
836
|
-
[Blockly.Translate(
|
|
802
|
+
[Blockly.Translate('imap_log_none'), ''],
|
|
803
|
+
[Blockly.Translate('imap_log_debug'), 'debug'],
|
|
804
|
+
[Blockly.Translate('imap_log_info'), 'log'],
|
|
805
|
+
[Blockly.Translate('imap_log_warn'), 'warn'],
|
|
806
|
+
[Blockly.Translate('imap_log_error'), 'error'],
|
|
837
807
|
]),
|
|
838
|
-
|
|
808
|
+
'LOG',
|
|
839
809
|
);
|
|
840
810
|
|
|
841
811
|
this.setInputsInline(false);
|
|
@@ -843,39 +813,29 @@ Blockly.Blocks["imap_flag"] = {
|
|
|
843
813
|
this.setNextStatement(true, null);
|
|
844
814
|
|
|
845
815
|
this.setColour(Blockly.Sendto.HUE);
|
|
846
|
-
|
|
847
|
-
this.
|
|
816
|
+
|
|
817
|
+
this.setTooltip(Blockly.Translate('imap_tooltip_flags'));
|
|
818
|
+
this.setHelpUrl(Blockly.Translate('imap_help'));
|
|
848
819
|
},
|
|
849
820
|
};
|
|
850
821
|
|
|
851
|
-
Blockly.JavaScript[
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
822
|
+
Blockly.JavaScript['imap_flag'] = function (block) {
|
|
823
|
+
const dropdown_instance = block.getFieldValue('INSTANCE');
|
|
824
|
+
const logLevel = block.getFieldValue('LOG');
|
|
825
|
+
const value_name = block.getFieldValue('IMAPNAME');
|
|
826
|
+
const value_flag = Blockly.JavaScript.valueToCode(block, 'FLAG', Blockly.JavaScript.ORDER_ATOMIC);
|
|
827
|
+
const value_flagtype = Blockly.JavaScript.valueToCode(block, 'FLAGTYPE', Blockly.JavaScript.ORDER_ATOMIC);
|
|
828
|
+
const value_uid = Blockly.JavaScript.valueToCode(block, 'UIDNO', Blockly.JavaScript.ORDER_ATOMIC);
|
|
858
829
|
|
|
859
|
-
|
|
830
|
+
let logText = '';
|
|
860
831
|
if (logLevel) {
|
|
861
|
-
logText =
|
|
862
|
-
"console." + logLevel + "(\"imap_flag: " + value_flag + " + " + value_uid + " + " + value_name + "\");\n";
|
|
863
|
-
} else {
|
|
864
|
-
logText = "";
|
|
832
|
+
logText = `console.${logLevel}('imap_flag: ' + ${value_flag} + ' ' + ${value_uid} + ' ${value_name}');\n`;
|
|
865
833
|
}
|
|
866
834
|
|
|
867
|
-
return (
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
value_uid +
|
|
874
|
-
", flagtype: " +
|
|
875
|
-
value_flagtype +
|
|
876
|
-
", name: '" +
|
|
877
|
-
value_name +
|
|
878
|
-
"'});\n" +
|
|
879
|
-
logText
|
|
880
|
-
);
|
|
835
|
+
return `sendTo('imap${dropdown_instance}', 'getFlags', {\n` +
|
|
836
|
+
` flag: ${value_flag},\n` +
|
|
837
|
+
` uid: ${value_uid},\n` +
|
|
838
|
+
` flagtype: ${value_flagtype},\n` +
|
|
839
|
+
` name: '${value_name},\n` +
|
|
840
|
+
`});\n${logText}`;
|
|
881
841
|
};
|