]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/behavior.js
2 Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
8 if(!dojo
._hasResource
["dojo.behavior"]){
9 dojo
._hasResource
["dojo.behavior"]=true;
10 dojo
.provide("dojo.behavior");
11 dojo
.behavior
=new function(){
19 function _5(_6
,_7
,_8
){
22 if(typeof _9
[x
]=="undefined"){
32 this.add=function(_a
){
34 _5(_a
,this,function(_c
,_d
){
35 var _e
=_1(this._behaviors
,_d
);
36 if(typeof _e
["id"]!="number"){
41 if((dojo
.isString(_c
))||(dojo
.isFunction(_c
))){
44 _5(_c
,function(_10
,_11
){
49 var _12=function(_13
,_14
,_15
){
50 if(dojo
.isString(_14
)){
52 dojo
.publish(_14
,[_13
]);
54 dojo
.connect(_13
,_15
,function(){
55 dojo
.publish(_14
,arguments
);
59 if(dojo
.isFunction(_14
)){
63 dojo
.connect(_13
,_15
,_14
);
68 this.apply=function(){
69 _5(this._behaviors
,function(_16
,id
){
70 dojo
.query(id
).forEach(function(_17
){
72 var bid
="_dj_behavior_"+_16
.id
;
73 if(typeof _17
[bid
]=="number"){
75 if(_18
==(_16
.length
)){
79 for(var x
=_18
,_19
;_19
=_16
[x
];x
++){
80 _5(_19
,function(_1a
,_1b
){
81 if(dojo
.isArray(_1a
)){
82 dojo
.forEach(_1a
,function(_1c
){
93 dojo
.addOnLoad(dojo
.behavior
,"apply");