wfc 2.1.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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/README.md +206 -0
- data/Rakefile +4 -0
- data/lib/web_forms.rb +2666 -0
- data/lib/wfc/version.rb +5 -0
- data/lib/wfc.rb +4 -0
- data/sig/wfc.rbs +4 -0
- metadata +49 -0
data/lib/web_forms.rb
ADDED
|
@@ -0,0 +1,2666 @@
|
|
|
1
|
+
# web_forms.rb 2.1 - The Back-End Part of WebForms Core Technology, Owned by Elanat (https://elanat.net)
|
|
2
|
+
# Compatible with WebFormsJS version 2.1
|
|
3
|
+
|
|
4
|
+
module WebFormsCore
|
|
5
|
+
class WebForms
|
|
6
|
+
GS = 29.chr
|
|
7
|
+
US = 31.chr
|
|
8
|
+
|
|
9
|
+
def initialize
|
|
10
|
+
@web_forms_data = ""
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def add(name, value = nil)
|
|
14
|
+
if @web_forms_data.length > 0
|
|
15
|
+
@web_forms_data << "\n"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
@web_forms_data << name
|
|
19
|
+
unless value.nil?
|
|
20
|
+
@web_forms_data << "="
|
|
21
|
+
@web_forms_data << value
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def add_to_up(name, value = nil)
|
|
26
|
+
line = value.nil? ? name : "#{name}=#{value}"
|
|
27
|
+
|
|
28
|
+
if @web_forms_data.length > 0
|
|
29
|
+
line += "\n"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
@web_forms_data.prepend(line)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def get_line_by_index(index)
|
|
36
|
+
return "" if @web_forms_data.length == 0
|
|
37
|
+
|
|
38
|
+
data = @web_forms_data
|
|
39
|
+
lines = data.split("\n", -1)
|
|
40
|
+
|
|
41
|
+
index = lines.length + index if index < 0
|
|
42
|
+
|
|
43
|
+
return "" if index < 0 || index >= lines.length
|
|
44
|
+
|
|
45
|
+
lines[index]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def update_line_by_index(index, name, value)
|
|
49
|
+
return if @web_forms_data.length == 0
|
|
50
|
+
|
|
51
|
+
data = @web_forms_data
|
|
52
|
+
lines = data.split("\n", -1)
|
|
53
|
+
|
|
54
|
+
index = lines.length + index if index < 0
|
|
55
|
+
|
|
56
|
+
return if index < 0 || index >= lines.length
|
|
57
|
+
|
|
58
|
+
lines[index] = name + (value.nil? || value.empty? ? "" : "=" + value)
|
|
59
|
+
|
|
60
|
+
@web_forms_data.clear
|
|
61
|
+
@web_forms_data << lines.join("\n")
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# For Extension
|
|
65
|
+
def add_line(name, value)
|
|
66
|
+
add(name, value)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Add
|
|
70
|
+
# Creates the Data if it does not exist; otherwise, Appends the New Value to the Existing Value.
|
|
71
|
+
def add_id(input_place, id)
|
|
72
|
+
add("ai" + input_place, id)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def add_name(input_place, name)
|
|
76
|
+
add("an" + input_place, name)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def add_value(input_place, value)
|
|
80
|
+
add("av" + input_place, value)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def add_class(input_place, class_name)
|
|
84
|
+
add("ac" + input_place, class_name)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def add_style(input_place, name_or_style, value = nil)
|
|
88
|
+
if value.nil?
|
|
89
|
+
add("as" + input_place, name_or_style)
|
|
90
|
+
else
|
|
91
|
+
add("as" + input_place, name_or_style + ':' + value)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def add_option_tag(input_place, text, value, selected = false)
|
|
96
|
+
add("ao" + input_place, value + GS + text + (selected ? GS + "1" : ""))
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def add_check_box_tag(input_place, text, value, checked = false)
|
|
100
|
+
add("ak" + input_place, value + GS + text + (checked ? GS + "1" : ""))
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def add_title(input_place, title)
|
|
104
|
+
add("al" + input_place, title)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def add_label(input_place, label)
|
|
108
|
+
add("aA" + input_place, label)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def add_text(input_place, text)
|
|
112
|
+
add("at" + input_place, text.gsub("\n", "$[ln];"))
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def add_text_to_up(input_place, text)
|
|
116
|
+
add("pt" + input_place, text.gsub("\n", "$[ln];"))
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def add_attribute(input_place, attribute, value = "", splitter = "\0")
|
|
120
|
+
add("aa" + input_place, attribute + GS + (splitter != "\0" ? splitter.to_s : "") + (!value.nil? && !value.empty? ? GS + value : ""))
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def add_tag(input_place, tag_name, id = "")
|
|
124
|
+
add("nt" + input_place, tag_name + (!id.nil? && !id.empty? ? GS + id : ""))
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def add_tag_to_up(input_place, tag_name, id = "")
|
|
128
|
+
add("ut" + input_place, tag_name + (!id.nil? && !id.empty? ? GS + id : ""))
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def add_tag_before(input_place, tag_name, id = "")
|
|
132
|
+
add("bt" + input_place, tag_name + (!id.nil? && !id.empty? ? GS + id : ""))
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def add_tag_after(input_place, tag_name, id = "")
|
|
136
|
+
add("ft" + input_place, tag_name + (!id.nil? && !id.empty? ? GS + id : ""))
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def add_hidden(input_place, name, value, id = "")
|
|
140
|
+
add("ah" + input_place, name + GS + value + (!id.nil? && !id.empty? ? GS + id : ""))
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Set
|
|
144
|
+
# Creates the Data if it does not exist; otherwise, Replaces the Existing Value with the New Value.
|
|
145
|
+
def set_id(input_place, id)
|
|
146
|
+
add("si" + input_place, id)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def set_name(input_place, name)
|
|
150
|
+
add("sn" + input_place, name)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def set_value(input_place, value)
|
|
154
|
+
add("sv" + input_place, value)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def set_class(input_place, class_name)
|
|
158
|
+
add("sc" + input_place, class_name)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def set_style(input_place, name_or_style, value = nil)
|
|
162
|
+
if value.nil?
|
|
163
|
+
add("ss" + input_place, name_or_style)
|
|
164
|
+
else
|
|
165
|
+
add("ss" + input_place, name_or_style + ':' + value)
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def set_option_tag(input_place, text, value, selected = false)
|
|
170
|
+
add("so" + input_place, value + GS + text + (selected ? GS + "1" : ""))
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def set_checked(input_place, checked = false)
|
|
174
|
+
add("sk" + input_place, checked ? "1" : "0")
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def set_check_box_tag(input_place, text, value, checked = false)
|
|
178
|
+
add("sk" + input_place, value + GS + text + (checked ? GS + "1" : ""))
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
def set_title(input_place, title)
|
|
182
|
+
add("sl" + input_place, title)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def set_label(input_place, label)
|
|
186
|
+
add("sA" + input_place, label)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def set_text(input_place, text)
|
|
190
|
+
add("st" + input_place, text.gsub("\n", "$[ln];"))
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def set_attribute(input_place, attribute, value = "")
|
|
194
|
+
add("sa" + input_place, attribute + GS + (!value.nil? && !value.empty? ? GS + value : ""))
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
def set_width(input_place, width)
|
|
198
|
+
final_width = width.is_a?(Integer) ? "#{width}px" : width.to_s
|
|
199
|
+
add("sw" + input_place, final_width)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def set_height(input_place, height)
|
|
203
|
+
final_height = height.is_a?(Integer) ? "#{height}px" : height.to_s
|
|
204
|
+
add("sh" + input_place, final_height)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
def set_background_color(input_place, color)
|
|
208
|
+
add("bc" + input_place, color)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def set_text_color(input_place, color)
|
|
212
|
+
add("tc" + input_place, color)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def set_font_name(input_place, name)
|
|
216
|
+
add("fn" + input_place, name)
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
def set_font_size(input_place, size)
|
|
220
|
+
final_size = size.is_a?(Integer) ? "#{size}px" : size.to_s
|
|
221
|
+
add("fs" + input_place, final_size)
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def set_font_bold(input_place, bold)
|
|
225
|
+
add("fb" + input_place, bold ? "1" : "0")
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def set_visible(input_place, visible)
|
|
229
|
+
add("vi" + input_place, visible ? "1" : "0")
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
def set_text_align(input_place, align)
|
|
233
|
+
add("ta" + input_place, align)
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
def set_read_only(input_place, read_only)
|
|
237
|
+
add("sr" + input_place, read_only ? "1" : "0")
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
def set_disabled(input_place, disabled)
|
|
241
|
+
add("sd" + input_place, disabled ? "1" : "0")
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
def set_focus(input_place, focus)
|
|
245
|
+
add("sf" + input_place, focus ? "1" : "0")
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
def set_min_length(input_place, length)
|
|
249
|
+
add("mn" + input_place, length.to_s)
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
def set_max_length(input_place, length)
|
|
253
|
+
add("mx" + input_place, length.to_s)
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
def set_selected_value(input_place, value)
|
|
257
|
+
add("ts" + input_place, value)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
def set_selected_index(input_place, index)
|
|
261
|
+
add("ti" + input_place, index.to_s)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def set_checked_value(input_place, value, checked)
|
|
265
|
+
add("ks" + input_place, value + GS + (checked ? "1" : "0"))
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def set_checked_index(input_place, index, checked)
|
|
269
|
+
add("ki" + input_place, index.to_s + GS + (checked ? "1" : "0"))
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Insert
|
|
273
|
+
# Creates the Data only if it does not exist; otherwise, does nothing.
|
|
274
|
+
def insert_id(input_place, id)
|
|
275
|
+
add("ii" + input_place, id)
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
def insert_name(input_place, name)
|
|
279
|
+
add("in" + input_place, name)
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
def insert_value(input_place, value)
|
|
283
|
+
add("iv" + input_place, value)
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
def insert_class(input_place, class_name)
|
|
287
|
+
add("ic" + input_place, class_name)
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
def insert_style(input_place, name_or_style, value = nil)
|
|
291
|
+
if value.nil?
|
|
292
|
+
add("is" + input_place, name_or_style)
|
|
293
|
+
else
|
|
294
|
+
add("is" + input_place, name_or_style + ':' + value)
|
|
295
|
+
end
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
def insert_option_tag(input_place, text, value, selected = false)
|
|
299
|
+
add("io" + input_place, value + GS + text + (selected ? GS + "1" : ""))
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
def insert_check_box_tag(input_place, text, value, checked = false)
|
|
303
|
+
add("ik" + input_place, value + GS + text + (checked ? GS + "1" : ""))
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
def insert_title(input_place, title)
|
|
307
|
+
add("il" + input_place, title)
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
def insert_label(input_place, label)
|
|
311
|
+
add("iA" + input_place, label)
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
def insert_text(input_place, text)
|
|
315
|
+
add("it" + input_place, text.gsub("\n", "$[ln];"))
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
def insert_attribute(input_place, attribute, value = "", splitter = "\0")
|
|
319
|
+
add("ia" + input_place, attribute + GS + (splitter != "\0" ? splitter.to_s : "") + (!value.nil? && !value.empty? ? GS + value : ""))
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# Delete
|
|
323
|
+
def delete_id(input_place)
|
|
324
|
+
add("di" + input_place)
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
def delete_name(input_place)
|
|
328
|
+
add("dn" + input_place)
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
def delete_value(input_place)
|
|
332
|
+
add("dv" + input_place)
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
def delete_class(input_place, class_name)
|
|
336
|
+
add("dc" + input_place, class_name)
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
def delete_style(input_place, style_name)
|
|
340
|
+
add("ds" + input_place, style_name)
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
def delete_option_tag(input_place, value)
|
|
344
|
+
add("do" + input_place, value)
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
def delete_all_option_tag(input_place)
|
|
348
|
+
add("do" + input_place, "*")
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
def delete_check_box_tag(input_place, value)
|
|
352
|
+
add("dk" + input_place, value)
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
def delete_all_check_box_tag(input_place)
|
|
356
|
+
add("dk" + input_place, "*")
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
def delete_title(input_place)
|
|
360
|
+
add("dl" + input_place)
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
def delete_label(input_place)
|
|
364
|
+
add("dA" + input_place)
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
def delete_text(input_place)
|
|
368
|
+
add("dt" + input_place)
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
def delete_attribute(input_place, attribute)
|
|
372
|
+
add("da" + input_place, attribute)
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
def delete(input_place)
|
|
376
|
+
add("de" + input_place)
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
def delete_parent(input_place)
|
|
380
|
+
add("dp" + input_place)
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
# Tag
|
|
384
|
+
def swap_tag(input_place, output_place)
|
|
385
|
+
add("sp" + input_place, output_place)
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
def set_reflection(input_place, tag)
|
|
389
|
+
add("sR" + input_place, tag)
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
def set_reflection_by_output_place(input_place, output_place)
|
|
393
|
+
add("iR" + input_place, output_place)
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
def set_morph(input_place, tag)
|
|
397
|
+
add("sM" + input_place, tag)
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
def set_morph_by_output_place(input_place, output_place)
|
|
401
|
+
add("iM" + input_place, output_place)
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
# Browser
|
|
405
|
+
def change_url(url)
|
|
406
|
+
add("cu", url)
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
def set_head_title(title)
|
|
410
|
+
add("ht", title)
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
def clipboard_write_text(text)
|
|
414
|
+
add("nw", text)
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
def scroll_to(x, y)
|
|
418
|
+
add("ws", x.to_s + GS + y.to_s)
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
def history_go(steps)
|
|
422
|
+
add("wg", steps.to_s)
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
def reload_page
|
|
426
|
+
add("lr")
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
def redirect(path)
|
|
430
|
+
add("lh", path)
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
# Increase
|
|
434
|
+
def increase_min_length(input_place, value)
|
|
435
|
+
add("+n" + input_place, value.to_s)
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
def increase_max_length(input_place, value)
|
|
439
|
+
add("+x" + input_place, value.to_s)
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
def increase_font_size(input_place, value)
|
|
443
|
+
add("+f" + input_place, value.to_s)
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
def increase_width(input_place, value)
|
|
447
|
+
add("+w" + input_place, value.to_s)
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
def increase_height(input_place, value)
|
|
451
|
+
add("+h" + input_place, value.to_s)
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
def increase_value(input_place, value)
|
|
455
|
+
add("+v" + input_place, value.to_s)
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
# Decrease
|
|
459
|
+
def decrease_min_length(input_place, value)
|
|
460
|
+
add("-n" + input_place, value.to_s)
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
def decrease_max_length(input_place, value)
|
|
464
|
+
add("-x" + input_place, value.to_s)
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
def decrease_font_size(input_place, value)
|
|
468
|
+
add("-f" + input_place, value.to_s)
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
def decrease_width(input_place, value)
|
|
472
|
+
add("-w" + input_place, value.to_s)
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
def decrease_height(input_place, value)
|
|
476
|
+
add("-h" + input_place, value.to_s)
|
|
477
|
+
end
|
|
478
|
+
|
|
479
|
+
def decrease_value(input_place, value)
|
|
480
|
+
add("-v" + input_place, value.to_s)
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
# Event
|
|
484
|
+
# ConstructorName: mouseevent, keyboardevent, uievent, focusevent, inputevent, event
|
|
485
|
+
# All Method in "Event" Section Only Support Dynamic Args Once. To Support Invoking Dynamic Arguments on a Momentary Basis, Use "EventListener" Section Methods.
|
|
486
|
+
def trigger_event(input_place, html_event_listener, constructor_name = nil)
|
|
487
|
+
add("TE" + input_place, html_event_listener + (!constructor_name.nil? && !constructor_name.empty? ? GS + constructor_name : ""))
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
def set_post_event(input_place, html_event, output_place = nil)
|
|
491
|
+
if output_place.nil?
|
|
492
|
+
add("Ep" + input_place, html_event)
|
|
493
|
+
elsif output_place == "+"
|
|
494
|
+
add("Ep" + input_place, html_event + GS + "+")
|
|
495
|
+
else
|
|
496
|
+
add("Ep" + input_place, html_event + GS + output_place)
|
|
497
|
+
end
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
def set_post_event_listener(input_place, html_event_listener, output_place = nil)
|
|
501
|
+
if output_place.nil?
|
|
502
|
+
add("EP" + input_place, html_event_listener)
|
|
503
|
+
elsif output_place == "+"
|
|
504
|
+
add("EP" + input_place, html_event_listener + GS + "+")
|
|
505
|
+
else
|
|
506
|
+
add("EP" + input_place, html_event_listener + GS + output_place)
|
|
507
|
+
end
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
def set_get_event(input_place, html_event, path_or_output_place = nil, output_place = nil)
|
|
511
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
512
|
+
if output_place.nil?
|
|
513
|
+
add("Eg" + input_place, html_event + GS + path)
|
|
514
|
+
else
|
|
515
|
+
add("Eg" + input_place, html_event + GS + path + GS + output_place)
|
|
516
|
+
end
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
def set_get_event_listener(input_place, html_event_listener, path_or_output_place = nil, output_place = nil)
|
|
520
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
521
|
+
if output_place.nil?
|
|
522
|
+
add("EG" + input_place, html_event_listener + GS + path)
|
|
523
|
+
else
|
|
524
|
+
add("EG" + input_place, html_event_listener + GS + path + GS + output_place)
|
|
525
|
+
end
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
def set_put_event(input_place, html_event, path_or_output_place = nil, output_place = nil)
|
|
529
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
530
|
+
if output_place.nil?
|
|
531
|
+
add("Et" + input_place, html_event + GS + path)
|
|
532
|
+
else
|
|
533
|
+
add("Et" + input_place, html_event + GS + path + GS + output_place)
|
|
534
|
+
end
|
|
535
|
+
end
|
|
536
|
+
|
|
537
|
+
def set_put_event_listener(input_place, html_event_listener, path_or_output_place = nil, output_place = nil)
|
|
538
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
539
|
+
if output_place.nil?
|
|
540
|
+
add("ET" + input_place, html_event_listener + GS + path)
|
|
541
|
+
else
|
|
542
|
+
add("ET" + input_place, html_event_listener + GS + path + GS + output_place)
|
|
543
|
+
end
|
|
544
|
+
end
|
|
545
|
+
|
|
546
|
+
def set_patch_event(input_place, html_event, path_or_output_place = nil, output_place = nil)
|
|
547
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
548
|
+
if output_place.nil?
|
|
549
|
+
add("Ea" + input_place, html_event + GS + path)
|
|
550
|
+
else
|
|
551
|
+
add("Ea" + input_place, html_event + GS + path + GS + output_place)
|
|
552
|
+
end
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
def set_patch_event_listener(input_place, html_event_listener, path_or_output_place = nil, output_place = nil)
|
|
556
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
557
|
+
if output_place.nil?
|
|
558
|
+
add("EA" + input_place, html_event_listener + GS + path)
|
|
559
|
+
else
|
|
560
|
+
add("EA" + input_place, html_event_listener + GS + path + GS + output_place)
|
|
561
|
+
end
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
def set_delete_event(input_place, html_event, path_or_output_place = nil, output_place = nil)
|
|
565
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
566
|
+
if output_place.nil?
|
|
567
|
+
add("El" + input_place, html_event + GS + path)
|
|
568
|
+
else
|
|
569
|
+
add("El" + input_place, html_event + GS + path + GS + output_place)
|
|
570
|
+
end
|
|
571
|
+
end
|
|
572
|
+
|
|
573
|
+
def set_delete_event_listener(input_place, html_event_listener, path_or_output_place = nil, output_place = nil)
|
|
574
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
575
|
+
if output_place.nil?
|
|
576
|
+
add("EL" + input_place, html_event_listener + GS + path)
|
|
577
|
+
else
|
|
578
|
+
add("EL" + input_place, html_event_listener + GS + path + GS + output_place)
|
|
579
|
+
end
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
def set_options_event(input_place, html_event, path_or_output_place = nil, output_place = nil)
|
|
583
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
584
|
+
if output_place.nil?
|
|
585
|
+
add("Eo" + input_place, html_event + GS + path)
|
|
586
|
+
else
|
|
587
|
+
add("Eo" + input_place, html_event + GS + path + GS + output_place)
|
|
588
|
+
end
|
|
589
|
+
end
|
|
590
|
+
|
|
591
|
+
def set_options_event_listener(input_place, html_event_listener, path_or_output_place = nil, output_place = nil)
|
|
592
|
+
path = path_or_output_place.nil? || path_or_output_place == "#" ? "#" : path_or_output_place
|
|
593
|
+
if output_place.nil?
|
|
594
|
+
add("EO" + input_place, html_event_listener + GS + path)
|
|
595
|
+
else
|
|
596
|
+
add("EO" + input_place, html_event_listener + GS + path + GS + output_place)
|
|
597
|
+
end
|
|
598
|
+
end
|
|
599
|
+
|
|
600
|
+
def set_head_event(input_place, html_event, path = nil)
|
|
601
|
+
add("Eh" + input_place, html_event + GS + (!path.nil? && !path.empty? ? path : "#"))
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
def set_head_event_listener(input_place, html_event_listener, path = nil)
|
|
605
|
+
add("EH" + input_place, html_event_listener + GS + (!path.nil? && !path.empty? ? path : "#"))
|
|
606
|
+
end
|
|
607
|
+
|
|
608
|
+
# IsMultiPart: If this value is true, the data will be sent based on the Form and with the "content" key.
|
|
609
|
+
def set_send_event(input_place, html_event, data, path = nil, method = "POST", is_multi_part = false, content_type = "text/plain", output_place = nil)
|
|
610
|
+
add("En" + input_place, html_event + GS + data.gsub("\n", "$[ln];").gsub("\"", "$[dq];").gsub("'", "$[sq];") + GS + (!path.nil? && !path.empty? ? path : "#") + GS + method + GS + (is_multi_part ? "1" : "0") + GS + content_type + GS + output_place.to_s)
|
|
611
|
+
end
|
|
612
|
+
|
|
613
|
+
def set_send_event_listener(input_place, html_event_listener, data, path = nil, method = "POST", is_multi_part = false, content_type = "text/plain", output_place = nil)
|
|
614
|
+
add("EN" + input_place, html_event_listener + GS + data.gsub("\n", "$[ln];") + GS + (!path.nil? && !path.empty? ? path : "#") + GS + method + GS + (is_multi_part ? "1" : "0") + GS + content_type + GS + output_place.to_s)
|
|
615
|
+
end
|
|
616
|
+
|
|
617
|
+
def set_comment_event(input_place, html_event, index = nil, output_place = nil)
|
|
618
|
+
add("Eb" + input_place, html_event + GS + index.to_s + GS + output_place.to_s)
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
def set_comment_event_listener(input_place, html_event_listener, index = nil, output_place = nil)
|
|
622
|
+
add("EB" + input_place, html_event_listener + GS + index.to_s + GS + output_place.to_s)
|
|
623
|
+
end
|
|
624
|
+
|
|
625
|
+
def set_wasm_event(input_place, html_event, wasm_language, wasm_url, method_name, args = nil, output_place = nil)
|
|
626
|
+
args_join = ""
|
|
627
|
+
if !args.nil? && args.is_a?(Array)
|
|
628
|
+
args_join = (args.length > 0) ? "[" + args.join(US) : ""
|
|
629
|
+
end
|
|
630
|
+
add("Ey" + input_place, html_event + GS + wasm_language + GS + wasm_url + GS + method_name + GS + args_join + GS + output_place.to_s)
|
|
631
|
+
end
|
|
632
|
+
|
|
633
|
+
def set_wasm_event_listener(input_place, html_event_listener, wasm_language, wasm_url, method_name, args = nil, output_place = nil)
|
|
634
|
+
args_join = ""
|
|
635
|
+
if !args.nil? && args.is_a?(Array)
|
|
636
|
+
args_join = (args.length > 0) ? "[" + args.join(US) : ""
|
|
637
|
+
end
|
|
638
|
+
add("EY" + input_place, html_event_listener + GS + wasm_language + GS + wasm_url + GS + method_name + GS + args_join + GS + output_place.to_s)
|
|
639
|
+
end
|
|
640
|
+
|
|
641
|
+
def set_web_socket_event(input_place, html_event, path)
|
|
642
|
+
add("Ew" + input_place, html_event + GS + path)
|
|
643
|
+
end
|
|
644
|
+
|
|
645
|
+
def set_web_socket_event_listener(input_place, html_event_listener, path)
|
|
646
|
+
add("EW" + input_place, html_event_listener + GS + path)
|
|
647
|
+
end
|
|
648
|
+
|
|
649
|
+
def set_sse_event(input_place, html_event, path, should_reconnect_or_output_place = true, reconnect_try_timeout_or_nil = 3000, output_place = nil)
|
|
650
|
+
if output_place.nil? && should_reconnect_or_output_place.is_a?(TrueClass) || should_reconnect_or_output_place.is_a?(FalseClass)
|
|
651
|
+
add("Ee" + input_place, html_event + GS + path + GS + (should_reconnect_or_output_place ? "1" : "0") + GS + reconnect_try_timeout_or_nil.to_s)
|
|
652
|
+
else
|
|
653
|
+
add("Ee" + input_place, html_event + GS + path + GS + (should_reconnect_or_output_place ? "1" : "0") + GS + reconnect_try_timeout_or_nil.to_s + GS + output_place.to_s)
|
|
654
|
+
end
|
|
655
|
+
end
|
|
656
|
+
|
|
657
|
+
def set_sse_event_listener(input_place, html_event_listener, path, should_reconnect_or_output_place = true, reconnect_try_timeout_or_nil = 3000, output_place = nil)
|
|
658
|
+
if output_place.nil? && should_reconnect_or_output_place.is_a?(TrueClass) || should_reconnect_or_output_place.is_a?(FalseClass)
|
|
659
|
+
add("EE" + input_place, html_event_listener + GS + path + GS + (should_reconnect_or_output_place ? "1" : "0") + GS + reconnect_try_timeout_or_nil.to_s)
|
|
660
|
+
else
|
|
661
|
+
add("EE" + input_place, html_event_listener + GS + path + GS + (should_reconnect_or_output_place ? "1" : "0") + GS + reconnect_try_timeout_or_nil.to_s + GS + output_place.to_s)
|
|
662
|
+
end
|
|
663
|
+
end
|
|
664
|
+
|
|
665
|
+
def set_front_event(input_place, html_event, module_path, args = nil, output_place = nil)
|
|
666
|
+
args_join = ""
|
|
667
|
+
if !args.nil? && args.is_a?(Array)
|
|
668
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
669
|
+
end
|
|
670
|
+
add("Ej" + input_place, html_event + GS + module_path + GS + output_place.to_s + args_join)
|
|
671
|
+
end
|
|
672
|
+
|
|
673
|
+
def set_front_event_listener(input_place, html_event_listener, module_path, args = nil, output_place = nil)
|
|
674
|
+
args_join = ""
|
|
675
|
+
if !args.nil? && args.is_a?(Array)
|
|
676
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
677
|
+
end
|
|
678
|
+
add("EJ" + input_place, html_event_listener + GS + module_path + GS + output_place.to_s + args_join)
|
|
679
|
+
end
|
|
680
|
+
|
|
681
|
+
def set_master_pages_event(input_place, html_event, output_place = nil)
|
|
682
|
+
add("Eu" + input_place, html_event + GS + output_place.to_s)
|
|
683
|
+
end
|
|
684
|
+
|
|
685
|
+
def set_master_pages_event_listener(input_place, html_event_listener, output_place = nil)
|
|
686
|
+
add("EU" + input_place, html_event_listener + GS + output_place.to_s)
|
|
687
|
+
end
|
|
688
|
+
|
|
689
|
+
def set_prevent_default_event(input_place, html_event)
|
|
690
|
+
add("Ed" + input_place, html_event)
|
|
691
|
+
end
|
|
692
|
+
|
|
693
|
+
def set_prevent_default_event_listener(input_place, html_event_listener)
|
|
694
|
+
add("ED" + input_place, html_event_listener)
|
|
695
|
+
end
|
|
696
|
+
|
|
697
|
+
def set_stop_propagation_event(input_place, html_event)
|
|
698
|
+
add("Es" + input_place, html_event)
|
|
699
|
+
end
|
|
700
|
+
|
|
701
|
+
def set_stop_propagation_event_listener(input_place, html_event_listener)
|
|
702
|
+
add("ES" + input_place, html_event_listener)
|
|
703
|
+
end
|
|
704
|
+
|
|
705
|
+
def set_method_event(input_place, html_event, method_name, args = nil)
|
|
706
|
+
args_join = ""
|
|
707
|
+
if !args.nil? && args.is_a?(Array)
|
|
708
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
709
|
+
end
|
|
710
|
+
add("Em" + input_place, html_event + GS + method_name + args_join)
|
|
711
|
+
end
|
|
712
|
+
|
|
713
|
+
def set_method_event_listener(input_place, html_event_listener, method_name, args = nil)
|
|
714
|
+
args_join = ""
|
|
715
|
+
if !args.nil? && args.is_a?(Array)
|
|
716
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
717
|
+
end
|
|
718
|
+
add("EM" + input_place, html_event_listener + GS + method_name + args_join)
|
|
719
|
+
end
|
|
720
|
+
|
|
721
|
+
def set_module_method_event(input_place, html_event, method_name, args = nil)
|
|
722
|
+
args_join = ""
|
|
723
|
+
if !args.nil? && args.is_a?(Array)
|
|
724
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
725
|
+
end
|
|
726
|
+
add("Ex" + input_place, html_event + GS + method_name + args_join)
|
|
727
|
+
end
|
|
728
|
+
|
|
729
|
+
def set_module_method_event_listener(input_place, html_event_listener, method_name, args = nil)
|
|
730
|
+
args_join = ""
|
|
731
|
+
if !args.nil? && args.is_a?(Array)
|
|
732
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
733
|
+
end
|
|
734
|
+
add("EX" + input_place, html_event_listener + GS + method_name + args_join)
|
|
735
|
+
end
|
|
736
|
+
|
|
737
|
+
def assign_confirm_event(input_place, html_event, text = "Are you sure you want to proceed?", type = "none", title = "Confirm", ok_text = "OK", cancel_text = "Cancel")
|
|
738
|
+
add("Ef" + input_place, html_event + GS + (text == "Are you sure you want to proceed?" ? "" : text) + GS + (type == "none" ? "" : type) + GS + (title == "Confirm" ? "" : title) + GS + (ok_text == "OK" ? "" : ok_text) + GS + (cancel_text == "Cancel" ? "" : cancel_text))
|
|
739
|
+
end
|
|
740
|
+
|
|
741
|
+
def remove_post_event(input_place, html_event)
|
|
742
|
+
add("Rp" + input_place, html_event)
|
|
743
|
+
end
|
|
744
|
+
|
|
745
|
+
def remove_post_event_listener(input_place, html_event_listener)
|
|
746
|
+
add("RP" + input_place, html_event_listener)
|
|
747
|
+
end
|
|
748
|
+
|
|
749
|
+
def remove_get_event(input_place, html_event)
|
|
750
|
+
add("Rg" + input_place, html_event)
|
|
751
|
+
end
|
|
752
|
+
|
|
753
|
+
def remove_get_event_listener(input_place, html_event_listener)
|
|
754
|
+
add("RG" + input_place, html_event_listener)
|
|
755
|
+
end
|
|
756
|
+
|
|
757
|
+
def remove_put_event(input_place, html_event)
|
|
758
|
+
add("Rt" + input_place, html_event)
|
|
759
|
+
end
|
|
760
|
+
|
|
761
|
+
def remove_put_event_listener(input_place, html_event_listener)
|
|
762
|
+
add("RT" + input_place, html_event_listener)
|
|
763
|
+
end
|
|
764
|
+
|
|
765
|
+
def remove_patch_event(input_place, html_event)
|
|
766
|
+
add("Ra" + input_place, html_event)
|
|
767
|
+
end
|
|
768
|
+
|
|
769
|
+
def remove_patch_event_listener(input_place, html_event_listener)
|
|
770
|
+
add("RA" + input_place, html_event_listener)
|
|
771
|
+
end
|
|
772
|
+
|
|
773
|
+
def remove_delete_event(input_place, html_event)
|
|
774
|
+
add("Rl" + input_place, html_event)
|
|
775
|
+
end
|
|
776
|
+
|
|
777
|
+
def remove_delete_event_listener(input_place, html_event_listener)
|
|
778
|
+
add("RL" + input_place, html_event_listener)
|
|
779
|
+
end
|
|
780
|
+
|
|
781
|
+
def remove_options_event(input_place, html_event)
|
|
782
|
+
add("Ro" + input_place, html_event)
|
|
783
|
+
end
|
|
784
|
+
|
|
785
|
+
def remove_options_event_listener(input_place, html_event_listener)
|
|
786
|
+
add("RO" + input_place, html_event_listener)
|
|
787
|
+
end
|
|
788
|
+
|
|
789
|
+
def remove_head_event(input_place, html_event)
|
|
790
|
+
add("Rh" + input_place, html_event)
|
|
791
|
+
end
|
|
792
|
+
|
|
793
|
+
def remove_head_event_listener(input_place, html_event_listener)
|
|
794
|
+
add("RH" + input_place, html_event_listener)
|
|
795
|
+
end
|
|
796
|
+
|
|
797
|
+
def remove_send_event(input_place, html_event)
|
|
798
|
+
add("Rn" + input_place, html_event)
|
|
799
|
+
end
|
|
800
|
+
|
|
801
|
+
def remove_send_event_listener(input_place, html_event_listener)
|
|
802
|
+
add("RN" + input_place, html_event_listener)
|
|
803
|
+
end
|
|
804
|
+
|
|
805
|
+
def remove_comment_event(input_place, html_event)
|
|
806
|
+
add("Rb" + input_place, html_event)
|
|
807
|
+
end
|
|
808
|
+
|
|
809
|
+
def remove_comment_event_listener(input_place, html_event_listener)
|
|
810
|
+
add("RB" + input_place, html_event_listener)
|
|
811
|
+
end
|
|
812
|
+
|
|
813
|
+
def remove_wasm_event(input_place, html_event)
|
|
814
|
+
add("Ry" + input_place, html_event)
|
|
815
|
+
end
|
|
816
|
+
|
|
817
|
+
def remove_wasm_event_listener(input_place, html_event_listener)
|
|
818
|
+
add("RY" + input_place, html_event_listener)
|
|
819
|
+
end
|
|
820
|
+
|
|
821
|
+
def remove_web_socket_event(input_place, html_event)
|
|
822
|
+
add("Rw" + input_place, html_event)
|
|
823
|
+
end
|
|
824
|
+
|
|
825
|
+
def remove_web_socket_event_listener(input_place, html_event_listener)
|
|
826
|
+
add("RW" + input_place, html_event_listener)
|
|
827
|
+
end
|
|
828
|
+
|
|
829
|
+
def remove_sse_event(input_place, html_event)
|
|
830
|
+
add("Re" + input_place, html_event)
|
|
831
|
+
end
|
|
832
|
+
|
|
833
|
+
def remove_sse_event_listener(input_place, html_event_listener)
|
|
834
|
+
add("RE" + input_place, html_event_listener)
|
|
835
|
+
end
|
|
836
|
+
|
|
837
|
+
def remove_front_event(input_place, html_event)
|
|
838
|
+
add("Rj" + input_place, html_event)
|
|
839
|
+
end
|
|
840
|
+
|
|
841
|
+
def remove_front_event_listener(input_place, html_event_listener)
|
|
842
|
+
add("RJ" + input_place, html_event_listener)
|
|
843
|
+
end
|
|
844
|
+
|
|
845
|
+
def remove_prevent_default_event(input_place, html_event)
|
|
846
|
+
add("Rd" + input_place, html_event)
|
|
847
|
+
end
|
|
848
|
+
|
|
849
|
+
def remove_prevent_default_event_listener(input_place, html_event_listener)
|
|
850
|
+
add("RD" + input_place, html_event_listener)
|
|
851
|
+
end
|
|
852
|
+
|
|
853
|
+
def remove_master_pages_event(input_place, html_event)
|
|
854
|
+
add("Ru" + input_place, html_event)
|
|
855
|
+
end
|
|
856
|
+
|
|
857
|
+
def remove_master_pages_event_listener(input_place, html_event_listener)
|
|
858
|
+
add("RU" + input_place, html_event_listener)
|
|
859
|
+
end
|
|
860
|
+
|
|
861
|
+
def remove_stop_propagation_event(input_place, html_event)
|
|
862
|
+
add("Rs" + input_place, html_event)
|
|
863
|
+
end
|
|
864
|
+
|
|
865
|
+
def remove_stop_propagation_event_listener(input_place, html_event_listener)
|
|
866
|
+
add("RS" + input_place, html_event_listener)
|
|
867
|
+
end
|
|
868
|
+
|
|
869
|
+
def remove_method_event(input_place, html_event, method_name)
|
|
870
|
+
add("Rm" + input_place, html_event + GS + method_name)
|
|
871
|
+
end
|
|
872
|
+
|
|
873
|
+
def remove_method_event_listener(input_place, html_event_listener, method_name)
|
|
874
|
+
add("RM" + input_place, html_event_listener + GS + method_name)
|
|
875
|
+
end
|
|
876
|
+
|
|
877
|
+
def remove_module_method_event(input_place, html_event, method_name)
|
|
878
|
+
add("Rx" + input_place, html_event + GS + method_name)
|
|
879
|
+
end
|
|
880
|
+
|
|
881
|
+
def remove_module_method_event_listener(input_place, html_event_listener, method_name)
|
|
882
|
+
add("RX" + input_place, html_event_listener + GS + method_name)
|
|
883
|
+
end
|
|
884
|
+
|
|
885
|
+
def remove_confirm_event(input_place, html_event)
|
|
886
|
+
add("Rf" + input_place, html_event)
|
|
887
|
+
end
|
|
888
|
+
|
|
889
|
+
# Custom Event
|
|
890
|
+
# This Method Is Compatible With EventListener And May Not Be Compatible With Events Written As Attributes In Some Browsers.
|
|
891
|
+
# Watch: attribute, style, text, children, value
|
|
892
|
+
# Compare: greater, less, equal, notequal, includes, startswith, endswith, matches, changed, inrange, lengthgreater, lengthless, lengthequal
|
|
893
|
+
# Range: Only Use For Compare With inrange Value. Split By Comma ","
|
|
894
|
+
# Key: Only Use For Watch With attribute And style Value
|
|
895
|
+
def create_custom_dom_event(input_place, event_name, watch, key, compare, value, range, immediate = false, delay = "0")
|
|
896
|
+
add("eC" + input_place, event_name + GS + watch + GS + key + GS + compare + GS + value + GS + range + GS + (immediate ? "1" : "0") + GS + delay.to_s)
|
|
897
|
+
end
|
|
898
|
+
|
|
899
|
+
def enable_scroll_bottom_event(enable = true)
|
|
900
|
+
add("eb", enable ? "1" : "0")
|
|
901
|
+
end
|
|
902
|
+
|
|
903
|
+
def enable_reached_element_event(input_place, once, enable = true)
|
|
904
|
+
add("er" + input_place, (once ? "1" : "0") + GS + (enable ? "1" : "0"))
|
|
905
|
+
end
|
|
906
|
+
|
|
907
|
+
# Module
|
|
908
|
+
def load_module(module_path, methods = nil)
|
|
909
|
+
methods ||= []
|
|
910
|
+
add("Ml", module_path + ((methods.length > 0) ? GS + "[" + methods.join(US) : ""))
|
|
911
|
+
end
|
|
912
|
+
|
|
913
|
+
def unload_module(module_path)
|
|
914
|
+
add("Mu", module_path)
|
|
915
|
+
end
|
|
916
|
+
|
|
917
|
+
def delete_module_method(method_name)
|
|
918
|
+
add("Md", method_name)
|
|
919
|
+
end
|
|
920
|
+
|
|
921
|
+
# Unit Testing
|
|
922
|
+
# InputPlace Is Actual, Expected Is Tag/OutputPlace
|
|
923
|
+
def assert_equal(input_place, tag)
|
|
924
|
+
add("At" + input_place, tag.gsub("\n", "$[ln];"))
|
|
925
|
+
end
|
|
926
|
+
|
|
927
|
+
def assert_equal_by_output_place(input_place, output_place)
|
|
928
|
+
add("Ao" + input_place, output_place)
|
|
929
|
+
end
|
|
930
|
+
|
|
931
|
+
# Debug
|
|
932
|
+
def create_debugger(pause = false)
|
|
933
|
+
add("Dc", pause ? "1" : "0")
|
|
934
|
+
end
|
|
935
|
+
|
|
936
|
+
# Service Worker
|
|
937
|
+
# To Use Service Worker, You Need To Add The Elanat Dedicated Module (service-worker.js) On The Client Side
|
|
938
|
+
def service_worker_register(path = nil, scope_path = nil)
|
|
939
|
+
add("wR", path.to_s + GS + scope_path.to_s)
|
|
940
|
+
end
|
|
941
|
+
|
|
942
|
+
def service_worker_pre_cache_static(path_list)
|
|
943
|
+
add("wp", path_list.join(GS))
|
|
944
|
+
end
|
|
945
|
+
|
|
946
|
+
def service_worker_dynamic_cache(path, seconds = "")
|
|
947
|
+
add("wc", path + (seconds != "" ? GS + seconds.to_s : ""))
|
|
948
|
+
end
|
|
949
|
+
|
|
950
|
+
def service_worker_delete_dynamic_cache(path = nil)
|
|
951
|
+
if path.nil?
|
|
952
|
+
add("wd")
|
|
953
|
+
else
|
|
954
|
+
add("wd", path)
|
|
955
|
+
end
|
|
956
|
+
end
|
|
957
|
+
|
|
958
|
+
def service_worker_dynamic_cache_ttl_update(path, seconds = "")
|
|
959
|
+
add("wt", path + (seconds != "" ? GS + seconds.to_s : ""))
|
|
960
|
+
end
|
|
961
|
+
|
|
962
|
+
# Path: Support Wildcard Automatically And Also Support Regex If Use "re:" Before Pattern
|
|
963
|
+
# Type: Type Is Cache Strategy. cachefirst, networkfirst, cacheonly, networkonly, stalerevalidate (Fast From Cache, Updates Simultaneously From The Network)
|
|
964
|
+
# CacheDynamic: If True, Any Successful Network Response For That Route Will Be Stored In The Dynamic Cache
|
|
965
|
+
def service_worker_route_set(path, type, cache_dynamic = false)
|
|
966
|
+
add("wr", path + GS + type + (cache_dynamic ? GS + "1" : ""))
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
def service_worker_route_alias(path, to)
|
|
970
|
+
add("wa", path + GS + to)
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
def service_worker_delete_route_alias(path = nil)
|
|
974
|
+
add("wC", path.to_s)
|
|
975
|
+
end
|
|
976
|
+
|
|
977
|
+
# Delete All Route And Alias
|
|
978
|
+
def service_worker_delete_route(path = nil)
|
|
979
|
+
if path.nil?
|
|
980
|
+
add("wD")
|
|
981
|
+
else
|
|
982
|
+
add("wD", path)
|
|
983
|
+
end
|
|
984
|
+
end
|
|
985
|
+
|
|
986
|
+
# SSE
|
|
987
|
+
def disconnect_sse(path = nil)
|
|
988
|
+
if path.nil?
|
|
989
|
+
add("Ds")
|
|
990
|
+
else
|
|
991
|
+
add("Ds", path)
|
|
992
|
+
end
|
|
993
|
+
end
|
|
994
|
+
|
|
995
|
+
def disconnect_all_sse
|
|
996
|
+
add("Ds")
|
|
997
|
+
end
|
|
998
|
+
|
|
999
|
+
# State
|
|
1000
|
+
def add_state(path = nil, title = nil)
|
|
1001
|
+
add("AS", path.to_s + GS + title.to_s)
|
|
1002
|
+
end
|
|
1003
|
+
|
|
1004
|
+
def save_state(path = nil, title = nil)
|
|
1005
|
+
add("As", path.to_s + GS + title.to_s)
|
|
1006
|
+
end
|
|
1007
|
+
|
|
1008
|
+
def load_state(path)
|
|
1009
|
+
add("ls", path)
|
|
1010
|
+
end
|
|
1011
|
+
|
|
1012
|
+
def delete_state(path = nil)
|
|
1013
|
+
if path.nil?
|
|
1014
|
+
add("DS")
|
|
1015
|
+
elsif path == "*"
|
|
1016
|
+
add("DS", "*")
|
|
1017
|
+
else
|
|
1018
|
+
add("DS", path)
|
|
1019
|
+
end
|
|
1020
|
+
end
|
|
1021
|
+
|
|
1022
|
+
def delete_all_state
|
|
1023
|
+
add("DS", "*")
|
|
1024
|
+
end
|
|
1025
|
+
|
|
1026
|
+
# Cookie
|
|
1027
|
+
def set_cookie(key, value, seconds, path = nil)
|
|
1028
|
+
add("sC", key + GS + value + GS + seconds.to_s + (!path.nil? && !path.empty? ? GS + path : ""))
|
|
1029
|
+
end
|
|
1030
|
+
|
|
1031
|
+
# Save (Session Cache)
|
|
1032
|
+
def save_id(input_place, key = ".")
|
|
1033
|
+
add("@gi" + input_place, key)
|
|
1034
|
+
end
|
|
1035
|
+
|
|
1036
|
+
def save_name(input_place, key = ".")
|
|
1037
|
+
add("@gn" + input_place, key)
|
|
1038
|
+
end
|
|
1039
|
+
|
|
1040
|
+
def save_value(input_place, key = ".")
|
|
1041
|
+
add("@gv" + input_place, key)
|
|
1042
|
+
end
|
|
1043
|
+
|
|
1044
|
+
def save_value_length(input_place, key = ".")
|
|
1045
|
+
add("@ge" + input_place, key)
|
|
1046
|
+
end
|
|
1047
|
+
|
|
1048
|
+
def save_class(input_place, key = ".")
|
|
1049
|
+
add("@gc" + input_place, key)
|
|
1050
|
+
end
|
|
1051
|
+
|
|
1052
|
+
def save_style(input_place, key = ".")
|
|
1053
|
+
add("@gs" + input_place, key)
|
|
1054
|
+
end
|
|
1055
|
+
|
|
1056
|
+
def save_title(input_place, key = ".")
|
|
1057
|
+
add("@gl" + input_place, key)
|
|
1058
|
+
end
|
|
1059
|
+
|
|
1060
|
+
def save_label(input_place, key = ".")
|
|
1061
|
+
add("@gA" + input_place, key)
|
|
1062
|
+
end
|
|
1063
|
+
|
|
1064
|
+
def save_text(input_place, key = ".")
|
|
1065
|
+
add("@gt" + input_place, key)
|
|
1066
|
+
end
|
|
1067
|
+
|
|
1068
|
+
def save_outer_text(input_place, key = ".")
|
|
1069
|
+
add("@go" + input_place, key)
|
|
1070
|
+
end
|
|
1071
|
+
|
|
1072
|
+
def save_text_length(input_place, key = ".")
|
|
1073
|
+
add("@gg" + input_place, key)
|
|
1074
|
+
end
|
|
1075
|
+
|
|
1076
|
+
def save_attribute(input_place, attribute, key = ".")
|
|
1077
|
+
add("@ga" + input_place, key + GS + attribute)
|
|
1078
|
+
end
|
|
1079
|
+
|
|
1080
|
+
def save_width(input_place, key = ".")
|
|
1081
|
+
add("@gw" + input_place, key)
|
|
1082
|
+
end
|
|
1083
|
+
|
|
1084
|
+
def save_height(input_place, key = ".")
|
|
1085
|
+
add("@gh" + input_place, key)
|
|
1086
|
+
end
|
|
1087
|
+
|
|
1088
|
+
def save_read_only(input_place, key = ".")
|
|
1089
|
+
add("@gr" + input_place, key)
|
|
1090
|
+
end
|
|
1091
|
+
|
|
1092
|
+
def save_selected_index(input_place, key = ".")
|
|
1093
|
+
add("@gx" + input_place, key)
|
|
1094
|
+
end
|
|
1095
|
+
|
|
1096
|
+
def save_text_align(input_place, key = ".")
|
|
1097
|
+
add("@gT" + input_place, key)
|
|
1098
|
+
end
|
|
1099
|
+
|
|
1100
|
+
def save_node_length(input_place, key = ".")
|
|
1101
|
+
add("@gL" + input_place, key)
|
|
1102
|
+
end
|
|
1103
|
+
|
|
1104
|
+
def save_visible(input_place, key = ".")
|
|
1105
|
+
add("@gV" + input_place, key)
|
|
1106
|
+
end
|
|
1107
|
+
|
|
1108
|
+
def save_url(url, fetch_script = false, key = ".")
|
|
1109
|
+
add("@gu", key + GS + url + (fetch_script ? GS + "1" : ""))
|
|
1110
|
+
end
|
|
1111
|
+
|
|
1112
|
+
def save_index(input_place, key = ".")
|
|
1113
|
+
add("@gI" + input_place, key)
|
|
1114
|
+
end
|
|
1115
|
+
|
|
1116
|
+
def remove_save(cache_key)
|
|
1117
|
+
add("rs", cache_key)
|
|
1118
|
+
end
|
|
1119
|
+
|
|
1120
|
+
def remove_all_save
|
|
1121
|
+
add("rs", "*")
|
|
1122
|
+
end
|
|
1123
|
+
|
|
1124
|
+
# Calling the SetSave Method Causes Action Control Requests Triggered by Events Using the GET, POST, PUT, PATCH, DELETE, and OPTIONS Methods, as well as Requests Triggered by the Send Event, to be Temporarily Saved on the Active Page, so the Request will not be Sent to the Server Again.
|
|
1125
|
+
def set_save
|
|
1126
|
+
add("cs", "*")
|
|
1127
|
+
end
|
|
1128
|
+
|
|
1129
|
+
def add_save_value(cache_key, value)
|
|
1130
|
+
add("SA", cache_key + GS + value.gsub("\n", "$[ln];"))
|
|
1131
|
+
end
|
|
1132
|
+
|
|
1133
|
+
def insert_save_value(cache_key, value)
|
|
1134
|
+
add("SI", cache_key + GS + value.gsub("\n", "$[ln];"))
|
|
1135
|
+
end
|
|
1136
|
+
|
|
1137
|
+
def append_save_value(cache_key, value)
|
|
1138
|
+
add("SP", cache_key + GS + value.gsub("\n", "$[ln];"))
|
|
1139
|
+
end
|
|
1140
|
+
|
|
1141
|
+
def replace_save_value(cache_key, search_value, value)
|
|
1142
|
+
add("SR", cache_key + GS + value.gsub("\n", "$[ln];") + GS + search_value.gsub("\n", "$[ln];"))
|
|
1143
|
+
end
|
|
1144
|
+
|
|
1145
|
+
# Cache
|
|
1146
|
+
def cache_id(input_place, key = ".")
|
|
1147
|
+
add("@ci" + input_place, key)
|
|
1148
|
+
end
|
|
1149
|
+
|
|
1150
|
+
def cache_name(input_place, key = ".")
|
|
1151
|
+
add("@cn" + input_place, key)
|
|
1152
|
+
end
|
|
1153
|
+
|
|
1154
|
+
def cache_value(input_place, key = ".")
|
|
1155
|
+
add("@cv" + input_place, key)
|
|
1156
|
+
end
|
|
1157
|
+
|
|
1158
|
+
def cache_value_length(input_place, key = ".")
|
|
1159
|
+
add("@ce" + input_place, key)
|
|
1160
|
+
end
|
|
1161
|
+
|
|
1162
|
+
def cache_class(input_place, key = ".")
|
|
1163
|
+
add("@cc" + input_place, key)
|
|
1164
|
+
end
|
|
1165
|
+
|
|
1166
|
+
def cache_style(input_place, key = ".")
|
|
1167
|
+
add("@cs" + input_place, key)
|
|
1168
|
+
end
|
|
1169
|
+
|
|
1170
|
+
def cache_title(input_place, key = ".")
|
|
1171
|
+
add("@cl" + input_place, key)
|
|
1172
|
+
end
|
|
1173
|
+
|
|
1174
|
+
def cache_label(input_place, key = ".")
|
|
1175
|
+
add("@cA" + input_place, key)
|
|
1176
|
+
end
|
|
1177
|
+
|
|
1178
|
+
def cache_text(input_place, key = ".")
|
|
1179
|
+
add("@ct" + input_place, key)
|
|
1180
|
+
end
|
|
1181
|
+
|
|
1182
|
+
def cache_outer_text(input_place, key = ".")
|
|
1183
|
+
add("@co" + input_place, key)
|
|
1184
|
+
end
|
|
1185
|
+
|
|
1186
|
+
def cache_text_length(input_place, key = ".")
|
|
1187
|
+
add("@cg" + input_place, key)
|
|
1188
|
+
end
|
|
1189
|
+
|
|
1190
|
+
def cache_attribute(input_place, attribute, key = ".")
|
|
1191
|
+
add("@ca" + input_place, key + GS + attribute)
|
|
1192
|
+
end
|
|
1193
|
+
|
|
1194
|
+
def cache_width(input_place, key = ".")
|
|
1195
|
+
add("@cw" + input_place, key)
|
|
1196
|
+
end
|
|
1197
|
+
|
|
1198
|
+
def cache_height(input_place, key = ".")
|
|
1199
|
+
add("@ch" + input_place, key)
|
|
1200
|
+
end
|
|
1201
|
+
|
|
1202
|
+
def cache_read_only(input_place, key = ".")
|
|
1203
|
+
add("@cr" + input_place, key)
|
|
1204
|
+
end
|
|
1205
|
+
|
|
1206
|
+
def cache_selected_index(input_place, key = ".")
|
|
1207
|
+
add("@cx" + input_place, key)
|
|
1208
|
+
end
|
|
1209
|
+
|
|
1210
|
+
def cache_text_align(input_place, key = ".")
|
|
1211
|
+
add("@cT" + input_place, key)
|
|
1212
|
+
end
|
|
1213
|
+
|
|
1214
|
+
def cache_node_length(input_place, key = ".")
|
|
1215
|
+
add("@cL" + input_place, key)
|
|
1216
|
+
end
|
|
1217
|
+
|
|
1218
|
+
def cache_visible(input_place, key = ".")
|
|
1219
|
+
add("@cV" + input_place, key)
|
|
1220
|
+
end
|
|
1221
|
+
|
|
1222
|
+
def cache_url(url, fetch_script = false, key = ".")
|
|
1223
|
+
add("@cu", key + GS + url + (fetch_script ? GS + "1" : ""))
|
|
1224
|
+
end
|
|
1225
|
+
|
|
1226
|
+
def cache_index(input_place, key = ".")
|
|
1227
|
+
add("@cI" + input_place, key)
|
|
1228
|
+
end
|
|
1229
|
+
|
|
1230
|
+
def remove_cache(cache_key)
|
|
1231
|
+
add("rd", cache_key)
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1234
|
+
def remove_all_cache
|
|
1235
|
+
add("rd", "*")
|
|
1236
|
+
end
|
|
1237
|
+
|
|
1238
|
+
# Calling the SetCache Method Causes Action Control Requests Triggered by events using the GET, POST, PUT, PATCH, DELETE, and OPTIONS Methods, as well as Requests Triggered by the Send event, to be Cached, so the Request will not be Sent to the Server Again.
|
|
1239
|
+
def set_cache(second = nil)
|
|
1240
|
+
if second.nil?
|
|
1241
|
+
add("cd", "*")
|
|
1242
|
+
else
|
|
1243
|
+
add("cd", second.to_s)
|
|
1244
|
+
end
|
|
1245
|
+
end
|
|
1246
|
+
|
|
1247
|
+
def add_cache_value(cache_key, value)
|
|
1248
|
+
add("CA", cache_key + GS + value.gsub("\n", "$[ln];"))
|
|
1249
|
+
end
|
|
1250
|
+
|
|
1251
|
+
def insert_cache_value(cache_key, value)
|
|
1252
|
+
add("CI", cache_key + GS + value.gsub("\n", "$[ln];"))
|
|
1253
|
+
end
|
|
1254
|
+
|
|
1255
|
+
def append_cache_value(cache_key, value)
|
|
1256
|
+
add("CP", cache_key + GS + value.gsub("\n", "$[ln];"))
|
|
1257
|
+
end
|
|
1258
|
+
|
|
1259
|
+
def replace_cache_value(cache_key, search_value, value)
|
|
1260
|
+
add("CR", cache_key + GS + value.gsub("\n", "$[ln];") + GS + search_value.gsub("\n", "$[ln];"))
|
|
1261
|
+
end
|
|
1262
|
+
|
|
1263
|
+
# Call
|
|
1264
|
+
def load_url(input_place, url)
|
|
1265
|
+
add("lu" + input_place, url)
|
|
1266
|
+
end
|
|
1267
|
+
|
|
1268
|
+
def run_action_controls(action_controls, without_web_forms_section = true, index = nil, use_current_event = true)
|
|
1269
|
+
add("lA", (use_current_event ? "1" : "0") + GS + (without_web_forms_section ? "1" : "0") + GS + index.to_s + GS + action_controls)
|
|
1270
|
+
end
|
|
1271
|
+
|
|
1272
|
+
def call_script(script_text)
|
|
1273
|
+
add("_", script_text.gsub("\n", "$[ln];"))
|
|
1274
|
+
end
|
|
1275
|
+
|
|
1276
|
+
def call_method(method_name, args = nil)
|
|
1277
|
+
args_join = ""
|
|
1278
|
+
if !args.nil? && args.is_a?(Array)
|
|
1279
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
1280
|
+
end
|
|
1281
|
+
add("lm", method_name + args_join)
|
|
1282
|
+
end
|
|
1283
|
+
|
|
1284
|
+
def call_module_method(method_name, args = nil)
|
|
1285
|
+
args_join = ""
|
|
1286
|
+
if !args.nil? && args.is_a?(Array)
|
|
1287
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
1288
|
+
end
|
|
1289
|
+
add("lM", method_name + args_join)
|
|
1290
|
+
end
|
|
1291
|
+
|
|
1292
|
+
def call_post_back(form_input_place, output_place = nil)
|
|
1293
|
+
add("Lp", "1" + GS + form_input_place + (!output_place.nil? && !output_place.empty? ? GS + output_place : ""))
|
|
1294
|
+
end
|
|
1295
|
+
|
|
1296
|
+
def call_comment_back(index, input_place = nil, use_current_event = true)
|
|
1297
|
+
add("LC", (use_current_event ? "1" : "0") + GS + index.to_s + GS + input_place.to_s)
|
|
1298
|
+
end
|
|
1299
|
+
|
|
1300
|
+
def call_wasm_back(wasm_language, wasm_url, method_name, args = nil, output_place = nil, use_current_event = true)
|
|
1301
|
+
args_join = ""
|
|
1302
|
+
if !args.nil? && args.is_a?(Array)
|
|
1303
|
+
args_join = (args.length > 0) ? "[" + args.join(US) : ""
|
|
1304
|
+
end
|
|
1305
|
+
add("Ly", (use_current_event ? "1" : "0") + GS + wasm_language + GS + wasm_url + GS + method_name + GS + args_join + GS + output_place.to_s)
|
|
1306
|
+
end
|
|
1307
|
+
|
|
1308
|
+
def call_web_socket_back(path, use_current_event = true)
|
|
1309
|
+
add("Lw", (use_current_event ? "1" : "0") + GS + path)
|
|
1310
|
+
end
|
|
1311
|
+
|
|
1312
|
+
def call_sse_back(path, output_place = nil, use_current_event = true, should_reconnect = true, reconnect_try_timeout = "3000")
|
|
1313
|
+
add("Ls", (use_current_event ? "1" : "0") + GS + path + GS + (should_reconnect ? "1" : "0") + GS + reconnect_try_timeout.to_s + (!output_place.nil? && !output_place.empty? ? GS + output_place : ""))
|
|
1314
|
+
end
|
|
1315
|
+
|
|
1316
|
+
def call_front(module_path, args = nil, output_place = nil, use_current_event = true)
|
|
1317
|
+
args_join = ""
|
|
1318
|
+
if !args.nil? && args.is_a?(Array)
|
|
1319
|
+
args_join = (args.length > 0) ? GS + "[" + args.join(US) : ""
|
|
1320
|
+
end
|
|
1321
|
+
add("Lj", (use_current_event ? "1" : "0") + GS + module_path + GS + output_place.to_s + args_join)
|
|
1322
|
+
end
|
|
1323
|
+
|
|
1324
|
+
def call_get_back(path, output_place = nil, use_current_event = true)
|
|
1325
|
+
add("Lg", (use_current_event ? "1" : "0") + GS + path + (!output_place.nil? && !output_place.empty? ? GS + output_place : ""))
|
|
1326
|
+
end
|
|
1327
|
+
|
|
1328
|
+
def call_put_back(path, output_place = nil, use_current_event = true)
|
|
1329
|
+
add("Lt", (use_current_event ? "1" : "0") + GS + path + (!output_place.nil? && !output_place.empty? ? GS + output_place : ""))
|
|
1330
|
+
end
|
|
1331
|
+
|
|
1332
|
+
def call_patch_back(path, output_place = nil, use_current_event = true)
|
|
1333
|
+
add("LP", (use_current_event ? "1" : "0") + GS + path + (!output_place.nil? && !output_place.empty? ? GS + output_place : ""))
|
|
1334
|
+
end
|
|
1335
|
+
|
|
1336
|
+
def call_delete_back(path, output_place = nil, use_current_event = true)
|
|
1337
|
+
add("Ld", (use_current_event ? "1" : "0") + GS + path + (!output_place.nil? && !output_place.empty? ? GS + output_place : ""))
|
|
1338
|
+
end
|
|
1339
|
+
|
|
1340
|
+
def call_head_back(path, use_current_event = true)
|
|
1341
|
+
add("Lh", (use_current_event ? "1" : "0") + GS + path)
|
|
1342
|
+
end
|
|
1343
|
+
|
|
1344
|
+
def call_options_back(path, output_place = nil, use_current_event = true)
|
|
1345
|
+
add("Lo", (use_current_event ? "1" : "0") + GS + path + (!output_place.nil? && !output_place.empty? ? GS + output_place : ""))
|
|
1346
|
+
end
|
|
1347
|
+
|
|
1348
|
+
def call_send_back(path, method, is_multi_part, content_type, data, output_place = nil, use_current_event = true)
|
|
1349
|
+
add("LS", (use_current_event ? "1" : "0") + GS + path + GS + method + GS + (is_multi_part ? "1" : "0") + GS + content_type + GS + data.gsub("\n", "$[ln];") + (!output_place.nil? && !output_place.empty? ? GS + output_place : ""))
|
|
1350
|
+
end
|
|
1351
|
+
|
|
1352
|
+
# Update
|
|
1353
|
+
def increase(input_place, value)
|
|
1354
|
+
add("gt" + input_place, "i" + GS + value.to_s)
|
|
1355
|
+
end
|
|
1356
|
+
|
|
1357
|
+
def decrease(input_place, value)
|
|
1358
|
+
add("gt" + input_place, "i" + GS + (value * -1).to_s)
|
|
1359
|
+
end
|
|
1360
|
+
|
|
1361
|
+
# If You Don't Use Deep Mode, any Tags Inside the Current Tag Will Simply Be Treated as Strings. Deep Mode Does not Remove Inner Elements.
|
|
1362
|
+
def replace(input_place, value, new_value, also_start_tag = false, deep = true)
|
|
1363
|
+
add("gt" + input_place, "r" + GS + value + GS + new_value + GS + (also_start_tag ? "1" : "0") + GS + (deep ? "1" : "0"))
|
|
1364
|
+
end
|
|
1365
|
+
|
|
1366
|
+
# HTML Converts Attribute Names to Lowercase, so they Need to Be Written in Lowercase.
|
|
1367
|
+
def replace_start_tag(input_place, value, new_value)
|
|
1368
|
+
add("gt" + input_place, "s" + GS + value + GS + new_value)
|
|
1369
|
+
end
|
|
1370
|
+
|
|
1371
|
+
# Pre Runner
|
|
1372
|
+
def assign_delay(mili_second, index = -1)
|
|
1373
|
+
current_line = get_line_by_index(index)
|
|
1374
|
+
return if current_line.nil? || current_line.empty?
|
|
1375
|
+
|
|
1376
|
+
parts = current_line.split('=', 2)
|
|
1377
|
+
new_name = ":" + mili_second.to_s + ")" + parts[0]
|
|
1378
|
+
new_value = parts.length > 1 ? parts[1] : ""
|
|
1379
|
+
|
|
1380
|
+
update_line_by_index(index, new_name, new_value)
|
|
1381
|
+
end
|
|
1382
|
+
|
|
1383
|
+
def assign_delay_change(mili_second, index = -1)
|
|
1384
|
+
current_line = get_line_by_index(index)
|
|
1385
|
+
return if current_line.nil? || current_line.empty?
|
|
1386
|
+
|
|
1387
|
+
parts = current_line.split('=', 2)
|
|
1388
|
+
current_name = parts[0]
|
|
1389
|
+
|
|
1390
|
+
if current_name.start_with?(":") && current_name.include?(")")
|
|
1391
|
+
closing_bracket = current_name.index(")")
|
|
1392
|
+
current_name = current_name[(closing_bracket + 1)..-1]
|
|
1393
|
+
end
|
|
1394
|
+
|
|
1395
|
+
new_name = ":" + mili_second.to_s + ")" + current_name
|
|
1396
|
+
new_value = parts.length > 1 ? parts[1] : ""
|
|
1397
|
+
|
|
1398
|
+
update_line_by_index(index, new_name, new_value)
|
|
1399
|
+
end
|
|
1400
|
+
|
|
1401
|
+
def assign_interval(mili_second, id = nil, index = -1)
|
|
1402
|
+
current_line = get_line_by_index(index)
|
|
1403
|
+
return if current_line.nil? || current_line.empty?
|
|
1404
|
+
|
|
1405
|
+
parts = current_line.split('=', 2)
|
|
1406
|
+
new_name = "(" + mili_second.to_s + (!id.nil? && !id.empty? ? "|" + id : "") + ")" + parts[0]
|
|
1407
|
+
new_value = parts.length > 1 ? parts[1] : ""
|
|
1408
|
+
|
|
1409
|
+
update_line_by_index(index, new_name, new_value)
|
|
1410
|
+
end
|
|
1411
|
+
|
|
1412
|
+
def assign_interval_change(mili_second, id = nil, index = -1)
|
|
1413
|
+
current_line = get_line_by_index(index)
|
|
1414
|
+
return if current_line.nil? || current_line.empty?
|
|
1415
|
+
|
|
1416
|
+
parts = current_line.split('=', 2)
|
|
1417
|
+
current_name = parts[0]
|
|
1418
|
+
|
|
1419
|
+
if current_name.start_with?("(") && current_name.include?(")")
|
|
1420
|
+
closing_bracket = current_name.index(")")
|
|
1421
|
+
current_name = current_name[(closing_bracket + 1)..-1]
|
|
1422
|
+
end
|
|
1423
|
+
|
|
1424
|
+
new_name = "(" + mili_second.to_s + (!id.nil? && !id.empty? ? "|" + id : "") + ")" + current_name
|
|
1425
|
+
new_value = parts.length > 1 ? parts[1] : ""
|
|
1426
|
+
|
|
1427
|
+
update_line_by_index(index, new_name, new_value)
|
|
1428
|
+
end
|
|
1429
|
+
|
|
1430
|
+
def delete_interval(id)
|
|
1431
|
+
add("Di", id)
|
|
1432
|
+
end
|
|
1433
|
+
|
|
1434
|
+
def assign_repeat(count, index = -1)
|
|
1435
|
+
current_line = get_line_by_index(index)
|
|
1436
|
+
return if current_line.nil? || current_line.empty?
|
|
1437
|
+
|
|
1438
|
+
parts = current_line.split('=', 2)
|
|
1439
|
+
new_name = "," + count.to_s + ")" + parts[0]
|
|
1440
|
+
new_value = parts.length > 1 ? parts[1] : ""
|
|
1441
|
+
|
|
1442
|
+
update_line_by_index(index, new_name, new_value)
|
|
1443
|
+
end
|
|
1444
|
+
|
|
1445
|
+
def assign_repeat_change(count, index = -1)
|
|
1446
|
+
current_line = get_line_by_index(index)
|
|
1447
|
+
return if current_line.nil? || current_line.empty?
|
|
1448
|
+
|
|
1449
|
+
parts = current_line.split('=', 2)
|
|
1450
|
+
current_name = parts[0]
|
|
1451
|
+
|
|
1452
|
+
if current_name.start_with?(",") && current_name.include?(")")
|
|
1453
|
+
closing_bracket = current_name.index(")")
|
|
1454
|
+
current_name = current_name[(closing_bracket + 1)..-1]
|
|
1455
|
+
end
|
|
1456
|
+
|
|
1457
|
+
new_name = "," + count.to_s + ")" + current_name
|
|
1458
|
+
new_value = parts.length > 1 ? parts[1] : ""
|
|
1459
|
+
|
|
1460
|
+
update_line_by_index(index, new_name, new_value)
|
|
1461
|
+
end
|
|
1462
|
+
|
|
1463
|
+
# Index
|
|
1464
|
+
def start_index(name = "")
|
|
1465
|
+
add("#", name)
|
|
1466
|
+
end
|
|
1467
|
+
|
|
1468
|
+
# This Index Is Automatically Run After Changing The Browser History (Back And Forward Buttons)
|
|
1469
|
+
def start_state
|
|
1470
|
+
start_index("$")
|
|
1471
|
+
end
|
|
1472
|
+
|
|
1473
|
+
def go_to(line, repeat = 1)
|
|
1474
|
+
if line.is_a?(Integer)
|
|
1475
|
+
add("&", line.to_s + GS + repeat.to_s)
|
|
1476
|
+
elsif repeat.is_a?(Integer) && !line.is_a?(Integer)
|
|
1477
|
+
add("&", "#" + line + GS + repeat.to_s)
|
|
1478
|
+
else
|
|
1479
|
+
add("&", line.to_s + GS + repeat.to_s)
|
|
1480
|
+
end
|
|
1481
|
+
end
|
|
1482
|
+
|
|
1483
|
+
# Start
|
|
1484
|
+
def start_transient_dom(input_place)
|
|
1485
|
+
add("td", input_place)
|
|
1486
|
+
end
|
|
1487
|
+
|
|
1488
|
+
def end_transient_dom
|
|
1489
|
+
add("td", ";")
|
|
1490
|
+
end
|
|
1491
|
+
|
|
1492
|
+
# Message
|
|
1493
|
+
# Type: warning, problem, help, success, none
|
|
1494
|
+
def alert(text, type = "none", title = "Alert", ok_text = "OK")
|
|
1495
|
+
add("Al", text + GS + (type == "none" ? "" : type) + GS + (title == "Alert" ? "" : title) + GS + (ok_text == "OK" ? "" : ok_text))
|
|
1496
|
+
end
|
|
1497
|
+
|
|
1498
|
+
def message(text, type_or_duration = "none", duration = "0")
|
|
1499
|
+
if type_or_duration.is_a?(Integer)
|
|
1500
|
+
add("me", text + GS + "" + GS + type_or_duration.to_s)
|
|
1501
|
+
elsif duration.is_a?(Integer)
|
|
1502
|
+
add("me", text + GS + (type_or_duration == "none" ? "" : type_or_duration) + GS + duration.to_s)
|
|
1503
|
+
else
|
|
1504
|
+
add("me", text + GS + (type_or_duration == "none" ? "" : type_or_duration) + GS + (duration == "0" ? "" : duration))
|
|
1505
|
+
end
|
|
1506
|
+
end
|
|
1507
|
+
|
|
1508
|
+
# Type: log, info, warn, error, debug, trace, group, groupend, table
|
|
1509
|
+
def console_message(text, type = "log")
|
|
1510
|
+
add("mc", text.gsub("\n", "$[ln];") + (type == "log" ? "" : GS + type))
|
|
1511
|
+
end
|
|
1512
|
+
|
|
1513
|
+
def console_message_assert(text, condition)
|
|
1514
|
+
add("ma", text.gsub("\n", "$[ln];") + GS + condition)
|
|
1515
|
+
end
|
|
1516
|
+
|
|
1517
|
+
# Enable
|
|
1518
|
+
# Calling The EnableWebSocket Or EnableWebSocketOnce Or AddWebSocket Methods Will Cause Any Subsequent Requests (Under WebForms Core Technology) To Operate Under The WebSocket Protocol.
|
|
1519
|
+
def enable_web_socket(enable = true)
|
|
1520
|
+
add("ew", enable ? "1" : "0")
|
|
1521
|
+
end
|
|
1522
|
+
|
|
1523
|
+
def enable_web_socket_once
|
|
1524
|
+
add("ew", "$")
|
|
1525
|
+
end
|
|
1526
|
+
|
|
1527
|
+
def add_web_socket(path)
|
|
1528
|
+
add("aw" + path)
|
|
1529
|
+
end
|
|
1530
|
+
|
|
1531
|
+
# Disconnected WebSocket
|
|
1532
|
+
def delete_web_socket(path)
|
|
1533
|
+
add("dw" + path)
|
|
1534
|
+
end
|
|
1535
|
+
|
|
1536
|
+
# Use
|
|
1537
|
+
# InputPlace Using Only For form Element
|
|
1538
|
+
def use_web_socket(input_place)
|
|
1539
|
+
add("uw" + input_place)
|
|
1540
|
+
end
|
|
1541
|
+
|
|
1542
|
+
def use_only_change_update(input_place)
|
|
1543
|
+
add("uo" + input_place)
|
|
1544
|
+
end
|
|
1545
|
+
|
|
1546
|
+
# Condition And Loop
|
|
1547
|
+
# Condition And Loop Supports Brackets and Then
|
|
1548
|
+
# Type: warning, problem, help, success, none
|
|
1549
|
+
# Interval: Value 0 is Await (if is not True, all Next Action Controls Waiting for it), Value -1 is Sync Check Once (is Support Bracket or Next Action Control), Value > 0 is Async and is Wait Based on Time Repetition Until it Becomes True (Is Support Bracket or Next Action Control, but is not Support Else).
|
|
1550
|
+
# Nested Conditions and Nested Loops are Possible.
|
|
1551
|
+
def confirm_is_true_accept(text = "Are you sure you want to proceed?", type = "none", title = "Confirm", ok_text = "OK", cancel_text = "Cancel", interval = 100)
|
|
1552
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "ct", (text == "Are you sure you want to proceed?" ? "" : text) + GS + (type == "none" ? "" : type) + GS + (title == "Confirm" ? "" : title) + GS + (ok_text == "OK" ? "" : ok_text) + GS + (cancel_text == "Cancel" ? "" : cancel_text))
|
|
1553
|
+
self
|
|
1554
|
+
end
|
|
1555
|
+
|
|
1556
|
+
def confirm_is_false_accept(text = "Are you sure you want to proceed?", type = "none", title = "Confirm", ok_text = "OK", cancel_text = "Cancel", interval = 100)
|
|
1557
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "cf", (text == "Are you sure you want to proceed?" ? "" : text) + GS + (type == "none" ? "" : type) + GS + (title == "Confirm" ? "" : title) + GS + (ok_text == "OK" ? "" : ok_text) + GS + (cancel_text == "Cancel" ? "" : cancel_text))
|
|
1558
|
+
self
|
|
1559
|
+
end
|
|
1560
|
+
|
|
1561
|
+
def is_greater_than(first_value, second_value, interval = -1)
|
|
1562
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "gt", first_value + GS + second_value)
|
|
1563
|
+
self
|
|
1564
|
+
end
|
|
1565
|
+
|
|
1566
|
+
def is_less_than(first_value, second_value, interval = -1)
|
|
1567
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "lt", first_value + GS + second_value)
|
|
1568
|
+
self
|
|
1569
|
+
end
|
|
1570
|
+
|
|
1571
|
+
def is_equal_to(first_value, second_value, interval = -1)
|
|
1572
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "et", first_value + GS + second_value)
|
|
1573
|
+
self
|
|
1574
|
+
end
|
|
1575
|
+
|
|
1576
|
+
def is_not_equal_to(first_value, second_value, interval = -1)
|
|
1577
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "Nt", first_value + GS + second_value)
|
|
1578
|
+
self
|
|
1579
|
+
end
|
|
1580
|
+
|
|
1581
|
+
def exist(value, interval = -1)
|
|
1582
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "ex", value)
|
|
1583
|
+
self
|
|
1584
|
+
end
|
|
1585
|
+
|
|
1586
|
+
def not_exist(value, interval = -1)
|
|
1587
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "nx", value)
|
|
1588
|
+
self
|
|
1589
|
+
end
|
|
1590
|
+
|
|
1591
|
+
def is_true(value, interval = -1)
|
|
1592
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "tr", value)
|
|
1593
|
+
self
|
|
1594
|
+
end
|
|
1595
|
+
|
|
1596
|
+
def is_false(value, interval = 1)
|
|
1597
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "fa", value)
|
|
1598
|
+
self
|
|
1599
|
+
end
|
|
1600
|
+
|
|
1601
|
+
def is_match_media(value, interval = -1)
|
|
1602
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "mm", value)
|
|
1603
|
+
self
|
|
1604
|
+
end
|
|
1605
|
+
|
|
1606
|
+
def is_not_match_media(value, interval = -1)
|
|
1607
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "nm", value)
|
|
1608
|
+
self
|
|
1609
|
+
end
|
|
1610
|
+
|
|
1611
|
+
def include(text, value, interval = -1)
|
|
1612
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "In", value + GS + text)
|
|
1613
|
+
self
|
|
1614
|
+
end
|
|
1615
|
+
|
|
1616
|
+
def not_include(text, value, interval = -1)
|
|
1617
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "Nn", value + GS + text)
|
|
1618
|
+
self
|
|
1619
|
+
end
|
|
1620
|
+
|
|
1621
|
+
def element_exists(input_place, interval = -1)
|
|
1622
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "eE", input_place)
|
|
1623
|
+
self
|
|
1624
|
+
end
|
|
1625
|
+
|
|
1626
|
+
def element_not_exists(input_place, interval = -1)
|
|
1627
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "nE", input_place)
|
|
1628
|
+
self
|
|
1629
|
+
end
|
|
1630
|
+
|
|
1631
|
+
def is_regex_match(value, pattern, interval = -1)
|
|
1632
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "re", value + GS + pattern)
|
|
1633
|
+
self
|
|
1634
|
+
end
|
|
1635
|
+
|
|
1636
|
+
def is_regex_not_match(value, pattern, interval = -1)
|
|
1637
|
+
add(((interval >= 0) ? "{(" + interval.to_s + ")" : "{") + "rn", value + GS + pattern)
|
|
1638
|
+
self
|
|
1639
|
+
end
|
|
1640
|
+
|
|
1641
|
+
# In: Everything Becomes A JSON List.
|
|
1642
|
+
# Key: Creates A Temporary Data In The Browser IndexedDB.
|
|
1643
|
+
# Key + "i" Creates A Temporary Data To Maintain The Loop Counter In The Browser IndexedDB.
|
|
1644
|
+
def for_each(path, in_val, key = ".")
|
|
1645
|
+
add("{fe", path + GS + in_val + GS + key)
|
|
1646
|
+
self
|
|
1647
|
+
end
|
|
1648
|
+
|
|
1649
|
+
# 'break' is a reserved keyword in Ruby, so 'wf_break' is used to preserve API intent without syntax errors.
|
|
1650
|
+
def wf_break
|
|
1651
|
+
add(";")
|
|
1652
|
+
end
|
|
1653
|
+
|
|
1654
|
+
# 'else' is a reserved keyword in Ruby, so 'wf_else' is used to preserve API intent without syntax errors.
|
|
1655
|
+
def wf_else
|
|
1656
|
+
add("}e")
|
|
1657
|
+
self
|
|
1658
|
+
end
|
|
1659
|
+
|
|
1660
|
+
def start_bracket
|
|
1661
|
+
add("{")
|
|
1662
|
+
end
|
|
1663
|
+
|
|
1664
|
+
def end_bracket
|
|
1665
|
+
add("}")
|
|
1666
|
+
end
|
|
1667
|
+
|
|
1668
|
+
# Used Then In Condition And Loop Methods
|
|
1669
|
+
def then_form(new_form = nil, &block)
|
|
1670
|
+
if block_given?
|
|
1671
|
+
new_form = WebForms.new
|
|
1672
|
+
yield new_form
|
|
1673
|
+
end
|
|
1674
|
+
|
|
1675
|
+
return self if new_form.nil?
|
|
1676
|
+
|
|
1677
|
+
data = new_form.get_web_forms_data
|
|
1678
|
+
|
|
1679
|
+
if !data.nil? && !data.empty?
|
|
1680
|
+
if data.include?("\n")
|
|
1681
|
+
new_form.add_to_up("{")
|
|
1682
|
+
new_form.add("}")
|
|
1683
|
+
end
|
|
1684
|
+
end
|
|
1685
|
+
|
|
1686
|
+
append_form(new_form)
|
|
1687
|
+
self
|
|
1688
|
+
end
|
|
1689
|
+
|
|
1690
|
+
def repeat_form(new_form = nil, repeat = 1, index = nil, &block)
|
|
1691
|
+
if block_given?
|
|
1692
|
+
temp_form = WebForms.new
|
|
1693
|
+
yield temp_form
|
|
1694
|
+
return repeat_form(temp_form, repeat, index)
|
|
1695
|
+
end
|
|
1696
|
+
|
|
1697
|
+
return self if new_form.nil?
|
|
1698
|
+
|
|
1699
|
+
if !index.nil?
|
|
1700
|
+
go_to(index)
|
|
1701
|
+
start_index(index)
|
|
1702
|
+
end
|
|
1703
|
+
|
|
1704
|
+
body_data = new_form.get_web_forms_data
|
|
1705
|
+
|
|
1706
|
+
return self if body_data.nil? || body_data.empty?
|
|
1707
|
+
|
|
1708
|
+
if index.nil?
|
|
1709
|
+
start_line = body_data.split("\n", -1).length * -1
|
|
1710
|
+
append_form(new_form)
|
|
1711
|
+
go_to(start_line, repeat - 1)
|
|
1712
|
+
else
|
|
1713
|
+
append_form(new_form)
|
|
1714
|
+
go_to(index, repeat - 1)
|
|
1715
|
+
end
|
|
1716
|
+
|
|
1717
|
+
self
|
|
1718
|
+
end
|
|
1719
|
+
|
|
1720
|
+
# Async
|
|
1721
|
+
# It Supports Brackets and Then
|
|
1722
|
+
def async_action
|
|
1723
|
+
add("{(a)")
|
|
1724
|
+
self
|
|
1725
|
+
end
|
|
1726
|
+
|
|
1727
|
+
def delay(mili_second)
|
|
1728
|
+
add("De", mili_second.to_s)
|
|
1729
|
+
end
|
|
1730
|
+
|
|
1731
|
+
# Option
|
|
1732
|
+
def change_option(name, value)
|
|
1733
|
+
add("co", name + GS + value)
|
|
1734
|
+
end
|
|
1735
|
+
|
|
1736
|
+
def reset_option(name = nil)
|
|
1737
|
+
if name.nil?
|
|
1738
|
+
add("ro")
|
|
1739
|
+
else
|
|
1740
|
+
add("ro", name)
|
|
1741
|
+
end
|
|
1742
|
+
end
|
|
1743
|
+
|
|
1744
|
+
# Format Storage
|
|
1745
|
+
def create_format_storage(key, data)
|
|
1746
|
+
add(".C", key + GS + data)
|
|
1747
|
+
end
|
|
1748
|
+
|
|
1749
|
+
def delete_format_storage(key)
|
|
1750
|
+
add(".D", key)
|
|
1751
|
+
end
|
|
1752
|
+
|
|
1753
|
+
def add_json(key, path, value)
|
|
1754
|
+
add(".a", key + GS + "j" + GS + value + GS + path)
|
|
1755
|
+
end
|
|
1756
|
+
|
|
1757
|
+
# Name: For Support Attribute, Set Double At Sign (@@) Before Name.
|
|
1758
|
+
def add_xml(key, path, name, value = nil)
|
|
1759
|
+
add(".a", key + GS + "x" + GS + name + GS + value.to_s + GS + path)
|
|
1760
|
+
end
|
|
1761
|
+
|
|
1762
|
+
def add_ini(key, path, value, is_ini_like = false)
|
|
1763
|
+
add(".a", key + GS + "i" + GS + (is_ini_like ? "1" : "0") + GS + value + GS + path)
|
|
1764
|
+
end
|
|
1765
|
+
|
|
1766
|
+
def add_text_line(key, line, text)
|
|
1767
|
+
add(".a", key + GS + "t" + GS + text + GS + line.to_s)
|
|
1768
|
+
end
|
|
1769
|
+
|
|
1770
|
+
def add_variable(key, value)
|
|
1771
|
+
add(".a", key + GS + "v" + GS + value)
|
|
1772
|
+
end
|
|
1773
|
+
|
|
1774
|
+
def update_json(key, path, value)
|
|
1775
|
+
add(".u", key + GS + "j" + GS + value + GS + path)
|
|
1776
|
+
end
|
|
1777
|
+
|
|
1778
|
+
def update_xml(key, path, value)
|
|
1779
|
+
add(".u", key + GS + "x" + GS + value + GS + path)
|
|
1780
|
+
end
|
|
1781
|
+
|
|
1782
|
+
def update_ini(key, path, value, is_ini_like = false)
|
|
1783
|
+
add(".u", key + GS + "i" + GS + (is_ini_like ? "1" : "0") + GS + value + GS + path)
|
|
1784
|
+
end
|
|
1785
|
+
|
|
1786
|
+
# Note: C# original has a typo 'UpdateTexLine', mapped to 'update_text_line' for Ruby standards while preserving exact logic.
|
|
1787
|
+
def update_text_line(key, line, text)
|
|
1788
|
+
add(".u", key + GS + "t" + GS + text + GS + line.to_s)
|
|
1789
|
+
end
|
|
1790
|
+
|
|
1791
|
+
def update_variable(key, value)
|
|
1792
|
+
add(".u", key + GS + "v" + GS + value)
|
|
1793
|
+
end
|
|
1794
|
+
|
|
1795
|
+
def increase_variable(key, value)
|
|
1796
|
+
add(".i", key + GS + "v" + GS + value.to_s)
|
|
1797
|
+
end
|
|
1798
|
+
|
|
1799
|
+
def decrease_variable(key, value)
|
|
1800
|
+
increase_variable(key, value * -1)
|
|
1801
|
+
end
|
|
1802
|
+
|
|
1803
|
+
def delete_json(key, path)
|
|
1804
|
+
add(".d", key + GS + "j" + GS + path)
|
|
1805
|
+
end
|
|
1806
|
+
|
|
1807
|
+
def delete_xml(key, path)
|
|
1808
|
+
add(".d", key + GS + "x" + GS + path)
|
|
1809
|
+
end
|
|
1810
|
+
|
|
1811
|
+
def delete_ini(key, path, is_ini_like = false)
|
|
1812
|
+
add(".d", key + GS + "i" + GS + is_ini_like.to_s + GS + path)
|
|
1813
|
+
end
|
|
1814
|
+
|
|
1815
|
+
def delete_text_line(key, line)
|
|
1816
|
+
add(".d", key + GS + "t" + GS + line.to_s)
|
|
1817
|
+
end
|
|
1818
|
+
|
|
1819
|
+
def delete_variable(key)
|
|
1820
|
+
add(".d", key + GS + "v")
|
|
1821
|
+
end
|
|
1822
|
+
|
|
1823
|
+
# Template Engine
|
|
1824
|
+
# Pattern Example: {{value}}, ((value)), *value*, $value;
|
|
1825
|
+
def bind_json_to_template(input_place, json_text, path, pattern, also_start_tag = true)
|
|
1826
|
+
add("Tj" + input_place, json_text + GS + path + GS + pattern + GS + (also_start_tag ? "1" : "0"))
|
|
1827
|
+
end
|
|
1828
|
+
|
|
1829
|
+
# Because XML Elements Are Lowercased, Placeholders Must Use Lowercase Names.
|
|
1830
|
+
def bind_xml_to_template(input_place, xml_text, path, pattern, also_start_tag = true)
|
|
1831
|
+
add("Tx" + input_place, xml_text + GS + path + GS + pattern + GS + (also_start_tag ? "1" : "0"))
|
|
1832
|
+
end
|
|
1833
|
+
|
|
1834
|
+
def bind_ini_to_template(input_place, ini_text, path, pattern, also_start_tag = true)
|
|
1835
|
+
add("Ti" + input_place, ini_text + GS + path + GS + pattern + GS + (also_start_tag ? "1" : "0"))
|
|
1836
|
+
end
|
|
1837
|
+
|
|
1838
|
+
# Inject
|
|
1839
|
+
# Need Add @: to First of String
|
|
1840
|
+
def inject(value)
|
|
1841
|
+
"$[" + value + "];"
|
|
1842
|
+
end
|
|
1843
|
+
|
|
1844
|
+
# Action Control
|
|
1845
|
+
def replace_action_control(search_value, value, adding_to_up = false)
|
|
1846
|
+
if adding_to_up
|
|
1847
|
+
add_to_up("rE", search_value + GS + value)
|
|
1848
|
+
else
|
|
1849
|
+
add("rE", search_value + GS + value)
|
|
1850
|
+
end
|
|
1851
|
+
end
|
|
1852
|
+
|
|
1853
|
+
def assign_replace(search_value, value, index = -1)
|
|
1854
|
+
current_line = get_line_by_index(index)
|
|
1855
|
+
return if current_line.nil? || current_line.empty?
|
|
1856
|
+
|
|
1857
|
+
parts = current_line.split('=', 2)
|
|
1858
|
+
new_name = ";" + search_value + GS + value + GS + parts[0]
|
|
1859
|
+
new_value = parts.length > 1 ? parts[1] : ""
|
|
1860
|
+
|
|
1861
|
+
update_line_by_index(index, new_name, new_value)
|
|
1862
|
+
end
|
|
1863
|
+
|
|
1864
|
+
# Hash And Checksum
|
|
1865
|
+
def set_hash
|
|
1866
|
+
add("SH")
|
|
1867
|
+
end
|
|
1868
|
+
|
|
1869
|
+
def set_checksum
|
|
1870
|
+
add("CS")
|
|
1871
|
+
end
|
|
1872
|
+
|
|
1873
|
+
def checksum_calculation(text)
|
|
1874
|
+
sum = 0
|
|
1875
|
+
mod = 65536
|
|
1876
|
+
shift = 5
|
|
1877
|
+
|
|
1878
|
+
text.each_char do |c|
|
|
1879
|
+
sum = (((sum << shift) | (sum >> (16 - shift))) ^ c.ord) % mod
|
|
1880
|
+
end
|
|
1881
|
+
|
|
1882
|
+
sum.to_s
|
|
1883
|
+
end
|
|
1884
|
+
|
|
1885
|
+
def get_checksum
|
|
1886
|
+
checksum_calculation(get_web_forms_data())
|
|
1887
|
+
end
|
|
1888
|
+
|
|
1889
|
+
# Get
|
|
1890
|
+
def get_forms_action_data
|
|
1891
|
+
return "" if @web_forms_data.length == 0
|
|
1892
|
+
@web_forms_data
|
|
1893
|
+
end
|
|
1894
|
+
|
|
1895
|
+
def response
|
|
1896
|
+
"[web-forms]\n" + get_forms_action_data()
|
|
1897
|
+
end
|
|
1898
|
+
|
|
1899
|
+
def get_forms_action_data_line_break
|
|
1900
|
+
return "" if @web_forms_data.length == 0
|
|
1901
|
+
|
|
1902
|
+
data = @web_forms_data
|
|
1903
|
+
processed_data = data.gsub("\"", "$[dq];")
|
|
1904
|
+
processed_data.gsub("\n", "$[sln];")
|
|
1905
|
+
end
|
|
1906
|
+
|
|
1907
|
+
# Export
|
|
1908
|
+
def export_to_html_comment(add_line = false)
|
|
1909
|
+
response_str = response().gsub("--", "$[dd];")
|
|
1910
|
+
if response_str[-1] == '-'
|
|
1911
|
+
response_str = response_str[0...-1] + "$[da];"
|
|
1912
|
+
end
|
|
1913
|
+
|
|
1914
|
+
(add_line ? "\n" : "") + "<!--" + response_str + "-->"
|
|
1915
|
+
end
|
|
1916
|
+
|
|
1917
|
+
# Using it for SSE Response
|
|
1918
|
+
def export_to_line_break(src = nil)
|
|
1919
|
+
"[web-forms]$[sln];" + get_forms_action_data_line_break()
|
|
1920
|
+
end
|
|
1921
|
+
|
|
1922
|
+
def get_web_forms_data
|
|
1923
|
+
@web_forms_data
|
|
1924
|
+
end
|
|
1925
|
+
|
|
1926
|
+
def append_form(form)
|
|
1927
|
+
return if form.nil?
|
|
1928
|
+
|
|
1929
|
+
other_data = form.get_web_forms_data
|
|
1930
|
+
if !other_data.nil? && !other_data.empty?
|
|
1931
|
+
if @web_forms_data.length > 0
|
|
1932
|
+
@web_forms_data << "\n"
|
|
1933
|
+
end
|
|
1934
|
+
@web_forms_data << other_data
|
|
1935
|
+
end
|
|
1936
|
+
end
|
|
1937
|
+
|
|
1938
|
+
def clean
|
|
1939
|
+
@web_forms_data.clear
|
|
1940
|
+
end
|
|
1941
|
+
end
|
|
1942
|
+
|
|
1943
|
+
class Security
|
|
1944
|
+
def safe_value(value)
|
|
1945
|
+
return value if value.length < 1
|
|
1946
|
+
|
|
1947
|
+
value = "@" + value if value[0] == '@'
|
|
1948
|
+
|
|
1949
|
+
value = value
|
|
1950
|
+
.gsub("\n", "$[ln];")
|
|
1951
|
+
.gsub(",@", "$[co];@")
|
|
1952
|
+
.gsub(28.chr, "\0")
|
|
1953
|
+
.gsub(29.chr, "\0")
|
|
1954
|
+
.gsub(30.chr, "\0")
|
|
1955
|
+
.gsub(31.chr, "\0")
|
|
1956
|
+
|
|
1957
|
+
value
|
|
1958
|
+
end
|
|
1959
|
+
end
|
|
1960
|
+
|
|
1961
|
+
# WebForms Place Criteria (WPC) DSL
|
|
1962
|
+
class InputPlace
|
|
1963
|
+
def self.document = ","
|
|
1964
|
+
def self.window = "`"
|
|
1965
|
+
# When Calling TransientDOM, Using Root will Result in the Selection of the Transient Tag.
|
|
1966
|
+
def self.root = "~"
|
|
1967
|
+
def self.html = "."
|
|
1968
|
+
def self.head = "^"
|
|
1969
|
+
def self.screen_orientation = "%"
|
|
1970
|
+
def self.all = "*"
|
|
1971
|
+
def self.parent = "/"
|
|
1972
|
+
def self.current = "$"
|
|
1973
|
+
def self.target = "!"
|
|
1974
|
+
def self.upper = "-"
|
|
1975
|
+
|
|
1976
|
+
def self.id(id_val)
|
|
1977
|
+
id_val
|
|
1978
|
+
end
|
|
1979
|
+
|
|
1980
|
+
def self.name(name_val, index = nil)
|
|
1981
|
+
if index.nil?
|
|
1982
|
+
'(' + name_val + ')'
|
|
1983
|
+
else
|
|
1984
|
+
'(' + name_val + ')' + index.to_s
|
|
1985
|
+
end
|
|
1986
|
+
end
|
|
1987
|
+
|
|
1988
|
+
def self.all_names(name_val)
|
|
1989
|
+
"(" + name_val + ")*"
|
|
1990
|
+
end
|
|
1991
|
+
|
|
1992
|
+
def self.tag(tag_val, index = nil)
|
|
1993
|
+
if index.nil?
|
|
1994
|
+
'<' + tag_val + '>'
|
|
1995
|
+
else
|
|
1996
|
+
'<' + tag_val + '>' + index.to_s
|
|
1997
|
+
end
|
|
1998
|
+
end
|
|
1999
|
+
|
|
2000
|
+
def self.all_tags(tag_val)
|
|
2001
|
+
"<" + tag_val + ">*"
|
|
2002
|
+
end
|
|
2003
|
+
|
|
2004
|
+
def self.child(index = nil)
|
|
2005
|
+
if index.nil?
|
|
2006
|
+
"<>"
|
|
2007
|
+
else
|
|
2008
|
+
"<>" + index.to_s
|
|
2009
|
+
end
|
|
2010
|
+
end
|
|
2011
|
+
|
|
2012
|
+
def self.all_child
|
|
2013
|
+
"<>*"
|
|
2014
|
+
end
|
|
2015
|
+
|
|
2016
|
+
def self.class_name(class_val, index = nil)
|
|
2017
|
+
if index.nil?
|
|
2018
|
+
'{' + class_val + '}'
|
|
2019
|
+
else
|
|
2020
|
+
'{' + class_val + '}' + index.to_s
|
|
2021
|
+
end
|
|
2022
|
+
end
|
|
2023
|
+
|
|
2024
|
+
def self.all_classes(class_val)
|
|
2025
|
+
"{" + class_val + "}*"
|
|
2026
|
+
end
|
|
2027
|
+
|
|
2028
|
+
def self.attribute(name_val, value_or_index = nil, operator_or_nil = nil, index = nil)
|
|
2029
|
+
if value_or_index.nil?
|
|
2030
|
+
'"' + name_val + '"'
|
|
2031
|
+
elsif index.nil? && (operator_or_nil.nil? || operator_or_nil == "\0")
|
|
2032
|
+
'"' + name_val + '"' + value_or_index.to_s
|
|
2033
|
+
else
|
|
2034
|
+
op = operator_or_nil.nil? || operator_or_nil == "\0" ? "" : operator_or_nil.to_s
|
|
2035
|
+
if index.nil?
|
|
2036
|
+
'"' + name_val + op + "'" + value_or_index + '"'
|
|
2037
|
+
else
|
|
2038
|
+
'"' + name_val + op + "'" + value_or_index + '"' + index.to_s
|
|
2039
|
+
end
|
|
2040
|
+
end
|
|
2041
|
+
end
|
|
2042
|
+
|
|
2043
|
+
def self.all_attributes(name_val, value = nil, operator = "\0")
|
|
2044
|
+
if value.nil?
|
|
2045
|
+
"\"" + name_val + "\"*"
|
|
2046
|
+
else
|
|
2047
|
+
op = operator == "\0" ? "" : operator.to_s
|
|
2048
|
+
"\"" + name_val + op + "'" + value + "\"*"
|
|
2049
|
+
end
|
|
2050
|
+
end
|
|
2051
|
+
|
|
2052
|
+
def self.query(query_val)
|
|
2053
|
+
"*" + query_val.gsub("=", "$[eq];").gsub("|", "$[vb];").gsub("?", "$[qu];")
|
|
2054
|
+
end
|
|
2055
|
+
|
|
2056
|
+
def self.query_all(query_val)
|
|
2057
|
+
"[" + query_val.gsub("=", "$[eq];").gsub("|", "$[vb];").gsub("?", "$[qu];")
|
|
2058
|
+
end
|
|
2059
|
+
end
|
|
2060
|
+
|
|
2061
|
+
class OutputPlace < InputPlace
|
|
2062
|
+
end
|
|
2063
|
+
|
|
2064
|
+
# Do not Add any Data Before or After it
|
|
2065
|
+
class Fetch
|
|
2066
|
+
RS = 30.chr
|
|
2067
|
+
US = 31.chr
|
|
2068
|
+
|
|
2069
|
+
# Method
|
|
2070
|
+
def self.random(max_value, min_value = nil)
|
|
2071
|
+
if min_value.nil?
|
|
2072
|
+
"@mr" + max_value.to_s
|
|
2073
|
+
else
|
|
2074
|
+
"@mr" + max_value.to_s + RS + min_value.to_s
|
|
2075
|
+
end
|
|
2076
|
+
end
|
|
2077
|
+
|
|
2078
|
+
def self.space_to_char(text, character = "-")
|
|
2079
|
+
"@sc" + character + RS + text
|
|
2080
|
+
end
|
|
2081
|
+
|
|
2082
|
+
def self.encode_uri(text)
|
|
2083
|
+
"@ue" + text
|
|
2084
|
+
end
|
|
2085
|
+
|
|
2086
|
+
def self.decode_uri(text)
|
|
2087
|
+
"@ud" + text
|
|
2088
|
+
end
|
|
2089
|
+
|
|
2090
|
+
def self.method(method_name, args = nil)
|
|
2091
|
+
return_value = "@cm" + method_name
|
|
2092
|
+
if !args.nil? && args.is_a?(Array)
|
|
2093
|
+
return_value += (args.length > 0) ? RS + args.join(US) : ""
|
|
2094
|
+
end
|
|
2095
|
+
return_value
|
|
2096
|
+
end
|
|
2097
|
+
|
|
2098
|
+
def self.module_method(method_name, args = nil)
|
|
2099
|
+
return_value = "@cM" + method_name
|
|
2100
|
+
if !args.nil? && args.is_a?(Array)
|
|
2101
|
+
return_value += (args.length > 0) ? RS + args.join(US) : ""
|
|
2102
|
+
end
|
|
2103
|
+
return_value
|
|
2104
|
+
end
|
|
2105
|
+
|
|
2106
|
+
# MethodName: The Method Name May Need to Include the Class Name, Separated by a Period. Example: MyClassName.MyMethodName
|
|
2107
|
+
def self.wasm_method(wasm_language, wasm_url, method_name, args = nil, key = ".")
|
|
2108
|
+
return_value = "@wA" + wasm_language + RS + wasm_url + RS + method_name
|
|
2109
|
+
if !args.nil? && args.is_a?(Array)
|
|
2110
|
+
return_value += (args.length > 0) ? RS + args.join(US) : ""
|
|
2111
|
+
end
|
|
2112
|
+
return_value
|
|
2113
|
+
end
|
|
2114
|
+
|
|
2115
|
+
def self.script(script_text)
|
|
2116
|
+
"@_" + script_text.gsub("\n", "$[ln];")
|
|
2117
|
+
end
|
|
2118
|
+
|
|
2119
|
+
def self.load_url(url, fetch_script = false)
|
|
2120
|
+
"@lu" + url + (fetch_script ? RS + "1" : "")
|
|
2121
|
+
end
|
|
2122
|
+
|
|
2123
|
+
def self.load_html(url, fetch_input_place = "", fetch_script = false)
|
|
2124
|
+
"@lh" + url + RS + (fetch_script ? "1" : "0") + (!fetch_input_place.nil? && !fetch_input_place.empty? ? RS + fetch_input_place : "")
|
|
2125
|
+
end
|
|
2126
|
+
|
|
2127
|
+
def self.load_line(url, line)
|
|
2128
|
+
"@ll" + url + RS + line.to_s
|
|
2129
|
+
end
|
|
2130
|
+
|
|
2131
|
+
def self.load_ini(url, name, is_ini_like = false)
|
|
2132
|
+
"@li" + url + RS + name + (is_ini_like ? RS + "1" : "")
|
|
2133
|
+
end
|
|
2134
|
+
|
|
2135
|
+
# Name: Name Or Nested Paths. Is Supprt Index (Student[8].Name). Nested Paths Index Starts At 0
|
|
2136
|
+
def self.load_json(url, name)
|
|
2137
|
+
"@lj" + url + RS + name
|
|
2138
|
+
end
|
|
2139
|
+
|
|
2140
|
+
# Name: Name Or XPath; XPath Index Starts At 1
|
|
2141
|
+
def self.load_xml(url, name)
|
|
2142
|
+
"@lx" + url + RS + name
|
|
2143
|
+
end
|
|
2144
|
+
|
|
2145
|
+
# MethodName: It's Check Function Or Variable
|
|
2146
|
+
def self.has_method(method_name)
|
|
2147
|
+
"@hm" + method_name
|
|
2148
|
+
end
|
|
2149
|
+
|
|
2150
|
+
def self.has_module_method(method_name)
|
|
2151
|
+
"@hM" + method_name
|
|
2152
|
+
end
|
|
2153
|
+
|
|
2154
|
+
# This Method Return True Or False If Key Pressed
|
|
2155
|
+
# Modifier: Alt, AltGraph, Control, Meta, Shift, CapsLock, NumLock, ScrollLock
|
|
2156
|
+
def self.get_modifier_state(modifier)
|
|
2157
|
+
"@ms" + modifier
|
|
2158
|
+
end
|
|
2159
|
+
|
|
2160
|
+
# Math
|
|
2161
|
+
def self.math(method_name, args = nil)
|
|
2162
|
+
return_value = "@M#" + method_name
|
|
2163
|
+
if !args.nil? && args.is_a?(Array)
|
|
2164
|
+
return_value += (args.length > 0) ? RS + args.join(US) : ""
|
|
2165
|
+
end
|
|
2166
|
+
return_value
|
|
2167
|
+
end
|
|
2168
|
+
|
|
2169
|
+
# Data
|
|
2170
|
+
def self.date_year = "@dy"
|
|
2171
|
+
# Month In JavaScript Is Start From Index 0, Month In WebForms Core Is Start From Index 1
|
|
2172
|
+
def self.date_month = "@dm"
|
|
2173
|
+
def self.date_day = "@dd"
|
|
2174
|
+
def self.date_date = "@dD"
|
|
2175
|
+
def self.date_hours = "@dh"
|
|
2176
|
+
def self.date_minutes = "@di"
|
|
2177
|
+
def self.date_seconds = "@ds"
|
|
2178
|
+
def self.date_milliseconds = "@dl"
|
|
2179
|
+
|
|
2180
|
+
# String
|
|
2181
|
+
def self.space = "@sp"
|
|
2182
|
+
def self.at_sign = "@sa"
|
|
2183
|
+
|
|
2184
|
+
# Tag
|
|
2185
|
+
def self.get_id(input_place)
|
|
2186
|
+
"@$i" + input_place
|
|
2187
|
+
end
|
|
2188
|
+
|
|
2189
|
+
def self.get_name(input_place)
|
|
2190
|
+
"@$n" + input_place
|
|
2191
|
+
end
|
|
2192
|
+
|
|
2193
|
+
def self.get_value(input_place)
|
|
2194
|
+
"@$v" + input_place
|
|
2195
|
+
end
|
|
2196
|
+
|
|
2197
|
+
def self.get_value_length(input_place)
|
|
2198
|
+
"@$e" + input_place
|
|
2199
|
+
end
|
|
2200
|
+
|
|
2201
|
+
def self.get_class(input_place)
|
|
2202
|
+
"@$c" + input_place
|
|
2203
|
+
end
|
|
2204
|
+
|
|
2205
|
+
def self.get_style(input_place)
|
|
2206
|
+
"@$s" + input_place
|
|
2207
|
+
end
|
|
2208
|
+
|
|
2209
|
+
def self.get_title(input_place)
|
|
2210
|
+
"@$l" + input_place
|
|
2211
|
+
end
|
|
2212
|
+
|
|
2213
|
+
def self.get_label(input_place)
|
|
2214
|
+
"@$A" + input_place
|
|
2215
|
+
end
|
|
2216
|
+
|
|
2217
|
+
def self.get_text(input_place)
|
|
2218
|
+
"@$t" + input_place
|
|
2219
|
+
end
|
|
2220
|
+
|
|
2221
|
+
def self.get_outer_text(input_place)
|
|
2222
|
+
"@$o" + input_place
|
|
2223
|
+
end
|
|
2224
|
+
|
|
2225
|
+
def self.get_text_length(input_place)
|
|
2226
|
+
"@$g" + input_place
|
|
2227
|
+
end
|
|
2228
|
+
|
|
2229
|
+
def self.get_attribute(input_place, attribute)
|
|
2230
|
+
"@$a" + input_place + RS + attribute
|
|
2231
|
+
end
|
|
2232
|
+
|
|
2233
|
+
def self.get_width(input_place)
|
|
2234
|
+
"@$w" + input_place
|
|
2235
|
+
end
|
|
2236
|
+
|
|
2237
|
+
def self.get_height(input_place)
|
|
2238
|
+
"@$h" + input_place
|
|
2239
|
+
end
|
|
2240
|
+
|
|
2241
|
+
def self.get_is_read_only(input_place)
|
|
2242
|
+
"@$r" + input_place
|
|
2243
|
+
end
|
|
2244
|
+
|
|
2245
|
+
def self.get_selected_index(input_place)
|
|
2246
|
+
"@$x" + input_place
|
|
2247
|
+
end
|
|
2248
|
+
|
|
2249
|
+
def self.get_index(input_place)
|
|
2250
|
+
"@$I" + input_place
|
|
2251
|
+
end
|
|
2252
|
+
|
|
2253
|
+
def self.get_text_align(input_place)
|
|
2254
|
+
"@$T" + input_place
|
|
2255
|
+
end
|
|
2256
|
+
|
|
2257
|
+
def self.get_node_length(input_place)
|
|
2258
|
+
"@$L" + input_place
|
|
2259
|
+
end
|
|
2260
|
+
|
|
2261
|
+
def self.get_is_visible(input_place)
|
|
2262
|
+
"@$V" + input_place
|
|
2263
|
+
end
|
|
2264
|
+
|
|
2265
|
+
# Save
|
|
2266
|
+
def self.has_hash(hash_val)
|
|
2267
|
+
"@HH" + hash_val
|
|
2268
|
+
end
|
|
2269
|
+
|
|
2270
|
+
def self.cookie(key)
|
|
2271
|
+
"@co" + key
|
|
2272
|
+
end
|
|
2273
|
+
|
|
2274
|
+
def self.save(key = ".", replace_value = nil)
|
|
2275
|
+
if replace_value.nil?
|
|
2276
|
+
"@cs" + key
|
|
2277
|
+
else
|
|
2278
|
+
"@cs" + key + RS + replace_value
|
|
2279
|
+
end
|
|
2280
|
+
end
|
|
2281
|
+
|
|
2282
|
+
def self.save_then_remove(key)
|
|
2283
|
+
"@cl" + key
|
|
2284
|
+
end
|
|
2285
|
+
|
|
2286
|
+
def self.save_length(key = ".")
|
|
2287
|
+
"@cg" + key
|
|
2288
|
+
end
|
|
2289
|
+
|
|
2290
|
+
def self.cache(key = ".", replace_value = nil)
|
|
2291
|
+
if replace_value.nil?
|
|
2292
|
+
"@cd" + key
|
|
2293
|
+
else
|
|
2294
|
+
"@cd" + key + RS + replace_value
|
|
2295
|
+
end
|
|
2296
|
+
end
|
|
2297
|
+
|
|
2298
|
+
def self.cache_then_remove(key)
|
|
2299
|
+
"@ct" + key
|
|
2300
|
+
end
|
|
2301
|
+
|
|
2302
|
+
def self.cache_length(key = ".")
|
|
2303
|
+
"@cG" + key
|
|
2304
|
+
end
|
|
2305
|
+
|
|
2306
|
+
def self.save_line(key = ".", line = 0)
|
|
2307
|
+
"@lL" + key + "[" + line.to_s
|
|
2308
|
+
end
|
|
2309
|
+
|
|
2310
|
+
def self.save_line_consume(key = ".")
|
|
2311
|
+
"@lL" + key
|
|
2312
|
+
end
|
|
2313
|
+
|
|
2314
|
+
# INIKey: Only Direct Key is Supported
|
|
2315
|
+
def self.save_ini(key, ini_key)
|
|
2316
|
+
"@lI" + key + "[" + ini_key
|
|
2317
|
+
end
|
|
2318
|
+
|
|
2319
|
+
def self.cache_line(key = ".", line = 0)
|
|
2320
|
+
"@dL" + key + "[" + line.to_s
|
|
2321
|
+
end
|
|
2322
|
+
|
|
2323
|
+
def self.cache_line_consume(key = ".")
|
|
2324
|
+
"@dL" + key
|
|
2325
|
+
end
|
|
2326
|
+
|
|
2327
|
+
# INIKey: Only Direct Key is Supported
|
|
2328
|
+
def self.cache_ini(key, ini_key)
|
|
2329
|
+
"@dI" + key + "[" + ini_key
|
|
2330
|
+
end
|
|
2331
|
+
|
|
2332
|
+
# Format Storage
|
|
2333
|
+
def self.format_store(key)
|
|
2334
|
+
"@fr" + key
|
|
2335
|
+
end
|
|
2336
|
+
|
|
2337
|
+
def self.format_store_by_xml_query(key, xpath)
|
|
2338
|
+
"@fx" + key + RS + xpath
|
|
2339
|
+
end
|
|
2340
|
+
|
|
2341
|
+
def self.format_store_by_json_query(key, query)
|
|
2342
|
+
"@fj" + key + RS + query
|
|
2343
|
+
end
|
|
2344
|
+
|
|
2345
|
+
def self.format_store_by_ini(key, name)
|
|
2346
|
+
"@fi" + key + RS + name
|
|
2347
|
+
end
|
|
2348
|
+
|
|
2349
|
+
def self.format_store_by_text(key, line)
|
|
2350
|
+
"@ft" + key + RS + line.to_s
|
|
2351
|
+
end
|
|
2352
|
+
|
|
2353
|
+
def self.format_store_by_variable(key)
|
|
2354
|
+
"@fv" + key
|
|
2355
|
+
end
|
|
2356
|
+
|
|
2357
|
+
# State
|
|
2358
|
+
def self.has_state(path)
|
|
2359
|
+
"@hs" + path
|
|
2360
|
+
end
|
|
2361
|
+
|
|
2362
|
+
# SSE
|
|
2363
|
+
def self.sse_is_connected(path)
|
|
2364
|
+
"@Sc" + path
|
|
2365
|
+
end
|
|
2366
|
+
|
|
2367
|
+
# WebSockets
|
|
2368
|
+
def self.web_sockets_is_connected(path = "")
|
|
2369
|
+
"@Wc" + path
|
|
2370
|
+
end
|
|
2371
|
+
|
|
2372
|
+
# Document
|
|
2373
|
+
def self.tab_is_active = "@da"
|
|
2374
|
+
|
|
2375
|
+
# Window
|
|
2376
|
+
def self.href = "@wf"
|
|
2377
|
+
PathName = "@wP"
|
|
2378
|
+
|
|
2379
|
+
def self.query(name = "*")
|
|
2380
|
+
"@wq" + name
|
|
2381
|
+
end
|
|
2382
|
+
|
|
2383
|
+
def self.hash = "@wh"
|
|
2384
|
+
def self.host = "@wH"
|
|
2385
|
+
def self.host_name = "@wn"
|
|
2386
|
+
def self.port = "@wT"
|
|
2387
|
+
def self.origin = "@wo"
|
|
2388
|
+
def self.get_selection = "@ws"
|
|
2389
|
+
def self.scroll_x = "@wx"
|
|
2390
|
+
def self.scroll_y = "@wy"
|
|
2391
|
+
|
|
2392
|
+
def self.segment(index)
|
|
2393
|
+
"@wS" + index.to_s
|
|
2394
|
+
end
|
|
2395
|
+
|
|
2396
|
+
# It Only Works when the String Starts with the Tilde Character (~). The Path is Also Separated by the Slash Character (/). #~/Segment1/Segment2/Segment3
|
|
2397
|
+
def self.hash_segment(index)
|
|
2398
|
+
"@wt" + index.to_s
|
|
2399
|
+
end
|
|
2400
|
+
|
|
2401
|
+
# Navigator
|
|
2402
|
+
def self.clipboard_text = "@nC"
|
|
2403
|
+
def self.geo_latitude = "@nW"
|
|
2404
|
+
def self.geo_longitude = "@nO"
|
|
2405
|
+
def self.language = "@nL"
|
|
2406
|
+
def self.is_on_line = "@no"
|
|
2407
|
+
def self.user_agent = "@na"
|
|
2408
|
+
|
|
2409
|
+
# Screen
|
|
2410
|
+
def self.screen_width = "@sw"
|
|
2411
|
+
def self.screen_height = "@sh"
|
|
2412
|
+
def self.screen_orientation_type = "@so"
|
|
2413
|
+
def self.screen_orientation_angle = "@sr"
|
|
2414
|
+
|
|
2415
|
+
# Performance
|
|
2416
|
+
def self.time_origin = "@pt"
|
|
2417
|
+
def self.performance_now = "@pn"
|
|
2418
|
+
|
|
2419
|
+
# Event
|
|
2420
|
+
def self.event = "@EV"
|
|
2421
|
+
def self.event_serialize = "@Es"
|
|
2422
|
+
def self.event_key = "@ek"
|
|
2423
|
+
def self.event_which = "@ew"
|
|
2424
|
+
def self.event_client_x = "@ex"
|
|
2425
|
+
def self.event_client_y = "@ey"
|
|
2426
|
+
def self.event_page_x = "@eX"
|
|
2427
|
+
def self.event_page_y = "@eY"
|
|
2428
|
+
def self.event_offset_x = "@Ex"
|
|
2429
|
+
def self.event_offset_y = "@Ey"
|
|
2430
|
+
def self.event_delta_y = "@ed"
|
|
2431
|
+
end
|
|
2432
|
+
|
|
2433
|
+
class WasmLanguage
|
|
2434
|
+
# The Suffix "Mediator" Means You Must Call the JavaScript Interface. In Other Cases, the WASM File Should Be Called Directly.
|
|
2435
|
+
def self.c = "c"
|
|
2436
|
+
def self.cpp = "c"
|
|
2437
|
+
def self.rust = "rust"
|
|
2438
|
+
def self.c_sharp = "csharp"
|
|
2439
|
+
# .NET WebCIL Container. The "dotnet.js" File Should Be Invoked.
|
|
2440
|
+
def self.c_sharp_mediator = "csharp-m"
|
|
2441
|
+
def self.go = "go"
|
|
2442
|
+
def self.java = "java"
|
|
2443
|
+
def self.assembly_script = "as"
|
|
2444
|
+
end
|
|
2445
|
+
|
|
2446
|
+
class HtmlEvent
|
|
2447
|
+
def self.on_abort = "onabort"
|
|
2448
|
+
def self.on_after_print = "onafterprint"
|
|
2449
|
+
def self.on_before_print = "onbeforeprint"
|
|
2450
|
+
def self.on_before_unload = "onbeforeunload"
|
|
2451
|
+
def self.on_blur = "onblur"
|
|
2452
|
+
def self.on_can_play = "oncanplay"
|
|
2453
|
+
def self.on_can_play_through = "oncanplaythrough"
|
|
2454
|
+
def self.on_change = "onchange"
|
|
2455
|
+
def self.on_click = "onclick"
|
|
2456
|
+
def self.on_copy = "oncopy"
|
|
2457
|
+
def self.on_cut = "oncut"
|
|
2458
|
+
def self.on_double_click = "ondblclick"
|
|
2459
|
+
def self.on_drag = "ondrag"
|
|
2460
|
+
def self.on_drag_end = "ondragend"
|
|
2461
|
+
def self.on_drag_enter = "ondragenter"
|
|
2462
|
+
def self.on_drag_leave = "ondragleave"
|
|
2463
|
+
def self.on_drag_over = "ondragover"
|
|
2464
|
+
def self.on_drag_start = "ondragstart"
|
|
2465
|
+
def self.on_drop = "ondrop"
|
|
2466
|
+
def self.on_duration_change = "ondurationchange"
|
|
2467
|
+
def self.on_ended = "onended"
|
|
2468
|
+
def self.on_error = "onerror"
|
|
2469
|
+
def self.on_focus = "onfocus"
|
|
2470
|
+
def self.on_focusin = "onfocusin"
|
|
2471
|
+
def self.on_focus_out = "onfocusout"
|
|
2472
|
+
def self.on_hash_change = "onhashchange"
|
|
2473
|
+
def self.on_input = "oninput"
|
|
2474
|
+
def self.on_invalid = "oninvalid"
|
|
2475
|
+
def self.on_key_down = "onkeydown"
|
|
2476
|
+
def self.on_key_press = "onkeypress"
|
|
2477
|
+
def self.on_key_up = "onkeyup"
|
|
2478
|
+
def self.on_load = "onload"
|
|
2479
|
+
def self.on_loaded_data = "onloadeddata"
|
|
2480
|
+
def self.on_loaded_meta_data = "onloadedmetadata"
|
|
2481
|
+
def self.on_load_start = "onloadstart"
|
|
2482
|
+
def self.on_mouse_down = "onmousedown"
|
|
2483
|
+
def self.on_mouse_enter = "onmouseenter"
|
|
2484
|
+
def self.on_mouse_leave = "onmouseleave"
|
|
2485
|
+
def self.on_mouse_move = "onmousemove"
|
|
2486
|
+
def self.on_mouse_over = "onmouseover"
|
|
2487
|
+
def self.on_mouse_out = "onmouseout"
|
|
2488
|
+
def self.on_mouse_up = "onmouseup"
|
|
2489
|
+
def self.on_offline = "onoffline"
|
|
2490
|
+
def self.on_online = "ononline"
|
|
2491
|
+
def self.on_page_hide = "onpagehide"
|
|
2492
|
+
def self.on_page_show = "onpageshow"
|
|
2493
|
+
def self.on_paste = "onpaste"
|
|
2494
|
+
def self.on_pause = "onpause"
|
|
2495
|
+
def self.on_play = "onplay"
|
|
2496
|
+
def self.on_playing = "onplaying"
|
|
2497
|
+
def self.on_progress = "onprogress"
|
|
2498
|
+
def self.on_rate_change = "onratechange"
|
|
2499
|
+
def self.on_resize = "onresize"
|
|
2500
|
+
def self.on_reset = "onreset"
|
|
2501
|
+
def self.on_scroll = "onscroll"
|
|
2502
|
+
def self.on_search = "onsearch"
|
|
2503
|
+
def self.on_seeked = "onseeked"
|
|
2504
|
+
def self.on_seeking = "onseeking"
|
|
2505
|
+
def self.on_select = "onselect"
|
|
2506
|
+
def self.on_stalled = "onstalled"
|
|
2507
|
+
def self.on_submit = "onsubmit"
|
|
2508
|
+
def self.on_suspend = "onsuspend"
|
|
2509
|
+
def self.on_time_update = "ontimeupdate"
|
|
2510
|
+
def self.on_toggle = "ontoggle"
|
|
2511
|
+
def self.on_touch_cancel = "ontouchcancel"
|
|
2512
|
+
def self.on_touchend = "ontouchend"
|
|
2513
|
+
def self.on_touch_move = "ontouchmove"
|
|
2514
|
+
def self.on_touch_start = "ontouchstart"
|
|
2515
|
+
def self.on_unload = "onunload"
|
|
2516
|
+
def self.on_volume_change = "onvolumechange"
|
|
2517
|
+
def self.on_waiting = "onwaiting"
|
|
2518
|
+
def self.on_wheel = "onwheel"
|
|
2519
|
+
end
|
|
2520
|
+
|
|
2521
|
+
class HtmlEventListener
|
|
2522
|
+
def self.abort = "abort"
|
|
2523
|
+
def self.after_print = "afterprint"
|
|
2524
|
+
def self.before_print = "beforeprint"
|
|
2525
|
+
def self.before_unload = "beforeunload"
|
|
2526
|
+
def self.blur = "blur"
|
|
2527
|
+
def self.can_play = "canplay"
|
|
2528
|
+
def self.can_play_through = "canplaythrough"
|
|
2529
|
+
def self.change = "change"
|
|
2530
|
+
def self.click = "click"
|
|
2531
|
+
def self.copy = "copy"
|
|
2532
|
+
def self.cut = "cut"
|
|
2533
|
+
def self.double_click = "dblclick"
|
|
2534
|
+
def self.drag = "drag"
|
|
2535
|
+
def self.drag_end = "dragend"
|
|
2536
|
+
def self.drag_enter = "dragenter"
|
|
2537
|
+
def self.drag_leave = "dragleave"
|
|
2538
|
+
def self.drag_over = "dragover"
|
|
2539
|
+
def self.drag_start = "dragstart"
|
|
2540
|
+
def self.drop = "drop"
|
|
2541
|
+
def self.duration_change = "durationchange"
|
|
2542
|
+
def self.ended = "ended"
|
|
2543
|
+
def self.error = "error"
|
|
2544
|
+
def self.focus = "focus"
|
|
2545
|
+
def self.focusin = "focusin"
|
|
2546
|
+
def self.focus_out = "focusout"
|
|
2547
|
+
def self.hash_change = "hashchange"
|
|
2548
|
+
def self.input = "input"
|
|
2549
|
+
def self.invalid = "invalid"
|
|
2550
|
+
def self.key_down = "keydown"
|
|
2551
|
+
def self.key_press = "keypress"
|
|
2552
|
+
def self.key_up = "keyup"
|
|
2553
|
+
def self.load = "load"
|
|
2554
|
+
def self.loaded_data = "loadeddata"
|
|
2555
|
+
def self.loaded_meta_data = "loadedmetadata"
|
|
2556
|
+
def self.load_start = "loadstart"
|
|
2557
|
+
def self.mouse_down = "mousedown"
|
|
2558
|
+
def self.mouse_enter = "mouseenter"
|
|
2559
|
+
def self.mouse_leave = "mouseleave"
|
|
2560
|
+
def self.mouse_move = "mousemove"
|
|
2561
|
+
def self.mouse_over = "mouseover"
|
|
2562
|
+
def self.mouse_out = "mouseout"
|
|
2563
|
+
def self.mouse_up = "mouseup"
|
|
2564
|
+
def self.offline = "offline"
|
|
2565
|
+
def self.online = "online"
|
|
2566
|
+
def self.page_hide = "pagehide"
|
|
2567
|
+
def self.page_show = "pageshow"
|
|
2568
|
+
def self.paste = "paste"
|
|
2569
|
+
def self.pause = "pause"
|
|
2570
|
+
def self.play = "play"
|
|
2571
|
+
def self.playing = "playing"
|
|
2572
|
+
def self.progress = "progress"
|
|
2573
|
+
def self.rate_change = "ratechange"
|
|
2574
|
+
def self.resize = "resize"
|
|
2575
|
+
def self.reset = "reset"
|
|
2576
|
+
def self.scroll = "scroll"
|
|
2577
|
+
def self.search = "search"
|
|
2578
|
+
def self.seeked = "seeked"
|
|
2579
|
+
def self.seeking = "seeking"
|
|
2580
|
+
def self.select = "select"
|
|
2581
|
+
def self.stalled = "stalled"
|
|
2582
|
+
def self.submit = "submit"
|
|
2583
|
+
def self.suspend = "suspend"
|
|
2584
|
+
def self.time_update = "timeupdate"
|
|
2585
|
+
def self.toggle = "toggle"
|
|
2586
|
+
def self.touch_cancel = "touchcancel"
|
|
2587
|
+
def self.touchend = "touchend"
|
|
2588
|
+
def self.touch_move = "touchmove"
|
|
2589
|
+
def self.touch_start = "touchstart"
|
|
2590
|
+
def self.unload = "unload"
|
|
2591
|
+
def self.volume_change = "volumechange"
|
|
2592
|
+
def self.waiting = "waiting"
|
|
2593
|
+
def self.wheel = "wheel"
|
|
2594
|
+
|
|
2595
|
+
def self.animation_end = "animationend"
|
|
2596
|
+
def self.animation_iteration = "animationiteration"
|
|
2597
|
+
def self.animation_start = "animationstart"
|
|
2598
|
+
def self.context_menu = "contextmenu"
|
|
2599
|
+
def self.full_screen_change = "fullscreenchange"
|
|
2600
|
+
def self.full_screen_error = "fullscreenerror"
|
|
2601
|
+
def self.pop_state = "popstate"
|
|
2602
|
+
def self.transition_end = "transitionend"
|
|
2603
|
+
def self.storage = "storage"
|
|
2604
|
+
|
|
2605
|
+
# Custom
|
|
2606
|
+
def self.scroll_bottom = "scrollbottom" # Need Call EnableScrollBottomEvent Method Before
|
|
2607
|
+
def self.element_reached = "elementreached" # Need Call EnableReachedElementEvent Method Before
|
|
2608
|
+
end
|
|
2609
|
+
|
|
2610
|
+
class String
|
|
2611
|
+
def child(value)
|
|
2612
|
+
if self.length < 1
|
|
2613
|
+
return value
|
|
2614
|
+
end
|
|
2615
|
+
|
|
2616
|
+
self + "|" + value
|
|
2617
|
+
end
|
|
2618
|
+
|
|
2619
|
+
def parent
|
|
2620
|
+
if self.length < 1
|
|
2621
|
+
return self
|
|
2622
|
+
end
|
|
2623
|
+
|
|
2624
|
+
if self.end_with?("|/") || self.end_with?("//")
|
|
2625
|
+
return self + '/'
|
|
2626
|
+
end
|
|
2627
|
+
|
|
2628
|
+
self + "|/"
|
|
2629
|
+
end
|
|
2630
|
+
|
|
2631
|
+
def criteria(value)
|
|
2632
|
+
if self.length < 1
|
|
2633
|
+
return value
|
|
2634
|
+
end
|
|
2635
|
+
|
|
2636
|
+
self + "?" + value.gsub("|", "$[vb];").gsub("?", "$[qu];")
|
|
2637
|
+
end
|
|
2638
|
+
|
|
2639
|
+
def append_fetch_replace(search_value, value)
|
|
2640
|
+
fs = 28.chr
|
|
2641
|
+
|
|
2642
|
+
text = self[1..-1]
|
|
2643
|
+
"@;" + search_value + fs + value + fs + text
|
|
2644
|
+
end
|
|
2645
|
+
|
|
2646
|
+
def line_break(encode_line = false)
|
|
2647
|
+
encode = encode_line ? "$[sln];" : ""
|
|
2648
|
+
self.gsub("\r\n", encode).gsub("\n", encode).gsub("\r", encode)
|
|
2649
|
+
end
|
|
2650
|
+
|
|
2651
|
+
# Converts Numbers to Strings
|
|
2652
|
+
def to_js_string
|
|
2653
|
+
"\"" + self + "\""
|
|
2654
|
+
end
|
|
2655
|
+
|
|
2656
|
+
# Get JS Object Momentary
|
|
2657
|
+
def to_js_object
|
|
2658
|
+
"$" + self
|
|
2659
|
+
end
|
|
2660
|
+
|
|
2661
|
+
# Get JS Object Returned Value Once
|
|
2662
|
+
def to_js_return_object
|
|
2663
|
+
"$@" + self
|
|
2664
|
+
end
|
|
2665
|
+
end
|
|
2666
|
+
end
|