Revision 903,
1.0 KB
checked in by niltonneto, 15 years ago
(diff) |
Importacao inicial do Expresso do Serpro
|
Line | |
---|
1 | /* Source: Venus Project |
---|
2 | http://www.jbanana.org/venus/ |
---|
3 | License: LGPL-CC & Creative Commons */ |
---|
4 | |
---|
5 | function getJSObject(jsID, args0){ |
---|
6 | var evento=getEvent(args0); |
---|
7 | var target=getDOMTarget(evento); |
---|
8 | return getJSObjectFromTarget(jsID, target); |
---|
9 | } |
---|
10 | |
---|
11 | function getJSObjectFromTarget(jsID, target){ |
---|
12 | var retorno = null; |
---|
13 | var tmp = target; |
---|
14 | while(retorno == null) { |
---|
15 | eval("retorno = tmp."+jsID); |
---|
16 | if((retorno==null||retorno==undefined) && tmp.getAttribute!=undefined ) retorno=tmp.getAttribute(jsID); |
---|
17 | tmp = tmp.parentNode; |
---|
18 | } |
---|
19 | if(retorno == null){ |
---|
20 | tmp = tmp.offsetParent; |
---|
21 | eval("retorno = tmp."+jsID); |
---|
22 | } |
---|
23 | return retorno; |
---|
24 | } |
---|
25 | |
---|
26 | |
---|
27 | function getEvent(args0){ |
---|
28 | var evento=args0; |
---|
29 | if(evento==null||evento==undefined) evento=event; |
---|
30 | return evento; |
---|
31 | } |
---|
32 | |
---|
33 | function getDOMTarget(evento){ |
---|
34 | var target=evento.target; |
---|
35 | if(target == null || target==undefined) target=evento.srcElement; |
---|
36 | return target; |
---|
37 | } |
---|
38 | |
---|
39 | function getDOMTargetByEvent(args0){ |
---|
40 | var evento=getEvent(args0); |
---|
41 | var target=getDOMTarget(evento); |
---|
42 | return target; |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.