Index: trunk/extensions/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -8,6 +8,24 @@ |
9 | 9 | |
10 | 10 | class ClickTrackingHooks { |
11 | 11 | |
| 12 | + /* Protected Static Members */ |
| 13 | + |
| 14 | + protected static $modules = array( |
| 15 | + 'jquery.clickTracking' => array( |
| 16 | + 'scripts' => 'jquery.clickTracking.js', |
| 17 | + 'dependencies' => 'jquery.cookie', |
| 18 | + ), |
| 19 | + 'ext.clickTracking' => array( |
| 20 | + 'scripts' => 'ext.clickTracking.js', |
| 21 | + 'dependencies' => 'jquery.clickTracking', |
| 22 | + ), |
| 23 | + 'ext.clickTracking.special' => array( |
| 24 | + 'scripts' => 'ext.clickTracking.special.js', |
| 25 | + 'styles' => 'ext.clickTracking.special.css', |
| 26 | + 'dependencies' => array( 'jquery.ui.datepicker', 'jquery.ui.dialog' ), |
| 27 | + ), |
| 28 | + ); |
| 29 | + |
12 | 30 | /* Static Methods */ |
13 | 31 | |
14 | 32 | /** |
— | — | @@ -86,21 +104,11 @@ |
87 | 105 | global $wgExtensionAssetsPath; |
88 | 106 | $localpath = dirname( __FILE__ ) . '/modules'; |
89 | 107 | $remotepath = "$wgExtensionAssetsPath/extensions/ClickTracking/modules"; |
90 | | - $resourceLoader->register( new ResourceLoaderFileModule( array( |
91 | | - 'jquery.clickTracking' => new ResourceLoaderFileModule( array( |
92 | | - 'scripts' => 'jquery.clickTracking.js', |
93 | | - 'dependencies' => 'jquery.cookie', |
94 | | - ) ), |
95 | | - 'ext.clickTracking' => new ResourceLoaderFileModule( array( |
96 | | - 'scripts' => 'ext.clickTracking.js', |
97 | | - 'dependencies' => 'jquery.clickTracking', |
98 | | - ) ), |
99 | | - 'ext.clickTracking.special' => new ResourceLoaderFileModule( array( |
100 | | - 'scripts' => 'ext.clickTracking.special.js', |
101 | | - 'styles' => 'ext.clickTracking.special.css', |
102 | | - 'dependencies' => array( 'jquery.ui.datepicker', 'jquery.ui.dialog' ), |
103 | | - ) ), |
104 | | - ), $localpath, $remotepath ) ); |
| 108 | + foreach ( self::$modules as $name => $module ) { |
| 109 | + $resourceLoader->register( |
| 110 | + $name, new ResourceLoaderFileModule( $module, $localpath, $remotepath ) |
| 111 | + ); |
| 112 | + } |
105 | 113 | return true; |
106 | 114 | } |
107 | 115 | |