@@ -51,81 +51,84 @@ cls.ReturnValuesView = function(id, name, container_class)
5151 {
5252 return (
5353 [ "div" ,
54- "No return values" ,
54+ ui_strings . M_VIEW_LABEL_NO_RETURN_VALUES ,
5555 "class" , "not-content inspection"
5656 ]
5757 ) ;
5858 } ;
5959
60- this . onbeforesearch = function ( msg )
60+ this . _onbeforesearch = function ( msg )
6161 {
6262 if ( this . _create_view_bound && this . isvisible ( ) )
6363 {
6464 this . _search_term = msg . search_term ;
6565 this . _create_view_bound ( ) ;
6666 }
67- } . bind ( this ) ;
67+ } ;
68+
69+ this . _on_view_created = function ( msg )
70+ {
71+ if ( msg . id == "return-values" )
72+ {
73+ this . _text_search . setContainer ( msg . container ) ;
74+ this . _text_search . setFormInput ( window . views [ this . id ] . getToolbarControl ( msg . container ,
75+ "return-values-text-search" ) ) ;
76+ }
77+ } ;
78+
79+ this . _on_view_destroyed = function ( msg )
80+ {
81+ if ( msg . id == "return-values" )
82+ this . _text_search . cleanup ( ) ;
83+ } ;
6884
6985 this . _init = function ( id , name , container_class )
7086 {
7187 View . prototype . init . call ( this , id , name , container_class ) ;
7288 this . required_services = [ "ecmascript-debugger" ] ;
7389 this . _container = null ;
74- this . _models = [ ] ;
7590 this . _search_term = "" ;
91+
92+ this . _text_search = new TextSearch ( 1 ) ;
93+ this . _text_search . add_listener ( "onbeforesearch" , this . _onbeforesearch . bind ( this ) ) ;
94+
95+ window . messages . addListener ( "view-created" , this . _on_view_created . bind ( this ) ) ;
96+ window . messages . addListener ( "view-destroyed" , this . _on_view_destroyed . bind ( this ) ) ;
97+
98+ window . event_handlers . input [ "return-values-text-search" ] = function ( event , target )
99+ {
100+ this . _text_search . searchDelayed ( target . value ) ;
101+ } . bind ( this ) ;
102+
103+ ActionBroker . get_instance ( )
104+ . get_global_handler ( )
105+ . register_shortcut_listener ( "return-values-text-search" ,
106+ cls . Helpers . shortcut_search_cb . bind ( this . _text_search ) ) ;
76107 } ;
77108
78109 this . _init ( id , name , container_class ) ;
79110} ;
80111
81112cls . ReturnValuesView . create_ui_widgets = function ( )
82113{
83- new ToolbarConfig
84- (
85- "return-values" ,
86- null ,
87- [
88- {
89- handler : "return-values-text-search" ,
90- shortcuts : "return-values-text-search" ,
91- title : ui_strings . S_INPUT_DEFAULT_TEXT_FILTER ,
92- label : ui_strings . S_INPUT_DEFAULT_TEXT_FILTER ,
93- type : "filter"
94- }
95- ]
96- ) ;
97-
98- var text_search = new TextSearch ( 1 ) ;
99- text_search . add_listener ( "onbeforesearch" ,
100- window . views [ "return-values" ] . onbeforesearch ) ;
101-
102- var on_view_created = function ( msg )
103- {
104- if ( msg . id == "return-values" )
105- {
106- text_search . setContainer ( msg . container ) ;
107- text_search . setFormInput ( views . inspection . getToolbarControl ( msg . container , "return-values-text-search" ) ) ;
108- }
109- } ;
110-
111- var on_view_destroyed = function ( msg )
112- {
113- if ( msg . id == "return-values" )
114+ new ToolbarConfig (
114115 {
115- text_search . cleanup ( ) ;
116+ view : "return-values" ,
117+ groups : [
118+ {
119+ type : UI . TYPE_INPUT ,
120+ items : [
121+ {
122+ handler : "return-values-text-search" ,
123+ shortcuts : "return-values-text-search" ,
124+ title : ui_strings . S_INPUT_DEFAULT_TEXT_FILTER ,
125+ label : ui_strings . S_INPUT_DEFAULT_TEXT_FILTER ,
126+ type : "filter"
127+ }
128+ ]
129+ }
130+ ]
116131 }
117- } ;
118-
119- messages . addListener ( "view-created" , on_view_created ) ;
120- messages . addListener ( "view-destroyed" , on_view_destroyed ) ;
121-
122- eventHandlers . input [ "return-values-text-search" ] = function ( event , target )
123- {
124- text_search . searchDelayed ( target . value ) ;
125- } ;
126-
127- ActionBroker . get_instance ( ) . get_global_handler ( )
128- . register_shortcut_listener ( "return-values-text-search" ,
129- cls . Helpers . shortcut_search_cb . bind ( text_search ) ) ;
132+ ) ;
130133} ;
131134
0 commit comments