[MediaWiki-commits] [Gerrit] Set wgUploadNavigationUrl for eowiki to Commons - change (operations/mediawiki-config)

2014-08-16 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Set wgUploadNavigationUrl for eowiki to Commons
..

Set wgUploadNavigationUrl for eowiki to Commons

Bug: 69055
Change-Id: Iaf5971f4a1c763a9c2e146eb9eddc75f007ff0ae
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/48/154448/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 740d840..f735fa2 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -1150,6 +1150,7 @@
'enwikinews' => false,
'enwikiquote' => '//commons.wikimedia.org/wiki/Special:UploadWizard',
'enwikivoyage' => '//en.wikivoyage.org/wiki/Wikivoyage:Upload_file',
+   'eowiki' => 
'//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=eo', // bug 69055
'eswiki' => 
'//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=es',
'eswikibooks' => 
'//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=es',
'eswikivoyage' => 
'//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=es', // bug 42933

-- 
To view, visit https://gerrit.wikimedia.org/r/154448
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf5971f4a1c763a9c2e146eb9eddc75f007ff0ae
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] add object ExtSQI as a wrapper of SemanticQueryInterface ext... - change (mediawiki...PhpTagsSMW)

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

Change subject: add object ExtSQI as a wrapper of SemanticQueryInterface 
extension (v 1.1.0)
..


add object ExtSQI as a wrapper of SemanticQueryInterface extension (v 1.1.0)

Change-Id: Ia703b70cc30005ec74c4f9ac696bdc625d19e608
---
M PhpTagsSMW.init.php
M PhpTagsSMW.php
M i18n/en.json
M i18n/qqq.json
A includes/SMWExtSQI.php
5 files changed, 111 insertions(+), 4 deletions(-)

Approvals:
  Pastakhov: Looks good to me, but someone else must approve
  JoelKP: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/PhpTagsSMW.init.php b/PhpTagsSMW.init.php
index 3ee59e5..464d988 100644
--- a/PhpTagsSMW.init.php
+++ b/PhpTagsSMW.init.php
@@ -6,6 +6,7 @@
\PhpTags\Hooks::setObjects(
array(
'ExtArrays' => 'SMWExtArrays',
+   'ExtSQI' => 'SMWExtSQI',
)
);
return true;
diff --git a/PhpTagsSMW.php b/PhpTagsSMW.php
index 5d3aaa0..d338032 100644
--- a/PhpTagsSMW.php
+++ b/PhpTagsSMW.php
@@ -32,7 +32,7 @@
);
 }
 
-define( 'PHPTAGS_SMW_VERSION' , '1.0.1' );
+define( 'PHPTAGS_SMW_VERSION' , '1.1.0' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['phptagssmw'][] = array(
@@ -57,7 +57,8 @@
 // Preparing classes for autoloading
 $wgAutoloadClasses['PhpTagsSMWInit']   = __DIR__ . '/PhpTagsSMW.init.php';
 
-$wgAutoloadClasses['PhpTagsObjects\\SMWExtArrays'] = 
__DIR__ . '/includes/SMWExtArrays.php';
+$wgAutoloadClasses['PhpTagsObjects\\SMWExtArrays'] = __DIR__ . 
'/includes/SMWExtArrays.php';
+$wgAutoloadClasses['PhpTagsObjects\\SMWExtSQI']= __DIR__ . 
'/includes/SMWExtSQI.php';
 
 /**
  * Add files to phpunit test
diff --git a/i18n/en.json b/i18n/en.json
index f67e5d2..8ab7f9f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -5,5 +5,6 @@
]
},
"phptagssmw-desc": "Objects for 
[https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki Semantic 
MediaWiki]-related data access",
-   "phptagssmw-ext-arrays-not-installed": "Requires the 
[https://www.mediawiki.org/wiki/Extension:Arrays Arrays] extension, but it's 
not installed."
+   "phptagssmw-ext-arrays-not-installed": "Requires the 
[https://www.mediawiki.org/wiki/Extension:Arrays Arrays] extension, but it's 
not installed.",
+   "phptagssmw-ext-sqi-not-installed": "Requires the 
[https://www.mediawiki.org/wiki/User:Vedmaka/Semantic_Query_Interface Semantic 
Query Interface] extension, but it's not installed."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 9d72166..bd98ca2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -5,5 +5,6 @@
]
},
"phptagssmw-desc": "{{desc|name=PhpTags 
SMW|url=http://www.mediawiki.org/wiki/Extension:PhpTags_SMW}}";,
-   "phptagssmw-ext-arrays-not-installed": "Error message when trying to 
use functionality from the [https://www.mediawiki.org/wiki/Extension:Arrays 
Arrays] extension without it being installed."
+   "phptagssmw-ext-arrays-not-installed": "Error message when trying to 
use functionality from the [https://www.mediawiki.org/wiki/Extension:Arrays 
Arrays] extension without it being installed.",
+   "phptagssmw-ext-sqi-not-installed": "Error message when trying to use 
functionality from the 
[https://www.mediawiki.org/wiki/User:Vedmaka/Semantic_Query_Interface Semantic 
Query Interface] extension without it being installed."
 }
diff --git a/includes/SMWExtSQI.php b/includes/SMWExtSQI.php
new file mode 100644
index 000..f0265f0
--- /dev/null
+++ b/includes/SMWExtSQI.php
@@ -0,0 +1,103 @@
+text() );
+   }
+   $this->value = new \SQI\SemanticQueryInterface();
+   return true;
+   }
+
+   /**
+*
+* @return \SQI\SemanticQueryInterface
+*/
+   private function getSQI() {
+   return $this->value;
+   }
+
+   public function m_from( $page, $flatResult = false ) {
+   $this->getSQI()->from( $page, (bool)$flatResult );
+   return $this;
+   }
+
+   public function m_condition( $condition, $conditionValue = null ) {
+   $this->getSQI()->condition( $condition, $conditionValue );
+   return $this;
+   }
+
+   public function m_category( $category ) {
+   $this->getSQI()->category( $category );
+   return $this;
+   }
+
+   public function m_printout( $printout ) {
+   $this->getSQI()->printout( $printout );
+   return $this;
+   }
+
+   public function m_limit( $limit ) {
+   $this->getSQI()->limit( $limit );
+   return $this;
+   }
+
+   public function m_offset( $offset ) {
+   $this->getSQI()->o

[MediaWiki-commits] [Gerrit] Do not use VERP on group sending of Emails - change (mediawiki...BounceHandler)

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

Change subject: Do not use VERP on group sending of Emails
..


Do not use VERP on group sending of Emails

Generating unique return path for every single email in a $to array
can cause issues. Hence disabling the feature

Change-Id: I046440c1f95c409adb0dfc584adbddc66d18f1b1
---
M BounceHandlerHooks.php
1 file changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/BounceHandlerHooks.php b/BounceHandlerHooks.php
index cec0d1a..14c6605 100644
--- a/BounceHandlerHooks.php
+++ b/BounceHandlerHooks.php
@@ -16,9 +16,8 @@
if ( is_object( $recip ) ) {
self::generateVerp( $recip, $returnPath );
} else if ( is_array( $recip ) ){
-   foreach( $recip as $to ) {
-   self::generateVerp( $to, $returnPath );
-   }
+   // Generating VERP address for a batch of send emails 
is complex. This feature is hence disabled
+   return true;
} else {
throw new InvalidArgumentException( "Expected 
MailAddress object or an array of MailAddress, got $recip" );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/154446
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I046440c1f95c409adb0dfc584adbddc66d18f1b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BounceHandler
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas <01tonytho...@gmail.com>
Gerrit-Reviewer: Jgreen 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make it easier to subclass Content and ContentHandler subcla... - change (mediawiki/core)

2014-08-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Make it easier to subclass Content and ContentHandler subclasses
..

Make it easier to subclass Content and ContentHandler subclasses

Currently the names of associated Content classes are hardcoded,
meaning that any extension that wishes to subclass these implementations
must also re-implement that function, usually copying it exactly
with just the class name changed. Using "static" avoids that issue.

For ContentHandlers, I added a TextContentHandler::getContentClass,
which should be used when creating new Content objects.

Change-Id: I70f1a3291aec3460120ec20121a23f4cb68e04d1
---
M includes/content/CssContent.php
M includes/content/CssContentHandler.php
M includes/content/JSONContentHandler.php
M includes/content/JavaScriptContent.php
M includes/content/JavaScriptContentHandler.php
M includes/content/TextContentHandler.php
M includes/content/WikitextContent.php
M includes/content/WikitextContentHandler.php
8 files changed, 40 insertions(+), 83 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/154447/1

diff --git a/includes/content/CssContent.php b/includes/content/CssContent.php
index 2673084..7241458 100644
--- a/includes/content/CssContent.php
+++ b/includes/content/CssContent.php
@@ -58,7 +58,7 @@
$text = $this->getNativeData();
$pst = $wgParser->preSaveTransform( $text, $title, $user, 
$popts );
 
-   return new CssContent( $pst );
+   return new static( $pst );
}
 
/**
diff --git a/includes/content/CssContentHandler.php 
b/includes/content/CssContentHandler.php
index fd326f0..1ab4ee2 100644
--- a/includes/content/CssContentHandler.php
+++ b/includes/content/CssContentHandler.php
@@ -36,27 +36,8 @@
parent::__construct( $modelId, array( CONTENT_FORMAT_CSS ) );
}
 
-   /**
-* @param string $text
-* @param string $format
-*
-* @return CssContent
-*
-* @see ContentHandler::unserializeContent()
-*/
-   public function unserializeContent( $text, $format = null ) {
-   $this->checkFormat( $format );
-
-   return new CssContent( $text );
-   }
-
-   /**
-* @return CssContent A new CssContent object with empty text.
-*
-* @see ContentHandler::makeEmptyContent()
-*/
-   public function makeEmptyContent() {
-   return new CssContent( '' );
+   protected function getContentClass() {
+   return 'CssContent';
}
 
/**
diff --git a/includes/content/JSONContentHandler.php 
b/includes/content/JSONContentHandler.php
index 6b77527..33f2036 100644
--- a/includes/content/JSONContentHandler.php
+++ b/includes/content/JSONContentHandler.php
@@ -16,6 +16,8 @@
/**
 * The class name of objects that should be created
 *
+* @deprecated override getContentClass instead
+*
 * @var string
 */
protected $contentClass = 'JSONContent';
@@ -25,25 +27,13 @@
}
 
/**
-* Unserializes a JSONContent object.
+* Temporary back-compat until extensions
+* are updated to override this
 *
-* @param string $text Serialized form of the content
-* @param null|string $format The format used for serialization
-*
-* @return JSONContent
+* @return string
 */
-   public function unserializeContent( $text, $format = null ) {
-   $this->checkFormat( $format );
-   return new $this->contentClass( $text );
-   }
-
-   /**
-* Creates an empty JSONContent object.
-*
-* @return JSONContent
-*/
-   public function makeEmptyContent() {
-   return new $this->contentClass( '' );
+   protected function getContentClass() {
+   return $this->contentClass;
}
 
/**
diff --git a/includes/content/JavaScriptContent.php 
b/includes/content/JavaScriptContent.php
index 442b705..0991f07 100644
--- a/includes/content/JavaScriptContent.php
+++ b/includes/content/JavaScriptContent.php
@@ -57,7 +57,7 @@
$text = $this->getNativeData();
$pst = $wgParser->preSaveTransform( $text, $title, $user, 
$popts );
 
-   return new JavaScriptContent( $pst );
+   return new static( $pst );
}
 
/**
diff --git a/includes/content/JavaScriptContentHandler.php 
b/includes/content/JavaScriptContentHandler.php
index 122003f..8d62e2a 100644
--- a/includes/content/JavaScriptContentHandler.php
+++ b/includes/content/JavaScriptContentHandler.php
@@ -36,27 +36,8 @@
parent::__construct( $modelId, array( CONTENT_FORMAT_JAVASCRIPT 
) );
}
 
-   /**
-* @para

[MediaWiki-commits] [Gerrit] Do not use VERP on group sending of Emails - change (mediawiki...BounceHandler)

2014-08-16 Thread 01tonythomas (Code Review)
01tonythomas has uploaded a new change for review.

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

Change subject: Do not use VERP on group sending of Emails
..

Do not use VERP on group sending of Emails

Generating unique return path for every single email in a $to array
can cause issues. Hence disabling the feature

Change-Id: I046440c1f95c409adb0dfc584adbddc66d18f1b1
---
M BounceHandlerHooks.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler 
refs/changes/46/154446/1

diff --git a/BounceHandlerHooks.php b/BounceHandlerHooks.php
index cec0d1a..14c6605 100644
--- a/BounceHandlerHooks.php
+++ b/BounceHandlerHooks.php
@@ -16,9 +16,8 @@
if ( is_object( $recip ) ) {
self::generateVerp( $recip, $returnPath );
} else if ( is_array( $recip ) ){
-   foreach( $recip as $to ) {
-   self::generateVerp( $to, $returnPath );
-   }
+   // Generating VERP address for a batch of send emails 
is complex. This feature is hence disabled
+   return true;
} else {
throw new InvalidArgumentException( "Expected 
MailAddress object or an array of MailAddress, got $recip" );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/154446
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I046440c1f95c409adb0dfc584adbddc66d18f1b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BounceHandler
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas <01tonytho...@gmail.com>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Single generator search query for both results and thumb urls. - change (apps...wikipedia)

2014-08-16 Thread Mhurd (Code Review)
Mhurd has uploaded a new change for review.

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

Change subject: Single generator search query for both results and thumb urls.
..

Single generator search query for both results and thumb urls.

Faster thumbnail image display.

Fixes iOS 6 lockups when quickly typing search term.

Change-Id: If94d4008b84db0e650415ee902be1bdee94b4159
---
M Wikipedia.xcodeproj/project.pbxproj
M wikipedia/Data/Operations/SearchOp.m
D wikipedia/Data/Operations/SearchThumbUrlsOp.h
D wikipedia/Data/Operations/SearchThumbUrlsOp.m
M wikipedia/Defines/Defines.h
M wikipedia/View Controllers/SearchResults/SearchResultsController.m
M wikipedia/mw-network/MWNetworkOp.m
7 files changed, 181 insertions(+), 264 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/45/154445/1

diff --git a/Wikipedia.xcodeproj/project.pbxproj 
b/Wikipedia.xcodeproj/project.pbxproj
index c1bbcb4..49139c0 100644
--- a/Wikipedia.xcodeproj/project.pbxproj
+++ b/Wikipedia.xcodeproj/project.pbxproj
@@ -89,7 +89,6 @@
0493C2D619526FFE00EBB973 /* WikiFont-Glyphs-iOS.ttf in 
Resources */ = {isa = PBXBuildFile; fileRef = 0493C2D519526FFE00EBB973 /* 
WikiFont-Glyphs-iOS.ttf */; };
049566C218F5F4CB0058EA12 /* ZeroConfigState.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 049566C118F5F4CB0058EA12 /* ZeroConfigState.m 
*/; };
04992BC018B687AF00A6C22B /* SearchOp.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 04992BBF18B687AF00A6C22B /* SearchOp.m */; };
-   04992BC418B6971F00A6C22B /* SearchThumbUrlsOp.m in Sources */ = 
{isa = PBXBuildFile; fileRef = 04992BC318B6971F00A6C22B /* SearchThumbUrlsOp.m 
*/; };
049B640C18AAF36200D98BD4 /* 
UIViewController+SearchChildViewControllers.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 049B640B18AAF36200D98BD4 /* 
UIViewController+SearchChildViewControllers.m */; };
04A70FD7185BB6C300E24515 /* URLCache.m in Sources */ = {isa = 
PBXBuildFile; fileRef = 04A70FD6185BB6C300E24515 /* URLCache.m */; };
04A81E8618871EB000EEBADB /* Section+ImageRecords.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = 04A81E8518871EB000EEBADB /* 
Section+ImageRecords.m */; };
@@ -346,8 +345,6 @@
049566C118F5F4CB0058EA12 /* ZeroConfigState.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= ZeroConfigState.m; sourceTree = ""; };
04992BBE18B687AF00A6C22B /* SearchOp.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SearchOp.h; sourceTree = ""; };
04992BBF18B687AF00A6C22B /* SearchOp.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SearchOp.m; sourceTree = ""; };
-   04992BC218B6971F00A6C22B /* SearchThumbUrlsOp.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SearchThumbUrlsOp.h; sourceTree = ""; };
-   04992BC318B6971F00A6C22B /* SearchThumbUrlsOp.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SearchThumbUrlsOp.m; sourceTree = ""; };
049B640A18AAF36200D98BD4 /* 
UIViewController+SearchChildViewControllers.h */ = {isa = PBXFileReference; 
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
"UIViewController+SearchChildViewControllers.h"; sourceTree = ""; };
049B640B18AAF36200D98BD4 /* 
UIViewController+SearchChildViewControllers.m */ = {isa = PBXFileReference; 
fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = 
"UIViewController+SearchChildViewControllers.m"; sourceTree = ""; };
04A70FD5185BB6C300E24515 /* URLCache.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
URLCache.h; sourceTree = ""; };
@@ -1326,8 +1323,6 @@
04DB0BE518BC2E1E00B4BCF3 /* CaptchaResetOp.m */,
04992BBE18B687AF00A6C22B /* SearchOp.h */,
04992BBF18B687AF00A6C22B /* SearchOp.m */,
-   04992BC218B6971F00A6C22B /* SearchThumbUrlsOp.h 
*/,
-   04992BC318B6971F00A6C22B /* SearchThumbUrlsOp.m 
*/,
04B78A5118A580AF0050EBF5 /* LoginOp.h */,
04B78A5218A580AF0050EBF5 /* LoginOp.m */,
04735E5E18A5B42D00C89C30 /* LoginTokenOp.h */,
@@ -1866,7 +1861,6 @@
D474CC15182AE196002BDE45 /* MWSite.m in Sources 
*/,
0463639818A844570049EE4F /* 
KeychainCredentials.m in Sources */,
047528AF19107DAA00F2CDA8 /* Section.m in 
Sources */,
-   04992BC418B6971F00A6C22B /* SearchTh

[MediaWiki-commits] [Gerrit] Normalize the user name given to Special:GlobalRenameProgress - change (mediawiki...CentralAuth)

2014-08-16 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Normalize the user name given to Special:GlobalRenameProgress
..

Normalize the user name given to Special:GlobalRenameProgress

This doesn't matter for log entries as those use Title mechanisms
to normalize, but it matters while the rename is in progress (as
GlobalRenameUserStatus doesn't do normalization).

Change-Id: If01b79a90e386bfcf567c71e2b1b514bebeebfb7
---
M specials/SpecialGlobalRenameProgress.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/44/15/1

diff --git a/specials/SpecialGlobalRenameProgress.php 
b/specials/SpecialGlobalRenameProgress.php
index ebf1bab..cd52f8f 100644
--- a/specials/SpecialGlobalRenameProgress.php
+++ b/specials/SpecialGlobalRenameProgress.php
@@ -38,7 +38,7 @@
}
 
function onSubmit( array $data ) {
-   $name = $data['username'];
+   $name = User::getCanonicalName( $data['username'], 'usable' );
if ( !$name ) {
return false;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/15
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If01b79a90e386bfcf567c71e2b1b514bebeebfb7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Hoo man 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Pass normalized username to GlobalRenameUserStatus - change (mediawiki...CentralAuth)

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

Change subject: Pass normalized username to GlobalRenameUserStatus
..


Pass normalized username to GlobalRenameUserStatus

We were directly taking the special page input which
means it wasn't normalized.

Change-Id: I5b75ecb41e8697f975963729df463225212a54f6
---
M specials/SpecialGlobalRenameUser.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Hoo man: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/specials/SpecialGlobalRenameUser.php 
b/specials/SpecialGlobalRenameUser.php
index c826312..4c2878d 100644
--- a/specials/SpecialGlobalRenameUser.php
+++ b/specials/SpecialGlobalRenameUser.php
@@ -118,7 +118,7 @@
CentralAuthUser::getInstance( $oldUser ),
$newUser,
CentralAuthUser::getInstance( $newUser ),
-   new GlobalRenameUserStatus( $this->newUsername ),
+   new GlobalRenameUserStatus( $newUser->getName() ),
'JobQueueGroup::singleton',
new GlobalRenameUserDatabaseUpdates(),
new GlobalRenameUserLogger( $this->getUser() )

-- 
To view, visit https://gerrit.wikimedia.org/r/154435
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b75ecb41e8697f975963729df463225212a54f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: CSteipp 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Wrap CentralAuthUser::attach in an explicit transaction - change (mediawiki...CentralAuth)

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

Change subject: Wrap CentralAuthUser::attach in an explicit transaction
..


Wrap CentralAuthUser::attach in an explicit transaction

Change-Id: I715c3e2b77ba28efc36a375ee214021f1334a1d1
---
M CentralAuthUser.php
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Hoo man: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CentralAuthUser.php b/CentralAuthUser.php
index 7c14fa8..0d4d395 100644
--- a/CentralAuthUser.php
+++ b/CentralAuthUser.php
@@ -1408,6 +1408,7 @@
 */
public function attach( $wikiID, $method = 'new', $sendToRC = true ) {
$dbw = self::getCentralDB();
+   $dbw->begin( __METHOD__ );
$dbw->insert( 'localuser',
array(
'lu_wiki'   => $wikiID,
@@ -1418,6 +1419,7 @@
array( 'IGNORE' )
);
$success = $dbw->affectedRows() === 1;
+   $dbw->commit( __METHOD__ );
 
if ( $wikiID === wfWikiID() ) {
$this->resetState();

-- 
To view, visit https://gerrit.wikimedia.org/r/154443
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I715c3e2b77ba28efc36a375ee214021f1334a1d1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Wrap CentralAuthUser::attach in an explicit transaction - change (mediawiki...CentralAuth)

2014-08-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Wrap CentralAuthUser::attach in an explicit transaction
..

Wrap CentralAuthUser::attach in an explicit transaction

Change-Id: I715c3e2b77ba28efc36a375ee214021f1334a1d1
---
M CentralAuthUser.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/43/154443/1

diff --git a/CentralAuthUser.php b/CentralAuthUser.php
index 7c14fa8..60d8321 100644
--- a/CentralAuthUser.php
+++ b/CentralAuthUser.php
@@ -1408,6 +1408,7 @@
 */
public function attach( $wikiID, $method = 'new', $sendToRC = true ) {
$dbw = self::getCentralDB();
+   $dbw->begin( __METHOD__ );
$dbw->insert( 'localuser',
array(
'lu_wiki'   => $wikiID,
@@ -1417,6 +1418,7 @@
__METHOD__,
array( 'IGNORE' )
);
+   $dbw->commit( __METHOD__ );
$success = $dbw->affectedRows() === 1;
 
if ( $wikiID === wfWikiID() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/154443
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I715c3e2b77ba28efc36a375ee214021f1334a1d1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] CommonSettings.php: Remove some dated cruft - change (operations/mediawiki-config)

2014-08-16 Thread PleaseStand (Code Review)
PleaseStand has uploaded a new change for review.

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

Change subject: CommonSettings.php: Remove some dated cruft
..

CommonSettings.php: Remove some dated cruft

* Remove unnecessary and broken "Protection for unusual entry points".
* Don't try loading php_utfnormal.so using dl().
* Don't unnecessarily (since 1.17) include DefaultSettings.php or
  set unused global variable $DP.
* Don't set $wgBlockOpenProxies (removed in 1.22, d7b953c25c59).
* Don't set obsolete profiling settings; current settings are
  located in StartProfiler.php.
* Don't set $wgMaxIfExistCount (removed in r32932).
* Don't set $wgCategoryTreeDynamicTag (removed in daf3e2d9f1ae).
* On nostalgiawiki, don't set a default for the "highlightbroken"
  user option (removed in 1.19, r111861 / c78f613b38a2).
* Don't set $wgUseHashTable, a long-obsolete setting.
* Remove commented-out values for $wgAntiLockFlags as well as
  another obsolete flag: ALF_NO_BLOCK_LOCK (removed in r84336 /
  f1b1aafa1d14).
* Don't set $wgCentralAuthSilentLogin (removed in 26e4affc9311)
  or $wgCentralAuthUseOldAutoLogin (removed in efbdc700188f).
* Don't set $wgNoticeRunMessageIndexRebuildJobImmediately
  (removed in 5d68f48e41ff).
* Don't set $wgUploadWizardConfig['disableResourceLoader'].

Change-Id: I03528ff360998aa16d85d9247a85513dff060acd
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 1 insertion(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/42/154442/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index b7cc59c..c3952d3 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -31,11 +31,6 @@
ini_set( 'error_append_string', ' (' . $_SERVER['SERVER_ADDR'] . ')' );
 }
 
-# Protection for unusual entry points
-if ( !function_exists( 'wfProfileIn' ) ) {
-   require( './includes/ProfilerStub.php' );
-}
-
 $fname = 'CommonSettings.php';
 wfProfileIn( $fname );
 wfProfileIn( "$fname-init" );
@@ -51,10 +46,6 @@
 $multiVersion = MWMultiVersion::getInstance();
 
 set_include_path( "$IP:/usr/local/lib/php:/usr/share/php" );
-
-if ( getenv( 'WIKIBACKUP' ) && !function_exists( 'utf8_normalize' ) ) {
-   dl( 'php_utfnormal.so' );
-}
 
 ### Determine realm and cluster we are on #
 # $cluster is an historical variable used for the WMF MW conf
@@ -111,11 +102,6 @@
$wmfHostnames['wikidata'] = 'www.wikidata.org';
break;
 }
-
-# Load site configuration
-include( "$IP/includes/DefaultSettings.php" );
-
-$DP = $IP;
 
 wfProfileOut( "$fname-init" );
 wfProfileIn( "$fname-host" );
@@ -451,18 +437,9 @@
 
 require( getRealmSpecificFilename( "$wmfConfigDir/squid.php" ) );
 
-$wgBlockOpenProxies = false;
-
 if( $wmfRealm == 'production' ) {
$wgUDPProfilerHost = '10.64.0.18';  // tungsten
$wgAggregateStatsID = $wgVersion;
-}
-
-// $wgProfiler is set in index.php
-if ( isset( $wgProfiler ) ) {
-   $wgProfiling = true;
-   $wgProfileToDatabase = true;
-   $wgProfileSampleRate = 1;
 }
 
 // CORS (cross-domain AJAX, bug 20814)
@@ -564,7 +541,6 @@
 include( $IP . '/extensions/CharInsert/CharInsert.php' );
 
 include( $IP . '/extensions/ParserFunctions/ParserFunctions.php' );
-$wgMaxIfExistCount = 500; // obs
 $wgExpensiveParserFunctionLimit = 500;
 
 if ( $wmgUseCite ) {
@@ -617,7 +593,6 @@
 
 if ( $wmgUseCategoryTree ) {
require( $IP . '/extensions/CategoryTree/CategoryTree.php' );
-   $wgCategoryTreeDynamicTag = true;
$wgCategoryTreeCategoryPageMode = $wmgCategoryTreeCategoryPageMode;
$wgCategoryTreeCategoryPageOptions = 
$wmgCategoryTreeCategoryPageOptions;
 }
@@ -863,13 +838,10 @@
} else {
$wgSiteNotice = "[//en.wikipedia.org/ See current Wikipedia]";
}
-   $wgDefaultUserOptions['highlightbroken'] = 0;
 
// Nostalgia skin
require_once "$IP/skins/Nostalgia/Nostalgia.php";
 }
-
-$wgUseHashTable = true;
 
 $wgCopyrightIcon = '';
 
@@ -915,8 +887,7 @@
 wfProfileIn( "$fname-misc3" );
 
 // Various DB contention settings
-$wgAntiLockFlags = ALF_NO_LINK_LOCK | ALF_NO_BLOCK_LOCK;
-# $wgAntiLockFlags = ALF_PRELOAD_LINKS | ALF_PRELOAD_EXISTENCE;
+$wgAntiLockFlags = ALF_NO_LINK_LOCK;
 if ( in_array( $wgDBname, array( 'testwiki', 'test2wiki', 'mediawikiwiki', 
'commonswiki' ) ) ) {
$wgSiteStatsAsyncFactor = 1;
 }
@@ -1204,8 +1175,6 @@
$wgCentralAuthCookies = true;
 
$wgDisableUnmergedEditing = $wmgDisableUnmergedEdits;
-   $wgCentralAuthSilentLogin = $wmgCentralAuthSilentLogin;
-   $wgCentralAuthUseOldAutoLogin = !$wgCentralAuthSilentLogin;
$wgCentralAuthUseEventLogging = $wmgCentralAuthUseEventLogging;
 
if( $wmfRealm == 'production' ) {
@@ -1470,7 +1439,6 @@
 
// Enable the CentralNotice/Translate integration
$w

[MediaWiki-commits] [Gerrit] [WIP] Script to clean up manual user global.js/css pages - change (mediawiki...GlobalCssJs)

2014-08-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: [WIP] Script to clean up manual user global.js/css pages
..

[WIP] Script to clean up manual user global.js/css pages

Bug: 68933
Change-Id: I4b3218ccbbc7754a89846f5fec4d288d86ed46bf
---
A removeOldManualUserPages.php
1 file changed, 129 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalCssJs 
refs/changes/41/154441/1

diff --git a/removeOldManualUserPages.php b/removeOldManualUserPages.php
new file mode 100644
index 000..d8e0504
--- /dev/null
+++ b/removeOldManualUserPages.php
@@ -0,0 +1,129 @@
+getOption( 'user' );
+   $user = User::newFromName( $userName );
+   if ( !class_exists( 'GlobalCssJsHooks' ) ) {
+   $this->error( 'The GlobalCssJs extension is not enabled 
on this wiki.', 1 );
+   }
+
+   if ( !GlobalCssJsHooks::loadForUser( $user ) ) {
+   $this->output( "$userName does not load global modules 
on this wiki." );
+   return;
+   }
+
+   $skins = array_keys( Skin::getSkinNames() );
+   $skins[] = 'common';
+   foreach ( $skins as $name ) {
+   $this->removeJS( $user, $name );
+   $this->removeCSS( $user, $name );
+   }
+   }
+
+   /**
+* Generic checks to see if we should work on a title.
+*
+* @param Title $title
+* @param Revision $rev
+* @return bool
+*/
+   private function checkTitle( Title $title, Revision $rev ) {
+   if ( !$title->exists() ) {
+   $this->output( "{$title->getPrefixedText()} does not 
exist on this wiki." );
+   return false;
+   }
+
+
+   if ( $title->getPreviousRevisionID( $rev->getId() ) !== false ) 
{
+   $this->output( "{$title->getPrefixedText()} has more 
than one revision, skipping." );
+   return false;
+   }
+
+   return true;
+   }
+
+   /**
+* Returns the domain name of the central wiki
+* escaped to use in a regex.
+*
+* @return string
+*/
+   private function getCentralWikiDomain() {
+   global $wgGlobalCssJsConfig;
+   $rl = new ResourceLoader;
+   $sources = $rl->getSources();
+   // Use api.php instead of load.php because it's more likely to 
be on the same domain
+   $api = $sources[$wgGlobalCssJsConfig['source']]['apiScript'];
+   $parsed = wfParseUrl( $api );
+   return preg_quote( $parsed['host'] );
+   }
+
+   private function deletePage( Title $title, $reason ) {
+   $page = WikiPage::factory( $title );
+   $user = User::newFromName( 'GlobalCssJs migration script' );
+   $errors = array();
+   $page->doDeleteArticleReal( wfMessage( 
$reason)->inContentLanguage()->text(), false, 0, true, $errors, $user );
+   $this->output( "{$title->getPrefixedText()} was deleted." );
+   }
+
+   private function removeCSS( User $user, $skin ) {
+   $userName = $user->getName();
+   $title = $user->getUserPage()->getSubpage( $skin . '.js' );
+   $rev = Revision::newFromTitle( $title );
+   if ( !$this->checkTitle( $title, $rev ) ) {
+   return;
+   }
+
+   /** @var CssContent $content */
+   $content = $rev->getContent();
+   $text = trim( $content->getNativeData() );
+   $domain = $this->getCentralWikiDomain();
+   preg_match( "/@import 
url\('(https?:)?\/\/$domain\/w\/index\/php?title=User:$userName\/global\.css&action=raw&ctype=text\/css'\);/",
 $text, $matches );
+   if ( $matches[0] !== $text ) {
+   $this->output( "{$title->getPrefixedText()} did not 
match the specified regular expression. Skipping." );
+   return;
+   }
+
+   // Delete!
+   $this->deletePage( $title, 'globalcssjs-delete-css' );
+   }
+
+   private function removeJS( User $user, $skin ) {
+   $userName = $user->getName();
+   $title = $user->getUserPage()->getSubpage( $skin . '.css' );
+   $rev = Revision::newFromTitle( $title );
+   if ( !$this->checkTitle( $title, $rev ) ) {
+   return;
+   }
+
+   /** @var JavaScriptContent $content */
+   $content = $rev->getContent();
+   $text = trim( $content->getNativeData() );
+   $domain = $this->getCentralWikiDomain();
+   preg_match( 
"/(mw\.load

[MediaWiki-commits] [Gerrit] Link tests directory from multiwiki web root - change (mediawiki/vagrant)

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

Change subject: Link tests directory from multiwiki web root
..


Link tests directory from multiwiki web root

This is necessary to run qunit tests as some of the JS assets are
in that directory.

Change-Id: I16bc49fb6e60206103776862035e8eeecb4cbb7d
---
M puppet/modules/mediawiki/manifests/multiwiki.pp
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/puppet/modules/mediawiki/manifests/multiwiki.pp 
b/puppet/modules/mediawiki/manifests/multiwiki.pp
index ce99e4f..97a29d3 100644
--- a/puppet/modules/mediawiki/manifests/multiwiki.pp
+++ b/puppet/modules/mediawiki/manifests/multiwiki.pp
@@ -128,6 +128,11 @@
 target => "${::mediawiki::dir}/skins",
 }
 
+file { "${script_dir}/tests":
+ensure => link,
+target => "${::mediawiki::dir}/tests",
+}
+
 file { "${script_dir}/COPYING":
 ensure => link,
 target => "${::mediawiki::dir}/COPYING",

-- 
To view, visit https://gerrit.wikimedia.org/r/154225
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I16bc49fb6e60206103776862035e8eeecb4cbb7d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] add synopses for MediaWiki-Vagrant commands - change (mediawiki/vagrant)

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

Change subject: add synopses for MediaWiki-Vagrant commands
..


add synopses for MediaWiki-Vagrant commands

This commit adds synopses for MediaWiki-Vagrant's custom commands, so that they
have meaningful help messages when somebody runs `vagrant -h`, hopefully making
it clearer as to what each command does at a glance.

Before this commit, most non-vanilla Vagrant commands had a blank space where
their synopsis would be. `vagrant vbguest` is now the only command missing a
synopsis.

Change-Id: I7173a27cf2f70f44d3387eb1a004874e6b569fa3
---
M lib/mediawiki-vagrant/git-update.rb
M lib/mediawiki-vagrant/import-dump.rb
M lib/mediawiki-vagrant/paste-puppet.rb
M lib/mediawiki-vagrant/roles.rb
M lib/mediawiki-vagrant/run-tests.rb
5 files changed, 32 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/mediawiki-vagrant/git-update.rb 
b/lib/mediawiki-vagrant/git-update.rb
index 78443ca..5f892c4 100644
--- a/lib/mediawiki-vagrant/git-update.rb
+++ b/lib/mediawiki-vagrant/git-update.rb
@@ -1,4 +1,8 @@
 class GitUpdates < Vagrant.plugin(2, :command)
+def self.synopsis
+"fetches new code from Gerrit"
+end
+
 def execute
 if %w(-h --help).include? @argv.first
 @env.ui.info 'Usage: vagrant git-update [-h]'
diff --git a/lib/mediawiki-vagrant/import-dump.rb 
b/lib/mediawiki-vagrant/import-dump.rb
index 8718c9e..9e1388b 100644
--- a/lib/mediawiki-vagrant/import-dump.rb
+++ b/lib/mediawiki-vagrant/import-dump.rb
@@ -1,4 +1,8 @@
 class ImportDump < Vagrant.plugin(2, :command)
+def self.synopsis
+"imports an XML file into MediaWiki"
+end
+
 def execute
 if ['-h', '--help'].include? @argv.first
 @env.ui.info "Usage: vagrant import-dump dumpfile.xml [-h]"
diff --git a/lib/mediawiki-vagrant/paste-puppet.rb 
b/lib/mediawiki-vagrant/paste-puppet.rb
index 1ddaa78..9db7283 100644
--- a/lib/mediawiki-vagrant/paste-puppet.rb
+++ b/lib/mediawiki-vagrant/paste-puppet.rb
@@ -4,6 +4,10 @@
 
 URL = URI('http://dpaste.de/api/')
 
+def self.synopsis
+"uploads your puppet logs to dpaste.de pastebin"
+end
+
 def latest_logfile
 Dir[File.join $DIR, '/logs/puppet/*.log'].max_by { |f| File.mtime f }
 end
diff --git a/lib/mediawiki-vagrant/roles.rb b/lib/mediawiki-vagrant/roles.rb
index 906a0e3..032997f 100644
--- a/lib/mediawiki-vagrant/roles.rb
+++ b/lib/mediawiki-vagrant/roles.rb
@@ -6,6 +6,10 @@
 class ListRoles < Vagrant.plugin(2, :command)
 include PluginEnvironment
 
+def self.synopsis
+"lists available mediawiki-vagrant roles"
+end
+
 def execute
 @env.ui.info "Available roles:\n"
 enabled = @mwv.roles_enabled
@@ -28,6 +32,10 @@
 
 class EnableRole < Vagrant.plugin(2, :command)
 include PluginEnvironment
+
+def self.synopsis
+"enables a mediawiki-vagrant role"
+end
 
 def execute
 if @argv.empty? or ['-h', '--help'].include? @argv.first
@@ -52,6 +60,10 @@
 class DisableRole < Vagrant.plugin(2, :command)
 include PluginEnvironment
 
+def self.synopsis
+"disables a mediawiki-vagrant role"
+end
+
 def execute
 if @argv.empty? or ['-h', '--help'].include? @argv.first
 @env.ui.info 'Disable one or more optional roles.'
@@ -75,6 +87,10 @@
 class ResetRoles < Vagrant.plugin(2, :command)
 include PluginEnvironment
 
+def self.synopsis
+"disables all optional mediawiki-vagrant roles"
+end
+
 def execute
 if ['-h', '--help'].include? @argv.first
 @env.ui.info 'Disable all optional roles.'
diff --git a/lib/mediawiki-vagrant/run-tests.rb 
b/lib/mediawiki-vagrant/run-tests.rb
index 79dc78f..4e50245 100644
--- a/lib/mediawiki-vagrant/run-tests.rb
+++ b/lib/mediawiki-vagrant/run-tests.rb
@@ -1,4 +1,8 @@
 class RunTests < Vagrant.plugin(2, :command)
+def self.synopsis
+"runs MediaWiki's test suite"
+end
+
 def execute
 if ['-h', '--help'].include? @argv.first
 @env.ui.info "Usage: vagrant run-tests [tests] [-h]"

-- 
To view, visit https://gerrit.wikimedia.org/r/154346
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7173a27cf2f70f44d3387eb1a004874e6b569fa3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Microchip08 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Further protection against corrupting css on build and sync. - change (apps...wikipedia)

2014-08-16 Thread Brion VIBBER (Code Review)
Brion VIBBER has submitted this change and it was merged.

Change subject: Further protection against corrupting css on build and sync.
..


Further protection against corrupting css on build and sync.

Updated error code range comparisons based on comments.

Change-Id: I47b61a143d6f02e61be4081a1036754f407ea453
---
M scripts/make-css-assets.bash
M wikipedia/Data/Operations/SyncAssetsFileOp.m
M wikipedia/mw-network/MWNetworkOp.h
M wikipedia/mw-network/MWNetworkOp.m
4 files changed, 32 insertions(+), 10 deletions(-)

Approvals:
  Brion VIBBER: Verified; Looks good to me, approved



diff --git a/scripts/make-css-assets.bash b/scripts/make-css-assets.bash
index e3a59c3..10b44f2 100755
--- a/scripts/make-css-assets.bash
+++ b/scripts/make-css-assets.bash
@@ -5,8 +5,8 @@
 
PREFIX="http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=true&lang=en&only=styles&skin=vector&modules=";
 
 cd "wikipedia/assets/" && {
-curl -o 'styles.css'   "${PREFIX}mobile.app.pagestyles.ios"
-curl -o 'abusefilter.css'  "${PREFIX}mobile.app.pagestyles.ios"
-curl -o 'preview.css'  "${PREFIX}mobile.app.preview"
+curl -L -f -o 'styles.css'   "${PREFIX}mobile.app.pagestyles.ios"
+curl -L -f -o 'abusefilter.css'  "${PREFIX}mobile.app.pagestyles.ios"
+curl -L -f -o 'preview.css'  "${PREFIX}mobile.app.preview"
 }
 
diff --git a/wikipedia/Data/Operations/SyncAssetsFileOp.m 
b/wikipedia/Data/Operations/SyncAssetsFileOp.m
index 84c826d..d8c89ad 100644
--- a/wikipedia/Data/Operations/SyncAssetsFileOp.m
+++ b/wikipedia/Data/Operations/SyncAssetsFileOp.m
@@ -35,12 +35,11 @@
 self.completionBlock = ^(){
 [[MWNetworkActivityIndicatorManager sharedManager] pop];
 
-if(weakSelf.isCancelled){
-return;
-}
-
-if (weakSelf.error) {
-return;
+if (weakSelf.isCancelled || weakSelf.error) return;
+
+if (weakSelf.response) {
+// Make extra sure that weird responses don't get written.
+if (((NSHTTPURLResponse *)weakSelf.response).statusCode != 
200) return;
 }
 
 // If it got this far, then a refresh was needed and has completed.
diff --git a/wikipedia/mw-network/MWNetworkOp.h 
b/wikipedia/mw-network/MWNetworkOp.h
index 721785e..fabb3e6 100644
--- a/wikipedia/mw-network/MWNetworkOp.h
+++ b/wikipedia/mw-network/MWNetworkOp.h
@@ -31,6 +31,7 @@
 @property (weak) id  delegate;
 
 @property (copy) NSURLRequest *request;
+@property (strong, nonatomic) NSURLResponse *response;
 
 @property (copy, readonly) NSMutableData *dataRetrieved;
 @property (nonatomic) NSUInteger dataRetrievedExpectedLength;
diff --git a/wikipedia/mw-network/MWNetworkOp.m 
b/wikipedia/mw-network/MWNetworkOp.m
index af37787..e7539b0 100644
--- a/wikipedia/mw-network/MWNetworkOp.m
+++ b/wikipedia/mw-network/MWNetworkOp.m
@@ -10,7 +10,6 @@
 
 @property (nonatomic, assign, getter = isOperationStarted) BOOL 
operationStarted;
 @property (strong, nonatomic) NSURLConnection *connection;
-@property (strong, nonatomic) NSURLResponse *response;
 @property (copy, readwrite) NSNumber *bytesWritten;
 @property (copy, readwrite) NSNumber *bytesExpectedToWrite;
 
@@ -184,6 +183,29 @@
 self.response = response;
 }
 
+-(void)setResponse:(NSURLResponse *)response
+{
+_response = response;
+
+[self failIfBadHTTPStatusCode];
+}
+
+-(void)failIfBadHTTPStatusCode
+{
+if (!self.response) return;
+
+// If the response is a server or client error finish with an error.
+NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)self.response;
+NSInteger code = httpResponse.statusCode;
+if ((code >= 400) && (code <= 499)) {
+[self finishWithError:[NSString stringWithFormat:@"Client error. HTTP 
Status Code %ld", (long)code]];
+}else if ((code >= 500) && (code <= 599)) {
+[self finishWithError:[NSString stringWithFormat:@"Server error. HTTP 
Status Code %ld", (long)code]];
+}
+//NSLog(@"responseStatusCode = %ld", (long)code);
+//NSLog(@"allHeaderFields = %@", httpResponse.allHeaderFields);
+}
+
 -(void)connectionDidFinishLoading:(NSURLConnection *)connection
 {
 if([self isCancelled]) {

-- 
To view, visit https://gerrit.wikimedia.org/r/153696
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I47b61a143d6f02e61be4081a1036754f407ea453
Gerrit-PatchSet: 2
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mhurd 
Gerrit-Reviewer: Brion VIBBER 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Dom transformations no longer "thrash". - change (apps...wikipedia)

2014-08-16 Thread Brion VIBBER (Code Review)
Brion VIBBER has submitted this change and it was merged.

Change subject: Dom transformations no longer "thrash".
..


Dom transformations no longer "thrash".

Much faster!

Fix for enwiki Soviet Union article (and others surely) issue.

Rebased and fixed edit pencil not showing issue.

Adjusted capitalization and selectors based on comments.

Change-Id: I8181e7de92fbbc3d71eff5a70bc9c8de2d52e670
---
M wikipedia/assets/bundle.js
M www/js/listeners.js
M www/js/transformer.js
M www/js/transforms.js
D www/js/wikihacks.js
5 files changed, 181 insertions(+), 293 deletions(-)

Approvals:
  Brion VIBBER: Verified; Looks good to me, approved



diff --git a/wikipedia/assets/bundle.js b/wikipedia/assets/bundle.js
index 0d5d71a..f646105 100644
--- a/wikipedia/assets/bundle.js
+++ b/wikipedia/assets/bundle.js
@@ -95,7 +95,6 @@
 
 },{}],3:[function(require,module,exports){
 var bridge = require("./bridge");
-var wikihacks = require("./wikihacks");
 var transformer = require("./transformer");
 var refs = require("./refs");
 
@@ -125,47 +124,20 @@
 bridge.registerListener( "append", function( payload ) {
 // Append html without losing existing event handlers
 // From: http://stackoverflow.com/a/595825
-var content = document.getElementById("content");
+
 var newcontent = document.createElement('div');
 newcontent.innerHTML = payload.html;
-
-var isFirstSection = true;
-while (newcontent.firstChild) {
-var section = newcontent.removeChild(newcontent.firstChild);
-if (section.nodeType == Node.ELEMENT_NODE) {
-if (isFirstSection) {
-section = transformer.transform( "leadSection", section );
-isFirstSection = false;
-}
-section = transformer.transform( "section", section );
-}
-content.appendChild(section);
-}
 
-// Things which need to happen any time data is appended.
-//TODO: later could optimize to only perform actions on elements found
-// within the content div which was appended).
-
-// TODO: migrate these into common transforms?
-
-wikihacks.putWideTablesInDivs();
-/*
-wikihacks.makeTablesNotBlockIfSafeToDoSo();
-wikihacks.reduceWeirdWebkitMargin();
- */
-wikihacks.hideAudioTags();
-/*
-wikihacks.allowDivWidthsToFlow();
-*/
-wikihacks.tweakFilePage();
-});
-
-bridge.registerListener( "prepend", function( payload ) {
-// Prepend html without losing existing event handlers
+transformer.transform( "relocateInfobox", newcontent );
+transformer.transform( "hideRedlinks", newcontent );
+transformer.transform( "disableFilePageEdit", newcontent );
+transformer.transform( "hideAudioTags", newcontent );
+transformer.transform( "overflowWideTables", newcontent );
+
 var content = document.getElementById("content");
-var newcontent = document.createElement('div');
-newcontent.innerHTML = payload.html;
-content.insertBefore(newcontent, content.firstChild);
+// Ensure we've done transforms *before* appending the new content.
+// Otherwise the web view dom will thrash.
+content.appendChild(newcontent);
 });
 
 bridge.registerListener( "remove", function( payload ) {
@@ -286,7 +258,7 @@
 
 document.addEventListener("touchend", touchEnd, "false");
 
-},{"./bridge":1,"./refs":5,"./transformer":6,"./wikihacks":8}],4:[function(require,module,exports){
+},{"./bridge":1,"./refs":5,"./transformer":6}],4:[function(require,module,exports){
 
 var bridge = require("./bridge");
 var elementLocation = require("./elementLocation");
@@ -433,9 +405,8 @@
 Transformer.prototype.transform = function( transform, element ) {
 var functions = transforms[transform];
 for ( var i = 0; i < functions.length; i++ ) {
-element = functions[i](element);
+functions[i](element);
 }
-return element;
 };
 
 module.exports = new Transformer();
@@ -443,26 +414,46 @@
 },{}],7:[function(require,module,exports){
 var transformer = require("./transformer");
 
-// Move infobox to the bottom of the lead section
-transformer.register( "leadSection", function( leadContent ) {
-var infobox = leadContent.querySelector( "table.infobox" );
-if ( infobox ) {
-infobox.parentNode.removeChild( infobox );
-var pTags = leadContent.getElementsByTagName( "p" );
-if ( pTags.length ) {
-pTags[0].appendChild( infobox );
-} else {
-leadContent.appendChild( infobox );
+transformer.register( "relocateInfobox", function( content ) {
+// Move infobox after first lead section paragraph.
+
+/*
+DIV section_heading_and_content_block_0
+DIV content_block_0
+P <-- Move infobox after first P element which is a direct 
child of content_block_0 DIV.
+
+Old code had problem with en wiki "Soviet Union" article - it moved the 
+infobox right after a P e

[MediaWiki-commits] [Gerrit] Make it obvious the config object belongs to the Vector skin - change (mediawiki...Vector)

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

Change subject: Make it obvious the config object belongs to the Vector skin
..


Make it obvious the config object belongs to the Vector skin

Change-Id: Id4504565feedaa31e170ea21782fed8043511b31
---
M SkinVector.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  Helder.wiki: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/SkinVector.php b/SkinVector.php
index 6ad919d..8f7056d 100644
--- a/SkinVector.php
+++ b/SkinVector.php
@@ -33,10 +33,10 @@
/**
 * @var Config
 */
-   private $config;
+   private $vectorConfig;
 
public function __construct( Config $config ) {
-   $this->config = $config;
+   $this->vectorConfig = $config;
}
 
protected static $bodyClasses = array( 'vector-animateLayout' );
@@ -77,7 +77,7 @@
 * Override to pass our Config instance to it
 */
public function setupTemplate( $classname, $repository = false, 
$cache_dir = false ) {
-   return new $classname( $this->config );
+   return new $classname( $this->vectorConfig );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/154431
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id4504565feedaa31e170ea21782fed8043511b31
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Helder.wiki 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add 'global-renamer' user group to metawiki - change (operations/mediawiki-config)

2014-08-16 Thread Vogone (Code Review)
Vogone has uploaded a new change for review.

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

Change subject: Add 'global-renamer' user group to metawiki
..

Add 'global-renamer' user group to metawiki

Create group 'global-renamer' with 'centralauth-rename' assigned.
Clean-up a few lines.

Bug: 69651
Change-Id: Ie54d0059af5fdcad487a837b34f9163568c883ef
---
M wmf-config/InitialiseSettings.php
1 file changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/40/154440/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 740d840..b87e38b 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -7214,18 +7214,20 @@
),
 
'+metawiki' => array(
-   'steward' => array( 'userrights-interwiki' => true ), // new 
steward stuff, yay 2007-12-27
-   'flood' => array( 'bot' => true ),
'autopatrolled' => array( 'autopatrol' => true ),
-   'centralnoticeadmin' => array( 'centralnotice-admin' => true, 
'editinterface' => true ), //adding to allow CN access without local sysop JRA 
2013-02-21
+   'centralnoticeadmin' => array( //adding to allow CN access 
without local sysop JRA 2013-02-21
+   'centralnotice-admin' => true,
+   'editinterface' => true,
+   ),
+   'flood' => array( 'bot' => true ),
+   'global-renamer' => array( 'centralauth-rename' => true ), // 
bug 69651
+   'massmessage-sender' => array( 'massmessage' => true ), // bug 
57611
+   'steward' => array( 'userrights-interwiki' => true ), // new 
steward stuff, yay 2007-12-27
'uploader' => array( // bug 50287
'upload' => true,
'reupload' => true,
'reupload-own' => true,
-   ),
-   'massmessage-sender' => array( // bug 57611
-   'massmessage' => true,
-   ),
+   ),
),
'mkwiki' => array(
'autopatrolled' => array( 'autopatrol' => true ),

-- 
To view, visit https://gerrit.wikimedia.org/r/154440
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie54d0059af5fdcad487a837b34f9163568c883ef
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Vogone 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Basic block image (figure/figcaption) support - change (VisualEditor/VisualEditor)

2014-08-16 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Basic block image (figure/figcaption) support
..

Basic block image (figure/figcaption) support

Change-Id: Iddb3a5f57fd0ab965db00c2b148ab4f5e89b923d
---
M .docs/eg-iframe.html
M build/modules.json
M demos/ve/desktop.html
M demos/ve/mobile.html
M demos/ve/pages/image.html
A src/ce/nodes/ve.ce.BlockImageNode.js
A src/ce/nodes/ve.ce.ImageCaptionNode.js
A src/dm/nodes/ve.dm.BlockImageNode.js
A src/dm/nodes/ve.dm.ImageCaptionNode.js
M tests/index.html
10 files changed, 353 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/39/154439/1

diff --git a/.docs/eg-iframe.html b/.docs/eg-iframe.html
index c819aba..79240b0 100644
--- a/.docs/eg-iframe.html
+++ b/.docs/eg-iframe.html
@@ -162,7 +162,6 @@



-   



@@ -175,6 +174,9 @@



+   
+   
+   



@@ -224,7 +226,6 @@



-   



@@ -237,6 +238,9 @@



+   
+   
+   



diff --git a/build/modules.json b/build/modules.json
index 31415d5..83aa2e9 100644
--- a/build/modules.json
+++ b/build/modules.json
@@ -184,7 +184,6 @@
"src/dm/nodes/ve.dm.DivNode.js",
"src/dm/nodes/ve.dm.DocumentNode.js",
"src/dm/nodes/ve.dm.HeadingNode.js",
-   "src/dm/nodes/ve.dm.InlineImageNode.js",
"src/dm/nodes/ve.dm.InternalItemNode.js",
"src/dm/nodes/ve.dm.InternalListNode.js",
"src/dm/nodes/ve.dm.ListItemNode.js",
@@ -197,6 +196,9 @@
"src/dm/nodes/ve.dm.TableRowNode.js",
"src/dm/nodes/ve.dm.TableSectionNode.js",
"src/dm/nodes/ve.dm.TextNode.js",
+   "src/dm/nodes/ve.dm.ImageCaptionNode.js",
+   "src/dm/nodes/ve.dm.BlockImageNode.js",
+   "src/dm/nodes/ve.dm.InlineImageNode.js",
"src/dm/annotations/ve.dm.LanguageAnnotation.js",
"src/dm/annotations/ve.dm.LinkAnnotation.js",
"src/dm/annotations/ve.dm.TextStyleAnnotation.js",
@@ -246,7 +248,6 @@
"src/ce/nodes/ve.ce.DivNode.js",
"src/ce/nodes/ve.ce.DocumentNode.js",
"src/ce/nodes/ve.ce.HeadingNode.js",
-   "src/ce/nodes/ve.ce.InlineImageNode.js",
"src/ce/nodes/ve.ce.InternalItemNode.js",
"src/ce/nodes/ve.ce.InternalListNode.js",
"src/ce/nodes/ve.ce.ListItemNode.js",
@@ -259,6 +260,9 @@
"src/ce/nodes/ve.ce.TableRowNode.js",
"src/ce/nodes/ve.ce.TableSectionNode.js",
"src/ce/nodes/ve.ce.TextNode.js",
+   "src/ce/nodes/ve.ce.ImageCaptionNode.js",
+   "src/ce/nodes/ve.ce.BlockImageNode.js",
+   "src/ce/nodes/ve.ce.InlineImageNode.js",
"src/ce/annotations/ve.ce.LanguageAnnotation.js",
"src/ce/annotations/ve.ce.LinkAnnotation.js",
"src/ce/annotations/ve.ce.TextStyleAnnotation.js",
diff --git a/demos/ve/desktop.html b/demos/ve/desktop.html
index 409162d..cb38cb7 100644
--- a/demos/ve/desktop.html
+++ b/demos/ve/desktop.html
@@ -174,7 +174,6 @@



-   



@@ -187,6 +186,9 @@



+   
+   
+   



@@ -236,7 +238,6 @@



-   



@@ -249,6 +250,9 @@



+   
+   
+   



diff --git a/demos/ve/mobile.html b/demos/ve/mobile.html
index dda4efe..4480c31 100644
--- a/demos/ve/mobile.html
+++ b/demos/ve/mobile.html
@@ -175,7 +175,6 @@



-   



@@ -188,6 +187,9 @@



+   
+   
+   

[MediaWiki-commits] [Gerrit] Pass normalized username to GlobalRenameUserStatus - change (mediawiki...CentralAuth)

2014-08-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Pass normalized username to GlobalRenameUserStatus
..

Pass normalized username to GlobalRenameUserStatus

We were directly taking the special page input which
means it wasn't normalized.

Change-Id: I5b75ecb41e8697f975963729df463225212a54f6
---
M specials/SpecialGlobalRenameUser.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/35/154435/1

diff --git a/specials/SpecialGlobalRenameUser.php 
b/specials/SpecialGlobalRenameUser.php
index c826312..4c2878d 100644
--- a/specials/SpecialGlobalRenameUser.php
+++ b/specials/SpecialGlobalRenameUser.php
@@ -118,7 +118,7 @@
CentralAuthUser::getInstance( $oldUser ),
$newUser,
CentralAuthUser::getInstance( $newUser ),
-   new GlobalRenameUserStatus( $this->newUsername ),
+   new GlobalRenameUserStatus( $newUser->getName() ),
'JobQueueGroup::singleton',
new GlobalRenameUserDatabaseUpdates(),
new GlobalRenameUserLogger( $this->getUser() )

-- 
To view, visit https://gerrit.wikimedia.org/r/154435
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b75ecb41e8697f975963729df463225212a54f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] User adjust git timestamp for extensions on Special:Version - change (mediawiki/core)

2014-08-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review.

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

Change subject: User adjust git timestamp for extensions on Special:Version
..

User adjust git timestamp for extensions on Special:Version

User with a timezone in its preferences does not see the git timestamp
in the local timezone.
The timestamp for mediawiki/core gets already adjust.

Change-Id: I412281670766bd9404fc829cac8eae277449c6a0
---
M includes/specials/SpecialVersion.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/154434/1

diff --git a/includes/specials/SpecialVersion.php 
b/includes/specials/SpecialVersion.php
index 87ab41c..4b1abac 100644
--- a/includes/specials/SpecialVersion.php
+++ b/includes/specials/SpecialVersion.php
@@ -724,7 +724,7 @@
if ( $vcsDate ) {
$vcsTimeString = Html::element( 'span',
array( 'class' => 
'mw-version-ext-vcs-timestamp' ),
-   $this->getLanguage()->timeanddate( 
$vcsDate )
+   $this->getLanguage()->timeanddate( 
$vcsDate, true )
);
$versionString .= " {$vcsTimeString}";
}

-- 
To view, visit https://gerrit.wikimedia.org/r/154434
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I412281670766bd9404fc829cac8eae277449c6a0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Enable GlobalCssJs on all CentralAuth wikis minus loginwiki - change (operations/mediawiki-config)

2014-08-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Enable GlobalCssJs on all CentralAuth wikis minus loginwiki
..

Enable GlobalCssJs on all CentralAuth wikis minus loginwiki

Bug: 57891
Change-Id: I9d9809c719364ae01afb0b49dc95c968ac4fc1d8
---
M wmf-config/CommonSettings-labs.php
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
4 files changed, 13 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/32/154432/1

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 911a2d5..c7597ae 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -113,23 +113,12 @@
 
 require_once( "$IP/extensions/MobileApp/MobileApp.php" );
 
-// Config for GlobalCssJs
-// Only enable on CentralAuth wikis
+// Labs override for GlobalCssJs
 if ( $wmgUseGlobalCssJs && $wmgUseCentralAuth ) {
-   require_once( "$IP/extensions/GlobalCssJs/GlobalCssJs.php" );
-
-   // Disable site-wide global css/js
-   $wgUseGlobalSiteCssJs = false;
-
// Load from betalabs metawiki
$wgResourceLoaderSources['metawiki'] = array(
'apiScript' => '//meta.wikimedia.beta.wmflabs.org/w/api.php',
'loadScript' => 
'//bits.beta.wmflabs.org/meta.wikimedia.beta.wmflabs.org/load.php',
-   );
-
-   $wgGlobalCssJsConfig = array(
-   'wiki' => 'metawiki',
-   'source' => 'metawiki',
);
 }
 
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index b7cc59c..88d9ded 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1291,23 +1291,21 @@
 
 // Config for GlobalCssJs
 // Only enable on CentralAuth wikis
-// Note that config in CommonSettings-labs.php
-// will override this on beta labs-- legoktm 04/17/14
 if ( $wmgUseGlobalCssJs && $wmgUseCentralAuth ) {
require_once( "$IP/extensions/GlobalCssJs/GlobalCssJs.php" );
 
// Disable site-wide global css/js
$wgUseGlobalSiteCssJs = false;
 
-   // Setup test2wiki as central wiki
-   $wgResourceLoaderSources['test2wiki'] = array(
-   'apiScript' => '//test2.wikipedia.org/w/api.php',
-   'loadScript' => 
'//bits.wikimedia.org/test2.wikipedia.org/load.php',
+   // Setup metawiki as central wiki
+   $wgResourceLoaderSources['metawiki'] = array(
+   'apiScript' => '//meta.wikimedia.org/w/api.php',
+   'loadScript' => 
'//bits.wikimedia.org/meta.wikimedia.org/load.php',
);
 
$wgGlobalCssJsConfig = array(
-   'wiki' => 'test2wiki',
-   'source' => 'test2wiki',
+   'wiki' => 'metawiki', // database name
+   'source' => 'metawiki', // ResourceLoader source name
);
 }
 
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 4af1918..a98ee95 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -394,13 +394,7 @@
'wmgBug54847' => array(
'default' => false,
),
-   # Note this is also guarded with wmgUseCentralAuth
-   'wmgUseGlobalCssJs' => array(
-   'default' => true,
-   'private' => false,
-   'fishbowl' => false,
-   'loginwiki' => false,
-   ),
+
'wmgUseGuidedTour' => array(
'wikidatawiki' => true,
),
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 740d840..19a00e9 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -10016,10 +10016,12 @@
'default' => true,
 ),
 
+// This is also guarded by $wmgUseCentralAuth
 'wmgUseGlobalCssJs' => array(
-   'default' => false,
-   'testwiki' => true,
-   'test2wiki' => true,
+   'default' => true,
+   'loginwiki' => false,
+   'private' => false,
+   'fishbowl' => false,
 ),
 
 'wmgUseOAuth' => array(

-- 
To view, visit https://gerrit.wikimedia.org/r/154432
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d9809c719364ae01afb0b49dc95c968ac4fc1d8
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make it obvious the config object belongs to the Vector skin - change (mediawiki...Vector)

2014-08-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Make it obvious the config object belongs to the Vector skin
..

Make it obvious the config object belongs to the Vector skin

Change-Id: Id4504565feedaa31e170ea21782fed8043511b31
---
M SkinVector.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector 
refs/changes/31/154431/1

diff --git a/SkinVector.php b/SkinVector.php
index 6ad919d..8f7056d 100644
--- a/SkinVector.php
+++ b/SkinVector.php
@@ -33,10 +33,10 @@
/**
 * @var Config
 */
-   private $config;
+   private $vectorConfig;
 
public function __construct( Config $config ) {
-   $this->config = $config;
+   $this->vectorConfig = $config;
}
 
protected static $bodyClasses = array( 'vector-animateLayout' );
@@ -77,7 +77,7 @@
 * Override to pass our Config instance to it
 */
public function setupTemplate( $classname, $repository = false, 
$cache_dir = false ) {
-   return new $classname( $this->config );
+   return new $classname( $this->vectorConfig );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/154431
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4504565feedaa31e170ea21782fed8043511b31
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Unbreak Special:ExtensionDistributor - change (mediawiki...ExtensionDistributor)

2014-08-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Unbreak Special:ExtensionDistributor
..

Unbreak Special:ExtensionDistributor

$wgExtDistArchiveAPI was removed a while back, I never
removed the usage here apparently.

Bug: 69644
Change-Id: I39778d7fc642952172a67b895c3c546dd79af4f8
---
M SpecialExtensionDistributor.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExtensionDistributor 
refs/changes/30/154430/1

diff --git a/SpecialExtensionDistributor.php b/SpecialExtensionDistributor.php
index 290272f..eb1cf91 100644
--- a/SpecialExtensionDistributor.php
+++ b/SpecialExtensionDistributor.php
@@ -20,11 +20,11 @@
 * @param $subpage string
 */
public function execute( $subpage ) {
-   global $wgExtDistListFile, $wgExtDistArchiveAPI;
+   global $wgExtDistListFile, $wgExtDistAPIConfig;
 
$this->setHeaders();
 
-   if ( !$wgExtDistListFile || !$wgExtDistArchiveAPI ) {
+   if ( !$wgExtDistListFile || !$wgExtDistAPIConfig ) {
$this->getOutput()->addWikiMsg( 
'extdist-not-configured' );
return;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/154430
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39778d7fc642952172a67b895c3c546dd79af4f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ExtensionDistributor
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add description to MW/ruleset.xml - change (mediawiki...codesniffer)

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

Change subject: Add description to MW/ruleset.xml
..


Add description to MW/ruleset.xml

Change-Id: I651b6a86b753b60b842af15b61fa447a029a5edc
---
M MediaWiki/ruleset.xml
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml
index 94fb91f..0c42d8a 100644
--- a/MediaWiki/ruleset.xml
+++ b/MediaWiki/ruleset.xml
@@ -6,6 +6,9 @@
- 
https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards
 -->
 
+
+   A coding standard for MediaWiki.
+


[MediaWiki-commits] [Gerrit] Use local content to get configuration settings in Action - change (mediawiki/core)

2014-08-16 Thread IAlex (Code Review)
IAlex has uploaded a new change for review.

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

Change subject: Use local content to get configuration settings in Action
..

Use local content to get configuration settings in Action

Follow-up I47db5eab45 (b061c27)

Change-Id: I76409f5fc61e5d35235f964e094dd8881bcc8311
---
M includes/actions/DeleteAction.php
M includes/actions/EditAction.php
M includes/actions/ProtectAction.php
3 files changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/154429/1

diff --git a/includes/actions/DeleteAction.php 
b/includes/actions/DeleteAction.php
index 9dc1049..12f0dff 100644
--- a/includes/actions/DeleteAction.php
+++ b/includes/actions/DeleteAction.php
@@ -41,8 +41,7 @@
}
 
public function show() {
-   global $wgUseMediaWikiUIEverywhere;
-   if ( $wgUseMediaWikiUIEverywhere ) {
+   if ( $this->getContext()->getConfig()->get( 
'UseMediaWikiUIEverywhere' ) ) {
$out = $this->getOutput();
$out->addModuleStyles( array(
'mediawiki.ui.input',
diff --git a/includes/actions/EditAction.php b/includes/actions/EditAction.php
index aaf4526..8876724 100644
--- a/includes/actions/EditAction.php
+++ b/includes/actions/EditAction.php
@@ -41,8 +41,7 @@
}
 
public function show() {
-   global $wgUseMediaWikiUIEverywhere;
-   if ( $wgUseMediaWikiUIEverywhere ) {
+   if ( $this->getContext()->getConfig()->get( 
'UseMediaWikiUIEverywhere' ) ) {
$out = $this->getOutput();
$out->addModuleStyles( array(
'mediawiki.ui.input',
diff --git a/includes/actions/ProtectAction.php 
b/includes/actions/ProtectAction.php
index 443660b..a7f1ac3 100644
--- a/includes/actions/ProtectAction.php
+++ b/includes/actions/ProtectAction.php
@@ -41,8 +41,7 @@
}
 
public function show() {
-   global $wgUseMediaWikiUIEverywhere;
-   if ( $wgUseMediaWikiUIEverywhere ) {
+   if ( $this->getContext()->getConfig()->get( 
'UseMediaWikiUIEverywhere' ) ) {
$out = $this->getOutput();
$out->addModuleStyles( array(
'mediawiki.ui.input',

-- 
To view, visit https://gerrit.wikimedia.org/r/154429
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76409f5fc61e5d35235f964e094dd8881bcc8311
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Separated the main page specific CSS from the base module an... - change (mediawiki...BlueSky)

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

Change subject: Separated the main page specific CSS from the base module and 
moved it to a separate module which is loaded only on the main page.
..


Separated the main page specific CSS from the base module and moved it to
a separate module which is loaded only on the main page.

Change-Id: I7c3c29cb5dca6adfb1ac69de4c8510087df8448a
---
M BlueSky.php
M BlueSky.skin.php
M resources/css/home.css
3 files changed, 20 insertions(+), 8 deletions(-)

Approvals:
  Isarra: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/BlueSky.php b/BlueSky.php
index fbafc7e..9615fe6 100755
--- a/BlueSky.php
+++ b/BlueSky.php
@@ -53,7 +53,6 @@
#'skins/common/commonContent.css' => array( 'media' => 'screen' 
),
'skins/common/commonInterface.css' => array( 'media' => 
'screen' ),
// Styles custom to this skin
-   'skins/BlueSky/resources/css/home.css' => array( 'media' => 
'screen' ),
'skins/BlueSky/resources/css/nonarticle.css' => array( 'media' 
=> 'screen' ),
'skins/BlueSky/resources/css/searchresults.css' => array( 
'media' => 'screen' ),
'skins/BlueSky/resources/css/special.css' => array( 'media' => 
'screen' ),
@@ -63,6 +62,15 @@
'position' => 'top'
 );
 
+// zzz prefix is a hack to ensure that this module is loaded after the main
+// skins.bluesky module
+$wgResourceModules['zzzskins.bluesky.mainpage'] = array(
+   'styles' => array(
+   'skins/BlueSky/resources/css/home.css' => array( 'media' => 
'screen' ),
+   ),
+   'position' => 'top'
+);
+
 $wgResourceModules['skins.bluesky.externallinks.123'] = array(
'styles' => array(
'skins/BlueSky/resources/css/externallinks-123.css' => array( 
'media' => 'screen' ),
diff --git a/BlueSky.skin.php b/BlueSky.skin.php
index 003d526..f496636 100755
--- a/BlueSky.skin.php
+++ b/BlueSky.skin.php
@@ -73,15 +73,19 @@
} else {
$baseCSSmodules[] = 'skins.bluesky.externallinks.124';
}
-   // Add base CSS (i.e. no themes or ugly hacks) via 
ResourceLoader
-   $out->addModuleStyles( $baseCSSmodules );
 
-   // Ugly LESS hacks
$modules = array();
$title = $this->getTitle();
$request = $this->getRequest();
$action = $request->getVal( 'action', 'view' );
 
+   if ( $title->isMainPage() ) {
+   $baseCSSmodules[] = 'zzzskins.bluesky.mainpage';
+   }
+
+   // Add base CSS (i.e. no themes or ugly hacks) via 
ResourceLoader
+   $out->addModuleStyles( $baseCSSmodules );
+
// Page action specific hacks
switch ( $action ) {
case 'delete':
diff --git a/resources/css/home.css b/resources/css/home.css
index 1ff08c3..3d23cc5 100755
--- a/resources/css/home.css
+++ b/resources/css/home.css
@@ -1,11 +1,11 @@
-.page-Main_Page #intro,
-.page-Main_Page .wh_block {
+#intro,
+.wh_block {
display: none;
 }
-.page-Main_Page #actionbar {
+#actionbar {
height: 18px;
 }
-.page-Main_Page .minor_section {
+.minor_section {
border: none;
padding: 0;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/154424
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7c3c29cb5dca6adfb1ac69de4c8510087df8448a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: Isarra 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Refactor ValidGlobalNameSniff - change (mediawiki...codesniffer)

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

Change subject: Refactor ValidGlobalNameSniff
..


Refactor ValidGlobalNameSniff

Change-Id: Ia198a09312bdf6cde44ec1adc36445f7f2be148e
---
M MediaWiki/Sniffs/NamingConventions/ValidGlobalNameSniff.php
1 file changed, 17 insertions(+), 29 deletions(-)

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



diff --git a/MediaWiki/Sniffs/NamingConventions/ValidGlobalNameSniff.php 
b/MediaWiki/Sniffs/NamingConventions/ValidGlobalNameSniff.php
index f425730..c3ab05e 100644
--- a/MediaWiki/Sniffs/NamingConventions/ValidGlobalNameSniff.php
+++ b/MediaWiki/Sniffs/NamingConventions/ValidGlobalNameSniff.php
@@ -8,7 +8,7 @@
/**
 * http://php.net/manual/en/reserved.variables.argv.php
 */
-   protected static $PHPReserved = array(
+   private static $PHPReserved = array(
'$GLOBALS',
'$_SERVER',
'$_GET',
@@ -25,7 +25,7 @@
'$argv'
);
 
-   protected static $mediaWikiValid = array(
+   private static $mediaWikiValid = array(
'$messageMemc',
'$parserMemc',
'$IP',
@@ -37,13 +37,6 @@
 
public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
$tokens = $phpcsFile->getTokens();
-   $token = $tokens[$stackPtr];
-
-   if( $token['code'] !== T_GLOBAL ) {
-   return;
-   }
-
-   $errorIssued = false;
 
$nameIndex  = $phpcsFile->findNext( T_VARIABLE, $stackPtr + 1 );
$globalName = $tokens[$nameIndex]['content'];
@@ -54,36 +47,31 @@
return;
}
 
-   // skip '$' and forge a valid global variable name
+   // Skip '$' and forge a valid global variable name
$expected = '$wg' . ucfirst(substr( $globalName, 1 ));
-
 
// Verify global is prefixed with wg
if( strpos($globalName, '$wg' ) !== 0 ) {
-
-   $error = 'Global variable "%s" is lacking \'wg\' 
prefix. Should be "%s".';
-   $type = 'wgPrefix';
-   $data = array( $globalName, $expected );
-   $phpcsFile->addError( $error, $stackPtr, $type, $data );
-
-   $errorIssued = true;
-   }
-
-   if( !$errorIssued ) { // no need to warn twice.
+   $phpcsFile->addError(
+   'Global variable "%s" is lacking \'wg\' prefix. 
Should be "%s".',
+   $stackPtr,
+   'wgPrefix',
+   array( $globalName, $expected )
+   );
+   } else {
// Verify global is probably CamelCase
$val = ord( substr( $globalName, 3, 1 ) );
if( !($val >= 65 && $val <= 90) ) {
-
-   $error = 'Global variable "%s" should use 
CamelCase: "%s"';
-   $type = 'CamelCase';
-   $data = array( $globalName, $expected );
-   $phpcsFile->addError( $error, $stackPtr, $type, 
$data );
-
-   $errorIssued = true;
+   $phpcsFile->addError(
+   'Global variable "%s" should use 
CamelCase: "%s"',
+   $stackPtr,
+   'CamelCase',
+   array( $globalName, $expected )
+   );
}
}
 
-   }//end process()
+   }
 
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/153314
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia198a09312bdf6cde44ec1adc36445f7f2be148e
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add tests for existing custom sniffs - change (mediawiki...codesniffer)

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

Change subject: Add tests for existing custom sniffs
..


Add tests for existing custom sniffs

Change-Id: I875b366b5bb273323a5faedcd65f1c2978a33d70
---
A MediaWiki/Tests/MediaWikiStandardTest.php
A MediaWiki/Tests/files/NamingConventions/case_global_name_fail.php
A MediaWiki/Tests/files/NamingConventions/wg_global_name_fail.php
A MediaWiki/Tests/files/generic_pass.php
M README.md
A TestHelper.php
A phpunit.bootstrap.php
A phpunit.xml.dist
8 files changed, 322 insertions(+), 1 deletion(-)

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



diff --git a/MediaWiki/Tests/MediaWikiStandardTest.php 
b/MediaWiki/Tests/MediaWikiStandardTest.php
new file mode 100644
index 000..e45aadb
--- /dev/null
+++ b/MediaWiki/Tests/MediaWikiStandardTest.php
@@ -0,0 +1,92 @@
+https://github.com/cakephp/cakephp-codesniffer/blob/015919e55049e696eef9e518026e2d9abcdba722/CakePHP/tests/CakePHPStandardTest.php
+ *
+ * @license MIT
+ * CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org)
+ * Copyright (c) 2005-2013, Cake Software Foundation, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * @author Adam Shorland
+ * Modifications
+ *  - Rename appropriatly
+ *  - Adapt $this->helper->runPhpCs call to pass second parameter $standard
+ */
+class MediaWikiStandardTest extends PHPUnit_Framework_TestCase {
+
+   /**
+* @var TestHelper
+*/
+   private $helper;
+
+   public function setUp() {
+   parent::setUp();
+   if (empty($this->helper)) {
+   $this->helper = new TestHelper();
+   }
+   }
+
+   /**
+* testFiles
+*
+* Run simple syntax checks, if the filename ends with pass.php - 
expect it to pass
+*/
+   public static function testProvider() {
+   $tests = array();
+
+   $standard = dirname(dirname(__FILE__));
+
+   $iterator = new RecursiveIteratorIterator(new 
RecursiveDirectoryIterator(dirname(__FILE__) . '/files'));
+   foreach ($iterator as $dir) {
+   if ($dir->isDir()) {
+   continue;
+   }
+
+   $file = $dir->getPathname();
+   $expectPass = (substr($file, -8) === 'pass.php');
+   $tests[] = array(
+   $file,
+   $standard,
+   $expectPass
+   );
+   }
+   return $tests;
+   }
+
+   /**
+* _testFile
+*
+* @dataProvider testProvider
+*
+* @param string $file
+* @param string $standard
+* @param boolean $expectPass
+*/
+   public function testFile($file, $standard, $expectPass) {
+   $outputStr = $this->helper->runPhpCs($file, $standard);
+   if ($expectPass) {
+   $this->assertNotRegExp(
+   "/FOUND \d+ ERROR/",
+   $outputStr,
+   basename($file) . ' - expected to pass with no 
errors, some were reported. '
+   );
+   } else {
+   $this->assertRegExp(
+   "/FOUND \d+ ERROR/",
+   $outputStr,
+   basename($file) . ' - expected failures, none 
reported. '
+   );
+   }
+   }
+
+}
\ No newline at end of file
diff --git a/MediaWiki/Tests/files/NamingConventions/case_global_name_fail.php 
b/MediaWiki/Tests/files/NamingConventions/case_global_name_fail.php
new file mode 100644
index 000..f6488a9
--- /dev/null
+++ b/MediaWiki/Tests/files/NamingConventions/case_global_name_fail.php
@@ -0,0 +1,6 @@
+https://www.mediawiki.org/wiki/Manual:Coding_conventions
+
+/**
+ * @param $outputtype
+ * @param null $ts
+ * @return null
+ */
+function wfTimestampOrNull( $outputtype = TS_UNIX, $ts = null ) {
+   if ( is_null( $ts ) ) {
+   return null;
+   } else {
+   return wfTimestamp( $outputtype, $ts );
+   }
+}
+
+$wgAutopromote = array(
+   'autoconfirmed' => array( '&',
+   arr

[MediaWiki-commits] [Gerrit] Remove unmatched @param - change (mediawiki/core)

2014-08-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review.

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

Change subject: Remove unmatched @param
..

Remove unmatched @param

There is no method parameter for this @param

Change-Id: I42d1e3439e5b767be09920d536bee34bcd017ec9
---
M includes/MWTimestamp.php
M includes/filerepo/RepoGroup.php
M includes/jobqueue/jobs/DoubleRedirectJob.php
3 files changed, 0 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/28/154428/1

diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php
index bc59588..26f5e54 100644
--- a/includes/MWTimestamp.php
+++ b/includes/MWTimestamp.php
@@ -238,7 +238,6 @@
 * @since 1.22
 *
 * @param User $user User to take preferences from
-* @param[out] MWTimestamp $ts Timestamp to adjust
 * @return DateInterval Offset that was applied to the timestamp
 */
public function offsetForUser( User $user ) {
diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php
index 0f80e16..bb99cdc 100644
--- a/includes/filerepo/RepoGroup.php
+++ b/includes/filerepo/RepoGroup.php
@@ -183,10 +183,6 @@
 *   The search title uses the input titles; the other is the final 
post-redirect title.
 *   All titles are returned as string DB keys and the inner array 
is associative.
 * @return array Map of (file name => File objects) for matches
-*
-* @param array $inputItems
-* @param int $flags
-* @return array
 */
function findFiles( array $inputItems, $flags = 0 ) {
if ( !$this->reposInitialised ) {
diff --git a/includes/jobqueue/jobs/DoubleRedirectJob.php 
b/includes/jobqueue/jobs/DoubleRedirectJob.php
index 34c302e..2561f2f 100644
--- a/includes/jobqueue/jobs/DoubleRedirectJob.php
+++ b/includes/jobqueue/jobs/DoubleRedirectJob.php
@@ -84,7 +84,6 @@
/**
 * @param Title $title
 * @param array|bool $params
-* @param int $id
 */
function __construct( $title, $params = false ) {
parent::__construct( 'fixDoubleRedirect', $title, $params );

-- 
To view, visit https://gerrit.wikimedia.org/r/154428
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42d1e3439e5b767be09920d536bee34bcd017ec9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] take amssq33 out of backend texts lists - change (operations/puppet)

2014-08-16 Thread BBlack (Code Review)
BBlack has uploaded a new change for review.

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

Change subject: take amssq33 out of backend texts lists
..

take amssq33 out of backend texts lists

Change-Id: I1199e6b7bb972608b698e0a76d800a2f1ed7f40f
---
M manifests/role/cache.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/27/154427/1

diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp
index 5e1f26d..223e773 100644
--- a/manifests/role/cache.pp
+++ b/manifests/role/cache.pp
@@ -71,7 +71,7 @@
 'esams' => [
 'amssq31.esams.wmnet',
 'amssq32.esams.wmnet',
-'amssq33.esams.wmnet',
+# 'amssq33.esams.wmnet', # powered down for now, RT # 
7933
 'amssq34.esams.wmnet',
 'amssq35.esams.wmnet',
 'amssq36.esams.wmnet',

-- 
To view, visit https://gerrit.wikimedia.org/r/154427
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1199e6b7bb972608b698e0a76d800a2f1ed7f40f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] take amssq33 out of backend texts lists - change (operations/puppet)

2014-08-16 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged.

Change subject: take amssq33 out of backend texts lists
..


take amssq33 out of backend texts lists

Change-Id: I1199e6b7bb972608b698e0a76d800a2f1ed7f40f
---
M manifests/role/cache.pp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  BBlack: Verified; Looks good to me, approved



diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp
index 5e1f26d..223e773 100644
--- a/manifests/role/cache.pp
+++ b/manifests/role/cache.pp
@@ -71,7 +71,7 @@
 'esams' => [
 'amssq31.esams.wmnet',
 'amssq32.esams.wmnet',
-'amssq33.esams.wmnet',
+# 'amssq33.esams.wmnet', # powered down for now, RT # 
7933
 'amssq34.esams.wmnet',
 'amssq35.esams.wmnet',
 'amssq36.esams.wmnet',

-- 
To view, visit https://gerrit.wikimedia.org/r/154427
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1199e6b7bb972608b698e0a76d800a2f1ed7f40f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix info order again because I'm a dumbarse. - change (mediawiki...BlueSky)

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

Change subject: Fix info order again because I'm a dumbarse.
..


Fix info order again because I'm a dumbarse.

Change-Id: I0842a91e76132b46904d5d913d7f1e7a75d2f5ce
---
M resources/css/main.less
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Isarra: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/css/main.less b/resources/css/main.less
index f1576b7..fc4306e 100755
--- a/resources/css/main.less
+++ b/resources/css/main.less
@@ -2244,18 +2244,18 @@
 #contentSub2 {
margin-left: 1em;
 }
+#info span {
+   padding-left: 1.8em;
+   display: inline-block;
+   margin-right: 1em;
+}
 #originators {
/* @embed */
background: url(../../images/edited.png) center left no-repeat;
-   padding-left: 1.8em;
-   display: inline-block;
-   margin-left: 1em;
 }
 #view_count {
/* @embed */
background: url(../../images/viewed.png) center left no-repeat;
-   padding-left: 1.8em;
-   display: inline-block;
 }
 
 #header_toc {

-- 
To view, visit https://gerrit.wikimedia.org/r/154426
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0842a91e76132b46904d5d913d7f1e7a75d2f5ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Isarra 
Gerrit-Reviewer: Isarra 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix info order again because I'm a dumbarse. - change (mediawiki...BlueSky)

2014-08-16 Thread Isarra (Code Review)
Isarra has uploaded a new change for review.

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

Change subject: Fix info order again because I'm a dumbarse.
..

Fix info order again because I'm a dumbarse.

Change-Id: I0842a91e76132b46904d5d913d7f1e7a75d2f5ce
---
M resources/css/main.less
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSky 
refs/changes/26/154426/1

diff --git a/resources/css/main.less b/resources/css/main.less
index f1576b7..fc4306e 100755
--- a/resources/css/main.less
+++ b/resources/css/main.less
@@ -2244,18 +2244,18 @@
 #contentSub2 {
margin-left: 1em;
 }
+#info span {
+   padding-left: 1.8em;
+   display: inline-block;
+   margin-right: 1em;
+}
 #originators {
/* @embed */
background: url(../../images/edited.png) center left no-repeat;
-   padding-left: 1.8em;
-   display: inline-block;
-   margin-left: 1em;
 }
 #view_count {
/* @embed */
background: url(../../images/viewed.png) center left no-repeat;
-   padding-left: 1.8em;
-   display: inline-block;
 }
 
 #header_toc {

-- 
To view, visit https://gerrit.wikimedia.org/r/154426
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0842a91e76132b46904d5d913d7f1e7a75d2f5ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Isarra 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Separated the main page specific CSS from the base module an... - change (mediawiki...BlueSky)

2014-08-16 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Separated the main page specific CSS from the base module and 
moved it to a separate module which is loaded only on the main page.
..

Separated the main page specific CSS from the base module and moved it to
a separate module which is loaded only on the main page.

Change-Id: I7c3c29cb5dca6adfb1ac69de4c8510087df8448a
---
M BlueSky.php
M BlueSky.skin.php
M resources/css/home.css
3 files changed, 18 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSky 
refs/changes/24/154424/1

diff --git a/BlueSky.php b/BlueSky.php
index fbafc7e..560e398 100755
--- a/BlueSky.php
+++ b/BlueSky.php
@@ -53,7 +53,6 @@
#'skins/common/commonContent.css' => array( 'media' => 'screen' 
),
'skins/common/commonInterface.css' => array( 'media' => 
'screen' ),
// Styles custom to this skin
-   'skins/BlueSky/resources/css/home.css' => array( 'media' => 
'screen' ),
'skins/BlueSky/resources/css/nonarticle.css' => array( 'media' 
=> 'screen' ),
'skins/BlueSky/resources/css/searchresults.css' => array( 
'media' => 'screen' ),
'skins/BlueSky/resources/css/special.css' => array( 'media' => 
'screen' ),
@@ -63,6 +62,13 @@
'position' => 'top'
 );
 
+$wgResourceModules['skins.bluesky.mainpage'] = array(
+   'styles' => array(
+   'skins/BlueSky/resources/css/home.css' => array( 'media' => 
'screen' ),
+   ),
+   'position' => 'top'
+);
+
 $wgResourceModules['skins.bluesky.externallinks.123'] = array(
'styles' => array(
'skins/BlueSky/resources/css/externallinks-123.css' => array( 
'media' => 'screen' ),
diff --git a/BlueSky.skin.php b/BlueSky.skin.php
index 003d526..3d663f4 100755
--- a/BlueSky.skin.php
+++ b/BlueSky.skin.php
@@ -73,15 +73,19 @@
} else {
$baseCSSmodules[] = 'skins.bluesky.externallinks.124';
}
-   // Add base CSS (i.e. no themes or ugly hacks) via 
ResourceLoader
-   $out->addModuleStyles( $baseCSSmodules );
 
-   // Ugly LESS hacks
$modules = array();
$title = $this->getTitle();
$request = $this->getRequest();
$action = $request->getVal( 'action', 'view' );
 
+   if ( $title->isMainPage() ) {
+   $baseCSSmodules[] = 'skins.bluesky.mainpage';
+   }
+
+   // Add base CSS (i.e. no themes or ugly hacks) via 
ResourceLoader
+   $out->addModuleStyles( $baseCSSmodules );
+
// Page action specific hacks
switch ( $action ) {
case 'delete':
diff --git a/resources/css/home.css b/resources/css/home.css
index 1ff08c3..3d23cc5 100755
--- a/resources/css/home.css
+++ b/resources/css/home.css
@@ -1,11 +1,11 @@
-.page-Main_Page #intro,
-.page-Main_Page .wh_block {
+#intro,
+.wh_block {
display: none;
 }
-.page-Main_Page #actionbar {
+#actionbar {
height: 18px;
 }
-.page-Main_Page .minor_section {
+.minor_section {
border: none;
padding: 0;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/154424
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c3c29cb5dca6adfb1ac69de4c8510087df8448a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix backwards css - change (mediawiki...BlueSky)

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

Change subject: Fix backwards css
..


Fix backwards css

Also something about better header shrinkage and whitespace

Change-Id: Ibccc05200759ebb55565be64033bf8f48509c0fe
---
M BlueSky.php
M resources/css/main.less
2 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Isarra: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/BlueSky.php b/BlueSky.php
old mode 100644
new mode 100755
index e55e866..fbafc7e
--- a/BlueSky.php
+++ b/BlueSky.php
@@ -259,11 +259,11 @@
 
 /**
  * TOC processing
- * Shamelessly stolen from brickimedia's refreshed skin 
+ * Shamelessly stolen from brickimedia's refreshed skin
  * Currently: 
https://github.com/Brickimedia/Refreshed/blob/master/Refreshed.skin.php#L72
  */
 $blueSkyTOC = '';
- 
+
 function wfTOCCrap( OutputPage &$out, ParserOutput $parseroutput ) {
global $blueSkyTOC;
$blueSkyTOC = $parseroutput->mSections;
diff --git a/resources/css/main.less b/resources/css/main.less
index 1c31dd6..f1576b7 100755
--- a/resources/css/main.less
+++ b/resources/css/main.less
@@ -588,6 +588,8 @@
 }
 #header.shrunk a#logo_link h2.logo-text {
margin-top: 6px;
+   height: 18px;
+   overflow: hidden;
 }
 #header a#logo_link h2.logo-text {
text-transform: uppercase;
@@ -2247,12 +2249,12 @@
background: url(../../images/edited.png) center left no-repeat;
padding-left: 1.8em;
display: inline-block;
+   margin-left: 1em;
 }
 #view_count {
/* @embed */
background: url(../../images/viewed.png) center left no-repeat;
padding-left: 1.8em;
-   margin-left: 1em;
display: inline-block;
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/154423
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibccc05200759ebb55565be64033bf8f48509c0fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Isarra 
Gerrit-Reviewer: Isarra 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix backwards css - change (mediawiki...BlueSky)

2014-08-16 Thread Isarra (Code Review)
Isarra has uploaded a new change for review.

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

Change subject: Fix backwards css
..

Fix backwards css

Also something about better header shrinkage and whitespace

Change-Id: Ibccc05200759ebb55565be64033bf8f48509c0fe
---
M BlueSky.php
M resources/css/main.less
2 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSky 
refs/changes/23/154423/1

diff --git a/BlueSky.php b/BlueSky.php
old mode 100644
new mode 100755
index e55e866..fbafc7e
--- a/BlueSky.php
+++ b/BlueSky.php
@@ -259,11 +259,11 @@
 
 /**
  * TOC processing
- * Shamelessly stolen from brickimedia's refreshed skin 
+ * Shamelessly stolen from brickimedia's refreshed skin
  * Currently: 
https://github.com/Brickimedia/Refreshed/blob/master/Refreshed.skin.php#L72
  */
 $blueSkyTOC = '';
- 
+
 function wfTOCCrap( OutputPage &$out, ParserOutput $parseroutput ) {
global $blueSkyTOC;
$blueSkyTOC = $parseroutput->mSections;
diff --git a/resources/css/main.less b/resources/css/main.less
index 1c31dd6..f1576b7 100755
--- a/resources/css/main.less
+++ b/resources/css/main.less
@@ -588,6 +588,8 @@
 }
 #header.shrunk a#logo_link h2.logo-text {
margin-top: 6px;
+   height: 18px;
+   overflow: hidden;
 }
 #header a#logo_link h2.logo-text {
text-transform: uppercase;
@@ -2247,12 +2249,12 @@
background: url(../../images/edited.png) center left no-repeat;
padding-left: 1.8em;
display: inline-block;
+   margin-left: 1em;
 }
 #view_count {
/* @embed */
background: url(../../images/viewed.png) center left no-repeat;
padding-left: 1.8em;
-   margin-left: 1em;
display: inline-block;
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/154423
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibccc05200759ebb55565be64033bf8f48509c0fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Isarra 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: fbd7923..54be1ee - change (mediawiki/extensions)

2014-08-16 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: fbd7923..54be1ee
..


Syncronize VisualEditor: fbd7923..54be1ee

Change-Id: Ifd65e410634e7db43bd75c02d4a8bc71c15e6847
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index fbd7923..54be1ee 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit fbd7923741b2a221f216dcea7fa322b725e1970b
+Subproject commit 54be1ee6e5eb2bb276152d2a863feb5986fda5c7

-- 
To view, visit https://gerrit.wikimedia.org/r/154422
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd65e410634e7db43bd75c02d4a8bc71c15e6847
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 
Gerrit-Reviewer: Jenkins-mwext-sync 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: fbd7923..54be1ee - change (mediawiki/extensions)

2014-08-16 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: fbd7923..54be1ee
..

Syncronize VisualEditor: fbd7923..54be1ee

Change-Id: Ifd65e410634e7db43bd75c02d4a8bc71c15e6847
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions 
refs/changes/22/154422/1

diff --git a/VisualEditor b/VisualEditor
index fbd7923..54be1ee 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit fbd7923741b2a221f216dcea7fa322b725e1970b
+Subproject commit 54be1ee6e5eb2bb276152d2a863feb5986fda5c7

-- 
To view, visit https://gerrit.wikimedia.org/r/154422
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd65e410634e7db43bd75c02d4a8bc71c15e6847
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update VE core submodule to master (f7fa420) - change (mediawiki...VisualEditor)

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

Change subject: Update VE core submodule to master (f7fa420)
..


Update VE core submodule to master (f7fa420)

New changes:
9371f89 Add local image to demo
be862da Add VE logo to repo and use in image demo and for branding demo page
a2c53ab Factor out wordbreak detection code and run it for simple insertions too

Change-Id: I1be861a69a1cd6eb1e163ac15b18b6d92973ed60
---
M lib/ve
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/lib/ve b/lib/ve
index 03975f8..f7fa420 16
--- a/lib/ve
+++ b/lib/ve
-Subproject commit 03975f8ea18fc69c49eea52dd0735093db2668ee
+Subproject commit f7fa4203c849360130dc8815222c1241131e412d

-- 
To view, visit https://gerrit.wikimedia.org/r/154418
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1be861a69a1cd6eb1e163ac15b18b6d92973ed60
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Rename 'image' to 'inlineImage' - change (VisualEditor/VisualEditor)

2014-08-16 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Rename 'image' to 'inlineImage'
..

Rename 'image' to 'inlineImage'

Makes room for blockImage and makes it consistent with MW images.

Change-Id: Icf94e498ad9be06a7d187e45cc0368773b9c5678
---
M .docs/eg-iframe.html
M build/modules.json
M demos/ve/desktop.html
M demos/ve/mobile.html
R src/ce/nodes/ve.ce.InlineImageNode.js
R src/dm/nodes/ve.dm.InlineImageNode.js
M tests/dm/lineardata/ve.dm.ElementLinearData.test.js
M tests/dm/lineardata/ve.dm.FlatLinearData.test.js
M tests/dm/ve.dm.Document.test.js
M tests/dm/ve.dm.Transaction.test.js
M tests/dm/ve.dm.TransactionProcessor.test.js
M tests/dm/ve.dm.example.js
M tests/index.html
13 files changed, 66 insertions(+), 66 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/21/154421/1

diff --git a/.docs/eg-iframe.html b/.docs/eg-iframe.html
index 3dae30d..2e57b36 100644
--- a/.docs/eg-iframe.html
+++ b/.docs/eg-iframe.html
@@ -22,7 +22,7 @@



-   
+   



@@ -163,7 +163,7 @@



-   
+   



@@ -225,7 +225,7 @@



-   
+   



diff --git a/build/modules.json b/build/modules.json
index 4209ff7..f5df92c 100644
--- a/build/modules.json
+++ b/build/modules.json
@@ -184,7 +184,7 @@
"src/dm/nodes/ve.dm.DivNode.js",
"src/dm/nodes/ve.dm.DocumentNode.js",
"src/dm/nodes/ve.dm.HeadingNode.js",
-   "src/dm/nodes/ve.dm.ImageNode.js",
+   "src/dm/nodes/ve.dm.InlineImageNode.js",
"src/dm/nodes/ve.dm.InternalItemNode.js",
"src/dm/nodes/ve.dm.InternalListNode.js",
"src/dm/nodes/ve.dm.ListItemNode.js",
@@ -246,7 +246,7 @@
"src/ce/nodes/ve.ce.DivNode.js",
"src/ce/nodes/ve.ce.DocumentNode.js",
"src/ce/nodes/ve.ce.HeadingNode.js",
-   "src/ce/nodes/ve.ce.ImageNode.js",
+   "src/ce/nodes/ve.ce.InlineImageNode.js",
"src/ce/nodes/ve.ce.InternalItemNode.js",
"src/ce/nodes/ve.ce.InternalListNode.js",
"src/ce/nodes/ve.ce.ListItemNode.js",
@@ -342,7 +342,7 @@
"src/ce/styles/nodes/ve.ce.CommentNode.css",
"src/ce/styles/nodes/ve.ce.DocumentNode.css",
"src/ce/styles/nodes/ve.ce.GeneratedContentNode.css",
-   "src/ce/styles/nodes/ve.ce.ImageNode.css",
+   "src/ce/styles/nodes/ve.ce.InlineImageNode.css",

"src/ce/styles/annotations/ve.ce.LanguageAnnotation.css",
"src/ce/styles/nodes/ve.ce.ResizableNode.css",
"src/ce/styles/nodes/ve.ce.TableCellNode.css",
diff --git a/demos/ve/desktop.html b/demos/ve/desktop.html
index c5eb5ae..a70491f 100644
--- a/demos/ve/desktop.html
+++ b/demos/ve/desktop.html
@@ -32,7 +32,7 @@



-   
+   



@@ -175,7 +175,7 @@



-   
+   



@@ -237,7 +237,7 @@



-   
+   



diff --git a/demos/ve/mobile.html b/demos/ve/mobile.html
index 6c34df9..6064922 100644
--- a/demos/ve/mobile.html
+++ b/demos/ve/mobile.html
@@ -32,7 +32,7 @@



-   
+   



@@ -176,7 +176,7 @@



-   
+   



@@ -238,7 +238,7 @@



-   
+   



diff --git a/src/ce/nodes/ve.ce.ImageNode.js 
b/src/ce/nodes/ve.ce.InlineImageNode.js
similarity index 77%
rename from src/ce/nodes/ve.ce.ImageNode.js
rename to src/ce/nodes/ve.ce.InlineImageNode.js
index 0e71329..1c8d4ca 100644
--- a/src/ce/nodes/ve.ce.ImageNode.js
+++ b/src/ce/nodes/ve.ce.InlineImageNode.js
@@ -14,10 +14,10 @@
  * @mixins ve.ce.ResizableNode
  *
  * @constructor
- * @param {ve.dm.ImageNode} model Model to observe
+ * @param

[MediaWiki-commits] [Gerrit] Content header style stuff - change (mediawiki...BlueSky)

2014-08-16 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: Content header style stuff
..


Content header style stuff

Format header, add ToC (stolen from refreshed skin)
Format some other random things - content, button placement, etc
Add special mainpage formatting
Possibly other stuff.

Needs cleaning up and integration into the skin itself (basically just tacked 
on the end)

Change-Id: I13b06c4365afec6ea2ac1a6365a7c4cb44232b62
---
M BlueSky.php
M BlueSky.skin.php
M i18n/en.json
M resources/css/home.css
M resources/css/main.less
A resources/images/edited.png
A resources/images/viewed.png
7 files changed, 205 insertions(+), 259 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/BlueSky.php b/BlueSky.php
index d1ac153..e55e866 100644
--- a/BlueSky.php
+++ b/BlueSky.php
@@ -195,6 +195,8 @@
 /**
  * Additional junk for the page head element.
  */
+$wgHooks['OutputPageParserOutput'][] = 'wfTOCCrap';
+
 $wgHooks['BeforePageDisplay'][] = function( &$out, &$skin ) {
//global $wgRequest, $wgUser;
 
@@ -254,3 +256,17 @@
 
return true;
 };
+
+/**
+ * TOC processing
+ * Shamelessly stolen from brickimedia's refreshed skin 
+ * Currently: 
https://github.com/Brickimedia/Refreshed/blob/master/Refreshed.skin.php#L72
+ */
+$blueSkyTOC = '';
+ 
+function wfTOCCrap( OutputPage &$out, ParserOutput $parseroutput ) {
+   global $blueSkyTOC;
+   $blueSkyTOC = $parseroutput->mSections;
+
+   return true;
+}
diff --git a/BlueSky.skin.php b/BlueSky.skin.php
old mode 100644
new mode 100755
index c4c50b7..003d526
--- a/BlueSky.skin.php
+++ b/BlueSky.skin.php
@@ -482,7 +482,7 @@
if ( empty( $categoryLinks['normal'] ) ) {
$t = $embed . '' . $pop;
} else {
-   $t = $embed . implode( "{$pop} | {$embed}", 
$categoryLinks['normal'] ) . $pop;
+   $t = $embed . implode( "{$pop}, {$embed}", 
$categoryLinks['normal'] ) . $pop;
}
if ( !$usebrowser ) {
return $t;
@@ -1549,7 +1549,24 @@
 * outputs a formatted page.
 */
public function execute() {
-   global $wgStylePath, $wgSitename, $wgForumLink;
+   global $wgStylePath, $wgSitename, $wgForumLink, $blueSkyTOC;
+
+   $tocHTML = '';
+   if ( $blueSkyTOC != '' ) {
+   if ( sizeof( $blueSkyTOC ) > 6 ) {
+   $tocHTML .= "";
+   } else {
+   $tocHTML .= "";
+   }
+   $i = 0;
+   foreach ( $blueSkyTOC as $tocpart ) {
+   $class = "toclevel-{$tocpart['toclevel']}";
+   $href = "#{$tocpart['anchor']}";
+   $tocHTML .= "{$tocpart['line']}";
+   $i++;
+   }
+   $tocHTML .= '';
+   }
 
if ( class_exists( 'MobileWikihow' ) ) {
$mobileWikihow = new MobileWikihow();
@@ -1834,8 +1851,6 @@
>

 class="mw-body">
-   html( 'subtitle' ) 
?>
-   data['undelete'] ) { ?>html( 'undelete' ) ?>
data['newtalk'] ) { ?>html( 'newtalk' ) ?>
suppressH1Tag() && 
$this->data['title'] && !isset( $this->data['bodyheading'] ) ) { ?>html( 'title' ) ?>
data['viewcount'] ) 
&& $this->data['viewcount'] ) {
+   echo '';
$this->html( 'viewcount' );
+   echo '';
}
echo $sk->msg( 'word-separator' 
)->escaped();
$lastEdit = $sk->getPageLastEdit( 
$title );
if ( !empty( $lastEdit ) ) {
-   echo '' . 
$lastEdit . '';
+   echo '' 
. $lastEdit . '';
}
?>

+   data['undelete'] ) { ?>html( 'undelete' ) ?>
+   html( 
'subtitle' ) ?>

+   
+   
+   msg( 'bluesky-toc-sections' ) ?>
+   
+   

 
 


-

[MediaWiki-commits] [Gerrit] Remove some presumably dead code - change (mediawiki...Wikibase)

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

Change subject: Remove some presumably dead code
..


Remove some presumably dead code

Change-Id: I43b27ba14979a7c878605b89d896ed3ae5fe0389
---
M repo/includes/EditEntity.php
1 file changed, 1 insertion(+), 6 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/EditEntity.php b/repo/includes/EditEntity.php
index 4e8c016..6e8f6ba 100644
--- a/repo/includes/EditEntity.php
+++ b/repo/includes/EditEntity.php
@@ -790,12 +790,7 @@
}
}
 
-   /**
-* @var Entity $entity
-*/
-   $entity = $this->getNewEntity();
-   $baseRev = $this->getBaseRevision();
-   $base = $baseRev === null ? null : $baseRev->getEntity();
+   $this->getBaseRevision();
 
return $this->status;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/153712
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I43b27ba14979a7c878605b89d896ed3ae5fe0389
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: WikidataJenkins 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Optimized copyright tooltip logic - change (mediawiki...Wikibase)

2014-08-16 Thread Henning Snater (Code Review)
Henning Snater has uploaded a new change for review.

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

Change subject: Optimized copyright tooltip logic
..

Optimized copyright tooltip logic

Change-Id: I6e4d6481b3f91fd45e06f44868bc95b7e6f763be
---
M repo/resources/wikibase.ui.entityViewInit.js
1 file changed, 5 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/19/154419/1

diff --git a/repo/resources/wikibase.ui.entityViewInit.js 
b/repo/resources/wikibase.ui.entityViewInit.js
index cdb5732..6baa8fb 100644
--- a/repo/resources/wikibase.ui.entityViewInit.js
+++ b/repo/resources/wikibase.ui.entityViewInit.js
@@ -60,26 +60,12 @@
return;
}
 
-   var $message = $( '' + 
copyRightMessageHtml + '' );
-   var $activeToolbar = $( '.wb-edit' )
-   // label/description of EditableValue 
always in edit mode if empty, 2nd '.wb-edit'
-   // on PropertyEditTool only appended 
when really being edited by the user though
-   .not( 
'.wb-ui-propertyedittool-editablevalue-ineditmode' )
-   .find( 
'.wikibase-toolbareditgroup-ineditmode' );
+   var $message = $( '' + 
copyRightMessageHtml + '' ),
+   edittoolbar = $( origin ).data( 
'edittoolbar' );
 
-   if( !$activeToolbar.length ) {
-   return; // no toolbar for some reason, 
just stop
-   } else if ( $( 'table.wb-terms' ).hasClass( 
'wb-edit' ) ) {
-   // TODO: When having multiple empty 
EditableValues which are initialized in edit
-   // mode, every EditableValue has the 
same classes assigned. This check should
-   // either be made more generic (not 
just invoked for the terms table) or an
-   // improved detection of the active 
toolbar be implemented.
-   $activeToolbar = origin.getSubject()
-   .find( 
'.wikibase-toolbareditgroup-ineditmode' );
+   if( !edittoolbar ) {
+   return;
}
-
-   var toolbar = $activeToolbar.data( 
'toolbareditgroup' )
-   || $activeToolbar.data( 'toolbar' );
 
var $hideMessage = $( '', {
text: mw.msg( 
'wikibase-copyrighttooltip-acknowledge' )
@@ -98,7 +84,7 @@
content: $message,
permanent: true,
gravity: gravity,
-   $anchor: toolbar.getButton( 
'save' )
+   $anchor: 
edittoolbar.toolbar.editGroup.getButton( 'save' )
} );
 
$hideMessage.on( 'click', function( event ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/154419
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e4d6481b3f91fd45e06f44868bc95b7e6f763be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Implemented jQuery.wikibase.labelview - change (mediawiki...Wikibase)

2014-08-16 Thread Henning Snater (Code Review)
Henning Snater has uploaded a new change for review.

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

Change subject: Implemented jQuery.wikibase.labelview
..

Implemented jQuery.wikibase.labelview

jQuery.wikibase.labelview replaces EditableLabel and LabelEditTool. 
PropertyEditTool and
corresponding components have become obsolete by this change set and are 
removed in a
subsequent change set.

Change-Id: Id36ab9c2dd0a3acb0c19e34c3ce8c8b2e7b954bb
---
M lib/WikibaseLib.hooks.php
M lib/resources/Resources.php
M lib/resources/jquery.wikibase/jquery.wikibase.descriptionview.js
A lib/resources/jquery.wikibase/jquery.wikibase.labelview.js
A lib/resources/jquery.wikibase/themes/default/jquery.wikibase.labelview.css
M lib/resources/templates.php
M lib/resources/wikibase.css
D lib/resources/wikibase.ui.LabelEditTool.js
D lib/resources/wikibase.ui.PropertyEditTool.EditableLabel.js
M lib/resources/wikibase.ui.PropertyEditTool.css
A lib/tests/qunit/jquery.wikibase/jquery.wikibase.labelview.tests.js
D lib/tests/qunit/wikibase.ui.LabelEditTool.tests.js
D lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableLabel.tests.js
M repo/includes/EntityView.php
M repo/resources/Resources.php
M repo/resources/wikibase.ui.entityViewInit.js
M repo/resources/wikibase.ui.initTermBox.js
17 files changed, 961 insertions(+), 555 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/94/154394/6

diff --git a/lib/WikibaseLib.hooks.php b/lib/WikibaseLib.hooks.php
index f7c859a..e19c1d7 100644
--- a/lib/WikibaseLib.hooks.php
+++ b/lib/WikibaseLib.hooks.php
@@ -83,9 +83,7 @@

'tests/qunit/wikibase.RepoApi/wikibase.RepoApi.tests.js',

'tests/qunit/wikibase.RepoApi/wikibase.RepoApiError.tests.js',
 
-   
'tests/qunit/wikibase.ui.LabelEditTool.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.tests.js',
-   
'tests/qunit/wikibase.ui.PropertyEditTool.EditableLabel.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.Interface.tests.js',
 
@@ -170,6 +168,15 @@
),
);
 
+   $testModules['qunit']['jquery.wikibase.labelview.tests'] = 
$moduleBase + array(
+   'scripts' => array(
+   
'tests/qunit/jquery.wikibase/jquery.wikibase.labelview.tests.js',
+   ),
+   'dependencies' => array(
+   'jquery.wikibase.labelview',
+   ),
+   );
+
$testModules['qunit']['jquery.wikibase.listview.tests'] = 
$moduleBase + array(
'scripts' => array(

'tests/qunit/jquery.wikibase/jquery.wikibase.listview.tests.js',
diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php
index dc36178..0ec5dc9 100644
--- a/lib/resources/Resources.php
+++ b/lib/resources/Resources.php
@@ -299,8 +299,6 @@
'wikibase.ui.PropertyEditTool.js',
'wikibase.ui.PropertyEditTool.EditableValue.js',

'wikibase.ui.PropertyEditTool.EditableValue.Interface.js',
-   'wikibase.ui.PropertyEditTool.EditableLabel.js',
-   'wikibase.ui.LabelEditTool.js',
),
'styles' => array(
'wikibase.ui.PropertyEditTool.css'
@@ -502,6 +500,23 @@
),
),
 
+   'jquery.wikibase.labelview' => $moduleTemplate + array(
+   'scripts' => array(
+   'jquery.wikibase/jquery.wikibase.labelview.js'
+   ),
+   'styles' => array(
+   
'jquery.wikibase/themes/default/jquery.wikibase.labelview.css',
+   ),
+   'dependencies' => array(
+   'jquery',
+   'jquery.ui.TemplatedWidget',
+   'jquery.wikibase.edittoolbar',
+   'jquery.wikibase.toolbarcontroller',
+   'wikibase',
+   'wikibase.RepoApiError',
+   ),
+   ),
+
'jquery.wikibase.sitelinkgroupview' => $moduleTemplate + array(
'scripts' => array(

'jquery.wikibase/jquery.wikibase.sitelinkgroupview.js'
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.descriptionview.js 
b/lib/resources/jquery.wiki

[MediaWiki-commits] [Gerrit] Moved initializing basic entity widgets to entityview - change (mediawiki...Wikibase)

2014-08-16 Thread Henning Snater (Code Review)
Henning Snater has uploaded a new change for review.

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

Change subject: Moved initializing basic entity widgets to entityview
..

Moved initializing basic entity widgets to entityview

Widgets for label, description, aliases and site links have been moved to 
entityview.

Change-Id: I41083f9386523e97720ebd44649e8b164c6a716d
---
M lib/resources/Resources.php
M lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
M lib/resources/jquery.wikibase/jquery.wikibase.sitelinkview.js
M lib/resources/templates.php
M lib/resources/wikibase.css
M repo/includes/EntityView.php
M repo/resources/Resources.php
M repo/resources/themes/default/wikibase.toc.css
M repo/resources/wikibase.ui.entityViewInit.js
9 files changed, 275 insertions(+), 240 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/16/154416/1

diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php
index 0ec5dc9..74ffc62 100644
--- a/lib/resources/Resources.php
+++ b/lib/resources/Resources.php
@@ -787,11 +787,17 @@
'jquery.wikibase/jquery.wikibase.entityview.js'
),
'dependencies' => array(
-   'jquery.wikibase.statementview',
-   'jquery.wikibase.claimlistview',
+   'jquery.ui.TemplatedWidget',
+   'jquery.wikibase.aliasesview',
'jquery.wikibase.claimgrouplistview',
+   'jquery.wikibase.claimlistview',
+   'jquery.wikibase.descriptionview',
+   'jquery.wikibase.labelview',
'jquery.wikibase.toolbarcontroller',
-   )
+   'jquery.wikibase.statementview',
+   'wikibase',
+   'wikibase.templates',
+   ),
),
 
'jquery.wikibase.entityselector' => $moduleTemplate + array(
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
index f6de46e..e69a735 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
@@ -1,38 +1,37 @@
 /**
  * @licence GNU GPL v2+
  * @author Daniel Werner < daniel.wer...@wikimedia.de >
+ * @author H. Snater < mediaw...@snater.com >
  */
-( function( wb, $ ) {
+( function( wb, $, mw ) {
'use strict';
+
+   var PARENT = $.ui.TemplatedWidget;
 
 /**
  * View for displaying an entire wikibase entity.
  * @since 0.3
+ * @extends jQuery.ui.TemplatedWidget
  *
- * @option {wb.datamodel.Entity} value
- *
- * @option {wb.store.EntityStore} entityStore
- * @option {wb.ValueViewBuilder} valueViewBuilder
- * @option {wb.AbstractedRepoApi} abstractedRepoApi
- *
- * TODO: this is far from complete, right now this only serves the 
functionality to display an
- *   entity's claims (and statements in case of an item).
+ * @option {wikibase.datamodel.Entity} [value]
+ * @option {wikibase.store.EntityStore} entityStore
+ * @option {wikibase.ValueViewBuilder} valueViewBuilder
+ * @option {wikibase.AbstractedRepoApi} abstractedRepoApi
  */
-$.widget( 'wikibase.entityview', {
-   widgetName: 'wikibase-entityview',
-
+$.widget( 'wikibase.entityview', PARENT, {
/**
-* Section node containing the list of claims of the entity, this node 
has a $.claimlistview
-* widget initialized.
-* @type jQuery
-*/
-   $claims: null,
-
-   /**
-* (Additional) default options
-* @see jQuery.Widget.options
+* @see jQuery.ui.TemplatedWidget
 */
options: {
+   template: 'wikibase-entityview',
+   templateParams: [
+   '', // entity type
+   '', // entity id
+   '', // language code
+   '', // language direction
+   '' // content
+   ],
+   templateShortCuts: {},
value: null,
entityStore: null,
valueViewBuilder: null,
@@ -40,29 +39,155 @@
},
 
/**
-* @see jQuery.Widget._create
+* @type {jQuery}
+*/
+   $label: null,
+
+   /**
+* @type {jQuery}
+*/
+   $description: null,
+
+   /**
+* @type {jQuery}
+*/
+   $aliases: null,
+
+   /**
+* @type {jQuery}
+*/
+   $claims: null,
+
+   /**
+* @see jQuery.ui.TemplatedWidget._create
+*
+* @throws {Error} if a required options is missing.
 */
_create: function() {
-   

[MediaWiki-commits] [Gerrit] Implemented jQuery.wikibase.descriptionview - change (mediawiki...Wikibase)

2014-08-16 Thread Henning Snater (Code Review)
Henning Snater has uploaded a new change for review.

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

Change subject: Implemented jQuery.wikibase.descriptionview
..

Implemented jQuery.wikibase.descriptionview

jQuery.wikibase.descriptionview replaces DescriptionEditTool and 
EditableDescription

Change-Id: I3bbc60aac809e5268e38ecca3013ae4fc0b66fde
---
M lib/WikibaseLib.hooks.php
M lib/resources/Resources.php
M lib/resources/jquery.wikibase/jquery.wikibase.aliasesview.js
A lib/resources/jquery.wikibase/jquery.wikibase.descriptionview.js
A 
lib/resources/jquery.wikibase/themes/default/jquery.wikibase.descriptionview.css
M lib/resources/jquery.wikibase/toolbar/edittoolbar.js
M lib/resources/templates.php
M lib/resources/wikibase.css
D lib/resources/wikibase.ui.DescriptionEditTool.js
D lib/resources/wikibase.ui.PropertyEditTool.EditableDescription.js
M lib/resources/wikibase.ui.PropertyEditTool.css
A lib/tests/qunit/jquery.wikibase/jquery.wikibase.descriptionview.tests.js
D lib/tests/qunit/wikibase.ui.DescriptionEditTool.tests.js
D lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableDescription.tests.js
M repo/includes/EntityView.php
M repo/resources/Resources.php
M repo/resources/wikibase.ui.entityViewInit.js
M repo/resources/wikibase.ui.initTermBox.js
18 files changed, 1,031 insertions(+), 488 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/88/154388/4

diff --git a/lib/WikibaseLib.hooks.php b/lib/WikibaseLib.hooks.php
index 65505d9..f7c859a 100644
--- a/lib/WikibaseLib.hooks.php
+++ b/lib/WikibaseLib.hooks.php
@@ -83,10 +83,8 @@

'tests/qunit/wikibase.RepoApi/wikibase.RepoApi.tests.js',

'tests/qunit/wikibase.RepoApi/wikibase.RepoApiError.tests.js',
 
-   
'tests/qunit/wikibase.ui.DescriptionEditTool.tests.js',

'tests/qunit/wikibase.ui.LabelEditTool.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.tests.js',
-   
'tests/qunit/wikibase.ui.PropertyEditTool.EditableDescription.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableLabel.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.Interface.tests.js',
@@ -163,6 +161,15 @@
),
);
 
+   $testModules['qunit']['jquery.wikibase.descriptionview.tests'] 
= $moduleBase + array(
+   'scripts' => array(
+   
'tests/qunit/jquery.wikibase/jquery.wikibase.descriptionview.tests.js',
+   ),
+   'dependencies' => array(
+   'jquery.wikibase.descriptionview',
+   ),
+   );
+
$testModules['qunit']['jquery.wikibase.listview.tests'] = 
$moduleBase + array(
'scripts' => array(

'tests/qunit/jquery.wikibase/jquery.wikibase.listview.tests.js',
diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php
index 8d3aab4..dc36178 100644
--- a/lib/resources/Resources.php
+++ b/lib/resources/Resources.php
@@ -299,10 +299,8 @@
'wikibase.ui.PropertyEditTool.js',
'wikibase.ui.PropertyEditTool.EditableValue.js',

'wikibase.ui.PropertyEditTool.EditableValue.Interface.js',
-   
'wikibase.ui.PropertyEditTool.EditableDescription.js',
'wikibase.ui.PropertyEditTool.EditableLabel.js',
'wikibase.ui.LabelEditTool.js',
-   'wikibase.ui.DescriptionEditTool.js',
),
'styles' => array(
'wikibase.ui.PropertyEditTool.css'
@@ -487,6 +485,23 @@
),
),
 
+   'jquery.wikibase.descriptionview' => $moduleTemplate + array(
+   'scripts' => array(
+   
'jquery.wikibase/jquery.wikibase.descriptionview.js'
+   ),
+   'styles' => array(
+   
'jquery.wikibase/themes/default/jquery.wikibase.descriptionview.css',
+   ),
+   'dependencies' => array(
+   'jquery.inputautoexpand',
+   'jquery.ui.TemplatedWidget',
+   'jquery.wikibase.edittoolbar',
+   'jquery.wikibase.toolbarcontroller',
+   'wikibase',
+  

[MediaWiki-commits] [Gerrit] Publish when Control+S pressed on Special:CX - change (mediawiki...ContentTranslation)

2014-08-16 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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

Change subject: Publish when Control+S pressed on Special:CX
..

Publish when Control+S pressed on Special:CX

Observed that users use this short cut in between translating.

Change-Id: I5ba48b33e07951fea3dd3a1b2879d7c109aed0b6
---
M modules/translation/ext.cx.publish.js
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/20/154420/1

diff --git a/modules/translation/ext.cx.publish.js 
b/modules/translation/ext.cx.publish.js
index 38bab68..d4a8aa7 100644
--- a/modules/translation/ext.cx.publish.js
+++ b/modules/translation/ext.cx.publish.js
@@ -128,5 +128,13 @@
 
$( function () {
mw.hook( 'mw.cx.publish' ).add( $.proxy( publish, this ) );
+   // Publish when CTRL+S is pressed.
+   $( document ).on( 'keydown', function ( e ) {
+   if ( e.ctrlKey && ( e.which === 83 ) ) {
+   e.preventDefault();
+   mw.hook( 'mw.cx.publish' ).fire();
+   return false;
+   }
+   } );
} );
 }( jQuery, mediaWiki ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/154420
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ba48b33e07951fea3dd3a1b2879d7c109aed0b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use consistently window.location.href instead of location.href - change (mediawiki...Wikibase)

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

Change subject: Use consistently window.location.href instead of location.href
..


Use consistently window.location.href instead of location.href

Change-Id: I43279c6219c58234046dbb8872ffe9ccd4f686cb
---
M repo/resources/wikibase.ui.entitysearch.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/resources/wikibase.ui.entitysearch.js 
b/repo/resources/wikibase.ui.entitysearch.js
index 63cbb55..0950ef6 100644
--- a/repo/resources/wikibase.ui.entitysearch.js
+++ b/repo/resources/wikibase.ui.entitysearch.js
@@ -44,7 +44,7 @@
&& /^key/.test( 
event.originalEvent.type )
&& !( item instanceof 
$.ui.ooMenu.CustomItem )
) {
-   location.href = 
item.getEntityStub().url;
+   window.location.href = 
item.getEntityStub().url;
}
} );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/154305
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I43279c6219c58234046dbb8872ffe9ccd4f686cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader 
Gerrit-Reviewer: Gerrit Patch Uploader 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: WikidataJenkins 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update VE core submodule to master (f7fa420) - change (mediawiki...VisualEditor)

2014-08-16 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: Update VE core submodule to master (f7fa420)
..

Update VE core submodule to master (f7fa420)

New changes:
9371f89 Add local image to demo
be862da Add VE logo to repo and use in image demo and for branding demo page
a2c53ab Factor out wordbreak detection code and run it for simple insertions too

Change-Id: I1be861a69a1cd6eb1e163ac15b18b6d92973ed60
---
M lib/ve
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/18/154418/1

diff --git a/lib/ve b/lib/ve
index 03975f8..f7fa420 16
--- a/lib/ve
+++ b/lib/ve
-Subproject commit 03975f8ea18fc69c49eea52dd0735093db2668ee
+Subproject commit f7fa4203c849360130dc8815222c1241131e412d

-- 
To view, visit https://gerrit.wikimedia.org/r/154418
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1be861a69a1cd6eb1e163ac15b18b6d92973ed60
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Better handing for redirects in MockRepositors - change (mediawiki...Wikibase)

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

Change subject: Better handing for redirects in MockRepositors
..


Better handing for redirects in MockRepositors

Also adds more tests.

Change-Id: I9ac1493f3b57962fa12ecb6483c9081eeddea637
---
M lib/tests/phpunit/MockRepository.php
M lib/tests/phpunit/MockRepositoryTest.php
2 files changed, 53 insertions(+), 5 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/tests/phpunit/MockRepository.php 
b/lib/tests/phpunit/MockRepository.php
index 1da87d5..74709d0 100644
--- a/lib/tests/phpunit/MockRepository.php
+++ b/lib/tests/phpunit/MockRepository.php
@@ -354,6 +354,8 @@
$rev->user = $user;
}
 
+   unset( $this->redirects[$key] );
+
$this->entities[$key][$revision] = $rev;
ksort( $this->entities[$key] );
 
@@ -368,6 +370,11 @@
 */
public function putRedirect( EntityRedirect $redirect ) {
$key = $redirect->getEntityId()->getSerialization();
+
+   if ( isset( $this->entities[$key] ) ) {
+   $this->removeEntity( $redirect->getEntityId() );
+   }
+
$this->redirects[$key] = $redirect;
}
 
@@ -379,15 +386,20 @@
 * @return Entity
 */
public function removeEntity( EntityId $id ) {
-   $oldEntity = $this->getEntity( $id );
+   try {
+   $oldEntity = $this->getEntity( $id );
 
-   if ( $oldEntity && ( $oldEntity instanceof Item ) ) {
-   // clean up old sitelinks
-   $this->unregisterSiteLinks( $oldEntity );
+   if ( $oldEntity && ( $oldEntity instanceof Item ) ) {
+   // clean up old sitelinks
+   $this->unregisterSiteLinks( $oldEntity );
+   }
+   } catch ( StorageException $ex ) {
+   $oldEntity = null; // ignore
}
 
$key = $id->getPrefixedId();
unset( $this->entities[$key] );
+   unset( $this->redirects[$key] );
 
return $oldEntity;
}
diff --git a/lib/tests/phpunit/MockRepositoryTest.php 
b/lib/tests/phpunit/MockRepositoryTest.php
index f080c4c..7328836 100644
--- a/lib/tests/phpunit/MockRepositoryTest.php
+++ b/lib/tests/phpunit/MockRepositoryTest.php
@@ -551,7 +551,13 @@
$this->setExpectedException( $error );
}
 
-   $rev = $this->repo->saveEntity( $entity, '', 
$GLOBALS['wgUser'], $flags, $baseRevId );
+   $rev = $this->repo->saveEntity( $entity, 'f00', 
$GLOBALS['wgUser'], $flags, $baseRevId );
+
+   $logEntry = $this->repo->getLogEntry( $rev->getRevision() );
+   $this->assertNotNull( $logEntry );
+   $this->assertEquals( $rev->getRevision(), $logEntry['revision'] 
);
+   $this->assertEquals( $entity->getId()->getSerialization(), 
$logEntry['entity'] );
+   $this->assertEquals( 'f00', $logEntry['summary'] );
 
$this->assertEquals( $entity->getLabels(), 
$rev->getEntity()->getLabels() );
$this->assertEquals( $entity->getLabels(), 
$this->repo->getEntity( $entity->getId() )->getLabels() );
@@ -559,7 +565,29 @@
// test we can't mess with entities in the repo
$entity->setLabel( 'en', 'STRANGE' );
$entity = $this->repo->getEntity( $entity->getId() );
+   $this->assertNotNull( $entity );
$this->assertNotEquals( 'STRANGE', $entity->getLabel( 'en' ) );
+   }
+
+   public function testSaveRedirect() {
+   $this->setupGetEntities();
+
+   $q10 = new ItemId( 'Q10' );
+   $q1 = new ItemId( 'Q1' );
+
+   $redirect = new EntityRedirect( $q10, $q1 );
+   $revId = $this->repo->saveRedirect( $redirect, 'redirected Q10 
to Q1', $GLOBALS['wgUser'] );
+
+   $this->assertGreaterThan( 0, $revId );
+
+   $logEntry = $this->repo->getLogEntry( $revId );
+   $this->assertNotNull( $logEntry );
+   $this->assertEquals( $revId, $logEntry['revision'] );
+   $this->assertEquals( 
$redirect->getEntityId()->getSerialization(), $logEntry['entity'] );
+   $this->assertEquals( 'redirected Q10 to Q1', 
$logEntry['summary'] );
+
+   $this->setExpectedException( 
'Wikibase\Lib\Store\UnresolvedRedirectException' );
+   $this->repo->getEntity( $q10 );
}
 
public function testGetLogEntry() {
@@ -619,6 +647,14 @@
$this->assertFalse( $this->repo->hasEntity( $item->getId() ) );
}
 
+   public funct

[MediaWiki-commits] [Gerrit] Remove span-wrapping of images - change (VisualEditor/VisualEditor)

2014-08-16 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Remove span-wrapping of images
..

Remove span-wrapping of images

This hack is no longer neccessary now that we no longer
use shields.

Change-Id: I33903a75ebde6d0930ca615710085b3efd2148a0
---
M demos/ve/pages/image.html
M src/ce/nodes/ve.ce.ImageNode.js
2 files changed, 14 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/17/154417/1

diff --git a/demos/ve/pages/image.html b/demos/ve/pages/image.html
index 90cd2bb..860cf9c 100644
--- a/demos/ve/pages/image.html
+++ b/demos/ve/pages/image.html
@@ -1,3 +1,4 @@
 This is a local image: foo
 Remote image outside of paragraph:
-
\ No newline at end of file
+
+Image without dimensions attributes: 
\ No newline at end of file
diff --git a/src/ce/nodes/ve.ce.ImageNode.js b/src/ce/nodes/ve.ce.ImageNode.js
index e5d619a..0e71329 100644
--- a/src/ce/nodes/ve.ce.ImageNode.js
+++ b/src/ce/nodes/ve.ce.ImageNode.js
@@ -25,21 +25,20 @@
// Parent constructor
ve.ce.LeafNode.call( this, model, config );
 
-   // Properties
-   this.$image = this.$( '' ).appendTo( this.$element );
-
// Mixin constructors
ve.ce.FocusableNode.call( this );
-   ve.ce.ResizableNode.call( this, this.$image, config );
+   ve.ce.ResizableNode.call( this, this.$element, config );
 
// Events
-   this.$element.on( 'click', ve.bind( this.onClick, this ) );
-   this.$image.on( 'load', ve.bind( this.onLoad, this ) );
+   this.$element.on( {
+   'click': ve.bind( this.onClick, this ),
+   'load': ve.bind( this.onLoad, this )
+   } );
this.model.connect( this, { attributeChange: 'onAttributeChange' } );
 
// Initialization
-   this.$element.addClass( 've-ce-imageNode' );
-   this.$image
+   this.$element
+   .addClass( 've-ce-imageNode' )
.attr( {
alt: this.model.getAttribute( 'alt' ),
src: this.getResolvedAttribute( 'src' )
@@ -61,7 +60,7 @@
 
 ve.ce.ImageNode.static.name = 'image';
 
-ve.ce.ImageNode.static.tagName = 'span';
+ve.ce.ImageNode.static.tagName = 'img';
 
 /* Methods */
 
@@ -75,10 +74,10 @@
  */
 ve.ce.ImageNode.prototype.onAttributeChange = function ( key, from, to ) {
if ( key === 'src' ) {
-   this.$image.attr( 'src', this.getResolvedAttribute( 'src' ) );
+   this.$element.attr( 'src', this.getResolvedAttribute( 'src' ) );
}
if ( key === 'width' || key === 'height' ) {
-   this.$image.css( key, to !== null ? to : '' );
+   this.$element.css( key, to !== null ? to : '' );
}
 };
 
@@ -110,8 +109,8 @@
  */
 ve.ce.ImageNode.prototype.onLoad = function () {
this.setOriginalDimensions( {
-   width: this.$image.prop( 'naturalWidth' ),
-   height: this.$image.prop( 'naturalHeight' )
+   width: this.$element.prop( 'naturalWidth' ),
+   height: this.$element.prop( 'naturalHeight' )
} );
 };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/154417
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33903a75ebde6d0930ca615710085b3efd2148a0
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove span-wrapping of link='' images - change (mediawiki...VisualEditor)

2014-08-16 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Remove span-wrapping of link='' images
..

Remove span-wrapping of link='' images

This hack is no longer neccessary now that we no longer
use shields.

Change-Id: I2194b16273b1ebe6e8d9360957cc7eab856dae13
---
M modules/ve-mw/ce/nodes/ve.ce.MWInlineImageNode.js
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/15/154415/1

diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWInlineImageNode.js 
b/modules/ve-mw/ce/nodes/ve.ce.MWInlineImageNode.js
index fc5af5b..ab91e56 100644
--- a/modules/ve-mw/ce/nodes/ve.ce.MWInlineImageNode.js
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWInlineImageNode.js
@@ -25,11 +25,7 @@
this.$element = this.$( '' ).addClass( 'image' );
this.$image = this.$( '' ).appendTo( this.$element );
} else {
-   // For inline images that are not linked (empty linkto=) we 
intentionally don't match output
-   // of MW Parser, instead we wrap those images in span so 
selection and hover (based on
-   // shields) can work well. It might change in the future when 
we improve our selection.
-   this.$element = this.$( '' );
-   this.$image = this.$( '' ).appendTo( this.$element );
+   this.$element = this.$image = this.$( '' ).appendTo( 
this.$element );
}
 
// Mixin constructors

-- 
To view, visit https://gerrit.wikimedia.org/r/154415
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2194b16273b1ebe6e8d9360957cc7eab856dae13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] HHVM: - change (operations/puppet)

2014-08-16 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: HHVM:
..

HHVM:

* Set hhvm.debug.core_dump_report_directory to /var/log/hhvm, which
  will make it write stack traces to this directory.
* Update the Upstart job configuration to look for a stack trace in
  $HHVM_LOG_DIR rather than in /tmp.
* Configure rsyslog to write HHVM's error log to /var/log/hhvm.log,
  and to rotate the file when its size exceeds 100 Mb.
  (It's not /var/log/hhvm/error.log because that directory has to be
  owned by HHVM's uid/guid, but rsyslog drops privileges and runs as
  syslog:adm.)
* The output channel does not discard the message, and its priority
  is lower than MediaWiki's rsyslog config, so MediaWiki is still
  able to capture HHVM log messages for fluorine.
* Configure logrotate to rotate hhvm.log and stacktraces.

Change-Id: I11b85c87a8902de28cba9f71840885a9864ec1df
---
M modules/hhvm/files/hhvm.conf
A modules/hhvm/files/hhvm.logrotate
A modules/hhvm/files/hhvm.rsyslog.conf
M modules/hhvm/manifests/init.pp
4 files changed, 79 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/14/154414/1

diff --git a/modules/hhvm/files/hhvm.conf b/modules/hhvm/files/hhvm.conf
index 282d251..31d1598 100644
--- a/modules/hhvm/files/hhvm.conf
+++ b/modules/hhvm/files/hhvm.conf
@@ -39,12 +39,17 @@
   # Read the PID of the exited HHVM process and remove the PID file.
   read PID /dev/null 2>&1 || true
+endscript
+}
+
+# Stack trace logs generated by HHVM when it crashes
+/var/log/hhvm/stacktrace.*.log.* {
+daily
+missingok
+rotate 100
+nocompress
+nocreate
+noolddir
+}
diff --git a/modules/hhvm/files/hhvm.rsyslog.conf 
b/modules/hhvm/files/hhvm.rsyslog.conf
new file mode 100644
index 000..16ba251
--- /dev/null
+++ b/modules/hhvm/files/hhvm.rsyslog.conf
@@ -0,0 +1,4 @@
+# Route syslog messages emitted by HHVM to /var/log/hhvm.log
+# and rotate the log file when it exceeds 100 Mb.
+$outchannel hhvm,/var/log/hhvm.log,1,/usr/sbin/logrotate -f 
/etc/logrotate.d/hhvm
+:programname, startswith, "hhvm" :omfile:$hhvm
diff --git a/modules/hhvm/manifests/init.pp b/modules/hhvm/manifests/init.pp
index 948da27..e039dab 100644
--- a/modules/hhvm/manifests/init.pp
+++ b/modules/hhvm/manifests/init.pp
@@ -30,6 +30,24 @@
 # documentation is getting better, but expect to have to dig around in
 # the source code.
 #
+#
+# === Logging
+#
+# By default, this module configures HHVM to log to syslog, and it
+# configures rsyslog to route HHVM messages to /var/log/hhvm.log.
+# Finally, it configures HHVM to write stack traces to /var/log/hhvm.
+#
+#   /var/log
+#   │
+#   ├── hhvm.log
+#   │
+#   └── hhvm
+#   │
+#   ├── stacktrace..log
+#   │
+#   └── stacktrace..log, ...
+#
+#
 # === Parameters
 #
 # [*user*]
@@ -44,6 +62,7 @@
 #
 # [*fcgi_settings*]
 #   Ditto, except for FastCGI mode.
+#
 #
 # === Examples
 #
@@ -84,7 +103,10 @@
 },
 mysql=> {
 slow_query_threshold => 10 * 1000,  # milliseconds
-}
+},
+debug=> {
+core_dump_report_directory => '/var/log/hhvm',
+},
 },
 }
 
@@ -200,7 +222,23 @@
 }
 
 
-## Run-time directories
+## Run-time data and logging
+
+rsyslog::conf { 'hhvm':
+source   => 'puppet:///modules/hhvm/hhvm.rsyslog.conf',
+priority => 20,
+require  => File['/etc/hhvm/logrotate.d/hhvm'],
+before   => Service['hhvm'],
+}
+
+file { '/etc/hhvm/logrotate.d/hhvm':
+source  => 'puppet:///modules/hhvm/hhvm.logrotate',
+owner   => 'root',
+group   => 'root',
+mode=> '0444',
+require => File['/var/log/hhvm'],
+before  => Service['hhvm'],
+}
 
 file { [ '/run/hhvm', '/var/log/hhvm' ]:
 ensure => directory,

-- 
To view, visit https://gerrit.wikimedia.org/r/154414
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11b85c87a8902de28cba9f71840885a9864ec1df
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Decrease specificity in badge css selectors - change (mediawiki...Wikibase)

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

Change subject: Decrease specificity in badge css selectors
..


Decrease specificity in badge css selectors

Change-Id: I9c7144731a2d896a29040ad033decb3b7b4d6c59
---
M lib/resources/wikibase.css
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/resources/wikibase.css b/lib/resources/wikibase.css
index d02627f..f59382a 100644
--- a/lib/resources/wikibase.css
+++ b/lib/resources/wikibase.css
@@ -954,7 +954,7 @@
width: 100%;
 }
 
-table.wb-sitelinks .wb-badge {
+.wb-badge {
/* SVG support using a transparent gradient to guarantee cross-browser
 * compatibility (browsers able to understand gradient syntax support 
also SVG).
 * 
http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique */
@@ -969,7 +969,7 @@
padding: 0 8px;
 }
 
-table.wb-sitelinks .wb-badge-empty {
+.wb-badge-empty {
background-image: url(images/wb-badges-empty.png);
/* @embed */
background-image: -webkit-linear-gradient(transparent, transparent), 
url(images/wb-badges-empty.svg);

-- 
To view, visit https://gerrit.wikimedia.org/r/154325
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9c7144731a2d896a29040ad033decb3b7b4d6c59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: WikidataJenkins 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] APISite.siteinfo automatically fetches the results - change (pywikibot/core)

2014-08-16 Thread XZise (Code Review)
XZise has uploaded a new change for review.

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

Change subject: APISite.siteinfo automatically fetches the results
..

APISite.siteinfo automatically fetches the results

This changes it from a dict to a Wrapper which automatically
queries the result if they aren't cached. It is basically merging
APISite._add_siteinfo, APISite._getsiteinfo and APISite.siteinfo.

It'll always caches the result of the siprop "general", because
otherwise it would be unable to determine if a requested property
is in fact a property of "general" (e.g. APISite.case()).

It also supports the "in" operator which tells you if the value is
cached. Setting it from the outside is not possible anymore.

Change-Id: Ib5b6d84f0baf60376cdc25bc715d346c1579da1f
---
M pywikibot/site.py
M tests/site_tests.py
2 files changed, 97 insertions(+), 108 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/13/154413/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index 63fca60..420c4be 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -890,6 +890,49 @@
 return decorator
 
 
+class SiteinfoWrapper(object):
+def __init__(self, site):
+self._site = site
+self._general = {}
+self._cache = {}
+
+def __getitem__(self, key):
+result = self.get(key)  # caches and doesn't force it
+if result is None:
+raise KeyError(key)
+else:
+return result
+
+def _is_general(self, key, force):
+if not self._general or force:
+self._general = self._site._get_siteinfo('general')
+return key in self._general
+
+def get(self, key, default=None, cache=True, force=False):
+if not force and self._general and key in self:
+if key == 'general':
+return self._general
+elif key in self._general:
+return self._general[key]
+elif key in self._cache:
+return self._cache[key]
+elif self._is_general(key, force):
+return self._general[key]
+else:
+new_info = self._site._get_siteinfo(key, force)
+if not new_info and default is not None:
+new_info = default
+if cache and new_info:
+self._cache[key] = new_info
+return new_info
+
+def __contains__(self, key):
+if key == 'general':
+return bool(self._general)
+else:
+return key in self._general or key in self._cache
+
+
 class APISite(BaseSite):
 
 """API interface to MediaWiki site.
@@ -924,6 +967,7 @@
 BaseSite.__init__(self, code, fam, user, sysop)
 self._msgcache = {}
 self._loginstatus = LoginStatus.NOT_ATTEMPTED
+self._siteinfo = SiteinfoWrapper(self)
 return
 
 @staticmethod
@@ -1067,8 +,6 @@
  if sysop else LoginStatus.AS_USER)
 else:
 self._loginstatus = LoginStatus.NOT_LOGGED_IN  # failure
-if not hasattr(self, "_siteinfo"):
-self._getsiteinfo()
 
 forceLogin = login  # alias for backward-compatibility
 
@@ -1385,7 +1427,7 @@
 if not hasattr(self, "_magicwords"):
 try:
 # don't cache in _siteinfo, because we cache it in _magicwords
-magicwords = self._add_siteinfo("magicwords", False)
+magicwords = self.siteinfo.get("magicwords", [], False)
 self._magicwords = dict((item["name"], item["aliases"])
 for item in magicwords)
 except api.APIError:
@@ -1432,9 +1474,9 @@
 """Return list of localized PAGENAMEE tags for the site."""
 return self.getmagicwords("pagenamee")
 
-def _add_siteinfo(self, prop, cache, force=False):
+def _get_siteinfo(self, prop, force=False):
 """
-Retrieve additional siteinfo and optionally cache it.
+Retrieve siteinfo and optionally cache it.
 
 Queries the site and returns the properties. It can cache the value
 so that future queries will access the cache. With C{force} set to
@@ -1450,12 +1492,6 @@
 @return: The properties of the site.
 @rtype: various (depends on prop)
 """
-if not hasattr(self, '_siteinfo'):
-force = True  # if it doesn't exists there won't be a cache
-if cache:  # but only initialise cache if that is requested
-self._getsiteinfo()
-if not force and prop in self._siteinfo:
-return self._siteinfo[prop]
 data = pywikibot.data.api.CachedRequest(
 expiry=0 if force else pywikibot.config.API_config_expiry,
 site=self,
@@ -1463,84 +1499,9 @@
 meta='siteinfo',
 siprop=prop).submit()
 try:
-prop_data = data

[MediaWiki-commits] [Gerrit] Add GenericPass test for MediaWikiBreaks standard - change (mediawiki...codesniffer)

2014-08-16 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Add GenericPass test for MediaWikiBreaks standard
..

Add GenericPass test for MediaWikiBreaks standard

Change-Id: Ied8fd51f6eab452de2be8b0fdf7485181e3e07e3
---
A MediaWikiBreaks/Tests/GenericPass.php
M MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
2 files changed, 104 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/12/154412/1

diff --git a/MediaWikiBreaks/Tests/GenericPass.php 
b/MediaWikiBreaks/Tests/GenericPass.php
new file mode 100644
index 000..e56b7a5
--- /dev/null
+++ b/MediaWikiBreaks/Tests/GenericPass.php
@@ -0,0 +1,103 @@
+https://www.mediawiki.org/wiki/Manual:Coding_conventions
+
+/**
+ * @param $outputtype
+ * @param null $ts
+ * @return null
+ */
+function wfTimestampOrNull( $outputtype = TS_UNIX, $ts = null ) {
+   if ( is_null( $ts ) ) {
+   return null;
+   } else {
+   return wfTimestamp( $outputtype, $ts );
+   }
+}
+
+$wgAutopromote = array(
+   'autoconfirmed' => array( '&',
+   array( APCOND_EDITCOUNT, &$wgAutoConfirmCount ),
+   array( APCOND_AGE, &$wgAutoConfirmAge ),
+   ),
+);
+
+$namespaceNames = array(
+   NS_MEDIA=> 'Media',
+   NS_SPECIAL  => 'Special',
+   NS_MAIN => '',
+);
+
+class FooBar extends BarBaz implements SomethingSomewhere {
+
+   private $foo = 'halalalalalaa';
+
+   public $var;
+
+   public function iDoCaseStuff( $word ) {
+   switch ( $word ) {
+   case 'lorem':
+   case 'ipsum':
+   $bar = 2;
+   break;
+   case 'dolor':
+   $bar = 3;
+   break;
+   default:
+   $bar = 0;
+   }
+   return strtolower( $bar ) == 'on'
+   || strtolower( $bar ) == 'true'
+   || strtolower( $bar ) == 'yes'
+   || preg_match( "/^\s*[+-]?0*[1-9]/", $bar );
+   }
+
+   public function iDoCaseStuffTwo( $word ) {
+   switch ( $word ) {
+   case 'lorem':
+   case 'ipsum':
+   $bar = 2;
+   break;
+   case 'dolor':
+   $bar = 3;
+   break;
+   default:
+   $bar = 0;
+   }
+   return $bar;
+   }
+
+   public function fooBarBaz( $par ) {
+   global $wgBarBarBar, $wgUser;
+
+   if ( $par ) {
+   return;
+   }
+
+   $wgBarBarBar->dobar(
+   Xml::fieldset( wfMessage( 'importinterwiki' )->text() ) 
.
+   Xml::openElement( 'form', array( 'method' => 'post', 
'action' => $par,
+   'id' => 'mw-import-interwiki-form' ) ) .
+   wfMessage( 'import-interwiki-text' )->parse() .
+   Xml::hidden( 'action', 'submit' ) .
+   Xml::hidden( 'source', 'interwiki' ) .
+   Xml::hidden( 'editToken', $wgUser->editToken() ),
+   'secondArgument'
+   );
+
+   $foo = $par;
+   return $foo + $wgBarBarBar + $this->foo;
+   }
+
+   private function someFunction( FooBar $baz ) {
+   $foo = array(
+   $baz,
+   'memememememememee',
+   );
+   $cat = array_merge( $foo, array( 'barn', 'door' ) );
+   return $cat;
+   }
+}
+
+// This file has a new line at the end!
diff --git a/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php 
b/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
index 0a3d4c7..e9f5e77 100644
--- a/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
+++ b/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
@@ -22,6 +22,7 @@
 */
protected function getExpectedResults() {
return array(
+   'GenericPass.php' => array(),
'RemovedStuff/Class.php' => array(
'error' => array(
4 => 1,

-- 
To view, visit https://gerrit.wikimedia.org/r/154412
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied8fd51f6eab452de2be8b0fdf7485181e3e07e3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits maili

[MediaWiki-commits] [Gerrit] Also catch use of global functions - change (mediawiki...codesniffer)

2014-08-16 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Also catch use of global functions
..

Also catch use of global functions

Change-Id: I6b7efae7027a4667d8eb02e9d69ce1d4c34b3928
---
M MediaWikiBreaks/Sniffs/RemovedStuff/MethodSniff.php
M MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
M MediaWikiBreaks/Tests/RemovedStuff/Method.php
3 files changed, 22 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/11/154411/1

diff --git a/MediaWikiBreaks/Sniffs/RemovedStuff/MethodSniff.php 
b/MediaWikiBreaks/Sniffs/RemovedStuff/MethodSniff.php
index aa0bc23..ee459c5 100644
--- a/MediaWikiBreaks/Sniffs/RemovedStuff/MethodSniff.php
+++ b/MediaWikiBreaks/Sniffs/RemovedStuff/MethodSniff.php
@@ -89,6 +89,7 @@
public function register() {
return array(
T_DOUBLE_COLON,
+   T_STRING,
);
}
 
@@ -100,8 +101,14 @@
$className = $tokens[$phpcsFile->findPrevious( 
T_STRING, $stackPtr )]['content'];
$methodName = $tokens[$phpcsFile->findNext( T_STRING, 
$stackPtr )]['content'];
$fullMethod = $className . $token['content'] . 
$methodName;
-   } else {
-   return null;
+   } elseif( $token['type'] === 'T_STRING' ) {
+   if( $phpcsFile->findNext( T_OPEN_PARENTHESIS, $stackPtr 
) <= $stackPtr +2 ) {
+   $fullMethod = $token['content'];
+   }
+   }
+
+   if( !isset( $fullMethod ) ) {
+   return;
}
 
foreach( $this->removedStuff as $version => $methods ) {
diff --git a/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php 
b/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
index 11808e9..0a3d4c7 100644
--- a/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
+++ b/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
@@ -43,6 +43,9 @@
'RemovedStuff/Method.php' => array(
'error' => array(
4 => 1,
+   9 => 1,
+   11 => 1,
+   13 => 1,
),
),
);
diff --git a/MediaWikiBreaks/Tests/RemovedStuff/Method.php 
b/MediaWikiBreaks/Tests/RemovedStuff/Method.php
index 3e48d4b..db05ee1 100644
--- a/MediaWikiBreaks/Tests/RemovedStuff/Method.php
+++ b/MediaWikiBreaks/Tests/RemovedStuff/Method.php
@@ -3,4 +3,13 @@
 //fail
 Linker::makeBrokenLink();
 //pass
-Foo::Bar();
\ No newline at end of file
+Foo::Bar();
+
+//fail
+wfStreamFile();
+//fail
+wfStreamFile ();
+//fail
+wfStreamFile ( $foo );
+//pass
+someFunction();
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/154411
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b7efae7027a4667d8eb02e9d69ce1d4c34b3928
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Also catch use of globals through $GLOBALS - change (mediawiki...codesniffer)

2014-08-16 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Also catch use of globals through $GLOBALS
..

Also catch use of globals through $GLOBALS

Change-Id: I707e717d99b6e1b7a600965b5bc0fc444232c92a
---
M MediaWikiBreaks/Sniffs/RemovedStuff/GlobalSniff.php
M MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
M MediaWikiBreaks/Tests/RemovedStuff/Global.php
3 files changed, 20 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/10/154410/1

diff --git a/MediaWikiBreaks/Sniffs/RemovedStuff/GlobalSniff.php 
b/MediaWikiBreaks/Sniffs/RemovedStuff/GlobalSniff.php
index 577fee0..d32d141 100644
--- a/MediaWikiBreaks/Sniffs/RemovedStuff/GlobalSniff.php
+++ b/MediaWikiBreaks/Sniffs/RemovedStuff/GlobalSniff.php
@@ -2,8 +2,6 @@
 
 /**
  * @author Adam Shorland
- *
- * @todo Catch use of MediaWikiGlobals through super globals!
  */
 class MediaWikiBreaks_Sniffs_RemovedStuff_GlobalSniff implements 
PHP_CodeSniffer_Sniff {
 
@@ -66,14 +64,28 @@
public function register() {
return array(
T_GLOBAL,
+   T_VARIABLE,
);
}
 
public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
$tokens = $phpcsFile->getTokens();
+   $token = $tokens[$stackPtr];
 
-   $nameIndex  = $phpcsFile->findNext( T_VARIABLE, $stackPtr );
-   $globalName = $tokens[$nameIndex]['content'];
+   if( $token['type'] === 'T_GLOBAL' ) {
+   $globalName = $tokens[$phpcsFile->findNext( T_VARIABLE, 
$stackPtr )]['content'];
+   } elseif( $token['type'] === 'T_VARIABLE' && $token['content'] 
=== '$GLOBALS' ) {
+   if( $phpcsFile->findNext( T_OPEN_SQUARE_BRACKET, 
$stackPtr ) <= $stackPtr + 2 ) {
+   $stringLocation = $phpcsFile->findNext( 
T_CONSTANT_ENCAPSED_STRING, $stackPtr );
+   if( $stringLocation <= $stackPtr + 3 ) {
+   $globalName = '$' . trim( 
$tokens[$stringLocation]['content'], "'" );
+   }
+   }
+   }
+
+   if( !isset( $globalName ) ) {
+   return;
+   }
 
foreach( $this->removedStuff as $version => $globals ) {
if( in_array( $globalName, $globals ) ) {
diff --git a/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php 
b/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
index a17ed36..11808e9 100644
--- a/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
+++ b/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
@@ -37,6 +37,7 @@
'RemovedStuff/Global.php' => array(
'error' => array(
5 => 1,
+   13 => 1,
),
),
'RemovedStuff/Method.php' => array(
diff --git a/MediaWikiBreaks/Tests/RemovedStuff/Global.php 
b/MediaWikiBreaks/Tests/RemovedStuff/Global.php
index dee9854..982463c 100644
--- a/MediaWikiBreaks/Tests/RemovedStuff/Global.php
+++ b/MediaWikiBreaks/Tests/RemovedStuff/Global.php
@@ -8,4 +8,7 @@
 function FooBar() {
//pass
global $barBaz;
+   $foo = $GLOBALS;
+   $foo = $GLOBALS['bar'];
+   $foo = $GLOBALS['wgAPICacheHelp'];
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/154410
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I707e717d99b6e1b7a600965b5bc0fc444232c92a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Set default setting for thumbsize to 300px (index 5) not 180px - change (mediawiki/core)

2014-08-16 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: Set default setting for thumbsize to 300px (index 5) not 180px
..

Set default setting for thumbsize to 300px (index 5) not 180px

Bug: 67703
Change-Id: I172ccc0128747090a199695d3bce04388b3bef57
---
M includes/DefaultSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/154409/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index cf00701..c167d8a 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -4248,7 +4248,7 @@
'showtoolbar' => 1,
'skin' => false,
'stubthreshold' => 0,
-   'thumbsize' => 2,
+   'thumbsize' => 5,
'underline' => 2,
'uselivepreview' => 0,
'usenewrc' => 0,

-- 
To view, visit https://gerrit.wikimedia.org/r/154409
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I172ccc0128747090a199695d3bce04388b3bef57
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jforrester 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Factor out wordbreak detection code and run it for simple in... - change (VisualEditor/VisualEditor)

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

Change subject: Factor out wordbreak detection code and run it for simple 
insertions too
..


Factor out wordbreak detection code and run it for simple insertions too

Wordbreak detection was only done for "complex changes", not
for "simple insertions". This worked because we made sure to
always pawn at the edge of an splitOnWordbreak annotation
(through the forceContinuation property), so typing there is
a replacement (replacing a pawn), and that's considered complex
rather than simple.

However, to facilitate future changes as well as for general
non-WTF-y-ness, we should be consistent and also apply the
wordbreak logic for simple insertions. I still don't like
the wordbreak code that much, but at least this change makes
it look a bit less like it works completely by accident.

ve.ce.Surface#onContentChange:
* Factor out wordbreak logic to internal function
* Also call this function in the simple insertion code path
* Cache word break checks out of the loop
* Bail early if no word breaks detected
* Simplify complex change code by adding replacementRange variable
  (needed for call to filterForWordbreak() anyway)
* Replace instanceof check that's always true with length check
* Reuse values of previousStart and nextStart where possible
* Move computation of previousData, nextData and lengthDiff
  to initialization
* Rename dataString to nextDataString, now computed at
  initialization time rather than being recomputed in every
  single loop iteration
* Add TODO about sameLeadingAndTrailing being ignored

Change-Id: I9290782002dfc47f01c383278580ed0b754ab2e2
---
M src/ce/ve.ce.Surface.js
1 file changed, 71 insertions(+), 49 deletions(-)

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



diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 43440e9..f9d1541 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -1469,23 +1469,75 @@
  * @param {ve.Range} next.range New selection
  */
 ve.ce.Surface.prototype.onContentChange = function ( node, previous, next ) {
-   var data, range, len, annotations, offsetDiff, lengthDiff, 
sameLeadingAndTrailing,
-   previousStart, nextStart, newRange,
-   previousData, nextData,
-   i, length, annotation, annotationIndex, dataString,
-   annotationsLeft, annotationsRight,
+   var data, range, len, annotations, offsetDiff, sameLeadingAndTrailing,
+   previousStart, nextStart, newRange, replacementRange,
fromLeft = 0,
fromRight = 0,
-   nodeOffset = node.getModel().getOffset();
+   nodeOffset = node.getModel().getOffset(),
+   previousData = ve.splitClusters( previous.text ),
+   nextData = ve.splitClusters( next.text ),
+   lengthDiff = next.text.length - previous.text.length,
+   nextDataString = new ve.dm.DataString( nextData ),
+   surface = this;
+
+   /**
+* Given a naïvely computed set of annotations to apply to the content 
we're about to insert,
+* this function will check if we're inserting at a word break, check 
if there are any
+* annotations in the set that need to be split at a word break, and 
remove those.
+*
+* @private
+* @param {ve.dm.AnnotationSet} annotations Annotations to apply. Will 
be modified.
+* @param {ve.Range} range Range covering removed content, or collapsed 
range at insertion offset.
+*/
+   function filterForWordbreak( annotations, range ) {
+   var i, length, annotation, annotationIndex, annotationsLeft, 
annotationsRight,
+   left = range.start,
+   right = range.end,
+   // - nodeOffset - 1 to adjust from absolute to relative
+   // adjustment from prev to next not needed because 
we're before the replacement
+   breakLeft = unicodeJS.wordbreak.isBreak( 
nextDataString, left - nodeOffset - 1 ),
+   // - nodeOffset - 1 to adjust from absolute to relative
+   // + lengthDiff to adjust from prev to next
+   breakRight = unicodeJS.wordbreak.isBreak( 
nextDataString, right + lengthDiff - nodeOffset - 1 );
+
+   if ( !breakLeft && !breakRight ) {
+   // No word breaks either side, so nothing to do
+   return;
+   }
+
+   annotationsLeft = 
surface.getModel().getDocument().data.getAnnotationsFromOffset( left - 1 );
+   annotationsRight = 
surface.getModel().getDocument().data.getAnnotationsFromOffset( right );
+
+   for ( i = 0, length = annotations.getLength(); i < length; i++ 
) {
+   annotation = annotations.get( i );
+   

[MediaWiki-commits] [Gerrit] Increase default thumbnail display size from 220px to 300px - change (operations/mediawiki-config)

2014-08-16 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: Increase default thumbnail display size from 220px to 300px
..

Increase default thumbnail display size from 220px to 300px

This affects all wikis except svwiki, which is the only non-standard default
(at 250px) per bug 16739.

Bug: 67709
Change-Id: Ic9d53742383035317400501799b94b20aef4d7c8
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/08/154408/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 740d840..a58e594 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -10483,7 +10483,7 @@
'svwiki' => array( 120, 200, 250, 300, 360 ),
 ),
 'wmgThumbsizeIndex' => array(
-   'default' => 4,
+   'default' => 6, // bug 67709
'svwiki' => 2, // bug 16739
 ),
 

-- 
To view, visit https://gerrit.wikimedia.org/r/154408
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9d53742383035317400501799b94b20aef4d7c8
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Ignore whitespace when generating paste context - change (VisualEditor/VisualEditor)

2014-08-16 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Ignore whitespace when generating paste context
..

Ignore whitespace when generating paste context

textStart/End offsets assume there is no inner whitespace so make
sure that is the case.

Bug: 69595
Change-Id: Ibfddaf94aaf7daedf05eec56821994f7f30ddd56
---
M src/ce/ve.ce.Surface.js
M tests/ce/ve.ce.Surface.test.js
2 files changed, 37 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/07/154407/1

diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index b76da37..207840f 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -985,7 +985,7 @@
  * @param {jQuery.Event} e Paste event
  */
 ve.ce.Surface.prototype.beforePaste = function ( e ) {
-   var tx, node, range, rangyRange, sel,
+   var tx, node, range, contextElement, rangyRange, sel,
context, leftText, rightText, textNode, textStart, textEnd,
selection = this.model.getSelection(),
clipboardData = e.originalEvent.clipboardData,
@@ -1020,7 +1020,13 @@
// to the paste target to give CE some context.
textStart = textEnd = 0;
range = node.getRange();
-   context = [ node.getClonedElement() ];
+   contextElement = node.getClonedElement();
+   // Throw away inner whitespace otherwise our textStart/End
+   // offsets will be wrong.
+   if ( contextElement.internal ) {
+   delete contextElement.internal.whitespace;
+   }
+   context = [ contextElement ];
// If there is content to the left of the cursor, put a 
placeholder
// character to the left of the cursor
if ( selection.start > range.start ) {
diff --git a/tests/ce/ve.ce.Surface.test.js b/tests/ce/ve.ce.Surface.test.js
index 61e339f..bf08712 100644
--- a/tests/ce/ve.ce.Surface.test.js
+++ b/tests/ce/ve.ce.Surface.test.js
@@ -553,7 +553,7 @@
 } );
 
 QUnit.test( 'beforePaste/afterPaste', function ( assert ) {
-   var i, exampleDoc = 'Foo',
+   var i, exampleDoc = 'Foo Baz ',
TestEvent = function ( data ) {
this.originalEvent = {
clipboardData: {
@@ -579,7 +579,7 @@
],
remove: []
},
-   { type: 'retain', length: 8 }
+   { type: 'retain', length: 13 }
]
],
msg: 'Text into empty paragraph'
@@ -596,7 +596,7 @@
insert: [ 'B', 'a', 'r' 
],
remove: []
},
-   { type: 'retain', length: 5 }
+   { type: 'retain', length: 10 }
]
],
msg: 'Text into paragraph'
@@ -617,7 +617,7 @@
],
remove: []
},
-   { type: 'retain', length: 5 }
+   { type: 'retain', length: 10 }
]
],
msg: 'Formatted text into paragraph'
@@ -635,7 +635,7 @@
insert: [ 'B', 'a', 'r' 
],
remove: []
},
-   { type: 'retain', length: 5 }
+   { type: 'retain', length: 10 }
]
],
msg: 'Formatted text into paragraph with 
pasteSpecial'
@@ -652,7 +652,7 @@
insert: [ 'B', 'a', 'r' 
],
remove: []
},
-   { type: 'retain', length: 5 }
+   { type: 'retain', length: 10 }
]
],

[MediaWiki-commits] [Gerrit] AbstractTest makes sure total msg count is correct - change (mediawiki...codesniffer)

2014-08-16 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: AbstractTest makes sure total msg count is correct
..

AbstractTest makes sure total msg count is correct

Previous to this there could be more errors in a file
that we had not explicitly defined in our standard test
and they would have just been ignored even though we
had not said that we were expecting them

Change-Id: Ie00d9e2d505fe210019f9ec8635875618ceb638c
---
M AbstractStandardTestCase.php
1 file changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/06/154406/1

diff --git a/AbstractStandardTestCase.php b/AbstractStandardTestCase.php
index efe3e29..23d80af 100644
--- a/AbstractStandardTestCase.php
+++ b/AbstractStandardTestCase.php
@@ -89,8 +89,11 @@
"Expected no errors but got some\n" . $outputStr
);
}
+
+   $totalExpectedMessages = 0;
foreach( $resultMap as $messageType => $lineMap ) {
foreach( $lineMap as $lineNumber => $messageCount ) {
+   $totalExpectedMessages += $messageCount;
$regex = '/\s(' . $lineNumber . ')\s\|\s(' . 
$messageType . ')\s\|/i';
$this->assertEquals(
$messageCount,
@@ -105,6 +108,20 @@
);
}
}
+
+   preg_match(
+   
'/FOUND\s(\d+)\s[\w\(\)]+\s(?:AND\s(\d+)\s[\w\(\)]+\s)?AFFECTING\s/',
+   $outputStr,
+   $summarymatches
+   );
+   $totalMessages = intval( $summarymatches[1] );
+   if( array_key_exists( 2, $summarymatches ) ) {
+   $totalMessages += intval( $summarymatches[2] );
+   }
+   $this->assertEquals(
+   $totalExpectedMessages,
+   $totalMessages,
+   "Total message count incorrect: 
Expected:$totalExpectedMessages Got:$totalMessages" );
}
 
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/154406
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie00d9e2d505fe210019f9ec8635875618ceb638c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add VE logo to repo and use in image demo and for branding d... - change (VisualEditor/VisualEditor)

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

Change subject: Add VE logo to repo and use in image demo and for branding demo 
page
..


Add VE logo to repo and use in image demo and for branding demo page

Change-Id: I3273fad3d97d6c6d7845191eca6dc89e5595d78f
---
M demos/ve/demo.css
M demos/ve/demo.desktop.css
M demos/ve/demo.html.template
M demos/ve/demo.mobile.css
M demos/ve/desktop-dist.html
M demos/ve/desktop.html
M demos/ve/mobile-dist.html
M demos/ve/mobile.html
8 files changed, 35 insertions(+), 5 deletions(-)

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



diff --git a/demos/ve/demo.css b/demos/ve/demo.css
index 639eb12..bae2870 100644
--- a/demos/ve/demo.css
+++ b/demos/ve/demo.css
@@ -15,6 +15,15 @@
 
 /* Demo */
 
+.ve-demo-logo {
+   float: right;
+   margin: -0.4em -0.3em 0 0;
+   background: url('VisualEditor-logo.svg') no-repeat;
+   background-size: contain;
+   width: 8.6em;
+   height: 3em;
+}
+
 .ve-demo-menu {
padding: 0.75em 1.5em;
 }
diff --git a/demos/ve/demo.desktop.css b/demos/ve/demo.desktop.css
index f9b3dad..a43363a 100644
--- a/demos/ve/demo.desktop.css
+++ b/demos/ve/demo.desktop.css
@@ -21,6 +21,11 @@
border-radius: 0 0 0.25em 0.25em;
 }
 
+.ve-demo-read {
+   border: 1px solid #ccc;
+   box-shadow: 0 0.25em 1.5em 0 #ddd;
+}
+
 /* Editor */
 
 .ve-ui-surface {
diff --git a/demos/ve/demo.html.template b/demos/ve/demo.html.template
index 96fbd2f..8c9f58d 100644
--- a/demos/ve/demo.html.template
+++ b/demos/ve/demo.html.template
@@ -17,7 +17,9 @@
 


-   
+   
+   
+   

 
 
diff --git a/demos/ve/demo.mobile.css b/demos/ve/demo.mobile.css
index 37ebf6d..e266869 100644
--- a/demos/ve/demo.mobile.css
+++ b/demos/ve/demo.mobile.css
@@ -5,6 +5,12 @@
  * @license The MIT License (MIT); see LICENSE.txt
  */
 
+/* Demo */
+
+.ve-demo-read {
+   border-top: 1px solid #ccc;
+}
+
 /* Editor */
 
 .ve-ui-surface {
diff --git a/demos/ve/desktop-dist.html b/demos/ve/desktop-dist.html
index 33e228e..aefe3b7 100644
--- a/demos/ve/desktop-dist.html
+++ b/demos/ve/desktop-dist.html
@@ -33,7 +33,9 @@
 


-   
+   
+   
+   

 

diff --git a/demos/ve/desktop.html b/demos/ve/desktop.html
index d428c6a..c5eb5ae 100644
--- a/demos/ve/desktop.html
+++ b/demos/ve/desktop.html
@@ -68,7 +68,9 @@
 


-   
+   
+   
+   

 

diff --git a/demos/ve/mobile-dist.html b/demos/ve/mobile-dist.html
index ab6aebd..744c205 100644
--- a/demos/ve/mobile-dist.html
+++ b/demos/ve/mobile-dist.html
@@ -33,7 +33,9 @@
 


-   
+   
+   
+   

 

diff --git a/demos/ve/mobile.html b/demos/ve/mobile.html
index b434833..6c34df9 100644
--- a/demos/ve/mobile.html
+++ b/demos/ve/mobile.html
@@ -69,7 +69,9 @@
 


-   
+   
+   
+   

 


-- 
To view, visit https://gerrit.wikimedia.org/r/152950
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3273fad3d97d6c6d7845191eca6dc89e5595d78f
Gerrit-PatchSet: 3
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Trevor Parscal 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add local image to demo - change (VisualEditor/VisualEditor)

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

Change subject: Add local image to demo
..


Add local image to demo

Change-Id: I0206120503d45378ed6b348f540263d6f1854bd8
---
A demos/ve/VisualEditor-logo.svg
M demos/ve/pages/image.html
2 files changed, 67 insertions(+), 2 deletions(-)

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



diff --git a/demos/ve/VisualEditor-logo.svg b/demos/ve/VisualEditor-logo.svg
new file mode 100644
index 000..c76de67
--- /dev/null
+++ b/demos/ve/VisualEditor-logo.svg
@@ -0,0 +1,64 @@
+
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+width="641px" height="225px" viewBox="72.5 191.5 641 225" 
enable-background="new 72.5 191.5 641 225" xml:space="preserve">
+
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+
diff --git a/demos/ve/pages/image.html b/demos/ve/pages/image.html
index e1f61d9..90cd2bb 100644
--- a/demos/ve/pages/image.html
+++ b/demos/ve/pages/image.html
@@ -1,2 +1,3 @@
-This is an image: !!!
-http://upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg"; 
width="180" height="20" resource="./Image:Foobar.jpg" />
\ No newline at end of file
+This is a local image: foo
+Remote image outside of paragraph:
+
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/152949
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0206120503d45378ed6b348f540263d6f1854bd8
Gerrit-PatchSet: 3
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Trevor Parscal 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Also catch use of bad classes in function typehints - change (mediawiki...codesniffer)

2014-08-16 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Also catch use of bad classes in function typehints
..

Also catch use of bad classes in function typehints

Change-Id: I743a2a0f0a33b7f6ee28972c6c36c0df9407dddf
---
M MediaWikiBreaks/Sniffs/RemovedStuff/ClassSniff.php
M MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
M MediaWikiBreaks/Tests/RemovedStuff/Class.php
3 files changed, 36 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/05/154405/1

diff --git a/MediaWikiBreaks/Sniffs/RemovedStuff/ClassSniff.php 
b/MediaWikiBreaks/Sniffs/RemovedStuff/ClassSniff.php
index c2a1aed..c6b1e15 100644
--- a/MediaWikiBreaks/Sniffs/RemovedStuff/ClassSniff.php
+++ b/MediaWikiBreaks/Sniffs/RemovedStuff/ClassSniff.php
@@ -2,8 +2,6 @@
 
 /**
  * @author Adam Shorland
- *
- * @todo Catch use of classes in TypeHints
  */
 class MediaWikiBreaks_Sniffs_RemovedStuff_ClassSniff implements 
PHP_CodeSniffer_Sniff {
 
@@ -28,27 +26,39 @@
T_NEW, // allows us to match creation of new objects 
from class
T_EXTENDS, // allows us to match classes that extend 
class
T_DOUBLE_COLON, // allows us to match static use of 
class
+   T_FUNCTION, // allows us to match typehints
);
}
 
public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
$tokens = $phpcsFile->getTokens();
$token = $tokens[$stackPtr];
+   $classNames = array();
 
if( $token['type'] === 'T_NEW' || $token['type'] === 
'T_EXTENDS' ) {
-   $className = $tokens[$phpcsFile->findNext( T_STRING, 
$stackPtr )]['content'];
+   $classNames[] = $tokens[$phpcsFile->findNext( T_STRING, 
$stackPtr )]['content'];
} else if( $token['type'] === 'T_DOUBLE_COLON' ) {
-   $className = $tokens[$phpcsFile->findPrevious( 
T_STRING, $stackPtr )]['content'];
+   $classNames[] = $tokens[$phpcsFile->findPrevious( 
T_STRING, $stackPtr )]['content'];
+   } else if( $token['type'] === 'T_FUNCTION' ) {
+   $start = $phpcsFile->findNext( T_OPEN_PARENTHESIS, 
$stackPtr );
+   $end = $phpcsFile->findNext( T_CLOSE_PARENTHESIS, 
$stackPtr );
+   for ( $i = $start; $i <= $end; $i++ ) {
+   if( $tokens[$i]['type'] === 'T_STRING' ) {
+   $classNames[] = $tokens[$i]['content'];
+   }
+   }
} else {
return null;
}
 
-   foreach( $this->removedStuff as $version => $removedStuff ) {
-   if( in_array( $className, $removedStuff ) ) {
-   $phpcsFile->addError(
-   'Class ' . $className . ' has been 
removed from Mediawiki in version ' . $version,
-   $stackPtr
-   );
+   foreach( $classNames as $className ) {
+   foreach( $this->removedStuff as $version => 
$removedStuff ) {
+   if( in_array( $className, $removedStuff ) ) {
+   $phpcsFile->addError(
+   'Class ' . $className . ' has 
been removed from Mediawiki in version ' . $version,
+   $stackPtr
+   );
+   }
}
}
}
diff --git a/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php 
b/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
index e88a5b4..a17ed36 100644
--- a/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
+++ b/MediaWikiBreaks/Tests/MediaWikiBreaksStandardTest.php
@@ -29,6 +29,9 @@
13 => 1,
18 => 1,
20 => 1,
+   27 => 1,
+   29 => 2,
+   31 => 2,
),
),
'RemovedStuff/Global.php' => array(
diff --git a/MediaWikiBreaks/Tests/RemovedStuff/Class.php 
b/MediaWikiBreaks/Tests/RemovedStuff/Class.php
index 0663f3d..2fb7900 100644
--- a/MediaWikiBreaks/Tests/RemovedStuff/Class.php
+++ b/MediaWikiBreaks/Tests/RemovedStuff/Class.php
@@ -21,4 +21,16 @@
 //pass
 Foo::bar();
 //pass
-Foo::$baz = 'bar';
\ No newline at end of file
+Foo::$baz = 'bar';
+
+//fail
+function lalalalalalala ( FakeMemCach

[MediaWiki-commits] [Gerrit] Fix the (un)watch token to include the namespace name. - change (mediawiki/core)

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

Change subject: Fix the (un)watch token to include the namespace name.
..


Fix the (un)watch token to include the namespace name.

Title::getDBkey() only returns the page name without the namespace
which means that "Test" and "User:Test" (for example) pages would
have the same token; use Title::getPrefixedDBkey() instead to
avoid this.

Change-Id: I80333b23cec0cfe6546f6e7776b0a77b56ee20c8
---
M includes/actions/WatchAction.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php
index 2c7502e..3b3ae1d 100644
--- a/includes/actions/WatchAction.php
+++ b/includes/actions/WatchAction.php
@@ -185,7 +185,7 @@
if ( $action != 'unwatch' ) {
$action = 'watch';
}
-   $salt = array( $action, $title->getDBkey() );
+   $salt = array( $action, $title->getPrefixedDBkey() );
 
// This token stronger salted and not compatible with ApiWatch
// It's title/action specific because index.php is GET and API 
is POST

-- 
To view, visit https://gerrit.wikimedia.org/r/144749
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I80333b23cec0cfe6546f6e7776b0a77b56ee20c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix phpcs errors in tests dir - change (mediawiki/core)

2014-08-16 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Fix phpcs errors in tests dir
..

Fix phpcs errors in tests dir

Change-Id: I79fa3b8f92e958f4a0dc4fe892703f37d711ca95
---
M tests/phpunit/includes/api/ApiRevisionDeleteTest.php
M tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
M tests/qunit/data/generateJqueryMsgData.php
M tests/testHelpers.inc
4 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/154404/1

diff --git a/tests/phpunit/includes/api/ApiRevisionDeleteTest.php 
b/tests/phpunit/includes/api/ApiRevisionDeleteTest.php
index 21f4322..b03836e 100644
--- a/tests/phpunit/includes/api/ApiRevisionDeleteTest.php
+++ b/tests/phpunit/includes/api/ApiRevisionDeleteTest.php
@@ -9,8 +9,8 @@
  */
 class ApiRevisionDeleteTest extends ApiTestCase {
 
-   static $page = 'Help:ApiRevDel_test';
-   var $revs = array();
+   public static $page = 'Help:ApiRevDel_test';
+   public $revs = array();
 
protected function setUp() {
// Needs to be before setup since this gets cached
diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php 
b/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
index 64e2b00..6ca4793 100644
--- a/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
+++ b/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
@@ -7,7 +7,12 @@
 
// The return value of the closure shouldn't matter since this 
test should
// never call it
-   SkinFactory::getDefaultInstance()->register( 'fakeskin', 
'FakeSkin', function(){});
+   SkinFactory::getDefaultInstance()->register(
+   'fakeskin',
+   'FakeSkin',
+   function(){
+   }
+   );
}
 
/**
diff --git a/tests/qunit/data/generateJqueryMsgData.php 
b/tests/qunit/data/generateJqueryMsgData.php
index 461ab87..61ebbf8 100644
--- a/tests/qunit/data/generateJqueryMsgData.php
+++ b/tests/qunit/data/generateJqueryMsgData.php
@@ -65,7 +65,7 @@
 
 class GenerateJqueryMsgData extends Maintenance {
 
-   static $keyToTestArgs = array(
+   public static $keyToTestArgs = array(
'undelete_short' => array(
array( 0 ),
array( 1 ),
diff --git a/tests/testHelpers.inc b/tests/testHelpers.inc
index 6d94435..2f5fa9e 100644
--- a/tests/testHelpers.inc
+++ b/tests/testHelpers.inc
@@ -51,8 +51,8 @@
 }
 
 class TestRecorder implements ITestRecorder {
-   var $parent;
-   var $term;
+   public $parent;
+   public $term;
 
function __construct( $parent ) {
$this->parent = $parent;
@@ -295,7 +295,7 @@
 }
 
 class DbTestRecorder extends DbTestPreviewer {
-   var $version;
+   public $version;
 
/**
 * Set up result recording; insert a record for the run with the date

-- 
To view, visit https://gerrit.wikimedia.org/r/154404
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79fa3b8f92e958f4a0dc4fe892703f37d711ca95
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add description to MW/ruleset.xml - change (mediawiki...codesniffer)

2014-08-16 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Add description to MW/ruleset.xml
..

Add description to MW/ruleset.xml

Change-Id: I651b6a86b753b60b842af15b61fa447a029a5edc
---
M MediaWiki/ruleset.xml
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/03/154403/1

diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml
index 7036716..c618405 100644
--- a/MediaWiki/ruleset.xml
+++ b/MediaWiki/ruleset.xml
@@ -7,6 +7,8 @@
 -->
 
 
+   A coding standard for MediaWiki.
+




-- 
To view, visit https://gerrit.wikimedia.org/r/154403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I651b6a86b753b60b842af15b61fa447a029a5edc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove dead stuff from MW/ruleset.xml - change (mediawiki...codesniffer)

2014-08-16 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Remove dead stuff from MW/ruleset.xml
..

Remove dead stuff from MW/ruleset.xml

Also reorder / group by sniff types

Change-Id: I5b028d282a7e8716d14e6032a7092250d08479f7
---
M MediaWiki/ruleset.xml
1 file changed, 4 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/02/154402/1

diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml
index 94fb91f..7036716 100644
--- a/MediaWiki/ruleset.xml
+++ b/MediaWiki/ruleset.xml
@@ -6,10 +6,8 @@
- 
https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards
 -->
 
+

-   



@@ -18,10 +16,6 @@

-   


@@ -40,12 +34,6 @@

0

-   
-   
-   



@@ -60,7 +48,6 @@



-   



@@ -85,20 +72,13 @@



-   
-   
-   
-   




+   
+   
 

+
 

-- 
To view, visit https://gerrit.wikimedia.org/r/154402
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b028d282a7e8716d14e6032a7092250d08479f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] diamond dupe def with apache::monitoring on labs - change (operations/puppet)

2014-08-16 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

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

Change subject: diamond dupe def with apache::monitoring on labs
..

diamond dupe def with apache::monitoring on labs

I have an instance (integration-dev) which has apache::monitoring
applied which includes ::diamond.  Since labs instances always have
::diamond included, I end up with a duplicate declaration:

Duplicate declaration: Class[Diamond] is already declared; cannot
redeclare at /etc/puppet/manifests/role/diamond.pp:40 on node
i-0311.eqiad.wmflabs

Change-Id: I359299e7e19679e16cbae6975fc9c661f635670a
---
M modules/apache/manifests/monitoring.pp
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/01/154401/1

diff --git a/modules/apache/manifests/monitoring.pp 
b/modules/apache/manifests/monitoring.pp
index 5185615..e1ce1a3 100644
--- a/modules/apache/manifests/monitoring.pp
+++ b/modules/apache/manifests/monitoring.pp
@@ -7,9 +7,13 @@
 #
 class apache::monitoring {
 include ::apache::mod::status
-include ::diamond
 include ::ganglia
 
+# Labs instance always have diamond
+if $::realm != 'labs' {
+include ::diamond
+}
+
 diamond::collector { 'Httpd': }
 
 file { '/usr/lib/ganglia/python_modules/apache_status.py':

-- 
To view, visit https://gerrit.wikimedia.org/r/154401
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I359299e7e19679e16cbae6975fc9c661f635670a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix moment tests - change (mediawiki...MultimediaViewer)

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

Change subject: Fix moment tests
..


Fix moment tests

moment.js has a slight change in date output which broke some tests.

Change-Id: If5ffdaba8574e574d644f3d8bd987ee29aeb0bc9
---
M tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js 
b/tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js
index 3bb5a1f..0f091ab 100644
--- a/tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js
+++ b/tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js
@@ -173,7 +173,7 @@
assert.strictEqual( panel.creditField.$element.find( 
'.mw-mmv-author' ).text(), imageData.author, 'Author text is correctly set' );
assert.strictEqual( panel.creditField.$element.find( 
'.mw-mmv-source' ).html(), 'LostBar', 'Source text is 
correctly set' );
assert.strictEqual( panel.creditField.$element.attr( 
'original-title' ), 'Author and source information', 'Source tooltip is 
correctly set' );
-   assert.ok( panel.$datetime.text().indexOf( 'August 26 2013' ) > 
0, 'Correct date is displayed' );
+   assert.ok( panel.$datetime.text().indexOf( 'August 26, 2013' ) 
> 0, 'Correct date is displayed' );
assert.strictEqual( panel.$license.text(), 'CC BY 2.0', 
'License is correctly set' );
assert.ok( panel.$license.prop( 'target' ), 'License 
information opens in new window' );
assert.ok( panel.$username.text().indexOf( 
imageData.lastUploader ) > 0, 'Correct username is displayed' );
@@ -181,7 +181,7 @@
imageData.creationDateTime = undefined;
panel.setImageInfo( image, imageData, repoData, localUsage, 
globalUsage, gender );
 
-   assert.ok( panel.$datetime.text().indexOf( 'August 25 2013' ) > 
0, 'Correct date is displayed' );
+   assert.ok( panel.$datetime.text().indexOf( 'August 25, 2013' ) 
> 0, 'Correct date is displayed' );
 
window.moment = oldMoment;
} );

-- 
To view, visit https://gerrit.wikimedia.org/r/154400
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If5ffdaba8574e574d644f3d8bd987ee29aeb0bc9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix moment tests - change (mediawiki...MultimediaViewer)

2014-08-16 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Fix moment tests
..

Fix moment tests

moment.js has a slight change in date output which broke some tests.

Change-Id: If5ffdaba8574e574d644f3d8bd987ee29aeb0bc9
---
M tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/00/154400/1

diff --git a/tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js 
b/tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js
index 3bb5a1f..0f091ab 100644
--- a/tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js
+++ b/tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js
@@ -173,7 +173,7 @@
assert.strictEqual( panel.creditField.$element.find( 
'.mw-mmv-author' ).text(), imageData.author, 'Author text is correctly set' );
assert.strictEqual( panel.creditField.$element.find( 
'.mw-mmv-source' ).html(), 'LostBar', 'Source text is 
correctly set' );
assert.strictEqual( panel.creditField.$element.attr( 
'original-title' ), 'Author and source information', 'Source tooltip is 
correctly set' );
-   assert.ok( panel.$datetime.text().indexOf( 'August 26 2013' ) > 
0, 'Correct date is displayed' );
+   assert.ok( panel.$datetime.text().indexOf( 'August 26, 2013' ) 
> 0, 'Correct date is displayed' );
assert.strictEqual( panel.$license.text(), 'CC BY 2.0', 
'License is correctly set' );
assert.ok( panel.$license.prop( 'target' ), 'License 
information opens in new window' );
assert.ok( panel.$username.text().indexOf( 
imageData.lastUploader ) > 0, 'Correct username is displayed' );
@@ -181,7 +181,7 @@
imageData.creationDateTime = undefined;
panel.setImageInfo( image, imageData, repoData, localUsage, 
globalUsage, gender );
 
-   assert.ok( panel.$datetime.text().indexOf( 'August 25 2013' ) > 
0, 'Correct date is displayed' );
+   assert.ok( panel.$datetime.text().indexOf( 'August 25, 2013' ) 
> 0, 'Correct date is displayed' );
 
window.moment = oldMoment;
} );

-- 
To view, visit https://gerrit.wikimedia.org/r/154400
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5ffdaba8574e574d644f3d8bd987ee29aeb0bc9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix URL protocol detection regex for file link= parameter - change (mediawiki/core)

2014-08-16 Thread TTO (Code Review)
TTO has uploaded a new change for review.

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

Change subject: Fix URL protocol detection regex for file link= parameter
..

Fix URL protocol detection regex for file link= parameter

This regex looked something like /^(?i)bitcoin:|ftp://|ftps://|.../, which
meant the anchoring ^ only applied to the first name. This meant that any
link= value that happened to contain a URL protocol anywhere within it
(e.g. wikinews:Foo containing "news:";) got incorrectly matched by this
regex.

Bug: 69317
Change-Id: Ide1c4f64137666db99f8e3b6816df01ef5099c8e
---
M includes/parser/Parser.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/154399/1

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index c5c472a..61fffc5 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -5527,7 +5527,7 @@
$paramName = 
'no-link';
$value = true;
$validated = 
true;
-   } elseif ( preg_match( 
"/^(?i)$prots/", $value ) ) {
+   } elseif ( preg_match( 
"/^((?i)$prots)/", $value ) ) {
if ( 
preg_match( "/^((?i)$prots)$chars+$/u", $value, $m ) ) {

$paramName = 'link-url';

$this->mOutput->addExternalLink( $value );

-- 
To view, visit https://gerrit.wikimedia.org/r/154399
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide1c4f64137666db99f8e3b6816df01ef5099c8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Edit summary in content language at Special:PagePreparation - change (mediawiki...Translate)

2014-08-16 Thread BPositive (Code Review)
BPositive has uploaded a new change for review.

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

Change subject: Edit summary in content language at Special:PagePreparation
..

Edit summary in content language at Special:PagePreparation

The edit summary "Prepared the page for translation" is now in the
content language, i.e, the language of the wiki. Previously, it was
appearing in the user interface language.

Bug: 69592
Change-Id: I91b2d4e25f7852d2bc0bfa26e934a31bf20a42ba
---
M resources/js/ext.translate.pagepreparation.js
M specials/SpecialPagePreparation.php
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/98/154398/1

diff --git a/resources/js/ext.translate.pagepreparation.js 
b/resources/js/ext.translate.pagepreparation.js
index 64d0449..538fefc 100644
--- a/resources/js/ext.translate.pagepreparation.js
+++ b/resources/js/ext.translate.pagepreparation.js
@@ -15,7 +15,7 @@
format: 'json',
title: pageName,
text: pageContent,
-   summary: mw.msg( 'pp-save-summary' ),
+   summary: $( '#pp-summary' ).val(),
} ).promise();
}
 
diff --git a/specials/SpecialPagePreparation.php 
b/specials/SpecialPagePreparation.php
index 6b05634..e355626 100644
--- a/specials/SpecialPagePreparation.php
+++ b/specials/SpecialPagePreparation.php
@@ -21,6 +21,7 @@
$pagenamePlaceholder = $this->msg( 'pp-pagename-placeholder' 
)->escaped();
$prepareButtonValue = $this->msg( 'pp-prepare-button-label' 
)->escaped();
$saveButtonValue = $this->msg( 'pp-save-button-label' 
)->escaped();
+   $summaryValue = $this->msg( 'pp-save-summary' 
)->inContentLanguage();
$output->addModules( 'ext.translate.pagepreparation' );
$output->addModuleStyles( 'jquery.uls.grid' );
$param = $request->getText( 'param' );
@@ -33,6 +34,7 @@
$out = <<

+   



-- 
To view, visit https://gerrit.wikimedia.org/r/154398
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91b2d4e25f7852d2bc0bfa26e934a31bf20a42ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: BPositive 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make ext.cx.model a dependency for ext.cx.util - change (mediawiki...ContentTranslation)

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

Change subject: Make ext.cx.model a dependency for ext.cx.util
..


Make ext.cx.model a dependency for ext.cx.util

Change-Id: I8be5baa88ef4f559883ff5a6fcc5cd7e0c8bbd47
---
M Resources.php
M modules/base/ext.cx.util.js
2 files changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/Resources.php b/Resources.php
index cc5bb07..c2b816f 100644
--- a/Resources.php
+++ b/Resources.php
@@ -41,6 +41,7 @@
'base/ext.cx.util.js',
),
'dependencies' => array(
+   'ext.cx.model',
'mediawiki.Uri',
),
 ) + $resourcePaths;
diff --git a/modules/base/ext.cx.util.js b/modules/base/ext.cx.util.js
index 2f2c400..0c3bc2d 100644
--- a/modules/base/ext.cx.util.js
+++ b/modules/base/ext.cx.util.js
@@ -11,8 +11,6 @@
 ( function ( mw ) {
'use strict';
 
-   mw.cx = mw.cx || {};
-
/**
 * Do the content translation by going to Special:CX
 * with the given source-target title and target language

-- 
To view, visit https://gerrit.wikimedia.org/r/150784
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8be5baa88ef4f559883ff5a6fcc5cd7e0c8bbd47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Santhosh 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Surround edit notices with appropriate classes - change (mediawiki/core)

2014-08-16 Thread Microchip08 (Code Review)
Microchip08 has uploaded a new change for review.

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

Change subject: Surround edit notices with appropriate classes
..

Surround edit notices with appropriate classes

This commit adds a  around edit notices with relevant classes to aid in the
creation of user scripts, following an earlier change (bug 30959) for
edit intros.

It adds an .editnotice class to each edit notice, and because classes are fairly
cheap, a second mirroring the edit notice's message key, and a third depending
on the edit notice type:
.editnotice-namespace   for a namespace-wide edit notice
.editnotice-basefor a edit notice for the subpage's base page
.editnotice-pagefor an edit notice set explicitly for the page

Bug: 68749
Change-Id: Idf44f2a344d64893f799286914bda3f8d4aff6bf
---
M includes/Title.php
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/154397/1

diff --git a/includes/Title.php b/includes/Title.php
index a1b2352..d320e5c 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -5007,7 +5007,8 @@
$editnotice_ns = 'editnotice-' . $this->getNamespace();
$editnotice_ns_message = wfMessage( $editnotice_ns );
if ( $editnotice_ns_message->exists() ) {
-   $notices[$editnotice_ns] = 
$editnotice_ns_message->parseAsBlock();
+   $notices[$editnotice_ns] = "";
+   $notices[$editnotice_ns] .= 
$editnotice_ns_message->parseAsBlock() . '';
}
if ( MWNamespace::hasSubpages( $this->getNamespace() ) ) {
$parts = explode( '/', $this->getDBkey() );
@@ -5016,7 +5017,8 @@
$editnotice_base .= '-' . array_shift( $parts );
$editnotice_base_msg = wfMessage( 
$editnotice_base );
if ( $editnotice_base_msg->exists() ) {
-   $notices[$editnotice_base] = 
$editnotice_base_msg->parseAsBlock();
+   $notices[$editnotice_base] = "";
+   $notices[$editnotice_base] .= 
$editnotice_base_msg->parseAsBlock() . '';
}
}
} else {
@@ -5024,7 +5026,8 @@
$editnoticeText = $editnotice_ns . '-' . str_replace( 
'/', '-', $this->getDBkey() );
$editnoticeMsg = wfMessage( $editnoticeText );
if ( $editnoticeMsg->exists() ) {
-   $notices[$editnoticeText] = 
$editnoticeMsg->parseAsBlock();
+   $notices[$editnoticeText] = "";
+   $notices[$editnoticeText] .= 
$editnoticeMsg->parseAsBlock() . '';
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/154397
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf44f2a344d64893f799286914bda3f8d4aff6bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Microchip08 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] ordered_yaml(): fix for Ruby 1.8 - change (operations/puppet)

2014-08-16 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: ordered_yaml(): fix for Ruby 1.8
..


ordered_yaml(): fix for Ruby 1.8

This patch reverts I62605c2a2, restoring the previous (and known-good) version
of ordered_json().

It also fixes the implementation of ordered_yaml(), which didn't work properly
with Ruby 1.8. Hash keys in Ruby 1.8 are not sorted in insertion order, so it's
not sufficient to recursively copy keys in sorted order into a new hash.
Instead, we patch the .each_pair method to iterate on keys in sorted order. We
only do this for hashes we create.

Change-Id: Ieb08e604ef3552c928c78aab2d44a7bae7966dd6
---
M modules/wmflib/lib/puppet/parser/functions/ordered_json.rb
D modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
A modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
3 files changed, 65 insertions(+), 23 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/wmflib/lib/puppet/parser/functions/ordered_json.rb 
b/modules/wmflib/lib/puppet/parser/functions/ordered_json.rb
index 2881495..c241444 100644
--- a/modules/wmflib/lib/puppet/parser/functions/ordered_json.rb
+++ b/modules/wmflib/lib/puppet/parser/functions/ordered_json.rb
@@ -1,33 +1,43 @@
-# == Functions: ordered_json(), ordered_yaml()
+# == Function: ordered_json
 #
-# Emit a hash as JSON or YAML with keys (both shallow and deep) sorted
-# in lexicographical order.
+# Serialize a hash into JSON with lexicographically sorted keys.
 #
-require 'json'
-require 'yaml'
-
-def sort_keys_recursive(value)
-# Prepare a value for JSON or YAML serialization by sorting its keys
-# (if it is a hash) and the keys of any hash object that is contained
-# within the value. Returns a new value.
-case value
+# Because the order of keys in Ruby 1.8 hashes is undefined, 'to_pson'
+# is not idempotent: i.e., the serialized form of the same hash object
+# can vary from one invocation to the next. This causes problems
+# whenever a JSON-serialized hash is included in a file template,
+# because the variations in key order are picked up as file updates by
+# Puppet, causing Puppet to replace the file and refresh dependent
+# resources on every run.
+#
+# Copyright 2014 Ori Livneh
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+def ordered_json(o)
+case o
 when Array
-value.map { |elem| sort_keys_recursive(elem) }
+'[' + o.map { |x| ordered_json(x) }.join(', ') + ']'
 when Hash
-value.sort.inject({}) { |h, (k, v)| h[k] = sort_keys_recursive(v); h }
-when 'true', 'false'
-value == 'true'
-when :undef
-nil
+'{' + o.sort.map { |k,v| k.to_pson + ': ' + ordered_json(v) }.join(', 
') + '}'
 else
-value.include?('.') ? Float(value) : Integer(value) rescue value
+o.include?('.') ? Float(o).to_s : Integer(o).to_s rescue o.to_pson
 end
 end
 
 module Puppet::Parser::Functions
-{:ordered_json => :to_json, :ordered_yaml => :to_yaml}.each do |func, 
method|
-newfunction(func, :type => :rvalue, :arity => 1) do |args|
-sort_keys_recursive(args.first).send(method).gsub(/^---\s*/, '') 
<< "\n"
-end
+newfunction(:ordered_json, :type => :rvalue) do |args|
+fail 'ordered_json() requires an argument' if args.empty?
+ordered_json(args.inject(:merge))
 end
 end
diff --git a/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb 
b/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
deleted file mode 12
index f6b7e00..000
--- a/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
+++ /dev/null
@@ -1 +0,0 @@
-ordered_json.rb
\ No newline at end of file
diff --git a/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb 
b/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
new file mode 100644
index 000..2e2b188
--- /dev/null
+++ b/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
@@ -0,0 +1,33 @@
+# == Function: ordered_yaml()
+#
+# Emit a hash as YAML with keys (both shallow and deep) in sorted order.
+#
+require "puppet/util/zaml.rb"
+
+def sort_keys_recursive(value)
+# Prepare a value for YAML serialization by sorting its keys (if it is
+# a hash) and the keys of any hash object that is contained within the
+# value. Returns a new value.
+case value
+when Array
+value.map { |elem|

[MediaWiki-commits] [Gerrit] Disable MediaViewer by default for logged-in users on Commons - change (operations/mediawiki-config)

2014-08-16 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Disable MediaViewer by default for logged-in users on Commons
..

Disable MediaViewer by default for logged-in users on Commons

Soft-depends on Ief0df5b4f4285d99208f007b0510a396f6c272e0

Bug: 69363
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/822
Change-Id: I90f6ab5b44fbcde0b89f56e795f69472c4940854
---
M wmf-config/CommonSettings-labs.php
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
4 files changed, 13 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/96/154396/1

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 77bbc30..7ac474b 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -70,10 +70,6 @@
if ( $wmgMediaViewerBeta ) {
$wgMediaViewerIsInBeta = true;
}
-
-   if ( $wmgMediaViewerLoggedIn ) {
-   $wgEnableMediaViewerForLoggedInUsersOnly = true;
-   }
 }
 
 if ( $wmgUseVectorBeta ) {
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 5d8b352..dfae5ec 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1887,8 +1887,12 @@
$wgMediaViewerIsInBeta = true;
}
 
-   if ( $wmgMediaViewerLoggedIn ) {
-   $wgEnableMediaViewerForLoggedInUsersOnly = true;
+   if ( isset( $wmgMediaViewerEnableByDefault ) ) {
+   $wgMediaViewerEnableByDefault = $wmgMediaViewerEnableByDefault;
+   }
+
+   if ( isset( $wmgMediaViewerEnableByDefaultForAnonymous ) ) {
+   $wgMediaViewerEnableByDefaultForAnonymous = 
$wmgMediaViewerEnableByDefaultForAnonymous;
}
 
if ( $wmgMediaViewerUseThumbnailGuessing ) {
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 4af1918..6b61afe 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -299,10 +299,6 @@
'enwiktionary' => true,
),
 
-   'wmgMediaViewerLoggedIn' => array(
-   'default' => false,
-   ),
-
'wmgNetworkPerformanceSamplingFactor' => array(
'default' => 1,
),
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 5008b22..276b5ce 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -10888,8 +10888,13 @@
'default' => false,
 ),
 
-'wmgMediaViewerLoggedIn' => array(
-   'default' => false,
+'wmgMediaViewerEnableByDefault' => array(
+   'default' => true,
+   'commonswiki' => false, // bug 69363
+),
+
+'wmgMediaViewerEnableByDefaultForAnonymous' => array(
+   'default' => true,
 ),
 
 'wmgMediaViewerUseThumbnailGuessing' => array(

-- 
To view, visit https://gerrit.wikimedia.org/r/154396
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90f6ab5b44fbcde0b89f56e795f69472c4940854
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add an option to disable by default for logged-in users - change (mediawiki...MultimediaViewer)

2014-08-16 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Add an option to disable by default for logged-in users
..

Add an option to disable by default for logged-in users

Soft-depends on I90f6ab5b44fbcde0b89f56e795f69472c4940854

Bug: 69363
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/822
Change-Id: Ief0df5b4f4285d99208f007b0510a396f6c272e0
---
M MultimediaViewer.php
M MultimediaViewerHooks.php
2 files changed, 21 insertions(+), 15 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/95/154395/1

diff --git a/MultimediaViewer.php b/MultimediaViewer.php
index 7d23bea..7034a96 100644
--- a/MultimediaViewer.php
+++ b/MultimediaViewer.php
@@ -69,12 +69,18 @@
$wgMediaViewerUseThumbnailGuessing = true;
 }
 
-if ( !isset( $wgEnableMediaViewerForLoggedInUsersOnly ) ) {
+if ( !isset( $wgMediaViewerEnableByDefault ) ) {
/**
-* @var bool: If set, and $wgMediaViewerIsInBeta is unset, Media Viewer 
will be turned on for
-* all logged-in users. False if unset.
+* @var bool: If trueish, and $wgMediaViewerIsInBeta is unset, Media 
Viewer will be turned on by default.
 */
-   $wgEnableMediaViewerForLoggedInUsersOnly = false;
+   $wgMediaViewerEnableByDefault = true;
+}
+
+if ( !isset( $wgMediaViewerEnableByDefaultForAnonymous ) ) {
+   /**
+* @var bool: Like $wgMediaViewerEnableByDefault, but for anonymous 
users only.
+*/
+   $wgMediaViewerEnableByDefaultForAnonymous = 
$wgMediaViewerEnableByDefault;
 }
 
 $wgMessagesDirs['MultimediaViewer'] = __DIR__ . '/i18n';
@@ -954,7 +960,12 @@
 
 $wgAutoloadClasses['MultimediaViewerHooks'] = __DIR__ . 
'/MultimediaViewerHooks.php';
 
-$wgDefaultUserOptions['multimediaviewer-enable'] = true;
+$wgExtensionFunctions[] = function () {
+   global $wgMediaViewerEnableByDefault, $wgDefaultUserOptions;
+   if ( $wgMediaViewerEnableByDefault ) {
+   $wgDefaultUserOptions['multimediaviewer-enable'] = true;
+   }
+};
 
 $wgHooks['GetPreferences'][] = 'MultimediaViewerHooks::getPreferences';
 $wgHooks['GetBetaFeaturePreferences'][] = 
'MultimediaViewerHooks::getBetaPreferences';
diff --git a/MultimediaViewerHooks.php b/MultimediaViewerHooks.php
index 27d7b49..6ac204a 100644
--- a/MultimediaViewerHooks.php
+++ b/MultimediaViewerHooks.php
@@ -37,22 +37,17 @@
 * @return bool
 */
protected static function shouldHandleClicks( $user ) {
-   global $wgMediaViewerIsInBeta, 
$wgEnableMediaViewerForLoggedInUsersOnly;
+   global $wgMediaViewerIsInBeta, 
$wgMediaViewerEnableByDefaultForAnonymous;
 
if ( $wgMediaViewerIsInBeta && class_exists( 'BetaFeatures' ) ) 
{
return BetaFeatures::isFeatureEnabled( $user, 
'multimedia-viewer' );
}
 
-   if ( $user->getOption( 'multimediaviewer-enable' ) ) {
-   if ( $wgEnableMediaViewerForLoggedInUsersOnly ) {
-   return $user->isLoggedIn();
-   } else {
-   // Default to enabling for everyone.
-   return true;
-   }
+   if ( !$user->isLoggedIn() && isset( 
$wgMediaViewerEnableByDefaultForAnonymous ) ) {
+   return (bool)$wgMediaViewerEnableByDefaultForAnonymous;
+   } else {
+   return (bool)$user->getOption( 
'multimediaviewer-enable' );
}
-
-   return false;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/154395
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief0df5b4f4285d99208f007b0510a396f6c272e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] New Wikidata Build - 16/08/2014 10:00 - change (mediawiki...Wikidata)

2014-08-16 Thread WikidataBuilder (Code Review)
WikidataBuilder has uploaded a new change for review.

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

Change subject: New Wikidata Build - 16/08/2014 10:00
..

New Wikidata Build - 16/08/2014 10:00

Change-Id: Ic91e1c83baffb7f261ad77b131f57d6c511b6f8d
---
M composer.lock
M extensions/PropertySuggester/README.md
M extensions/PropertySuggester/build/travis/script.sh
M extensions/PropertySuggester/i18n/en.json
M extensions/PropertySuggester/modules/ext.PropertySuggester.EntitySelector.js
M extensions/PropertySuggester/src/PropertySuggester/GetSuggestions.php
M extensions/PropertySuggester/src/PropertySuggester/SuggesterParams.php
M extensions/PropertySuggester/src/PropertySuggester/SuggesterParamsParser.php
M 
extensions/PropertySuggester/src/PropertySuggester/Suggesters/SimpleSuggester.php
M 
extensions/PropertySuggester/src/PropertySuggester/Suggesters/SuggesterEngine.php
M extensions/PropertySuggester/src/PropertySuggester/SuggestionGenerator.php
M extensions/PropertySuggester/tests/bootstrap.php
M 
extensions/PropertySuggester/tests/phpunit/PropertySuggester/GetSuggestionsTest.php
M 
extensions/PropertySuggester/tests/phpunit/PropertySuggester/SuggesterParamsParserTest.php
M 
extensions/PropertySuggester/tests/phpunit/PropertySuggester/Suggesters/SimpleSuggesterTest.php
M 
extensions/PropertySuggester/tests/phpunit/PropertySuggester/SuggestionGeneratorTest.php
M extensions/Wikibase/client/WikibaseClient.hooks.php
M 
extensions/Wikibase/client/includes/DataAccess/PropertyParserFunction/SnaksFinder.php
A extensions/Wikibase/client/includes/hooks/ChangesPageWikibaseFilterHandler.php
M extensions/Wikibase/client/includes/hooks/SpecialWatchlistQueryHandler.php
M extensions/Wikibase/client/tests/phpunit/includes/ChangeHandlerTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/LanguageAwareRendererTest.php
A 
extensions/Wikibase/client/tests/phpunit/includes/hooks/ChangesPageWikibaseFilterHandlerTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/hooks/SpecialWatchlistQueryHandlerTest.php
M extensions/Wikibase/lib/WikibaseLib.php
M extensions/Wikibase/lib/includes/parsers/DateTimeParser.php
M extensions/Wikibase/lib/includes/parsers/MonolingualTextParser.php
M extensions/Wikibase/lib/includes/parsers/MonthNameUnlocalizer.php
M extensions/Wikibase/lib/includes/store/GenericEntityInfoBuilder.php
M extensions/Wikibase/lib/includes/store/TermIndex.php
M extensions/Wikibase/lib/includes/store/sql/SqlEntityInfoBuilder.php
M extensions/Wikibase/lib/includes/store/sql/SqlEntityInfoBuilderFactory.php
M extensions/Wikibase/lib/includes/store/sql/TermSqlIndex.php
M extensions/Wikibase/lib/tests/phpunit/parsers/MonolingualTextParserTest.php
M extensions/Wikibase/lib/tests/phpunit/parsers/MonthNameUnlocalizerTest.php
M extensions/Wikibase/repo/includes/EntityView.php
M extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php
M extensions/Wikibase/repo/includes/PropertyView.php
D extensions/Wikibase/repo/includes/View/FingerprintView.php
M extensions/Wikibase/repo/includes/View/TermBoxView.php
M extensions/Wikibase/repo/includes/api/ApiErrorReporter.php
M extensions/Wikibase/repo/includes/store/sql/EntityPerPageBuilder.php
M extensions/Wikibase/repo/includes/store/sql/ItemsPerSiteBuilder.php
M extensions/Wikibase/repo/includes/store/sql/PropertyInfoTableBuilder.php
M extensions/Wikibase/repo/includes/store/sql/SqlStore.php
M extensions/Wikibase/repo/includes/store/sql/TermSearchKeyBuilder.php
M extensions/Wikibase/repo/tests/phpunit/includes/EntityViewTest.php
D extensions/Wikibase/repo/tests/phpunit/includes/View/FingerprintViewTest.php
M vendor/autoload.php
M vendor/composer/autoload_classmap.php
M vendor/composer/autoload_real.php
M vendor/composer/installed.json
52 files changed, 891 insertions(+), 584 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata 
refs/changes/93/154393/1

diff --git a/composer.lock b/composer.lock
index 02ec9fb..d7a41e1 100644
--- a/composer.lock
+++ b/composer.lock
@@ -723,16 +723,16 @@
 },
 {
 "name": "propertysuggester/property-suggester",
-"version": "v1.0",
+"version": "v1.1",
 "source": {
 "type": "git",
 "url": "https://github.com/Wikidata-lib/PropertySuggester.git";,
-"reference": "2fb712f58c368a1151b3e8aeb09876ffa1f66913"
+"reference": "fe77e3d6db4582d2b4cefbe51a1f74e8838f79d1"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/Wikidata-lib/PropertySuggester/zipball/2fb712f58c368a1151b3e8aeb09876ffa1f66913";,
-"reference": "2fb712f58c368a1151b3e8aeb09876ffa1f66913",
+"url": 
"https://api.github.com/repos/Wikidata-lib/PropertySuggester/zipball/fe77e3d6db4582d2b4cefbe51a1f74e8838f79d1";,
+

[MediaWiki-commits] [Gerrit] Register a fake skin instead of a 'vector' that will fail - change (mediawiki/core)

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

Change subject: Register a fake skin instead of a 'vector' that will fail
..


Register a fake skin instead of a 'vector' that will fail

Bug: 69639
Change-Id: Icd87520f7b6de337b009144420c3a430861d0833
---
M tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php 
b/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
index 038a0e1..64e2b00 100644
--- a/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
+++ b/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
@@ -7,7 +7,7 @@
 
// The return value of the closure shouldn't matter since this 
test should
// never call it
-   SkinFactory::getDefaultInstance()->register( 'vector', 
'Vector', function(){});
+   SkinFactory::getDefaultInstance()->register( 'fakeskin', 
'FakeSkin', function(){});
}
 
/**
@@ -29,7 +29,7 @@
),
'skinStyles' => array(
'default' => 'quux-fallback.less',
-   'vector' => array(
+   'fakeskin' => array(
'baz-vector.css',
'quux-vector.less',
),

-- 
To view, visit https://gerrit.wikimedia.org/r/154384
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icd87520f7b6de337b009144420c3a430861d0833
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Mark additional tests as unconnected to a Site - change (pywikibot/core)

2014-08-16 Thread John Vandenberg (Code Review)
John Vandenberg has uploaded a new change for review.

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

Change subject: Mark additional tests as unconnected to a Site
..

Mark additional tests as unconnected to a Site

* Namespace tests do not need a site.
* One of the textlib tests does not need a site.
* One of the wikidataquery tests talks to wikidataquery
  but does not need a site.

Change-Id: Iffacec799d421a678c45ea82e1e32abf400e34fd
---
M tests/namespace_tests.py
M tests/textlib_tests.py
M tests/wikidataquery_tests.py
3 files changed, 8 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/92/154392/1

diff --git a/tests/namespace_tests.py b/tests/namespace_tests.py
index b6fe44f..70ff073 100644
--- a/tests/namespace_tests.py
+++ b/tests/namespace_tests.py
@@ -11,14 +11,14 @@
 
 from collections import Iterable
 from pywikibot.site import Namespace
-from tests.utils import PywikibotTestCase, unittest
+from tests.utils import NoSiteTestCase, unittest
 
 import sys
 if sys.version_info[0] > 2:
 basestring = (str, )
 
 
-class TestNamespaceObject(PywikibotTestCase):
+class TestNamespaceObject(NoSiteTestCase):
 """Test cases for Namespace class."""
 
 # These should work in any MW wiki
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index edcead9..b57d979 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -17,7 +17,7 @@
 import pywikibot.textlib as textlib
 from pywikibot import config
 
-from tests.utils import unittest, PywikibotTestCase
+from tests.utils import unittest, NoSiteTestCase, PywikibotTestCase
 
 files = {}
 dirname = os.path.join(os.path.dirname(__file__), "pages")
@@ -27,9 +27,8 @@
'r', 'utf-8').read()
 
 
-class TestSectionFunctions(PywikibotTestCase):
+class TestSectionFunctions(NoSiteTestCase):
 def setUp(self):
-self.site = pywikibot.Site('en', 'wikipedia')
 self.catresult1 = ('[[Category:Cat1]]%(LS)s[[Category:Cat2]]%(LS)s'
% {'LS': config.LS})
 super(TestSectionFunctions, self).setUp()
diff --git a/tests/wikidataquery_tests.py b/tests/wikidataquery_tests.py
index f1044b8..ae6a08f 100644
--- a/tests/wikidataquery_tests.py
+++ b/tests/wikidataquery_tests.py
@@ -12,7 +12,7 @@
 
 
 import pywikibot.data.wikidataquery as query
-from tests.utils import unittest, PywikibotTestCase
+from tests.utils import unittest, NoSiteTestCase, PywikibotTestCase
 
 import pywikibot
 from pywikibot.page import ItemPage, PropertyPage, Claim
@@ -228,7 +228,9 @@
 self.assertEqual(qs, "q=link%5Benwiki%5D&labels=en,fr&props=prop")
 
 
-class TestApiSlowFunctions(PywikibotTestCase):
+class TestApiSlowFunctions(NoSiteTestCase):
+
+net = True
 
 def testQueryApiGetter(self):
 """

-- 
To view, visit https://gerrit.wikimedia.org/r/154392
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffacec799d421a678c45ea82e1e32abf400e34fd
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Relative links ignored at Special:PagePreparation - change (mediawiki...Translate)

2014-08-16 Thread BPositive (Code Review)
BPositive has uploaded a new change for review.

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

Change subject: Relative links ignored at Special:PagePreparation
..

Relative links ignored at Special:PagePreparation

Relative links like [[../Foo:Bar|Bar]] have been ignored while
adding the "Special:MyLanguage/" prefix for links during page
preparation.

Bug: 69593
Change-Id: I2e17ce0409c32261d814e84a73a1761a505069ad
---
M resources/js/ext.translate.pagepreparation.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/91/154391/1

diff --git a/resources/js/ext.translate.pagepreparation.js 
b/resources/js/ext.translate.pagepreparation.js
index 64d0449..116c1c5 100644
--- a/resources/js/ext.translate.pagepreparation.js
+++ b/resources/js/ext.translate.pagepreparation.js
@@ -116,10 +116,10 @@
namespaces = getNamespaces();
nsString = namespaces.join( '|' );
linkPrefixRegex = new RegExp( 
'\\[\\[((?:(?:special(?!:MyLanguage\\b)|' + nsString +
-   '):)?[^:]*?)\\]\\]', 'gi' );
+   '):)?[^:/]*?)\\]\\]', 'gi' );
// Add the 'Special:MyLanguage/' prefix for all internal links 
of valid namespaces and
// mainspace.
-   // Regex : http://regex101.com/r/zZ9jH9
+   // Regex : http://regex101.com/r/zZ9jH9/2
pageContent = pageContent.replace( linkPrefixRegex, 
'[[Special:MyLanguage/$1]]' );
return pageContent;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/154391
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e17ce0409c32261d814e84a73a1761a505069ad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: BPositive 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] new method APISite.restrictions() to reduce duplicate code - change (pywikibot/core)

2014-08-16 Thread Ricordisamoa (Code Review)
Ricordisamoa has uploaded a new change for review.

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

Change subject: new method APISite.restrictions() to reduce duplicate code
..

new method APISite.restrictions() to reduce duplicate code

The recently added methods:
.protection_types() and .protection_levels()
have been removed; no 'deprecated' notice has been added.

Change-Id: I7199e78c6600beb21736031e8f4a4a13a3cc27f4
---
M pywikibot/page.py
M pywikibot/site.py
M scripts/protect.py
3 files changed, 21 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/90/154390/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 7108a2b..7c04821 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -840,7 +840,7 @@
 """
 # Currently hard coded, but a future API update might allow us to
 # properly determine the applicable protection types
-p_types = set(self.site.protection_types())
+p_types = set(self.site.restrictions()['types'])
 if not self.exists():
 return set(['create']) if 'create' in p_types else set()
 else:
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 63fca60..3b9370a 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3500,41 +3500,30 @@
 "protect-invalidlevel": "Invalid protection level"
 }
 
-def protection_types(self):
+def restrictions(self):
 """
-Return the protection types available on this site.
+Return the page restrictions available on this site.
 
-With MediaWiki version 1.23 protection types can be retrieved. To
-support older wikis, the default protection types 'create', 'edit',
-'move' and 'upload' are returned.
+Since MediaWiki 1.23, restrictions can be retrieved via the API.
+For older wikis, the default restrictions are returned.
 
-@return protection types available
-@rtype: set of unicode instances
+@return: available page restrictions
+@rtype: dict
 """
 # implemented in b73b5883d486db0e9278ef16733551f28d9e096d
 restrictions = self._add_siteinfo('restrictions', True)
-if restrictions is None or 'types' not in restrictions:
-return set([u'create', u'edit', u'move', u'upload'])
-else:
-return set(restrictions['types'])
-
-def protection_levels(self):
-"""
-Return the protection levels available on this site.
-
-With MediaWiki version 1.23 protection levels can be retrieved. To
-support older wikis, the default protection levels '', 'autoconfirmed',
-and 'sysop' are returned.
-
-@return protection types available
-@rtype: set of unicode instances
-"""
-# implemented in b73b5883d486db0e9278ef16733551f28d9e096d
-restrictions = self._add_siteinfo('restrictions', True)
-if restrictions is None or 'levels' not in restrictions:
-return set([u'', u'autoconfirmed', u'sysop'])
-else:
-return set(restrictions['levels'])
+default = {
+'cascadinglevels': ['sysop'],
+'semiprotectedlevels': ['autoconfirmed'],
+'levels': ['', 'autoconfirmed', 'sysop'],
+'types': ['create', 'edit', 'move', 'upload']
+}
+if restrictions is None:
+restrictions = default
+for key, val in restrictions.items():
+if isinstance(val, list):
+restrictions[key] = set(val)
+return restrictions
 
 @must_be(group='sysop')
 @deprecate_arg("summary", "reason")
diff --git a/scripts/protect.py b/scripts/protect.py
index 256d76b..c3a9567 100644
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -156,8 +156,8 @@
 genFactory = pagegenerators.GeneratorFactory()
 site = pywikibot.Site()
 
-protection_levels = set(site.protection_levels())
-protection_types = site.protection_types()
+protection_levels = site.restrictions()['levels']
+protection_types = site.restrictions()['types']
 if '' in protection_levels:
 protection_levels.remove('')
 protection_levels.add('none')

-- 
To view, visit https://gerrit.wikimedia.org/r/154390
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7199e78c6600beb21736031e8f4a4a13a3cc27f4
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make MWMediaDialog not crash on API errors - change (mediawiki...VisualEditor)

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

Change subject: Make MWMediaDialog not crash on API errors
..


Make MWMediaDialog not crash on API errors

resp.query won't be set if resp.error is set instead.

Also rename alignButons to alignButtons.

Change-Id: Ie69fe1ddae393ee02b44e9288a35e0dd47d17e4e
---
M modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
index 910adb4..f401f2e 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
@@ -188,7 +188,7 @@
  */
 ve.ui.MWMediaDialog.prototype.initialize = function () {
var altTextFieldset, positionFieldset, borderField, positionField,
-   alignLeftButton, alignCenterButton, alignRightButton, 
alignButons;
+   alignLeftButton, alignCenterButton, alignRightButton, 
alignButtons;
 
// Parent method
ve.ui.MWMediaDialog.super.prototype.initialize.call( this );
@@ -272,11 +272,11 @@
'label': ve.msg( 'visualeditor-dialog-media-position-right' )
} );
 
-   alignButons = ( this.frame.getDir() === 'ltr' ) ?
+   alignButtons = ( this.frame.getDir() === 'ltr' ) ?
[ alignLeftButton, alignCenterButton, alignRightButton ] :
[ alignRightButton, alignCenterButton, alignLeftButton ];
 
-   this.positionInput.addItems( alignButons, 0 );
+   this.positionInput.addItems( alignButtons, 0 );
 
this.positionCheckbox = new OO.ui.CheckboxInputWidget( {
'$': this.$
@@ -590,7 +590,7 @@
'meta': 'filerepoinfo'
} ).then(
function ( resp ) {
-   return resp.query.repos || defaultSource;
+   return resp.query && resp.query.repos || 
defaultSource;
},
function () {
return $.Deferred().resolve( defaultSource );

-- 
To view, visit https://gerrit.wikimedia.org/r/154385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie69fe1ddae393ee02b44e9288a35e0dd47d17e4e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Mooeypoo 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 14e4a91..fbd7923 - change (mediawiki/extensions)

2014-08-16 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: 14e4a91..fbd7923
..

Syncronize VisualEditor: 14e4a91..fbd7923

Change-Id: I207c028e4295d51ed6ccf2edeb4a3529943d46b8
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions 
refs/changes/89/154389/1

diff --git a/VisualEditor b/VisualEditor
index 14e4a91..fbd7923 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 14e4a915d7b1f9dee9c56076f8e00ca2f9555948
+Subproject commit fbd7923741b2a221f216dcea7fa322b725e1970b

-- 
To view, visit https://gerrit.wikimedia.org/r/154389
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I207c028e4295d51ed6ccf2edeb4a3529943d46b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 14e4a91..fbd7923 - change (mediawiki/extensions)

2014-08-16 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: 14e4a91..fbd7923
..


Syncronize VisualEditor: 14e4a91..fbd7923

Change-Id: I207c028e4295d51ed6ccf2edeb4a3529943d46b8
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index 14e4a91..fbd7923 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 14e4a915d7b1f9dee9c56076f8e00ca2f9555948
+Subproject commit fbd7923741b2a221f216dcea7fa322b725e1970b

-- 
To view, visit https://gerrit.wikimedia.org/r/154389
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I207c028e4295d51ed6ccf2edeb4a3529943d46b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 
Gerrit-Reviewer: Jenkins-mwext-sync 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] [5] Add revision local cache holder object - change (mediawiki...Echo)

2014-08-16 Thread Bsitu (Code Review)
Bsitu has uploaded a new change for review.

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

Change subject: [5] Add revision local cache holder object
..

[5] Add revision local cache holder object

Change-Id: I85f68b3ca269c711a8a177e013bd8eba38833444
---
M Echo.php
A includes/cache/RevisionLocalCache.php
2 files changed, 57 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/87/154387/1

diff --git a/Echo.php b/Echo.php
index ae9346e..3d1a68c 100644
--- a/Echo.php
+++ b/Echo.php
@@ -70,6 +70,7 @@
 // Local caches
 $wgAutoloadClasses['EchoLocalCache'] = $dir . 'includes/cache/LocalCache.php';
 $wgAutoloadClasses['EchoTitleLocalCache'] = $dir . 
'includes/cache/TitleLocalCache.php';
+$wgAutoloadClasses['EchoRevisionLocalCache'] = $dir . 
'includes/cache/RevisionLocalCache.php';
 
 // Output formatters
 $wgAutoloadClasses['EchoDataOutputFormatter'] = $dir . 
'includes/DataOutputFormatter.php';
diff --git a/includes/cache/RevisionLocalCache.php 
b/includes/cache/RevisionLocalCache.php
new file mode 100644
index 000..a584ffd
--- /dev/null
+++ b/includes/cache/RevisionLocalCache.php
@@ -0,0 +1,56 @@
+lookups ) {
+   // @Todo Make a core Revision::newFromIds()
+   $dbr = wfGetDB( DB_SLAVE );
+   $fields = array_merge(
+   Revision::selectFields(),
+   Revision::selectPageFields(),
+   Revision::selectUserFields()
+   );
+   $res = $dbr->select(
+   array( 'revision', 'page', 'user' ),
+   $fields,
+   array( 'rev_id' => $this->lookups ),
+   __METHOD__,
+   $options,
+   array( 'page' => Revision::pageJoinCond(), 
'user' => Revision::userJoinCond() )
+   );
+   if ( $res ) {
+   foreach ( $res as $row ) {
+   $this->targets[$row->rev_id] = new 
Revision( $row );
+   }
+   }
+
+   $this->lookups = array();
+   }
+   }
+
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/154387
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85f68b3ca269c711a8a177e013bd8eba38833444
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits