remove old cycle-inputs.js
This commit is contained in:
parent
743aa86dfb
commit
ef1de133ed
@ -1,46 +0,0 @@
|
|||||||
/* Cycle <input> text boxes.
|
|
||||||
* works with the types defined in 'types'.
|
|
||||||
* Note: Does not work for <textarea>.
|
|
||||||
*
|
|
||||||
* Example keybind:
|
|
||||||
* CYCLE_INPUTS = "jseval -q -f ~/.config/qutebrowser/cycle-inputs.js"
|
|
||||||
* config.bind('gi', CYCLE_INPUTS)
|
|
||||||
*
|
|
||||||
* By dive on freenode <dave@dawoodfall.net>
|
|
||||||
*/
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
var inputs = document.getElementsByTagName("input");
|
|
||||||
var types = /text|password|date|email|month|number|range|search|tel|time|url|week/;
|
|
||||||
var hidden = /hidden/;
|
|
||||||
var found = false;
|
|
||||||
var ii = 0;
|
|
||||||
var jj = 0;
|
|
||||||
|
|
||||||
function ishidden(el) {
|
|
||||||
return hidden.test(el.attributes.value) || el.offsetParent === null;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (ii = 0; ii < inputs.length; ii++) {
|
|
||||||
if (inputs[ii] === document.activeElement) {
|
|
||||||
for (jj = ii + 1; jj < inputs.length; jj++) {
|
|
||||||
if (!ishidden(inputs[jj]) && types.test(inputs[jj].type)) {
|
|
||||||
inputs[jj].focus();
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found) {
|
|
||||||
for (ii = 0; ii < inputs.length; ii++) {
|
|
||||||
if (!ishidden(inputs[ii]) && types.test(inputs[ii].type)) {
|
|
||||||
inputs[ii].focus();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// vim: tw=0 expandtab tabstop=4 softtabstop=4 shiftwidth=4
|
|
@ -14,18 +14,18 @@ var inputs = document.getElementsByTagName("input");
|
|||||||
var types = /text|password|date|email|month|number|range|search|tel|time|url|week/;
|
var types = /text|password|date|email|month|number|range|search|tel|time|url|week/;
|
||||||
var hidden = /hidden/;
|
var hidden = /hidden/;
|
||||||
var found = false;
|
var found = false;
|
||||||
var ii = 0;
|
var i = 0;
|
||||||
var jj = 0;
|
var k = 0;
|
||||||
|
|
||||||
function ishidden(el) {
|
function ishidden(el) {
|
||||||
return hidden.test(el.attributes.value) || el.offsetParent === null;
|
return hidden.test(el.attributes.value) || el.offsetParent === null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ii = 0; ii < inputs.length; ii++) {
|
for (i = 0; i < inputs.length; i++) {
|
||||||
if (inputs[ii] === document.activeElement) {
|
if (inputs[i] === document.activeElement) {
|
||||||
for (jj = ii + 1; jj < inputs.length; jj++) {
|
for (k = i + 1; k < inputs.length; k++) {
|
||||||
if (!ishidden(inputs[jj]) && types.test(inputs[jj].type)) {
|
if (!ishidden(inputs[k]) && types.test(inputs[k].type)) {
|
||||||
inputs[jj].focus();
|
inputs[k].focus();
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -35,9 +35,9 @@ for (ii = 0; ii < inputs.length; ii++) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
for (ii = 0; ii < inputs.length; ii++) {
|
for (i = 0; i < inputs.length; i++) {
|
||||||
if (!ishidden(inputs[ii]) && types.test(inputs[ii].type)) {
|
if (!ishidden(inputs[i]) && types.test(inputs[i].type)) {
|
||||||
inputs[ii].focus();
|
inputs[i].focus();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user