iobroker.imap 0.1.3 → 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 +9 -1
- package/admin/blockly.js +654 -711
- package/io-package.json +21 -18
- package/lib/Connection.js +2 -1
- package/package.json +15 -15
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,448 +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
|
-
en:
|
|
116
|
-
de:
|
|
117
|
-
ru:
|
|
118
|
-
pt:
|
|
119
|
-
nl:
|
|
120
|
-
fr:
|
|
121
|
-
it:
|
|
122
|
-
es:
|
|
123
|
-
pl:
|
|
124
|
-
uk:
|
|
125
|
-
|
|
126
|
-
};
|
|
127
|
-
Blockly.Words[
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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.Words[
|
|
388
|
-
en:
|
|
389
|
-
de:
|
|
390
|
-
ru:
|
|
391
|
-
pt:
|
|
392
|
-
nl:
|
|
393
|
-
fr:
|
|
394
|
-
it:
|
|
395
|
-
es:
|
|
396
|
-
pl:
|
|
397
|
-
uk:
|
|
398
|
-
|
|
399
|
-
};
|
|
400
|
-
Blockly.Sendto.blocks[
|
|
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'] =
|
|
401
401
|
'<block type="imap">' +
|
|
402
|
-
' <
|
|
403
|
-
"
|
|
404
|
-
' <value name="IMAPNAME">' +
|
|
405
|
-
" </value>" +
|
|
402
|
+
' <field name="INSTANCE"></field>' +
|
|
403
|
+
' <field name="IMAPNAME"></field>' +
|
|
406
404
|
' <value name="SEARCH">' +
|
|
407
405
|
' <shadow type="text">' +
|
|
408
406
|
' <field name="TEXT">["UNSEEN"]</field>' +
|
|
409
|
-
|
|
410
|
-
|
|
407
|
+
' </shadow>' +
|
|
408
|
+
' </value>' +
|
|
411
409
|
' <value name="MAX">' +
|
|
412
410
|
' <shadow type="math_number">' +
|
|
413
411
|
' <field name="NUM">20</field>' +
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
' <
|
|
417
|
-
|
|
418
|
-
"</block>";
|
|
412
|
+
' </shadow>' +
|
|
413
|
+
' </value>' +
|
|
414
|
+
' <field name="LOG"></field>' +
|
|
415
|
+
'</block>';
|
|
419
416
|
|
|
420
|
-
Blockly.Blocks[
|
|
417
|
+
Blockly.Blocks['imap'] = {
|
|
421
418
|
init: function () {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
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+)$/);
|
|
428
427
|
if (m) {
|
|
429
|
-
|
|
430
|
-
options_instance.push([
|
|
428
|
+
const n = parseInt(m[1], 10);
|
|
429
|
+
options_instance.push(['imap.' + n, '.' + n]);
|
|
431
430
|
if (main.objects[main.instances[i]].native.hosts) {
|
|
432
|
-
for (
|
|
433
|
-
//Checking active in the main.js.
|
|
434
|
-
|
|
435
|
-
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]);
|
|
436
435
|
}
|
|
437
436
|
}
|
|
438
437
|
}
|
|
439
438
|
}
|
|
440
439
|
}
|
|
441
|
-
if (
|
|
440
|
+
if (options_instance.length == 0) options_instance.push([Blockly.Translate('no_instance_found'), '']);
|
|
442
441
|
|
|
443
|
-
this.appendDummyInput(
|
|
444
|
-
.appendField(Blockly.Translate(
|
|
445
|
-
.appendField(new Blockly.FieldDropdown(options_instance),
|
|
446
|
-
this.appendDummyInput(
|
|
447
|
-
.appendField(Blockly.Translate(
|
|
448
|
-
.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');
|
|
449
448
|
|
|
450
|
-
this.appendValueInput(
|
|
449
|
+
this.appendValueInput('SEARCH').appendField(Blockly.Translate('imap_search'));
|
|
451
450
|
|
|
452
|
-
this.appendValueInput(
|
|
451
|
+
this.appendValueInput('MAX').appendField(Blockly.Translate('imap_max'));
|
|
453
452
|
|
|
454
|
-
this.appendDummyInput(
|
|
455
|
-
.appendField(Blockly.Translate(
|
|
453
|
+
this.appendDummyInput('LOG')
|
|
454
|
+
.appendField(Blockly.Translate('imap_log'))
|
|
456
455
|
.appendField(
|
|
457
456
|
new Blockly.FieldDropdown([
|
|
458
|
-
[Blockly.Translate(
|
|
459
|
-
[Blockly.Translate(
|
|
460
|
-
[Blockly.Translate(
|
|
461
|
-
[Blockly.Translate(
|
|
462
|
-
[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'],
|
|
463
462
|
]),
|
|
464
|
-
|
|
463
|
+
'LOG',
|
|
465
464
|
);
|
|
466
465
|
|
|
467
466
|
this.setInputsInline(false);
|
|
@@ -469,390 +468,344 @@ Blockly.Blocks["imap"] = {
|
|
|
469
468
|
this.setNextStatement(true, null);
|
|
470
469
|
|
|
471
470
|
this.setColour(Blockly.Sendto.HUE);
|
|
472
|
-
|
|
473
|
-
this.
|
|
471
|
+
|
|
472
|
+
this.setTooltip(Blockly.Translate('imap_tooltip'));
|
|
473
|
+
this.setHelpUrl(Blockly.Translate('imap_help'));
|
|
474
474
|
},
|
|
475
475
|
};
|
|
476
476
|
|
|
477
|
-
Blockly.JavaScript[
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
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);
|
|
483
483
|
|
|
484
|
-
|
|
484
|
+
let logText = '';
|
|
485
485
|
if (logLevel) {
|
|
486
|
-
logText =
|
|
487
|
-
"console." + logLevel + "(\"imap: " + value_max + " + " + value_name + "\");\n";
|
|
488
|
-
} else {
|
|
489
|
-
logText = "";
|
|
486
|
+
logText = `console.${logLevel}('imap: ' + ${value_max} + ' ' + ${value_name});\n`;
|
|
490
487
|
}
|
|
491
488
|
|
|
492
|
-
return (
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
"'});\n" +
|
|
502
|
-
logText
|
|
503
|
-
);
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
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>' +
|
|
507
498
|
'<block type="imap_request">' +
|
|
508
|
-
' <
|
|
509
|
-
"
|
|
510
|
-
' <value name="IMAPNAME">' +
|
|
511
|
-
" </value>" +
|
|
499
|
+
' <field name="INSTANCE"></field>' +
|
|
500
|
+
' <field name="IMAPNAME"></field>' +
|
|
512
501
|
' <value name="SEARCH">' +
|
|
513
502
|
' <shadow type="text">' +
|
|
514
|
-
' <field name="TEXT">["ALL", ["SINCE", "May 20,
|
|
515
|
-
|
|
516
|
-
|
|
503
|
+
' <field name="TEXT">["ALL", ["SINCE", "May 20, 2024"]]</field>' +
|
|
504
|
+
' </shadow>' +
|
|
505
|
+
' </value>' +
|
|
517
506
|
' <value name="FETCH">' +
|
|
518
507
|
' <shadow type="text">' +
|
|
519
508
|
' <field name="TEXT">{"fetch": false, "uid": [1,2,3,4]}</field>' +
|
|
520
|
-
|
|
521
|
-
|
|
509
|
+
' </shadow>' +
|
|
510
|
+
' </value>' +
|
|
522
511
|
' <value name="BODIES">' +
|
|
523
512
|
' <shadow type="text">' +
|
|
524
513
|
' <field name="TEXT">{bodies: "", markSeen: false}</field>' +
|
|
525
|
-
|
|
526
|
-
|
|
514
|
+
' </shadow>' +
|
|
515
|
+
' </value>' +
|
|
527
516
|
' <value name="MAX">' +
|
|
528
517
|
' <shadow type="math_number">' +
|
|
529
518
|
' <field name="NUM">20</field>' +
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
' <
|
|
533
|
-
"
|
|
534
|
-
' <
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
"</block>";
|
|
539
|
-
|
|
540
|
-
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'] = {
|
|
541
527
|
init: function () {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
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+)$/);
|
|
548
536
|
if (m) {
|
|
549
|
-
|
|
550
|
-
options_instance.push([
|
|
537
|
+
const n = parseInt(m[1], 10);
|
|
538
|
+
options_instance.push(['imap.' + n, '.' + n]);
|
|
551
539
|
if (main.objects[main.instances[i]].native.hosts) {
|
|
552
|
-
for (
|
|
553
|
-
//Checking active in the main.js.
|
|
554
|
-
|
|
555
|
-
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]);
|
|
556
544
|
}
|
|
557
545
|
}
|
|
558
546
|
}
|
|
559
547
|
}
|
|
560
548
|
}
|
|
561
|
-
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate(
|
|
549
|
+
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate('no_instance_found'), '']);
|
|
562
550
|
|
|
563
|
-
this.appendDummyInput(
|
|
564
|
-
.appendField(Blockly.Translate(
|
|
565
|
-
.appendField(new Blockly.FieldDropdown(options_instance),
|
|
551
|
+
this.appendDummyInput('INSTANCE')
|
|
552
|
+
.appendField(Blockly.Translate('imap'))
|
|
553
|
+
.appendField(new Blockly.FieldDropdown(options_instance), 'INSTANCE');
|
|
566
554
|
|
|
567
|
-
this.appendDummyInput(
|
|
568
|
-
.appendField(Blockly.Translate(
|
|
569
|
-
.appendField(new Blockly.FieldDropdown(options_user),
|
|
555
|
+
this.appendDummyInput('IMAPNAME')
|
|
556
|
+
.appendField(Blockly.Translate('imap_name'))
|
|
557
|
+
.appendField(new Blockly.FieldDropdown(options_user), 'IMAPNAME');
|
|
570
558
|
|
|
571
|
-
this.appendValueInput(
|
|
559
|
+
this.appendValueInput('SEARCH').appendField(Blockly.Translate('imap_search'));
|
|
572
560
|
|
|
573
|
-
this.appendValueInput(
|
|
561
|
+
this.appendValueInput('FETCH').appendField(Blockly.Translate('imap_fetch'));
|
|
574
562
|
|
|
575
|
-
this.appendValueInput(
|
|
563
|
+
this.appendValueInput('BODIES').appendField(Blockly.Translate('imap_bodies'));
|
|
576
564
|
|
|
577
|
-
this.appendValueInput(
|
|
565
|
+
this.appendValueInput('MAX').appendField(Blockly.Translate('imap_max'));
|
|
578
566
|
|
|
579
|
-
this.appendDummyInput(
|
|
580
|
-
.appendField(Blockly.Translate(
|
|
581
|
-
.appendField(new Blockly.FieldCheckbox(
|
|
567
|
+
this.appendDummyInput('MAILPARSER')
|
|
568
|
+
.appendField(Blockly.Translate('imap_mailparser'))
|
|
569
|
+
.appendField(new Blockly.FieldCheckbox('TRUE'), 'MAILPARSER');
|
|
582
570
|
|
|
583
|
-
this.appendDummyInput(
|
|
584
|
-
.appendField(Blockly.Translate(
|
|
571
|
+
this.appendDummyInput('LOG')
|
|
572
|
+
.appendField(Blockly.Translate('imap_log'))
|
|
585
573
|
.appendField(
|
|
586
574
|
new Blockly.FieldDropdown([
|
|
587
|
-
[Blockly.Translate(
|
|
588
|
-
[Blockly.Translate(
|
|
589
|
-
[Blockly.Translate(
|
|
590
|
-
[Blockly.Translate(
|
|
591
|
-
[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'],
|
|
592
580
|
]),
|
|
593
|
-
|
|
581
|
+
'LOG',
|
|
594
582
|
);
|
|
595
|
-
this.appendStatementInput(
|
|
583
|
+
this.appendStatementInput('STATEMENT').setCheck(null);
|
|
596
584
|
|
|
597
585
|
this.setInputsInline(false);
|
|
598
586
|
this.setPreviousStatement(true, null);
|
|
599
587
|
this.setNextStatement(true, null);
|
|
600
588
|
|
|
601
589
|
this.setColour(Blockly.Sendto.HUE);
|
|
602
|
-
|
|
603
|
-
this.
|
|
590
|
+
|
|
591
|
+
this.setTooltip(Blockly.Translate('imap_tooltip_request'));
|
|
592
|
+
this.setHelpUrl(Blockly.Translate('imap_help'));
|
|
604
593
|
},
|
|
605
594
|
};
|
|
606
595
|
|
|
607
|
-
Blockly.JavaScript[
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
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) {
|
|
617
607
|
value_parse = true;
|
|
618
608
|
} else {
|
|
619
609
|
value_parse = false;
|
|
620
610
|
}
|
|
621
611
|
|
|
622
|
-
|
|
623
|
-
if (value_fetch !== null && value_fetch !==
|
|
624
|
-
if (typeof value_fetch ===
|
|
625
|
-
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)})`;
|
|
626
616
|
} else {
|
|
627
|
-
para_fetch =
|
|
617
|
+
para_fetch = `JSON.parse(${value_fetch})`;
|
|
628
618
|
}
|
|
629
619
|
}
|
|
630
620
|
|
|
631
|
-
|
|
632
|
-
text += ' name: "' + value_name + '",\n';
|
|
633
|
-
text += " max: " + value_max + ",\n";
|
|
634
|
-
text += " search: " + value_search + ",\n";
|
|
635
|
-
text += " fetch: " + para_fetch + ",\n";
|
|
636
|
-
text += " bodie: " + value_bodie + ",\n";
|
|
637
|
-
text += " parse: " + value_parse + ",\n";
|
|
638
|
-
text += "}";
|
|
639
|
-
|
|
640
|
-
var args = [];
|
|
641
|
-
args.push('\n "name": "' + value_name + '"');
|
|
642
|
-
args.push('\n "max": ' + value_max);
|
|
643
|
-
args.push('\n "search": ' + value_search);
|
|
644
|
-
args.push('\n "fetch": ' + value_fetch);
|
|
645
|
-
args.push('\n "bodie": ' + value_bodie);
|
|
646
|
-
args.push('\n "parse": ' + value_parse);
|
|
647
|
-
var logText;
|
|
621
|
+
let logText = '';
|
|
648
622
|
if (logLevel) {
|
|
649
|
-
logText =
|
|
650
|
-
} else {
|
|
651
|
-
logText = "";
|
|
623
|
+
logText = `console.${logLevel}('imap_request: ' + ${value_max} + ' ${value_name}');\n`;
|
|
652
624
|
}
|
|
653
|
-
|
|
654
|
-
statement = Blockly.JavaScript.statementToCode(block,
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
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` +
|
|
664
637
|
statement +
|
|
665
|
-
|
|
666
|
-
logText
|
|
667
|
-
);
|
|
638
|
+
`});\n${logText}`;
|
|
668
639
|
};
|
|
669
640
|
|
|
670
|
-
Blockly.Sendto.blocks[
|
|
641
|
+
Blockly.Sendto.blocks['imap_data'] =
|
|
642
|
+
'<sep gap="5"></sep>' +
|
|
671
643
|
'<block type="imap_data">' +
|
|
672
|
-
' <
|
|
673
|
-
"
|
|
674
|
-
' <
|
|
675
|
-
"
|
|
676
|
-
' <
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
' <value name="STATEMENT">' +
|
|
681
|
-
" </value>" +
|
|
682
|
-
"</block>";
|
|
683
|
-
|
|
684
|
-
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'] = {
|
|
685
652
|
init: function () {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
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+)$/);
|
|
692
661
|
if (m) {
|
|
693
|
-
|
|
694
|
-
options_instance.push([
|
|
662
|
+
const n = parseInt(m[1], 10);
|
|
663
|
+
options_instance.push(['imap.' + n, '.' + n]);
|
|
695
664
|
if (main.objects[main.instances[i]].native.hosts) {
|
|
696
|
-
for (
|
|
665
|
+
for (let a = 0; a < main.objects[main.instances[i]].native.hosts.length; a++) {
|
|
697
666
|
//Checking active in the main.js.
|
|
698
|
-
|
|
699
|
-
options_user.push([n +
|
|
667
|
+
const id = main.objects[main.instances[i]].native.hosts[a].user;
|
|
668
|
+
options_user.push([n + '.' + id, id]);
|
|
700
669
|
}
|
|
701
670
|
}
|
|
702
671
|
}
|
|
703
672
|
}
|
|
704
673
|
}
|
|
705
|
-
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate(
|
|
674
|
+
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate('no_instance_found'), '']);
|
|
706
675
|
|
|
707
|
-
this.appendDummyInput(
|
|
708
|
-
.appendField(Blockly.Translate(
|
|
709
|
-
.appendField(new Blockly.FieldDropdown(options_instance),
|
|
676
|
+
this.appendDummyInput('INSTANCE')
|
|
677
|
+
.appendField(Blockly.Translate('imap'))
|
|
678
|
+
.appendField(new Blockly.FieldDropdown(options_instance), 'INSTANCE');
|
|
710
679
|
|
|
711
|
-
this.appendDummyInput(
|
|
712
|
-
.appendField(Blockly.Translate(
|
|
713
|
-
.appendField(new Blockly.FieldDropdown(options_user),
|
|
680
|
+
this.appendDummyInput('IMAPNAME')
|
|
681
|
+
.appendField(Blockly.Translate('imap_name'))
|
|
682
|
+
.appendField(new Blockly.FieldDropdown(options_user), 'IMAPNAME');
|
|
714
683
|
|
|
715
|
-
this.appendDummyInput(
|
|
716
|
-
.appendField(Blockly.Translate(
|
|
684
|
+
this.appendDummyInput('IMAPVALUE')
|
|
685
|
+
.appendField(Blockly.Translate('imap_data'))
|
|
717
686
|
.appendField(
|
|
718
687
|
new Blockly.FieldDropdown([
|
|
719
|
-
[Blockly.Translate(
|
|
720
|
-
[Blockly.Translate(
|
|
688
|
+
[Blockly.Translate('imap_data_json'), 'data'],
|
|
689
|
+
[Blockly.Translate('imap_data_seqno'), 'seqno'],
|
|
721
690
|
]),
|
|
722
|
-
|
|
691
|
+
'IMAPVALUE',
|
|
723
692
|
);
|
|
724
693
|
|
|
725
|
-
this.appendDummyInput(
|
|
726
|
-
.appendField(Blockly.Translate(
|
|
694
|
+
this.appendDummyInput('LOG')
|
|
695
|
+
.appendField(Blockly.Translate('imap_log'))
|
|
727
696
|
.appendField(
|
|
728
697
|
new Blockly.FieldDropdown([
|
|
729
|
-
[Blockly.Translate(
|
|
730
|
-
[Blockly.Translate(
|
|
731
|
-
[Blockly.Translate(
|
|
732
|
-
[Blockly.Translate(
|
|
733
|
-
[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'],
|
|
734
703
|
]),
|
|
735
|
-
|
|
704
|
+
'LOG',
|
|
736
705
|
);
|
|
737
|
-
this.appendStatementInput(
|
|
706
|
+
this.appendStatementInput('STATEMENT').setCheck(null);
|
|
738
707
|
|
|
739
708
|
this.setInputsInline(false);
|
|
740
709
|
this.setPreviousStatement(true, null);
|
|
741
710
|
this.setNextStatement(true, null);
|
|
742
711
|
|
|
743
712
|
this.setColour(Blockly.Sendto.HUE);
|
|
744
|
-
this.setTooltip(Blockly.Translate(
|
|
745
|
-
this.setHelpUrl(Blockly.Translate(
|
|
713
|
+
this.setTooltip(Blockly.Translate('imap_tooltip_data'));
|
|
714
|
+
this.setHelpUrl(Blockly.Translate('imap_help'));
|
|
746
715
|
},
|
|
747
716
|
};
|
|
748
717
|
|
|
749
|
-
Blockly.JavaScript[
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
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');
|
|
754
723
|
|
|
755
|
-
|
|
756
|
-
text += ' name: "' + value_name + '",\n';
|
|
757
|
-
text += ' value: "' + value_value + '",\n';
|
|
758
|
-
text += "}";
|
|
759
|
-
|
|
760
|
-
var args = [];
|
|
761
|
-
args.push('\n "name": "' + value_name + '"');
|
|
762
|
-
args.push('\n "value": "' + value_value + '"');
|
|
763
|
-
var logText;
|
|
724
|
+
let logText = '';
|
|
764
725
|
if (logLevel) {
|
|
765
|
-
logText =
|
|
766
|
-
} else {
|
|
767
|
-
logText = "";
|
|
726
|
+
logText = `console.${logLevel}('imap_data: ${value_name}');\n`;
|
|
768
727
|
}
|
|
769
|
-
|
|
770
|
-
statement = Blockly.JavaScript.statementToCode(block,
|
|
771
|
-
|
|
772
|
-
return (
|
|
773
|
-
'
|
|
774
|
-
|
|
775
|
-
'
|
|
776
|
-
command +
|
|
777
|
-
'", ' +
|
|
778
|
-
text +
|
|
779
|
-
", 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' +
|
|
780
735
|
statement +
|
|
781
|
-
|
|
782
|
-
logText
|
|
783
|
-
);
|
|
736
|
+
`});\n${logText}`;
|
|
784
737
|
};
|
|
785
|
-
Blockly.Sendto.blocks[
|
|
738
|
+
Blockly.Sendto.blocks['imap_flag'] =
|
|
739
|
+
'<sep gap="5"></sep>' +
|
|
786
740
|
'<block type="imap_flag">' +
|
|
787
|
-
' <
|
|
788
|
-
"
|
|
789
|
-
' <value name="IMAPNAME">' +
|
|
790
|
-
" </value>" +
|
|
741
|
+
' <field name="INSTANCE"></field>' +
|
|
742
|
+
' <field name="IMAPNAME"></field>' +
|
|
791
743
|
' <value name="FLAG">' +
|
|
792
744
|
' <shadow type="text">' +
|
|
793
745
|
' <field name="TEXT">setFlags</field>' +
|
|
794
|
-
|
|
795
|
-
|
|
746
|
+
' </shadow>' +
|
|
747
|
+
' </value>' +
|
|
796
748
|
' <value name="FLAGTYPE">' +
|
|
797
749
|
' <shadow type="text">' +
|
|
798
750
|
' <field name="TEXT">Seen</field>' +
|
|
799
|
-
|
|
800
|
-
|
|
751
|
+
' </shadow>' +
|
|
752
|
+
' </value>' +
|
|
801
753
|
' <value name="UIDNO">' +
|
|
802
754
|
' <shadow type="math_number">' +
|
|
803
755
|
' <field name="NUM">0</field>' +
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
' <
|
|
807
|
-
|
|
808
|
-
"</block>";
|
|
756
|
+
' </shadow>' +
|
|
757
|
+
' </value>' +
|
|
758
|
+
' <field name="LOG"></field>' +
|
|
759
|
+
'</block>';
|
|
809
760
|
|
|
810
|
-
Blockly.Blocks[
|
|
761
|
+
Blockly.Blocks['imap_flag'] = {
|
|
811
762
|
init: function () {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
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+)$/);
|
|
818
771
|
if (m) {
|
|
819
|
-
|
|
820
|
-
options_instance.push([
|
|
772
|
+
const n = parseInt(m[1], 10);
|
|
773
|
+
options_instance.push(['imap.' + n, '.' + n]);
|
|
821
774
|
if (main.objects[main.instances[i]].native.hosts) {
|
|
822
|
-
for (
|
|
823
|
-
//Checking active in the main.js.
|
|
824
|
-
|
|
825
|
-
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]);
|
|
826
779
|
}
|
|
827
780
|
}
|
|
828
781
|
}
|
|
829
782
|
}
|
|
830
783
|
}
|
|
831
|
-
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate(
|
|
784
|
+
if (Object.keys(options_instance).length == 0) options_instance.push([Blockly.Translate('no_instance_found'), '']);
|
|
832
785
|
|
|
833
|
-
this.appendDummyInput(
|
|
834
|
-
.appendField(Blockly.Translate(
|
|
835
|
-
.appendField(new Blockly.FieldDropdown(options_instance),
|
|
786
|
+
this.appendDummyInput('INSTANCE')
|
|
787
|
+
.appendField(Blockly.Translate('imap'))
|
|
788
|
+
.appendField(new Blockly.FieldDropdown(options_instance), 'INSTANCE');
|
|
836
789
|
|
|
837
|
-
this.appendDummyInput(
|
|
838
|
-
.appendField(Blockly.Translate(
|
|
839
|
-
.appendField(new Blockly.FieldDropdown(options_user),
|
|
790
|
+
this.appendDummyInput('IMAPNAME')
|
|
791
|
+
.appendField(Blockly.Translate('imap_name'))
|
|
792
|
+
.appendField(new Blockly.FieldDropdown(options_user), 'IMAPNAME');
|
|
840
793
|
|
|
841
|
-
this.appendValueInput(
|
|
842
|
-
this.appendValueInput(
|
|
843
|
-
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'));
|
|
844
797
|
|
|
845
|
-
this.appendDummyInput(
|
|
846
|
-
.appendField(Blockly.Translate(
|
|
798
|
+
this.appendDummyInput('LOG')
|
|
799
|
+
.appendField(Blockly.Translate('imap_log'))
|
|
847
800
|
.appendField(
|
|
848
801
|
new Blockly.FieldDropdown([
|
|
849
|
-
[Blockly.Translate(
|
|
850
|
-
[Blockly.Translate(
|
|
851
|
-
[Blockly.Translate(
|
|
852
|
-
[Blockly.Translate(
|
|
853
|
-
[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'],
|
|
854
807
|
]),
|
|
855
|
-
|
|
808
|
+
'LOG',
|
|
856
809
|
);
|
|
857
810
|
|
|
858
811
|
this.setInputsInline(false);
|
|
@@ -860,39 +813,29 @@ Blockly.Blocks["imap_flag"] = {
|
|
|
860
813
|
this.setNextStatement(true, null);
|
|
861
814
|
|
|
862
815
|
this.setColour(Blockly.Sendto.HUE);
|
|
863
|
-
|
|
864
|
-
this.
|
|
816
|
+
|
|
817
|
+
this.setTooltip(Blockly.Translate('imap_tooltip_flags'));
|
|
818
|
+
this.setHelpUrl(Blockly.Translate('imap_help'));
|
|
865
819
|
},
|
|
866
820
|
};
|
|
867
821
|
|
|
868
|
-
Blockly.JavaScript[
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
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);
|
|
875
829
|
|
|
876
|
-
|
|
830
|
+
let logText = '';
|
|
877
831
|
if (logLevel) {
|
|
878
|
-
logText =
|
|
879
|
-
"console." + logLevel + "(\"imap_flag: " + value_flag + " + " + value_uid + " + " + value_name + "\");\n";
|
|
880
|
-
} else {
|
|
881
|
-
logText = "";
|
|
832
|
+
logText = `console.${logLevel}('imap_flag: ' + ${value_flag} + ' ' + ${value_uid} + ' ${value_name}');\n`;
|
|
882
833
|
}
|
|
883
834
|
|
|
884
|
-
return (
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
value_uid +
|
|
891
|
-
", flagtype: " +
|
|
892
|
-
value_flagtype +
|
|
893
|
-
", name: '" +
|
|
894
|
-
value_name +
|
|
895
|
-
"'});\n" +
|
|
896
|
-
logText
|
|
897
|
-
);
|
|
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}`;
|
|
898
841
|
};
|