aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/go_input.js
diff options
context:
space:
mode:
authorGravatar Paweł Zuzelski <pawelz@pld-linux.org>2010-06-08 16:31:50 +0200
committerGravatar Paweł Zuzelski <pawelz@pld-linux.org>2010-06-08 16:38:09 +0200
commitf9922ae0f9b05afb3f485a60f57744f61fda8c40 (patch)
treec7c64f6ab7be712f871d6d5b3bf984ac0fc90741 /examples/data/scripts/go_input.js
parent528da21727fba819d8eef4251d22d91de2c111c9 (diff)
Resurect go_input script.
Diffstat (limited to 'examples/data/scripts/go_input.js')
-rw-r--r--examples/data/scripts/go_input.js27
1 files changed, 27 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();