diff options
author | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-06-08 16:31:50 +0200 |
---|---|---|
committer | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-06-08 16:38:09 +0200 |
commit | f9922ae0f9b05afb3f485a60f57744f61fda8c40 (patch) | |
tree | c7c64f6ab7be712f871d6d5b3bf984ac0fc90741 /examples/data/scripts | |
parent | 528da21727fba819d8eef4251d22d91de2c111c9 (diff) |
Resurect go_input script.
Diffstat (limited to 'examples/data/scripts')
-rw-r--r-- | examples/data/scripts/go_input.js | 27 | ||||
-rwxr-xr-x | examples/data/scripts/go_input.sh | 20 |
2 files changed, 47 insertions, 0 deletions
diff --git a/examples/data/scripts/go_input.js b/examples/data/scripts/go_input.js new file mode 100644 index 0000000..557671f --- /dev/null +++ b/examples/data/scripts/go_input.js @@ -0,0 +1,27 @@ +var elements = document.querySelectorAll("textarea, input" + [ + ":not([type='button'])", + ":not([type='checkbox'])", + ":not([type='hidden'])", + ":not([type='image'])", + ":not([type='radio'])", + ":not([type='reset'])", + ":not([type='submit'])"].join("")); +function gi() { + if (elements) { + var el, i = 0; + while((el = elements[i++])) { + var style=getComputedStyle(el, null); + if (style.display !== 'none' && style.visibility === 'visible') { + if (el.type === "file") { + el.click(); + } + else { + el.focus(); + } + return "XXXEMIT_FORM_ACTIVEXXX"; + } + } + } +} + +gi(); diff --git a/examples/data/scripts/go_input.sh b/examples/data/scripts/go_input.sh new file mode 100755 index 0000000..c873dd8 --- /dev/null +++ b/examples/data/scripts/go_input.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +config=$1; +shift +pid=$1; +shift +xid=$1; +shift +fifo=$1; +shift +socket=$1; +shift +url=$1; +shift +title=$1; +shift + +case $(echo 'script @scripts_dir/go_input.js' | socat - unix-connect:$socket) in + *XXXEMIT_FORM_ACTIVEXXX*) echo 'event FORM_ACTIVE' | socat - unix-connect:$socket ;; +esac |