r75940 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75939‎ | r75940 | r75941 >
Date:17:46, 3 November 2010
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Mostly reverts r75591, refactoring the way modules are being defined and registered.
Modified paths:
  • /trunk/extensions/ClickTracking/ClickTracking.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ClickTracking/ClickTracking.hooks.php
@@ -8,6 +8,24 @@
99
1010 class ClickTrackingHooks {
1111
 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+
1230 /* Static Methods */
1331
1432 /**
@@ -86,21 +104,11 @@
87105 global $wgExtensionAssetsPath;
88106 $localpath = dirname( __FILE__ ) . '/modules';
89107 $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+ }
105113 return true;
106114 }
107115

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75591Fix Maps breakage in r75587, and fix ClickTracking which apparently has been ...catrope23:00, 27 October 2010

Comments

#Comment by 😂 (talk | contribs)   17:53, 3 November 2010

Looks good

Status & tagging log