[MediaWiki-commits] [Gerrit] Allow LinkCache to be used for other wikis - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/177960 Change subject: Allow LinkCache to be used for other wikis .. Allow LinkCache to be used for other wikis Changed most of LinkCache to use TitleValue internally since it doesn't depend upon global state like Title does. Change-Id: I89e57f39e75d1cefe534d79ddbe41dd1bfdc776e --- M includes/Title.php M includes/cache/LinkBatch.php M includes/cache/LinkCache.php M includes/page/WikiPage.php M includes/parser/CoreParserFunctions.php M includes/parser/LinkHolderArray.php M includes/parser/Parser.php A tests/phpunit/includes/cache/LinkCacheTest.php 8 files changed, 277 insertions(+), 101 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/60/177960/1 diff --git a/includes/Title.php b/includes/Title.php index 638da08..5288a37 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -960,7 +960,7 @@ # Calling getArticleID() loads the field from cache as needed if ( !$this-mContentModel $this-getArticleID( $flags ) ) { $linkCache = LinkCache::singleton(); - $this-mContentModel = $linkCache-getGoodLinkFieldObj( $this, 'model' ); + $this-mContentModel = $linkCache-getGoodLinkFieldObj( $this-getTitleValue(), 'model' ); } if ( !$this-mContentModel ) { @@ -3165,12 +3165,12 @@ $linkCache = LinkCache::singleton(); if ( $flags self::GAID_FOR_UPDATE ) { $oldUpdate = $linkCache-forUpdate( true ); - $linkCache-clearLink( $this ); - $this-mArticleID = $linkCache-addLinkObj( $this ); + $linkCache-clearLink( $this-getTitleValue() ); + $this-mArticleID = $linkCache-addLinkObj( $this-getTitleValue() ); $linkCache-forUpdate( $oldUpdate ); } else { if ( -1 == $this-mArticleID ) { - $this-mArticleID = $linkCache-addLinkObj( $this ); + $this-mArticleID = $linkCache-addLinkObj( $this-getTitleValue() ); } } return $this-mArticleID; @@ -3194,7 +3194,7 @@ } $linkCache = LinkCache::singleton(); - $cached = $linkCache-getGoodLinkFieldObj( $this, 'redirect' ); + $cached = $linkCache-getGoodLinkFieldObj( $this-getTitleValue(), 'redirect' ); if ( $cached === null ) { # Trust LinkCache's state over our own # LinkCache is telling us that the page doesn't exist, despite there being cached @@ -3228,7 +3228,7 @@ return $this-mLength; } $linkCache = LinkCache::singleton(); - $cached = $linkCache-getGoodLinkFieldObj( $this, 'length' ); + $cached = $linkCache-getGoodLinkFieldObj( $this-getTitleValue(), 'length' ); if ( $cached === null ) { # Trust LinkCache's state over our own, as for isRedirect() $this-mLength = 0; @@ -3256,8 +3256,8 @@ return $this-mLatestID; } $linkCache = LinkCache::singleton(); - $linkCache-addLinkObj( $this ); - $cached = $linkCache-getGoodLinkFieldObj( $this, 'revision' ); + $linkCache-addLinkObj( $this-getTitleValue() ); + $cached = $linkCache-getGoodLinkFieldObj( $this-getTitleValue(), 'revision' ); if ( $cached === null ) { # Trust LinkCache's state over our own, as for isRedirect() $this-mLatestID = 0; @@ -3281,7 +3281,7 @@ */ public function resetArticleID( $newid ) { $linkCache = LinkCache::singleton(); - $linkCache-clearLink( $this ); + $linkCache-clearLink( $this-getTitleValue() ); if ( $newid === false ) { $this-mArticleID = -1; @@ -3399,11 +3399,9 @@ if ( $res-numRows() ) { $linkCache = LinkCache::singleton(); foreach ( $res as $row ) { - $titleObj = Title::makeTitle( $row-page_namespace, $row-page_title ); - if ( $titleObj ) { - $linkCache-addGoodLinkObjFromRow( $titleObj, $row ); - $retVal[] = $titleObj; - } + $titleValue = new TitleValue( $row-page_namespace, $row-page_title ); + $linkCache-addGoodLinkObjFromRow( $titleValue,
[MediaWiki-commits] [Gerrit] Apply percent decoding to titles extracted from URLs - change (apps...wikipedia)
Sesh has uploaded a new change for review. https://gerrit.wikimedia.org/r/177961 Change subject: Apply percent decoding to titles extracted from URLs .. Apply percent decoding to titles extracted from URLs Change-Id: If2cd04fff08a394467eb4b770e080fc80fa076da --- M MediaWikiKit/MediaWikiKit/MWKSite.m M MediaWikiKit/MediaWikiKitTests/MWKSiteTests.m 2 files changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/61/177961/1 diff --git a/MediaWikiKit/MediaWikiKit/MWKSite.m b/MediaWikiKit/MediaWikiKit/MWKSite.m index 826abb9..4e1dd0d 100644 --- a/MediaWikiKit/MediaWikiKit/MWKSite.m +++ b/MediaWikiKit/MediaWikiKit/MWKSite.m @@ -28,7 +28,8 @@ - (MWKTitle *)titleWithInternalLink:(NSString *)path { if ([path hasPrefix:localLinkPrefix]) { -NSString *remainder = [path substringFromIndex:localLinkPrefix.length]; +NSString *remainder = [[path substringFromIndex:localLinkPrefix.length] + stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; return [self titleWithString:remainder]; } else { @throw [NSException exceptionWithName:@SiteBadLinkFormatException reason:@unexpected local link format userInfo:nil]; diff --git a/MediaWikiKit/MediaWikiKitTests/MWKSiteTests.m b/MediaWikiKit/MediaWikiKitTests/MWKSiteTests.m index a396260..734b4e9 100644 --- a/MediaWikiKit/MediaWikiKitTests/MWKSiteTests.m +++ b/MediaWikiKit/MediaWikiKitTests/MWKSiteTests.m @@ -63,6 +63,8 @@ XCTAssertEqualObjects([site titleWithInternalLink:@/wiki/India].prefixedText, @India); XCTAssertEqualObjects([site titleWithInternalLink:@/wiki/Talk:India].prefixedText, @Talk:India); XCTAssertEqualObjects([site titleWithInternalLink:@/wiki/Talk:India#History].prefixedText, @Talk:India); +XCTAssertEqualObjects([site titleWithInternalLink:@/wiki/2008 ACC Men%27s Basketball Tournament].prefixedText, + @2008 ACC Men's Basketball Tournament); //XCTAssertThrows([site titleWithInternalLink:@/upload/foobar]); } -- To view, visit https://gerrit.wikimedia.org/r/177961 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2cd04fff08a394467eb4b770e080fc80fa076da Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Sesh seshadri.mahalin...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix issue where first Read more suggestion was sometimes t... - change (apps...wikipedia)
Deskana has uploaded a new change for review. https://gerrit.wikimedia.org/r/177962 Change subject: Fix issue where first Read more suggestion was sometimes the current article .. Fix issue where first Read more suggestion was sometimes the current article Currently, if you follow a link to the current page via a redirect, e.g. going to [[Avant-garde]] by tapping on the a link to the [[Avant garde]] redirect page, then the first link the Read more section is often for the current article. This patch fixes that. Bug: T76936 Change-Id: Idf580246e070fbce26e88c0bb67196b5f7b4f028 --- M wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java M wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java 2 files changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/62/177962/1 diff --git a/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java b/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java index 522c86b..cd2541b 100644 --- a/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java +++ b/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java @@ -488,6 +488,13 @@ getActivity().updateProgressBar(false, true, 0); // trigger layout of the bottom content +// Check to see if the page title has changed (e.g. due to following a redirect), +// because if it has then the handler needs the new title to make sure it doesn't +// accidentally display the current article as a read more suggestion +if (bottomContentHandler.getTitle() != title) +{ +bottomContentHandler.setTitle(title); +} bottomContentHandler.beginLayout(); } }); diff --git a/wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java b/wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java index 2ab97a7..974ff71 100644 --- a/wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java +++ b/wikipedia/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java @@ -47,7 +47,7 @@ private final CommunicationBridge bridge; private final WebView webView; private final LinkHandler linkHandler; -private final PageTitle pageTitle; +private PageTitle pageTitle; private final PageActivity activity; private final WikipediaApp app; private float displayDensity; @@ -220,6 +220,14 @@ }.execute(); } +public PageTitle getTitle() { +return pageTitle; +} + +public void setTitle(PageTitle newTitle) { +pageTitle = newTitle; +} + private void setupReadMoreSection(LayoutInflater layoutInflater, final FullSearchArticlesTask.FullSearchResults results) { final ReadMoreAdapter adapter = new ReadMoreAdapter(layoutInflater, results.getResults()); -- To view, visit https://gerrit.wikimedia.org/r/177962 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf580246e070fbce26e88c0bb67196b5f7b4f028 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Deskana dga...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert nagios_common: Add compat checkcommand definition te... - change (operations/puppet)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/177963 Change subject: Revert nagios_common: Add compat checkcommand definition temporarily .. Revert nagios_common: Add compat checkcommand definition temporarily Puppet seems to have run everywhere necessary, and a manual check reveals that nobody is using the old name anymore. This reverts commit 71c83329f323bb1de18b52e40d794667d02b4818. Change-Id: I8d9d88743da78b2747ebbd160dc4daebd97881f4 --- M modules/nagios_common/files/checkcommands.cfg 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/63/177963/1 diff --git a/modules/nagios_common/files/checkcommands.cfg b/modules/nagios_common/files/checkcommands.cfg index 6834a43..88f092e 100644 --- a/modules/nagios_common/files/checkcommands.cfg +++ b/modules/nagios_common/files/checkcommands.cfg @@ -231,12 +231,6 @@ command_line$USER1$/check_http -H $ARG1$ -p $ARG2$ -I $HOSTADDRESS$ -u /wikimedia-monitoring-test } -# HACK: Temp. definition same as check_http_varnish until puppet comes around to collecting everything -define command{ -command_namecheck_http_generic -command_line$USER1$/check_http -H $ARG1$ -p $ARG2$ -I $HOSTADDRESS$ -u /wikimedia-monitoring-test -} - # 'check_http_upload' command definition, querying a different URL define command{ command_namecheck_http_upload_on_port -- To view, visit https://gerrit.wikimedia.org/r/177963 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d9d88743da78b2747ebbd160dc4daebd97881f4 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert nagios_common: Add compat checkcommand definition te... - change (operations/puppet)
Yuvipanda has submitted this change and it was merged. Change subject: Revert nagios_common: Add compat checkcommand definition temporarily .. Revert nagios_common: Add compat checkcommand definition temporarily Puppet seems to have run everywhere necessary, and a manual check reveals that nobody is using the old name anymore. This reverts commit 71c83329f323bb1de18b52e40d794667d02b4818. Change-Id: I8d9d88743da78b2747ebbd160dc4daebd97881f4 --- M modules/nagios_common/files/checkcommands.cfg 1 file changed, 0 insertions(+), 6 deletions(-) Approvals: Yuvipanda: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/nagios_common/files/checkcommands.cfg b/modules/nagios_common/files/checkcommands.cfg index 6834a43..88f092e 100644 --- a/modules/nagios_common/files/checkcommands.cfg +++ b/modules/nagios_common/files/checkcommands.cfg @@ -231,12 +231,6 @@ command_line$USER1$/check_http -H $ARG1$ -p $ARG2$ -I $HOSTADDRESS$ -u /wikimedia-monitoring-test } -# HACK: Temp. definition same as check_http_varnish until puppet comes around to collecting everything -define command{ -command_namecheck_http_generic -command_line$USER1$/check_http -H $ARG1$ -p $ARG2$ -I $HOSTADDRESS$ -u /wikimedia-monitoring-test -} - # 'check_http_upload' command definition, querying a different URL define command{ command_namecheck_http_upload_on_port -- To view, visit https://gerrit.wikimedia.org/r/177963 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d9d88743da78b2747ebbd160dc4daebd97881f4 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape renameuser-linkoncontribs - change (mediawiki...Renameuser)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177964 Change subject: Escape renameuser-linkoncontribs .. Escape renameuser-linkoncontribs Change-Id: I997aa38715e3b0cf976ff07f845060b23966951b --- M Renameuser.hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Renameuser refs/changes/64/177964/1 diff --git a/Renameuser.hooks.php b/Renameuser.hooks.php index e527173..846f913 100644 --- a/Renameuser.hooks.php +++ b/Renameuser.hooks.php @@ -46,7 +46,7 @@ if ( $wgUser-isAllowed( 'renameuser' ) $id ) { $tools[] = Linker::link( SpecialPage::getTitleFor( 'Renameuser' ), - wfMessage( 'renameuser-linkoncontribs' )-text(), + wfMessage( 'renameuser-linkoncontribs' )-escaped(), array( 'title' = wfMessage( 'renameuser-linkoncontribs-text' )-parse() ), array( 'oldusername' = $nt-getText() ) ); -- To view, visit https://gerrit.wikimedia.org/r/177964 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I997aa38715e3b0cf976ff07f845060b23966951b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Renameuser Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Check for invalid titles when figuring out default form - change (mediawiki...SemanticForms)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177965 Change subject: Check for invalid titles when figuring out default form .. Check for invalid titles when figuring out default form Causes fatal errors with my unescaped/double-escaped messages checker Change-Id: I4221b2a965a55231b2a67ac5ce03b98ae0a43076 --- M includes/SF_FormLinker.php 1 file changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/65/177965/1 diff --git a/includes/SF_FormLinker.php b/includes/SF_FormLinker.php index a52c2f1..df765a3 100644 --- a/includes/SF_FormLinker.php +++ b/includes/SF_FormLinker.php @@ -21,7 +21,7 @@ static $mLinkedPages = array(); static $mLinkedPagesRetrieved = false; - static function getDefaultForm( $title ) { + static function getDefaultForm( Title $title ) { $pageID = $title-getArticleID(); $dbr = wfGetDB( DB_SLAVE ); $res = $dbr-select( 'page_props', @@ -393,9 +393,11 @@ } $namespacePage = Title::makeTitleSafe( NS_PROJECT, $namespace_label ); - $default_form = self::getDefaultForm( $namespacePage ); - if ( $default_form != '' ) { - return array( $default_form ); + if ( $namespacePage ) { + $default_form = self::getDefaultForm( $namespacePage ); + if ( $default_form != '' ) { + return array( $default_form ); + } } $default_forms = self::getFormsThatPagePointsTo( $namespace_label, NS_PROJECT, self::DEFAULT_FORM ); -- To view, visit https://gerrit.wikimedia.org/r/177965 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4221b2a965a55231b2a67ac5ce03b98ae0a43076 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape translate-sidebar-alltrans - change (mediawiki...Translate)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177968 Change subject: Escape translate-sidebar-alltrans .. Escape translate-sidebar-alltrans Change-Id: Ie7c6582ae27757fc0b767ea687f0adc786bdeb6d --- M utils/ToolBox.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/68/177968/1 diff --git a/utils/ToolBox.php b/utils/ToolBox.php index ba04013..6693469 100644 --- a/utils/ToolBox.php +++ b/utils/ToolBox.php @@ -27,7 +27,7 @@ $handle = new MessageHandle( $title ); if ( $handle-isValid() ) { $message = $title-getNsText() . ':' . $handle-getKey(); - $desc = wfMessage( 'translate-sidebar-alltrans' )-text(); + $desc = wfMessage( 'translate-sidebar-alltrans' )-escaped(); $url = htmlspecialchars( SpecialPage::getTitleFor( 'Translations' ) -getLocalURL( array ('message' = $message ) ) ); -- To view, visit https://gerrit.wikimedia.org/r/177968 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7c6582ae27757fc0b767ea687f0adc786bdeb6d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape tpt-languages-separator - change (mediawiki...Translate)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177967 Change subject: Escape tpt-languages-separator .. Escape tpt-languages-separator Change-Id: Ieb82971e0406a15cd89ddc3d0d1ba0b3c579c61f --- M tag/PageTranslationHooks.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/67/177967/1 diff --git a/tag/PageTranslationHooks.php b/tag/PageTranslationHooks.php index dce67e7..e306261 100644 --- a/tag/PageTranslationHooks.php +++ b/tag/PageTranslationHooks.php @@ -296,7 +296,7 @@ // dirmark (rlm/lrm) is added, because languages with RTL names can // mess the display $lang = Language::factory( $userLangCode ); - $sep = wfMessage( 'tpt-languages-separator' )-inLanguage( $lang )-plain(); + $sep = wfMessage( 'tpt-languages-separator' )-inLanguage( $lang )-escaped(); $sep .= $lang-getDirMark(); $languages = implode( $sep, $languages ); -- To view, visit https://gerrit.wikimedia.org/r/177967 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb82971e0406a15cd89ddc3d0d1ba0b3c579c61f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't double escape messages on Special:Translate - change (mediawiki...Translate)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177966 Change subject: Don't double escape messages on Special:Translate .. Don't double escape messages on Special:Translate Change-Id: If16199f291e1d1ad0c7b71df1f533d6c0bd9a591 --- M specials/SpecialTranslate.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/66/177966/1 diff --git a/specials/SpecialTranslate.php b/specials/SpecialTranslate.php index 3d5f13d..88d6b68 100644 --- a/specials/SpecialTranslate.php +++ b/specials/SpecialTranslate.php @@ -482,7 +482,7 @@ $taskParams = array( 'filter' = $filter ) + $params; ksort( $taskParams ); $href = $this-getTitle()-getLocalUrl( $taskParams ); - $link = Html::element( 'a', array( 'href' = $href ), $this-msg( $tabClass ) ); + $link = Html::element( 'a', array( 'href' = $href ), $this-msg( $tabClass )-text() ); $output .= Html::rawElement( 'li', array( 'class' = 'column ' . $tabClass, 'data-filter' = $filter, @@ -551,11 +551,11 @@ ) ) . Html::element( 'span', array( 'class' = 'grouptitle' ), - $this-msg( 'translate-msggroupselector-projects' )-escaped() + $this-msg( 'translate-msggroupselector-projects' )-text() ) . Html::element( 'span', array( 'class' = 'grouptitle grouplink expanded' ), - $this-msg( 'translate-msggroupselector-search-all' )-escaped() + $this-msg( 'translate-msggroupselector-search-all' )-text() ) . Html::element( 'span', array( -- To view, visit https://gerrit.wikimedia.org/r/177966 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If16199f291e1d1ad0c7b71df1f533d6c0bd9a591 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove double escaping in Special:Block - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177977 Change subject: Remove double escaping in Special:Block .. Remove double escaping in Special:Block This function is used in two extensions, which also pass it to HtmlForm, so no underescaping there either. Change-Id: I93325051b3a6ef8fc242437a736b5c84bda56b7d --- M includes/specials/SpecialBlock.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/77/177977/1 diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index a4269d1..b0b8bd6 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -829,7 +829,7 @@ } list( $show, $value ) = explode( ':', $option ); - $a[htmlspecialchars( $show )] = htmlspecialchars( $value ); + $a[$show] = $value; } return $a; -- To view, visit https://gerrit.wikimedia.org/r/177977 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93325051b3a6ef8fc242437a736b5c84bda56b7d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix escaping of specialList and clarify comments - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177980 Change subject: Fix escaping of specialList and clarify comments .. Fix escaping of specialList and clarify comments Change-Id: I4bead5f5f310dd35e8dfee738f35a070e7bf869f --- M languages/Language.php 1 file changed, 26 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/80/177980/1 diff --git a/languages/Language.php b/languages/Language.php index 7847ba2..d14606b 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -959,7 +959,17 @@ * @return string */ function getMessageFromDB( $msg ) { - return wfMessage( $msg )-inLanguage( $this )-text(); + return $this-msg( $msg )-text(); + } + + /** +* Get message object in this language. Only for use inside this class. +* +* @param string $msg Message name +* @return Message +*/ + protected function msg( $msg ) { + return wfMessage( $msg )-inLanguage( $this ); } /** @@ -3403,10 +3413,10 @@ return ''; } if ( $m 0 ) { - $and = htmlspecialchars( $this-getMessageFromDB( 'and' ) ); - $space = htmlspecialchars( $this-getMessageFromDB( 'word-separator' ) ); + $and = $this-msg( 'and' )-escaped(); + $space = $this-msg( 'word-separator' )-escaped(); if ( $m 1 ) { - $comma = htmlspecialchars( $this-getMessageFromDB( 'comma-separator' ) ); + $comma = $this-msg( 'comma-separator' )-escaped(); } } $s = $l[$m]; @@ -4640,17 +4650,22 @@ * Make a list item, used by various special pages * * @param string $page Page link -* @param string $details Text between brackets +* @param string $details HTML safe text between brackets * @param bool $oppositedm Add the direction mark opposite to your * language, to display text properly -* @return string +* @return HTML escaped string */ function specialList( $page, $details, $oppositedm = true ) { - $dirmark = ( $oppositedm ? $this-getDirMark( true ) : '' ) . - $this-getDirMark(); - $details = $details ? $dirmark . $this-getMessageFromDB( 'word-separator' ) . - wfMessage( 'parentheses' )-rawParams( $details )-inLanguage( $this )-escaped() : ''; - return $page . $details; + if ( !$details ) { + return $page; + } + + $dirmark = ( $oppositedm ? $this-getDirMark( true ) : '' ) . $this-getDirMark(); + return + $page . + $dirmark . + $this-msg( 'word-separator' )-escaped() . + $this-msg( 'parentheses' )-rawParams( $details )-escaped(); } /** -- To view, visit https://gerrit.wikimedia.org/r/177980 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4bead5f5f310dd35e8dfee738f35a070e7bf869f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Skin: handle invalid titles gracefully - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177971 Change subject: Skin: handle invalid titles gracefully .. Skin: handle invalid titles gracefully Linker::link throws a notice if given null instead of title. Title is constructed based on messages, so it can easily be null. Change-Id: I5451135966cbb3bbd09d2568cec6b936f3b88aa3 --- M includes/skins/Skin.php 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/71/177971/1 diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 5604bc2..f401c92 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -482,9 +482,10 @@ $msg = $this-msg( 'pagecategories' )-numParams( count( $allCats['normal'] ) )-escaped(); $linkPage = wfMessage( 'pagecategorieslink' )-inContentLanguage()-text(); + $title = Title::newFromText( $linkPage ); + $link = $title ? Linker::link( $title, $msg ) : $msg; $s .= 'div id=mw-normal-catlinks class=mw-normal-catlinks' . - Linker::link( Title::newFromText( $linkPage ), $msg ) - . $colon . 'ul' . $t . '/ul' . '/div'; + $link . $colon . 'ul' . $t . '/ul' . '/div'; } # Hidden categories @@ -951,6 +952,10 @@ // but we make the link target be the one site-wide page. $title = Title::newFromText( $this-msg( $page )-inContentLanguage()-text() ); + if ( !$title ) { + return ''; + } + return Linker::linkKnown( $title, $this-msg( $desc )-escaped() -- To view, visit https://gerrit.wikimedia.org/r/177971 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5451135966cbb3bbd09d2568cec6b936f3b88aa3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove over/underescaping detected in Special:UserRights - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177979 Change subject: Remove over/underescaping detected in Special:UserRights .. Remove over/underescaping detected in Special:UserRights Change-Id: I99823cd56e0a6f501101cb85be832d2925ce9779 --- M includes/User.php M includes/specials/SpecialUserrights.php M languages/Language.php 3 files changed, 23 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/79/177979/1 diff --git a/includes/User.php b/includes/User.php index 3cbb052..43faf4d 100644 --- a/includes/User.php +++ b/includes/User.php @@ -4471,7 +4471,7 @@ if ( $title ) { return Linker::link( $title, htmlspecialchars( $text ) ); } else { - return $text; + return htmlspecialchars( $text ); } } diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 6ca57aa..75fd644 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -493,25 +493,32 @@ } $language = $this-getLanguage(); - $displayedList = $this-msg( 'userrights-groupsmember-type', - $language-listToText( $list ), - $language-listToText( $membersList ) - )-plain(); - $displayedAutolist = $this-msg( 'userrights-groupsmember-type', - $language-listToText( $autoList ), - $language-listToText( $autoMembersList ) - )-plain(); + $displayedList = $this-msg( 'userrights-groupsmember-type' ) + -rawParams( + $language-listToText( $list ), + $language-listToText( $membersList ) + )-escaped(); + $displayedAutolist = $this-msg( 'userrights-groupsmember-type' ) + -rawParams( + $language-listToText( $autoList ), + $language-listToText( $autoMembersList ) + )-escaped(); $grouplist = ''; $count = count( $list ); if ( $count 0 ) { - $grouplist = $this-msg( 'userrights-groupsmember', $count, $user-getName() )-parse(); + $grouplist = $this-msg( 'userrights-groupsmember' ) + -numParams( $count ) + -params( $user-getName() ) + -parse(); $grouplist = 'p' . $grouplist . ' ' . $displayedList . /p\n; } $count = count( $autoList ); if ( $count 0 ) { - $autogrouplistintro = $this-msg( 'userrights-groupsmember-auto', $count, $user-getName() ) + $autogrouplistintro = $this-msg( 'userrights-groupsmember-auto' ) + -numParams( $count ) + -params( $user-getName() ) -parse(); $grouplist .= 'p' . $autogrouplistintro . ' ' . $displayedAutolist . /p\n; } @@ -669,9 +676,9 @@ $member = User::getGroupMember( $group, $user-getName() ); if ( $checkbox['irreversible'] ) { - $text = $this-msg( 'userrights-irreversible-marker', $member )-escaped(); + $text = $this-msg( 'userrights-irreversible-marker', $member )-text(); } else { - $text = htmlspecialchars( $member ); + $text = $member; } $checkboxHtml = Xml::checkLabel( $text, wpGroup- . $group, wpGroup- . $group, $checkbox['set'], $attr ); diff --git a/languages/Language.php b/languages/Language.php index fb04255..7847ba2 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -3403,10 +3403,10 @@ return ''; } if ( $m 0 ) { - $and = $this-getMessageFromDB( 'and' ); - $space = $this-getMessageFromDB( 'word-separator' ); + $and = htmlspecialchars( $this-getMessageFromDB( 'and' ) ); + $space = htmlspecialchars( $this-getMessageFromDB( 'word-separator' ) ); if ( $m 1 ) { - $comma = $this-getMessageFromDB( 'comma-separator' ); + $comma =
[MediaWiki-commits] [Gerrit] Escape unescaped messages shown on a diff page - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177974 Change subject: Escape unescaped messages shown on a diff page .. Escape unescaped messages shown on a diff page Change-Id: I05c07625a2dbb3c5d3ab46d1cfafeaed6a248bba --- M includes/Linker.php M includes/diff/DifferenceEngine.php 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/74/177974/1 diff --git a/includes/Linker.php b/includes/Linker.php index d84e5d09..927ab1f 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1179,7 +1179,7 @@ wfRunHooks( 'UserToolLinksEdit', array( $userId, $userText, $items ) ); if ( $items ) { - return wfMessage( 'word-separator' )-plain() + return wfMessage( 'word-separator' )-escaped() . 'span class=mw-usertoollinks' . wfMessage( 'parentheses' )-rawParams( $wgLang-pipeList( $items ) )-escaped() . '/span'; @@ -1266,7 +1266,7 @@ $userId = $rev-getUser( Revision::FOR_THIS_USER ); $userText = $rev-getUserText( Revision::FOR_THIS_USER ); $link = self::userLink( $userId, $userText ) - . wfMessage( 'word-separator' )-plain() + . wfMessage( 'word-separator' )-escaped() . self::userToolLinks( $userId, $userText ); } else { $link = wfMessage( 'rev-deleted-user' )-escaped(); @@ -1812,7 +1812,7 @@ $inner = self::buildRollbackLink( $rev, $context, $editCount ); if ( !in_array( 'noBrackets', $options ) ) { - $inner = $context-msg( 'brackets' )-rawParams( $inner )-plain(); + $inner = $context-msg( 'brackets' )-rawParams( $inner )-escaped(); } return 'span class=mw-rollback-link' . $inner . '/span'; diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index dd5f3c7..e4f3b0d 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -1062,7 +1062,7 @@ $key = $title-quickUserCan( 'edit', $user ) ? 'editold' : 'viewsourceold'; $msg = $this-msg( $key )-escaped(); $editLink = $this-msg( 'parentheses' )-rawParams( - Linker::linkKnown( $title, $msg, array( ), $editQuery ) )-plain(); + Linker::linkKnown( $title, $msg, array( ), $editQuery ) )-escaped(); $header .= ' ' . Html::rawElement( 'span', array( 'class' = 'mw-diff-edit' ), -- To view, visit https://gerrit.wikimedia.org/r/177974 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05c07625a2dbb3c5d3ab46d1cfafeaed6a248bba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape unescaped messages shown in action=info - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177976 Change subject: Escape unescaped messages shown in action=info .. Escape unescaped messages shown in action=info Change-Id: Id16d8c8dff73fdacad6c9a4ff7f2919945b7e893 --- M includes/Linker.php M includes/actions/InfoAction.php 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/76/177976/1 diff --git a/includes/Linker.php b/includes/Linker.php index 927ab1f..081123c 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -2033,14 +2033,14 @@ if ( $titleObj-quickUserCan( 'edit' ) ) { $editLink = self::link( $titleObj, - wfMessage( 'editlink' )-text(), + wfMessage( 'editlink' )-escaped(), array(), array( 'action' = 'edit' ) ); } else { $editLink = self::link( $titleObj, - wfMessage( 'viewsourcelink' )-text(), + wfMessage( 'viewsourcelink' )-escaped(), array(), array( 'action' = 'edit' ) ); diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index e7455f6..a3f7a1b 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -295,7 +295,7 @@ // Content model of the page $pageInfo['header-basic'][] = array( $this-msg( 'pageinfo-content-model' ), - ContentHandler::getLocalizedName( $title-getContentModel() ) + htmlspecialchars( ContentHandler::getLocalizedName( $title-getContentModel() ) ) ); // Search engine status @@ -477,7 +477,7 @@ $this-msg( 'pageinfo-firsttime' ), Linker::linkKnown( $title, - $lang-userTimeAndDate( $firstRev-getTimestamp(), $user ), + htmlspecialchars( $lang-userTimeAndDate( $firstRev-getTimestamp(), $user ) ), array(), array( 'oldid' = $firstRev-getId() ) ) @@ -496,7 +496,7 @@ $this-msg( 'pageinfo-lasttime' ), Linker::linkKnown( $title, - $lang-userTimeAndDate( $this-page-getTimestamp(), $user ), + htmlspecialchars( $lang-userTimeAndDate( $this-page-getTimestamp(), $user ) ), array(), array( 'oldid' = $this-page-getLatest() ) ) -- To view, visit https://gerrit.wikimedia.org/r/177976 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id16d8c8dff73fdacad6c9a4ff7f2919945b7e893 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape limit report output - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177969 Change subject: Escape limit report output .. Escape limit report output Even though it is inside html comment, someone could easily close the comment if raw html is allowed in messages. Change-Id: I9a43457f3fdd71b6fe962f017760b4da0a26366b --- M includes/parser/Parser.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/69/177969/1 diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 7ea57be..d9e7100 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -516,7 +516,7 @@ } if ( !$keyMsg-isDisabled() !$valueMsg-isDisabled() ) { $valueMsg-params( $value ); - $limitReport .= {$keyMsg-text()}: {$valueMsg-text()}\n; + $limitReport .= {$keyMsg-escaped()}: {$valueMsg-escaped()}\n; } } } -- To view, visit https://gerrit.wikimedia.org/r/177969 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9a43457f3fdd71b6fe962f017760b4da0a26366b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escaped lastmodifiedat and laggedslavemode - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177973 Change subject: Escaped lastmodifiedat and laggedslavemode .. Escaped lastmodifiedat and laggedslavemode Change-Id: Ibcc1b49946bc91e12756eb3866448159493c61f4 --- M includes/skins/Skin.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/73/177973/1 diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 3099bf6..5c6916a 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -862,13 +862,13 @@ if ( $timestamp ) { $d = $this-getLanguage()-userDate( $timestamp, $this-getUser() ); $t = $this-getLanguage()-userTime( $timestamp, $this-getUser() ); - $s = ' ' . $this-msg( 'lastmodifiedat', $d, $t )-text(); + $s = ' ' . $this-msg( 'lastmodifiedat', $d, $t )-escaped(); } else { $s = ''; } if ( wfGetLB()-getLaggedSlaveMode() ) { - $s .= ' strong' . $this-msg( 'laggedslavemode' )-text() . '/strong'; + $s .= ' strong' . $this-msg( 'laggedslavemode' )-escaped() . '/strong'; } return $s; -- To view, visit https://gerrit.wikimedia.org/r/177973 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibcc1b49946bc91e12756eb3866448159493c61f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape retrievedfrom message in the skin - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177972 Change subject: Escape retrievedfrom message in the skin .. Escape retrievedfrom message in the skin Change-Id: Ifd696ecd93c76e56cb21b3f2645367bb5ba0 --- M includes/skins/Skin.php 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/177972/1 diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index f401c92..3099bf6 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -646,8 +646,9 @@ $url = htmlspecialchars( wfExpandIRI( $this-getTitle()-getCanonicalURL() ) ); } - return $this-msg( 'retrievedfrom', 'a dir=ltr href=' . $url - . '' . $url . '/a' )-text(); + return $this-msg( 'retrievedfrom' ) + -rawParams( 'a dir=ltr href=' . $url. '' . $url . '/a' ) + -escaped(); } /** -- To view, visit https://gerrit.wikimedia.org/r/177972 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd696ecd93c76e56cb21b3f2645367bb5ba0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape parentheses message on watchlist pages - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177970 Change subject: Escape parentheses message on watchlist pages .. Escape parentheses message on watchlist pages Change-Id: Ie9943d7da81d16fcd95558f681af68ef9d392bfe --- M includes/specials/SpecialEditWatchlist.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/70/177970/1 diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index cb97420..3c3fa3b 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -760,7 +760,7 @@ return Html::rawElement( 'span', array( 'class' = 'mw-watchlist-toollinks' ), - wfMessage( 'parentheses', $wgLang-pipeList( $tools ) )-text() + wfMessage( 'parentheses' )-rawParams( $wgLang-pipeList( $tools ) )-escaped() ); } } -- To view, visit https://gerrit.wikimedia.org/r/177970 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9943d7da81d16fcd95558f681af68ef9d392bfe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape unescaped content shown in Special:BlockList - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177978 Change subject: Escape unescaped content shown in Special:BlockList .. Escape unescaped content shown in Special:BlockList Change-Id: I38bd12613b4066c312635f9920a9e2d2002dbf6d --- M includes/specials/SpecialBlockList.php 1 file changed, 21 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/78/177978/1 diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 02b2626..2fd3f6c 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -77,11 +77,11 @@ ), 'Options' = array( 'type' = 'multiselect', - 'options' = array( - $this-msg( 'blocklist-userblocks' )-text() = 'userblocks', - $this-msg( 'blocklist-tempblocks' )-text() = 'tempblocks', - $this-msg( 'blocklist-addressblocks' )-text() = 'addressblocks', - $this-msg( 'blocklist-rangeblocks' )-text() = 'rangeblocks', + 'options-messages' = array( + 'blocklist-userblocks' = 'userblocks', + 'blocklist-tempblocks' = 'tempblocks', + 'blocklist-addressblocks' = 'addressblocks', + 'blocklist-rangeblocks' = 'rangeblocks', ), 'flatlist' = true, ), @@ -262,19 +262,26 @@ 'blocklist-nousertalk', 'unblocklink', 'change-blocklink', - 'infiniteblock', ); - $msg = array_combine( $msg, array_map( array( $this, 'msg' ), $msg ) ); + $msg = array_combine( + $msg, + array_map( + function ( $m ) { return $this-msg( $m )-escaped(); }, + $msg + ) + ); } /** @var $row object */ $row = $this-mCurrentRow; + $language = $this-getLanguage(); + $formatted = ''; switch ( $name ) { case 'ipb_timestamp': - $formatted = $this-getLanguage()-userTimeAndDate( $value, $this-getUser() ); + $formatted = htmlspecialchars( $language-userTimeAndDate( $value, $this-getUser() ) ); break; case 'ipb_target': @@ -300,7 +307,10 @@ break; case 'ipb_expiry': - $formatted = $this-getLanguage()-formatExpiry( $value, /* User preference timezone */true ); + $formatted = htmlspecialchars( $language-formatExpiry( + $value, + /* User preference timezone */true + ) ); if ( $this-getUser()-isAllowed( 'block' ) ) { if ( $row-ipb_auto ) { $links[] = Linker::linkKnown( @@ -323,7 +333,7 @@ 'span', array( 'class' = 'mw-blocklist-actions' ), $this-msg( 'parentheses' )-rawParams( - $this-getLanguage()-pipeList( $links ) )-escaped() + $language-pipeList( $links ) )-escaped() ); } break; @@ -361,7 +371,7 @@ $properties[] = $msg['blocklist-nousertalk']; } - $formatted = $this-getLanguage()-commaList( $properties ); + $formatted = $language-commaList( $properties ); break; default: -- To view, visit https://gerrit.wikimedia.org/r/177978 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38bd12613b4066c312635f9920a9e2d2002dbf6d Gerrit-PatchSet: 1
[MediaWiki-commits] [Gerrit] Escape word-separator in LogFormatter - change (mediawiki/core)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177975 Change subject: Escape word-separator in LogFormatter .. Escape word-separator in LogFormatter Change-Id: I9428f5ff5b95d09932b3588f0118d6992a384390 --- M includes/logging/LogFormatter.php 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/75/177975/1 diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index bbe2f42..c0ca0c0 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -355,8 +355,10 @@ $element = $this-styleRestricedElement( $element ); } } else { - $performer = $this-getPerformerElement() . $this-msg( 'word-separator' )-text(); - $element = $performer . $this-getRestrictedElement( 'rev-deleted-event' ); + $sep = $this-msg( 'word-separator' ); + $sep = $this-plaintext ? $sep-text() : $sep-escaped(); + $performer = $this-getPerformerElement(); + $element = $performer . $sep . $this-getRestrictedElement( 'rev-deleted-event' ); } return $element; @@ -731,7 +733,9 @@ $performer = $this-getPerformerElement(); if ( !$this-irctext ) { - $action = $performer . $this-msg( 'word-separator' )-text() . $action; + $sep = $this-msg( 'word-separator' ); + $sep = $this-plaintext ? $sep-text() : $sep-escaped(); + $action = $performer . $sep . $action; } return $action; -- To view, visit https://gerrit.wikimedia.org/r/177975 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9428f5ff5b95d09932b3588f0118d6992a384390 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] RELEASE-NOTES-1.25: bug 44740 - T46740 - change (mediawiki/core)
PleaseStand has uploaded a new change for review. https://gerrit.wikimedia.org/r/177981 Change subject: RELEASE-NOTES-1.25: bug 44740 - T46740 .. RELEASE-NOTES-1.25: bug 44740 - T46740 Follows-up c393f874706e as indicated in e0698e254512. Change-Id: Ib25638e2808436bbf3321b8c7870dcc5bc2cb7b3 --- M RELEASE-NOTES-1.25 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/81/177981/1 diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 36d698f..06d2d66 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -29,7 +29,7 @@ * $wgOpenSearchTemplate is deprecated in favor of $wgOpenSearchTemplates. * Edits are now prepared via AJAX as users type edit summaries. This behavior can be disabled via $wgAjaxEditStash. -* (bug 44740) The temporary option $wgIncludejQueryMigrate was removed, along +* (T46740) The temporary option $wgIncludejQueryMigrate was removed, along with the jQuery Migrate library, as indicated when this option was provided in MediaWiki 1.24. -- To view, visit https://gerrit.wikimedia.org/r/177981 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib25638e2808436bbf3321b8c7870dcc5bc2cb7b3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand pleasest...@live.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] RELEASE-NOTES-1.25: bug 44740 - T46740 - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: RELEASE-NOTES-1.25: bug 44740 - T46740 .. RELEASE-NOTES-1.25: bug 44740 - T46740 Follows-up c393f874706e as indicated in e0698e254512. Change-Id: Ib25638e2808436bbf3321b8c7870dcc5bc2cb7b3 --- M RELEASE-NOTES-1.25 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 36d698f..06d2d66 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -29,7 +29,7 @@ * $wgOpenSearchTemplate is deprecated in favor of $wgOpenSearchTemplates. * Edits are now prepared via AJAX as users type edit summaries. This behavior can be disabled via $wgAjaxEditStash. -* (bug 44740) The temporary option $wgIncludejQueryMigrate was removed, along +* (T46740) The temporary option $wgIncludejQueryMigrate was removed, along with the jQuery Migrate library, as indicated when this option was provided in MediaWiki 1.24. -- To view, visit https://gerrit.wikimedia.org/r/177981 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib25638e2808436bbf3321b8c7870dcc5bc2cb7b3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand pleasest...@live.com Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Ensure integer compare in Special:WantedCategories - change (mediawiki/core)
Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/177982 Change subject: Ensure integer compare in Special:WantedCategories .. Ensure integer compare in Special:WantedCategories For some reasons the qc_value from the query is returned as string, not integer. The strict unequal comparision gives always true and that results in unneded 1 - 1 member. Added a intval. Bug: T76910 Change-Id: I26e2718e418f35e2e10565c747a8f06f2bbb5ba3 --- M includes/specials/SpecialWantedcategories.php 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/82/177982/1 diff --git a/includes/specials/SpecialWantedcategories.php b/includes/specials/SpecialWantedcategories.php index b8c0bb2..7ddafae 100644 --- a/includes/specials/SpecialWantedcategories.php +++ b/includes/specials/SpecialWantedcategories.php @@ -109,6 +109,7 @@ $currentValue = isset( $this-currentCategoryCounts[$result-title] ) ? $this-currentCategoryCounts[$result-title] : 0; + $cachedValue = intval( $result-value ); // T76910 // If the category has been created or emptied since the list was refreshed, strike it if ( $nt-isKnown() || $currentValue === 0 ) { @@ -116,11 +117,11 @@ } // Show the current number of category entries if it changed - if ( $currentValue !== $result-value ) { + if ( $currentValue !== $cachedValue ) { $nlinks = $this-msg( 'nmemberschanged' ) - -numParams( $result-value, $currentValue )-escaped(); + -numParams( $cachedValue, $currentValue )-escaped(); } else { - $nlinks = $this-msg( 'nmembers' )-numParams( $result-value )-escaped(); + $nlinks = $this-msg( 'nmembers' )-numParams( $cachedValue )-escaped(); } } -- To view, visit https://gerrit.wikimedia.org/r/177982 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26e2718e418f35e2e10565c747a8f06f2bbb5ba3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender umherirrender_de...@web.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Minor lint in base manifests - change (operations/puppet)
Alexandros Kosiaris has submitted this change and it was merged. Change subject: Minor lint in base manifests .. Minor lint in base manifests Change-Id: Ic3af7564829808c09485a71a24280f568cc82e35 --- M modules/base/manifests/init.pp 1 file changed, 15 insertions(+), 16 deletions(-) Approvals: Hashar: Looks good to me, but someone else must approve Alexandros Kosiaris: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/base/manifests/init.pp b/modules/base/manifests/init.pp index c6633a4..1d5a651 100644 --- a/modules/base/manifests/init.pp +++ b/modules/base/manifests/init.pp @@ -222,22 +222,21 @@ certname = $certname, } -include passwords::root, -base::grub, -base::resolving, -base::remote-syslog, -base::sysctl, -base::motd, -base::standard-packages, -base::environment, -base::phaste, -base::platform, -base::screenconfig, -ssh::client, -ssh::server, -role::salt::minions, -role::trebuchet, -nrpe +include passwords::root +include base::grub +include base::resolving +include base::remote-syslog +include base::sysctl +include base::motd +include base::standard-packages +include base::environment +include base::phaste +include base::platform +include base::screenconfig +include ssh::client +include role::salt::minions +include role::trebuchet +include nrpe # include base::monitor::host. -- To view, visit https://gerrit.wikimedia.org/r/177864 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3af7564829808c09485a71a24280f568cc82e35 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org Gerrit-Reviewer: Hashar has...@free.fr 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 Parsoid in beta - change (operations/puppet)
Alexandros Kosiaris has submitted this change and it was merged. Change subject: Fix Parsoid in beta .. Fix Parsoid in beta Point Varnish to the new instance (the old one is fried). Bonus: fix incorrect path in Parsoid settings (worked around this with a symlink in the meantime). Change-Id: I6a001f6e28c2b5ae25b08ae9d75bdb15469404a9 --- M manifests/role/cache.pp M manifests/role/parsoid.pp 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Alexandros Kosiaris: Looks good to me, approved jenkins-bot: Verified diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp index 39a6413..8ff1f0e 100644 --- a/manifests/role/cache.pp +++ b/manifests/role/cache.pp @@ -356,7 +356,7 @@ 'eqiad' = [ '10.68.17.96' ], # deployment-mediawiki01 }, 'parsoid' = { -'eqiad' = [ '10.68.16.17' ], # deployment-parsoid04 +'eqiad' = [ '10.68.16.120' ], # deployment-parsoid05 } } } diff --git a/manifests/role/parsoid.pp b/manifests/role/parsoid.pp index 1fd9a9b..29e2bfc 100644 --- a/manifests/role/parsoid.pp +++ b/manifests/role/parsoid.pp @@ -199,7 +199,7 @@ $parsoid_settings_file = '/srv/deployment/parsoid/localsettings.js' # Checkout of mediawiki/services/parsoid -$parsoid_base_path = '/srv/deployment/parsoid/parsoid' +$parsoid_base_path = '/srv/deployment/parsoid/deploy/src' file { '/etc/default/parsoid': ensure = present, -- To view, visit https://gerrit.wikimedia.org/r/169622 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6a001f6e28c2b5ae25b08ae9d75bdb15469404a9 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org Gerrit-Reviewer: Cscott canan...@wikimedia.org Gerrit-Reviewer: GWicke gwi...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] remove Points Reopened Before and Points Closed Before - change (phabricator...Sprint)
Christopher Johnson (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/177983 Change subject: remove Points Reopened Before and Points Closed Before .. remove Points Reopened Before and Points Closed Before History calcs for these values are wrong and unnecessary If a Task is Reopened, its points will be the same as when it was closed and any changes will still be picked up in the points change transaction. If a Task is closed before the Sprint start, its points should not be added to the points closed in the past and brought forward to the present, because points closed is only used to determine current points remaining. There is no value in knowing how many points were remaining in a Sprint that did not exist yet. Change-Id: I4ada671839518b8a60bd6dc1a861868045488c01 --- M src/storage/SprintTransaction.php M src/view/HistoryTableView.php 2 files changed, 4 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/Sprint refs/changes/83/177983/1 diff --git a/src/storage/SprintTransaction.php b/src/storage/SprintTransaction.php index 03c65af..433a6ad 100644 --- a/src/storage/SprintTransaction.php +++ b/src/storage/SprintTransaction.php @@ -40,13 +40,13 @@ break; case close: // A task was closed, mark it as done - // $this-CloseTasksBefore($before, $dates); - // $this-ClosePointsBefore($before, $points, $dates); + $this-CloseTasksBefore($before, $dates); + // $this-ClosePointsBefore($before, $points, $dates); break; case reopen: // A task was reopened, subtract from done -// $this-ReopenedTasksBefore($before, $dates); -// $this-ReopenedPointsBefore($before, $points, $dates); + $this-ReopenedTasksBefore($before, $dates); + // $this-ReopenedPointsBefore($before, $points, $dates); break; case points: // Points were changed diff --git a/src/view/HistoryTableView.php b/src/view/HistoryTableView.php index 3b2f3c4..db5e7c3 100644 --- a/src/view/HistoryTableView.php +++ b/src/view/HistoryTableView.php @@ -10,8 +10,6 @@ $before-getTasksReopenedBefore(), $before-getTasksClosedBefore(), $before-getPointsAddedBefore(), -$before-getPointsReopenedBefore(), -$before-getPointsClosedBefore(), $before-getPointsForwardfromBefore(), ); @@ -22,10 +20,7 @@ pht('Tasks Reopened'), pht('Tasks Closed'), pht('Points Added'), -pht('Points Reopened'), -pht('Points Closed'), pht('Points Forwarded'), - )); $box = id(new PHUIObjectBoxView()) -setHeaderText(pht('Before Sprint')) -- To view, visit https://gerrit.wikimedia.org/r/177983 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ada671839518b8a60bd6dc1a861868045488c01 Gerrit-PatchSet: 1 Gerrit-Project: phabricator/extensions/Sprint Gerrit-Branch: master Gerrit-Owner: Christopher Johnson (WMDE) christopher.john...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [FIX] Replace: Sharing exceptions and support XML - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/177984 Change subject: [FIX] Replace: Sharing exceptions and support XML .. [FIX] Replace: Sharing exceptions and support XML If multiple replacements share the same exceptions dictionary, they will be compiled by the first replacement and replace the original strings. The second replacement then tries to compile the already compiled exceptions which fails. To only compile each set of exceptions once, it now uses a list which is aware of the exceptions all entries share and only compiles them if they weren't compiled before. Also the XML generator assumed that the replacements where a list of tuples which changed with babc7cef9b7805b0bb8c2b5abab4b715e7fc1e7a so XML needs to be aware of that. Bug: T76940 Change-Id: Ifb8a66adb7d158c93a408bf1f558ea8e90b0a2b0 --- M scripts/replace.py 1 file changed, 117 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/84/177984/1 diff --git a/scripts/replace.py b/scripts/replace.py index 1dfef2c..9ea8015 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -162,20 +162,27 @@ The replacement instructions. -def __init__(self, old, new, use_regex=None, exceptions=None, - case_insensitive=None, edit_summary=None, - default_summary=True): +def __init__(self, old, new, edit_summary=None, default_summary=True): self.old = old self.old_regex = None self.new = new -self.use_regex = use_regex -self.exceptions = exceptions -self.case_insensitive = case_insensitive -self.edit_summary = edit_summary +self._edit_summary = edit_summary self.default_summary = default_summary +@property +def edit_summary(self): +return self._edit_summary + +def _compile(self, use_regex, flags): +# This does not update use_regex and flags depending on this instance +if not use_regex: +self.old_regex = re.escape(self.old) +else: +self.old_regex = self.old +self.old_regex = re.compile(self.old_regex, flags) + def compile(self, use_regex, flags): -# Set the regular aexpression flags +# Set the regular expression flags flags |= re.UNICODE if self.case_insensitive is False: @@ -185,12 +192,95 @@ if self.use_regex is not None: use_regex = self.use_regex # this replacement overrides it -if not use_regex: -self.old_regex = re.escape(self.old) -else: -self.old_regex = self.old -self.old_regex = re.compile(self.old_regex, flags) +self._compile(use_regex, flags) + + +class SingleReplacement(Replacement): + +A single replacement with it's own data. + +def __init__(self, old, new, use_regex=None, exceptions=None, + case_insensitive=None, edit_summary=None, + default_summary=True): +super(SingleReplacement, self).__init__(old, new, edit_summary, +default_summary) +self._use_regex = use_regex +self.exceptions = exceptions +self._case_insensitive = case_insensitive + +@property +def case_insensitive(self): +return self._case_insensitive + +@property +def use_regex(self): +return self._use_regex + +def _compile(self, use_regex, flags): +super(SingleReplacement, self)._compile(use_regex, flags) precompile_exceptions(self.exceptions, use_regex, flags) + + +class ReplacementSet(list): + + +A list of replacements which all share some properties. + +The shared properties are: +* use_regex +* exceptions +* case_insensitive + +Each entry in this list should be a SetReplacement. The exceptions are +compiled only once. + + +def __init__(self, use_regex, exceptions, case_insensitive, edit_summary): +super(ReplacementSet, self).__init__() +self.use_regex = use_regex +self._exceptions = exceptions +self.exceptions = None +self.case_insensitive = case_insensitive +self.edit_summary = edit_summary + +def _compile_exceptions(self, use_regex, flags): +if not self.exceptions: +self.exceptions = dict(self._exceptions) +precompile_exceptions(self.exceptions, use_regex, flags) + + +class SetReplacement(Replacement): + +A replacement entry for ReplacementSet. + +def __init__(self, old, new, fix_set, edit_summary=None, + default_summary=True): +super(SetReplacement, self).__init__(old, new, edit_summary, + default_summary) +self.fix_set = fix_set + +@property +def case_insensitive(self): +return self.fix_set.case_insensitive +
[MediaWiki-commits] [Gerrit] remove Points Reopened Before and Points Closed Before - change (phabricator...Sprint)
Christopher Johnson (WMDE) has submitted this change and it was merged. Change subject: remove Points Reopened Before and Points Closed Before .. remove Points Reopened Before and Points Closed Before History calcs for these values are wrong and unnecessary If a Task is Reopened, its points will be the same as when it was closed and any changes will still be picked up in the points change transaction. If a Task is closed before the Sprint start, its points should not be added to the points closed in the past and brought forward to the present, because points closed is only used to determine current points remaining. There is no value in knowing how many points were remaining in a Sprint that did not exist yet. Change-Id: I4ada671839518b8a60bd6dc1a861868045488c01 --- M src/storage/SprintTransaction.php M src/view/HistoryTableView.php 2 files changed, 4 insertions(+), 9 deletions(-) Approvals: Christopher Johnson (WMDE): Verified; Looks good to me, approved diff --git a/src/storage/SprintTransaction.php b/src/storage/SprintTransaction.php index 03c65af..433a6ad 100644 --- a/src/storage/SprintTransaction.php +++ b/src/storage/SprintTransaction.php @@ -40,13 +40,13 @@ break; case close: // A task was closed, mark it as done - // $this-CloseTasksBefore($before, $dates); - // $this-ClosePointsBefore($before, $points, $dates); + $this-CloseTasksBefore($before, $dates); + // $this-ClosePointsBefore($before, $points, $dates); break; case reopen: // A task was reopened, subtract from done -// $this-ReopenedTasksBefore($before, $dates); -// $this-ReopenedPointsBefore($before, $points, $dates); + $this-ReopenedTasksBefore($before, $dates); + // $this-ReopenedPointsBefore($before, $points, $dates); break; case points: // Points were changed diff --git a/src/view/HistoryTableView.php b/src/view/HistoryTableView.php index 3b2f3c4..db5e7c3 100644 --- a/src/view/HistoryTableView.php +++ b/src/view/HistoryTableView.php @@ -10,8 +10,6 @@ $before-getTasksReopenedBefore(), $before-getTasksClosedBefore(), $before-getPointsAddedBefore(), -$before-getPointsReopenedBefore(), -$before-getPointsClosedBefore(), $before-getPointsForwardfromBefore(), ); @@ -22,10 +20,7 @@ pht('Tasks Reopened'), pht('Tasks Closed'), pht('Points Added'), -pht('Points Reopened'), -pht('Points Closed'), pht('Points Forwarded'), - )); $box = id(new PHUIObjectBoxView()) -setHeaderText(pht('Before Sprint')) -- To view, visit https://gerrit.wikimedia.org/r/177983 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ada671839518b8a60bd6dc1a861868045488c01 Gerrit-PatchSet: 1 Gerrit-Project: phabricator/extensions/Sprint Gerrit-Branch: master Gerrit-Owner: Christopher Johnson (WMDE) christopher.john...@wikimedia.de Gerrit-Reviewer: Christopher Johnson (WMDE) christopher.john...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Skip tests that use a site which is failing - change (pywikibot/core)
John Vandenberg has uploaded a new change for review. https://gerrit.wikimedia.org/r/177985 Change subject: Skip tests that use a site which is failing .. Skip tests that use a site which is failing Add 'hostname' to TestCase.sites dict, and skip class when failed to receive a useful response for the hosts homepage. Re-enable weblib tests on travis-ci, instead using the new automatic skip functionality. Bug: T58963 Change-Id: I8fdcdaa0fab3b680d35b81b20a12ff5b786f779d --- M tests/aspects.py M tests/data_ingestion_tests.py M tests/http_tests.py M tests/weblib_tests.py M tests/wikidataquery_tests.py M tests/wikistats_tests.py 6 files changed, 139 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/85/177985/1 diff --git a/tests/aspects.py b/tests/aspects.py index 6466018..f375317 100644 --- a/tests/aspects.py +++ b/tests/aspects.py @@ -40,6 +40,7 @@ from pywikibot import config, log, Site from pywikibot.site import BaseSite from pywikibot.family import WikimediaFamily +from pywikibot.comms import threadedhttp from pywikibot.data.api import Request as _original_Request import tests @@ -382,6 +383,64 @@ super(CacheInfoMixin, self).tearDown() +class CheckHostnameMixin(TestCaseBase): + +Check the hostname is online before running tests. + +_checked_hostnames = {} + +@classmethod +def setUpClass(cls): + +Set up the test class. + +Prevent tests running if the host is down. + +super(CheckHostnameMixin, cls).setUpClass() + +if not hasattr(cls, 'sites'): +return + +for key, data in cls.sites.items(): +if 'hostname' not in data: +raise Exception('%s: hostname not defined for %s' +% (cls.__name__, key)) +hostname = data['hostname'] + +if hostname in cls._checked_hostnames: +if isinstance(cls._checked_hostnames[hostname], Exception): +raise unittest.SkipTest( +'%s: hostname %s failed (cached): %s' +% (cls.__name__, hostname, + cls._checked_hostnames[hostname])) +elif cls._checked_hostnames[hostname] is False: +raise unittest.SkipTest('%s: hostname %s failed (cached)' +% (cls.__name__, hostname)) +else: +continue + +protocol = 'http' +try: +r = threadedhttp.Http() +rv = r.request(uri=protocol + '://' + hostname) +if isinstance(rv, Exception): +cls._checked_hostnames[hostname] = rv +raise unittest.SkipTest( +'%s: hostname %s failed: %s' +% (cls.__name__, hostname, rv)) +except Exception as e: +cls._checked_hostnames[hostname] = e +raise unittest.SkipTest( +'%s: hostname %s failed: %s' +% (cls.__name__, hostname, e)) +if not rv[1] or not isinstance(rv[1], bytes): +# This is not an error, as the tests may use a webpage other +# than the root of the webserver, but it may be useful. +print('%s: hostname %s returned %s instead of unicode' + % (cls.__name__, hostname, type(rv[1]))) +cls._checked_hostnames[hostname] = True + + class SiteWriteMixin(TestCaseBase): @@ -591,6 +650,8 @@ if 'cached' in dct and dct['cached']: bases = tuple([ForceCacheMixin] + list(bases)) +bases = tuple([CheckHostnameMixin] + list(bases)) + if 'write' in dct and dct['write']: bases = tuple([SiteWriteMixin] + list(bases)) @@ -665,16 +726,19 @@ interface = DrySite for data in cls.sites.values(): -if 'site' not in data: +if 'site' not in data and 'code' in data and 'family' in data: data['site'] = Site(data['code'], data['family'], interface=interface) +if 'hostname' not in data and 'site' in data: +data['hostname'] = data['site'].hostname() if not hasattr(cls, 'cached') or not cls.cached: pywikibot._sites = orig_sites if len(cls.sites) == 1: key = next(iter(cls.sites.keys())) -cls.site = cls.sites[key]['site'] +if 'site' in cls.sites[key]: +cls.site = cls.sites[key]['site'] @classmethod def get_site(cls, name=None): @@ -830,19 +894,23 @@ super(WikibaseTestCase, cls).setUpClass() -for site in cls.sites.values(): -if not site['site'].has_data_repository: +
[MediaWiki-commits] [Gerrit] Workaround for a scrolling bug in IE8 on resize - change (mediawiki...WikiEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Workaround for a scrolling bug in IE8 on resize .. Workaround for a scrolling bug in IE8 on resize Bug: T63910 Change-Id: I6dacc1ed2f2fdf4ea615a477b711dc78667bae68 --- M modules/jquery.wikiEditor.js 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/jquery.wikiEditor.js b/modules/jquery.wikiEditor.js index e5d34aa..55a55a8 100644 --- a/modules/jquery.wikiEditor.js +++ b/modules/jquery.wikiEditor.js @@ -219,6 +219,9 @@ return $( this ); } +// Save browser profile for detailed tests. +var profile = $.client.profile(); + /* Initialization */ // The wikiEditor context is stored in the element's data, so when this function gets called again we can pick up right @@ -311,6 +314,11 @@ * Executes core event filters as well as event handlers provided by modules. */ trigger: function ( name, event ) { + // Workaround for a scrolling bug in IE8 (bug 61908) + if ( profile.name === 'msie' profile.versionNumber === 8 ) { + context.$textarea.css( 'width', context.$textarea.parent().width() ); + } + // Event is an optional argument, but from here on out, at least the type field should be dependable if ( typeof event === 'undefined' ) { event = { 'type': 'custom' }; @@ -467,8 +475,9 @@ /** * Workaround for a scrolling bug in IE8 (bug 61908) */ - if ( $.client.profile().name === 'msie' ) { + if ( profile.name === 'msie' profile.versionNumber === 8 ) { context.$textarea.css( 'height', context.$textarea.height() ); + context.$textarea.css( 'width', context.$textarea.parent().width() ); } /** -- To view, visit https://gerrit.wikimedia.org/r/115378 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6dacc1ed2f2fdf4ea615a477b711dc78667bae68 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Fomafix Gerrit-Reviewer: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added global command line arguments support - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Added global command line arguments support .. Added global command line arguments support Also added main() and removed global variable. Note: --family/-f is now the global arg -family T70664 Change-Id: I41bc6b8175f34867cfe50c6b890892045c32b4c4 --- M scripts/replicate_wiki.py 1 file changed, 32 insertions(+), 15 deletions(-) Approvals: John Vandenberg: Looks good to me, approved XZise: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py index f417541..7d4da0f 100644 --- a/scripts/replicate_wiki.py +++ b/scripts/replicate_wiki.py @@ -19,6 +19,21 @@ to replace all occurences of 'Hoofdpagina' with 'Veurblaad' when writing to liwiki. Note that this does not take the origin wiki into account. + +The following parameters are supported: +-ractually replace pages (without this option +--replace you will only get an overview page) + +-ooriginal wiki +--original + +destination_wiki destination wiki(s) + +-ns specify namespace +--namespace + +-dns destination namespace (if different) +--dest-namespace # # (C) Kasper Souren, 2012-2013 @@ -63,7 +78,7 @@ pywikibot.output(Syncing from + original_wiki) -family = options.family or config.family +family = config.family sites = options.destination_wiki @@ -80,7 +95,7 @@ self.differences = {} self.user_diff = {} -pywikibot.output('Syncing to', newline=False) +pywikibot.output('Syncing to ', newline=False) for s in self.sites: s.login() self.differences[s] = [] @@ -115,8 +130,8 @@ ] if self.options.namespace: -pywikibot.output(str(options.namespace)) -namespaces = [int(options.namespace)] +pywikibot.output(str(self.options.namespace)) +namespaces = [int(self.options.namespace)] pywikibot.output(Checking these namespaces: %s\n % (namespaces,)) for ns in namespaces: @@ -175,8 +190,8 @@ txt1 = page1.text for site in self.sites: -if options.dest_namespace: -prefix = namespaces(site)[int(options.dest_namespace)] +if self.options.dest_namespace: +prefix = namespaces(site)[int(self.options.dest_namespace)] if prefix: prefix += ':' new_pagename = prefix + page1.titleWithoutNamespace() @@ -212,28 +227,30 @@ sys.stdout.flush() -if __name__ == '__main__': +def main(*args): from argparse import ArgumentParser -parser = ArgumentParser() -parser.add_argument(-f, --family, dest=family, -help=wiki family) +my_args = pywikibot.handle_args(args) +parser = ArgumentParser(add_help=False) parser.add_argument(-r, --replace, action=store_true, -help=actually replace pages (without this option you will only get an overview page)) +help=actually replace pages (without this + option you will only get an overview page)) parser.add_argument(-o, --original, dest=original_wiki, help=original wiki) -parser.add_argument('destination_wiki', metavar='destination', type=str, nargs='+', -help='destination wiki(s)') +parser.add_argument('destination_wiki', metavar='destination', +type=str, nargs='+', help='destination wiki(s)') parser.add_argument(-ns, --namespace, dest=namespace, help=specify namespace) parser.add_argument(-dns, --dest-namespace, dest=dest_namespace, help=destination namespace (if different)) -(options, args) = parser.parse_known_args() +options = parser.parse_args(my_args) -# sync is global for convenient IPython debugging sync = SyncSites(options) sync.check_sysops() sync.check_namespaces() sync.generate_overviews() + +if __name__ == '__main__': +main() -- To view, visit https://gerrit.wikimedia.org/r/177216 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I41bc6b8175f34867cfe50c6b890892045c32b4c4 Gerrit-PatchSet: 10 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Murfel murna...@gmail.com Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: XZise commodorefabia...@gmx.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] [FIX] Replace: Sharing exceptions and support XML - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [FIX] Replace: Sharing exceptions and support XML .. [FIX] Replace: Sharing exceptions and support XML If multiple replacements share the same exceptions dictionary, they will be compiled by the first replacement and replace the original strings. The second replacement then tries to compile the already compiled exceptions which fails. To only compile each set of exceptions once, it now uses a list which is aware of the exceptions all entries share and only compiles them if they weren't compiled before. Also the XML generator assumed that the replacements where a list of tuples which changed with babc7cef9b7805b0bb8c2b5abab4b715e7fc1e7a so XML needs to be aware of that. Bug: T76940 Change-Id: Ifb8a66adb7d158c93a408bf1f558ea8e90b0a2b0 --- M scripts/replace.py 1 file changed, 116 insertions(+), 21 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/replace.py b/scripts/replace.py index 1dfef2c..c68b161 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -158,24 +158,31 @@ exceptions[exceptionCategory] = patterns -class Replacement(object): +class ReplacementBase(object): The replacement instructions. -def __init__(self, old, new, use_regex=None, exceptions=None, - case_insensitive=None, edit_summary=None, - default_summary=True): +def __init__(self, old, new, edit_summary=None, default_summary=True): self.old = old self.old_regex = None self.new = new -self.use_regex = use_regex -self.exceptions = exceptions -self.case_insensitive = case_insensitive -self.edit_summary = edit_summary +self._edit_summary = edit_summary self.default_summary = default_summary +@property +def edit_summary(self): +return self._edit_summary + +def _compile(self, use_regex, flags): +# This does not update use_regex and flags depending on this instance +if not use_regex: +self.old_regex = re.escape(self.old) +else: +self.old_regex = self.old +self.old_regex = re.compile(self.old_regex, flags) + def compile(self, use_regex, flags): -# Set the regular aexpression flags +# Set the regular expression flags flags |= re.UNICODE if self.case_insensitive is False: @@ -185,12 +192,95 @@ if self.use_regex is not None: use_regex = self.use_regex # this replacement overrides it -if not use_regex: -self.old_regex = re.escape(self.old) -else: -self.old_regex = self.old -self.old_regex = re.compile(self.old_regex, flags) +self._compile(use_regex, flags) + + +class Replacement(ReplacementBase): + +A single replacement with it's own data. + +def __init__(self, old, new, use_regex=None, exceptions=None, + case_insensitive=None, edit_summary=None, + default_summary=True): +super(Replacement, self).__init__(old, new, edit_summary, + default_summary) +self._use_regex = use_regex +self.exceptions = exceptions +self._case_insensitive = case_insensitive + +@property +def case_insensitive(self): +return self._case_insensitive + +@property +def use_regex(self): +return self._use_regex + +def _compile(self, use_regex, flags): +super(Replacement, self)._compile(use_regex, flags) precompile_exceptions(self.exceptions, use_regex, flags) + + +class ReplacementList(list): + + +A list of replacements which all share some properties. + +The shared properties are: +* use_regex +* exceptions +* case_insensitive + +Each entry in this list should be a ReplacementListEntry. The exceptions +are compiled only once. + + +def __init__(self, use_regex, exceptions, case_insensitive, edit_summary): +super(ReplacementList, self).__init__() +self.use_regex = use_regex +self._exceptions = exceptions +self.exceptions = None +self.case_insensitive = case_insensitive +self.edit_summary = edit_summary + +def _compile_exceptions(self, use_regex, flags): +if not self.exceptions and self._exceptions is not None: +self.exceptions = dict(self._exceptions) +precompile_exceptions(self.exceptions, use_regex, flags) + + +class ReplacementListEntry(ReplacementBase): + +A replacement entry for ReplacementList. + +def __init__(self, old, new, fix_set, edit_summary=None, + default_summary=True): +super(ReplacementListEntry, self).__init__(old, new, edit_summary, +
[MediaWiki-commits] [Gerrit] Cleanup getModifiedTime per If92ca3e7 in core - change (mediawiki...TwnMainPage)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/177987 Change subject: Cleanup getModifiedTime per If92ca3e7 in core .. Cleanup getModifiedTime per If92ca3e7 in core Change-Id: I7c037d60884cc2f9ab7a42b7adfb4743962c1d82 --- M ResourceLoaderProjectIconsModule.php 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwnMainPage refs/changes/87/177987/1 diff --git a/ResourceLoaderProjectIconsModule.php b/ResourceLoaderProjectIconsModule.php index a52c16f..6d34401 100644 --- a/ResourceLoaderProjectIconsModule.php +++ b/ResourceLoaderProjectIconsModule.php @@ -69,10 +69,6 @@ return array( 'all' = $out ); } - /** -* @param $context ResourceLoaderContext -* @return array|int|Mixed -*/ public function getModifiedTime( ResourceLoaderContext $context ) { $cache = wfGetCache( CACHE_ANYTHING ); $key = wfMemcKey( 'resourceloader', 'twnmainpage', 'icons' ); @@ -84,7 +80,7 @@ if ( is_array( $result ) $result['hash'] === $hash ) { return $result['timestamp']; } - $timestamp = wfTimestamp(); + $timestamp = time(); $cache-set( $key, array( 'hash' = $hash, 'timestamp' = $timestamp, -- To view, visit https://gerrit.wikimedia.org/r/177987 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c037d60884cc2f9ab7a42b7adfb4743962c1d82 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TwnMainPage Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix T72764 - [jquery.textSelection] Select sample text, if p... - change (mediawiki/core)
Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/177986 Change subject: Fix T72764 - [jquery.textSelection] Select sample text, if possible, when splitlines is true .. Fix T72764 - [jquery.textSelection] Select sample text, if possible, when splitlines is true Change-Id: Ic39b56f78d8e0bfeaa5ad5ff3d0e9e6e6a0e56fc --- M resources/src/jquery/jquery.textSelection.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/86/177986/1 diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index 632769b..bd6518d 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -243,7 +243,7 @@ selText = selText.replace( /\r?\n/g, '\r\n' ); post = post.replace( /\r?\n/g, '\r\n' ); } - if ( isSample options.selectPeri !options.splitlines ) { + if ( isSample options.selectPeri ( !options.splitlines || ( options.splitlines selText.indexOf( '\n' ) === -1 ) ) ) { this.selectionStart = startPos + pre.length; this.selectionEnd = startPos + pre.length + selText.length; } else { -- To view, visit https://gerrit.wikimedia.org/r/177986 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic39b56f78d8e0bfeaa5ad5ff3d0e9e6e6a0e56fc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Scimonster tehalmightyscimons...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Clean up MockClientStore - change (mediawiki...Wikibase)
Hoo man has submitted this change and it was merged. Change subject: Clean up MockClientStore .. Clean up MockClientStore I'm not sure why these objects need to be static. I tried to change this but some tests failed. Change-Id: I5313b4f774a6a99c8427a2ea4f783d09f0f39eb3 --- M client/tests/phpunit/MockClientStore.php 1 file changed, 102 insertions(+), 22 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/client/tests/phpunit/MockClientStore.php b/client/tests/phpunit/MockClientStore.php index 9b6d402..057e4c1 100644 --- a/client/tests/phpunit/MockClientStore.php +++ b/client/tests/phpunit/MockClientStore.php @@ -2,11 +2,19 @@ namespace Wikibase\Test; +use Wikibase\ChangesTable; +use Wikibase\Client\Store\EntityIdLookup; use Wikibase\Client\Usage\NullUsageTracker; use Wikibase\Client\Usage\SubscriptionManager; +use Wikibase\Client\Usage\UsageLookup; +use Wikibase\Client\Usage\UsageTracker; use Wikibase\ClientStore; +use Wikibase\Lib\Store\EntityLookup; +use Wikibase\Lib\Store\EntityRevisionLookup; use Wikibase\Lib\Store\SiteLinkLookup; use Wikibase\PropertyInfoStore; +use Wikibase\PropertyLabelResolver; +use Wikibase\TermIndex; /** * (Incomplete) ClientStore mock @@ -18,45 +26,115 @@ */ class MockClientStore implements ClientStore { + /** +* @var MockRepository|null +*/ + private static $mockRepository = null; + + /** +* @var MockPropertyInfoStore|null +*/ + private static $mockPropertyInfoStore = null; + + /** +* @see ClientStore::getUsageLookup +* +* @return UsageLookup +*/ public function getUsageLookup() { return new NullUsageTracker(); } + /** +* @see ClientStore::getUsageTracker +* +* @return UsageTracker +*/ public function getUsageTracker() { return new NullUsageTracker(); } + /** +* @see ClientStore::getSubscriptionManager +* +* @return SubscriptionManager +*/ public function getSubscriptionManager() { return new SubscriptionManager(); } - public function getPropertyLabelResolver() {} - public function getTermIndex() {} - public function getEntityIdLookup() {} - public function newChangesTable() {} - public function clear() {} - public function rebuild() {} - private function getMock() { - static $mockRepo = false; - if ( !$mockRepo ) { - $mockRepo = new MockRepository(); - } - - return $mockRepo; + /** +* @see ClientStore::getPropertyLabelResolver +* +* @return PropertyLabelResolver +*/ + public function getPropertyLabelResolver() { + // FIXME: Incomplete } - /* + /** +* @see ClientStore::getTermIndex +* +* @return TermIndex +*/ + public function getTermIndex() { + // FIXME: Incomplete + } + + /** +* @see ClientStore::getEntityIdLookup +* +* @return EntityIdLookup +*/ + public function getEntityIdLookup() { + // FIXME: Incomplete + } + + /** +* @see ClientStore::newChangesTable +* +* @return ChangesTable +*/ + public function newChangesTable() { + // FIXME: Incomplete + } + + /** +* @see ClientStore::clear +*/ + public function clear() { + } + + /** +* @see ClientStore::rebuild +*/ + public function rebuild() { + } + + private function getMockRepository() { + if ( self::$mockRepository === null ) { + self::$mockRepository = new MockRepository(); + } + + return self::$mockRepository; + } + + /** +* @see ClientStore::getEntityLookup +* * @return EntityLookup */ public function getEntityLookup() { - return $this-getMock(); + return $this-getMockRepository(); } - /* + /** +* @see ClientStore::getEntityRevisionLookup +* * @return EntityRevisionLookup */ public function getEntityRevisionLookup() { - return $this-getMock(); + return $this-getMockRepository(); } /** @@ -65,18 +143,20 @@ * @return SiteLinkLookup */ public function getSiteLinkLookup() { - return $this-getMock(); + return $this-getMockRepository(); } /** +* @see ClientStore::getPropertyInfoStore +* * @return PropertyInfoStore
[MediaWiki-commits] [Gerrit] adds default sort start date descending for Sprint projects ... - change (phabricator...Sprint)
Christopher Johnson (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/177988 Change subject: adds default sort start date descending for Sprint projects list .. adds default sort start date descending for Sprint projects list renames and moves classes Change-Id: I4ed4e13f21612e242bfd0bde6d590ab774c20c17 --- M src/__phutil_library_map__.php M src/application/SprintApplication.php R src/controller/SprintDataViewController.php R src/controller/SprintListController.php M src/controller/SprintProjectProfileController.php R src/controller/board/SprintBoardColumnDetailController.php R src/controller/board/SprintBoardColumnEditController.php R src/controller/board/SprintBoardColumnHideController.php R src/controller/board/SprintBoardController.php R src/controller/board/SprintBoardImportController.php R src/controller/board/SprintBoardMoveController.php R src/controller/board/SprintBoardReorderController.php R src/controller/board/SprintBoardTaskEditController.php R src/controller/board/SprintBoardViewController.php M src/storage/SprintBuildStats.php M src/tests/SprintApplicationTest.php M src/util/BurndownDataDate.php 17 files changed, 32 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/Sprint refs/changes/88/177988/1 diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index ec29c2c..e39343f 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -14,9 +14,7 @@ 'BurndownDataDate' = 'util/BurndownDataDate.php', 'BurndownDataDateTest' = 'tests/BurndownDataDateTest.php', 'BurndownDataView' = 'view/BurndownDataView.php', -'BurndownDataViewController' = 'controller/BurndownDataViewController.php', 'BurndownException' = 'exception/BurndownException.php', -'BurndownListController' = 'controller/BurndownListController.php', 'CeleritySprintResources' = 'celerity/CeleritySprintResources.php', 'DateIterator' = 'tests/DateIterator.php', 'EventTableView' = 'view/EventTableView.php', @@ -26,22 +24,24 @@ 'SprintApplication' = 'application/SprintApplication.php', 'SprintApplicationTest' = 'tests/SprintApplicationTest.php', 'SprintBeginDateField' = 'customfield/SprintBeginDateField.php', -'SprintBoardColumnDetailController' = 'controller/SprintBoardColumnDetailController.php', -'SprintBoardColumnEditController' = 'controller/SprintBoardColumnEditController.php', -'SprintBoardColumnHideController' = 'controller/SprintBoardColumnHideController.php', -'SprintBoardController' = 'controller/SprintBoardController.php', -'SprintBoardImportController' = 'controller/SprintBoardImportController.php', -'SprintBoardMoveController' = 'controller/SprintBoardMoveController.php', -'SprintBoardReorderController' = 'controller/SprintBoardReorderController.php', +'SprintBoardColumnDetailController' = 'controller/board/SprintBoardColumnDetailController.php', +'SprintBoardColumnEditController' = 'controller/board/SprintBoardColumnEditController.php', +'SprintBoardColumnHideController' = 'controller/board/SprintBoardColumnHideController.php', +'SprintBoardController' = 'controller/board/SprintBoardController.php', +'SprintBoardImportController' = 'controller/board/SprintBoardImportController.php', +'SprintBoardMoveController' = 'controller/board/SprintBoardMoveController.php', +'SprintBoardReorderController' = 'controller/board/SprintBoardReorderController.php', 'SprintBoardTaskCard' = 'view/SprintBoardTaskCard.php', -'SprintBoardTaskEditController' = 'controller/SprintBoardTaskEditController.php', -'SprintBoardViewController' = 'controller/SprintBoardViewController.php', +'SprintBoardTaskEditController' = 'controller/board/SprintBoardTaskEditController.php', +'SprintBoardViewController' = 'controller/board/SprintBoardViewController.php', 'SprintBuildStats' = 'storage/SprintBuildStats.php', 'SprintBuildStatsTest' = 'tests/SprintBuildStatsTest.php', 'SprintConstants' = 'constants/SprintConstants.php', 'SprintController' = 'controller/SprintController.php', 'SprintControllerTest' = 'tests/SprintControllerTest.php', +'SprintDataViewController' = 'controller/SprintDataViewController.php', 'SprintEndDateField' = 'customfield/SprintEndDateField.php', +'SprintListController' = 'controller/SprintListController.php', 'SprintProjectCustomField' = 'customfield/SprintProjectCustomField.php', 'SprintProjectProfileController' = 'controller/SprintProjectProfileController.php', 'SprintQuery' = 'query/SprintQuery.php', @@ -64,9 +64,7 @@ 'BurndownActionMenuEventListener' = 'PhabricatorEventListener', 'BurndownDataDateTest' = 'SprintTestCase', 'BurndownDataView' = 'SprintView', -'BurndownDataViewController' = 'SprintController',
[MediaWiki-commits] [Gerrit] adds default sort start date descending for Sprint projects ... - change (phabricator...Sprint)
Christopher Johnson (WMDE) has submitted this change and it was merged. Change subject: adds default sort start date descending for Sprint projects list .. adds default sort start date descending for Sprint projects list renames and moves classes Change-Id: I4ed4e13f21612e242bfd0bde6d590ab774c20c17 --- M src/__phutil_library_map__.php M src/application/SprintApplication.php R src/controller/SprintDataViewController.php R src/controller/SprintListController.php M src/controller/SprintProjectProfileController.php R src/controller/board/SprintBoardColumnDetailController.php R src/controller/board/SprintBoardColumnEditController.php R src/controller/board/SprintBoardColumnHideController.php R src/controller/board/SprintBoardController.php R src/controller/board/SprintBoardImportController.php R src/controller/board/SprintBoardMoveController.php R src/controller/board/SprintBoardReorderController.php R src/controller/board/SprintBoardTaskEditController.php R src/controller/board/SprintBoardViewController.php M src/storage/SprintBuildStats.php M src/tests/SprintApplicationTest.php M src/util/BurndownDataDate.php 17 files changed, 32 insertions(+), 32 deletions(-) Approvals: Christopher Johnson (WMDE): Verified; Looks good to me, approved diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index ec29c2c..e39343f 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -14,9 +14,7 @@ 'BurndownDataDate' = 'util/BurndownDataDate.php', 'BurndownDataDateTest' = 'tests/BurndownDataDateTest.php', 'BurndownDataView' = 'view/BurndownDataView.php', -'BurndownDataViewController' = 'controller/BurndownDataViewController.php', 'BurndownException' = 'exception/BurndownException.php', -'BurndownListController' = 'controller/BurndownListController.php', 'CeleritySprintResources' = 'celerity/CeleritySprintResources.php', 'DateIterator' = 'tests/DateIterator.php', 'EventTableView' = 'view/EventTableView.php', @@ -26,22 +24,24 @@ 'SprintApplication' = 'application/SprintApplication.php', 'SprintApplicationTest' = 'tests/SprintApplicationTest.php', 'SprintBeginDateField' = 'customfield/SprintBeginDateField.php', -'SprintBoardColumnDetailController' = 'controller/SprintBoardColumnDetailController.php', -'SprintBoardColumnEditController' = 'controller/SprintBoardColumnEditController.php', -'SprintBoardColumnHideController' = 'controller/SprintBoardColumnHideController.php', -'SprintBoardController' = 'controller/SprintBoardController.php', -'SprintBoardImportController' = 'controller/SprintBoardImportController.php', -'SprintBoardMoveController' = 'controller/SprintBoardMoveController.php', -'SprintBoardReorderController' = 'controller/SprintBoardReorderController.php', +'SprintBoardColumnDetailController' = 'controller/board/SprintBoardColumnDetailController.php', +'SprintBoardColumnEditController' = 'controller/board/SprintBoardColumnEditController.php', +'SprintBoardColumnHideController' = 'controller/board/SprintBoardColumnHideController.php', +'SprintBoardController' = 'controller/board/SprintBoardController.php', +'SprintBoardImportController' = 'controller/board/SprintBoardImportController.php', +'SprintBoardMoveController' = 'controller/board/SprintBoardMoveController.php', +'SprintBoardReorderController' = 'controller/board/SprintBoardReorderController.php', 'SprintBoardTaskCard' = 'view/SprintBoardTaskCard.php', -'SprintBoardTaskEditController' = 'controller/SprintBoardTaskEditController.php', -'SprintBoardViewController' = 'controller/SprintBoardViewController.php', +'SprintBoardTaskEditController' = 'controller/board/SprintBoardTaskEditController.php', +'SprintBoardViewController' = 'controller/board/SprintBoardViewController.php', 'SprintBuildStats' = 'storage/SprintBuildStats.php', 'SprintBuildStatsTest' = 'tests/SprintBuildStatsTest.php', 'SprintConstants' = 'constants/SprintConstants.php', 'SprintController' = 'controller/SprintController.php', 'SprintControllerTest' = 'tests/SprintControllerTest.php', +'SprintDataViewController' = 'controller/SprintDataViewController.php', 'SprintEndDateField' = 'customfield/SprintEndDateField.php', +'SprintListController' = 'controller/SprintListController.php', 'SprintProjectCustomField' = 'customfield/SprintProjectCustomField.php', 'SprintProjectProfileController' = 'controller/SprintProjectProfileController.php', 'SprintQuery' = 'query/SprintQuery.php', @@ -64,9 +64,7 @@ 'BurndownActionMenuEventListener' = 'PhabricatorEventListener', 'BurndownDataDateTest' = 'SprintTestCase', 'BurndownDataView' = 'SprintView', -'BurndownDataViewController' = 'SprintController', 'BurndownException' = 'Exception', -'BurndownListController' =
[MediaWiki-commits] [Gerrit] Re-enable weblib tests but allow WebCite to fail - change (pywikibot/core)
John Vandenberg has uploaded a new change for review. https://gerrit.wikimedia.org/r/177989 Change subject: Re-enable weblib tests but allow WebCite to fail .. Re-enable weblib tests but allow WebCite to fail weblib tests were disabled when both archive.org and WebCite were failing. archive.org has been working correctly for a while. WebCite is currently emitting invalid XML, with entries like: result status=failure_unsupportedfiletype/../result Change-Id: I795daf897ec5621d714742a0d353ece90ccfbbfa --- M pywikibot/weblib.py M tests/weblib_tests.py 2 files changed, 28 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/89/177989/1 diff --git a/pywikibot/weblib.py b/pywikibot/weblib.py index f682fec..6893839 100644 --- a/pywikibot/weblib.py +++ b/pywikibot/weblib.py @@ -8,10 +8,13 @@ __version__ = '$Id$' import sys + if sys.version_info[0] 2: from urllib.parse import urlencode else: from urllib import urlencode + +import pywikibot from pywikibot.comms import http @@ -22,10 +25,14 @@ See [[:mw:Archived Pages]] and https://archive.org/help/wayback_api.php for more details. +Returns None if there was a problem parsing the response from archive.org. + @param url: url to search an archived version for @param timestamp: requested archive date. The version closest to that moment is returned. Format: MMDDhhmmss or part thereof. - +@return: closest archive URL +@rtype: unicode or None +@raises: ServerError import json uri = u'https://archive.org/wayback/available?' @@ -38,8 +45,13 @@ uri = uri + urlencode(query) jsontext = http.request(uri=uri, site=None) if closest in jsontext: -data = json.loads(jsontext) -return data['archived_snapshots']['closest']['url'] +try: +data = json.loads(jsontext) +return data['archived_snapshots']['closest']['url'] +except Exception: +pywikibot.error(u'getInternetArchiveURL failed loading %s' % uri) +pywikibot.exception() +return None else: return None @@ -50,10 +62,14 @@ See http://www.webcitation.org/doc/WebCiteBestPracticesGuide.pdf for more details +Returns None if there was a problem parsing the response from WebCite. + @param url: url to search an archived version for @param timestamp: requested archive date. The version closest to that moment is returned. Format: MMDDhhmmss or part thereof. - +@return: archive URL +@rtype: unicode or None +@raises: ServerError import xml.etree.ElementTree as ET uri = u'http://www.webcitation.org/query?' @@ -67,7 +83,12 @@ uri = uri + urlencode(query) xmltext = http.request(uri=uri, site=None) if success in xmltext: -data = ET.fromstring(xmltext) -return data.find('.//webcite_url').text +try: +data = ET.fromstring(xmltext) +return data.find('.//webcite_url').text +except Exception: +pywikibot.error(u'getWebCitationURL failed loading %s' % uri) +pywikibot.exception() +return None else: return None diff --git a/tests/weblib_tests.py b/tests/weblib_tests.py index f4916e7..eef7287 100644 --- a/tests/weblib_tests.py +++ b/tests/weblib_tests.py @@ -24,12 +24,6 @@ net = True -@classmethod -def setUpClass(cls): -if os.environ.get('TRAVIS', 'false') == 'true': -raise unittest.SkipTest('Weblib tests are disabled on Travis-CI') -super(TestArchiveSites, cls).setUpClass() - def testInternetArchiveNewest(self): archivedversion = weblib.getInternetArchiveURL('https://google.com') parsed = urlparse(archivedversion) @@ -45,6 +39,7 @@ self.assertTrue(parsed.path.strip('/').endswith('www.google.com'), parsed.path) self.assertIn('200606', parsed.path) +@unittest.expectedFailure def testWebCiteOlder(self): archivedversion = weblib.getWebCitationURL('https://google.com', '20130101') self.assertEqual(archivedversion, 'http://www.webcitation.org/6DHSeh2L0') -- To view, visit https://gerrit.wikimedia.org/r/177989 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I795daf897ec5621d714742a0d353ece90ccfbbfa Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: John Vandenberg jay...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] jquery.textSelection: Select sample text, if possible, when ... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: jquery.textSelection: Select sample text, if possible, when splitlines is true .. jquery.textSelection: Select sample text, if possible, when splitlines is true Bug: T72764 Change-Id: Ic39b56f78d8e0bfeaa5ad5ff3d0e9e6e6a0e56fc --- M resources/src/jquery/jquery.textSelection.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index 632769b..bd6518d 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -243,7 +243,7 @@ selText = selText.replace( /\r?\n/g, '\r\n' ); post = post.replace( /\r?\n/g, '\r\n' ); } - if ( isSample options.selectPeri !options.splitlines ) { + if ( isSample options.selectPeri ( !options.splitlines || ( options.splitlines selText.indexOf( '\n' ) === -1 ) ) ) { this.selectionStart = startPos + pre.length; this.selectionEnd = startPos + pre.length + selText.length; } else { -- To view, visit https://gerrit.wikimedia.org/r/177986 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic39b56f78d8e0bfeaa5ad5ff3d0e9e6e6a0e56fc Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net Gerrit-Reviewer: Scimonster tehalmightyscimons...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Asynchronous HTTP requests - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Asynchronous HTTP requests .. Asynchronous HTTP requests HttpRequest object expanded to be a usable HTTP interface providing a 'promise' response, allowing both syncronmous and asyncronous requests with error reporting, infinite callbacks, and access to raw and decoded response data. Added HTTP request methods _enqueue and fetch, as simple utility methods for HttpRequest. Bug: T57889 Change-Id: I4f71b39d6402abefed5841d4ea67a7ac47cc46a2 --- M pywikibot/comms/http.py M pywikibot/comms/threadedhttp.py M tests/http_tests.py 3 files changed, 276 insertions(+), 47 deletions(-) Approvals: XZise: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 9e65821..7907165 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -209,48 +209,55 @@ @deprecate_arg('ssl', None) def request(site=None, uri=None, *args, **kwargs): -Queue a request to be submitted to Site. + +Request to Site with default error handling and response decoding. -All parameters not listed below are the same as -L{httplib2.Http.request}. +See L{httplib2.Http.request} for additional parameters. -If the site argument is provided, the uri is relative to the site's -scriptpath. +If the site argument is provided, the uri is a relative uri from +and including the document root '/'. -If the site argument is None, the uri must be absolute, and is -used for requests to non wiki pages. +If the site argument is None, the uri must be absolute. @param site: The Site to connect to @type site: L{pywikibot.site.BaseSite} @param uri: the URI to retrieve @type uri: str -@return: The received data (a unicode string). - +@return: The received data +@rtype: unicode assert(site or uri) -if site: -proto = site.protocol() -if proto == 'https': -host = site.ssl_hostname() -uri = site.ssl_pathprefix() + uri -else: -host = site.hostname() -baseuri = urlparse.urljoin(%s://%s % (proto, host), uri) +if not site: +# TODO: deprecate this usage, once the library code has been +# migrated to using the other request methods. +r = fetch(uri, *args, **kwargs) +return r.content -kwargs.setdefault(disable_ssl_certificate_validation, - site.ignore_certificate_error()) +proto = site.protocol() +if proto == 'https': +host = site.ssl_hostname() +uri = site.ssl_pathprefix() + uri else: -baseuri = uri -host = urlparse.urlparse(uri).netloc +host = site.hostname() +baseuri = urlparse.urljoin(%s://%s % (proto, host), uri) + +kwargs.setdefault(disable_ssl_certificate_validation, + site.ignore_certificate_error()) format_string = kwargs.setdefault(headers, {}).get(user-agent) kwargs[headers][user-agent] = user_agent(site, format_string) -request = threadedhttp.HttpRequest(baseuri, *args, **kwargs) -http_queue.put(request) -while not request.lock.acquire(False): -time.sleep(0.1) +r = fetch(baseuri, *args, **kwargs) +return r.content + +def error_handling_callback(request): + +Raise exceptions and log alerts. + +@param request: Request that has completed +@rtype request: L{threadedhttp.HttpRequest} + # TODO: do some error correcting stuff if isinstance(request.data, SSLHandshakeError): if SSL_CERT_VERIFY_FAILED_MSG in str(request.data): @@ -260,25 +267,86 @@ if isinstance(request.data, Exception): raise request.data -if request.data[0].status == 504: -raise Server504Error(Server %s timed out % host) +if request.status == 504: +raise Server504Error(Server %s timed out % request.hostname) -if request.data[0].status == 414: +if request.status == 414: raise Server414Error('Too long GET request') # HTTP status 207 is also a success status for Webdav FINDPROP, # used by the version module. -if request.data[0].status not in (200, 207): +if request.status not in (200, 207): pywikibot.warning(uHttp response status %(status)s % {'status': request.data[0].status}) -pos = request.data[0]['content-type'].find('charset=') -if pos = 0: -pos += len('charset=') -encoding = request.data[0]['content-type'][pos:] -else: -encoding = 'ascii' -# Don't warn, many pages don't contain one -pywikibot.log(uHttp response doesn't contain a charset.) -return request.data[1].decode(encoding) +def _enqueue(uri, method=GET, body=None, headers=None, **kwargs): + +Enqueue non-blocking threaded HTTP request with callback.
[MediaWiki-commits] [Gerrit] Clean up MockPropertyLabelResolver - change (mediawiki...Wikibase)
Hoo man has submitted this change and it was merged. Change subject: Clean up MockPropertyLabelResolver .. Clean up MockPropertyLabelResolver Change-Id: Ibad4935c6ebd4b726cf2d61bd2fc62e702d233a5 --- M lib/tests/phpunit/MockPropertyLabelResolver.php 1 file changed, 20 insertions(+), 14 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/tests/phpunit/MockPropertyLabelResolver.php b/lib/tests/phpunit/MockPropertyLabelResolver.php index 2a454fc..d9627cf 100644 --- a/lib/tests/phpunit/MockPropertyLabelResolver.php +++ b/lib/tests/phpunit/MockPropertyLabelResolver.php @@ -14,37 +14,43 @@ */ class MockPropertyLabelResolver implements PropertyLabelResolver { - protected $repo; - - protected $lang; + /** +* @var MockRepository +*/ + private $mockRepository; /** -* @param string $lang -* @param MockRepository $repo +* @var string */ - public function __construct( $lang, MockRepository $repo ) { - $this-lang = $lang; - $this-repo = $repo; + private $languageCode; + + /** +* @param string $languageCode +* @param MockRepository $mockRepository +*/ + public function __construct( $languageCode, MockRepository $mockRepository ) { + $this-languageCode = $languageCode; + $this-mockRepository = $mockRepository; } /** -* @param string[] $labels the labels +* @param string[] $labels * @param string $recache ignored * * @return EntityId[] a map of strings from $labels to the corresponding entity ID. */ public function getPropertyIdsForLabels( array $labels, $recache = '' ) { - $ids = array(); + $entityIds = array(); foreach ( $labels as $label ) { - $prop = $this-repo-getPropertyByLabel( $label, $this-lang ); + $entity = $this-mockRepository-getPropertyByLabel( $label, $this-languageCode ); - if ( $prop !== null ) { - $ids[$label] = $prop-getId(); + if ( $entity !== null ) { + $entityIds[$label] = $entity-getId(); } } - return $ids; + return $entityIds; } } -- To view, visit https://gerrit.wikimedia.org/r/177198 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibad4935c6ebd4b726cf2d61bd2fc62e702d233a5 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de Gerrit-Reviewer: Hoo man h...@online.de 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 ambiguous $repo to $wikibaseRepo - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Rename ambiguous $repo to $wikibaseRepo .. Rename ambiguous $repo to $wikibaseRepo This is split from I04767f2. Change-Id: Idc31b4b81fca351358f659f8f3f8fbaa2ebe61d5 --- M repo/includes/View/SiteLinksView.php M repo/includes/api/EditEntity.php M repo/includes/api/MergeItems.php M repo/includes/api/ModifyEntity.php M repo/includes/content/EntityContent.php M repo/includes/specials/SpecialEntityData.php M repo/includes/specials/SpecialMergeItems.php M repo/includes/specials/SpecialSetSiteLink.php 8 files changed, 41 insertions(+), 45 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/View/SiteLinksView.php b/repo/includes/View/SiteLinksView.php index cbc15d7..d158e46 100644 --- a/repo/includes/View/SiteLinksView.php +++ b/repo/includes/View/SiteLinksView.php @@ -63,9 +63,7 @@ $this-languageCode = $languageCode; // @todo inject option/objects instead of using the singleton - $repo = WikibaseRepo::getDefaultInstance(); - - $settings = $repo-getSettings(); + $settings = WikibaseRepo::getDefaultInstance()-getSettings(); $this-specialSiteLinkGroups = $settings-getSetting( 'specialSiteLinkGroups' ); $this-badgeItems = $settings-getSetting( 'badgeItems' ); } diff --git a/repo/includes/api/EditEntity.php b/repo/includes/api/EditEntity.php index 45b10ae..67e3904 100644 --- a/repo/includes/api/EditEntity.php +++ b/repo/includes/api/EditEntity.php @@ -84,8 +84,7 @@ $this-validLanguageCodes = array_flip( Utils::getLanguageCodes() ); - $repo = WikibaseRepo::getDefaultInstance(); - $changeOpFactoryProvider = $repo-getChangeOpFactoryProvider(); + $changeOpFactoryProvider = WikibaseRepo::getDefaultInstance()-getChangeOpFactoryProvider(); $this-termChangeOpFactory = $changeOpFactoryProvider-getFingerprintChangeOpFactory(); $this-claimChangeOpFactory = $changeOpFactoryProvider-getClaimChangeOpFactory(); $this-siteLinkChangeOpFactory = $changeOpFactoryProvider-getSiteLinkChangeOpFactory(); diff --git a/repo/includes/api/MergeItems.php b/repo/includes/api/MergeItems.php index 4c6484f..9d4dab6 100644 --- a/repo/includes/api/MergeItems.php +++ b/repo/includes/api/MergeItems.php @@ -53,18 +53,18 @@ public function __construct( ApiMain $mainModule, $moduleName, $modulePrefix = '' ) { parent::__construct( $mainModule, $moduleName, $modulePrefix ); - $repo = WikibaseRepo::getDefaultInstance(); + $wikibaseRepo = WikibaseRepo::getDefaultInstance(); $this-setServices( - $repo-getEntityIdParser(), - $repo-getApiHelperFactory()-getErrorReporter( $this ), - $repo-getApiHelperFactory()-getResultBuilder( $this ), + $wikibaseRepo-getEntityIdParser(), + $wikibaseRepo-getApiHelperFactory()-getErrorReporter( $this ), + $wikibaseRepo-getApiHelperFactory()-getResultBuilder( $this ), new ItemMergeInteractor( - $repo-getChangeOpFactoryProvider()-getMergeChangeOpFactory(), - $repo-getEntityRevisionLookup( 'uncached' ), - $repo-getEntityStore(), - $repo-getEntityPermissionChecker(), - $repo-getSummaryFormatter(), + $wikibaseRepo-getChangeOpFactoryProvider()-getMergeChangeOpFactory(), + $wikibaseRepo-getEntityRevisionLookup( 'uncached' ), + $wikibaseRepo-getEntityStore(), + $wikibaseRepo-getEntityPermissionChecker(), + $wikibaseRepo-getSummaryFormatter(), $this-getUser() ) ); diff --git a/repo/includes/api/ModifyEntity.php b/repo/includes/api/ModifyEntity.php index 8696afe..6ad1065 100644 --- a/repo/includes/api/ModifyEntity.php +++ b/repo/includes/api/ModifyEntity.php @@ -81,19 +81,20 @@ public function __construct( ApiMain $mainModule, $moduleName, $modulePrefix = '' ) { parent::__construct( $mainModule, $moduleName, $modulePrefix ); - $repo = WikibaseRepo::getDefaultInstance(); + $wikibaseRepo = WikibaseRepo::getDefaultInstance(); + $settings = $wikibaseRepo-getSettings(); //TODO: provide a mechanism to override the services - $this-stringNormalizer = $repo-getStringNormalizer(); + $this-stringNormalizer
[MediaWiki-commits] [Gerrit] [WIP] Convert API help to use i18n - change (mediawiki...Wikibase)
Sn1per has uploaded a new change for review. https://gerrit.wikimedia.org/r/177990 Change subject: [WIP] Convert API help to use i18n .. [WIP] Convert API help to use i18n - API help modified to use i18n messages - i18n messages edited to add said messages Bug: T74704 Change-Id: Ic15389a05531c635ffe59d2d2a9a851c899ced64 --- M repo/i18n/en.json M repo/i18n/qqq.json M repo/includes/api/AvailableBadges.php 3 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/90/177990/1 diff --git a/repo/i18n/en.json b/repo/i18n/en.json index adf8958..6234a73 100644 --- a/repo/i18n/en.json +++ b/repo/i18n/en.json @@ -419,5 +419,7 @@ right-property-term: Change property terms (labels, descriptions, aliases), right-property-create: Create properties, wikibase-entity-not-viewable-title: Content type mismatch: Can not display content, - wikibase-entity-not-viewable: The given content of type \$1\ is not an Entity and can not be displayed by Wikibase. + wikibase-entity-not-viewable: The given content of type \$1\ is not an Entity and can not be displayed by Wikibase., + apihelp-wbavailablebadges-description: API module to query available badge items., + apihelp-wbavailablebadges-example-1: Queries all available badge items } diff --git a/repo/i18n/qqq.json b/repo/i18n/qqq.json index 1b88650..b97e868 100644 --- a/repo/i18n/qqq.json +++ b/repo/i18n/qqq.json @@ -444,5 +444,7 @@ right-property-term: {{doc-right|property-term}}\nRight to alter the [[d:Wikidata:Glossary#Term|terms]] of [[d:Wikidata:Glossary#Item|items]]., right-property-create: {{doc-right|property-create}}\nRight to create new [[d:Wikidata:Glossary#Property|properties]]., wikibase-entity-not-viewable-title: Page title on the error page saying that content can't be displayed., - wikibase-entity-not-viewable: Error message saying that some content can't be rendered. $1 is the content model of the content that can't be displayed (eg. wikitext). + wikibase-entity-not-viewable: Error message saying that some content can't be rendered. $1 is the content model of the content that can't be displayed (eg. wikitext)., + apihelp-wbavailablebadges-description: {{doc-apihelp-description|wbavailablebadges}}, + apihelp-wbavailablebadges-example-1: {{doc-apihelp-example|wbavailablebadges}} } diff --git a/repo/includes/api/AvailableBadges.php b/repo/includes/api/AvailableBadges.php index 1437c5c..5e4e921 100644 --- a/repo/includes/api/AvailableBadges.php +++ b/repo/includes/api/AvailableBadges.php @@ -33,6 +33,7 @@ } /** +* @deprecated since MediaWiki core 1.25 * @see ApiBase::getDescription * * @since 0.5 @@ -46,6 +47,7 @@ } /** +* @deprecated since MediaWiki core 1.25 * @see ApiBase::getExamples * * @since 0.5 @@ -59,4 +61,15 @@ ); } + /** +* @see ApiBase:getExamplesMessages() +* +* @return array +*/ + protected function getExamplesMessages() { + return array( + 'action=wbavailablebadges' = + 'apihelp-wbavailablebadges-example-1', + ); + } } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/177990 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic15389a05531c635ffe59d2d2a9a851c899ced64 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Sn1per geof...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] build: Use String#slice instead of discouraged String#substr - change (unicodejs)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/177992 Change subject: build: Use String#slice instead of discouraged String#substr .. build: Use String#slice instead of discouraged String#substr Aside from the confusion and differences between substr() and substring() and IE8 bugs with substr(), substr() was removed from the spec as of ECMAScript 5. It's been standardised in the optional Annex B section of ES5. Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 --- M build/tasks/git-build.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/unicodejs refs/changes/92/177992/1 diff --git a/build/tasks/git-build.js b/build/tasks/git-build.js index 6053b5c..7d34e06 100644 --- a/build/tasks/git-build.js +++ b/build/tasks/git-build.js @@ -13,7 +13,7 @@ done( false ); return; } - grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.substr( 0, 10 ) + ')' ); + grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.slice( 0, 10 ) + ')' ); grunt.verbose.writeln( 'Added git HEAD to pgk.version' ); done(); } ); -- To view, visit https://gerrit.wikimedia.org/r/177992 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 Gerrit-PatchSet: 1 Gerrit-Project: unicodejs Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPROV] Reduce usage of unicode() - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/177993 Change subject: [IMPROV] Reduce usage of unicode() .. [IMPROV] Reduce usage of unicode() The unicode() builtin is not necessary if it's added unmodified via format or %-notation into a unicode string (e.g. u'{0}'.format(value)). Change-Id: I77017db516e6573ce463628167e9c4f2cf845aab --- M pywikibot/bot.py M pywikibot/pagegenerators.py M scripts/checkimages.py 3 files changed, 9 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/93/177993/1 diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 6e92dbf..99622dc 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -266,7 +266,7 @@ log(u'=== Pywikibot framework v2.0 -- Logging header ===') # script call -log(u'COMMAND: %s' % unicode(sys.argv)) +log(u'COMMAND: %s' % sys.argv) # script call time stamp log(u'DATE: %s UTC' % str(datetime.datetime.utcnow())) @@ -280,7 +280,7 @@ # system if hasattr(os, 'uname'): -log(u'SYSTEM: %s' % unicode(os.uname())) +log(u'SYSTEM: %s' % os.uname()) # config file dir log(u'CONFIG FILE DIR: %s' % pywikibot.config2.base_dir) @@ -319,7 +319,7 @@ log(u' %s' % ver) if config.log_pywiki_repo_version: -log(u'PYWIKI REPO VERSION: %s' % unicode(version.getversion_onlinerepo())) +log(u'PYWIKI REPO VERSION: %s' % version.getversion_onlinerepo()) log(u'=== ' * 14) @@ -1074,7 +1074,7 @@ if site not in self._sites: log(u'LOADING SITE %s VERSION: %s' -% (site, unicode(site.version( +% (site, site.version())) self._sites.add(site) if len(self._sites) == 2: diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index a4b5b43..00e0f11 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -40,7 +40,6 @@ if sys.version_info[0] 2: basestring = (str, ) -unicode = str _logger = pagegenerators @@ -1966,7 +1965,7 @@ pywikibot.output(u'retrieved %d items' % data[u'status'][u'items']) for item in data[u'items']: -page = pywikibot.ItemPage(repo, u'Q' + unicode(item)) +page = pywikibot.ItemPage(repo, u'Q{0}'.format(item)) try: link = page.getSitelink(site) except pywikibot.NoPage: diff --git a/scripts/checkimages.py b/scripts/checkimages.py index 1310359..65b1faa 100644 --- a/scripts/checkimages.py +++ b/scripts/checkimages.py @@ -572,14 +572,10 @@ def printWithTimeZone(message): Print the messages followed by the TimeZone encoded correctly. if message[-1] != ' ': -message = '%s ' % unicode(message) -if locale.getlocale()[1]: -time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), - time.gmtime()), -locale.getlocale()[1]) -else: -time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), - time.gmtime())) +message = u'%s ' % message +time_zone = time.strftime(u%d %b %Y %H:%M:%S (UTC), time.gmtime()) +if sys.version_info[0] == 2 and locale.getlocale()[1]: +time_zone = time_zone.decode(locale.getlocale()[1]) pywikibot.output(u%s%s % (message, time_zone)) -- To view, visit https://gerrit.wikimedia.org/r/177993 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77017db516e6573ce463628167e9c4f2cf845aab Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] build: Use String#slice instead of discouraged String#substr - change (oojs/ui)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/177994 Change subject: build: Use String#slice instead of discouraged String#substr .. build: Use String#slice instead of discouraged String#substr Aside from the confusion and differences between substr() and substring() and IE8 bugs with substr(), substr() was removed from the spec as of ECMAScript 5. It's been standardised in the optional Annex B section of ES5. Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 --- M Gruntfile.js M build/tasks/colorize-svg.js M demos/demo.js 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/94/177994/1 diff --git a/Gruntfile.js b/Gruntfile.js index 3a6f04e..1d3f257 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -328,7 +328,7 @@ done( false ); return; } - grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.substr( 0, 10 ) + ')' ); + grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.slice( 0, 10 ) + ')' ); grunt.verbose.writeln( 'Added git HEAD to pgk.version' ); done(); } ); diff --git a/build/tasks/colorize-svg.js b/build/tasks/colorize-svg.js index 46b61bf..0ac2f79 100644 --- a/build/tasks/colorize-svg.js +++ b/build/tasks/colorize-svg.js @@ -163,7 +163,7 @@ file = this.file, name = this.name, fileExtension = path.extname( file ), - fileExtensionBase = fileExtension.substr( 1 ), + fileExtensionBase = fileExtension.slice( 1 ), fileNameBase = path.basename( file, fileExtension ), filePath = path.join( this.list.getPath(), file ), variable = fileExtensionBase.toLowerCase() === 'svg', diff --git a/demos/demo.js b/demos/demo.js index 7349673..22b6e91 100644 --- a/demos/demo.js +++ b/demos/demo.js @@ -244,7 +244,7 @@ * @return {string[]} Factor values in URL order: page, theme, graphics, direction */ OO.ui.Demo.prototype.getCurrentFactorValues = function () { - return location.hash.substr( 1 ).split( '-' ); + return location.hash.slice( 1 ).split( '-' ); }; /** -- To view, visit https://gerrit.wikimedia.org/r/177994 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (mediawiki...Metrolook)
jenkins-bot has submitted this change and it was merged. Change subject: Localisation updates from https://translatewiki.net. .. Localisation updates from https://translatewiki.net. Change-Id: I40438bb9489e0cd1fd44f85f8f9d011eef7ba409 (cherry picked from commit 1ea4635ae01c566ec052df19fe5765b3885e66c6) --- A i18n/fa.json A i18n/ia.json A i18n/pt-br.json 3 files changed, 26 insertions(+), 0 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/fa.json b/i18n/fa.json new file mode 100644 index 000..13addfa --- /dev/null +++ b/i18n/fa.json @@ -0,0 +1,9 @@ +{ + @metadata: { + authors: [ + Reza1615 + ] + }, + metrolook-desc: پوسته مترلوک برای مدیاویکی, + metrolook-guest: مهمان +} diff --git a/i18n/ia.json b/i18n/ia.json new file mode 100644 index 000..f8388d5 --- /dev/null +++ b/i18n/ia.json @@ -0,0 +1,9 @@ +{ + @metadata: { + authors: [ + McDutchie + ] + }, + metrolook-desc: Apparentia Metrolook pro MediaWiki, + metrolook-guest: Hospite +} diff --git a/i18n/pt-br.json b/i18n/pt-br.json new file mode 100644 index 000..98fd812 --- /dev/null +++ b/i18n/pt-br.json @@ -0,0 +1,8 @@ +{ + @metadata: { + authors: [ + Mordecool + ] + }, + metrolook-guest: Hóspede +} -- To view, visit https://gerrit.wikimedia.org/r/177995 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I40438bb9489e0cd1fd44f85f8f9d011eef7ba409 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Metrolook Gerrit-Branch: REL1_23 Gerrit-Owner: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: L10n-bot l10n-...@translatewiki.net Gerrit-Reviewer: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (mediawiki...Metrolook)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/177995 Change subject: Localisation updates from https://translatewiki.net. .. Localisation updates from https://translatewiki.net. Change-Id: I40438bb9489e0cd1fd44f85f8f9d011eef7ba409 (cherry picked from commit 1ea4635ae01c566ec052df19fe5765b3885e66c6) --- A i18n/fa.json A i18n/ia.json A i18n/pt-br.json 3 files changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Metrolook refs/changes/95/177995/1 diff --git a/i18n/fa.json b/i18n/fa.json new file mode 100644 index 000..13addfa --- /dev/null +++ b/i18n/fa.json @@ -0,0 +1,9 @@ +{ + @metadata: { + authors: [ + Reza1615 + ] + }, + metrolook-desc: پوسته مترلوک برای مدیاویکی, + metrolook-guest: مهمان +} diff --git a/i18n/ia.json b/i18n/ia.json new file mode 100644 index 000..f8388d5 --- /dev/null +++ b/i18n/ia.json @@ -0,0 +1,9 @@ +{ + @metadata: { + authors: [ + McDutchie + ] + }, + metrolook-desc: Apparentia Metrolook pro MediaWiki, + metrolook-guest: Hospite +} diff --git a/i18n/pt-br.json b/i18n/pt-br.json new file mode 100644 index 000..98fd812 --- /dev/null +++ b/i18n/pt-br.json @@ -0,0 +1,8 @@ +{ + @metadata: { + authors: [ + Mordecool + ] + }, + metrolook-guest: Hóspede +} -- To view, visit https://gerrit.wikimedia.org/r/177995 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40438bb9489e0cd1fd44f85f8f9d011eef7ba409 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Metrolook Gerrit-Branch: REL1_23 Gerrit-Owner: Paladox thomasmulhall...@yahoo.com Gerrit-Reviewer: L10n-bot l10n-...@translatewiki.net ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] robots.php: Use max() time and clean up - change (operations/mediawiki-config)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/177996 Change subject: robots.php: Use max() time and clean up .. robots.php: Use max() time and clean up Change-Id: I67d30d69a760b484e195aa57039cb6ec381063a8 --- M w/robots.php 1 file changed, 12 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/96/177996/1 diff --git a/w/robots.php b/w/robots.php index acfa538..e8e5019 100644 --- a/w/robots.php +++ b/w/robots.php @@ -12,8 +12,10 @@ header( 'Vary: X-Subdomain' ); $robotsfile = '/srv/mediawiki/robots.txt'; +$robotsfilestats = fstat( $robots ); $robots = fopen( $robotsfile, 'rb' ); -$text = ''; +$mtime = $stats['mtime']; +$extratext = ''; $zeroRated = isset( $_SERVER['HTTP_X_SUBDOMAIN'] ) $_SERVER['HTTP_X_SUBDOMAIN'] === 'ZERO'; @@ -24,22 +26,17 @@ if ( $zeroRated ) { echo $dontIndex; } elseif ( $wgArticle-getID() != 0 ) { - $text = $wgArticle-getContent( false ); - - // Send the greater of the on disk file and on wiki content modification - // time. - $filemod = filemtime( $robotsfile ); - $wikimod = wfTimestamp( TS_UNIX, $wgArticle-getTouched() ); - $lastmod = gmdate( 'D, j M Y H:i:s', max( $filemod, $wikimod ) ) . ' GMT'; - header( Last-modified: $lastmod ); + $extratext = $wgArticle-getContent( false ) ; + // Take last modified timestamp of page into account + $mtime = max( $mtime, wfTimestamp( TS_UNIX, $wgArticle-getTouched() ) ); } elseif( $wmfRealm == 'labs' ) { echo $dontIndex; -} else { - $stats = fstat( $robots ); - - $lastmod = gmdate( 'D, j M Y H:i:s', $stats['mtime'] ) . ' GMT'; - header( Last-modified: $lastmod ); } + +$lastmod = gmdate( 'D, j M Y H:i:s', $stats['mtime'] ) . ' GMT'; +header( Last-modified: $lastmod ); + fpassthru( $robots ); -echo #\n#\n#--#\n#\n#\n#\n . $text; +echo #\n#\n#--#\n#\n#\n#\n; +echo $extratext; -- To view, visit https://gerrit.wikimedia.org/r/177996 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67d30d69a760b484e195aa57039cb6ec381063a8 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Element: Use $.context instead of recomputing in #getElement... - change (oojs/ui)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/177997 Change subject: Element: Use $.context instead of recomputing in #getElementDocument .. Element: Use $.context instead of recomputing in #getElementDocument In the constructor we already call getJQuery, which uses the same static.getElementDocument and stores it in wrapper.context. The constructor even uses this (this.$.context.createElement). Simplfy the non-static getElementDocument by simply returning that instead of recomputing it. Change-Id: I678cbe21ac3dec02498428e727a51ea42c4cb74b --- M src/Element.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/97/177997/1 diff --git a/src/Element.js b/src/Element.js index d0ce844..d92ce31 100644 --- a/src/Element.js +++ b/src/Element.js @@ -482,7 +482,7 @@ * @return {HTMLDocument} Document object */ OO.ui.Element.prototype.getElementDocument = function () { - return OO.ui.Element.static.getDocument( this.$element ); + return this.$.context; }; /** -- To view, visit https://gerrit.wikimedia.org/r/177997 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I678cbe21ac3dec02498428e727a51ea42c4cb74b Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] build: Use String#slice instead of discouraged String#substr - change (VisualEditor/VisualEditor)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/177998 Change subject: build: Use String#slice instead of discouraged String#substr .. build: Use String#slice instead of discouraged String#substr Follows-up 7004717af5. Aside from the confusion and differences between substr() and substring() and IE8 bugs with substr(), substr() was removed from the spec as of ECMAScript 5. It's been standardised in the optional Annex B section of ES5. Change-Id: I1f9f46f73ea0c79ec7e4c726a86bfe3ffa1924d3 --- M build/tasks/git-build.js M src/ui/widgets/ve.ui.LanguageResultWidget.js M tests/ce/ve.ce.TestRunner.js 3 files changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/98/177998/1 diff --git a/build/tasks/git-build.js b/build/tasks/git-build.js index 6053b5c..7d34e06 100644 --- a/build/tasks/git-build.js +++ b/build/tasks/git-build.js @@ -13,7 +13,7 @@ done( false ); return; } - grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.substr( 0, 10 ) + ')' ); + grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.slice( 0, 10 ) + ')' ); grunt.verbose.writeln( 'Added git HEAD to pgk.version' ); done(); } ); diff --git a/src/ui/widgets/ve.ui.LanguageResultWidget.js b/src/ui/widgets/ve.ui.LanguageResultWidget.js index 2ae6b60..254b1a9 100644 --- a/src/ui/widgets/ve.ui.LanguageResultWidget.js +++ b/src/ui/widgets/ve.ui.LanguageResultWidget.js @@ -75,7 +75,7 @@ document.createTextNode( text.slice( 0, offset ) ), this.$( 'span' ) .addClass( 've-ui-languageResultWidget-highlight' ) - .text( text.substr( offset, query.length ) ), + .text( text.slice( offset, offset + query.length ) ), document.createTextNode( text.slice( offset + query.length ) ) ); return $result.contents(); diff --git a/tests/ce/ve.ce.TestRunner.js b/tests/ce/ve.ce.TestRunner.js index 6706209..2ce05de 100644 --- a/tests/ce/ve.ce.TestRunner.js +++ b/tests/ce/ve.ce.TestRunner.js @@ -58,8 +58,8 @@ // test = n because one more boundaries than code units if ( node.textContent.length = n ) { offset = reversed ? node.textContent.length - n : n; - slice = node.textContent.substring( 0, offset ) + '|' + - node.textContent.substring( offset ); + slice = node.textContent.slice( 0, offset ) + '|' + + node.textContent.slice( offset ); return { node: node, offset: offset, slice: slice }; } else { return { consumed: node.textContent.length + 1 }; @@ -204,7 +204,8 @@ // FIXME: renaming startNode to startContainer revealed failing tests if ( false nativeRange nativeRange.startContainer text.indexOf( nativeRange.startContainer.textContent ) === 0 ) { // We're just appending - extra = nativeRange.startContainer.textContent.substring( nativeRange.startContainer.textContent.length ); + // FIXME: str.slice( tr.length ) always produces an empty string... + extra = nativeRange.startContainer.textContent.slice( nativeRange.startContainer.textContent.length ); // This is fine IF startContainer is a TextNode nativeRange.startContainer.textContent += extra; } else { -- To view, visit https://gerrit.wikimedia.org/r/177998 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f9f46f73ea0c79ec7e4c726a86bfe3ffa1924d3 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] special.js: Use then() instead of manually wrapping Deferred - change (mediawiki...UrlShortener)
jenkins-bot has submitted this change and it was merged. Change subject: special.js: Use then() instead of manually wrapping Deferred .. special.js: Use then() instead of manually wrapping Deferred * No need for the 'new' operator in $.Deferred. It's not an instantiable constructor with prototype but an object factory. Unnecessary overhead and didn't match code used elsewhere. * Simplifies data processing to receiving data and returning the transformed value. No need to invoke a shared interface like d.resolve or d.reject. Follows-up 76b57a8, 6ff803c. Change-Id: Ie1887c9d8b31c19fef24acbc1cc4be1194930217 --- M js/ext.urlShortener.special.js 1 file changed, 9 insertions(+), 13 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/js/ext.urlShortener.special.js b/js/ext.urlShortener.special.js index 1c70b05..f1e53fd 100644 --- a/js/ext.urlShortener.special.js +++ b/js/ext.urlShortener.special.js @@ -65,22 +65,18 @@ * fails with an error object on failure */ UrlShortener.prototype.shortenUrl = function ( url ) { - var d = new $.Deferred(), - validate = this.validateInput( url ); - if ( validate === true ) { - this.api.get( { + var validate = this.validateInput( url ); + if ( validate !== true ) { + return $.Deferred().reject( validate ).promise(); + } + return this.api.get( { action: 'shortenurl', url: url - } ).done( function ( data ) { - d.resolve( data.shortenurl.shorturl ); - } ).fail( function ( errCode, data ) { - d.reject( data.error ); + } ).then( function ( data ) { + return data.shortenurl.shorturl; + }, function ( errCode, data ) { + return data.error; } ); - - } else { - d.reject( validate ); - } - return d.promise(); }; /** -- To view, visit https://gerrit.wikimedia.org/r/145552 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1887c9d8b31c19fef24acbc1cc4be1194930217 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/UrlShortener Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Prtksxna psax...@wikimedia.org Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace deprecated constructor and minor cleanup - change (search/highlighter)
BearND has uploaded a new change for review. https://gerrit.wikimedia.org/r/177999 Change subject: Replace deprecated constructor and minor cleanup .. Replace deprecated constructor and minor cleanup The deprecated constructor was in AbstractDocsAndPositionsHitEnumTestBase.englishStemmingAnalyzer(). The rest was some minor cleanup. I've avoided the X... classes since those a copies from upstream. Change-Id: I07f2d3efc03a564c944241a14dcea72f708bf614 --- M experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/HitEnum.java M experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/snippet/BasicScoreBasedSnippetChooser.java M experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/AbstractMultiSourceExtracter.java M experimental-highlighter-elasticsearch-plugin/src/main/java/org/elasticsearch/search/highlight/ExperimentalHighlighter.java M experimental-highlighter-elasticsearch-plugin/src/main/java/org/elasticsearch/search/highlight/FieldWrapper.java M experimental-highlighter-lucene/src/main/java/org/wikimedia/highlighter/experimental/lucene/hit/AutomatonHitEnum.java M experimental-highlighter-lucene/src/test/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java M experimental-highlighter-lucene/src/test/java/org/apache/lucene/util/automaton/TestDeterminizeLexicon.java M experimental-highlighter-lucene/src/test/java/org/wikimedia/highlighter/experimental/lucene/hit/AbstractDocsAndPositionsHitEnumTestBase.java 9 files changed, 43 insertions(+), 44 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/search/highlighter refs/changes/99/177999/1 diff --git a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/HitEnum.java b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/HitEnum.java index 0774458..d01a766 100644 --- a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/HitEnum.java +++ b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/HitEnum.java @@ -7,7 +7,7 @@ public interface HitEnum extends Segment { /** * Move the enum to the next hit. - * + * * @return is there a next hit (true) or was the last one the final hit * (false) */ @@ -47,7 +47,7 @@ * of precision is worth the comparison efficiency. */ int source(); - + public static enum LessThans implements LessThanHitEnum { /** * Sorts ascending by position. @@ -66,6 +66,6 @@ } return lhs.endOffset() rhs.endOffset(); } -}; +} } } diff --git a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/snippet/BasicScoreBasedSnippetChooser.java b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/snippet/BasicScoreBasedSnippetChooser.java index dbe2dbc..8f6d42d 100644 --- a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/snippet/BasicScoreBasedSnippetChooser.java +++ b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/snippet/BasicScoreBasedSnippetChooser.java @@ -143,7 +143,7 @@ } return 0; } -}; +} } private class ProtoSnippetQueue extends PriorityQueueProtoSnippet { diff --git a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/AbstractMultiSourceExtracter.java b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/AbstractMultiSourceExtracter.java index e699883..4791da4 100644 --- a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/AbstractMultiSourceExtracter.java +++ b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/AbstractMultiSourceExtracter.java @@ -12,16 +12,16 @@ abstract class AbstractMultiSourceExtracterT implements SourceExtracterT { interface BuilderT, S extends BuilderT, S { /** - * Add a segmenter. + * Add an extracter. * - * @param segmenter the segmenter to delegate to - * @param length the length of the source underlying the segmenter + * @param extracter the extracter to delegate to + * @param length the length of the source underlying the extracter * @return this for chaining */ S add(SourceExtracterT extracter, int length); /** - * Build the segmenter. + * Build the extracter. */ SourceExtracterT build(); } @@ -37,7 +37,7 @@ /** *
[MediaWiki-commits] [Gerrit] Package.json: Add contributors field - change (mediawiki...citoid)
Mvolz has submitted this change and it was merged. Change subject: Package.json: Add contributors field .. Package.json: Add contributors field Add contributors field to package.json as well as four contributors. Change-Id: Id53d41f7f6eda4a98f028e72da2225df6ee94bde --- M package.json 1 file changed, 18 insertions(+), 1 deletion(-) Approvals: Mvolz: Verified; Looks good to me, approved Danmichaelo: Looks good to me, but someone else must approve diff --git a/package.json b/package.json index f427361..dfdd7e9 100644 --- a/package.json +++ b/package.json @@ -18,5 +18,22 @@ repository: { type: git, url: https://gerrit.wikimedia.org/r/mediawiki/services/citoid; - } + }, + contributors: [ + { + name: Marielle Volz, + email: marielle.v...@gmail.com + }, + { + name: Danny Wu, + email: utf8snow...@gmail.com + }, + { + name: Geoffrey Mon, + email: geof...@gmail.com + }, + { + name: Dan Michael O. Heggø, + email: danmicha...@gmail.com + }] } -- To view, visit https://gerrit.wikimedia.org/r/177516 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id53d41f7f6eda4a98f028e72da2225df6ee94bde Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/services/citoid Gerrit-Branch: master Gerrit-Owner: Mvolz mv...@wikimedia.org Gerrit-Reviewer: Danmichaelo danmicha...@gmail.com Gerrit-Reviewer: Mvolz mv...@wikimedia.org Gerrit-Reviewer: Sn1per geof...@gmail.com Gerrit-Reviewer: Unicodesnowman ad...@glados.cc Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use String#slice instead of discouraged String#substr - change (mediawiki...VisualEditor)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/178000 Change subject: Use String#slice instead of discouraged String#substr .. Use String#slice instead of discouraged String#substr Aside from the confusion and differences between substr() and substring() and IE8 bugs with substr(), substr() was removed from the spec as of ECMAScript 5. It's been standardised in the optional Annex B section of ES5. Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 --- M modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js M modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js M modules/ve-mw/init/ve.init.mw.trackSubscriber.js M modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js M modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js M modules/ve-mw/ui/widgets/ve.ui.MWReferenceGroupInputWidget.js M modules/ve-mw/ui/widgets/ve.ui.MWTitleInputWidget.js 7 files changed, 12 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/00/178000/1 diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js index b811a08..bb8413e 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js @@ -160,7 +160,7 @@ dataElement.attributes.listKey, // Generate a name starting with ':' to distinguish it from normal names 'literal/:' - ).substr( 'literal/'.length ); + ).slice( 'literal/'.length ); } else { name = undefined; } diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js index fd9e48f..c7470f4 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js @@ -166,8 +166,8 @@ output += input; break; } - output += input.substr( 0, match.index ); - input = input.substr( match.index + match[0].length ); + output += input.slice( 0, match.index ); + input = input.slice( match.index + match[0].length ); if ( inNowiki ) { if ( match[0] === '/nowiki' ) { inNowiki = false; diff --git a/modules/ve-mw/init/ve.init.mw.trackSubscriber.js b/modules/ve-mw/init/ve.init.mw.trackSubscriber.js index c53d100..0906a7d 100644 --- a/modules/ve-mw/init/ve.init.mw.trackSubscriber.js +++ b/modules/ve-mw/init/ve.init.mw.trackSubscriber.js @@ -53,11 +53,14 @@ ve.trackSubscribeAll( function ( topic, data ) { data = data || {}; - var newData, action, now = Math.floor( ve.now() ), prefix = topic.substr( 0, topic.indexOf( '.' ) ); + var newData, action, + now = Math.floor( ve.now() ), + prefix = topic.slice( 0, topic.indexOf( '.' ) ); + if ( prefix === 'mwtiming' ) { // Legacy TimingData events // Map timing.foo -- ve.foo - topic = 've.' + topic.substr( prefix.length + 1 ); + topic = 've.' + topic.slice( prefix.length + 1 ); } else if ( prefix === 'mwedit' ) { // Edit schema action = topic.split( '.' )[1]; diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index 85d2c57..4993714 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -605,7 +605,7 @@ if ( namespacesWithSubpages[ namespace ] ) { // If we are in a namespace that allows for subpages, strip the entire // title except for the part after the last / - pageTitle = pageTitle.substr( pageTitle.lastIndexOf( '/' ) + 1 ); + pageTitle = pageTitle.slice( pageTitle.lastIndexOf( '/' ) + 1 ); } this.pageTitle = pageTitle; diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js index d9d7a97..364ce62 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js @@ -248,7 +248,7 @@ } if ( this.forceCapitalization ) { - value = value.substr( 0, 1 ).toUpperCase() + value.substr( 1 ); + value = value.slice( 0, 1 ).toUpperCase() + value.slice( 1 ); } return { diff --git
[MediaWiki-commits] [Gerrit] Restrict Verified+1/2 and Submit to JenkinsBot and l10n-bot - change (mediawiki...citoid)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/178001 Change subject: Restrict Verified+1/2 and Submit to JenkinsBot and l10n-bot .. Restrict Verified+1/2 and Submit to JenkinsBot and l10n-bot Change-Id: If0ea510f5126868d108dec73f94d7fc67f563eed --- M groups M project.config 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid refs/changes/01/178001/1 diff --git a/groups b/groups index af90bc9..c824b70 100644 --- a/groups +++ b/groups @@ -1,3 +1,6 @@ # UUID Group Name # +global:Registered-UsersRegistered Users bde5b014ff1e1f8e97271d2b0afc637882100dd6 mediawiki-services-citoid +2bc47fcadf4e44ec9a1a73bcfa06232554f47ce2 JenkinsBot +cc37d98e3a4301744a0c0a9249173ae170696072 l10n-bot diff --git a/project.config b/project.config index a81cb9b..af2f974 100644 --- a/project.config +++ b/project.config @@ -6,3 +6,10 @@ mergeContent = true [access refs/*] owner = group mediawiki-services-citoid +[access refs/heads/master] + label-Verified = -1..+2 group JenkinsBot + label-Verified = -1..+2 group l10n-bot + label-Verified = -1..+0 group Registered Users + submit = deny group Registered Users + submit = group JenkinsBot + submit = group l10n-bot -- To view, visit https://gerrit.wikimedia.org/r/178001 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0ea510f5126868d108dec73f94d7fc67f563eed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/citoid Gerrit-Branch: refs/meta/config Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Restrict Verified+1/2 and Submit to JenkinsBot and l10n-bot - change (mediawiki...citoid)
Krinkle has submitted this change and it was merged. Change subject: Restrict Verified+1/2 and Submit to JenkinsBot and l10n-bot .. Restrict Verified+1/2 and Submit to JenkinsBot and l10n-bot Change-Id: If0ea510f5126868d108dec73f94d7fc67f563eed --- M groups M project.config 2 files changed, 10 insertions(+), 0 deletions(-) Approvals: Krinkle: Verified; Looks good to me, approved diff --git a/groups b/groups index af90bc9..c824b70 100644 --- a/groups +++ b/groups @@ -1,3 +1,6 @@ # UUID Group Name # +global:Registered-UsersRegistered Users bde5b014ff1e1f8e97271d2b0afc637882100dd6 mediawiki-services-citoid +2bc47fcadf4e44ec9a1a73bcfa06232554f47ce2 JenkinsBot +cc37d98e3a4301744a0c0a9249173ae170696072 l10n-bot diff --git a/project.config b/project.config index a81cb9b..af2f974 100644 --- a/project.config +++ b/project.config @@ -6,3 +6,10 @@ mergeContent = true [access refs/*] owner = group mediawiki-services-citoid +[access refs/heads/master] + label-Verified = -1..+2 group JenkinsBot + label-Verified = -1..+2 group l10n-bot + label-Verified = -1..+0 group Registered Users + submit = deny group Registered Users + submit = group JenkinsBot + submit = group l10n-bot -- To view, visit https://gerrit.wikimedia.org/r/178001 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0ea510f5126868d108dec73f94d7fc67f563eed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/citoid Gerrit-Branch: refs/meta/config Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use hasOwnProperty for module names - change (mediawiki/core)
Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/178002 Change subject: Use hasOwnProperty for module names .. Use hasOwnProperty for module names This avoids conflicts with predefined object properties. Change-Id: I1b1c2db355f0c698be4a5fe797daa55dedc25258 --- M resources/src/mediawiki/mediawiki.js 1 file changed, 15 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/02/178002/1 diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 06d0f47..d1352d6 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -840,7 +840,7 @@ function sortDependencies( module, resolved, unresolved ) { var n, deps, len, skip; - if ( registry[module] === undefined ) { + if ( !hasOwn.call( registry, module ) ) { throw new Error( 'Unknown dependency: ' + module ); } @@ -954,7 +954,7 @@ // Build a list of modules which are in one of the specified states for ( s = 0; s states.length; s += 1 ) { for ( m = 0; m modules.length; m += 1 ) { - if ( registry[modules[m]] === undefined ) { + if ( !hasOwn.call( registry, modules[m] ) ) { // Module does not exist if ( states[s] === 'unregistered' ) { // OK, undefined @@ -1098,7 +1098,7 @@ var key, value, media, i, urls, cssHandle, checkCssHandles, cssHandlesRegistered = false; - if ( registry[module] === undefined ) { + if ( !hasOwn.call( registry, module ) ) { throw new Error( 'Module has not been registered yet: ' + module ); } else if ( registry[module].state === 'registered' ) { throw new Error( 'Module has not been requested from the server yet: ' + module ); @@ -1406,7 +1406,7 @@ // Appends a list of modules from the queue to the batch for ( q = 0; q queue.length; q += 1 ) { // Only request modules which are registered - if ( registry[queue[q]] !== undefined registry[queue[q]].state === 'registered' ) { + if ( hasOwn.call( registry, queue[q] ) registry[queue[q]].state === 'registered' ) { // Prevent duplicate entries if ( $.inArray( queue[q], batch ) === -1 ) { batch[batch.length] = queue[q]; @@ -1469,10 +1469,10 @@ for ( b = 0; b batch.length; b += 1 ) { bSource = registry[batch[b]].source; bGroup = registry[batch[b]].group; - if ( splits[bSource] === undefined ) { + if ( !hasOwn.call( splits, bSource ) ) { splits[bSource] = {}; } - if ( splits[bSource][bGroup] === undefined ) { + if ( !hasOwn.call( splits[bSource], bGroup ) ) { splits[bSource][bGroup] = []; } bSourceGroup = splits[bSource][bGroup]; @@ -1525,7 +1525,7 @@ prefix = modules[i].substr( 0, lastDotIndex ); suffix = modules[i].slice( lastDotIndex + 1 ); - bytesAdded = moduleMap[prefix] !== undefined + bytesAdded = hasOwn.call( moduleMap, prefix ) ? suffix.length + 3 //
[MediaWiki-commits] [Gerrit] [IMPROV] Reduce usage of unicode() - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [IMPROV] Reduce usage of unicode() .. [IMPROV] Reduce usage of unicode() The unicode() builtin is not necessary if it's added unmodified via format or %-notation into a unicode string (e.g. u'{0}'.format(value)). In addition, the localized time formatting was removed. The default 'C' locale (which is ASCII by definition) is now used instead. Change-Id: I77017db516e6573ce463628167e9c4f2cf845aab --- M pywikibot/bot.py M pywikibot/pagegenerators.py M scripts/checkimages.py 3 files changed, 7 insertions(+), 17 deletions(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 6e92dbf..99622dc 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -266,7 +266,7 @@ log(u'=== Pywikibot framework v2.0 -- Logging header ===') # script call -log(u'COMMAND: %s' % unicode(sys.argv)) +log(u'COMMAND: %s' % sys.argv) # script call time stamp log(u'DATE: %s UTC' % str(datetime.datetime.utcnow())) @@ -280,7 +280,7 @@ # system if hasattr(os, 'uname'): -log(u'SYSTEM: %s' % unicode(os.uname())) +log(u'SYSTEM: %s' % os.uname()) # config file dir log(u'CONFIG FILE DIR: %s' % pywikibot.config2.base_dir) @@ -319,7 +319,7 @@ log(u' %s' % ver) if config.log_pywiki_repo_version: -log(u'PYWIKI REPO VERSION: %s' % unicode(version.getversion_onlinerepo())) +log(u'PYWIKI REPO VERSION: %s' % version.getversion_onlinerepo()) log(u'=== ' * 14) @@ -1074,7 +1074,7 @@ if site not in self._sites: log(u'LOADING SITE %s VERSION: %s' -% (site, unicode(site.version( +% (site, site.version())) self._sites.add(site) if len(self._sites) == 2: diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index a4b5b43..00e0f11 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -40,7 +40,6 @@ if sys.version_info[0] 2: basestring = (str, ) -unicode = str _logger = pagegenerators @@ -1966,7 +1965,7 @@ pywikibot.output(u'retrieved %d items' % data[u'status'][u'items']) for item in data[u'items']: -page = pywikibot.ItemPage(repo, u'Q' + unicode(item)) +page = pywikibot.ItemPage(repo, u'Q{0}'.format(item)) try: link = page.getSitelink(site) except pywikibot.NoPage: diff --git a/scripts/checkimages.py b/scripts/checkimages.py index 1310359..66b1aee 100644 --- a/scripts/checkimages.py +++ b/scripts/checkimages.py @@ -92,7 +92,6 @@ import re import time import datetime -import locale import sys import pywikibot @@ -102,8 +101,6 @@ if sys.version_info[0] 2: basestring = (str, ) - -locale.setlocale(locale.LC_ALL, '') ### # --- Change only below! ---# @@ -572,14 +569,8 @@ def printWithTimeZone(message): Print the messages followed by the TimeZone encoded correctly. if message[-1] != ' ': -message = '%s ' % unicode(message) -if locale.getlocale()[1]: -time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), - time.gmtime()), -locale.getlocale()[1]) -else: -time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), - time.gmtime())) +message = u'%s ' % message +time_zone = time.strftime(u%d %b %Y %H:%M:%S (UTC), time.gmtime()) pywikibot.output(u%s%s % (message, time_zone)) -- To view, visit https://gerrit.wikimedia.org/r/177993 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77017db516e6573ce463628167e9c4f2cf845aab Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: XZise commodorefabia...@gmx.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Checp fix to handle multipart audit files - change (wikimedia...tools)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/178003 Change subject: Checp fix to handle multipart audit files .. Checp fix to handle multipart audit files The big catch is that the second file does not include column headers. Change-Id: Ib4963bc63226a8b1303010b2730dd32d5361e1b6 --- M audit/paypal/SarFile.py M audit/paypal/TrrFile.py M audit/paypal/ppreport.py 3 files changed, 103 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/03/178003/1 diff --git a/audit/paypal/SarFile.py b/audit/paypal/SarFile.py index bb3ab79..f5f77ef 100644 --- a/audit/paypal/SarFile.py +++ b/audit/paypal/SarFile.py @@ -12,6 +12,33 @@ class SarFile(object): VERSION=2 stomp = None +column_headers = [ +Column Type, +Subscription ID, +Subscription Action Type, +Subscription Currency, +Subscription Creation Date, +Subscription Period 1, +Period 1 Amount, +Subscription Period 2, +Period 2 Amount, +Subscription Period 3, +Period 3 Amount, +Recurring, +Recurrence number, +Subscription Payer PayPal Account ID, +Subscription Payer email address, +Subscription Payer Name, +Subscription Payer Business Name, +Shipping Address Line1, +Shipping Address City, +Shipping Address State, +Shipping Address Zip, +Shipping Address Country, +Subscription Description, +Subscription Memo, +Subscription Custom Field, +] @staticmethod def handle(path): @@ -23,7 +50,7 @@ self.crm = Civicrm(config.civicrm_db) def parse(self): -ppreport.read(self.path, self.VERSION, self.parse_line) +ppreport.read(self.path, self.VERSION, self.parse_line, self.column_headers) def parse_line(self, row): required_fields = [ diff --git a/audit/paypal/TrrFile.py b/audit/paypal/TrrFile.py index d32ec97..a81edf2 100644 --- a/audit/paypal/TrrFile.py +++ b/audit/paypal/TrrFile.py @@ -14,6 +14,64 @@ class TrrFile(object): VERSION = [4, 8] stomp = None +# FIXME: these are version 8 headers, we would fail on multi-part v4 files... +column_headers = [ +Column Type, +Transaction ID, +Invoice ID, +PayPal Reference ID, +PayPal Reference ID Type, +Transaction Event Code, +Transaction Initiation Date, +Transaction Completion Date, +Transaction Debit or Credit, +Gross Transaction Amount, +Gross Transaction Currency, +Fee Debit or Credit, +Fee Amount, +Fee Currency, +Transactional Status, +Insurance Amount, +Sales Tax Amount, +Shipping Amount, +Transaction Subject, +Transaction Note, +Payer's Account ID, +Payer Address Status, +Item Name, +Item ID, +Option 1 Name, +Option 1 Value, +Option 2 Name, +Option 2 Value, +Auction Site, +Auction Buyer ID, +Auction Closing Date, +Shipping Address Line1, +Shipping Address Line2, +Shipping Address City, +Shipping Address State, +Shipping Address Zip, +Shipping Address Country, +Shipping Method, +Custom Field, +Billing Address Line1, +Billing Address Line2, +Billing Address City, +Billing Address State, +Billing Address Zip, +Billing Address Country, +Consumer ID, +First Name, +Last Name, +Consumer Business Name, +Card Type, +Payment Source, +Shipping Name, +Authorization Review Status, +Protection Eligibility, +Payment Tracking ID, +] @staticmethod def handle(path): @@ -25,7 +83,8 @@ self.crm = Civicrm(config.civicrm_db) def parse(self): -ppreport.read(self.path, self.VERSION, self.parse_line) +# FIXME: encapsulation issues +ppreport.read(self.path, self.VERSION, self.parse_line, self.column_headers) def parse_line(self, row): if row['Billing Address Line1']: diff --git a/audit/paypal/ppreport.py b/audit/paypal/ppreport.py index d83865c..78d7090 100644 --- a/audit/paypal/ppreport.py +++ b/audit/paypal/ppreport.py @@ -9,13 +9,13 @@ quotechar='' ) -def read(path, version, callback): +def read(path, version, callback, column_headers): try: -read_encoded(path, version, callback, encoding='utf-16') +read_encoded(path, version, callback, column_headers, encoding='utf-16') except UnicodeError: -read_encoded(path, version, callback, encoding='utf-8-sig') +read_encoded(path, version, callback, column_headers, encoding='utf-8-sig') -def
[MediaWiki-commits] [Gerrit] Safety thing prevent overwriting files - change (wikimedia...tools)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/178004 Change subject: Safety thing prevent overwriting files .. Safety thing prevent overwriting files Change-Id: Ic41b4f83b9e1e4988513306a7ded04698c738fb5 --- M audit/paypal/parse_nightly 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/04/178004/1 diff --git a/audit/paypal/parse_nightly b/audit/paypal/parse_nightly index 1d72259..78c2ca5 100755 --- a/audit/paypal/parse_nightly +++ b/audit/paypal/parse_nightly @@ -43,6 +43,8 @@ dest_path = os.path.join(config.archive_path, filename) log.info(Archiving {orig} to {new}.format(orig=path, new=dest_path)) +if os.path.exists(dest_path): +raise Exception(Failed to archive file because destination path already exists: + dest_path) shutil.move(path, dest_path) if __name__ == '__main__': -- To view, visit https://gerrit.wikimedia.org/r/178004 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic41b4f83b9e1e4988513306a7ded04698c738fb5 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: master Gerrit-Owner: Awight awi...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert [IMPROV] Reduce usage of unicode() - change (pywikibot/core)
Nullzero has uploaded a new change for review. https://gerrit.wikimedia.org/r/178005 Change subject: Revert [IMPROV] Reduce usage of unicode() .. Revert [IMPROV] Reduce usage of unicode() The change completely breaks: https://travis-ci.org/wikimedia/pywikibot-core/builds/43211148 This reverts commit 58fd995ac73efa1c7807c0315c8c2140eb22011b. Change-Id: I815faa4f75c2a473dfa444da9248607717e5288a --- M pywikibot/bot.py M pywikibot/pagegenerators.py M scripts/checkimages.py 3 files changed, 17 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/05/178005/1 diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 99622dc..6e92dbf 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -266,7 +266,7 @@ log(u'=== Pywikibot framework v2.0 -- Logging header ===') # script call -log(u'COMMAND: %s' % sys.argv) +log(u'COMMAND: %s' % unicode(sys.argv)) # script call time stamp log(u'DATE: %s UTC' % str(datetime.datetime.utcnow())) @@ -280,7 +280,7 @@ # system if hasattr(os, 'uname'): -log(u'SYSTEM: %s' % os.uname()) +log(u'SYSTEM: %s' % unicode(os.uname())) # config file dir log(u'CONFIG FILE DIR: %s' % pywikibot.config2.base_dir) @@ -319,7 +319,7 @@ log(u' %s' % ver) if config.log_pywiki_repo_version: -log(u'PYWIKI REPO VERSION: %s' % version.getversion_onlinerepo()) +log(u'PYWIKI REPO VERSION: %s' % unicode(version.getversion_onlinerepo())) log(u'=== ' * 14) @@ -1074,7 +1074,7 @@ if site not in self._sites: log(u'LOADING SITE %s VERSION: %s' -% (site, site.version())) +% (site, unicode(site.version( self._sites.add(site) if len(self._sites) == 2: diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 00e0f11..a4b5b43 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -40,6 +40,7 @@ if sys.version_info[0] 2: basestring = (str, ) +unicode = str _logger = pagegenerators @@ -1965,7 +1966,7 @@ pywikibot.output(u'retrieved %d items' % data[u'status'][u'items']) for item in data[u'items']: -page = pywikibot.ItemPage(repo, u'Q{0}'.format(item)) +page = pywikibot.ItemPage(repo, u'Q' + unicode(item)) try: link = page.getSitelink(site) except pywikibot.NoPage: diff --git a/scripts/checkimages.py b/scripts/checkimages.py index 66b1aee..1310359 100644 --- a/scripts/checkimages.py +++ b/scripts/checkimages.py @@ -92,6 +92,7 @@ import re import time import datetime +import locale import sys import pywikibot @@ -101,6 +102,8 @@ if sys.version_info[0] 2: basestring = (str, ) + +locale.setlocale(locale.LC_ALL, '') ### # --- Change only below! ---# @@ -569,8 +572,14 @@ def printWithTimeZone(message): Print the messages followed by the TimeZone encoded correctly. if message[-1] != ' ': -message = u'%s ' % message -time_zone = time.strftime(u%d %b %Y %H:%M:%S (UTC), time.gmtime()) +message = '%s ' % unicode(message) +if locale.getlocale()[1]: +time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), + time.gmtime()), +locale.getlocale()[1]) +else: +time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), + time.gmtime())) pywikibot.output(u%s%s % (message, time_zone)) -- To view, visit https://gerrit.wikimedia.org/r/178005 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I815faa4f75c2a473dfa444da9248607717e5288a Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Nullzero nullzero.f...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert [IMPROV] Reduce usage of unicode() - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Revert [IMPROV] Reduce usage of unicode() .. Revert [IMPROV] Reduce usage of unicode() The change completely breaks: https://travis-ci.org/wikimedia/pywikibot-core/builds/43211148 This reverts commit 58fd995ac73efa1c7807c0315c8c2140eb22011b. Change-Id: I815faa4f75c2a473dfa444da9248607717e5288a --- M pywikibot/bot.py M pywikibot/pagegenerators.py M scripts/checkimages.py 3 files changed, 17 insertions(+), 7 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 99622dc..6e92dbf 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -266,7 +266,7 @@ log(u'=== Pywikibot framework v2.0 -- Logging header ===') # script call -log(u'COMMAND: %s' % sys.argv) +log(u'COMMAND: %s' % unicode(sys.argv)) # script call time stamp log(u'DATE: %s UTC' % str(datetime.datetime.utcnow())) @@ -280,7 +280,7 @@ # system if hasattr(os, 'uname'): -log(u'SYSTEM: %s' % os.uname()) +log(u'SYSTEM: %s' % unicode(os.uname())) # config file dir log(u'CONFIG FILE DIR: %s' % pywikibot.config2.base_dir) @@ -319,7 +319,7 @@ log(u' %s' % ver) if config.log_pywiki_repo_version: -log(u'PYWIKI REPO VERSION: %s' % version.getversion_onlinerepo()) +log(u'PYWIKI REPO VERSION: %s' % unicode(version.getversion_onlinerepo())) log(u'=== ' * 14) @@ -1074,7 +1074,7 @@ if site not in self._sites: log(u'LOADING SITE %s VERSION: %s' -% (site, site.version())) +% (site, unicode(site.version( self._sites.add(site) if len(self._sites) == 2: diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 00e0f11..a4b5b43 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -40,6 +40,7 @@ if sys.version_info[0] 2: basestring = (str, ) +unicode = str _logger = pagegenerators @@ -1965,7 +1966,7 @@ pywikibot.output(u'retrieved %d items' % data[u'status'][u'items']) for item in data[u'items']: -page = pywikibot.ItemPage(repo, u'Q{0}'.format(item)) +page = pywikibot.ItemPage(repo, u'Q' + unicode(item)) try: link = page.getSitelink(site) except pywikibot.NoPage: diff --git a/scripts/checkimages.py b/scripts/checkimages.py index 66b1aee..1310359 100644 --- a/scripts/checkimages.py +++ b/scripts/checkimages.py @@ -92,6 +92,7 @@ import re import time import datetime +import locale import sys import pywikibot @@ -101,6 +102,8 @@ if sys.version_info[0] 2: basestring = (str, ) + +locale.setlocale(locale.LC_ALL, '') ### # --- Change only below! ---# @@ -569,8 +572,14 @@ def printWithTimeZone(message): Print the messages followed by the TimeZone encoded correctly. if message[-1] != ' ': -message = u'%s ' % message -time_zone = time.strftime(u%d %b %Y %H:%M:%S (UTC), time.gmtime()) +message = '%s ' % unicode(message) +if locale.getlocale()[1]: +time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), + time.gmtime()), +locale.getlocale()[1]) +else: +time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), + time.gmtime())) pywikibot.output(u%s%s % (message, time_zone)) -- To view, visit https://gerrit.wikimedia.org/r/178005 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I815faa4f75c2a473dfa444da9248607717e5288a Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Nullzero nullzero.f...@gmail.com Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Xqt i...@gno.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPROV] Reduce usage of unicode() - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/178006 Change subject: [IMPROV] Reduce usage of unicode() .. [IMPROV] Reduce usage of unicode() The unicode() builtin is not necessary if it's added unmodified via format or %-notation into a unicode string (e.g. u'{0}'.format(value)). In addition, the localized time formatting was removed. The default 'C' locale (which is ASCII by definition) is now used instead. Change-Id: I7ab06dc9cd7ddff6ff6654d6d611870520abc02b --- M pywikibot/bot.py M pywikibot/pagegenerators.py M scripts/checkimages.py 3 files changed, 7 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/06/178006/1 diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 6e92dbf..77bd26f 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -266,7 +266,7 @@ log(u'=== Pywikibot framework v2.0 -- Logging header ===') # script call -log(u'COMMAND: %s' % unicode(sys.argv)) +log(u'COMMAND: %s' % sys.argv) # script call time stamp log(u'DATE: %s UTC' % str(datetime.datetime.utcnow())) @@ -280,7 +280,7 @@ # system if hasattr(os, 'uname'): -log(u'SYSTEM: %s' % unicode(os.uname())) +log(u'SYSTEM: {0}'.format(os.uname())) # config file dir log(u'CONFIG FILE DIR: %s' % pywikibot.config2.base_dir) @@ -319,7 +319,7 @@ log(u' %s' % ver) if config.log_pywiki_repo_version: -log(u'PYWIKI REPO VERSION: %s' % unicode(version.getversion_onlinerepo())) +log(u'PYWIKI REPO VERSION: %s' % version.getversion_onlinerepo()) log(u'=== ' * 14) @@ -1074,7 +1074,7 @@ if site not in self._sites: log(u'LOADING SITE %s VERSION: %s' -% (site, unicode(site.version( +% (site, site.version())) self._sites.add(site) if len(self._sites) == 2: diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index a4b5b43..00e0f11 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -40,7 +40,6 @@ if sys.version_info[0] 2: basestring = (str, ) -unicode = str _logger = pagegenerators @@ -1966,7 +1965,7 @@ pywikibot.output(u'retrieved %d items' % data[u'status'][u'items']) for item in data[u'items']: -page = pywikibot.ItemPage(repo, u'Q' + unicode(item)) +page = pywikibot.ItemPage(repo, u'Q{0}'.format(item)) try: link = page.getSitelink(site) except pywikibot.NoPage: diff --git a/scripts/checkimages.py b/scripts/checkimages.py index 1310359..66b1aee 100644 --- a/scripts/checkimages.py +++ b/scripts/checkimages.py @@ -92,7 +92,6 @@ import re import time import datetime -import locale import sys import pywikibot @@ -102,8 +101,6 @@ if sys.version_info[0] 2: basestring = (str, ) - -locale.setlocale(locale.LC_ALL, '') ### # --- Change only below! ---# @@ -572,14 +569,8 @@ def printWithTimeZone(message): Print the messages followed by the TimeZone encoded correctly. if message[-1] != ' ': -message = '%s ' % unicode(message) -if locale.getlocale()[1]: -time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), - time.gmtime()), -locale.getlocale()[1]) -else: -time_zone = unicode(time.strftime(u%d %b %Y %H:%M:%S (UTC), - time.gmtime())) +message = u'%s ' % message +time_zone = time.strftime(u%d %b %Y %H:%M:%S (UTC), time.gmtime()) pywikibot.output(u%s%s % (message, time_zone)) -- To view, visit https://gerrit.wikimedia.org/r/178006 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ab06dc9cd7ddff6ff6654d6d611870520abc02b Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de ___ 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 (32397d8) - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Update VE core submodule to master (32397d8) .. Update VE core submodule to master (32397d8) New changes: 5e60f12 Ensure clipboard key is removed from paste target 32397d8 Update OOjs UI to v0.4.0 Local changes to compensate for new OOUI version, and updated wfUseMW call. Change-Id: I005f7b23a36e04f1305d4aa037c19a5c7db9a699 --- M VisualEditor.hooks.php M lib/ve M modules/ve-mw/init/ve.init.mw.Target.js M modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js 4 files changed, 3 insertions(+), 3 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index 0004cd1..665f92f 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -17,7 +17,7 @@ // parties who attempt to install VisualEditor onto non-alpha wikis, as // this should have no impact on deploying to Wikimedia's wiki cluster; // is fine for release tarballs because 1.22wmf11 1.22alpha 1.22.0. - wfUseMW( '1.25wmf7' ); + wfUseMW( '1.25wmf12' ); } /** diff --git a/lib/ve b/lib/ve index d52749b..32397d8 16 --- a/lib/ve +++ b/lib/ve -Subproject commit d52749bac071fb5063f84fdf0e0ac975c06a9b01 +Subproject commit 32397d8854f3c4ed7d47cb26904851dc0892607e diff --git a/modules/ve-mw/init/ve.init.mw.Target.js b/modules/ve-mw/init/ve.init.mw.Target.js index 775ff68..8736da4 100644 --- a/modules/ve-mw/init/ve.init.mw.Target.js +++ b/modules/ve-mw/init/ve.init.mw.Target.js @@ -1540,7 +1540,7 @@ * @param {ve.ce.HeadingNode} headingNode Heading node to scroll to */ ve.init.mw.Target.prototype.scrollToHeading = function ( headingNode ) { - var $window = $( OO.ui.Element.getWindow( this.$element ) ); + var $window = $( OO.ui.Element.static.getWindow( this.$element ) ); $window.scrollTop( headingNode.$element.offset().top - this.toolbar.$element.height() ); }; diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js index 71bce0c..88030ae 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js @@ -182,7 +182,7 @@ * @param {ve.ui.MWCategoryItemWidget} item Category item */ ve.ui.MWCategoryPopupWidget.prototype.setPopup = function ( item ) { - var pos = OO.ui.Element.getRelativePosition( item.$indicator, this.$element.offsetParent() ); + var pos = OO.ui.Element.static.getRelativePosition( item.$indicator, this.$element.offsetParent() ); // Align to the middle of the indicator pos.left += item.$indicator.width() / 2; // Position below the indicator -- To view, visit https://gerrit.wikimedia.org/r/177797 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I005f7b23a36e04f1305d4aa037c19a5c7db9a699 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Jforrester jforres...@wikimedia.org 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: fc6eaf6..baffe9d - change (mediawiki/extensions)
Jenkins-mwext-sync has submitted this change and it was merged. Change subject: Syncronize VisualEditor: fc6eaf6..baffe9d .. Syncronize VisualEditor: fc6eaf6..baffe9d Change-Id: I79be29b07875fb595240ad46b6b37123d41f518a --- 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 fc6eaf6..baffe9d 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit fc6eaf6825c8db31fac7e3dfc6fdbe8314f27f71 +Subproject commit baffe9d7e13038c93a1844db39090e1ec2786dcf -- To view, visit https://gerrit.wikimedia.org/r/178007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79be29b07875fb595240ad46b6b37123d41f518a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org Gerrit-Reviewer: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: fc6eaf6..baffe9d - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/178007 Change subject: Syncronize VisualEditor: fc6eaf6..baffe9d .. Syncronize VisualEditor: fc6eaf6..baffe9d Change-Id: I79be29b07875fb595240ad46b6b37123d41f518a --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/07/178007/1 diff --git a/VisualEditor b/VisualEditor index fc6eaf6..baffe9d 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit fc6eaf6825c8db31fac7e3dfc6fdbe8314f27f71 +Subproject commit baffe9d7e13038c93a1844db39090e1ec2786dcf -- To view, visit https://gerrit.wikimedia.org/r/178007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79be29b07875fb595240ad46b6b37123d41f518a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki.legacy.oldshared: Copy missing image and add SVG v... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: mediawiki.legacy.oldshared: Copy missing image and add SVG version .. mediawiki.legacy.oldshared: Copy missing image and add SVG version Copied images from mediawiki.skinning. Change-Id: If58832e59c6f04ce5ef8ee39d821708098f8952e --- A resources/src/mediawiki.legacy/images/magnify-clip-ltr.png A resources/src/mediawiki.legacy/images/magnify-clip-ltr.svg A resources/src/mediawiki.legacy/images/magnify-clip-rtl.png A resources/src/mediawiki.legacy/images/magnify-clip-rtl.svg M resources/src/mediawiki.legacy/oldshared.css 5 files changed, 19 insertions(+), 1 deletion(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.legacy/images/magnify-clip-ltr.png b/resources/src/mediawiki.legacy/images/magnify-clip-ltr.png new file mode 100644 index 000..712b1b4 --- /dev/null +++ b/resources/src/mediawiki.legacy/images/magnify-clip-ltr.png Binary files differ diff --git a/resources/src/mediawiki.legacy/images/magnify-clip-ltr.svg b/resources/src/mediawiki.legacy/images/magnify-clip-ltr.svg new file mode 100644 index 000..4d3dcb6 --- /dev/null +++ b/resources/src/mediawiki.legacy/images/magnify-clip-ltr.svg @@ -0,0 +1,7 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +svg xmlns=http://www.w3.org/2000/svg; viewBox=0 0 11 15 width=15 height=11 +g id=magnify-clip fill=#fff stroke=#000 +path id=bigbox d=M1.509 1.865h10.99v7.919h-10.99z/ +path id=smallbox d=M-1.499 6.868h5.943v4.904h-5.943z/ +/g +/svg diff --git a/resources/src/mediawiki.legacy/images/magnify-clip-rtl.png b/resources/src/mediawiki.legacy/images/magnify-clip-rtl.png new file mode 100644 index 000..1d03a8c --- /dev/null +++ b/resources/src/mediawiki.legacy/images/magnify-clip-rtl.png Binary files differ diff --git a/resources/src/mediawiki.legacy/images/magnify-clip-rtl.svg b/resources/src/mediawiki.legacy/images/magnify-clip-rtl.svg new file mode 100644 index 000..582e4ae --- /dev/null +++ b/resources/src/mediawiki.legacy/images/magnify-clip-rtl.svg @@ -0,0 +1,7 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +svg xmlns=http://www.w3.org/2000/svg; viewBox=0 0 11 15 width=15 height=11 +g id=magnify-clip fill=#fff stroke=#000 +path id=bigbox d=M9.491 1.865h-10.99v7.919h10.99z/ +path id=smallbox d=M12.499 6.868h-5.943v4.904h5.943z/ +/g +/svg diff --git a/resources/src/mediawiki.legacy/oldshared.css b/resources/src/mediawiki.legacy/oldshared.css index d92d3bb..c2bd5a7 100644 --- a/resources/src/mediawiki.legacy/oldshared.css +++ b/resources/src/mediawiki.legacy/oldshared.css @@ -119,8 +119,12 @@ /* …and replace it with the image */ width: 15px; height: 11px; - /* @embed */ + /* Use same SVG support hack as mediawiki.legacy's shared.css */ background: url(images/magnify-clip-ltr.png) center center no-repeat; + /* @embed */ + background-image: -webkit-linear-gradient(transparent, transparent), url(images/magnify-clip-ltr.svg); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url(images/magnify-clip-ltr.svg); /* Don't annoy people who copy-paste everything too much */ -moz-user-select: none; -webkit-user-select: none; -- To view, visit https://gerrit.wikimedia.org/r/172316 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If58832e59c6f04ce5ef8ee39d821708098f8952e Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Alex Monk kren...@wikimedia.org Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net Gerrit-Reviewer: Jforrester jforres...@wikimedia.org Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: TheDJ hartman.w...@gmail.com Gerrit-Reviewer: Trevor Parscal tpars...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Element: Use $.context instead of recomputing in #getElement... - change (oojs/ui)
jenkins-bot has submitted this change and it was merged. Change subject: Element: Use $.context instead of recomputing in #getElementDocument .. Element: Use $.context instead of recomputing in #getElementDocument In the constructor we already call getJQuery, which uses the same static.getElementDocument and stores it in wrapper.context. The constructor even uses this (this.$.context.createElement). Simplfy the non-static getElementDocument by simply returning that instead of recomputing it. Change-Id: I678cbe21ac3dec02498428e727a51ea42c4cb74b --- M src/Element.js M tests/Element.test.js 2 files changed, 24 insertions(+), 6 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Element.js b/src/Element.js index d0ce844..d92ce31 100644 --- a/src/Element.js +++ b/src/Element.js @@ -482,7 +482,7 @@ * @return {HTMLDocument} Document object */ OO.ui.Element.prototype.getElementDocument = function () { - return OO.ui.Element.static.getDocument( this.$element ); + return this.$.context; }; /** diff --git a/tests/Element.test.js b/tests/Element.test.js index 14a454f..362d89a 100644 --- a/tests/Element.test.js +++ b/tests/Element.test.js @@ -2,6 +2,12 @@ setup: function () { this.fixture = document.createElement( 'div' ); document.body.appendChild( this.fixture ); + + this.makeFrame = function () { + var frame = document.createElement( 'iframe' ); + this.fixture.appendChild( frame ); + return ( frame.contentWindow frame.contentWindow.document ) || frame.contentDocument; + }; }, teardown: function () { this.fixture.parentNode.removeChild( this.fixture ); @@ -9,18 +15,16 @@ } } ); -QUnit.test( 'getDocument', 10, function ( assert ) { +QUnit.test( 'static.getDocument', 10, function ( assert ) { var frameDoc, frameEl, frameDiv, el = this.fixture, div = document.createElement( 'div' ), $el = $( this.fixture ), $div = $( 'div' ), win = window, - doc = document, - frame = doc.createElement( 'iframe' ); + doc = document; - el.appendChild( frame ); - frameDoc = ( frame.contentWindow frame.contentWindow.document ) || frame.contentDocument; + frameDoc = this.makeFrame(); frameEl = frameDoc.createElement( 'span' ); frameDoc.documentElement.appendChild( frameEl ); frameDiv = frameDoc.createElement( 'div' ); @@ -38,3 +42,17 @@ assert.strictEqual( OO.ui.Element.static.getDocument( {} ), null, 'Invalid' ); } ); + +QUnit.test( 'getElementDocument', 2, function ( assert ) { + var el, doc; + + doc = document; + el = new OO.ui.Element(); + assert.strictEqual( el.getElementDocument(), doc ); + + doc = this.makeFrame(); + el = new OO.ui.Element( { + $: OO.ui.Element.static.getJQuery( doc ) + } ); + assert.strictEqual( el.getElementDocument(), doc ); +} ); -- To view, visit https://gerrit.wikimedia.org/r/177997 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I678cbe21ac3dec02498428e727a51ea42c4cb74b Gerrit-PatchSet: 2 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Catrope roan.katt...@gmail.com 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 VisualEditor for cherry-pick - change (mediawiki/core)
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/178009 Change subject: Update VisualEditor for cherry-pick .. Update VisualEditor for cherry-pick New changes: a195e07 Update VE core for cherry-pick 7a680b9 Ensure clipboard key is removed from paste target Change-Id: Ifff2606a78500d37ea65dbbb953a55b9f8d6ecc9 --- M extensions/VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/09/178009/1 diff --git a/extensions/VisualEditor b/extensions/VisualEditor index 3765160..a195e07 16 --- a/extensions/VisualEditor +++ b/extensions/VisualEditor -Subproject commit 37651605d4fb8668e3acafd840917ea8ba46e288 +Subproject commit a195e07a372fe445b50b963ce60c2966e88edf1f -- To view, visit https://gerrit.wikimedia.org/r/178009 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifff2606a78500d37ea65dbbb953a55b9f8d6ecc9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.25wmf11 Gerrit-Owner: Catrope roan.katt...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update VisualEditor for cherry-pick - change (mediawiki/core)
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/178010 Change subject: Update VisualEditor for cherry-pick .. Update VisualEditor for cherry-pick New changes: a1145b4 Update VE core for cherry-pick bfe4e8f Ensure clipboard key is removed from paste target Change-Id: I292d27e33841ec94da6cc17a215644255c28e2bc --- M extensions/VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/10/178010/1 diff --git a/extensions/VisualEditor b/extensions/VisualEditor index e8eefbb..b71e742 16 --- a/extensions/VisualEditor +++ b/extensions/VisualEditor -Subproject commit e8eefbb4dec1e4931e3b6f4bff2a36020add6249 +Subproject commit b71e742763e64b7f8048c715220ca5f728dd0f96 -- To view, visit https://gerrit.wikimedia.org/r/178010 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I292d27e33841ec94da6cc17a215644255c28e2bc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.25wmf10 Gerrit-Owner: Catrope roan.katt...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use String#slice instead of discouraged String#substr - change (unicodejs)
jenkins-bot has submitted this change and it was merged. Change subject: Use String#slice instead of discouraged String#substr .. Use String#slice instead of discouraged String#substr Aside from the confusion and differences between substr() and substring() and IE8 bugs with substr(), substr() was removed from the spec as of ECMAScript 5. It's been standardised in the optional Annex B section of ES5. Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 --- M build/tasks/git-build.js M src/unicodejs.js 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/build/tasks/git-build.js b/build/tasks/git-build.js index 6053b5c..7d34e06 100644 --- a/build/tasks/git-build.js +++ b/build/tasks/git-build.js @@ -13,7 +13,7 @@ done( false ); return; } - grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.substr( 0, 10 ) + ')' ); + grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.slice( 0, 10 ) + ')' ); grunt.verbose.writeln( 'Added git HEAD to pgk.version' ); done(); } ); diff --git a/src/unicodejs.js b/src/unicodejs.js index 736a0a7..b155bfc 100644 --- a/src/unicodejs.js +++ b/src/unicodejs.js @@ -36,7 +36,7 @@ * @return {string} String literal ('\u' followed by 4 hex digits) */ function uEsc( codeUnit ) { - return '\\u' + ( codeUnit + 0x1 ).toString( 16 ).substr( -4 ); + return '\\u' + ( codeUnit + 0x1 ).toString( 16 ).slice( -4 ); } /** -- To view, visit https://gerrit.wikimedia.org/r/177992 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 Gerrit-PatchSet: 2 Gerrit-Project: unicodejs Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use String#slice instead of discouraged String#substr - change (VisualEditor/VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Use String#slice instead of discouraged String#substr .. Use String#slice instead of discouraged String#substr Follows-up 7004717af5. Aside from the confusion and differences between substr() and substring() and IE8 bugs with substr(), substr() was removed from the spec as of ECMAScript 5. It's been standardised in the optional Annex B section of ES5. Change-Id: I1f9f46f73ea0c79ec7e4c726a86bfe3ffa1924d3 --- M build/tasks/git-build.js M src/ui/widgets/ve.ui.LanguageResultWidget.js M tests/ce/ve.ce.TestRunner.js 3 files changed, 6 insertions(+), 5 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/build/tasks/git-build.js b/build/tasks/git-build.js index 6053b5c..7d34e06 100644 --- a/build/tasks/git-build.js +++ b/build/tasks/git-build.js @@ -13,7 +13,7 @@ done( false ); return; } - grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.substr( 0, 10 ) + ')' ); + grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.slice( 0, 10 ) + ')' ); grunt.verbose.writeln( 'Added git HEAD to pgk.version' ); done(); } ); diff --git a/src/ui/widgets/ve.ui.LanguageResultWidget.js b/src/ui/widgets/ve.ui.LanguageResultWidget.js index 2ae6b60..254b1a9 100644 --- a/src/ui/widgets/ve.ui.LanguageResultWidget.js +++ b/src/ui/widgets/ve.ui.LanguageResultWidget.js @@ -75,7 +75,7 @@ document.createTextNode( text.slice( 0, offset ) ), this.$( 'span' ) .addClass( 've-ui-languageResultWidget-highlight' ) - .text( text.substr( offset, query.length ) ), + .text( text.slice( offset, offset + query.length ) ), document.createTextNode( text.slice( offset + query.length ) ) ); return $result.contents(); diff --git a/tests/ce/ve.ce.TestRunner.js b/tests/ce/ve.ce.TestRunner.js index 6706209..2ce05de 100644 --- a/tests/ce/ve.ce.TestRunner.js +++ b/tests/ce/ve.ce.TestRunner.js @@ -58,8 +58,8 @@ // test = n because one more boundaries than code units if ( node.textContent.length = n ) { offset = reversed ? node.textContent.length - n : n; - slice = node.textContent.substring( 0, offset ) + '|' + - node.textContent.substring( offset ); + slice = node.textContent.slice( 0, offset ) + '|' + + node.textContent.slice( offset ); return { node: node, offset: offset, slice: slice }; } else { return { consumed: node.textContent.length + 1 }; @@ -204,7 +204,8 @@ // FIXME: renaming startNode to startContainer revealed failing tests if ( false nativeRange nativeRange.startContainer text.indexOf( nativeRange.startContainer.textContent ) === 0 ) { // We're just appending - extra = nativeRange.startContainer.textContent.substring( nativeRange.startContainer.textContent.length ); + // FIXME: str.slice( tr.length ) always produces an empty string... + extra = nativeRange.startContainer.textContent.slice( nativeRange.startContainer.textContent.length ); // This is fine IF startContainer is a TextNode nativeRange.startContainer.textContent += extra; } else { -- To view, visit https://gerrit.wikimedia.org/r/177998 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f9f46f73ea0c79ec7e4c726a86bfe3ffa1924d3 Gerrit-PatchSet: 2 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't use new with $.Deferred() - change (mediawiki...Translate)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/178032 Change subject: Don't use new with $.Deferred() .. Don't use new with $.Deferred() Simplified code where possible with then() and postWithToken(). Change-Id: Ifd39d7e3063681363961e3a6125d6ce99b6f6e74 --- M resources/js/ext.translate.base.js M resources/js/ext.translate.editor.helpers.js M resources/js/ext.translate.special.pagemigration.js M resources/js/ext.translate.special.pagepreparation.js M resources/js/ext.translate.workflowselector.js 5 files changed, 25 insertions(+), 43 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/32/178032/1 diff --git a/resources/js/ext.translate.base.js b/resources/js/ext.translate.base.js index 4d409f7..76c8e7d 100644 --- a/resources/js/ext.translate.base.js +++ b/resources/js/ext.translate.base.js @@ -53,8 +53,7 @@ * @return {jQuery.Promise} Object containing the requested properties on success. */ getMessageGroup: function ( id, props ) { - var params, - deferred = new $.Deferred(); + var params; if ( $.isArray( props ) ) { props = props.join( '|' ); @@ -71,14 +70,9 @@ mgroot: id }; - new mw.Api() - .get( params ) - .done( function ( result ) { - deferred.resolve( result.query.messagegroups[0] ); - } ) - .fail( deferred.reject ); - - return deferred.promise(); + return (new mw.Api()).get( params ).then( function ( result ) { + return result.query.messagegroups[0]; + } ); }, /** diff --git a/resources/js/ext.translate.editor.helpers.js b/resources/js/ext.translate.editor.helpers.js index 9c08552..6a0587d 100644 --- a/resources/js/ext.translate.editor.helpers.js +++ b/resources/js/ext.translate.editor.helpers.js @@ -53,10 +53,9 @@ saveDocumentation: function () { var translateEditor = this, api = new mw.Api(), - deferred = new $.Deferred(), newDocumentation = translateEditor.$editor.find( '.tux-textarea-documentation' ).val(); - deferred = api.postWithToken( 'edit', { + return api.postWithToken( 'edit', { action: 'edit', title: translateEditor.message.title .replace( /\/[a-z\-]+$/, '/' + mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ), @@ -85,7 +84,6 @@ mw.notify( 'Error saving message documentation' ); mw.log( 'Error saving documentation', errorCode, results ); } ); - return deferred.promise(); }, /** diff --git a/resources/js/ext.translate.special.pagemigration.js b/resources/js/ext.translate.special.pagemigration.js index 7b72bae..307b121 100644 --- a/resources/js/ext.translate.special.pagemigration.js +++ b/resources/js/ext.translate.special.pagemigration.js @@ -12,15 +12,14 @@ function createTranslationPage( i, content ) { return function () { - var api = new mw.Api(), - identifier, title, summary, - deferred = new $.Deferred(); + var identifier, title, summary, + api = new mw.Api(); identifier = sourceUnits[i].identifier; title = 'Translations:' + pageName + '/' + identifier + '/' + langCode; summary = $( '#pm-summary' ).val(); - deferred = api.postWithToken( 'edit', { + return api.postWithToken( 'edit', { action: 'edit', format: 'json', watchlist: 'nochange', @@ -28,7 +27,6 @@ text: content, summary: summary, } ); - return deferred.promise(); }; } @@ -59,12 +57,12 @@ if ( typeof obj === undefined ) { // obj was not initialized errorBox.text( mw.msg( 'pm-page-does-not-exist', pageTitle ) ).show(
[MediaWiki-commits] [Gerrit] Update README to Phabricator time - change (mediawiki...Translate)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/178043 Change subject: Update README to Phabricator time .. Update README to Phabricator time Change-Id: I02a7d155d9a7c1da8fe74088150b02f209c78609 --- M README 1 file changed, 3 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/43/178043/1 diff --git a/README b/README index a2cfe11..778f067 100644 --- a/README +++ b/README @@ -14,19 +14,15 @@ $wgGroupPermissions['sysop']['pagetranslation'] = true; More documentation is at + https://www.mediawiki.org/wiki/Help:Extension:Translate https://www.mediawiki.org/wiki/Help:Extension:Translate/Installation https://www.mediawiki.org/wiki/Help:Extension:Translate/Configuration == Contributing == * Translations? Go to https://translatewiki.net and sign up. * Code? File format handlers? New message groups? Graphics? Suggestions? - Bug reports? Please start a thread at https://translatewiki.net/wiki/Support, - report a bug in https://bugzilla.wikimedia.org or join us at #mediawiki-i18n + Bug reports? File a bug or feature request or join us at #mediawiki-i18n and let us know what you have in mind. Known bugs and feature requests are collected at: - https://translatewiki.net/wiki/Issues_and_features and - https://bugzilla.wikimedia.org/buglist.cgi?resolution=---component=Translate - -Documentation for the extension is at: - https://www.mediawiki.org/wiki/Help:Extension:Translate + https://phabricator.wikimedia.org/tag/mediawiki-extensions-translate/ -- To view, visit https://gerrit.wikimedia.org/r/178043 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02a7d155d9a7c1da8fe74088150b02f209c78609 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use String#slice instead of discouraged String#substr - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Use String#slice instead of discouraged String#substr .. Use String#slice instead of discouraged String#substr Aside from the confusion and differences between substr() and substring() and IE8 bugs with substr(), substr() was removed from the spec as of ECMAScript 5. It's been standardised in the optional Annex B section of ES5. Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 --- M modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js M modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js M modules/ve-mw/init/ve.init.mw.trackSubscriber.js M modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js M modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js M modules/ve-mw/ui/widgets/ve.ui.MWReferenceGroupInputWidget.js M modules/ve-mw/ui/widgets/ve.ui.MWTitleInputWidget.js 7 files changed, 12 insertions(+), 9 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js index b811a08..bb8413e 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js @@ -160,7 +160,7 @@ dataElement.attributes.listKey, // Generate a name starting with ':' to distinguish it from normal names 'literal/:' - ).substr( 'literal/'.length ); + ).slice( 'literal/'.length ); } else { name = undefined; } diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js index fd9e48f..c7470f4 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js @@ -166,8 +166,8 @@ output += input; break; } - output += input.substr( 0, match.index ); - input = input.substr( match.index + match[0].length ); + output += input.slice( 0, match.index ); + input = input.slice( match.index + match[0].length ); if ( inNowiki ) { if ( match[0] === '/nowiki' ) { inNowiki = false; diff --git a/modules/ve-mw/init/ve.init.mw.trackSubscriber.js b/modules/ve-mw/init/ve.init.mw.trackSubscriber.js index c53d100..0906a7d 100644 --- a/modules/ve-mw/init/ve.init.mw.trackSubscriber.js +++ b/modules/ve-mw/init/ve.init.mw.trackSubscriber.js @@ -53,11 +53,14 @@ ve.trackSubscribeAll( function ( topic, data ) { data = data || {}; - var newData, action, now = Math.floor( ve.now() ), prefix = topic.substr( 0, topic.indexOf( '.' ) ); + var newData, action, + now = Math.floor( ve.now() ), + prefix = topic.slice( 0, topic.indexOf( '.' ) ); + if ( prefix === 'mwtiming' ) { // Legacy TimingData events // Map timing.foo -- ve.foo - topic = 've.' + topic.substr( prefix.length + 1 ); + topic = 've.' + topic.slice( prefix.length + 1 ); } else if ( prefix === 'mwedit' ) { // Edit schema action = topic.split( '.' )[1]; diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index 85d2c57..4993714 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -605,7 +605,7 @@ if ( namespacesWithSubpages[ namespace ] ) { // If we are in a namespace that allows for subpages, strip the entire // title except for the part after the last / - pageTitle = pageTitle.substr( pageTitle.lastIndexOf( '/' ) + 1 ); + pageTitle = pageTitle.slice( pageTitle.lastIndexOf( '/' ) + 1 ); } this.pageTitle = pageTitle; diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js index d9d7a97..364ce62 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryInputWidget.js @@ -248,7 +248,7 @@ } if ( this.forceCapitalization ) { - value = value.substr( 0, 1 ).toUpperCase() + value.substr( 1 ); + value = value.slice( 0, 1 ).toUpperCase() + value.slice( 1 ); } return { diff --git
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: baffe9d..ee954cb - change (mediawiki/extensions)
Jenkins-mwext-sync has submitted this change and it was merged. Change subject: Syncronize VisualEditor: baffe9d..ee954cb .. Syncronize VisualEditor: baffe9d..ee954cb Change-Id: If839155eff2cce5c20f857f95d02a185cd4cac52 --- 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 baffe9d..ee954cb 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit baffe9d7e13038c93a1844db39090e1ec2786dcf +Subproject commit ee954cbdd552f88a967f52fe8a78a2c239e91ff6 -- To view, visit https://gerrit.wikimedia.org/r/178044 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If839155eff2cce5c20f857f95d02a185cd4cac52 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org Gerrit-Reviewer: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: baffe9d..ee954cb - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/178044 Change subject: Syncronize VisualEditor: baffe9d..ee954cb .. Syncronize VisualEditor: baffe9d..ee954cb Change-Id: If839155eff2cce5c20f857f95d02a185cd4cac52 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/44/178044/1 diff --git a/VisualEditor b/VisualEditor index baffe9d..ee954cb 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit baffe9d7e13038c93a1844db39090e1ec2786dcf +Subproject commit ee954cbdd552f88a967f52fe8a78a2c239e91ff6 -- To view, visit https://gerrit.wikimedia.org/r/178044 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If839155eff2cce5c20f857f95d02a185cd4cac52 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix href parsing in transclusion nodes when on alternative (... - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Fix href parsing in transclusion nodes when on alternative (e.g. mobile) domains/paths .. Fix href parsing in transclusion nodes when on alternative (e.g. mobile) domains/paths Use model HTMLDocument when parsing transclusion nodes and their link hrefs As well as mobile, this also covers the issue I found in /w/index.php?veaction=edit See also T76374 Bug: T76379 Change-Id: I07c9ba0adbcee32f7eb2ca280d3a1d46e963d28f --- M modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js index 6647225..0cece3a 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js @@ -102,7 +102,7 @@ return this.onParseError.call( this, deferred ); } - contentNodes = $.parseHTML( response.visualeditor.content ); + contentNodes = $.parseHTML( response.visualeditor.content, this.getModelHtmlDocument() ); // HACK: if $content consists of a single paragraph, unwrap it. // We have to do this because the PHP parser wraps everything in ps, and inline templates // will render strangely when wrapped in ps. @@ -129,12 +129,13 @@ * @inheritdoc */ ve.ce.MWTransclusionNode.prototype.getRenderedDomElements = function ( domElements ) { - var $elements = this.$( ve.ce.GeneratedContentNode.prototype.getRenderedDomElements.call( this, domElements ) ); + var $elements = this.$( ve.ce.GeneratedContentNode.prototype.getRenderedDomElements.call( this, domElements ) ), + transclusionNode = this; $elements .find( 'a[href][rel=mw:WikiLink]' ).addBack( 'a[href][rel=mw:WikiLink]' ) .each( function () { var targetData = ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref( - this.href, this.ownerDocument + this.href, transclusionNode.getModelHtmlDocument() ), normalisedHref = decodeURIComponent( targetData.title ); if ( mw.Title.newFromText( normalisedHref ) ) { -- To view, visit https://gerrit.wikimedia.org/r/177875 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I07c9ba0adbcee32f7eb2ca280d3a1d46e963d28f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk kren...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com 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: ee954cb..9d1b8fd - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/178045 Change subject: Syncronize VisualEditor: ee954cb..9d1b8fd .. Syncronize VisualEditor: ee954cb..9d1b8fd Change-Id: Ic3f63a40afa521c8be601569c751701ed9148333 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/45/178045/1 diff --git a/VisualEditor b/VisualEditor index ee954cb..9d1b8fd 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit ee954cbdd552f88a967f52fe8a78a2c239e91ff6 +Subproject commit 9d1b8fdded94285b607f37a953a8b8e0d31e57ab -- To view, visit https://gerrit.wikimedia.org/r/178045 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3f63a40afa521c8be601569c751701ed9148333 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: ee954cb..9d1b8fd - change (mediawiki/extensions)
Jenkins-mwext-sync has submitted this change and it was merged. Change subject: Syncronize VisualEditor: ee954cb..9d1b8fd .. Syncronize VisualEditor: ee954cb..9d1b8fd Change-Id: Ic3f63a40afa521c8be601569c751701ed9148333 --- 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 ee954cb..9d1b8fd 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit ee954cbdd552f88a967f52fe8a78a2c239e91ff6 +Subproject commit 9d1b8fdded94285b607f37a953a8b8e0d31e57ab -- To view, visit https://gerrit.wikimedia.org/r/178045 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3f63a40afa521c8be601569c751701ed9148333 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org Gerrit-Reviewer: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] build: Use String#slice instead of discouraged String#substr - change (oojs/ui)
jenkins-bot has submitted this change and it was merged. Change subject: build: Use String#slice instead of discouraged String#substr .. build: Use String#slice instead of discouraged String#substr Aside from the confusion and differences between substr() and substring() and IE8 bugs with substr(), substr() was removed from the spec as of ECMAScript 5. It's been standardised in the optional Annex B section of ES5. Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 --- M Gruntfile.js M build/tasks/colorize-svg.js M demos/demo.js 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/Gruntfile.js b/Gruntfile.js index 3a6f04e..1d3f257 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -328,7 +328,7 @@ done( false ); return; } - grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.substr( 0, 10 ) + ')' ); + grunt.config.set( 'pkg.version', grunt.config( 'pkg.version' ) + '-pre (' + stout.slice( 0, 10 ) + ')' ); grunt.verbose.writeln( 'Added git HEAD to pgk.version' ); done(); } ); diff --git a/build/tasks/colorize-svg.js b/build/tasks/colorize-svg.js index 46b61bf..0ac2f79 100644 --- a/build/tasks/colorize-svg.js +++ b/build/tasks/colorize-svg.js @@ -163,7 +163,7 @@ file = this.file, name = this.name, fileExtension = path.extname( file ), - fileExtensionBase = fileExtension.substr( 1 ), + fileExtensionBase = fileExtension.slice( 1 ), fileNameBase = path.basename( file, fileExtension ), filePath = path.join( this.list.getPath(), file ), variable = fileExtensionBase.toLowerCase() === 'svg', diff --git a/demos/demo.js b/demos/demo.js index 7349673..22b6e91 100644 --- a/demos/demo.js +++ b/demos/demo.js @@ -244,7 +244,7 @@ * @return {string[]} Factor values in URL order: page, theme, graphics, direction */ OO.ui.Demo.prototype.getCurrentFactorValues = function () { - return location.hash.substr( 1 ).split( '-' ); + return location.hash.slice( 1 ).split( '-' ); }; /** -- To view, visit https://gerrit.wikimedia.org/r/177994 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] bin: Update update-unicodejs.sh to parity with update-oojs.sh - change (VisualEditor/VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: bin: Update update-unicodejs.sh to parity with update-oojs.sh .. bin: Update update-unicodejs.sh to parity with update-oojs.sh Change-Id: I80e78eb8de78f81b7f046bc4f9bc647fff5cafc3 --- M bin/update-unicodejs.sh 1 file changed, 11 insertions(+), 9 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/bin/update-unicodejs.sh b/bin/update-unicodejs.sh index e3268ee..ed4822f 100755 --- a/bin/update-unicodejs.sh +++ b/bin/update-unicodejs.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# This script generates a commit that updates our copy of UnicodeJS + if [ -n $2 ] then # Too many parameters @@ -7,25 +9,25 @@ exit 1 fi -REPO_DIR=$(cd $(dirname $0)/..; pwd) # Root dir of the git repo working tree -TARGET_DIR=lib/unicodejs # Destination relative to the root of the repo -NPM_DIR=`mktemp -d 2/dev/null || mktemp -d -t 'update-unicodejs'` # e.g. /tmp/update-unicodejs.rI0I5Vir +REPO_DIR=$(cd $(dirname $0)/..; pwd) # Root dir of the git repo working tree +TARGET_DIR=lib/unicodejs # Destination relative to the root of the repo +NPM_DIR=$(mktemp -d 2/dev/null || mktemp -d -t 'update-unicodejs') # e.g. /tmp/update-unicodejs.rI0I5Vir # Prepare working tree -cd $REPO_DIR -git reset $TARGET_DIR git checkout $TARGET_DIR git fetch origin +cd $REPO_DIR +git reset -- $TARGET_DIR git checkout -- $TARGET_DIR git fetch origin git checkout -B upstream-unicodejs origin/master || exit 1 # Fetch upstream version cd $NPM_DIR if [ -n $1 ] then - npm install unicodejs@$1 || exit 1 + npm install unicodejs@$1 || exit 1 else npm install unicodejs || exit 1 fi -UNICODEJS_VERSION=$(node -e 'console.log(JSON.parse(require(fs).readFileSync(./node_modules/unicodejs/package.json)).version);') +UNICODEJS_VERSION=$(node -e 'console.log(require(./node_modules/unicodejs/package.json).version);') if [ $UNICODEJS_VERSION == ] then echo 'Could not find UnicodeJS version' @@ -33,10 +35,10 @@ fi # Copy file(s) -rsync --recursive --delete --force ./node_modules/unicodejs/dist $REPO_DIR/$TARGET_DIR || exit 1 +rsync --force ./node_modules/unicodejs/dist/unicodejs.js $REPO_DIR/$TARGET_DIR || exit 1 # Clean up temporary area -rm -rf $NPM_DIR +rm -rf $NPM_DIR # Generate commit cd $REPO_DIR || exit 1 -- To view, visit https://gerrit.wikimedia.org/r/177583 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I80e78eb8de78f81b7f046bc4f9bc647fff5cafc3 Gerrit-PatchSet: 2 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jforrester jforres...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Krinkle krinklem...@gmail.com 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 bugzilla references to phabricator - change (mediawiki...UniversalLanguageSelector)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/178046 Change subject: Update bugzilla references to phabricator .. Update bugzilla references to phabricator Change-Id: I2cb920fd084a1ab333678e1e3c8f4524b39cc6cd --- M README M composer.json M data/fontrepo/fonts/AbyssinicaSIL/font.ini M data/fontrepo/fonts/Akkadian/font.ini M data/fontrepo/fonts/CharisSIL/font.ini M data/fontrepo/fonts/DoulosSIL/font.ini M data/fontrepo/fonts/EstrangeloEdessa/font.ini M data/fontrepo/fonts/FreeFontThana/font.ini M data/fontrepo/fonts/Hanuman/font.ini M data/fontrepo/fonts/HussainiNastaleeq/font.ini M data/fontrepo/fonts/Jomolhari/font.ini M data/fontrepo/fonts/Lateef/font.ini M data/fontrepo/fonts/NafeesWeb/font.ini M data/fontrepo/fonts/Nokora/font.ini M data/fontrepo/fonts/NuosuSIL/font.ini M data/fontrepo/fonts/OpenDyslexic/font.ini M data/fontrepo/fonts/RailwaySans/font.ini M data/fontrepo/fonts/Scheherazade/font.ini M data/fontrepo/fonts/Shapour/font.ini M data/fontrepo/fonts/SiyamRupali/font.ini M data/fontrepo/fonts/Suwannaphum/font.ini M data/fontrepo/fonts/TharLon/font.ini M data/fontrepo/fonts/amiri/font.ini M data/fontrepo/fonts/lklug/font.ini M resources/css/ext.uls.pt.css M tests/browser/features/live_preview_of_display_language.feature M tests/browser/features/settings_panel.feature M tests/browser/features/step_definitions/cog_sidebar_user_steps.rb 28 files changed, 32 insertions(+), 37 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/46/178046/1 diff --git a/README b/README index 7229041..60fff0d 100644 --- a/README +++ b/README @@ -34,9 +34,5 @@ Its development is at Wikimedia Github account. Any fixes to lib/ should happen at Github. Follow the build instructions of jquery.uls to create jquery.uls.js. -More documentation is at: - https://www.mediawiki.org/wiki/Extension:UniversalLanguageSelector - -For reporting bugs, use 'UniversalLanguageSelector' component under -'MediaWiki extensions' product at: - https://bugzilla.wikimedia.org +Bugs for the extension are handled in Phabricator: + https://phabricator.wikimedia.org/tag/mediawiki-extensions-universallanguageselector/ diff --git a/composer.json b/composer.json index 886a517..999cdbd 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ homepage: https://www.mediawiki.org/wiki/Extension:UniversalLanguageSelector;, license: [ GPL-2.0+, MIT ], support: { - issues: https://bugzilla.wikimedia.org/;, + issues: https://phabricator.wikimedia.org/tag/mediawiki-extensions-universallanguageselector/;, irc: irc://irc.freenode.net/mediawiki-i18n }, require: { diff --git a/data/fontrepo/fonts/AbyssinicaSIL/font.ini b/data/fontrepo/fonts/AbyssinicaSIL/font.ini index 7715270..3294015 100644 --- a/data/fontrepo/fonts/AbyssinicaSIL/font.ini +++ b/data/fontrepo/fonts/AbyssinicaSIL/font.ini @@ -3,5 +3,5 @@ version=1.500 license=OFL-1.1 licensefile=OFL.txt -request-url=https://gerrit.wikimedia.org/r/#/c/25479/, https://gerrit.wikimedia.org/r/#/c/90306/ +request-url=https://gerrit.wikimedia.org/r/#/c/90306/ url=http://scripts.sil.org/AbyssinicaSIL diff --git a/data/fontrepo/fonts/Akkadian/font.ini b/data/fontrepo/fonts/Akkadian/font.ini index 29284ff..e63fe4c 100644 --- a/data/fontrepo/fonts/Akkadian/font.ini +++ b/data/fontrepo/fonts/Akkadian/font.ini @@ -3,6 +3,5 @@ version=2.56 license=George-Douros licensefile=George-Douros.txt -request-url=https://gerrit.wikimedia.org/r/#/c/25479/ -;original request http://ultimategerardm.blogspot.in/2012/02/cuneiform-is-supported-at.html -url=http://users.teilar.gr/~g1951d/; +request-url=http://ultimategerardm.blogspot.in/2012/02/cuneiform-is-supported-at.html +url=http://users.teilar.gr/~g1951d/ diff --git a/data/fontrepo/fonts/CharisSIL/font.ini b/data/fontrepo/fonts/CharisSIL/font.ini index 65b0760..f3e0fcf 100644 --- a/data/fontrepo/fonts/CharisSIL/font.ini +++ b/data/fontrepo/fonts/CharisSIL/font.ini @@ -3,5 +3,5 @@ version=4.011 license=OFL-1.1 licensefile=OFL.txt -request-url=https://gerrit.wikimedia.org/r/#/c/25479/,https://bugzilla.wikimedia.org/47190 +request-url=https://phabricator.wikimedia.org/T49190 url=http://scripts.sil.org/CharisSIL diff --git a/data/fontrepo/fonts/DoulosSIL/font.ini b/data/fontrepo/fonts/DoulosSIL/font.ini index ded1918..80db637 100644 --- a/data/fontrepo/fonts/DoulosSIL/font.ini +++ b/data/fontrepo/fonts/DoulosSIL/font.ini @@ -3,5 +3,5 @@ version=4.112 license=OFL-1.1 licensefile=OFL.txt -request-url=https://bugzilla.wikimedia.org/47190 +request-url=https://phabricator.wikimedia.org/T49190 url=http://scripts.sil.org/DoulosSIL diff --git a/data/fontrepo/fonts/EstrangeloEdessa/font.ini b/data/fontrepo/fonts/EstrangeloEdessa/font.ini index 74e82f8..8eb59a5 100644 ---
[MediaWiki-commits] [Gerrit] Update references to bugzilla to phabricator - change (mediawiki...Translate)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/178047 Change subject: Update references to bugzilla to phabricator .. Update references to bugzilla to phabricator Change-Id: I653bffa866331d3cb15d03e0a1090514e04553f7 --- M Translate.MyLanguage.alias.php M Translate.php M TranslateUtils.php M api/ApiHardMessages.php M composer.json M ffs/MediaWikiComplexMessages.php M messagegroups/RecentAdditionsMessageGroup.php M resources/js/ext.translate.quickedit.js M resources/js/ext.translate.special.aggregategroups.js M tag/PageTranslationHooks.php M tag/SpecialPageTranslationDeletePage.php M tag/SpecialPageTranslationMovePage.php M tag/TPException.php M tag/TranslateMoveJob.php M tests/phpunit/TranslateSandboxTest.php M utils/MessageGroupCache.php 16 files changed, 17 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/47/178047/1 diff --git a/Translate.MyLanguage.alias.php b/Translate.MyLanguage.alias.php index 71e1076..c767c95 100644 --- a/Translate.MyLanguage.alias.php +++ b/Translate.MyLanguage.alias.php @@ -4,7 +4,7 @@ * This is a backwards compatibility file that separates the translations * in the extension from the translations of the same page's name * in core MediaWiki. For more information see the following bug: - * https://bugzilla.wikimedia.org/show_bug.cgi?id=69461 + * https://phabricator.wikimedia.org/T71461 * * @file * @license GPL-2.0+ diff --git a/Translate.php b/Translate.php index 958603f..e38c4fa 100644 --- a/Translate.php +++ b/Translate.php @@ -66,7 +66,8 @@ // Backwards compatibility: // If Special:MyLanguage is not in core, load translations of its name // from the Translate extension's code. -// See https://bugzilla.wikimedia.org/69461 +// See https://phabricator.wikimedia.org/T71461 +// Can be removed when MW 1.23 is no longer supported if ( !isset( $GLOBALS['wgAutoloadLocalClasses']['SpecialMyLanguage'] ) ) { $GLOBALS['wgExtensionMessagesFiles']['TranslateMyLanguageAlias'] = $dir/Translate.MyLanguage.alias.php; diff --git a/TranslateUtils.php b/TranslateUtils.php index f2e10c9..09243a3 100644 --- a/TranslateUtils.php +++ b/TranslateUtils.php @@ -205,7 +205,7 @@ public static function getLanguageNames( /*string */$code ) { $languageNames = Language::fetchLanguageNames( $code ); - // Remove languages with deprecated codes (bug 35475) + // Remove languages with deprecated codes (bug T37475) global $wgDummyLanguageCodes; foreach ( array_keys( $wgDummyLanguageCodes ) as $dummyLanguageCode ) { diff --git a/api/ApiHardMessages.php b/api/ApiHardMessages.php index f37279c..b7b9613 100644 --- a/api/ApiHardMessages.php +++ b/api/ApiHardMessages.php @@ -40,7 +40,7 @@ $revision = Revision::newFromTitle( $baseTitle ); if ( !$revision ) { - // This can fail. See https://bugzilla.wikimedia.org/show_bug.cgi?id=43286 + // This can fail. See https://phabricator.wikimedia.org/T45286 $this-dieUsage( 'Invalid revision', 'invalidrevision' ); } diff --git a/composer.json b/composer.json index 282d9dd..0df5528 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ } ], support: { - issues: https://bugzilla.wikimedia.org/;, + issues: https://phabricator.wikimedia.org/tag/mediawiki-extensions-translate/;, irc: irc://irc.freenode.net/mediawiki-i18n, forum: https://www.mediawiki.org/wiki/Extension_talk:Translate;, wiki: https://www.mediawiki.org/wiki/Extension:Translate; diff --git a/ffs/MediaWikiComplexMessages.php b/ffs/MediaWikiComplexMessages.php index 3ea1d1d..3034b8e 100644 --- a/ffs/MediaWikiComplexMessages.php +++ b/ffs/MediaWikiComplexMessages.php @@ -384,7 +384,7 @@ function formatForSave( WebRequest $request ) { $text = ''; - // Do not replace spaces by underscores for magic words. See bug 46613 + // Do not replace spaces by underscores for magic words. See bug T48613 $replaceSpace = $request-getVal( 'module' ) !== 'magic'; foreach ( array_keys( $this-data ) as $group ) { diff --git a/messagegroups/RecentAdditionsMessageGroup.php b/messagegroups/RecentAdditionsMessageGroup.php index 96db992..6a6d6bb 100644 --- a/messagegroups/RecentAdditionsMessageGroup.php +++ b/messagegroups/RecentAdditionsMessageGroup.php @@ -51,7 +51,6 @@ * Filters out messages that should not be displayed here * as they are not displayed in other places. * -* @see https://bugzilla.wikimedia.org/43030 * @param MessageHandle $handle * @return boolean
[MediaWiki-commits] [Gerrit] More misc JS fixes - change (mediawiki...LastModified)
jenkins-bot has submitted this change and it was merged. Change subject: More misc JS fixes .. More misc JS fixes * Remove some variables used only once * Use mw.util.getUrl * Check .length to see whether jQuery matched any elements Change-Id: I14d104fd696a8f41b885a1fe1101f62b381e4f9f --- M modules/lastmodified.js 1 file changed, 20 insertions(+), 50 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/lastmodified.js b/modules/lastmodified.js index ed577c3..e7e702e 100644 --- a/modules/lastmodified.js +++ b/modules/lastmodified.js @@ -23,46 +23,21 @@ * * This is the primary function for this script. */ -function render () { +$( function () { + var historyLink = getArticleHistoryLink(), + currentSkin = mw.config.get( 'skin' ), + html = ''; - // Get the last-modified-timestamp value - var lastModifiedTimestamp = getMetaLastModifiedTimestamp(); - - // Get the last-modified-range value - var displayRange = getMetaRange(); - - // Get the current timestamp and remove the milliseconds - var nowStamp = getUtcTimeStamp(); - - // Get the difference in the time from when it was last edited. - var modifiedDifference = nowStamp - lastModifiedTimestamp; - - // Get the last modified text - var lastModifiedText = getLastModifiedText( modifiedDifference, displayRange ); - - // Get the article history link - var historyLink = getArticleHistoryLink(); - - // Get the current skin - var currentSkin = mw.config.get( 'skin' ); - - // Get the proper styling (skin-dependent) - var divStyle = getDivStyle( currentSkin ); - - // Get the HTML property to append to (skin-dependent) - var htmlProperty = getHtmlProperty( currentSkin ); - - // Construct the HTML - var html = ''; - html += 'div style=' + divStyle + ' id=mwe-lastmodified'; + html += 'div style=' + getDivStyle( currentSkin ) + ' id=mwe-lastmodified'; html += 'a href=' + historyLink + ' title=' + mw.message( 'lastmodified-title-tag' ).escaped() + ''; - html += lastModifiedText; + html += getLastModifiedText( getUtcTimeStamp() - getMetaLastModifiedTimestamp(), getMetaRange() ); html += '/a'; html += '/div'; - // Insert the HTML into the web page - $( htmlProperty ).append( html ); -} + // Insert the HTML into the web page, based on skin + $( getHtmlProperty( currentSkin ) ).append( html ); +} ); + /** * Get the UTC Timestamp without microseconds * @@ -70,7 +45,7 @@ */ function getUtcTimeStamp () { return parseInt( new Date().getTime() / 1000 ); -} +}; /** * Get the article history link @@ -78,8 +53,8 @@ * @return {string} Return the article title */ function getArticleHistoryLink () { - return mw.config.get( 'wgScript' ) + '?title=' + encodeURIComponent( mw.config.get( 'wgPageName' ) ) + 'action=history'; -} + return mw.util.getUrl( mw.config.get( 'wgPageName' ), { action: 'history' } ); +}; /** * Get the value from the meta tag: last-modified-timestamp @@ -91,12 +66,12 @@ var metaTag = $( meta[name=last-modified-timestamp] ); // If the tag was found, parse the value - if ( metaTag ) { + if ( metaTag.length ) { return parseInt( metaTag.attr( 'content' ) ); } return 0; -} +}; /** * Get the modified text. This takes advantage of internationalization. @@ -160,7 +135,7 @@ } return message; -} +}; /** * Get the value from the meta tag: last-modified-range @@ -172,12 +147,12 @@ var metaTag = $( 'meta[name=last-modified-range]' ); // If the tag was found, parse the value - if ( metaTag ) { + if ( metaTag.length ) { return parseInt( metaTag.attr( 'content' ) ); } return 0; -} +}; /** * Get the proper div style tag information depending on the skin @@ -190,7 +165,7 @@ } else { return float: right; font-size: 0.5em;; } -} +}; /** * Get the HTML property to append to depending on the skin @@ -203,11 +178,6 @@ } else { return '#firstHeading'; } -} - -/** - * Display the last modified link on the page. - */ -$( render ); +}; }() ); -- To view, visit https://gerrit.wikimedia.org/r/170114 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I14d104fd696a8f41b885a1fe1101f62b381e4f9f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/LastModified Gerrit-Branch: master Gerrit-Owner: Alex Monk kren...@wikimedia.org Gerrit-Reviewer: Jforrester jforres...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits
[MediaWiki-commits] [Gerrit] Tidy up JS - change (mediawiki...LastModified)
jenkins-bot has submitted this change and it was merged. Change subject: Tidy up JS .. Tidy up JS Code style, docs fixes Change-Id: I0d6bca748e1035489f39b963063028ac9b941f25 --- M modules/lastmodified.js 1 file changed, 38 insertions(+), 63 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/lastmodified.js b/modules/lastmodified.js index b28f69c..ed577c3 100644 --- a/modules/lastmodified.js +++ b/modules/lastmodified.js @@ -16,39 +16,32 @@ * @author Katie Horn kh...@wikimedia.org, Jeremy Postlethwaite jpostlethwa...@wikimedia.org */ -( function( global ) { +( function () { /** * Find out when the article was last modified and insert it into the page. * * This is the primary function for this script. - * */ -function render() { +function render () { // Get the last-modified-timestamp value var lastModifiedTimestamp = getMetaLastModifiedTimestamp(); - //console.log( 'lastModifiedTimestamp: ' + lastModifiedTimestamp ); // Get the last-modified-range value var displayRange = getMetaRange(); - //console.log( 'displayRange: ' + displayRange ); // Get the current timestamp and remove the milliseconds var nowStamp = getUtcTimeStamp(); - //console.log( 'nowStamp: ' + nowStamp ); // Get the difference in the time from when it was last edited. var modifiedDifference = nowStamp - lastModifiedTimestamp; - //console.log( 'modifiedDifference: ' + modifiedDifference ); // Get the last modified text var lastModifiedText = getLastModifiedText( modifiedDifference, displayRange ); - //console.log( 'lastModifiedText: ' + lastModifiedText ); // Get the article history link var historyLink = getArticleHistoryLink(); - //console.log( 'historyLink: ' + historyLink ); // Get the current skin var currentSkin = mw.config.get( 'skin' ); @@ -73,35 +66,29 @@ /** * Get the UTC Timestamp without microseconds * - * @return integer + * @return {number} */ -function getUtcTimeStamp() { - - // Get the current Date object - var now = new Date(); - //console.log( 'now: ' + now ); - - return parseInt( now.getTime() / 1000 ); +function getUtcTimeStamp () { + return parseInt( new Date().getTime() / 1000 ); } /** * Get the article history link * - * @return string Return the article title + * @return {string} Return the article title */ -function getArticleHistoryLink() { +function getArticleHistoryLink () { return mw.config.get( 'wgScript' ) + '?title=' + encodeURIComponent( mw.config.get( 'wgPageName' ) ) + 'action=history'; } /** * Get the value from the meta tag: last-modified-timestamp * - * @return integer + * @return {number} */ -function getMetaLastModifiedTimestamp() { - +function getMetaLastModifiedTimestamp () { // Fetch the meta tag - var metaTag = $(meta[name=last-modified-timestamp]); + var metaTag = $( meta[name=last-modified-timestamp] ); // If the tag was found, parse the value if ( metaTag ) { @@ -114,8 +101,8 @@ /** * Get the modified text. This takes advantage of internationalization. * - * @param integer modifiedDifference The difference of time from now compared to last edited - * @param integer displayRangeThe maximum unit of time to display for last updated + * @param {number} modifiedDifference The difference of time from now compared to last edited + * @param {number} displayRangeThe maximum unit of time to display for last updated * * displayRange * - 0: years - display: years, months, days, hours, minutes, seconds @@ -125,9 +112,9 @@ * - 4: minutes- display: minutes, seconds * - 5: seconds- display: seconds * - * @return string + * @return {string} */ -function getLastModifiedText( modifiedDifference, displayRange ) { +function getLastModifiedText ( modifiedDifference, displayRange ) { // Message to return var message = ''; @@ -138,46 +125,37 @@ var myLastEdit = modifiedDifference; if ( modifiedDifference 60 ) { - // seconds - message = ( mw.msg( 'lastmodified-seconds', myLastEdit ) ); - + message = mw.msg( 'lastmodified-seconds', myLastEdit ); } else if ( modifiedDifference 3600 ) { - // minutes if ( displayRange = 4 ) { myLastEdit = parseInt( modifiedDifference / 60 ); - message = ( mw.msg( 'lastmodified-minutes', myLastEdit ) ); + message = mw.msg( 'lastmodified-minutes', myLastEdit ); } - } else if ( modifiedDifference 86400
[MediaWiki-commits] [Gerrit] jsduck: Remove redundant hack that searched jsduck.log for ... - change (integration/config)
jenkins-bot has submitted this change and it was merged. Change subject: jsduck: Remove redundant hack that searched jsduck.log for Warning .. jsduck: Remove redundant hack that searched jsduck.log for Warning Follows-up a4db3e7a37, e7a940d94b. When we added --processes=0, this hack became redundant since the upstream issue with exit codes only applies to parallel execution on old Ruby versions. As long as we run the old Ruby (bug 60138) we'll have processes=0, and when we upgrade, the exitcode bug isn't there and we'll remove processes=0. Bug: 55668 Change-Id: I1e226492d5313e28d851d71d04771fd84bd66af8 --- M jjb/macro.yaml 1 file changed, 1 insertion(+), 16 deletions(-) Approvals: Krinkle: Looks good to me, approved JanZerebecki: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/jjb/macro.yaml b/jjb/macro.yaml index f108f7b..2a12bbc 100644 --- a/jjb/macro.yaml +++ b/jjb/macro.yaml @@ -276,22 +276,7 @@ else version=unknown fi -set -o pipefail -jsduck --config={config} --footer=Generated for branch ${{version}} on {{DATE}} by {{JSDUCK}} {{VERSION}}. --processes 0 --warnings-exit-nonzero 21 | tee jsduck.log -ec=$? -if [[ $ec -eq 0 ]] -then -set +e -grep ^Warning: jsduck.log /dev/null -gr=$? -set -e -if [[ $gr -eq 0 ]] -then -ec=1 -fi -fi -# Exit with exit code of jsduck command, or whether we found errors -exit $ec +jsduck --config={config} --footer=Generated for branch ${{version}} on {{DATE}} by {{JSDUCK}} {{VERSION}}. --processes 0 --warnings-exit-nonzero - builder: name: jsduck -- To view, visit https://gerrit.wikimedia.org/r/174619 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e226492d5313e28d851d71d04771fd84bd66af8 Gerrit-PatchSet: 5 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Hashar has...@free.fr Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.de Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow adding custom parameters to the callback for OAuth. - change (mediawiki...OAuth)
jenkins-bot has submitted this change and it was merged. Change subject: Allow adding custom parameters to the callback for OAuth. .. Allow adding custom parameters to the callback for OAuth. In addition, allow consumer not to specify consumer key when redirecting the user. This prevents consumer key be displayed in the location bar and stored in the browser's history. Change-Id: I0a88818969a37145171c310050de2b3daadf72fa --- M backend/MWOAuthConsumer.php M backend/MWOAuthDataStore.php M backend/MWOAuthServer.php M backend/schema/MWOAuthUpdater.hooks.php A backend/schema/mysql/callback_is_prefix.sql A backend/schema/sqlite/OAuth.sql A backend/schema/sqlite/callback_is_prefix.sql M frontend/specialpages/SpecialMWOAuth.php M frontend/specialpages/SpecialMWOAuthConsumerRegistration.php M frontend/specialpages/SpecialMWOAuthListConsumers.php M frontend/specialpages/SpecialMWOAuthManageConsumers.php M i18n/en.json M i18n/qqq.json 13 files changed, 240 insertions(+), 27 deletions(-) Approvals: CSteipp: Looks good to me, approved 20after4: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/backend/MWOAuthConsumer.php b/backend/MWOAuthConsumer.php index ce2fe66..31c3d3e 100644 --- a/backend/MWOAuthConsumer.php +++ b/backend/MWOAuthConsumer.php @@ -37,6 +37,8 @@ protected $version; /** @var string OAuth callback URL for authorization step*/ protected $callbackUrl; + /** @var int OAuth callback URL is a prefix and we allow all URLs which have callbackUrl as the prefix */ + protected $callbackIsPrefix; /** @var string Application description */ protected $description; /** @var string Publisher email address */ @@ -79,6 +81,7 @@ 'userId' = 'oarc_user_id', 'version'= 'oarc_version', 'callbackUrl'= 'oarc_callback_url', + 'callbackIsPrefix' = 'oarc_callback_is_prefix', 'description'= 'oarc_description', 'email' = 'oarc_email', 'emailAuthenticated' = 'oarc_email_authenticated', @@ -99,15 +102,16 @@ protected static function getFieldPermissionChecks() { return array( - 'name'= 'userCanSee', - 'userId' = 'userCanSee', - 'version' = 'userCanSee', - 'callbackUrl' = 'userCanSee', - 'description' = 'userCanSee', - 'rsaKey' = 'userCanSee', - 'email' = 'userCanSeeEmail', - 'secretKey' = 'userCanSeeSecret', - 'restrictions'= 'userCanSeePrivate', + 'name' = 'userCanSee', + 'userId' = 'userCanSee', + 'version' = 'userCanSee', + 'callbackUrl' = 'userCanSee', + 'callbackIsPrefix' = 'userCanSee', + 'description' = 'userCanSee', + 'rsaKey' = 'userCanSee', + 'email'= 'userCanSeeEmail', + 'secretKey'= 'userCanSeeSecret', + 'restrictions' = 'userCanSeePrivate', ); } @@ -189,12 +193,19 @@ } /** +* @param MWOAuthDataStore $dataStore * @param string $verifyCode verification code * @param string $requestKey original request key from /initiate * @return string the url for redirection */ - public function generateCallbackUrl( $verifyCode, $requestKey ) { - return wfAppendQuery( $this-callbackUrl, array( + public function generateCallbackUrl( $dataStore, $verifyCode, $requestKey ) { + $callback = $dataStore-getCallbackUrl( $this-key, $requestKey ); + + if ( $callback === 'oob' ) { + $callback = $this-get( 'callbackUrl' ); + } + + return wfAppendQuery( $callback, array( 'oauth_verifier' = $verifyCode, 'oauth_token'= $requestKey ) ); diff --git a/backend/MWOAuthDataStore.php b/backend/MWOAuthDataStore.php index c51cb9d..57a78c2 100644 --- a/backend/MWOAuthDataStore.php +++ b/backend/MWOAuthDataStore.php @@ -102,19 +102,56 @@ * Generate a new token (attached to this consumer), save it in the cache, and return it * * @param MWOAuthConsumer|OAuthConsumer $consumer -* @param null $callback +* @param string $callback * @return
[MediaWiki-commits] [Gerrit] Add review settings page for Admin - change (wikimedia/wikimania-scholarships)
jenkins-bot has submitted this change and it was merged. Change subject: Add review settings page for Admin .. Add review settings page for Admin Bug: 64011 Co-Authored-By: Niharika niharikakohl...@gmail.com Change-Id: I22c509d4a44db95bf87c23122404bb4be19831ac --- M data/i18n/en.json M data/i18n/qqq.json A data/templates/admin/settings.html M data/templates/base_auth.html M src/Wikimania/Scholarship/App.php A src/Wikimania/Scholarship/Controllers/Admin/Settings.php M src/Wikimania/Scholarship/Dao/Settings.php 7 files changed, 215 insertions(+), 5 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/data/i18n/en.json b/data/i18n/en.json index 22cc683..9dd0be2 100644 --- a/data/i18n/en.json +++ b/data/i18n/en.json @@ -21,6 +21,7 @@ nav-admin: Admin, nav-users: Manage users, nav-account: My Account, + nav-settings: Settings, mock: This is a mock scholarship application site only, use it just for testing., @@ -268,5 +269,10 @@ csrf-heading: Invalid request, csrf-message: The request that was submitted was missing the request forgery protection token. Please return to the form, reload the page and try again., - search-region: Geographic region: + search-region: Geographic region:, + admin-settings-phase1pass: Phase 1 pass score:, + admin-settings-phase2pass: Phase 2 pass score:, + admin-settings-weightonwiki: Weight of contributions to Wikimedia:, + admin-settings-weightoffwiki: Weight of contributions other than Wikimedia:, + admin-settings-weightinterest: Weight of Interest: } diff --git a/data/i18n/qqq.json b/data/i18n/qqq.json index 80ab914..d7085f2 100644 --- a/data/i18n/qqq.json +++ b/data/i18n/qqq.json @@ -22,6 +22,7 @@ nav-admin: Navigation menu label for list of administrative pages.\n{{Identical|Admin}}, nav-users: Navigation menu label, links to user list page, nav-account: Navigation menu label for list of pages specific to the authenticated user's account.\n{{Identical|My account}}, +nav-settings: Navigation menu label, for settings page, mock: Disclaimer shown on scholarship request form when application is being used for testing and development, not-open: Content for site landing page before date that scholarship request will be accepted, deadline-passed: Content for site landing page after scholarship request period has closed, @@ -235,5 +236,10 @@ no-results: Content for report with no results, csrf-heading: Header for cross site request forgery (CSRF) error page, csrf-message: Cross site request forgery (CSRF) error page body, -search-region: Input label, followed by text box +search-region: Input label, followed by text box, +admin-settings-phase1pass: Input label, for phase 1 pass score, +admin-settings-phase2pass: Input label, for [hase 2 pass score, +admin-settings-weightonwiki: Input label, for weight of contributions to Wikimedia, +admin-settings-weightoffwiki: Input label, for weight of contributions other than Wikimedia, +admin-settings-weightinterest: Input label, for weight of Interest } \ No newline at end of file diff --git a/data/templates/admin/settings.html b/data/templates/admin/settings.html new file mode 100644 index 000..35b3b5e --- /dev/null +++ b/data/templates/admin/settings.html @@ -0,0 +1,68 @@ +{% extends admin/base.html %} + +{% set errors = flash.form_errors|default([]) %} +{% if flash.form_defaults|default(false) %} +{% set set = flash.form_defaults %} +{% endif %} + +{% block content %} +{% spaceless %} +ol class=breadcrumb + li{{ wgLang.message( 'nav-admin' ) }}/li + li{{ wgLang.message( 'nav-settings' ) }}/li +/ol + +form class=form-horizontal method=post action={{ urlFor( 'admin_settings_post' ) }} + input type=hidden name={{ csrf_param }} value={{ csrf_token }} / + div class=form-group +label for=phase1pass class=col-sm-2 control-label + {{ wgLang.message( 'admin-settings-phase1pass' ) }} +/label +div class=col-sm-5 + input type=text class=form-control id=phase1pass name=phase1pass value={{ set.phase1pass }} required=required +/div + /div + + div class=form-group +label for=phase2pass class=col-sm-2 control-label + {{ wgLang.message( 'admin-settings-phase2pass' ) }} +/label +div class=col-sm-5 + input type=text class=form-control name=phase2pass id=phase2pass value={{ set.phase2pass }} required=required +/div + /div + + div class=form-group +label for=weightonwiki class=col-sm-2 control-label + {{ wgLang.message( 'admin-settings-weightonwiki' ) }} +/label +div class=col-sm-5 + input type=text class=form-control name=weightonwiki id=weightonwiki value={{ set.weightonwiki }} required=required +/div + /div + + div class=form-group +label
[MediaWiki-commits] [Gerrit] Replace desktop watchstar icon with mobile skin one - change (mediawiki...Vector)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/178048 Change subject: Replace desktop watchstar icon with mobile skin one .. Replace desktop watchstar icon with mobile skin one Also, replaces the old animation with the same as in the mobile skin. Bug: T56307 Change-Id: Ida98e080dd26b0354884eee2af3269c6228e3a75 --- M components/watchstar.less D images/unwatch-icon-hl.png D images/unwatch-icon-hl.svg M images/unwatch-icon.png M images/unwatch-icon.svg D images/watch-icon-hl.png D images/watch-icon-hl.svg D images/watch-icon-loading.png D images/watch-icon-loading.svg M images/watch-icon.png M images/watch-icon.svg 11 files changed, 54 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector refs/changes/48/178048/1 diff --git a/components/watchstar.less b/components/watchstar.less index a389ed6..44dfbba 100644 --- a/components/watchstar.less +++ b/components/watchstar.less @@ -15,33 +15,26 @@ height: 0; overflow: hidden; background-position: 5px 60%; + + -webkit-transform-origin: 50% 57%; // Chrome 4-36, Safari 3.2+, Opera 15-23 + transform-origin: 50% 57%; + .transition(transform .5s); + /* Suppress the hilarious rotating focus outline on Firefox */ + outline: none; } #ca-unwatch.icon a { .background-image-svg('images/unwatch-icon.svg', 'images/unwatch-icon.png'); + .transform-rotate(72deg); } #ca-watch.icon a { .background-image-svg('images/watch-icon.svg', 'images/watch-icon.png'); } -#ca-unwatch.icon a:hover, -#ca-unwatch.icon a:focus { - .background-image-svg('images/unwatch-icon-hl.svg', 'images/unwatch-icon-hl.png'); -} -#ca-watch.icon a:hover, -#ca-watch.icon a:focus { - .background-image-svg('images/watch-icon-hl.svg', 'images/watch-icon-hl.png'); -} #ca-unwatch.icon a.loading, #ca-watch.icon a.loading { - .background-image-svg('images/watch-icon-loading.svg', 'images/watch-icon-loading.png'); - .rotation(700ms); - /* Suppress the hilarious rotating focus outline on Firefox */ - outline: none; cursor: default; pointer-events: none; - background-position: 50% 60%; - -webkit-transform-origin: 50% 57%; - transform-origin: 50% 57%; } + #ca-unwatch.icon a span, #ca-watch.icon a span { display: none; diff --git a/images/unwatch-icon-hl.png b/images/unwatch-icon-hl.png deleted file mode 100644 index 6b2b502..000 --- a/images/unwatch-icon-hl.png +++ /dev/null Binary files differ diff --git a/images/unwatch-icon-hl.svg b/images/unwatch-icon-hl.svg deleted file mode 100644 index d52d547..000 --- a/images/unwatch-icon-hl.svg +++ /dev/null @@ -1 +0,0 @@ -?xml version=1.0 encoding=UTF-8?svg xmlns=http://www.w3.org/2000/svg; xmlns:xlink=http://www.w3.org/1999/xlink; width=16 height=16defslinearGradient id=astop offset=0 stop-color=#c2edff/stop offset=.5 stop-color=#68bdff/stop offset=1 stop-color=#fff//linearGradientlinearGradient x1=13.47 y1=14.363 x2=4.596 y2=3.397 id=b xlink:href=#a gradientUnits=userSpaceOnUse//defspath d=M8.103 1.146l2.175 4.408 4.864.707-3.52 3.431.831 4.845-4.351-2.287-4.351 2.287.831-4.845-3.52-3.431 4.864-.707z fill=url(#b) stroke=#c8b250 stroke-width=0.1999//svg \ No newline at end of file diff --git a/images/unwatch-icon.png b/images/unwatch-icon.png index 9fd9436..ccade3e 100644 --- a/images/unwatch-icon.png +++ b/images/unwatch-icon.png Binary files differ diff --git a/images/unwatch-icon.svg b/images/unwatch-icon.svg index cde7bc5..0f4a348 100644 --- a/images/unwatch-icon.svg +++ b/images/unwatch-icon.svg @@ -1 +1,24 @@ -?xml version=1.0 encoding=UTF-8?svg xmlns=http://www.w3.org/2000/svg; xmlns:xlink=http://www.w3.org/1999/xlink; width=16 height=16defslinearGradient id=astop offset=0 stop-color=#c2edff/stop offset=.5 stop-color=#68bdff/stop offset=1 stop-color=#fff//linearGradientlinearGradient x1=13.47 y1=14.363 x2=4.596 y2=3.397 id=b xlink:href=#a gradientUnits=userSpaceOnUse//defspath d=M8.103 1.146l2.175 4.408 4.864.707-3.52 3.431.831 4.845-4.351-2.287-4.351 2.287.831-4.845-3.52-3.431 4.864-.707z fill=url(#b) stroke=#7cb5d1 stroke-width=0.1999//svg \ No newline at end of file +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + version=1.1 + width=16 + height=16 + viewBox=0 0 16 16 + id=Layer_1 + xml:space=preservemetadata + id=metadata11rdf:RDFcc:Work + rdf:about=dc:formatimage/svg+xml/dc:formatdc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage;
[MediaWiki-commits] [Gerrit] WIP document how to install and run - change (wikimedia...dash)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/178049 Change subject: WIP document how to install and run .. WIP document how to install and run Change-Id: I32cefe4f555e44793acbb8215a814a35696ea9db --- M README.md 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash refs/changes/49/178049/1 diff --git a/README.md b/README.md index 307485e..18fad3e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,18 @@ To use the live version with actual Fundraising data, you will need special permissions. Please contact ssm...@wikimedia.org. +Installation + + +To install and run the application in development mode, first ensure you do +not have anything already listening to port 8080. If so, stop it or change +the configured port in config.js. + ++ Be sure you have the submodules: git submodule update -i ++ nvm use 0.8.2 ++ node server.js --debug +FIXME: how to enable debug mode? I'm getting auth issues, tried -d... + Framework / Libraries = -- To view, visit https://gerrit.wikimedia.org/r/178049 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32cefe4f555e44793acbb8215a814a35696ea9db Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/dash Gerrit-Branch: master Gerrit-Owner: Awight awi...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update README from [[mw:README]] - change (mediawiki/core)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/178050 Change subject: Update README from [[mw:README]] .. Update README from [[mw:README]] Update README to version from https://www.mediawiki.org/w/index.php?title=READMEoldid=1305667 which was updated to include changes made in git through commit cbc3289. The bug tracker link change from 811b2e6 was deliberately omitted from the on wiki updates as bugzilla.wikimedia.org is now a redirect to phabricator.wikimedia.org in the same way that bugs.mediawiki.org is and advertising the particular bug tracking software used by the project in the README seems unnecessary. Change-Id: Ia73cc6c2b80e85c47a3023b7aef19a5b54aa47cf --- M README 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/50/178050/1 diff --git a/README b/README index 282ee6c..d2b9e71 100644 --- a/README +++ b/README @@ -1,14 +1,16 @@ == MediaWiki == -MediaWiki is a popular and free, open-source wiki software package written in -PHP. It serves as the platform for Wikipedia and the other projects of the Wikimedia -Foundation, which deliver content in over 280 languages to more than half a billion -people each month. MediaWiki's reliability and robust feature set have earned it a -large and vibrant community of third-party users and developers. +MediaWiki is a popular free and open-source wiki software package written in +PHP. It serves as the platform for Wikipedia and the other projects of the +Wikimedia Foundation, which deliver content in over 280 languages to more than +half a billion people each month. MediaWiki's reliability and robust feature +set have earned it a large and vibrant community of third-party users and +developers. MediaWiki is: -* feature-rich and extensible, both on-wiki and with over 2,000 extensions; +* feature-rich and extensible: both by users on-wiki, and by using the over + 3,000 extensions and 700 configuration settings; * scalable and suitable for both small and large sites; * available in your language; and * simple to install, working on most hardware/software combinations. @@ -23,7 +25,7 @@ * Seeking help from a person? ** https://www.mediawiki.org/wiki/Communication * Looking to file a bug report or a feature request? -** https://bugzilla.wikimedia.org/ +** https://bugs.mediawiki.org/ * Interested in helping out? ** https://www.mediawiki.org/wiki/How_to_contribute -- To view, visit https://gerrit.wikimedia.org/r/178050 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia73cc6c2b80e85c47a3023b7aef19a5b54aa47cf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: BryanDavis bda...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve argument validation in frame:expandTemplate() - change (mediawiki...Scribunto)
jenkins-bot has submitted this change and it was merged. Change subject: Improve argument validation in frame:expandTemplate() .. Improve argument validation in frame:expandTemplate() Just like the other methods, e shouldn't be allowing passing of things that aren't numbers or strings here. For that matter, we should just abstract out the whole arg key and value validation into a separate function instead of repeating it in four places. Bug: T76609 Change-Id: Id7e512a988ef9b7a5c5a110c8992dd5d649dcbf9 --- M engines/LuaCommon/lualib/mw.lua 1 file changed, 24 insertions(+), 38 deletions(-) Approvals: Jackmcbarn: Looks good to me, approved jenkins-bot: Verified diff --git a/engines/LuaCommon/lualib/mw.lua b/engines/LuaCommon/lualib/mw.lua index 06a670c..f6a2aee 100644 --- a/engines/LuaCommon/lualib/mw.lua +++ b/engines/LuaCommon/lualib/mw.lua @@ -231,6 +231,25 @@ return newFrame( unpack( parentFrameIds ) ) end + local function checkArgs( name, args ) + local ret = {} + for k, v in pairs( args ) do + local tp = type( k ) + if tp ~= 'string' and tp ~= 'number' then + error( name .. : arg keys must be strings or numbers, .. tp .. given, 3 ) + end + tp = type( v ) + if tp == 'boolean' then + ret[k] = v and '1' or '' + elseif tp == 'string' or tp == 'number' then + ret[k] = tostring( v ) + else + error( name .. : invalid type .. tp .. for arg ' .. k .. ', 3 ) + end + end + return ret + end + function frame:newChild( opt ) checkSelf( self, 'newChild' ) @@ -249,21 +268,7 @@ elseif type( opt.args ) ~= 'table' then error( frame:newChild: args must be a table, 2 ) else - args = {} - for k, v in pairs( opt.args ) do - local tp = type( k ) - if tp ~= 'string' and tp ~= 'number' then - error( frame:newChild: arg keys must be strings or numbers, .. tp .. given, 2 ) - end - local tp = type( v ) - if tp == 'boolean' then - args[k] = v and '1' or '' - elseif tp == 'string' or tp == 'number' then - args[k] = tostring( v ) - else - error( frame:newChild: invalid type .. tp .. for arg ' .. k .. ', 2 ) - end - end + args = checkArgs( 'frame:newChild', opt.args ) end local newFrameId = php.newChildFrame( frameId, title, args ) @@ -293,7 +298,7 @@ elseif type( opt.args ) ~= 'table' then error( frame:expandTemplate: args must be a table ) else - args = opt.args + args = checkArgs( 'frame:expandTemplate', opt.args ) end return php.expandTemplate( frameId, title, args ) @@ -319,16 +324,7 @@ error( frame:callParserFunction: function name must be a string or number, 2 ) end - for k, v in pairs( args ) do - if type( k ) ~= 'string' and type( k ) ~= 'number' then - error( frame:callParserFunction: arg keys must be strings or numbers, 2 ) - end - if type( v ) == 'number' then - args[k] = tostring( v ) - elseif type( v ) ~= 'string' then - error( frame:callParserFunction: args must be strings or numbers, 2 ) - end - end + args = checkArgs( 'frame:callParserFunction', args ) return php.callParserFunction( frameId, name, args ) end @@ -361,17 +357,7 @@ elseif type( args ) == 'string' or type( args ) == 'number' then args = { content, args } elseif type( args ) == 'table' then - local tmp = args - args = {} - for k, v in pairs( tmp ) do - if type( k ) ~= 'string' and type( k ) ~= 'number' then - error( frame:extensionTag: arg keys must be strings or numbers,
[MediaWiki-commits] [Gerrit] Preload missing langlinks and templates - change (pywikibot/core)
John Vandenberg has uploaded a new change for review. https://gerrit.wikimedia.org/r/178051 Change subject: Preload missing langlinks and templates .. Preload missing langlinks and templates Site.preloadpages/api.update_page currently doesnt cache that a page doesnt have langlinks or templates. Change-Id: Ia948745a8b8881cba112ae34bb31514623c65169 --- M pywikibot/data/api.py 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/51/178051/1 diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index cf8ce17..988ab8d 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1820,6 +1820,8 @@ page._templates.extend(templates) else: page._templates = templates +elif 'templates' in props: +page._templates = [] if langlinks in pagedict: links = [] @@ -1833,6 +1835,8 @@ page._langlinks.extend(links) else: page._langlinks = links +elif langlinks in props: +page._langlinks = [] if coordinates in pagedict: coords = [] -- To view, visit https://gerrit.wikimedia.org/r/178051 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia948745a8b8881cba112ae34bb31514623c65169 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: John Vandenberg jay...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Form class enhancements - change (wikimedia/wikimania-scholarships)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/178052 Change subject: Form class enhancements .. Form class enhancements * Add `require*` methods which make it easier to add required fields to a form. * Backport fix from IEG grant review for processing null inputs. Change-Id: I1e565c3e17d5bfe9448afb95172348701ac06d53 --- M src/Wikimania/Scholarship/Form.php M tests/Wikimania/Scholarship/FormTest.php 2 files changed, 73 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships refs/changes/52/178052/1 diff --git a/src/Wikimania/Scholarship/Form.php b/src/Wikimania/Scholarship/Form.php index be7fe86..2655681 100644 --- a/src/Wikimania/Scholarship/Form.php +++ b/src/Wikimania/Scholarship/Form.php @@ -26,7 +26,7 @@ * Collect and validate user input. * * @author Bryan Davis bd...@wikimedia.org - * @copyright © 2013 Bryan Davis and Wikimedia Foundation. + * @copyright © 2014 Bryan Davis, Wikimedia Foundation and contributors. */ class Form { @@ -97,6 +97,10 @@ return $this-expect( $name, \FILTER_VALIDATE_BOOLEAN, $options ); } + public function requireBool( $name, $options = null ) { + return $this-expectBool( $name, self::required( $options ) ); + } + public function expectTrue( $name, $options = null ) { $options = ( is_array( $options ) ) ? $options : array(); $options['validate'] = function ($v) { @@ -105,20 +109,40 @@ return $this-expectBool( $name, $options ); } + public function requireTrue( $name, $options = null ) { + return $this-expectTrue( $name, self::required( $options ) ); + } + public function expectEmail( $name, $options = null ) { return $this-expect( $name, \FILTER_VALIDATE_EMAIL, $options ); + } + + public function requireEmail( $name, $options = null ) { + return $this-expectEmail( $name, self::required( $options ) ); } public function expectFloat( $name, $options = null ) { return $this-expect( $name, \FILTER_VALIDATE_FLOAT, $options ); } + public function requireFloat( $name, $options = null ) { + return $this-expectFloat( $name, self::required( $options ) ); + } + public function expectInt( $name, $options = null ) { return $this-expect( $name, \FILTER_VALIDATE_INT, $options ); } + public function requireInt( $name, $options = null ) { + return $this-expectInt( $name, self::required( $options ) ); + } + public function expectIp( $name, $options = null ) { return $this-expect( $name, \FILTER_VALIDATE_IP, $options ); + } + + public function requireIp( $name, $options = null ) { + return $this-expectIp( $name, self::required( $options ) ); } public function expectRegex( $name, $re, $options = null ) { @@ -127,16 +151,32 @@ return $this-expect( $name, \FILTER_VALIDATE_REGEXP, $options ); } + public function requireRegex( $name, $re, $options = null ) { + return $this-expectRegex( $name, $re, self::required( $options ) ); + } + public function expectUrl( $name, $options = null ) { return $this-expect( $name, \FILTER_VALIDATE_URL, $options ); + } + + public function requireUrl( $name, $options = null ) { + return $this-expectUrl( $name, self::required( $options ) ); } public function expectString( $name, $options = null ) { return $this-expectRegex( $name, '/^.+$/s', $options ); } + public function requireString( $name, $options = null ) { + return $this-expectString( $name, self::required( $options ) ); + } + public function expectAnything( $name, $options = null ) { return $this-expect( $name, \FILTER_UNSAFE_RAW, $options ); + } + + public function requireAnything( $name, $options = null ) { + return $this-expectAnything( $name, self::required( $options ) ); } public function expectInArray( $name, $valids, $options = null ) { @@ -146,6 +186,12 @@ return ( !$required empty( $val ) ) || in_array( $val, $valids ); }; return $this-expectAnything( $name, $options ); + } + + public function requireInArray( $name, $valids, $options = null ) { + return $this-expectInArray( $name, $valids, + self::required( $options ) + ); } /** @@ -161,9 +207,15 @@ foreach ( $this-params as $name = $opt ) { $var = isset( $vars[$name] ) ?
[MediaWiki-commits] [Gerrit] Use Form::require* methods - change (wikimedia/wikimania-scholarships)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/178053 Change subject: Use Form::require* methods .. Use Form::require* methods Replace Form::expect*() calls using 'required' = true in the options array with the new Form::require* methods. Change-Id: Id8499610669fdea7e287f3cc9671448c527ddee5 --- M src/Wikimania/Scholarship/Controllers/Admin/Settings.php M src/Wikimania/Scholarship/Controllers/Admin/User.php M src/Wikimania/Scholarship/Controllers/Login.php M src/Wikimania/Scholarship/Controllers/Review/Application.php M src/Wikimania/Scholarship/Controllers/Review/Phase2List.php M src/Wikimania/Scholarship/Controllers/Review/PhaseGrid.php M src/Wikimania/Scholarship/Controllers/User/ChangePassword.php M src/Wikimania/Scholarship/Forms/Apply.php 8 files changed, 29 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships refs/changes/53/178053/1 diff --git a/src/Wikimania/Scholarship/Controllers/Admin/Settings.php b/src/Wikimania/Scholarship/Controllers/Admin/Settings.php index 78b686d..55e8f8c 100644 --- a/src/Wikimania/Scholarship/Controllers/Admin/Settings.php +++ b/src/Wikimania/Scholarship/Controllers/Admin/Settings.php @@ -41,15 +41,11 @@ protected function handlePost() { - $this-form-expectInt( 'phase1pass', array( 'required' = true ) ); - $this-form-expectInt( 'phase2pass', array( 'required' = true ) ); - $this-form-expectFloat( 'weightonwiki', array( 'required' = true ) ); - $this-form-expectFloat( 'weightoffwiki', array( - 'required' = true, - ) ); - $this-form-expectFloat( 'weightinterest', array( - 'required' = true, - ) ); + $this-form-requireInt( 'phase1pass' ); + $this-form-requireInt( 'phase2pass' ); + $this-form-requireFloat( 'weightonwiki' ); + $this-form-requireFloat( 'weightoffwiki' ); + $this-form-requireFloat( 'weightinterest' ); if ( $this-form-validate() ) { $settings = array( diff --git a/src/Wikimania/Scholarship/Controllers/Admin/User.php b/src/Wikimania/Scholarship/Controllers/Admin/User.php index 5fc94f3..d44ff9d 100644 --- a/src/Wikimania/Scholarship/Controllers/Admin/User.php +++ b/src/Wikimania/Scholarship/Controllers/Admin/User.php @@ -58,11 +58,11 @@ protected function handlePost() { $id = $this-request-post( 'id' ); - $this-form-expectString( 'username', array( 'required' = true ) ); + $this-form-requireString( 'username' ); $this-form-expectString( 'password', array( 'required' = ( $id == 'new' ) ) ); - $this-form-expectEmail( 'email', array( 'required' = true ) ); + $this-form-requireEmail( 'email' ); $this-form-expectBool( 'reviewer' ); $this-form-expectBool( 'isvalid' ); $this-form-expectBool( 'isadmin' ); diff --git a/src/Wikimania/Scholarship/Controllers/Login.php b/src/Wikimania/Scholarship/Controllers/Login.php index 7e338e2..bfc8f62 100644 --- a/src/Wikimania/Scholarship/Controllers/Login.php +++ b/src/Wikimania/Scholarship/Controllers/Login.php @@ -48,8 +48,8 @@ $next = $this-urlFor( 'review_home' ); } - $this-form-expectString( 'username', array( 'required' = true ) ); - $this-form-expectString( 'password', array( 'required' = true ) ); + $this-form-requireString( 'username' ); + $this-form-requireString( 'password' ); if ( $this-form-validate() ) { $authed = $this-authManager-authenticate( diff --git a/src/Wikimania/Scholarship/Controllers/Review/Application.php b/src/Wikimania/Scholarship/Controllers/Review/Application.php index cd5fdc8..8822b92 100644 --- a/src/Wikimania/Scholarship/Controllers/Review/Application.php +++ b/src/Wikimania/Scholarship/Controllers/Review/Application.php @@ -76,7 +76,7 @@ $criteria = array( 'valid', 'onwiki', 'offwiki', 'interest' ); $this-form-expectInt( 'phase', array( 'min_range' = 0, 'max_range' = 2, 'default' = 2 ) ); - $this-form-expectInt( 'id', array( 'min_range' = 0, 'required' = true ) ); + $this-form-requireInt( 'id', array( 'min_range' = 0 ) ); $this-form-expectString( 'notes' ); foreach ( $criteria as $c) { $this-form-expectInt( $c, array( 'min_range' = 0 ) ); diff --git a/src/Wikimania/Scholarship/Controllers/Review/Phase2List.php b/src/Wikimania/Scholarship/Controllers/Review/Phase2List.php index 3b1be27..cc0ae45 100644 ---
[MediaWiki-commits] [Gerrit] Updated doc in template wrapping + DRYed out a regexp from t... - change (mediawiki...parsoid)
Subramanya Sastry has uploaded a new change for review. https://gerrit.wikimedia.org/r/178054 Change subject: Updated doc in template wrapping + DRYed out a regexp from the code .. Updated doc in template wrapping + DRYed out a regexp from the code Change-Id: I872689ee800272ac5fda925f5211f1c68a7f94b6 --- M lib/dom.wrapTemplates.js M lib/mediawiki.DOMUtils.js 2 files changed, 23 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/54/178054/1 diff --git a/lib/dom.wrapTemplates.js b/lib/dom.wrapTemplates.js index 9ed09cc..e2a93bc 100644 --- a/lib/dom.wrapTemplates.js +++ b/lib/dom.wrapTemplates.js @@ -5,14 +5,28 @@ * *Locate start and end metas. Walk upwards towards the root from both and *find a common ancestor A. The subtree rooted at A is now effectively the - *scope of the dom template ouput ... with some caveats. + *scope of the dom template ouput. * * 2. findTopLevelNonOverlappingRanges * *Mark all nodes in a range and walk up to root from each range start to - *determine nesting. + *determine overlaps, nesting. Merge overlapping and nested ranges to find + *the subset of top-level non-overlapping ranges which will be wrapped as + *individual units. * * 3. encapsulateTemplates + * + *For each non-overlapping range, + *- compute a data-mw according to the DOM spec + *- replace the start / end meta markers with transclusion type and data-mw + * on the first DOM node + *- add about ids on all top-level nodes of the range + * + * This is a simple high-level overview of the 3 steps to help understand this + * code. + * + * FIXME: At some point, more of the details should be extracted and documented + * in pseudo-code as an algorithm. */ use strict; @@ -592,7 +606,7 @@ dp: null }; - // Skip template-marker meta-tags + // Skip template-marker meta-tags. // Also, skip past comments/text nodes found in fosterable positions // which wouldn't have been span-wrapped in the while-loop above. while (DU.isTplMarkerMeta(encapInfo.target) || !DU.isElt(encapInfo.target)) { @@ -802,9 +816,7 @@ if ( DU.isElt(elem) ) { var type = elem.getAttribute( 'typeof' ), - // FIXME: This regexp is repeated in DOMUtils.isTplMetaType - // DRY it out, if possible. - metaMatch = type ? type.match( /(?:^|\s)(mw:(?:Transclusion|Param)(\/[^\s]+)?)(?=$|\s)/ ) : null; + metaMatch = type ? type.match(DU.TPL_META_TYPE_REGEXP) : null; // Ignore templates without tsr. // diff --git a/lib/mediawiki.DOMUtils.js b/lib/mediawiki.DOMUtils.js index 379515a..fe3bcd4 100644 --- a/lib/mediawiki.DOMUtils.js +++ b/lib/mediawiki.DOMUtils.js @@ -563,13 +563,17 @@ return this.isNodeOfType(n, meta, type); }, + // FIXME: What is the convention we should use for constants like this? + // Or, is there one for node.js already? + TPL_META_TYPE_REGEXP: /(?:^|\s)(mw:(?:Transclusion|Param)(\/[^\s]+)?)(?=$|\s)/, + /** * Check whether a meta's typeof indicates that it is a template expansion. * * @param {string} nType */ isTplMetaType: function(nType) { - return (/(?:^|\s)(mw:(?:Transclusion|Param)(\/[^\s]+)?)(?=$|\s)/).test(nType); + return this.TPL_META_TYPE_REGEXP.test(nType); }, /** -- To view, visit https://gerrit.wikimedia.org/r/178054 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I872689ee800272ac5fda925f5211f1c68a7f94b6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry ssas...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits