@@ -4,32 +4,25 @@ How to use me?
4
4
Then go on About RES -> wikiCheck and push the button!
5
5
This will check the wiki and list all undocumented options.
6
6
*/
7
- modules [ 'wikiCheck' ] = {
8
- moduleID : 'wikiCheck' ,
9
- moduleName : 'Wiki Check' ,
10
- category : 'About RES' ,
11
- options : {
7
+ addModule ( 'wikiCheck' , function ( module , moduleID ) {
8
+ module . moduleName = 'Wiki Check' ;
9
+ module . category = 'About RES' ;
10
+ module . description = 'Check if all options are listed on the wiki.' ;
11
+ module . options = {
12
12
check : {
13
13
type : 'button' ,
14
14
text : 'Check' ,
15
- callback : null ,
15
+ callback : check ,
16
16
description : 'Launch the test (open the dev console !).'
17
17
}
18
- } ,
19
- description : 'Check if all options are listed on the wiki.' ,
20
- isEnabled : function ( ) {
21
- return RESUtils . options . getModulePrefs ( this . moduleID ) ;
22
- } ,
23
- isMatchURL : function ( ) {
18
+ } ;
19
+ module . isMatchURL = function ( ) {
24
20
return false ;
25
- } ,
26
- go : function ( ) {
27
- this . options [ 'check' ] . callback = this . check ;
28
- } ,
29
- check : function ( ) {
30
- modules [ 'wikiCheck' ] . fetchPages ( ) ;
31
- } ,
32
- fetchPages : function ( ) {
21
+ } ;
22
+ function check ( ) {
23
+ fetchPages ( ) ;
24
+ }
25
+ function fetchPages ( ) {
33
26
console . group ( 'Fetching wiki pages' ) ;
34
27
$ . getJSON ( 'http://api.reddit.com/r/Enhancement/wiki/pages/' , function ( data ) {
35
28
console . log ( 'Wiki page list fetched' ) ;
@@ -47,15 +40,15 @@ modules['wikiCheck'] = {
47
40
fetchedPages ++ ;
48
41
console . log ( fetchedPages + '/' + wikiPages . length ) ;
49
42
if ( fetchedPages === wikiPages . length ) {
50
- modules [ 'wikiCheck' ] . fetchOptions ( optionsList ) ;
43
+ fetchOptions ( optionsList ) ;
51
44
console . groupEnd ( ) ;
52
45
}
53
46
} ) ;
54
47
} , i * 1000 , wikiPage ) ;
55
48
} ) ;
56
49
} ) ;
57
- } ,
58
- fetchOptions : function ( optionsList ) {
50
+ }
51
+ function fetchOptions ( optionsList ) {
59
52
var missingOptions = [ ] ;
60
53
for ( var m in modules ) {
61
54
if ( ! m . hidden ) {
@@ -84,4 +77,4 @@ modules['wikiCheck'] = {
84
77
console . groupEnd ( ) ;
85
78
}
86
79
}
87
- } ;
80
+ } ) ;
0 commit comments