@@ -3,42 +3,42 @@ function SeleniumIDEGenericAutoCompleteSearch() {
3
3
}
4
4
5
5
SeleniumIDEGenericAutoCompleteSearch . prototype = {
6
- startSearch : function ( searchString , searchParam , prevResult , listener ) {
7
- var result = new AutoCompleteResult ( searchString , this . candidates [ searchParam ] || [ ] ) ;
8
- listener . onSearchResult ( this , result ) ;
9
- } ,
10
-
11
- stopSearch : function ( ) {
12
- } ,
13
-
14
- setCandidates : function ( key , values ) {
15
- this . setCandidatesWithComments ( key , values , null ) ;
16
- } ,
17
-
18
- setCandidatesWithComments : function ( key , values , comments ) {
19
- var count = values . Count ( ) ;
20
- var candidates = this . candidates [ key ] = new Array ( count ) ;
21
- for ( var i = 0 ; i < count ; i ++ ) {
22
- candidates [ i ] = [ values . GetElementAt ( i ) . QueryInterface ( Components . interfaces . nsISupportsString ) . data ,
23
- comments ? comments . GetElementAt ( i ) . QueryInterface ( Components . interfaces . nsISupportsString ) . data : null ] ;
24
- }
25
- } ,
26
-
27
- clearCandidates : function ( key ) {
28
- if ( this . candidates [ key ] ) {
29
- delete this . candidates [ key ] ;
30
- }
31
- } ,
6
+ startSearch : function ( searchString , searchParam , prevResult , listener ) {
7
+ var result = new AutoCompleteResult ( searchString , this . candidates [ searchParam ] || [ ] ) ;
8
+ listener . onSearchResult ( this , result ) ;
9
+ } ,
10
+
11
+ stopSearch : function ( ) {
12
+ } ,
13
+
14
+ setCandidates : function ( key , values ) {
15
+ this . setCandidatesWithComments ( key , values , null ) ;
16
+ } ,
17
+
18
+ setCandidatesWithComments : function ( key , values , comments ) {
19
+ var count = values . Count ( ) ;
20
+ var candidates = this . candidates [ key ] = new Array ( count ) ;
21
+ for ( var i = 0 ; i < count ; i ++ ) {
22
+ candidates [ i ] = [ values . GetElementAt ( i ) . QueryInterface ( Components . interfaces . nsISupportsString ) . data ,
23
+ comments ? comments . GetElementAt ( i ) . QueryInterface ( Components . interfaces . nsISupportsString ) . data : null ] ;
24
+ }
25
+ } ,
26
+
27
+ clearCandidates : function ( key ) {
28
+ if ( this . candidates [ key ] ) {
29
+ delete this . candidates [ key ] ;
30
+ }
31
+ } ,
32
32
33
- QueryInterface : function ( uuid ) {
34
- if ( uuid . equals ( Components . interfaces . nsISeleniumIDEGenericAutoCompleteSearch ) ||
35
- uuid . equals ( Components . interfaces . nsIAutoCompleteSearch ) ||
36
- uuid . equals ( Components . interfaces . nsISupports ) ) {
37
- return this ;
38
- }
39
- Components . returnCode = Components . results . NS_ERROR_NO_INTERFACE ;
40
- return null ;
33
+ QueryInterface : function ( uuid ) {
34
+ if ( uuid . equals ( Components . interfaces . nsISeleniumIDEGenericAutoCompleteSearch ) ||
35
+ uuid . equals ( Components . interfaces . nsIAutoCompleteSearch ) ||
36
+ uuid . equals ( Components . interfaces . nsISupports ) ) {
37
+ return this ;
41
38
}
39
+ Components . returnCode = Components . results . NS_ERROR_NO_INTERFACE ;
40
+ return null ;
41
+ }
42
42
} ;
43
43
44
44
function AutoCompleteResult ( search , candidates ) {
@@ -70,49 +70,53 @@ function AutoCompleteResult(search, candidates) {
70
70
}
71
71
72
72
AutoCompleteResult . prototype = {
73
- get defaultIndex ( ) {
74
- return 0 ;
75
- } ,
76
- get errorDescription ( ) {
77
- return '' ;
78
- } ,
79
- get matchCount ( ) {
80
- return this . result . length ;
81
- } ,
82
- get searchResult ( ) {
83
- return Components . interfaces . nsIAutoCompleteResult . RESULT_SUCCESS ;
84
- } ,
85
- get searchString ( ) {
86
- return this . search ;
87
- } ,
88
- getCommentAt : function ( index ) {
89
- return this . result [ index ] [ 1 ] || '' ;
90
- } ,
91
- getStyleAt : function ( index ) {
92
- return '' ;
93
- } ,
94
- getValueAt : function ( index ) {
95
- return this . result [ index ] [ 0 ] ;
96
- } ,
97
- getImageAt : function ( index ) {
98
- return '' ;
99
- } ,
100
- getLabelAt : function getLabelAt ( index ) {
101
- return this . getValueAt ( index ) ;
102
- } ,
103
- getFinalCompleteValueAt : function ( index ) {
104
- return this . getValueAt ( index ) ;
105
- } ,
106
- removeValueAt : function ( rowIndex , removeFromDb ) {
107
- } ,
108
- QueryInterface : function ( uuid ) {
109
- if ( uuid . equals ( Components . interfaces . nsIAutoCompleteResult ) ||
110
- uuid . equals ( Components . interfaces . nsISupports ) ) {
111
- return this ;
112
- }
113
- Components . returnCode = Components . results . NS_ERROR_NO_INTERFACE ;
114
- return null ;
73
+ get searchString ( ) {
74
+ return this . search ;
75
+ } ,
76
+ get searchResult ( ) {
77
+ return Components . interfaces . nsIAutoCompleteResult . RESULT_SUCCESS ;
78
+ } ,
79
+ get defaultIndex ( ) {
80
+ return 0 ;
81
+ } ,
82
+ get errorDescription ( ) {
83
+ return '' ;
84
+ } ,
85
+ get matchCount ( ) {
86
+ return this . result . length ;
87
+ } ,
88
+ get typeAheadResult ( ) {
89
+ return false ;
90
+ } ,
91
+ getValueAt : function ( index ) {
92
+ return this . result [ index ] [ 0 ] ;
93
+ } ,
94
+ getLabelAt : function ( index ) {
95
+ return this . getValueAt ( index ) ;
96
+ } ,
97
+ getCommentAt : function ( index ) {
98
+ return this . result [ index ] [ 1 ] || '' ;
99
+ } ,
100
+ getStyleAt : function ( index ) {
101
+ // TODO improve this proof of concept with an optimised version for multiple deprecated commands
102
+ return this . result [ index ] [ 0 ] === "verifyTextPresent" ? 'deprecated' : '' ;
103
+ } ,
104
+ getImageAt : function ( index ) {
105
+ return '' ;
106
+ } ,
107
+ getFinalCompleteValueAt : function ( index ) {
108
+ return this . getValueAt ( index ) ;
109
+ } ,
110
+ removeValueAt : function ( rowIndex , removeFromDb ) {
111
+ } ,
112
+ QueryInterface : function ( uuid ) {
113
+ if ( uuid . equals ( Components . interfaces . nsIAutoCompleteResult ) ||
114
+ uuid . equals ( Components . interfaces . nsISupports ) ) {
115
+ return this ;
115
116
}
117
+ Components . returnCode = Components . results . NS_ERROR_NO_INTERFACE ;
118
+ return null ;
119
+ }
116
120
} ;
117
121
118
122
//const COMPONENT_ID = Components.ID("{4791AF5F-AFBA-45A1-8204-47A135DF9591}");
0 commit comments