2 (c) 2009 by Leon Winter
3 (c) 2009, 2010 by Hannes Schueller
4 (c) 2010 by Hans-Peter Deifel
8 function vimprobable_v(e
, y
) {
9 t
= e
.nodeName
.toLowerCase();
10 if((t
== 'input' && /^(text|password|checkbox|radio)$/.test(e
.type
))
11 || /^(select|textarea)$/.test(t
)
12 || e
.contentEditable
== 'true')
13 console
.log('insertmode_'+(y
=='focus'?'on':'off'));
16 if(document
.activeElement
)
17 vimprobable_v(document
.activeElement
,'focus');
19 vimprobable_m
=['focus','blur'];
21 if (document
.getElementsByTagName("body")[0] !== null && typeof(document
.getElementsByTagName("body")[0]) == "object") {
22 for(i
in vimprobable_m
)
23 document
.getElementsByTagName('body')[0].addEventListener(vimprobable_m
[i
], function(x
) {
24 vimprobable_v(x
.target
,x
.type
);
28 self
.onunload = function() {
29 vimprobable_v(document
.activeElement
, '');