@@ -5,25 +5,25 @@ window.cls || (window.cls = {});
55 * @extends ViewBase
66 */
77
8- cls . EventName = function ( name )
8+ cls . EventType = function ( type )
99{
10- this . name = name ;
10+ this . type = type ;
1111 this . rt_listeners = null ;
1212 this . is_expanded = false ;
1313 this . rt_id = 0 ;
1414 this . obj_id = 0 ;
1515 this . _init ( ) ;
1616} ;
1717
18- cls . EventNamePrototype = function ( )
18+ cls . EventTypePrototype = function ( )
1919{
2020 var SEARCH_TYPE_EVENT = 5 ;
2121
22- this . search_dom = function ( rt_id , obj_id , ev_name , cb )
22+ this . search_listeners = function ( rt_id , obj_id , type , cb )
2323 {
2424 this . rt_id = this . _data_runtime_id = rt_id ;
2525 this . obj_id = this . _root_obj_id = obj_id ;
26- this . search ( ev_name , SEARCH_TYPE_EVENT , 0 , 0 , cb ) ;
26+ this . search ( type , SEARCH_TYPE_EVENT , 0 , 0 , cb ) ;
2727 } ;
2828
2929 this . collapse = function ( )
@@ -34,8 +34,8 @@ cls.EventNamePrototype = function()
3434 } ;
3535} ;
3636
37- cls . EventNamePrototype . prototype = cls . EcmascriptDebugger [ "6.0" ] . InspectableDOMNode . prototype ;
38- cls . EventName . prototype = new cls . EventNamePrototype ( ) ;
37+ cls . EventTypePrototype . prototype = cls . EcmascriptDebugger [ "6.0" ] . InspectableDOMNode . prototype ;
38+ cls . EventType . prototype = new cls . EventTypePrototype ( ) ;
3939
4040cls . RTListUpdateCTX = function ( rt_id_list , cb )
4141{
@@ -44,10 +44,10 @@ cls.RTListUpdateCTX = function(rt_id_list, cb)
4444
4545cls . RTListUpdateCTX . prototype = new function ( )
4646{
47- this . _handle_expand_listener = function ( ev_name_obj )
47+ this . _handle_expand_listener = function ( ev_type )
4848 {
49- var list = this . expanded_map [ ev_name_obj . rt_id ] ;
50- var index = list . indexOf ( ev_name_obj . name ) ;
49+ var list = this . expanded_map [ ev_type . rt_id ] ;
50+ var index = list . indexOf ( ev_type . type ) ;
5151 if ( index > - 1 )
5252 list . splice ( index , 1 ) ;
5353 else
@@ -61,7 +61,7 @@ cls.RTListUpdateCTX.prototype = new function()
6161 {
6262 return this . rt_map . hasOwnProperty ( rt_id ) &&
6363 ( ! this . rt_map [ rt_id ] || ( this . expanded_map [ rt_id ] &&
64- this . expanded_map [ rt_id ] . length === 0 ) ) ;
64+ this . expanded_map [ rt_id ] . length === 0 ) ) ;
6565 } ;
6666
6767 this . check_is_updated = function ( )
@@ -94,9 +94,9 @@ cls.EvenetListeners.prototype = new function()
9494
9595 this . update = function ( ) { } ;
9696 this . get_data = function ( ) { } ;
97- this . expand_listeners = function ( rt_id , obj_id , ev_name , cb ) { } ;
98- this . collapse_listeners = function ( rt_id , ev_name ) { } ;
99- this . is_expanded = function ( rt_id , name ) { } ;
97+ this . expand_listeners = function ( rt_id , obj_id , type , cb ) { } ;
98+ this . collapse_listeners = function ( rt_id , type ) { } ;
99+ this . is_expanded = function ( rt_id , type ) { } ;
100100
101101 var SUCCESS = 0 ;
102102 var SEARCH_TYPE_EVENT = 5 ;
@@ -108,7 +108,7 @@ cls.EvenetListeners.prototype = new function()
108108
109109 this._rts = [{rt_id: <rt-id>,
110110 obj_id: <obj-id>,
111- event_names : [<EventName >, ...]}, ...]
111+ event_types : [<EventType >, ...]}, ...]
112112 */
113113
114114 this . _on_new_rts = function ( )
@@ -173,21 +173,21 @@ cls.EvenetListeners.prototype = new function()
173173 {
174174 this . _win_id_map [ rt_id ] = ctx . win_id_map [ rt_id ] = message [ OBJECT_VALUE ] [ OBJECT_ID ] ;
175175 if ( ctx . rt_id_list . every ( function ( rt_id ) { return ctx . win_id_map [ rt_id ] ; } ) )
176- ctx . rt_id_list . map ( this . _get_event_names . bind ( this , ctx ) ) ;
176+ ctx . rt_id_list . map ( this . _get_event_types . bind ( this , ctx ) ) ;
177177 }
178178 else
179179 opera . postError ( ui_strings . S_DRAGONFLY_INFO_MESSAGE +
180180 "failed to get the window object in cls.EvenetListeners." )
181181 } ;
182182
183- this . _get_event_names = function ( ctx , rt_id )
183+ this . _get_event_types = function ( ctx , rt_id )
184184 {
185- var tag = this . _tagman . set_callback ( this , this . _handle_get_event_names , [ ctx ] ) ;
185+ var tag = this . _tagman . set_callback ( this , this . _handle_get_event_types , [ ctx ] ) ;
186186 var msg = [ rt_id ] ;
187187 this . _esdb . requestGetEventNames ( tag , msg ) ;
188188 } ;
189189
190- this . _handle_get_event_names = function ( status , message , ctx )
190+ this . _handle_get_event_types = function ( status , message , ctx )
191191 {
192192 if ( status === SUCCESS )
193193 {
@@ -203,22 +203,21 @@ cls.EvenetListeners.prototype = new function()
203203 ctx . expanded_map [ rt_id ] = [ ] ;
204204 if ( ev_list && ev_list . length )
205205 {
206- rt_listeners . event_names = ev_list . map ( function ( name )
206+ rt_listeners . event_types = ev_list . map ( function ( type )
207207 {
208- var ev_n_obj = new cls . EventName ( name ) ;
209- if ( this . is_expanded ( rt_id , name ) )
208+ var ev_type = new cls . EventType ( type ) ;
209+ if ( this . is_expanded ( rt_id , type ) )
210210 {
211- ctx . expanded_map [ rt_id ] . push ( name ) ;
212- var search_cb = this . _handle_dom_search . bind ( this ,
213- ev_n_obj ,
214- ctx . handle_expand_listener ) ;
215- ev_n_obj . search_dom ( rt_id , obj_id , name , search_cb ) ;
211+ ctx . expanded_map [ rt_id ] . push ( type ) ;
212+ var cb = this . _handle_dom_search . bind ( this , ev_type ,
213+ ctx . handle_expand_listener ) ;
214+ ev_type . search_listeners ( rt_id , obj_id , type , cb ) ;
216215 }
217- return ev_n_obj ;
216+ return ev_type ;
218217 } , this ) ;
219218 }
220219 else
221- rt_listeners . event_names = [ ] ;
220+ rt_listeners . event_types = [ ] ;
222221
223222 ctx . rt_map [ rt_id ] = rt_listeners ;
224223 ctx . check_is_updated ( ) ;
@@ -228,34 +227,34 @@ cls.EvenetListeners.prototype = new function()
228227 "failed to retrieve the event names in cls.EvenetListeners." )
229228 } ;
230229
231- this . _handle_dom_search = function ( ev_name_obj , cb )
230+ this . _handle_dom_search = function ( ev_type , cb )
232231 {
233- var tag = this . _tagman . set_callback ( this , this . _handle_obj_search , [ ev_name_obj , cb ] ) ;
234- var msg = [ ev_name_obj . rt_id , [ this . _win_id_map [ ev_name_obj . rt_id ] ] ] ;
232+ var tag = this . _tagman . set_callback ( this , this . _handle_obj_search , [ ev_type , cb ] ) ;
233+ var msg = [ ev_type . rt_id , [ this . _win_id_map [ ev_type . rt_id ] ] ] ;
235234 this . _esdb . requestGetEventListeners ( tag , msg ) ;
236235 } ;
237236
238- this . _handle_obj_search = function ( status , message , ev_name_obj , cb )
237+ this . _handle_obj_search = function ( status , message , ev_type , cb )
239238 {
240239 if ( status === SUCCESS )
241240 {
242241 var TARGET_LIST = 1 ;
243242 var OBJECT_ID = 0 ;
244243 var EVENT_LISTENERS = 1 ;
245244 var ev_target = message [ TARGET_LIST ] && message [ TARGET_LIST ] [ 0 ] ;
246- ev_name_obj . window_listeners = ev_target
247- ? { win_id : ev_target [ OBJECT_ID ] ,
248- listeners : ev_target [ EVENT_LISTENERS ] }
249- : null ;
250- ev_name_obj . is_expanded = true ;
245+ ev_type . window_listeners = ev_target
246+ ? { win_id : ev_target [ OBJECT_ID ] ,
247+ listeners : ev_target [ EVENT_LISTENERS ] }
248+ : null ;
249+ ev_type . is_expanded = true ;
251250
252- if ( ! this . _expand_tree [ ev_name_obj . rt_id ] )
253- this . _expand_tree [ ev_name_obj . rt_id ] = { } ;
251+ if ( ! this . _expand_tree [ ev_type . rt_id ] )
252+ this . _expand_tree [ ev_type . rt_id ] = { } ;
254253
255- this . _expand_tree [ ev_name_obj . rt_id ] [ ev_name_obj . name ] = true ;
254+ this . _expand_tree [ ev_type . rt_id ] [ ev_type . type ] = true ;
256255
257256 if ( cb )
258- cb ( ev_name_obj ) ;
257+ cb ( ev_type ) ;
259258 else
260259 this . _view . update ( ) ;
261260
@@ -265,15 +264,15 @@ cls.EvenetListeners.prototype = new function()
265264 "requestGetEventListeners failed in cls.EvenetListeners." )
266265 } ;
267266
268- this . _get_ev_name_obj = function ( rt_id , ev_name )
267+ this . _get_ev_type = function ( rt_id , type )
269268 {
270269 var rt = this . _get_rt ( rt_id ) ;
271270 if ( rt )
272271 {
273- for ( var i = 0 , ev_n ; ev_n = rt . event_names [ i ] ; i ++ )
272+ for ( var i = 0 , ev_type ; ev_type = rt . event_types [ i ] ; i ++ )
274273 {
275- if ( ev_n . name == ev_name )
276- return ev_n ;
274+ if ( ev_type . type == type )
275+ return ev_type ;
277276 }
278277 }
279278 return null ;
@@ -318,35 +317,35 @@ cls.EvenetListeners.prototype = new function()
318317 return null ;
319318 } ;
320319
321- this . expand_listeners = function ( rt_id , obj_id , ev_name , cb )
320+ this . expand_listeners = function ( rt_id , obj_id , type , cb )
322321 {
323- var ev_n_obj = this . _get_ev_name_obj ( rt_id , ev_name ) ;
324- if ( ev_n_obj )
322+ var ev_type = this . _get_ev_type ( rt_id , type ) ;
323+ if ( ev_type )
325324 {
326- var search_cb = this . _handle_dom_search . bind ( this , ev_n_obj , cb ) ;
327- ev_n_obj . search_dom ( rt_id , obj_id , ev_name , search_cb ) ;
325+ var cb = this . _handle_dom_search . bind ( this , ev_type , cb ) ;
326+ ev_type . search_listeners ( rt_id , obj_id , type , cb ) ;
328327 }
329328 else
330329 opera . postError ( ui_strings . S_DRAGONFLY_INFO_MESSAGE +
331330 "failed to find event names object in cls.EvenetListeners." )
332331
333332 } ;
334333
335- this . collapse_listeners = function ( rt_id , ev_name )
334+ this . collapse_listeners = function ( rt_id , type )
336335 {
337- var ev_n_obj = this . _get_ev_name_obj ( rt_id , ev_name ) ;
338- if ( ev_n_obj )
336+ var ev_type = this . _get_ev_type ( rt_id , type ) ;
337+ if ( ev_type )
339338 {
340- ev_n_obj . collapse ( ) ;
339+ ev_type . collapse ( ) ;
341340 if ( this . _expand_tree [ rt_id ] )
342- this . _expand_tree [ rt_id ] [ ev_name ] = false ;
341+ this . _expand_tree [ rt_id ] [ type ] = false ;
343342 }
344343 } ;
345344
346- this . is_expanded = function ( rt_id , name )
345+ this . is_expanded = function ( rt_id , type )
347346 {
348347 return this . _expand_tree [ rt_id ]
349- ? Boolean ( this . _expand_tree [ rt_id ] [ name ] )
348+ ? Boolean ( this . _expand_tree [ rt_id ] [ type ] )
350349 : false ;
351350 } ;
352351
0 commit comments