From 935d54fb63306dbd2cea9407ad1b2a530ade310a Mon Sep 17 00:00:00 2001 From: totoro Date: Sun, 15 Aug 2021 00:13:49 +0200 Subject: [PATCH] init and options for javascript typewatch (trigger event when the key are not pressed during elapsed time) --- web/jQuery/jq_typewatch.anubis | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+), 0 deletions(-) create mode 100644 web/jQuery/jq_typewatch.anubis diff --git a/web/jQuery/jq_typewatch.anubis b/web/jQuery/jq_typewatch.anubis new file mode 100644 index 0000000..ecf98cb --- /dev/null +++ b/web/jQuery/jq_typewatch.anubis @@ -0,0 +1,37 @@ +/* + * Created by PyramIDE. + * User: フランスのトトロ aka (David RENÉ) + * Date: 11/07/2021 + * Time: 00:21 + * © David RENÉ + */ + +read tools/string.anubis + + +public define String + watch_options + ( + String target_id, //id of the target to insert the result + String ajax_url, // + Int wait, + ) + = +"{ + callback: function(value) {Xlib.load_content('"+target_id+"', "+ajax_url+")}, + wait:"+wait+", + highlight: true, + allowSubmit: false, + captureLength: 0 +}" +. + +public define String + init_watcher + ( + String element, + String target_id, + String ajax_url, + )= + "$('#"+element+"').typeWatch("+watch_options(target_id, ajax_url, 750)+");" +. -- libgit2 0.21.4