[MediaWiki-commits] [Gerrit] Clean up RL module definitions. - change (mediawiki...TimedMediaHandler)

2014-01-17 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Clean up RL module definitions.
..


Clean up RL module definitions.

* Remove unneeded addModuleStyles(), it's redundant with addModule().
* Replace two array dependencies with their single contents.
* Use __DIR__ instead of dirname.
* Use + for concatenate $baseExtensionResource instead of array_merge().
* Improve a hook comment.

Related to bug 0 though this doesn't reduce amount of JS code loaded.

I couldn't get TMH to work on my wiki, so this is untested, but the modules
load without errors in 1.22.
TimedMediaHandler claims to work with MediaWiki 1.17, so some of these may
be intentional for backwards compatibility and the cleanup unwanted.

Change-Id: Ia7b465c2db154620585db481db88a4c88a002038
---
M TimedMediaHandler.hooks.php
M TimedMediaHandler_body.php
2 files changed, 17 insertions(+), 19 deletions(-)

Approvals:
  Brian Wolff: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index b43f1ce..2fac670 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -50,26 +50,26 @@
$wgJobTypesExcludedFromDefaultQueue[] = 'webVideoTranscode';
 
$baseExtensionResource = array(
-   'localBasePath' = dirname( __FILE__ ),
+   'localBasePath' = __DIR__,
'remoteExtPath' = 'TimedMediaHandler',
);
 
// Add the PopUpMediaTransform module ( specific to timedMedia 
handler ( no support in mwEmbed modules )
$wgResourceModules+= array(
-   'mw.PopUpMediaTransform' = array_merge( 
$baseExtensionResource, array(
+   'mw.PopUpMediaTransform' = $baseExtensionResource + 
array(
'scripts' = 'resources/mw.PopUpThumbVideo.js',
'styles' = 'resources/PopUpThumbVideo.css',
'dependencies' = array( 'mw.MwEmbedSupport', 
'mediawiki.Title' ),
-   ) ),
-   'mw.TMHGalleryHook.js' = array_merge( 
$baseExtensionResource, array(
+   ),
+   'mw.TMHGalleryHook.js' = $baseExtensionResource + 
array(
'scripts' = 'resources/mw.TMHGalleryHook.js',
// position top needed as it needs to load 
before mediawiki.page.gallery
'position' = 'top',
-   ) ),
-   'embedPlayerIframeStyle'= array_merge( 
$baseExtensionResource, array(
+   ),
+   'embedPlayerIframeStyle'= $baseExtensionResource + 
array(
'styles' = 'resources/embedPlayerIframe.css',
-   ) ),
-   'ext.tmh.transcodetable' = array_merge( 
$baseExtensionResource, array(
+   ),
+   'ext.tmh.transcodetable' = $baseExtensionResource + 
array(
'scripts' = 
'resources/ext.tmh.transcodetable.js',
'styles' = 'resources/transcodeTable.css',
'messages'= array(
@@ -79,15 +79,15 @@
'timedmedia-reset',
'timedmedia-reset-confirm'
)
-   ) ),
-   mw.MediaWikiPlayerSupport =  array_merge( 
$baseExtensionResource, array(
+   ),
+   mw.MediaWikiPlayerSupport =  $baseExtensionResource 
+ array(
'scripts' = 
'resources/mw.MediaWikiPlayerSupport.js',
-   'dependencies'= array( 'mw.Api' )
-   ) ),
+   'dependencies'= 'mw.Api',
+   ),
// adds support MediaWikiPlayerSupport player bindings
-   mw.MediaWikiPlayer.loader =  array_merge( 
$baseExtensionResource, array(
+   mw.MediaWikiPlayer.loader =  $baseExtensionResource 
+ array(
'loaderScripts' = 
'resources/mw.MediaWikiPlayer.loader.js',
-   ) ),
+   ),
);
// Setup a hook for iframe embed handling:
$wgHooks['ArticleFromTitle'][] = 
'TimedMediaIframeOutput::iframeHook';
@@ -318,7 +318,7 @@
 * @return bool
 */
public static function loadExtensionSchemaUpdates( $updater ){
-   $updater-addExtensionTable( 'transcode', dirname( __FILE__ ) . 
'/TimedMediaHandler.sql' );
+   $updater-addExtensionTable( 'transcode', __DIR__ . 
'/TimedMediaHandler.sql' );

[MediaWiki-commits] [Gerrit] Clean up RL module definitions. - change (mediawiki...TimedMediaHandler)

2013-10-26 Thread Spage (Code Review)
Spage has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/92052


Change subject: Clean up RL module definitions.
..

Clean up RL module definitions.

* Remove unneeded addModuleStyles(), it's redundant with addModule().
* Replace two array dependencies with their single contents.
* Use __DIR__ instead of dirname.
* Use + for concatenate $baseExtensionResource instead of array_merge().
* Improve a hook comment.

Related to bug 0 though this doesn't reduce amount of JS code loaded.

I couldn't get TMH to work on my wiki, so this is untested, but the modules
load without errors in 1.22.
TimedMediaHandler claims to work with MediaWiki 1.17, so some of these may
be intentional for backwards compatibility and the cleanup unwanted.

Change-Id: Ia7b465c2db154620585db481db88a4c88a002038
---
M TimedMediaHandler.hooks.php
M TimedMediaHandler_body.php
2 files changed, 18 insertions(+), 20 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/52/92052/1

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 0a41b97..b14f32a 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -51,26 +51,26 @@
$wgJobTypesExcludedFromDefaultQueue[] = 'webVideoTranscode';
 
$baseExtensionResource = array(
-   'localBasePath' = dirname( __FILE__ ),
+   'localBasePath' = __DIR__,
'remoteExtPath' = 'TimedMediaHandler',
);
 
// Add the PopUpMediaTransform module ( specific to timedMedia 
handler ( no support in mwEmbed modules )
$wgResourceModules+= array(
-   'mw.PopUpMediaTransform' = array_merge( 
$baseExtensionResource, array(
+   'mw.PopUpMediaTransform' = $baseExtensionResource + 
array(
'scripts' = 'resources/mw.PopUpThumbVideo.js',
'styles' = 'resources/PopUpThumbVideo.css',
-   'dependencies' = array( 'mw.MwEmbedSupport' ),
-   ) ),
-   'mw.TMHGalleryHook.js' = array_merge( 
$baseExtensionResource, array(
+   'dependencies' = 'mw.MwEmbedSupport',
+   ),
+   'mw.TMHGalleryHook.js' = $baseExtensionResource + 
array(
'scripts' = 'resources/mw.TMHGalleryHook.js',
// position top needed as it needs to load 
before mediawiki.page.gallery
'position' = 'top',
-   ) ),
-   'embedPlayerIframeStyle'= array_merge( 
$baseExtensionResource, array(
+   ),
+   'embedPlayerIframeStyle'= $baseExtensionResource + 
array(
'styles' = 'resources/embedPlayerIframe.css',
-   ) ),
-   'ext.tmh.transcodetable' = array_merge( 
$baseExtensionResource, array(
+   ),
+   'ext.tmh.transcodetable' = $baseExtensionResource + 
array(
'scripts' = 
'resources/ext.tmh.transcodetable.js',
'styles' = 'resources/transcodeTable.css',
'messages'= array(
@@ -80,15 +80,15 @@
'timedmedia-reset',
'timedmedia-reset-confirm'
)
-   ) ),
-   mw.MediaWikiPlayerSupport =  array_merge( 
$baseExtensionResource, array(
+   ),
+   mw.MediaWikiPlayerSupport =  $baseExtensionResource 
+ array(
'scripts' = 
'resources/mw.MediaWikiPlayerSupport.js',
-   'dependencies'= array( 'mw.Api' )
-   ) ),
+   'dependencies'= 'mw.Api',
+   ),
// adds support MediaWikiPlayerSupport player bindings
-   mw.MediaWikiPlayer.loader =  array_merge( 
$baseExtensionResource, array(
+   mw.MediaWikiPlayer.loader =  $baseExtensionResource 
+ array(
'loaderScripts' = 
'resources/mw.MediaWikiPlayer.loader.js',
-   ) ),
+   ),
);
// Setup a hook for iframe embed handling:
$wgHooks['ArticleFromTitle'][] = 
'TimedMediaIframeOutput::iframeHook';
@@ -319,7 +319,7 @@
 * @return bool
 */
public static function loadExtensionSchemaUpdates( $updater ){
-   $updater-addExtensionTable( 'transcode', dirname( __FILE__ ) . 
'/TimedMediaHandler.sql' );