jenkins-bot has submitted this change and it was merged.
Change subject: Housecleaning.
......................................................................
Housecleaning.
* Replace globRelative calls with hard-coded paths.
* Replace globals with context calls.
* Removed unused images.
Change-Id: Id49bbf565fd4ff59cbeeb9e16d3a7b0d10055cc2
---
M Experiments.hooks.php
M Experiments.php
D css/images/gray-bg.png
D css/images/green-checkmark.png
D css/images/icon-1-edit.png
D css/images/icon-10-edits.png
D css/images/icon-100-edits.png
D css/images/icon-25-edits.png
D css/images/icon-5-edits.png
D css/images/icon-50-edits.png
10 files changed, 11 insertions(+), 39 deletions(-)
Approvals:
Ori.livneh: Looks good to me, approved
Mattflaschen: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/Experiments.hooks.php b/Experiments.hooks.php
index f4cb45a..401b67a 100644
--- a/Experiments.hooks.php
+++ b/Experiments.hooks.php
@@ -11,25 +11,6 @@
public static $isWelcomeCreation = false;
/**
- * globRelative
- *
- * Searches for files matching pattern relative to the path of the
extension
- *
- * @param $pattern string glob pattern
- * @return array
- */
- public static function globRelative( $pattern ) {
- // Trim the slash after the directory as well.
- $dirlen = strlen( __DIR__ ) + 1;
- $matches = glob( __DIR__ . $pattern );
- foreach ( $matches as &$match ) {
- $match = substr( $match, $dirlen );
- }
- unset( $match );
- return $matches;
- }
-
- /**
* BeforePageDisplay hook
*
* Adds the modules to the page
@@ -39,9 +20,7 @@
* @return bool
*/
public static function onBeforePageDisplay( $out, $skin ) {
- $out->addModules( array (
- 'ext.Experiments.experiments'
- ) );
+ $out->addModules( 'ext.Experiments.openTask' );
return true;
}
@@ -54,10 +33,10 @@
* @return bool
*/
public static function onMakeGlobalVariablesScript( &$vars, $out ) {
- global $wgUser;
- if ( $wgUser->isLoggedIn() ) {
- $vars[ 'wgEditCount' ] = $wgUser->getEditCount();
- $vars[ 'wgUserId' ] = $wgUser->getId();
+ $user = $out->getUser();
+ if ( $user->isLoggedIn() ) {
+ $vars[ 'wgEditCount' ] = $user->getEditCount();
+ $vars[ 'wgUserId' ] = $user->getId();
}
if ( self::$isWelcomeCreation ) {
$vars[ 'wgIsWelcomeCreation' ] = true;
@@ -67,7 +46,7 @@
/**
* ResourceLoaderGetConfigVars hook
- * Sends down _static_ config vars to JavaScript
+ * Sends down static config vars to JavaScript
*
* @param $vars array
* @return bool
@@ -89,9 +68,7 @@
*/
public static function onUserCreateForm( &$template ) {
global $wgOut;
- $wgOut->addModules( array (
- 'ext.Experiments.acux'
- ) );
+ $wgOut->addModules( 'ext.Experiments.acux' );
return true;
}
@@ -102,8 +79,6 @@
*/
public static function onBeforeWelcomeCreation( &$welcomeCreationMsg,
&$injected_html ) {
self::$isWelcomeCreation = true;
-
return true;
}
-
}
diff --git a/Experiments.php b/Experiments.php
index 5d9df78..f42c274 100644
--- a/Experiments.php
+++ b/Experiments.php
@@ -41,20 +41,19 @@
);
$wgResourceModules[ 'ext.Experiments.lib' ] = array(
- 'scripts' => ExperimentsHooks::globRelative( '/lib/*.js' ),
+ 'scripts' => array( 'lib/jquery.stall.js', 'lib/e3.js' ),
'localBasePath' => __DIR__,
'dependencies' => array(
'jquery.cookie',
- 'jquery.json', // openTask.js uses $.toJSON
+ 'jquery.json',
'mediawiki.user',
'ext.UserBuckets',
),
'remoteExtPath' => 'E3Experiments'
);
-$wgResourceModules[ 'ext.Experiments.experiments' ] = array(
- 'scripts' => ExperimentsHooks::globRelative( '/experiments/*.js'
),
- 'styles' => ExperimentsHooks::globRelative( '/css/*.css' ),
+$wgResourceModules[ 'ext.Experiments.openTask' ] = array(
+ 'scripts' => 'experiments/openTask.js',
'localBasePath' => __DIR__,
'remoteExtPath' => 'E3Experiments',
'dependencies' => array(
@@ -68,8 +67,6 @@
)
);
-// Account Creation UX is only needed on UserCreateForm, hence
-// it's a separate module.
$wgResourceModules[ 'ext.Experiments.acux' ] = array(
'scripts' => 'experiments/acux/accountCreationUX.js',
'styles' => 'css/acux/acux.css',
diff --git a/css/images/gray-bg.png b/css/images/gray-bg.png
deleted file mode 100644
index d7e7f96..0000000
--- a/css/images/gray-bg.png
+++ /dev/null
Binary files differ
diff --git a/css/images/green-checkmark.png b/css/images/green-checkmark.png
deleted file mode 100644
index bf4c735..0000000
--- a/css/images/green-checkmark.png
+++ /dev/null
Binary files differ
diff --git a/css/images/icon-1-edit.png b/css/images/icon-1-edit.png
deleted file mode 100644
index 29de1fb..0000000
--- a/css/images/icon-1-edit.png
+++ /dev/null
Binary files differ
diff --git a/css/images/icon-10-edits.png b/css/images/icon-10-edits.png
deleted file mode 100644
index 3d733a2..0000000
--- a/css/images/icon-10-edits.png
+++ /dev/null
Binary files differ
diff --git a/css/images/icon-100-edits.png b/css/images/icon-100-edits.png
deleted file mode 100644
index 62cb656..0000000
--- a/css/images/icon-100-edits.png
+++ /dev/null
Binary files differ
diff --git a/css/images/icon-25-edits.png b/css/images/icon-25-edits.png
deleted file mode 100644
index 5ccc227..0000000
--- a/css/images/icon-25-edits.png
+++ /dev/null
Binary files differ
diff --git a/css/images/icon-5-edits.png b/css/images/icon-5-edits.png
deleted file mode 100644
index 7ed37f0..0000000
--- a/css/images/icon-5-edits.png
+++ /dev/null
Binary files differ
diff --git a/css/images/icon-50-edits.png b/css/images/icon-50-edits.png
deleted file mode 100644
index 926f0db..0000000
--- a/css/images/icon-50-edits.png
+++ /dev/null
Binary files differ
--
To view, visit https://gerrit.wikimedia.org/r/51339
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id49bbf565fd4ff59cbeeb9e16d3a7b0d10055cc2
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/E3Experiments
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits