Commit 935d54fb63306dbd2cea9407ad1b2a530ade310a
1 parent
72990664
init and options for javascript typewatch (trigger event when the key are not pr…
…essed during elapsed time)
Showing
1 changed file
with
37 additions
and
0 deletions
Show diff stats
| 1 | +/* | |
| 2 | + * Created by PyramIDE. | |
| 3 | + * User: フランスのトトロ aka (David RENÉ) | |
| 4 | + * Date: 11/07/2021 | |
| 5 | + * Time: 00:21 | |
| 6 | + * © David RENÉ | |
| 7 | + */ | |
| 8 | + | |
| 9 | +read tools/string.anubis | |
| 10 | + | |
| 11 | + | |
| 12 | +public define String | |
| 13 | + watch_options | |
| 14 | + ( | |
| 15 | + String target_id, //id of the target to insert the result | |
| 16 | + String ajax_url, // | |
| 17 | + Int wait, | |
| 18 | + ) | |
| 19 | + = | |
| 20 | +"{ | |
| 21 | + callback: function(value) {Xlib.load_content('"+target_id+"', "+ajax_url+")}, | |
| 22 | + wait:"+wait+", | |
| 23 | + highlight: true, | |
| 24 | + allowSubmit: false, | |
| 25 | + captureLength: 0 | |
| 26 | +}" | |
| 27 | +. | |
| 28 | + | |
| 29 | +public define String | |
| 30 | + init_watcher | |
| 31 | + ( | |
| 32 | + String element, | |
| 33 | + String target_id, | |
| 34 | + String ajax_url, | |
| 35 | + )= | |
| 36 | + "$('#"+element+"').typeWatch("+watch_options(target_id, ajax_url, 750)+");" | |
| 37 | +. | ... | ... |