[MediaWiki-commits] [Gerrit] i18n: consistency tweaks - change (mediawiki...MobileFrontend)
Shirayuki has uploaded a new change for review. https://gerrit.wikimedia.org/r/103643 Change subject: i18n: consistency tweaks .. i18n: consistency tweaks * remove full-stops * add GENDER support Spotted by Siebrand * https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Mobile-frontend-history-no-results/en * https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Mobile-frontend-profile-usertalk/en Spotted by Ebraminio * https://translatewiki.net/wiki/Thread:Support/MediaWiki:Mobile-frontend-last-modified-with-user-minutes/en Change-Id: I27767f015c83996765ca5381cee56e76e7e73fcc --- M MobileFrontend.i18n.php 1 file changed, 6 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/43/103643/1 diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php index 7db4b5e..583ff23 100644 --- a/MobileFrontend.i18n.php +++ b/MobileFrontend.i18n.php @@ -89,7 +89,7 @@ 'mobile-frontend-history' = 'View edit history of this page.', 'mobile-frontend-history-404-title' = 'No such page', 'mobile-frontend-history-404-desc' = Cannot look at history for a page that doesn't exist. It may have been deleted or you may have followed a bad link., - 'mobile-frontend-history-no-results' = 'No history matches the filter provided.', + 'mobile-frontend-history-no-results' = 'The filter provided no history matches.', 'mobile-frontend-contribution-summary' = 'All edits made by {{GENDER:$1|[[Special:UserProfile/$1|$1]]}}', 'mobile-frontend-history-summary' = 'Page history for [[:$1]]', 'mobile-frontend-last-modified-date' = 'Last modified on $1, at $2', @@ -101,12 +101,12 @@ 'mobile-frontend-last-modified-years' = 'Last modified {{PLURAL:$1|$1 year|$1 years}} ago', 'mobile-frontend-last-modified-just-now' = 'Last modified just now', 'mobile-frontend-last-modified-with-user-seconds' = '[$4 Last {{GENDER:$1|edited}} {{PLURAL:$3|$3 second|$3 seconds}} ago] by {{PLURAL:$5|[$6 $2]|0=an anonymous user}}', - 'mobile-frontend-last-modified-with-user-minutes' = '[$4 Last {{GENDER:$1|edited}} {{PLURAL:$3|$3 minute|$3 minutes}} ago] by {{PLURAL:$5|[$6 $2]|0=an anonymous user}}.', + 'mobile-frontend-last-modified-with-user-minutes' = '[$4 Last {{GENDER:$1|edited}} {{PLURAL:$3|$3 minute|$3 minutes}} ago] by {{PLURAL:$5|[$6 $2]|0=an anonymous user}}', 'mobile-frontend-last-modified-with-user-hours' = '[$4 Last {{GENDER:$1|edited}} {{PLURAL:$3|$3 hour|$3 hours}} ago] by {{PLURAL:$5|[$6 $2]|0=an anonymous user}}', 'mobile-frontend-last-modified-with-user-days' = '[$4 Last {{GENDER:$1|edited}} {{PLURAL:$3|$3 day|$3 days}} ago] by {{PLURAL:$5|[$6 $2]|0=an anonymous user}}', 'mobile-frontend-last-modified-with-user-months' = '[$4 Last {{GENDER:$1|edited}} {{PLURAL:$3|$3 month|$3 months}} ago] by {{PLURAL:$5|[$6 $2]|0=an anonymous user}}', 'mobile-frontend-last-modified-with-user-years' = '[$4 Last {{GENDER:$1|edited}} {{PLURAL:$3|$3 year|$3 years}} ago] by {{PLURAL:$5|[$6 $2]|0=an anonymous user}}', - 'mobile-frontend-last-modified-with-user-just-now' = '[$3 Last {{GENDER:$1|edited}}] just now by {{PLURAL:$4|[$5 $2]|0=an anonymous user}}.', + 'mobile-frontend-last-modified-with-user-just-now' = '[$3 Last {{GENDER:$1|edited}}] just now by {{PLURAL:$4|[$5 $2]|0=an anonymous user}}', 'mobile-frontend-learn-more' = 'Learn more', 'mobile-frontend-view-source' = 'View source', // account creation @@ -374,7 +374,7 @@ // Special:UserProfile 'mobile-frontend-profile-title' = 'User profile', 'mobile-frontend-profile-last-upload-caption' = '{{GENDER:$2|Uploaded}} {{PLURAL:$1|yesterday|$1 days ago|0=today}}.', - 'mobile-frontend-profile-usertalk' = 'Talk to $1', + 'mobile-frontend-profile-usertalk' = 'Talk to {{GENDER:$1|$1}}', 'mobile-frontend-profile-error' = Oh no!, 'mobile-frontend-profile-noargs' = 'No username was given. Please provide a username to view a profile.', 'mobile-frontend-profile-nouser' = 'No user with this name exists. Usernames are case sensitive so please check if it has been typed correctly.', @@ -1040,10 +1040,8 @@ Parameters: * $1 - the amount of days ago the image was uploaded * $2 - the user name for GENDER', - 'mobile-frontend-profile-usertalk' = 'Link label to user talk page. - -Parameters: -* $1 - username of user who talk page belongs to + 'mobile-frontend-profile-usertalk' = 'Link label to user talk page. Parameters: +* $1 - username of user who talk page belongs to. Can be used for GENDER. * $2 - the gender of that user', 'mobile-frontend-profile-error' = 'Heading for errors on the profile page.', 'mobile-frontend-profile-noargs' = 'Message shown when no user profile URL is
[MediaWiki-commits] [Gerrit] Buffer png writes and flush them all at once - change (mediawiki...Math)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/103644 Change subject: Buffer png writes and flush them all at once .. Buffer png writes and flush them all at once * This should half the time to render pages with many formulas bug: 56769 Change-Id: I5edf979c31fe12098eba1d1df52c9cd3251bd115 --- M .gitignore M MathTexvc.php 2 files changed, 18 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math refs/changes/44/103644/1 diff --git a/.gitignore b/.gitignore index 3417dd2..f91b1cb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *~ *.kate-swp .*.swp +/nbproject/private/ \ No newline at end of file diff --git a/MathTexvc.php b/MathTexvc.php index 78bd39f..6f83a98 100644 --- a/MathTexvc.php +++ b/MathTexvc.php @@ -126,7 +126,7 @@ * @return int|string MW_TEXVC_SUCCESS or error string */ public function callTexvc() { - global $wgTexvc, $wgTexvcBackgroundColor, $wgUseSquid, $wgMathCheckFiles; + global $wgTexvc, $wgTexvcBackgroundColor, $wgUseSquid, $wgMathCheckFiles, $wgHooks; wfProfileIn( __METHOD__ ); $tmpDir = wfTempDir(); @@ -237,13 +237,23 @@ return $this-getError( 'math_output_error' ); } // Store the file at the final storage path... - if ( !$backend-quickStore( array( - 'src' = $tmpDir/{$this-getHash()}.png, 'dst' = $hashpath/{$this-getHash()}.png - ) )-isOK() - ) { - wfProfileOut( __METHOD__ ); - return $this-getError( 'math_output_error' ); + // Bug 56769: buffer the writes and do them at the end. + if ( !isset( $wgHooks['ParserAfterParse']['FlushMathBackend'] ) ) { + $backend-mathBufferedWrites = array(); + $wgHooks['ParserAfterParse']['FlushMathBackend'] = function() use ( $backend ) { + global $wgHooks; + unset( $wgHooks['ParserAfterParse']['FlushMathBackend'] ); + $backend-doQuickOperations( $backend-mathBufferedWrites ); + unset( $backend-mathBufferedWrites ); + }; } + $backend-mathBufferedWrites[] = array( + 'op' = 'store', + 'src' = $tmpDir/{$this-getHash()}.png, + 'dst' = $hashpath/{$this-getHash()}.png, + 'ref' = $tempFsFile // keep file alive + ); + wfProfileOut( __METHOD__ ); return self::MW_TEXVC_SUCCESS; } -- To view, visit https://gerrit.wikimedia.org/r/103644 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5edf979c31fe12098eba1d1df52c9cd3251bd115 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: Aaron Schulz asch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed undefined mwVerNum variable - change (operations/puppet)
Ori.livneh has submitted this change and it was merged. Change subject: Fixed undefined mwVerNum variable .. Fixed undefined mwVerNum variable Change-Id: If00bacd89eef6c0950d9396a3b0a0ebd13bb9ec0 --- M files/scap/mw-update-l10n M files/scap/scap-2 2 files changed, 9 insertions(+), 4 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/files/scap/mw-update-l10n b/files/scap/mw-update-l10n index 7a62e89..2497548 100755 --- a/files/scap/mw-update-l10n +++ b/files/scap/mw-update-l10n @@ -77,7 +77,7 @@ || die # Include JSON versions of the CDB files and add MD5 files - sudo -u l10nupdate /usr/local/bin/refreshCdbJsonFiles --directory=$MW_COMMON_SOURCE/php-$mwVerNum/cache/l10n \ + sudo -u l10nupdate $BINDIR/refreshCdbJsonFiles --directory=$MW_COMMON_SOURCE/php-$mwVerNum/cache/l10n \ --threads=$THREADS \ || die diff --git a/files/scap/scap-2 b/files/scap/scap-2 index 69135ea..43cfe2b 100755 --- a/files/scap/scap-2 +++ b/files/scap/scap-2 @@ -1,5 +1,6 @@ #!/bin/bash +BINDIR=/usr/local/bin PATH=/bin:/usr/bin:/sbin:/usr/sbin: TERM=dumb @@ -23,7 +24,11 @@ CPUS=`grep -c 'model name' /proc/cpuinfo` THREADS=`expr $CPUS / 2` +mwVersions=$($BINDIR/mwversionsinuse) # Rebuild the CDB files from the JSON versions -/usr/local/bin/mergeCdbFileUpdates --directory=$MW_COMMON/php-$mwVerNum/cache/l10n \ - --threads=$THREADS \ - || die +# Regenerate the extension message file list for all active MediaWiki versions +for mwVerNum in ${mwVersions[@]}; do + $BINDIR/mergeCdbFileUpdates --directory=$MW_COMMON/php-$mwVerNum/cache/l10n \ + --threads=$THREADS \ + || die +done \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/103636 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If00bacd89eef6c0950d9396a3b0a0ebd13bb9ec0 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Ori.livneh o...@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] Make links to valid Help pages blue links - change (mediawiki...HelpPages)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/103648 Change subject: Make links to valid Help pages blue links .. Make links to valid Help pages blue links Change-Id: I6dda6293c7734d5db08ca65560f949c05523cfe7 --- M HelpPages.hooks.php M HelpPages.php 2 files changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HelpPages refs/changes/48/103648/1 diff --git a/HelpPages.hooks.php b/HelpPages.hooks.php index 1b9701e..414ff28 100644 --- a/HelpPages.hooks.php +++ b/HelpPages.hooks.php @@ -58,6 +58,18 @@ */ public static function onArticlePurge( $article ) { HelpPages::purgeCache( $article-getTitle() ); + + return true; + } + + /** +* If the page exists, make blue links +*/ + public static function onLinkBegin( $dummy, Title $target, $html, $customAttribs, $query, $options, $ret ) { + if ( $target-getNamespace() === NS_HELP HelpPages::helpPageExists( $target ) ) { + $options = array( 'known' ); + } + return true; } } diff --git a/HelpPages.php b/HelpPages.php index 0d223a1..63794bd 100644 --- a/HelpPages.php +++ b/HelpPages.php @@ -29,7 +29,7 @@ 'author' = 'Kunal Mehta', 'url' = 'https://www.mediawiki.org/wiki/Extension:HelpPages', 'descriptionmsg' = 'helppages-desc', - 'version' = '0.1', + 'version' = '0.2', ); $dir = dirname(__FILE__); @@ -42,6 +42,7 @@ $wgHooks['ShowMissingArticle'][] = 'HelpPagesHooks::onShowMissingArticle'; $wgHooks['SkinTemplateNavigation::Universal'][] = 'HelpPagesHooks::onSkinTemplateNavigationUniversal'; $wgHooks['ArticlePurge'][] = 'HelpPagesHooks::onArticlePurge'; +$wgHooks['LinkBegin'][] = 'HelpPagesHooks::onLinkBegin'; $wgResourceModules['ext.HelpPages'] = array( 'styles' = 'ext.HelpPages.css', -- To view, visit https://gerrit.wikimedia.org/r/103648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6dda6293c7734d5db08ca65560f949c05523cfe7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HelpPages Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix ArticlePurge hook - change (mediawiki...HelpPages)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/103645 Change subject: Fix ArticlePurge hook .. Fix ArticlePurge hook * Actually register the hook * Hook will provide a WikiPage object, not an article * Introduce HelpPages::purgeCache which actually clears the cache Change-Id: If109114eb0ed1efa543452be09bea36f8501af43 --- M HelpPages.body.php M HelpPages.hooks.php M HelpPages.php 3 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HelpPages refs/changes/45/103645/1 diff --git a/HelpPages.body.php b/HelpPages.body.php index aac3ef6..6c41876 100644 --- a/HelpPages.body.php +++ b/HelpPages.body.php @@ -31,6 +31,14 @@ } /** +* @param Title $title +*/ + public static function purgeCache( Title $title ) { + global $wgMemc; + $wgMemc-delete( self::getCacheKey( $title-getPrefixedText() ) ); + } + + /** * Use action=parse to get rendered HTML of a page * @param $title string * @return array diff --git a/HelpPages.hooks.php b/HelpPages.hooks.php index 69d6138..29f2364 100644 --- a/HelpPages.hooks.php +++ b/HelpPages.hooks.php @@ -55,17 +55,13 @@ return true; } - /** * Use action=purge to clear cache -* @param $article Article +* @param WikiPage $article * @return bool */ public static function onArticlePurge( $article ) { - global $wgMemc; - $title = $article-getContext()-getTitle(); - $key = HelpPages::getCacheKey( $title ); - $wgMemc-delete( $key ); + HelpPages::purgeCache( $article-getTitle() ); return true; } } diff --git a/HelpPages.php b/HelpPages.php index 443014c..0d223a1 100644 --- a/HelpPages.php +++ b/HelpPages.php @@ -41,6 +41,7 @@ $wgHooks['ShowMissingArticle'][] = 'HelpPagesHooks::onShowMissingArticle'; $wgHooks['SkinTemplateNavigation::Universal'][] = 'HelpPagesHooks::onSkinTemplateNavigationUniversal'; +$wgHooks['ArticlePurge'][] = 'HelpPagesHooks::onArticlePurge'; $wgResourceModules['ext.HelpPages'] = array( 'styles' = 'ext.HelpPages.css', -- To view, visit https://gerrit.wikimedia.org/r/103645 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If109114eb0ed1efa543452be09bea36f8501af43 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HelpPages Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add HelpPages::helpPageExists for simple existence checks - change (mediawiki...HelpPages)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/103647 Change subject: Add HelpPages::helpPageExists for simple existence checks .. Add HelpPages::helpPageExists for simple existence checks Change-Id: Ic6649f5ac4831087694bf9c88fa498119fbdada0 --- M HelpPages.body.php M HelpPages.hooks.php 2 files changed, 22 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HelpPages refs/changes/47/103647/1 diff --git a/HelpPages.body.php b/HelpPages.body.php index 7dbb006..e023a35 100644 --- a/HelpPages.body.php +++ b/HelpPages.body.php @@ -100,4 +100,9 @@ return false; } -} \ No newline at end of file + public static function helpPageExists( Title $title ) { + list( $text, /* $oldid */ ) = self::getPagePlusFallbacks( 'Help:' . $title-getText() ); + return (bool)$text; + } + +} diff --git a/HelpPages.hooks.php b/HelpPages.hooks.php index 29f2364..1b9701e 100644 --- a/HelpPages.hooks.php +++ b/HelpPages.hooks.php @@ -28,29 +28,25 @@ * @return bool */ public static function onSkinTemplateNavigationUniversal( $sktemplate, $links ) { - //var_dump($links); $context = $sktemplate-getContext(); $title = $sktemplate-getTitle(); - //var_dump($links); - if ( $title-getNamespace() == NS_HELP ) { - list ( $text, $oldid ) = HelpPages::getPagePlusFallbacks( 'Help:' . $title-getText() ); - if ( $text ) { - $links['namespaces']['help']['class'] = 'selected'; - $links['namespaces']['help_talk']['class'] = ''; - $links['namespaces']['help_talk']['href'] = '//www.mediawiki.org/wiki/Help talk:' . $title-getText(); - $links['views'] = array(); // Kill the 'Create' button @todo make this suck less - $links['views'][] = array( - 'class' = false, - 'text' = $context-msg( 'helppages-edit-tab' ), - 'href' = wfAppendQuery( - '//www.mediawiki.org/w/index.php', - array( - 'action' = 'edit', - 'title' = $title-getPrefixedText() - ) + + if ( $title-getNamespace() == NS_HELP HelpPages::helpPageExists( $title ) ) { + $links['namespaces']['help']['class'] = 'selected'; + $links['namespaces']['help_talk']['class'] = ''; + $links['namespaces']['help_talk']['href'] = '//www.mediawiki.org/wiki/Help talk:' . $title-getText(); + $links['views'] = array(); // Kill the 'Create' button @todo make this suck less + $links['views'][] = array( + 'class' = false, + 'text' = $context-msg( 'helppages-edit-tab' ), + 'href' = wfAppendQuery( + '//www.mediawiki.org/w/index.php', + array( + 'action' = 'edit', + 'title' = $title-getPrefixedText() ) - ); - } + ) + ); } return true; } -- To view, visit https://gerrit.wikimedia.org/r/103647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic6649f5ac4831087694bf9c88fa498119fbdada0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HelpPages Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set visibility on some stuff - change (mediawiki...HelpPages)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/103646 Change subject: Set visibility on some stuff .. Set visibility on some stuff Change-Id: I708cb635022471ba057f0b5f735c397152fa37fb --- M HelpPages.body.php 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HelpPages refs/changes/46/103646/1 diff --git a/HelpPages.body.php b/HelpPages.body.php index 6c41876..7dbb006 100644 --- a/HelpPages.body.php +++ b/HelpPages.body.php @@ -9,7 +9,7 @@ * @param $params array * @return array */ - public static function makeAPIRequest( $params ) { + protected static function makeAPIRequest( $params ) { $params['format'] = 'json'; $url = wfAppendQuery( self::$apiurl, $params ); $req = MWHttpRequest::factory( $url ); @@ -22,10 +22,10 @@ /** * Get the cache key for a certain title * -* @param Title|string $title +* @param string $title * @return string */ - public static function getCacheKey( $title ) { + protected static function getCacheKey( $title ) { global $wgLanguageCode; return wfMemcKey( 'helppages', $wgLanguageCode, md5( $title ), 'v2' ); } @@ -43,7 +43,7 @@ * @param $title string * @return array */ - public static function parseWikiText( $title ) { + protected static function parseWikiText( $title ) { $params = array( 'action' = 'parse', 'page' = $title -- To view, visit https://gerrit.wikimedia.org/r/103646 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I708cb635022471ba057f0b5f735c397152fa37fb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HelpPages Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make links to valid Help pages blue links - change (mediawiki...HelpPages)
Legoktm has submitted this change and it was merged. Change subject: Make links to valid Help pages blue links .. Make links to valid Help pages blue links Change-Id: I6dda6293c7734d5db08ca65560f949c05523cfe7 --- M HelpPages.hooks.php M HelpPages.php 2 files changed, 14 insertions(+), 1 deletion(-) Approvals: Legoktm: Verified; Looks good to me, approved diff --git a/HelpPages.hooks.php b/HelpPages.hooks.php index 1b9701e..414ff28 100644 --- a/HelpPages.hooks.php +++ b/HelpPages.hooks.php @@ -58,6 +58,18 @@ */ public static function onArticlePurge( $article ) { HelpPages::purgeCache( $article-getTitle() ); + + return true; + } + + /** +* If the page exists, make blue links +*/ + public static function onLinkBegin( $dummy, Title $target, $html, $customAttribs, $query, $options, $ret ) { + if ( $target-getNamespace() === NS_HELP HelpPages::helpPageExists( $target ) ) { + $options = array( 'known' ); + } + return true; } } diff --git a/HelpPages.php b/HelpPages.php index 0d223a1..63794bd 100644 --- a/HelpPages.php +++ b/HelpPages.php @@ -29,7 +29,7 @@ 'author' = 'Kunal Mehta', 'url' = 'https://www.mediawiki.org/wiki/Extension:HelpPages', 'descriptionmsg' = 'helppages-desc', - 'version' = '0.1', + 'version' = '0.2', ); $dir = dirname(__FILE__); @@ -42,6 +42,7 @@ $wgHooks['ShowMissingArticle'][] = 'HelpPagesHooks::onShowMissingArticle'; $wgHooks['SkinTemplateNavigation::Universal'][] = 'HelpPagesHooks::onSkinTemplateNavigationUniversal'; $wgHooks['ArticlePurge'][] = 'HelpPagesHooks::onArticlePurge'; +$wgHooks['LinkBegin'][] = 'HelpPagesHooks::onLinkBegin'; $wgResourceModules['ext.HelpPages'] = array( 'styles' = 'ext.HelpPages.css', -- To view, visit https://gerrit.wikimedia.org/r/103648 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6dda6293c7734d5db08ca65560f949c05523cfe7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HelpPages Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set visibility on some stuff - change (mediawiki...HelpPages)
Legoktm has submitted this change and it was merged. Change subject: Set visibility on some stuff .. Set visibility on some stuff Change-Id: I708cb635022471ba057f0b5f735c397152fa37fb --- M HelpPages.body.php 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Legoktm: Verified; Looks good to me, approved diff --git a/HelpPages.body.php b/HelpPages.body.php index 6c41876..7dbb006 100644 --- a/HelpPages.body.php +++ b/HelpPages.body.php @@ -9,7 +9,7 @@ * @param $params array * @return array */ - public static function makeAPIRequest( $params ) { + protected static function makeAPIRequest( $params ) { $params['format'] = 'json'; $url = wfAppendQuery( self::$apiurl, $params ); $req = MWHttpRequest::factory( $url ); @@ -22,10 +22,10 @@ /** * Get the cache key for a certain title * -* @param Title|string $title +* @param string $title * @return string */ - public static function getCacheKey( $title ) { + protected static function getCacheKey( $title ) { global $wgLanguageCode; return wfMemcKey( 'helppages', $wgLanguageCode, md5( $title ), 'v2' ); } @@ -43,7 +43,7 @@ * @param $title string * @return array */ - public static function parseWikiText( $title ) { + protected static function parseWikiText( $title ) { $params = array( 'action' = 'parse', 'page' = $title -- To view, visit https://gerrit.wikimedia.org/r/103646 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I708cb635022471ba057f0b5f735c397152fa37fb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HelpPages Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix ArticlePurge hook - change (mediawiki...HelpPages)
Legoktm has submitted this change and it was merged. Change subject: Fix ArticlePurge hook .. Fix ArticlePurge hook * Actually register the hook * Hook will provide a WikiPage object, not an article * Introduce HelpPages::purgeCache which actually clears the cache Change-Id: If109114eb0ed1efa543452be09bea36f8501af43 --- M HelpPages.body.php M HelpPages.hooks.php M HelpPages.php 3 files changed, 11 insertions(+), 6 deletions(-) Approvals: Legoktm: Verified; Looks good to me, approved diff --git a/HelpPages.body.php b/HelpPages.body.php index aac3ef6..6c41876 100644 --- a/HelpPages.body.php +++ b/HelpPages.body.php @@ -31,6 +31,14 @@ } /** +* @param Title $title +*/ + public static function purgeCache( Title $title ) { + global $wgMemc; + $wgMemc-delete( self::getCacheKey( $title-getPrefixedText() ) ); + } + + /** * Use action=parse to get rendered HTML of a page * @param $title string * @return array diff --git a/HelpPages.hooks.php b/HelpPages.hooks.php index 69d6138..29f2364 100644 --- a/HelpPages.hooks.php +++ b/HelpPages.hooks.php @@ -55,17 +55,13 @@ return true; } - /** * Use action=purge to clear cache -* @param $article Article +* @param WikiPage $article * @return bool */ public static function onArticlePurge( $article ) { - global $wgMemc; - $title = $article-getContext()-getTitle(); - $key = HelpPages::getCacheKey( $title ); - $wgMemc-delete( $key ); + HelpPages::purgeCache( $article-getTitle() ); return true; } } diff --git a/HelpPages.php b/HelpPages.php index 443014c..0d223a1 100644 --- a/HelpPages.php +++ b/HelpPages.php @@ -41,6 +41,7 @@ $wgHooks['ShowMissingArticle'][] = 'HelpPagesHooks::onShowMissingArticle'; $wgHooks['SkinTemplateNavigation::Universal'][] = 'HelpPagesHooks::onSkinTemplateNavigationUniversal'; +$wgHooks['ArticlePurge'][] = 'HelpPagesHooks::onArticlePurge'; $wgResourceModules['ext.HelpPages'] = array( 'styles' = 'ext.HelpPages.css', -- To view, visit https://gerrit.wikimedia.org/r/103645 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If109114eb0ed1efa543452be09bea36f8501af43 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HelpPages Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add HelpPages::helpPageExists for simple existence checks - change (mediawiki...HelpPages)
Legoktm has submitted this change and it was merged. Change subject: Add HelpPages::helpPageExists for simple existence checks .. Add HelpPages::helpPageExists for simple existence checks Change-Id: Ic6649f5ac4831087694bf9c88fa498119fbdada0 --- M HelpPages.body.php M HelpPages.hooks.php 2 files changed, 22 insertions(+), 21 deletions(-) Approvals: Legoktm: Verified; Looks good to me, approved diff --git a/HelpPages.body.php b/HelpPages.body.php index 7dbb006..e023a35 100644 --- a/HelpPages.body.php +++ b/HelpPages.body.php @@ -100,4 +100,9 @@ return false; } -} \ No newline at end of file + public static function helpPageExists( Title $title ) { + list( $text, /* $oldid */ ) = self::getPagePlusFallbacks( 'Help:' . $title-getText() ); + return (bool)$text; + } + +} diff --git a/HelpPages.hooks.php b/HelpPages.hooks.php index 29f2364..1b9701e 100644 --- a/HelpPages.hooks.php +++ b/HelpPages.hooks.php @@ -28,29 +28,25 @@ * @return bool */ public static function onSkinTemplateNavigationUniversal( $sktemplate, $links ) { - //var_dump($links); $context = $sktemplate-getContext(); $title = $sktemplate-getTitle(); - //var_dump($links); - if ( $title-getNamespace() == NS_HELP ) { - list ( $text, $oldid ) = HelpPages::getPagePlusFallbacks( 'Help:' . $title-getText() ); - if ( $text ) { - $links['namespaces']['help']['class'] = 'selected'; - $links['namespaces']['help_talk']['class'] = ''; - $links['namespaces']['help_talk']['href'] = '//www.mediawiki.org/wiki/Help talk:' . $title-getText(); - $links['views'] = array(); // Kill the 'Create' button @todo make this suck less - $links['views'][] = array( - 'class' = false, - 'text' = $context-msg( 'helppages-edit-tab' ), - 'href' = wfAppendQuery( - '//www.mediawiki.org/w/index.php', - array( - 'action' = 'edit', - 'title' = $title-getPrefixedText() - ) + + if ( $title-getNamespace() == NS_HELP HelpPages::helpPageExists( $title ) ) { + $links['namespaces']['help']['class'] = 'selected'; + $links['namespaces']['help_talk']['class'] = ''; + $links['namespaces']['help_talk']['href'] = '//www.mediawiki.org/wiki/Help talk:' . $title-getText(); + $links['views'] = array(); // Kill the 'Create' button @todo make this suck less + $links['views'][] = array( + 'class' = false, + 'text' = $context-msg( 'helppages-edit-tab' ), + 'href' = wfAppendQuery( + '//www.mediawiki.org/w/index.php', + array( + 'action' = 'edit', + 'title' = $title-getPrefixedText() ) - ); - } + ) + ); } return true; } -- To view, visit https://gerrit.wikimedia.org/r/103647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic6649f5ac4831087694bf9c88fa498119fbdada0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HelpPages Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] allow empty translations - change (pywikibot/compat)
jenkins-bot has submitted this change and it was merged. Change subject: allow empty translations .. allow empty translations Sync with core (from patch change 103540) Change-Id: I829e0de992300f6938764f9b571eb2a119f57dea --- M pywikibot/i18n.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 93b2518..8ae944c 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -283,7 +283,7 @@ else: trans = xdict.values()[0] code = xdict.keys()[0] -if not trans: +if trans is None: return # return None if we have no translation found if parameters is None: return trans -- To view, visit https://gerrit.wikimedia.org/r/103614 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I829e0de992300f6938764f9b571eb2a119f57dea Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: 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] i18n: consistency tweaks - change (mediawiki...GettingStarted)
jenkins-bot has submitted this change and it was merged. Change subject: i18n: consistency tweaks .. i18n: consistency tweaks * replace article by page * replace single-quotation by double Partially spotted by Siebrand https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Gettingstarted-task-copyedit-toolbar-description/en Change-Id: I1468d1fb63d4f112e8ba81aea59f380f6b5bd322 --- M GettingStarted.i18n.php 1 file changed, 22 insertions(+), 22 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/GettingStarted.i18n.php b/GettingStarted.i18n.php index 62b3e12..04c8da0 100644 --- a/GettingStarted.i18n.php +++ b/GettingStarted.i18n.php @@ -18,7 +18,7 @@ 'gettingstarted-welcome-back-site-user' = Welcome back, $2, 'gettingstarted-task-header' = 'Thanks for joining {{SITENAME}}! Here are some ways you can get involved. -Choose an option below, and you will see a random article that needs help.', +Choose an option below, and you will see a random page that needs help.', 'gettingstarted-return' = ← No thanks, return to the page I was reading, 'gettingstarted-project-link' = '{{ns:Project}}:GettingStarted', // Change tags @@ -31,46 +31,46 @@ 'gettingstarted-task-clarify-main-description' = 'Improve Clarity', 'gettingstarted-task-clarify-secondary-description' = 'Simplify or reword sentences.', 'gettingstarted-task-addlinks-main-description' = 'Add Links', - 'gettingstarted-task-addlinks-secondary-description' = 'Connect {{SITENAME}} articles together.', + 'gettingstarted-task-addlinks-secondary-description' = 'Connect {{SITENAME}} pages together.', - // Toolbar above article, when they have chosen a task and been redirected + // Toolbar above page, when they have chosen a task and been redirected /// Shared among all tasks 'gettingstarted-task-toolbar-return-to-list-text' = '◄ Choose another task', 'gettingstarted-task-toolbar-return-to-list-title' = 'Return to the task choice page', 'gettingstarted-task-toolbar-editing-help-text' = 'Show me how', 'gettingstarted-task-toolbar-editing-help-title' = 'Show a guide on how to edit', - 'gettingstarted-task-toolbar-try-another-text' = 'Try another article ►', + 'gettingstarted-task-toolbar-try-another-text' = 'Try another page ►', 'gettingstarted-task-toolbar-close-title' = 'Close this toolbar', /// Specific to each task - 'gettingstarted-task-copyedit-toolbar-description' = 'This article may have spelling or grammar errors you can fix.', - 'gettingstarted-task-copyedit-toolbar-try-another-title' = 'Go to a random article you can improve by copyediting', + 'gettingstarted-task-copyedit-toolbar-description' = 'This page may have spelling or grammar errors you can fix.', + 'gettingstarted-task-copyedit-toolbar-try-another-title' = 'Go to a random page you can improve by copyediting', - 'gettingstarted-task-clarify-toolbar-description' = 'This article may be confusing or vague. Look for ways you can make it clearer.', - 'gettingstarted-task-clarify-toolbar-try-another-title' = 'Go to a random article you can clarify', + 'gettingstarted-task-clarify-toolbar-description' = 'This page may be confusing or vague. Look for ways you can make it clearer.', + 'gettingstarted-task-clarify-toolbar-try-another-title' = 'Go to a random page you can clarify', - 'gettingstarted-task-addlinks-toolbar-description' = 'This article may need more links. Look for terms that have a {{SITENAME}} article.', - 'gettingstarted-task-addlinks-toolbar-try-another-title' = 'Go to a random article you can add links to', + 'gettingstarted-task-addlinks-toolbar-description' = 'This page may need more links. Look for terms that have a {{SITENAME}} page.', + 'gettingstarted-task-addlinks-toolbar-try-another-title' = 'Go to a random page you can add links to', // Tours 'guidedtour-tour-gettingstartedtasktoolbarintro-title' = 'How to get started', - 'guidedtour-tour-gettingstartedtasktoolbarintro-description' = 'Just start scanning through the article looking for improvements. If you feel overwhelmed, don\'t worry. You don\'t have to be an expert on this topic! If you need help or want to try another article, use the links in the top bar.', + 'guidedtour-tour-gettingstartedtasktoolbarintro-description' = 'Just start scanning through the page looking for improvements. If you feel overwhelmed, do not worry. You do not have to be an expert on this topic! If you need help or want to try another page, use the links in the top bar.', 'guidedtour-tour-gettingstartedtasktoolbar-ambox-title' = 'Ideas on what to do', - 'guidedtour-tour-gettingstartedtasktoolbar-ambox-description' =
[MediaWiki-commits] [Gerrit] i18n: replace special page by page - change (mediawiki...SemanticMediaWiki)
jenkins-bot has submitted this change and it was merged. Change subject: i18n: replace special page by page .. i18n: replace special page by page Spotted by Siebrand https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Smw-sp-properties-docu/en Change-Id: Iaa6391044908c173c24300f1d9fbcd50d5996730 --- M languages/SMW_Messages.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/SMW_Messages.php b/languages/SMW_Messages.php index 9065227..a7b1277 100644 --- a/languages/SMW_Messages.php +++ b/languages/SMW_Messages.php @@ -424,7 +424,7 @@ 'smw-pa-property-predefined_asksi' = '$1 is a predefined property (also known as [https://www.semantic-mediawiki.org/wiki/Help:Special_properties special property]) which collects the number of conditions used in a query. It is a built-in property that comes with additional administrative privileges but can be used just like any other [https://www.semantic-mediawiki.org/wiki/Property user-defined property].', // Special:Properties - 'smw-sp-properties-docu' = 'This special page shows [https://www.semantic-mediawiki.org/wiki/Property properties] that are available and when filtered, only user-defined properties that match the condition are displayed. For a differentiated view, see the special page [[Special:UnusedProperties|unused properties]] or [[Special:WantedProperties|wanted properties]].', + 'smw-sp-properties-docu' = 'This page shows [https://www.semantic-mediawiki.org/wiki/Property properties] that are available and when filtered, only user-defined properties that match the condition are displayed. For a differentiated view, see the special page [[Special:UnusedProperties|unused properties]] or [[Special:WantedProperties|wanted properties]].', 'smw-sp-properties-cache-info' = 'The listed data have been retrieved from [https://www.semantic-mediawiki.org/wiki/Caching cache], and were last updated $1.', 'smw-sp-properties-header-label' = 'List of properties', -- To view, visit https://gerrit.wikimedia.org/r/103635 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaa6391044908c173c24300f1d9fbcd50d5996730 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMediaWiki Gerrit-Branch: master Gerrit-Owner: Shirayuki shirayuk...@gmail.com Gerrit-Reviewer: Siebrand siebr...@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] i18n: capitalize Commons - change (mediawiki...EducationProgram)
jenkins-bot has submitted this change and it was merged. Change subject: i18n: capitalize Commons .. i18n: capitalize Commons Spotted by OsamaK https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Epoa-profile-photo-help/ar Change-Id: Ie98b25c014ffd59496d109761efdeeb8d0a7b997 --- M EducationProgram.i18n.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/EducationProgram.i18n.php b/EducationProgram.i18n.php index 256f743..d74b009 100644 --- a/EducationProgram.i18n.php +++ b/EducationProgram.i18n.php @@ -770,7 +770,7 @@ 'onlineambassadorprofile-text' = 'Your Online volunteer profile is what students get to see when they browse available volunteers.', 'epoa-profile-bio' = 'Short bio', 'epoa-profile-photo' = 'Profile photo', - 'epoa-profile-photo-help' = 'A picture of you that will be shown next to your bio. Enter the name of an image on Wikimedia Commons and a preview will appear. You can type the first few letters of the image name and then select your image from the suggestion list. If you do not have a picture of you on commons yet, [$1 go upload one]!', + 'epoa-profile-photo-help' = 'A picture of you that will be shown next to your bio. Enter the name of an image on Wikimedia Commons and a preview will appear. You can type the first few letters of the image name and then select your image from the suggestion list. If you do not have a picture of you on Commons yet, [$1 go upload one]!', 'epoa-profile-saved' = 'Your profile has been saved', 'epoa-profile-invalid-bio' = 'Your bio needs to contain at least $1 {{PLURAL:$1|character|characters}}.', 'epoa-visible' = 'Publicly list you as Online volunteer', @@ -781,7 +781,7 @@ 'campusambassadorprofile-text' = 'Your Campus volunteer profile is what students get to see when they browse available volunteers.', 'epca-profile-bio' = 'Short bio', 'epca-profile-photo' = 'Profile photo', - 'epca-profile-photo-help' = 'A picture of you that will be shown next to your bio. Enter the name of an image on Wikimedia Commons and a preview will appear. You can type the first few letters of the image name and then select your image from the suggestion list. If you do not have a picture of you on commons yet, [$1 go upload one]!', + 'epca-profile-photo-help' = 'A picture of you that will be shown next to your bio. Enter the name of an image on Wikimedia Commons and a preview will appear. You can type the first few letters of the image name and then select your image from the suggestion list. If you do not have a picture of you on Commons yet, [$1 go upload one]!', 'epca-profile-saved' = 'Your profile has been saved', 'epca-profile-invalid-bio' = 'Your bio needs to contain at least $1 {{PLURAL:$1|character|characters}}.', 'epca-visible' = 'Publicly list you as Campus volunteer', -- To view, visit https://gerrit.wikimedia.org/r/103620 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie98b25c014ffd59496d109761efdeeb8d0a7b997 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EducationProgram Gerrit-Branch: master Gerrit-Owner: Shirayuki shirayuk...@gmail.com Gerrit-Reviewer: Siebrand siebr...@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] Disable interwiki magic for wikimedia (chapter) sites - change (operations/mediawiki-config)
TTO has uploaded a new change for review. https://gerrit.wikimedia.org/r/103649 Change subject: Disable interwiki magic for wikimedia (chapter) sites .. Disable interwiki magic for wikimedia (chapter) sites See the explanation at the bug. Basically, this feature is broken and produces nonsense on these sites. Bug: 58958 Change-Id: If2cc6c9a5d47226d24924ab29cceb128b8da6647 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/49/103649/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index d3bf4f3..be04c60 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -67,6 +67,7 @@ 'wgInterwikiMagic' = array( 'default' = true, 'metawiki' = false, + 'wikimedia' = false, ), # wgLanguageCode @{ -- To view, visit https://gerrit.wikimedia.org/r/103649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2cc6c9a5d47226d24924ab29cceb128b8da6647 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: TTO at.li...@live.com.au ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove hard coded entity ids from DatabaseRowEntityIdIterato... - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Remove hard coded entity ids from DatabaseRowEntityIdIteratorTest .. Remove hard coded entity ids from DatabaseRowEntityIdIteratorTest Change-Id: Idf46daee4d7462edf4e45903fb7b10ed3f5505ee --- M repo/tests/phpunit/includes/store/sql/DatabaseRowEntityIdIteratorTest.php 1 file changed, 17 insertions(+), 13 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/tests/phpunit/includes/store/sql/DatabaseRowEntityIdIteratorTest.php b/repo/tests/phpunit/includes/store/sql/DatabaseRowEntityIdIteratorTest.php index b543a3b..3fb4fb7 100644 --- a/repo/tests/phpunit/includes/store/sql/DatabaseRowEntityIdIteratorTest.php +++ b/repo/tests/phpunit/includes/store/sql/DatabaseRowEntityIdIteratorTest.php @@ -4,13 +4,8 @@ use Wikibase\DatabaseRowEntityIdIterator; use Wikibase\DataModel\Entity\EntityId; -use Wikibase\DataModel\Entity\ItemId; -use Wikibase\DataModel\Entity\PropertyId; -use Wikibase\EntityContent; -use Wikibase\EntityContentFactory; -use Wikibase\EntityFactory; -use Wikibase\Property; -use Wikibase\Repo\WikibaseRepo; +use Wikibase\PropertyContent; +use Wikibase\ItemContent; /** * @covers Wikibase\DatabaseRowEntityIdIterator @@ -79,9 +74,16 @@ } /** -* @dataProvider idProvider +* @dataProvider entityProvider */ - public function testIteration( $ids ) { + public function testIteration( $entityContents ) { + $ids = array(); + + foreach( $entityContents as $entityContent ) { + $entityContent-save( 'foo', null, EDIT_NEW ); + $ids[] = $entityContent-getEntity()-getId(); + } + $iterator = $this-newDatabaseRowEntityIdIterator( $ids ); if ( empty( $ids ) ) { @@ -94,13 +96,15 @@ } } - public static function idProvider() { - $p10 = new PropertyId( 'P10' ); - $q30 = new ItemId( 'Q30' ); + public static function entityProvider() { + $property = PropertyContent::newEmpty(); + $property-getProperty()-setDataTypeId( 'string' ); + + $item = ItemContent::newEmpty(); return array( 'empty' = array( array() ), - 'some entities' = array( array( $p10, $q30 ) ), + 'some entities' = array( array( $property, $item ) ), ); } } -- To view, visit https://gerrit.wikimedia.org/r/103632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf46daee4d7462edf4e45903fb7b10ed3f5505ee Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo man h...@online.de Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: Jeroen De Dauw jeroended...@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; add mail forwarding rules - change (pywikibot...drtrigonbot)
DrTrigon has uploaded a new change for review. https://gerrit.wikimedia.org/r/103650 Change subject: update; add mail forwarding rules .. update; add mail forwarding rules Change-Id: I339a22aa272e516301dc5b73604d0fc7ab0cebfa --- A .forward A .forward+subster M fabfile.py 3 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/drtrigonbot refs/changes/50/103650/1 diff --git a/.forward b/.forward new file mode 100644 index 000..2ecadf7 --- /dev/null +++ b/.forward @@ -0,0 +1 @@ +dr.tri...@surfeu.ch diff --git a/.forward+subster b/.forward+subster new file mode 100644 index 000..afc287a --- /dev/null +++ b/.forward+subster @@ -0,0 +1 @@ + ~/data/subster/mail_inbox diff --git a/fabfile.py b/fabfile.py index 55e4848..50799c3 100644 --- a/fabfile.py +++ b/fabfile.py @@ -127,6 +127,8 @@ _clone_git_path(repo='pywikibot/bots/drtrigonbot', dest='pywikibot-drtrigonbot/', paths=['public_html/', '.description', + '.forward', + '.forward+subster', '/README', # exclude 'externals/README' 'fabfile.py', 'warnuserquota.py', @@ -168,7 +170,13 @@ def sl_drtrigonbot(): local('ln -s pywikibot-drtrigonbot/README README') local('ln -s pywikibot-drtrigonbot/warnuserquota.py warnuserquota.py') -local('ln -s pywikibot-drtrigonbot/.description .description') +local('ln -s pywikibot-drtrigonbot/.forward .forward') +if LABS:# labs-tools +local('ln -s pywikibot-drtrigonbot/.description .description') +else: # toolserver +# .about.me file...? +local('ln -s pywikibot-drtrigonbot/.forward+subster .forward+subster') +local('chmod 600 ~/.forward*') def sl_compat(): if LABS:# labs-tools -- To view, visit https://gerrit.wikimedia.org/r/103650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I339a22aa272e516301dc5b73604d0fc7ab0cebfa Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/drtrigonbot Gerrit-Branch: master Gerrit-Owner: DrTrigon dr.tri...@surfeu.ch ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] update; add mail forwarding rules - change (pywikibot...drtrigonbot)
DrTrigon has submitted this change and it was merged. Change subject: update; add mail forwarding rules .. update; add mail forwarding rules Change-Id: I339a22aa272e516301dc5b73604d0fc7ab0cebfa --- A .forward A .forward+subster M fabfile.py 3 files changed, 11 insertions(+), 1 deletion(-) Approvals: DrTrigon: Verified; Looks good to me, approved diff --git a/.forward b/.forward new file mode 100644 index 000..2ecadf7 --- /dev/null +++ b/.forward @@ -0,0 +1 @@ +dr.tri...@surfeu.ch diff --git a/.forward+subster b/.forward+subster new file mode 100644 index 000..afc287a --- /dev/null +++ b/.forward+subster @@ -0,0 +1 @@ + ~/data/subster/mail_inbox diff --git a/fabfile.py b/fabfile.py index 55e4848..50799c3 100644 --- a/fabfile.py +++ b/fabfile.py @@ -127,6 +127,8 @@ _clone_git_path(repo='pywikibot/bots/drtrigonbot', dest='pywikibot-drtrigonbot/', paths=['public_html/', '.description', + '.forward', + '.forward+subster', '/README', # exclude 'externals/README' 'fabfile.py', 'warnuserquota.py', @@ -168,7 +170,13 @@ def sl_drtrigonbot(): local('ln -s pywikibot-drtrigonbot/README README') local('ln -s pywikibot-drtrigonbot/warnuserquota.py warnuserquota.py') -local('ln -s pywikibot-drtrigonbot/.description .description') +local('ln -s pywikibot-drtrigonbot/.forward .forward') +if LABS:# labs-tools +local('ln -s pywikibot-drtrigonbot/.description .description') +else: # toolserver +# .about.me file...? +local('ln -s pywikibot-drtrigonbot/.forward+subster .forward+subster') +local('chmod 600 ~/.forward*') def sl_compat(): if LABS:# labs-tools -- To view, visit https://gerrit.wikimedia.org/r/103650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I339a22aa272e516301dc5b73604d0fc7ab0cebfa Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/drtrigonbot Gerrit-Branch: master Gerrit-Owner: DrTrigon dr.tri...@surfeu.ch Gerrit-Reviewer: DrTrigon dr.tri...@surfeu.ch ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Reorder UserEditFilterGenerator in right place - change (pywikibot/compat)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/103651 Change subject: Reorder UserEditFilterGenerator in right place .. Reorder UserEditFilterGenerator in right place synchronized with core Change-Id: I46e88b7e0313c0f1c4560b74c2c9208b828868fc --- M template.py 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/51/103651/1 diff --git a/template.py b/template.py index f75797e..d284a22 100644 --- a/template.py +++ b/template.py @@ -351,8 +351,6 @@ if xmlfilename: gen = XmlDumpTemplatePageGenerator(oldTemplates, xmlfilename) -elif user: -gen = UserEditFilterGenerator(gen, user, timestamp, skip) else: gen = genFactory.getCombinedGenerator() if not gen: @@ -362,7 +360,8 @@ ] gen = pagegenerators.CombinedPageGenerator(gens) gen = pagegenerators.DuplicateFilterPageGenerator(gen) - +if user: +gen = UserEditFilterGenerator(gen, user, timestamp, skip) preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = TemplateRobot(preloadingGen, templates, subst, remove, editSummary, -- To view, visit https://gerrit.wikimedia.org/r/103651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46e88b7e0313c0f1c4560b74c2c9208b828868fc Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add massmessage-sender user group to enwiki - change (operations/mediawiki-config)
Odder has uploaded a new change for review. https://gerrit.wikimedia.org/r/103652 Change subject: Add massmessage-sender user group to enwiki .. Add massmessage-sender user group to enwiki This patch adds the 'massmessage-sender' user group to the English Wikipedia, with the extension's only user right, ie. 'massmessage'; sysops will be able to add and remove users from this group. See bug for URL with on-wiki consensus for the creation of this new user group. Bug: 58962 Change-Id: I20acaa34171f1040052a5330caab535aa3f9aaa8 --- M wmf-config/InitialiseSettings.php 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/52/103652/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index d3bf4f3..da764f0 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -6794,6 +6794,9 @@ 'bureaucrat' = array( 'move-subpages' = true, 'suppressredirect' = true, 'tboverride' = true, ), 'templateeditor' = array( 'templateeditor' = true, 'tboverride' = true, ), // bug 55432 'sysop' = array( 'templateeditor' = true ), // bug 55432 + 'massmessage-sender' = array( // bug 58962 + 'massmessage' = true, + ), ), 'enwikibooks' = array( // 'rollbacker' = array( 'rollback' = true ), @@ -7793,7 +7796,7 @@ ), '+enwiki' = array( 'bureaucrat' = array( 'accountcreator' ), - 'sysop' = array( 'abusefilter', 'accountcreator', 'autoreviewer', 'confirmed', 'filemover', 'reviewer', 'rollbacker', 'templateeditor' ), + 'sysop' = array( 'abusefilter', 'accountcreator', 'autoreviewer', 'confirmed', 'filemover', 'reviewer', 'rollbacker', 'templateeditor', 'massmessage-sender' ), ), '+enwikibooks' = array( 'sysop' = array( 'transwiki', 'uploader' ), @@ -8241,7 +8244,7 @@ ), '+enwiki' = array( 'bureaucrat' = array( 'ipblock-exempt', 'accountcreator', 'sysop' ), - 'sysop' = array( 'rollbacker', 'accountcreator', 'abusefilter', 'autoreviewer', 'confirmed', 'reviewer', 'filemover', 'templateeditor' ), + 'sysop' = array( 'rollbacker', 'accountcreator', 'abusefilter', 'autoreviewer', 'confirmed', 'reviewer', 'filemover', 'templateeditor', 'massmessage-sender' ), ), '+enwikibooks' = array( 'sysop' = array( 'transwiki', 'uploader', ), -- To view, visit https://gerrit.wikimedia.org/r/103652 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20acaa34171f1040052a5330caab535aa3f9aaa8 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Odder tom...@twkozlowski.net ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] i18n: Add GENDER support to epoa-visible - change (mediawiki...EducationProgram)
MegaAlex has uploaded a new change for review. https://gerrit.wikimedia.org/r/103654 Change subject: i18n: Add GENDER support to epoa-visible .. i18n: Add GENDER support to epoa-visible Spotted by Siebrand Change-Id: I220762642d566fadac7ac6bd2c6702decb54afa4 --- M EducationProgram.i18n.php M includes/specials/SpecialAmbassadorProfile.php 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram refs/changes/54/103654/1 diff --git a/EducationProgram.i18n.php b/EducationProgram.i18n.php index f8dea30..14c2fb3 100644 --- a/EducationProgram.i18n.php +++ b/EducationProgram.i18n.php @@ -773,7 +773,7 @@ 'epoa-profile-photo-help' = 'A picture of you that will be shown next to your bio. Enter the name of an image on Wikimedia Commons and a preview will appear. You can type the first few letters of the image name and then select your image from the suggestion list. If you do not have a picture of you on commons yet, [$1 go upload one]!', 'epoa-profile-saved' = 'Your profile has been saved', 'epoa-profile-invalid-bio' = 'Your bio needs to contain at least $1 {{PLURAL:$1|character|characters}}.', - 'epoa-visible' = 'Publicly list you as Online volunteer', + 'epoa-visible' = 'Publicly list {{GENDER:$1|you}} as Online volunteer', // Special:CampusAmbassadorProfile 'campusambassadorprofile' = 'Campus volunteer profile', @@ -1886,7 +1886,8 @@ 'epoa-profile-saved' = 'Success message shown in success box at top of page after save.', 'epoa-profile-invalid-bio' = 'Error message stating the bio must contain more characters. Parameters: * $1 is the minimum number of characters.', - 'epoa-visible' = 'Check box input label.', + 'epoa-visible' = 'Check box input label.Parameters: +* $1 is a plain text username of the current user, used for GENDER', 'campusambassadorprofile' = 'Page title.', 'campusambassadorprofile-legend' = 'Ambassador form legend.', 'campusambassadorprofile-text' = 'Ambassador form description.', diff --git a/includes/specials/SpecialAmbassadorProfile.php b/includes/specials/SpecialAmbassadorProfile.php index 80b0c9c..b449712 100644 --- a/includes/specials/SpecialAmbassadorProfile.php +++ b/includes/specials/SpecialAmbassadorProfile.php @@ -100,7 +100,7 @@ $fields['visible'] = array( 'type' = 'check', - 'label-message' = $this-getMsgPrefix() . 'visible', + 'label' = wfMessage( $this-getMsgPrefix() . 'visible', $this-getUser() )-text(), 'required' = true, 'rows' = 10, 'default' = $ambassador-getField( 'visible' ), -- To view, visit https://gerrit.wikimedia.org/r/103654 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I220762642d566fadac7ac6bd2c6702decb54afa4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EducationProgram Gerrit-Branch: master Gerrit-Owner: MegaAlex alexivano...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated location of zhtable in comment - change (mediawiki/core)
Liangent has uploaded a new change for review. https://gerrit.wikimedia.org/r/103655 Change subject: Updated location of zhtable in comment .. Updated location of zhtable in comment Follow up I239483e6cdf7d412be01ae8bd45978481c5dd518. Change-Id: Ia909b36ed8b996057ba4e7966cac4d29ee3836f4 --- M maintenance/language/zhtable/Makefile.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/55/103655/1 diff --git a/maintenance/language/zhtable/Makefile.py b/maintenance/language/zhtable/Makefile.py index 7e19794..ac09246 100755 --- a/maintenance/language/zhtable/Makefile.py +++ b/maintenance/language/zhtable/Makefile.py @@ -352,7 +352,7 @@ /** * Simplified / Traditional Chinese conversion tables * - * Automatically generated using code and data in includes/zhtable/ + * Automatically generated using code and data in maintenance/language/zhtable/ * Do not modify directly! * * @file -- To view, visit https://gerrit.wikimedia.org/r/103655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia909b36ed8b996057ba4e7966cac4d29ee3836f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Liangent liang...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated location of zhtable in comment - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Updated location of zhtable in comment .. Updated location of zhtable in comment Follow up I239483e6cdf7d412be01ae8bd45978481c5dd518. Change-Id: Ia909b36ed8b996057ba4e7966cac4d29ee3836f4 --- M maintenance/language/zhtable/Makefile.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/language/zhtable/Makefile.py b/maintenance/language/zhtable/Makefile.py index 7e19794..ac09246 100755 --- a/maintenance/language/zhtable/Makefile.py +++ b/maintenance/language/zhtable/Makefile.py @@ -352,7 +352,7 @@ /** * Simplified / Traditional Chinese conversion tables * - * Automatically generated using code and data in includes/zhtable/ + * Automatically generated using code and data in maintenance/language/zhtable/ * Do not modify directly! * * @file -- To view, visit https://gerrit.wikimedia.org/r/103655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia909b36ed8b996057ba4e7966cac4d29ee3836f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Liangent liang...@gmail.com Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Parent5446 tylerro...@gmail.com Gerrit-Reviewer: Petr Onderka gsv...@gmail.com Gerrit-Reviewer: Siebrand siebr...@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] Output language-converted-title in output - change (mediawiki...GeoCrumbs)
Mayankmadan has uploaded a new change for review. https://gerrit.wikimedia.org/r/103656 Change subject: Output language-converted-title in output .. Output language-converted-title in output Bug: 57925 Change-Id: I8f87e6b4a8369564e4e3bfe51b5e2875635b6012 --- M GeoCrumbs.class.php 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoCrumbs refs/changes/56/103656/1 diff --git a/GeoCrumbs.class.php b/GeoCrumbs.class.php index f1b134b..2d0ec6b 100644 --- a/GeoCrumbs.class.php +++ b/GeoCrumbs.class.php @@ -114,13 +114,19 @@ public function makeTrail( Title $title ) { $breadcrumbs = array(); $idStack = array(); + $parsercache = $this-getParserCache($title-getArticleID()); for ( $cnt = 0; $title $cnt 20; $cnt++ ) { // do not link the final breadcrumb if ( $cnt == 0 ) { - $link = $title-getSubpageText(); + if ($parsercache-getDisplayTitle() == false) { + $link = $parsercache-mTitleText; + } + else { + $link = $parsercache-getDisplayTitle(); + } } else { - $link = Linker::link( $title, $title-getSubpageText() ); + $link = Linker::link( $title, $parsercache-mTitleText ); } // mark redirects with italics. -- To view, visit https://gerrit.wikimedia.org/r/103656 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f87e6b4a8369564e4e3bfe51b5e2875635b6012 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GeoCrumbs Gerrit-Branch: master Gerrit-Owner: Mayankmadan maddiema...@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] Perform QuickReturn at the same rate as scrolling - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Perform QuickReturn at the same rate as scrolling .. Perform QuickReturn at the same rate as scrolling Change-Id: I719e4db20befa04da243b49b24ecf9208e9436a4 --- M wikipedia/src/main/java/org/wikimedia/wikipedia/QuickReturnHandler.java 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/src/main/java/org/wikimedia/wikipedia/QuickReturnHandler.java b/wikipedia/src/main/java/org/wikimedia/wikipedia/QuickReturnHandler.java index 3f3758e..4242461 100644 --- a/wikipedia/src/main/java/org/wikimedia/wikipedia/QuickReturnHandler.java +++ b/wikipedia/src/main/java/org/wikimedia/wikipedia/QuickReturnHandler.java @@ -33,13 +33,13 @@ int animMargin; if (oldScrollY scrollY) { int minMargin = 0; -int scrollDelta = (oldScrollY - scrollY) / 2; +int scrollDelta = oldScrollY - scrollY; int newMargin = (int)quickReturnView.getTranslationY() + scrollDelta; animMargin = Math.min(minMargin, newMargin); } else { // scroll downn! int minMargin = -quickReturnView.getHeight(); -int scrollDelta = (scrollY - oldScrollY) / 2; +int scrollDelta = scrollY - oldScrollY; int newMargin = (int)quickReturnView.getTranslationY() - scrollDelta; animMargin = Math.max(minMargin, newMargin); } -- To view, visit https://gerrit.wikimedia.org/r/103515 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I719e4db20befa04da243b49b24ecf9208e9436a4 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [MobileFrontend] Update optional/ignore message keys - change (translatewiki)
Raimond Spekking has uploaded a new change for review. https://gerrit.wikimedia.org/r/103657 Change subject: [MobileFrontend] Update optional/ignore message keys .. [MobileFrontend] Update optional/ignore message keys 1 added per https://gerrit.wikimedia.org/r/#/c/102043/13/MobileFrontend.i18n.php,unified Other removed ... sometime deleted in the past ... Change-Id: I0663d47517e4e0e27b8845537dda56b089bcac3f --- M groups/MediaWiki/mediawiki-defines.txt 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/57/103657/1 diff --git a/groups/MediaWiki/mediawiki-defines.txt b/groups/MediaWiki/mediawiki-defines.txt index f20f097..df7442d 100644 --- a/groups/MediaWiki/mediawiki-defines.txt +++ b/groups/MediaWiki/mediawiki-defines.txt @@ -862,10 +862,11 @@ Mobile Frontend descmsg = mobile-frontend-desc aliasfile = MobileFrontend/MobileFrontend.alias.php -optional = mobile-frontend-feedback-page, mobile-frontend-page-menu-language-current -optional = mobile.js, mobile.css, mobile-frontend-ajax-random-quote-author -ignored = mobile-frontend-sopa-notice, mobile-frontend-current-language +optional = mobile-frontend-page-menu-language-current +optional = mobile.js, mobile.css +ignored = mobile-frontend-current-language ignored = mobile-frontend-page-menu-language, mobile-frontend-terms-url +ignored = mobilefrontend-keepgoing-wikify-category Model -- To view, visit https://gerrit.wikimedia.org/r/103657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0663d47517e4e0e27b8845537dda56b089bcac3f Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [MobileFrontend] Update optional/ignore message keys - change (translatewiki)
Raimond Spekking has submitted this change and it was merged. Change subject: [MobileFrontend] Update optional/ignore message keys .. [MobileFrontend] Update optional/ignore message keys 1 added per https://gerrit.wikimedia.org/r/#/c/102043/13/MobileFrontend.i18n.php,unified Other removed ... sometime deleted in the past ... Change-Id: I0663d47517e4e0e27b8845537dda56b089bcac3f --- M groups/MediaWiki/mediawiki-defines.txt 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Raimond Spekking: Verified; Looks good to me, approved diff --git a/groups/MediaWiki/mediawiki-defines.txt b/groups/MediaWiki/mediawiki-defines.txt index f20f097..df7442d 100644 --- a/groups/MediaWiki/mediawiki-defines.txt +++ b/groups/MediaWiki/mediawiki-defines.txt @@ -862,10 +862,11 @@ Mobile Frontend descmsg = mobile-frontend-desc aliasfile = MobileFrontend/MobileFrontend.alias.php -optional = mobile-frontend-feedback-page, mobile-frontend-page-menu-language-current -optional = mobile.js, mobile.css, mobile-frontend-ajax-random-quote-author -ignored = mobile-frontend-sopa-notice, mobile-frontend-current-language +optional = mobile-frontend-page-menu-language-current +optional = mobile.js, mobile.css +ignored = mobile-frontend-current-language ignored = mobile-frontend-page-menu-language, mobile-frontend-terms-url +ignored = mobilefrontend-keepgoing-wikify-category Model -- To view, visit https://gerrit.wikimedia.org/r/103657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0663d47517e4e0e27b8845537dda56b089bcac3f Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com Gerrit-Reviewer: Raimond Spekking raimond.spekk...@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] (bug 58342) Inject TermBox when viewing - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: (bug 58342) Inject TermBox when viewing .. (bug 58342) Inject TermBox when viewing This introduces a generic mechanism for managing and expanding placeholders in cached content, to allow user specific content to be injected on demand. This change also factors several bits of logic out of EntityView and provides more fine grained tests. Change-Id: I75cbbf01c644232f906a1d4f8e990b3fdbf781ec --- M repo/Wikibase.classes.php M repo/Wikibase.hooks.php M repo/Wikibase.php M repo/includes/EntityView.php A repo/includes/EntityViewPlaceholderExpander.php A repo/includes/UserLanguageLookup.php A repo/includes/view/SectionEditLinkGenerator.php A repo/includes/view/TermBoxView.php A repo/includes/view/TextInjector.php M repo/resources/themes/default/wikibase.toc.css A repo/tests/phpunit/includes/EntityViewPlaceholderExpanderTest.php M repo/tests/phpunit/includes/EntityViewTest.php A repo/tests/phpunit/includes/UserLanguagesTest.php A repo/tests/phpunit/includes/view/SectionEditLinkGeneratorTest.php A repo/tests/phpunit/includes/view/TermBoxViewTest.php A repo/tests/phpunit/includes/view/TextInjectorTest.php 16 files changed, 996 insertions(+), 171 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php index 99418fc..819c41a 100644 --- a/repo/Wikibase.classes.php +++ b/repo/Wikibase.classes.php @@ -41,6 +41,7 @@ 'Wikibase\ItemContentDiffView' = 'includes/ItemContentDiffView.php', 'Wikibase\ItemDisambiguation' = 'includes/ItemDisambiguation.php', 'Wikibase\EntityView' = 'includes/EntityView.php', + 'Wikibase\EntityViewPlaceholderExpander' = 'includes/EntityViewPlaceholderExpander.php', 'Wikibase\ExceptionWithCode' = 'includes/ExceptionWithCode.php', 'Wikibase\ItemView' = 'includes/ItemView.php', 'Wikibase\LabelDescriptionDuplicateDetector' = 'includes/LabelDescriptionDuplicateDetector.php', @@ -52,6 +53,12 @@ 'Wikibase\SummaryFormatter' = 'includes/SummaryFormatter.php', 'Wikibase\Repo\WikibaseRepo' = 'includes/WikibaseRepo.php', 'Wikibase\ClaimHtmlGenerator' = 'includes/ClaimHtmlGenerator.php', + 'Wikibase\UserLanguageLookup' = 'includes/UserLanguageLookup.php', + + // includes/view + 'Wikibase\SectionEditLinkGenerator' = 'includes/view/SectionEditLinkGenerator.php', + 'Wikibase\TermBoxView' = 'includes/view/TermBoxView.php', + 'Wikibase\TextInjector' = 'includes/view/TextInjector.php', // includes/ChangeOp 'Wikibase\ChangeOp\ChangeOps' = 'includes/ChangeOp/ChangeOps.php', diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php index 77ec924..7bed6a6 100644 --- a/repo/Wikibase.hooks.php +++ b/repo/Wikibase.hooks.php @@ -16,6 +16,7 @@ use MWContentSerializationException; use MWException; use OutputPage; +use ParserOutput; use RecentChange; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; @@ -1031,4 +1032,54 @@ } return true; } + + /** +* Called when pushing meta-info from the ParserOutput into OutputPage. +* Used to transfer the 'wb-placeholders' from ParserOutput to OutputPage. +* +* @param OutputPage $out +* @param ParserOutput $parserOutput +* +* @return bool +*/ + public static function onOutputPageParserOutput( OutputPage $out, ParserOutput $parserOutput ) { + $placeholders = $parserOutput-getExtensionData( 'wikibase-view-chunks' ); + + if ( $placeholders ) { + $out-setProperty( 'wikibase-view-chunks', $placeholders ); + } + + return true; + } + + /** +* Called when pushing HTML from the ParserOutput into OutputPage. +* Used to expand any placeholders in the OutputPage's 'wb-placeholders' property +* in the HTML. +* +* @param OutputPage $out +* @param string $html the HTML to mangle +* +* @return bool +*/ + public static function onOutputPageBeforeHTML( OutputPage $out, $html ) { + $placeholders = $out-getProperty( 'wikibase-view-chunks' ); + + if ( $placeholders ) { + $injector = new TextInjector( $placeholders ); + + $expander = new EntityViewPlaceholderExpander( + $out-getTitle(), + $out-getUser(), + $out-getLanguage(), + WikibaseRepo::getDefaultInstance()-getEntityIdParser(), +
[MediaWiki-commits] [Gerrit] Add variable to disable WAP - change (mediawiki...MobileFrontend)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/103658 Change subject: Add variable to disable WAP .. Add variable to disable WAP Change-Id: I429484b9687ff09ce43eae3d89b6d7c91338ea99 --- M MobileFrontend.php M includes/MobileFrontend.hooks.php M includes/formatters/MobileFormatter.php M includes/skins/SkinMobile.php 4 files changed, 25 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/58/103658/1 diff --git a/MobileFrontend.php b/MobileFrontend.php index 7c8b9de..388b9ca 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -435,3 +435,16 @@ * Controls whether new 1-column diffs should be used */ $wgMFEnableBetaDiff = false; + +/** + * Controls the use of WAP view. Possible values: + * enabled - WAP is enabled; + * transitional - disabled but output still varied by X-WAP and requests with X-WAP: yes have shorter expiry time; + * disabled - WAP is disabled; + */ +$wgMFWap = 'enabled'; + +/** + * Maximum HTTP lifetime for page views with $wgMFWap = 'transitional' + */ +$wgMFTransitionalWapLifetime = 3 * 86400; diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 9bd19e3..35da4ee 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -41,7 +41,7 @@ * @return bool */ public static function onRequestContextCreateSkin( $context, $skin ) { - global $wgMFEnableDesktopResources, $wgMFDefaultSkinClass, $wgULSPosition; + global $wgMFEnableDesktopResources, $wgMFDefaultSkinClass, $wgULSPosition, $wgMFWap; // check whether or not the user has requested to toggle their view $mobileContext = MobileContext::singleton(); @@ -78,7 +78,7 @@ // log whether user is using alpha/beta/stable $mobileContext-logMobileMode(); - if ( $mobileContext-getContentFormat() == 'WML' ) { + if ( $mobileContext-getContentFormat() == 'WML' $wgMFWap == 'enabled' ) { # Grab the skin class and initialise it. $skin = new SkinMobileWML( $context ); } else { diff --git a/includes/formatters/MobileFormatter.php b/includes/formatters/MobileFormatter.php index 4bb2304..314d371 100644 --- a/includes/formatters/MobileFormatter.php +++ b/includes/formatters/MobileFormatter.php @@ -48,6 +48,8 @@ * @return MobileFormatter */ public static function newFromContext( $context, $html ) { + global $wgMFWap; + wfProfileIn( __METHOD__ ); $title = $context-getTitle(); @@ -56,7 +58,7 @@ $isSpecialPage = $title-isSpecialPage(); $html = self::wrapHTML( $html ); - if ( $context-getContentFormat() === 'WML' ) { + if ( $context-getContentFormat() === 'WML' $wgMFWap === 'enabled' ) { $wmlContext = new WmlContext( $context ); $formatter = new MobileFormatterWML( $html, $title, $wmlContext ); } else { diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php index dd19524..0757f1f 100644 --- a/includes/skins/SkinMobile.php +++ b/includes/skins/SkinMobile.php @@ -15,7 +15,7 @@ } public function outputPage( OutputPage $out = null ) { - global $wgMFNoindexPages; + global $wgMFNoindexPages, $wgMFWap, $wgMFTransitionalWapLifetime; wfProfileIn( __METHOD__ ); if ( !$out ) { $out = $this-getOutput(); @@ -25,6 +25,12 @@ } wfRunHooks( 'BeforePageDisplayMobile', array( $out ) ); + + # Restrict cache lifetime for potentially WAPy requests during the transitional period + if ( $wgMFWap == 'transitional' ) { + $out-setSquidMaxage( min( $out-mSquidMaxage, $wgMFTransitionalWapLifetime ) ); + } + parent::outputPage( $out ); } -- To view, visit https://gerrit.wikimedia.org/r/103658 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I429484b9687ff09ce43eae3d89b6d7c91338ea99 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: MaxSem maxsem.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] i18n: replace whitespace by entity 32 - change (mediawiki...PageTriage)
jenkins-bot has submitted this change and it was merged. Change subject: i18n: replace whitespace by entity 32 .. i18n: replace whitespace by entity 32 Spotted by Siebrand https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Pagetriage-dot-separator/en Change-Id: I0f13e562769860ec3ac0f13cd3dc71078a9e27b8 --- M PageTriage.i18n.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Siebrand: Looks good to me, but someone else must approve MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/PageTriage.i18n.php b/PageTriage.i18n.php index 4f3f53e..a1191f2 100644 --- a/PageTriage.i18n.php +++ b/PageTriage.i18n.php @@ -15,7 +15,7 @@ */ $messages['en'] = array( 'pagetriage' = 'Page Triage', - 'pagetriage-dot-separator' = ' · ', + 'pagetriage-dot-separator' = '#32;·#32;', 'newpagesfeed' = 'New pages feed', 'pagetriage-desc' = 'Facilitates reviewing and approving new pages', 'pagetriage-pagecuration' = 'Page Curation', -- To view, visit https://gerrit.wikimedia.org/r/103629 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0f13e562769860ec3ac0f13cd3dc71078a9e27b8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageTriage Gerrit-Branch: master Gerrit-Owner: Shirayuki shirayuk...@gmail.com Gerrit-Reviewer: MaxSem maxsem.w...@gmail.com Gerrit-Reviewer: Siebrand siebr...@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] Fix for removal of MW 1.17 support - change (mediawiki...SemanticForms)
Yaron Koren has uploaded a new change for review. https://gerrit.wikimedia.org/r/103720 Change subject: Fix for removal of MW 1.17 support .. Fix for removal of MW 1.17 support Change-Id: Iacece6b70c7ab122d1feb68075e59690734e8b47 --- M includes/forminputs/SF_TextInput.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/20/103720/1 diff --git a/includes/forminputs/SF_TextInput.php b/includes/forminputs/SF_TextInput.php index eec01eb..0ad8559 100644 --- a/includes/forminputs/SF_TextInput.php +++ b/includes/forminputs/SF_TextInput.php @@ -108,7 +108,7 @@ } public static function uploadableHTML( $input_id, $delimiter = null, $default_filename = null, $cur_value = '', $other_args = array() ) { - $upload_window_page = SFUtils::getSpecialPage( 'UploadWindow' ); + $upload_window_page = SpecialPageFactory::getPage( 'UploadWindow' ); $query_string = sfInputID=$input_id; if ( $delimiter != null ) { $query_string .= sfDelimiter=$delimiter; -- To view, visit https://gerrit.wikimedia.org/r/103720 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iacece6b70c7ab122d1feb68075e59690734e8b47 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Yaron Koren yaro...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for removal of MW 1.17 support - change (mediawiki...SemanticForms)
Yaron Koren has submitted this change and it was merged. Change subject: Fix for removal of MW 1.17 support .. Fix for removal of MW 1.17 support Change-Id: Iacece6b70c7ab122d1feb68075e59690734e8b47 --- M includes/forminputs/SF_TextInput.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Yaron Koren: Verified; Looks good to me, approved diff --git a/includes/forminputs/SF_TextInput.php b/includes/forminputs/SF_TextInput.php index eec01eb..0ad8559 100644 --- a/includes/forminputs/SF_TextInput.php +++ b/includes/forminputs/SF_TextInput.php @@ -108,7 +108,7 @@ } public static function uploadableHTML( $input_id, $delimiter = null, $default_filename = null, $cur_value = '', $other_args = array() ) { - $upload_window_page = SFUtils::getSpecialPage( 'UploadWindow' ); + $upload_window_page = SpecialPageFactory::getPage( 'UploadWindow' ); $query_string = sfInputID=$input_id; if ( $delimiter != null ) { $query_string .= sfDelimiter=$delimiter; -- To view, visit https://gerrit.wikimedia.org/r/103720 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iacece6b70c7ab122d1feb68075e59690734e8b47 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticForms Gerrit-Branch: master Gerrit-Owner: Yaron Koren yaro...@gmail.com Gerrit-Reviewer: Yaron Koren yaro...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Split JS to several files for improved modularity - change (mediawiki...ApiSandbox)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/103721 Change subject: Split JS to several files for improved modularity .. Split JS to several files for improved modularity Change-Id: I389cec418be72b3b021404abb7b0b530f71dd50f --- M ApiSandbox.php A resources/UiBuilder.js A resources/apiSandbox.js R resources/main.js R resources/styles.css 5 files changed, 246 insertions(+), 228 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApiSandbox refs/changes/21/103721/1 diff --git a/ApiSandbox.php b/ApiSandbox.php index 9418788..93d5544 100644 --- a/ApiSandbox.php +++ b/ApiSandbox.php @@ -20,10 +20,14 @@ $wgSpecialPageGroups['ApiSandbox'] = 'wiki'; $wgResourceModules['ext.apiSandbox'] = array( - 'scripts' = 'ext.apiSandbox.js', - 'styles' = 'ext.apiSandbox.css', - 'localBasePath' = __DIR__ . '/modules', - 'remoteExtPath' = 'ApiSandbox/modules', + 'scripts' = array( + 'apiSandbox.js', + 'UiBuilder.js', + 'main.js', + ), + 'styles' = 'styles.css', + 'localBasePath' = __DIR__ . '/resources', + 'remoteExtPath' = 'ApiSandbox/resources', 'messages' = array( 'apisb-loading', 'apisb-load-error', diff --git a/resources/UiBuilder.js b/resources/UiBuilder.js new file mode 100644 index 000..08d1ba0 --- /dev/null +++ b/resources/UiBuilder.js @@ -0,0 +1,209 @@ +/*global jQuery, mediaWiki, apiSandbox*/ +/*jslint regexp: true, browser: true, continue: true, sloppy: true, white: true, forin: true, plusplus: true */ +( function ( $, mw, apiSandbox, undefined ) { + /** +* HTML-escapes and pretty-formats an API description string +* +* @param s {String} String to escape +* @return {String} +*/ + var smartEscape = function( s ) { + if ( !s ) { + return ''; // @todo: fully verify paraminfo output + } + s = mw.html.escape( s ); + if ( s.indexOf( '\n ' ) = 0 ) { + // turns *-bulleted list into a HTML list + s = s.replace( /^(.*?)((?:\n\s+\*?[^\n]*)+)(.*?)$/m, '$1ul$2/ul$3' ); // outer tags + s = s.replace( /\n\s+\*?([^\n]*)/g, '\nli$1/li' ); // li around bulleted lines + } + s = s.replace( /\n(?!)/, '\nbr/' ); + s = s.replace( /(?:https?:)?\/\/[^\s]+/g, function ( s ) { + // linkify URLs, input is already HTML-escaped above + return 'a href=' + s + '' + s + '/a'; + } ); + return s; + }; + + + /** +* Class that creates inputs for a query and builds request data +* +* @constructor +* @param $container {jQuery} Container to put UI into +* @param info {Object} Query information +* @param prefix {String} Additional prefix for parameter names +*/ + function UiBuilder( $container, info, prefix ) { + this.$container = $container; + this.info = info; + this.prefix = prefix + info.prefix; + this.params = info.parameters; + + $container.addClass( 'api-sandbox-builder' ).data( 'builder', this ); + + this.createInputs(); + } + + UiBuilder.prototype = { + /** +* Creates inputs and places them into container +*/ + createInputs: function () { + var $table, $tbody, i, length, param, name; + + $table = $( 'table class=api-sandbox-params mw-datatabletheadtr/tr/theadtbody/tbody/table' ) + .find( ' thead tr' ) + .append( mw.html.element( 'th', { 'class': 'api-sandbox-params-label' }, mw.msg( 'apisb-params-param' ) ) ) + .append( mw.html.element( 'th', { 'class': 'api-sandbox-params-value' }, mw.msg( 'apisb-params-input' ) ) ) + .append( mw.html.element( 'th', {}, mw.msg( 'apisb-params-desc' ) ) ) + .end(); + $tbody = $table.find( ' tbody' ); + for ( i = 0, length = this.params.length; i length; i += 1 ) { + param = this.params[i]; + name = this.prefix + param.name; + + $( 'tr' ) + .append( + $( 'td class=api-sandbox-params-label/td' ) + .html( mw.html.element( 'label', + { 'for': 'param-' + name }, name ) +
[MediaWiki-commits] [Gerrit] Check whether history.pushState is supported - change (mediawiki...ApiSandbox)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/103722 Change subject: Check whether history.pushState is supported .. Check whether history.pushState is supported Bug: 45923 Change-Id: I0fa7313e0b2051b356703f9f0a5bb7bce2423f2f --- M resources/main.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApiSandbox refs/changes/22/103722/1 diff --git a/resources/main.js b/resources/main.js index 2b8b51a..ee6555b 100644 --- a/resources/main.js +++ b/resources/main.js @@ -577,7 +577,7 @@ historyEntry = '#' + url + params; - if ( window.location.hash !== historyEntry ) { + if ( window.location.hash !== historyEntry history history.pushState ) { history.pushState( null, '', historyEntry ); } url = mw.util.wikiScript( 'api' ) + '?' + url; -- To view, visit https://gerrit.wikimedia.org/r/103722 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0fa7313e0b2051b356703f9f0a5bb7bce2423f2f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ApiSandbox Gerrit-Branch: master Gerrit-Owner: MaxSem maxsem.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] Don't use bogus nonefm format - change (mediawiki...ApiSandbox)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/103723 Change subject: Don't use bogus nonefm format .. Don't use bogus nonefm format Bug: 57504 Change-Id: I3ecd8a0aea6908f6401430e889b1b9904cbbe672 --- M resources/main.js 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApiSandbox refs/changes/23/103723/1 diff --git a/resources/main.js b/resources/main.js index ee6555b..bbaae1f 100644 --- a/resources/main.js +++ b/resources/main.js @@ -550,7 +550,7 @@ } ); $form.submit( function ( e ) { - var url, params, mustBePosted, historyEntry; + var url, params, mustBePosted, historyEntry, formatStr; // Prevent browser from submitting the form // and reloading the page to the action-url. @@ -568,7 +568,8 @@ url += '' + $query.val(); params += queryRequest.getRequestData(); } - url += 'format=' + $format.val(); + formatStr = $format.val(); + url += 'format=' + formatStr; params += genericRequest.getRequestData(); if ( $( '#param-generator' ).length $( '#param-generator' ).val() ) { @@ -594,7 +595,10 @@ $requestUrl.val( url + params ); $postRow.hide(); } - url = url.replace( /(format=[^]+)/, '$1fm' ); + // There is no nonefm format + if ( formatStr != 'none' ) { + url = url.replace( /(format=[^]+)/, '$1fm' ); + } runQuery( { url: url, params: params, type: mustBePosted ? 'POST' : 'GET' } ); } ); -- To view, visit https://gerrit.wikimedia.org/r/103723 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ecd8a0aea6908f6401430e889b1b9904cbbe672 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ApiSandbox Gerrit-Branch: master Gerrit-Owner: MaxSem maxsem.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] update; minor comment added - change (pywikibot...drtrigonbot)
DrTrigon has uploaded a new change for review. https://gerrit.wikimedia.org/r/103724 Change subject: update; minor comment added .. update; minor comment added Change-Id: I9df6f6d24e1d3430e4b1651e97ce80d7dbff71ab --- M fabfile.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/drtrigonbot refs/changes/24/103724/1 diff --git a/fabfile.py b/fabfile.py index 50799c3..ac540a5 100644 --- a/fabfile.py +++ b/fabfile.py @@ -176,7 +176,7 @@ else: # toolserver # .about.me file...? local('ln -s pywikibot-drtrigonbot/.forward+subster .forward+subster') -local('chmod 600 ~/.forward*') +local('chmod 600 ~/.forward*') # changes 'pywikibot-drtrigonbot/.forward*' def sl_compat(): if LABS:# labs-tools -- To view, visit https://gerrit.wikimedia.org/r/103724 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9df6f6d24e1d3430e4b1651e97ce80d7dbff71ab Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/drtrigonbot Gerrit-Branch: master Gerrit-Owner: DrTrigon dr.tri...@surfeu.ch ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] update; minor comment added - change (pywikibot...drtrigonbot)
DrTrigon has submitted this change and it was merged. Change subject: update; minor comment added .. update; minor comment added Change-Id: I9df6f6d24e1d3430e4b1651e97ce80d7dbff71ab --- M fabfile.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: DrTrigon: Verified; Looks good to me, approved diff --git a/fabfile.py b/fabfile.py index 50799c3..ac540a5 100644 --- a/fabfile.py +++ b/fabfile.py @@ -176,7 +176,7 @@ else: # toolserver # .about.me file...? local('ln -s pywikibot-drtrigonbot/.forward+subster .forward+subster') -local('chmod 600 ~/.forward*') +local('chmod 600 ~/.forward*') # changes 'pywikibot-drtrigonbot/.forward*' def sl_compat(): if LABS:# labs-tools -- To view, visit https://gerrit.wikimedia.org/r/103724 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9df6f6d24e1d3430e4b1651e97ce80d7dbff71ab Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/drtrigonbot Gerrit-Branch: master Gerrit-Owner: DrTrigon dr.tri...@surfeu.ch Gerrit-Reviewer: DrTrigon dr.tri...@surfeu.ch ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Experiment with disabling per-section tidy - change (mediawiki...MobileFrontend)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/103725 Change subject: Experiment with disabling per-section tidy .. Experiment with disabling per-section tidy Introduce new variable, $wgMFTidyMobileViewSections, controlling per-section tidy in action=mobileview. Default behavior remains the same, however we can now experiment with it. Benefits include: * Tidy sucks, make the world a better place without it * It's slow - and since we can't afford caching every page, it affects performance profoundly * Divs across sections will look reasonably Change-Id: I8a95e7442100fc597ed2f7ded8b587709585f7d9 --- M MobileFrontend.php M includes/api/ApiMobileView.php 2 files changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/25/103725/1 diff --git a/MobileFrontend.php b/MobileFrontend.php index 7c8b9de..39ee4c7 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -435,3 +435,8 @@ * Controls whether new 1-column diffs should be used */ $wgMFEnableBetaDiff = false; + +/** + * Controls whether API action=mobileview should have every HTML section tidied for invalid markup + */ +$wgMFTidyMobileViewSections = true; diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php index d83aaeb..cb40697 100644 --- a/includes/api/ApiMobileView.php +++ b/includes/api/ApiMobileView.php @@ -273,7 +273,7 @@ } private function getData( Title $title, $noImages ) { - global $wgMemc, $wgUseTidy, $wgMFMinCachedPageSize; + global $wgMemc, $wgUseTidy, $wgMFTidyMobileViewSections, $wgMFMinCachedPageSize; wfProfileIn( __METHOD__ ); $wp = $this-makeWikiPage( $title ); @@ -353,7 +353,7 @@ if ( count( $data['text'] ) ) { $chunk = h$chunk; } - if ( $wgUseTidy count( $chunks ) 1 ) { + if ( $wgUseTidy $wgMFTidyMobileViewSections count( $chunks ) 1 ) { wfProfileIn( __METHOD__ . '-tidy' ); $chunk = MWTidy::tidy( $chunk ); wfProfileOut( __METHOD__ . '-tidy' ); -- To view, visit https://gerrit.wikimedia.org/r/103725 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a95e7442100fc597ed2f7ded8b587709585f7d9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: MaxSem maxsem.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Follow CSS conventions, including @embed - change (mediawiki...GuidedTour)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/103726 Change subject: Follow CSS conventions, including @embed .. Follow CSS conventions, including @embed Change-Id: I69d5e593a36b3dd5e7be94c2a68aa5e8d4e6c2dc --- M modules/ext.guidedTour.css M modules/mediawiki.libs.guiders/mediawiki.libs.guiders.css 2 files changed, 73 insertions(+), 77 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GuidedTour refs/changes/26/103726/1 diff --git a/modules/ext.guidedTour.css b/modules/ext.guidedTour.css index aba214a..a5a46dc 100644 --- a/modules/ext.guidedTour.css +++ b/modules/ext.guidedTour.css @@ -46,11 +46,13 @@ background-image: url(ext.guidedTour.arrows.png); } -.guider_arrow_right, .guider_arrow_left { +.guider_arrow_right, +.guider_arrow_left { height: 39px; } -.guider_arrow_up, .guider_arrow_down { +.guider_arrow_up, +.guider_arrow_down { height: 24px; } diff --git a/modules/mediawiki.libs.guiders/mediawiki.libs.guiders.css b/modules/mediawiki.libs.guiders/mediawiki.libs.guiders.css index 11e2e41..31f89ac 100755 --- a/modules/mediawiki.libs.guiders/mediawiki.libs.guiders.css +++ b/modules/mediawiki.libs.guiders/mediawiki.libs.guiders.css @@ -1,92 +1,86 @@ .guider { - background: #FFF; - border: 1px solid #666; - font-family: arial; - position: absolute; - outline: none; - padding: 4px 12px; - width: 500px; - z-index: 10005 !important; + background: #FFF; + border: 1px solid #666; + font-family: arial; + position: absolute; + outline: none; + padding: 4px 12px; + width: 500px; + z-index: 10005 !important; - /* Shadow */ - -moz-box-shadow: 0 0px 8px #111; - -webkit-box-shadow: 0 0px 8px #111; - box-shadow: 0 0px 8px #111; - /* End shadow */ + /* Shadow */ + -moz-box-shadow: 0 0px 8px #111; + -webkit-box-shadow: 0 0px 8px #111; + box-shadow: 0 0px 8px #111; + /* End shadow */ - /* Rounded corners */ - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - /* End rounded corners */ + /* Rounded corners */ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + /* End rounded corners */ } .guider_buttons { - height: 36px; - position: relative; - width: 100%; + height: 36px; + position: relative; + width: 100%; } .guider_content { - position: relative; + position: relative; } .guider_content h1 { - color: #1054AA; - float: left; - font-size: 21px; - width: 95%; + color: #1054AA; + float: left; + font-size: 21px; + width: 95%; } .guider_close { - float: right; - padding: 10px 0 0; + float: right; + padding: 10px 0 0; } .x_button { - cursor: pointer; - height: 13px; - width: 13px; - background-repeat: no-repeat; - background-image:
[MediaWiki-commits] [Gerrit] i18n: remove BOM character - change (mediawiki...LinkedWiki)
Shirayuki has uploaded a new change for review. https://gerrit.wikimedia.org/r/103727 Change subject: i18n: remove BOM character .. i18n: remove BOM character Change-Id: Ie709ddafd60f448f75d36379b306d5d72caa6db7 --- M LinkedWiki.i18n.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LinkedWiki refs/changes/27/103727/1 diff --git a/LinkedWiki.i18n.php b/LinkedWiki.i18n.php index 1846eae..b5a4656 100644 --- a/LinkedWiki.i18n.php +++ b/LinkedWiki.i18n.php @@ -1,4 +1,4 @@ -?php +?php $messages = array(); -- To view, visit https://gerrit.wikimedia.org/r/103727 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie709ddafd60f448f75d36379b306d5d72caa6db7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LinkedWiki Gerrit-Branch: master Gerrit-Owner: Shirayuki shirayuk...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] i18n: remove BOM character - change (mediawiki...PushToWatch)
Shirayuki has uploaded a new change for review. https://gerrit.wikimedia.org/r/103728 Change subject: i18n: remove BOM character .. i18n: remove BOM character Change-Id: Ide44abe582486d499c99e8c2d2b2b0dbc3cb57df --- M PushToWatch.i18n.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PushToWatch refs/changes/28/103728/1 diff --git a/PushToWatch.i18n.php b/PushToWatch.i18n.php index b62c930..316dcae 100644 --- a/PushToWatch.i18n.php +++ b/PushToWatch.i18n.php @@ -1,4 +1,4 @@ -?php +?php /** * i18n message definitions for the PushToWatch extension. * -- To view, visit https://gerrit.wikimedia.org/r/103728 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide44abe582486d499c99e8c2d2b2b0dbc3cb57df Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PushToWatch Gerrit-Branch: master Gerrit-Owner: Shirayuki shirayuk...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] i18n: remove BOM character - change (mediawiki...QuizTabulate)
Shirayuki has uploaded a new change for review. https://gerrit.wikimedia.org/r/103729 Change subject: i18n: remove BOM character .. i18n: remove BOM character Change-Id: Icadcc7d4e421a99e5b3f5b57d8ecc57209dc4dff --- M QuizTabulate.i18n.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuizTabulate refs/changes/29/103729/1 diff --git a/QuizTabulate.i18n.php b/QuizTabulate.i18n.php index 2028ee8..5c4ef11 100644 --- a/QuizTabulate.i18n.php +++ b/QuizTabulate.i18n.php @@ -1,4 +1,4 @@ -?php +?php /** * Internationalization file. */ -- To view, visit https://gerrit.wikimedia.org/r/103729 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icadcc7d4e421a99e5b3f5b57d8ecc57209dc4dff Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/QuizTabulate Gerrit-Branch: master Gerrit-Owner: Shirayuki shirayuk...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fix import sources for all chapter wikis - change (operations/mediawiki-config)
Jeremyb has uploaded a new change for review. https://gerrit.wikimedia.org/r/103731 Change subject: fix import sources for all chapter wikis .. fix import sources for all chapter wikis fix where broken and standardize everyone on the new scheme related to Bug 31042 now probably coincidentally working (but maybe not for some sister projects): co, et, fi, mk, no, se, tr (country code and lang code are the same or some other, unrelated lang happens to exist to at least make it not NXDOMAIN) * co had e:en, not sure what that was supposed to be, removed for now probably broken: mx, ru * mx is not a lang * ru was using 'r' instead of ru? already was going through meta as the first hop: nyc fixed in previous changeset (I29941e17f7851c5a93): br (Bug 58936) Change-Id: I2180ce9ff6901174c5cf3f5ca9d33eceaa930c09 --- M wmf-config/InitialiseSettings.php 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/31/103731/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index c6de8b0..b4401bd 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -8648,7 +8648,7 @@ 'chywiki' = array( 'en', 'fr', ), 'ckbwiki' = array( 'fa', 'ar', 'ku', 'en', 'de', 'fr', 'it', 'es', 'ru', 'pt', ), // bug 52633 'commonswiki' = array( 'meta', 'w:en', 'w:de', 'w:fr', 'w:pl', 'w:ja', 'w:es', 'w:nl', 'w:ru', 'w:sv', 'w:ja', 'w:it', 'w:pt', 'w:zh', 'wikibooks:en', 'mediawikiwiki', 'foundation', 'wikidata'), // bug 54001 - 'cowikimedia' = array( 'meta', 'w:es', 'b:es', 'v:es', 'e:en' ), + 'cowikimedia' = array( 'meta', 'wikipedia:es', 'wikibooks:es', 'wikiversity:es' ), 'crhwiki' = array( 'incubator' ), 'crwiki' = array( 'en', 'fr' ), 'cswiki' = array( 'b', 'meta', 'n', 'q', 's', 'v', 'wikt' ), @@ -8693,12 +8693,12 @@ 'etwiki' = array( 'b', 'q', 's', 'wikt' ), 'etwikisource' = array( 'w' ), 'etwiktionary' = array( 'w' ), - 'etwikimedia' = array( 'w', 'meta' ), + 'etwikimedia' = array( 'wikipedia:et', 'meta' ), 'extwiki' = array( 'incubator' ), 'fdcwiki' = array( 'meta' ), 'fiwikisource' = array( 'OldWikisource', 'w', 'b' ), 'fiwikiversity' = array( 'b', 'q', 'n', 's', 'wikt', 'w', 'betawikiversity' ), - 'fiwikimedia' = array( 'w', 'meta' ), + 'fiwikimedia' = array( 'wikipedia:fi', 'meta' ), 'foundationwiki' = array( 'meta' ), 'frrwiki' = array( 'en', 'de', 'nds', 's:de', 'oldwikisource' ), # s:de and oldwikisource per bug 38023 'frwiki' = array( @@ -8787,27 +8787,27 @@ 'mediawikiwiki' = array( 'meta', 'w:en', 'usability' ), 'metawiki' = array( 'commons', 'foundation', 'w', 'cs', 'fr', 'strategy' ), 'mgwiktionary' = array( 'fr', 'io', 'en', 'w', ), - 'mkwikimedia' = array( 'meta', 'w' ), + 'mkwikimedia' = array( 'meta', 'wikipedia:mk' ), 'mlwiki' = array( 'en' ), 'mlwikibooks' = array( 'w', 'en' ), // bug 50156 'mlwikisource' = array( 'w', 'en', 'w:en', ), 'mlwikiquote' = array( 'en', 'w:en', 'w' ), 'mswiki' = array( 'id' ), # bug 16033 'mswiktionary' = array( 'w' ), - 'mxwikimedia' = array( 'meta', 'w:es', 'b:es', 'v:es', 'w:en', ), + 'mxwikimedia' = array( 'meta', 'wikipedia:es', 'wikibooks:es', 'wikiversity:es', 'wikipedia:en', ), 'myvwiki' = array( 'incubator' ), 'ndswiki' = array( 'en', 'de', 'nl', 'nds-nl', 'wikt' ), 'nlwikibooks' = array( 'w' ), 'nlwikisource' = array( 'w', 'wikt', 'q', 'b', 'n', 'nl', 'de', 'en' ), 'nlwiktionary' = array( 'w', 'en', 'fr' ), 'nowiki' = array( 's', 'q', 'nn', 'da', 'sv', 'nl', 'en', 'de' ), - 'nowikimedia' = array( 'meta', 'w', 'w:nn', 'w:se' ), + 'nowikimedia' = array( 'meta', 'wikipedia:no', 'wikipedia:nn', 'wikipedia:se' ), 'nowikibooks' = array( 'sv', 'da', 'en', 'w', 'w:nn', 'w:sv', 'w:da', 'w:en' ), 'nowikinews' = array( 'sv' ), 'nowikiquote' = array( 'w', 'en', 'nn' ), 'nowikisource' = array( 'w' ), 'nowiktionary' = array( 'w' ), - 'nycwikimedia' = array( 'm:w', 'meta' ), + 'nycwikimedia' = array( 'wikipedia:en', 'meta' ), 'orwiki' = array( 'en', 'commons' ), 'otrs_wikiwiki' = array( 'meta' ), 'outreachwiki' = array( 'w:en', 'w:de', 'w:fr', 'w:pl', 'w:it', 'w:ja', 'w:es', 'w:nl', 'w:pt', 'w:ru', 'w:sv', 'commons', 'foundation', 'm', ), @@ -8823,7 +8823,7 @@ 'ptwikiversity' = array( 'incubator', 'w', 'b', ), 'rowikibooks' = array( 'w', 's' ), 'ruwikibooks' = array( 'w', 's', ), - 'ruwikimedia' = array( 'meta', 'foundation', 'r', ), + 'ruwikimedia' = array( 'meta', 'foundation', 'wikipedia:ru', ),
[MediaWiki-commits] [Gerrit] import sources: move chapter wikis to own section - change (operations/mediawiki-config)
Jeremyb has uploaded a new change for review. https://gerrit.wikimedia.org/r/103732 Change subject: import sources: move chapter wikis to own section .. import sources: move chapter wikis to own section Change-Id: I7d717b682d2f9db65ae5ebe2940f3c474686f448 --- M wmf-config/InitialiseSettings.php 1 file changed, 17 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/32/103732/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index b4401bd..1d5bba1 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -8625,6 +8625,23 @@ 'wikiversity' = array( 'meta', 'b', 'incubator' ), // Specific wikis + +// chapter wikis + 'bewikimedia' = array( 'meta' ), + 'brwikimedia' = array( 'wikipedia:pt', 'meta', 'wiktionary:pt', 'wikisource:pt', 'wikinews:pt', 'wikiquote:pt', 'wikibooks:pt', 'wikiversity:pt', 'commons' ), + 'cowikimedia' = array( 'meta', 'wikipedia:es', 'wikibooks:es', 'wikiversity:es' ), + 'etwikimedia' = array( 'wikipedia:et', 'meta' ), + 'fiwikimedia' = array( 'wikipedia:fi', 'meta' ), + 'mkwikimedia' = array( 'meta', 'wikipedia:mk' ), + 'mxwikimedia' = array( 'meta', 'wikipedia:es', 'wikibooks:es', 'wikiversity:es', 'wikipedia:en', ), + 'nowikimedia' = array( 'meta', 'wikipedia:no', 'wikipedia:nn', 'wikipedia:se' ), + 'nycwikimedia' = array( 'wikipedia:en', 'meta' ), + 'ruwikimedia' = array( 'meta', 'foundation', 'wikipedia:ru', ), + 'sewikimedia' = array( 'wikipedia:sv' ), + 'trwikimedia' = array( 'wikipedia:tr', 'meta' ), + 'ukwikimedia' = array( 'meta' ), + +// content wikis 'alswiki' = array( 'de', 'wikt', 'b', 'q', 'en', 'fr', 'it', 'b:de' ), 'alswikibooks' = array( 'b:de', 'w' ), 'arbcom_enwiki' = array( 'meta', 'w' ), @@ -8636,9 +8653,7 @@ 'arwikiversity' = array( 'w', 'b', 'n', 'q', 's', 'wikt' ), 'arzwiki' = array( 'incubator', 'en', 'ar', 'es', 'fr', ), 'betawikiversity' = array( 'meta', 'b', 'en', 'incubator', 'de', 'wikipedia:lt' ), - 'bewikimedia' = array( 'meta' ), 'bnwiki' = array ( 'en' ), # Bug 34791 - 'brwikimedia' = array( 'wikipedia:pt', 'meta', 'wiktionary:pt', 'wikisource:pt', 'wikinews:pt', 'wikiquote:pt', 'wikibooks:pt', 'wikiversity:pt', 'commons' ), 'bnwikisource' = array( 'OldWikisource', 'w', 'en' ), 'cawikibooks' = array( 'w', 's', ), 'cawikinews' = array( 'w', 'wikt', 'q', 'b', 's', 'v', 'fr', 'en', 'de', 'es', 'pt', 'it', 'commons', 'meta', 'eo' ), @@ -8648,7 +8663,6 @@ 'chywiki' = array( 'en', 'fr', ), 'ckbwiki' = array( 'fa', 'ar', 'ku', 'en', 'de', 'fr', 'it', 'es', 'ru', 'pt', ), // bug 52633 'commonswiki' = array( 'meta', 'w:en', 'w:de', 'w:fr', 'w:pl', 'w:ja', 'w:es', 'w:nl', 'w:ru', 'w:sv', 'w:ja', 'w:it', 'w:pt', 'w:zh', 'wikibooks:en', 'mediawikiwiki', 'foundation', 'wikidata'), // bug 54001 - 'cowikimedia' = array( 'meta', 'wikipedia:es', 'wikibooks:es', 'wikiversity:es' ), 'crhwiki' = array( 'incubator' ), 'crwiki' = array( 'en', 'fr' ), 'cswiki' = array( 'b', 'meta', 'n', 'q', 's', 'v', 'wikt' ), @@ -8693,12 +8707,10 @@ 'etwiki' = array( 'b', 'q', 's', 'wikt' ), 'etwikisource' = array( 'w' ), 'etwiktionary' = array( 'w' ), - 'etwikimedia' = array( 'wikipedia:et', 'meta' ), 'extwiki' = array( 'incubator' ), 'fdcwiki' = array( 'meta' ), 'fiwikisource' = array( 'OldWikisource', 'w', 'b' ), 'fiwikiversity' = array( 'b', 'q', 'n', 's', 'wikt', 'w', 'betawikiversity' ), - 'fiwikimedia' = array( 'wikipedia:fi', 'meta' ), 'foundationwiki' = array( 'meta' ), 'frrwiki' = array( 'en', 'de', 'nds', 's:de', 'oldwikisource' ), # s:de and oldwikisource per bug 38023 'frwiki' = array( @@ -8787,27 +8799,23 @@ 'mediawikiwiki' = array( 'meta', 'w:en', 'usability' ), 'metawiki' = array( 'commons', 'foundation', 'w', 'cs', 'fr', 'strategy' ), 'mgwiktionary' = array( 'fr', 'io', 'en', 'w', ), - 'mkwikimedia' = array( 'meta', 'wikipedia:mk' ), 'mlwiki' = array( 'en' ), 'mlwikibooks' = array( 'w', 'en' ), // bug 50156 'mlwikisource' = array( 'w', 'en', 'w:en', ), 'mlwikiquote' = array( 'en', 'w:en', 'w' ), 'mswiki' = array( 'id' ), # bug 16033 'mswiktionary' = array( 'w' ), - 'mxwikimedia' = array( 'meta', 'wikipedia:es', 'wikibooks:es', 'wikiversity:es', 'wikipedia:en', ), 'myvwiki' = array( 'incubator' ), 'ndswiki' = array( 'en', 'de', 'nl', 'nds-nl', 'wikt' ), 'nlwikibooks' = array( 'w' ), 'nlwikisource' = array( 'w', 'wikt', 'q', 'b', 'n', 'nl', 'de', 'en' ), 'nlwiktionary' = array( 'w', 'en',
[MediaWiki-commits] [Gerrit] brwikimedia: fix import sources - change (operations/mediawiki-config)
Jeremyb has uploaded a new change for review. https://gerrit.wikimedia.org/r/103730 Change subject: brwikimedia: fix import sources .. brwikimedia: fix import sources most are not working now scopy format from mxwikimedia / cowikimedia/s On second thought, mxwikimedia/cowikimedia are also wrong... fixing brwikimedia first and other chapters in I2180ce9ff6901174c5cf3f5ca9d related to Bug 31042 Bug: 58936 Change-Id: I29941e17f7851c5a93d9ddb58dae9a134cc789aa --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/30/103730/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index d3bf4f3..c6de8b0 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -8638,7 +8638,7 @@ 'betawikiversity' = array( 'meta', 'b', 'en', 'incubator', 'de', 'wikipedia:lt' ), 'bewikimedia' = array( 'meta' ), 'bnwiki' = array ( 'en' ), # Bug 34791 - 'brwikimedia' = array( 'pt', 'meta', 'pt:w', 'pt:wikt', 'pt:s', 'pt:n', 'pt:q', 'pt:b', 'pt:v', 'commons' ), + 'brwikimedia' = array( 'wikipedia:pt', 'meta', 'wiktionary:pt', 'wikisource:pt', 'wikinews:pt', 'wikiquote:pt', 'wikibooks:pt', 'wikiversity:pt', 'commons' ), 'bnwikisource' = array( 'OldWikisource', 'w', 'en' ), 'cawikibooks' = array( 'w', 's', ), 'cawikinews' = array( 'w', 'wikt', 'q', 'b', 's', 'v', 'fr', 'en', 'de', 'es', 'pt', 'it', 'commons', 'meta', 'eo' ), -- To view, visit https://gerrit.wikimedia.org/r/103730 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I29941e17f7851c5a93d9ddb58dae9a134cc789aa Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Jeremyb jer...@tuxmachine.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Increase number of threads for Searching - change (apps...wikipedia)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/103733 Change subject: Increase number of threads for Searching .. Increase number of threads for Searching Improves apparent performance when someone is typing slowly. Change-Id: Iceb24a4d900a8b7bc176c16796fcf94e9fb5922c --- M wikipedia/src/main/java/org/wikimedia/wikipedia/SearchArticlesTask.java 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/33/103733/1 diff --git a/wikipedia/src/main/java/org/wikimedia/wikipedia/SearchArticlesTask.java b/wikipedia/src/main/java/org/wikimedia/wikipedia/SearchArticlesTask.java index e61fc9e..35d56e0 100644 --- a/wikipedia/src/main/java/org/wikimedia/wikipedia/SearchArticlesTask.java +++ b/wikipedia/src/main/java/org/wikimedia/wikipedia/SearchArticlesTask.java @@ -15,7 +15,7 @@ private final Site site; public SearchArticlesTask(Api api, Site site, String prefix) { - super(ExecutorService.getSingleton().getExecutor(SearchArticlesTask.class, 2), api); + super(ExecutorService.getSingleton().getExecutor(SearchArticlesTask.class, 4), api); this.prefix = prefix; this.site = site; } -- To view, visit https://gerrit.wikimedia.org/r/103733 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iceb24a4d900a8b7bc176c16796fcf94e9fb5922c Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master 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] Breaking Change: All lower case excludedtitle for consistency - change (mediawiki...GettingStarted)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/103734 Change subject: Breaking Change: All lower case excludedtitle for consistency .. Breaking Change: All lower case excludedtitle for consistency This is the standard for the MW API. See, for example, https://www.mediawiki.org/wiki/API:Query Change-Id: If2835fe099ba0455c721828d579027bda1772a8a --- M api/ApiGettingStartedGetPages.php 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GettingStarted refs/changes/34/103734/1 diff --git a/api/ApiGettingStartedGetPages.php b/api/ApiGettingStartedGetPages.php index b1fcc22..f19b1d0 100644 --- a/api/ApiGettingStartedGetPages.php +++ b/api/ApiGettingStartedGetPages.php @@ -16,7 +16,7 @@ $user = $this-getUser(); $taskName = $this-getParameter( 'taskname' ); - $excludedTitle = Title::newFromText( $this-getParameter( 'excludedTitle' ) ); + $excludedTitle = Title::newFromText( $this-getParameter( 'excludedtitle' ) ); $count = $this-getParameter( 'count' ); if ( !isset( $wgGettingStartedTasks[$taskName] ) ) { @@ -99,7 +99,7 @@ public function getParamDescription() { return array( 'taskname' = 'Task name, for example, copyedit', - 'excludedTitle' = 'Full title of a page to exclude from the list', + 'excludedtitle' = 'Full title of a page to exclude from the list', 'count' = 'Requested count; will attempt to fetch this exact number, but may fetch fewer if no more are found after multiple attempts' ); } @@ -110,7 +110,7 @@ ApiBase::PARAM_TYPE = 'string', ApiBase::PARAM_REQUIRED = true, ), - 'excludedTitle' = array( + 'excludedtitle' = array( ApiBase::PARAM_TYPE = 'string', ApiBase::PARAM_REQUIRED = false, ), @@ -123,7 +123,7 @@ public function getExamples() { return array( - 'api.php?action=gettingstartedgetpagestaskname=copyeditexcludedTitle=Earthcount=1', + 'api.php?action=gettingstartedgetpagestaskname=copyeditexcludedtitle=Earthcount=1', ); } } -- To view, visit https://gerrit.wikimedia.org/r/103734 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2835fe099ba0455c721828d579027bda1772a8a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GettingStarted Gerrit-Branch: master Gerrit-Owner: Mattflaschen mflasc...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Show network error only if it is actually a network error - change (apps...wikipedia)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/103735 Change subject: Show network error only if it is actually a network error .. Show network error only if it is actually a network error Throw a runtime exception otherwise Change-Id: I9c0d34c2f3f2b26f38bdbf7c34705becf0376d0e --- M wikipedia/src/main/java/org/wikimedia/wikipedia/PageViewFragment.java 1 file changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/35/103735/1 diff --git a/wikipedia/src/main/java/org/wikimedia/wikipedia/PageViewFragment.java b/wikipedia/src/main/java/org/wikimedia/wikipedia/PageViewFragment.java index d3eaa65..e061c0e 100644 --- a/wikipedia/src/main/java/org/wikimedia/wikipedia/PageViewFragment.java +++ b/wikipedia/src/main/java/org/wikimedia/wikipedia/PageViewFragment.java @@ -13,6 +13,7 @@ import org.json.JSONException; import org.json.JSONObject; import org.mediawiki.api.json.Api; +import org.mediawiki.api.json.ApiException; import org.mediawiki.api.json.ApiResult; import org.mediawiki.api.json.RequestBuilder; import org.wikimedia.wikipedia.events.PageStateChangeEvent; @@ -240,12 +241,16 @@ @Override public void onCatch(Throwable caught) { -// Should check for the source of the error and have different things turn up -// But good enough for now -Utils.crossFade(loadProgress, networkError); -// Not sure why this is required, but without it tapping retry hides networkError -// FIXME: INVESTIGATE WHY THIS HAPPENS! -networkError.setVisibility(View.VISIBLE); +if (caught instanceof ApiException) { +// Should check for the source of the error and have different things turn up +// But good enough for now +Utils.crossFade(loadProgress, networkError); +// Not sure why this is required, but without it tapping retry hides networkError +// FIXME: INVESTIGATE WHY THIS HAPPENS! +networkError.setVisibility(View.VISIBLE); +} else { +throw new RuntimeException(caught); +} } } -- To view, visit https://gerrit.wikimedia.org/r/103735 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c0d34c2f3f2b26f38bdbf7c34705becf0376d0e Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master 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] Remove documentation description for non-existing parameter - change (pywikibot/core)
Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/103736 Change subject: Remove documentation description for non-existing parameter .. Remove documentation description for non-existing parameter Change-Id: Ifd4b7f598d170d3656392a3fb9b01d5edfa736f0 --- M pywikibot/site.py 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/36/103736/1 diff --git a/pywikibot/site.py b/pywikibot/site.py index 27558be..a090d04 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -2692,7 +2692,6 @@ @param page: The Page to be saved; its .text property will be used as the new text to be saved to the wiki -@param token: the edit token retrieved using Site.token() @param summary: the edit summary (required!) @param minor: if True (default), mark edit as minor @param notminor: if True, override account preferences to mark edit -- To view, visit https://gerrit.wikimedia.org/r/103736 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd4b7f598d170d3656392a3fb9b01d5edfa736f0 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Guoguo12 guogu...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Client-side wrapper for GettingStartedGetPages API - change (mediawiki...GettingStarted)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/103737 Change subject: Client-side wrapper for GettingStartedGetPages API .. Client-side wrapper for GettingStartedGetPages API Change-Id: Ib3584fe14bd03d25356a3538f9e11b14ad42a6c1 --- M GettingStarted.php A resources/ext.gettingstarted.api.js 2 files changed, 56 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GettingStarted refs/changes/37/103737/1 diff --git a/GettingStarted.php b/GettingStarted.php index 5733722..f1ac607 100644 --- a/GettingStarted.php +++ b/GettingStarted.php @@ -190,6 +190,15 @@ ) ) + $gettingStartedModuleInfo; +// Mixins for mediawiki.api +$wgResourceModules[ 'ext.gettingstarted.api' ] = array( + 'scripts' = 'ext.gettingstarted.api.js', + 'dependencies' = array( + 'mediawiki.api', + 'mediawiki.Title', + ), +) + $gettingStartedModuleInfo; + $wgResourceModules[ 'ext.gettingstarted.openTask' ] = array( 'scripts' = 'ext.gettingstarted.openTask.js', 'dependencies' = array( diff --git a/resources/ext.gettingstarted.api.js b/resources/ext.gettingstarted.api.js new file mode 100644 index 000..34a1646 --- /dev/null +++ b/resources/ext.gettingstarted.api.js @@ -0,0 +1,47 @@ +( function ( mw, $ ) { + // Client-side wrappers for the GettingStarted web API + + $.extend( mw.Api.prototype, { + /** +* @param {Object} options API parameters +* @param {String} options.taskName name of task type, such as 'copyedit' +* @param {String} [options.excludedTitle] title to exclude, as string +* @param {Number} options.count number of titles to request. It may return fewer +* than count, but never more. +* @return {jQuery.Promise} promise resolving to processed API response +* @return {Array} return.done on success, promise's done callback is called with +* an array of title strings +* @return {String} return.fail on failure, promise's fail callback is called with +* the error code +* +*/ + gettingStartedGetPages: function ( options ) { + var params, dfd; + + dfd = $.Deferred(); + + params = { + action: 'gettingstartedgetpages', + taskname: options.taskName, + count: options.count + }; + + if ( options.excludedTitle ) { + params.excludedtitle = options.excludedTitle; + } + + this.get( params ).done( function ( resp ) { + var root = resp.gettingstartedgetpages; + if ( root root.titles ) { + dfd.resolve( root.titles ); + } else { + dfd.reject( 'gettingstarted-unexpected-api-response' ); + } + } ).fail( function ( errCode ) { + dfd.reject( errCode ); + } ); + + return dfd.promise(); + } + } ); +}( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/103737 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3584fe14bd03d25356a3538f9e11b14ad42a6c1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GettingStarted Gerrit-Branch: master Gerrit-Owner: Mattflaschen mflasc...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set UI language from Accept-Language header - change (wikimedia/wikimania-scholarships)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/103738 Change subject: Set UI language from Accept-Language header .. Set UI language from Accept-Language header Use the bast match between the available translations and the request's Accept-Language header to set the UI language when the user hasn't explicitly chosen a language. Bug: 58908 Change-Id: I422d742af4b9fc1f6155148ce29b156b1acf5520 --- M src/Wikimania/Scholarship/Lang.php A tests/Wikimania/Scholarship/LangTest.php A tests/Wikimania/Scholarship/i18n/bar.json A tests/Wikimania/Scholarship/i18n/en.json A tests/Wikimania/Scholarship/i18n/foo.json A tests/Wikimania/Scholarship/i18n/qqq.json 6 files changed, 150 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships refs/changes/38/103738/1 diff --git a/src/Wikimania/Scholarship/Lang.php b/src/Wikimania/Scholarship/Lang.php index 172aa49..ebb183e 100644 --- a/src/Wikimania/Scholarship/Lang.php +++ b/src/Wikimania/Scholarship/Lang.php @@ -58,6 +58,7 @@ */ protected $defaultLang; + /** * @param string $dir Directory containing language files * @param string $default Default language @@ -106,7 +107,7 @@ continue; } - $lang = substr( basename( $file ), 0, -5 ); + $lang = strtolower( substr( basename( $file ), 0, -5 ) ); if ( $lang === 'qqq' ) { // Ignore message documentation continue; @@ -128,6 +129,7 @@ return array_keys( $this-messages ); } + /** * Get the active language. * @return string Selected language @@ -140,7 +142,14 @@ $lang = $_SESSION['uselang']; } else { - $lang = $this-defaultLang; + $wants = self::parseAcceptLanguage(); + $bestMatches = array_intersect( $wants, $this-getLangs() ); + if ( $bestMatches ) { + $lang = current( $bestMatches ); + + } else { + $lang = $this-defaultLang; + } } if ( $lang !== 'qqx' ) { @@ -155,6 +164,7 @@ $this-lang = $lang; return $lang; } + /** * Get a message string. @@ -180,7 +190,6 @@ $msg = $this-messages['en'][$key]; } else { - // FIXME: log missing translation $this-logger-warning( 'No translation for key {key} in {lang} or en', array( 'method' = __METHOD__, @@ -208,4 +217,43 @@ return $msg; } + + /** +* Parse the Accept-Language header present in the request and return an +* ordered list of lanaguages preferred by the user-agent. +* +* @return array List of preferred languages +*/ + public static function parseAcceptLanguage() { + if ( !isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) { + return array(); + } + + $weighted = array(); + + // Strip any whitespace in the header value + $hdr = preg_replace( '/\s+/', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ); + // Split on commas + $parts = explode( ',', $hdr ); + foreach ( $parts as $idx = $part ) { + if ( strpos( $part, ';q=' ) ) { + // Extract relative weight from component + list( $lang, $weight ) = explode( ';q=', $part ); + $weight = (float)$weight; + + } else { + $lang = $part; + $weight = 1; + } + + if ( $lang != '*' $weight 0 ) { + // Decorate the weight with the original position to make sort stable + $weighted[strtolower( $lang )] = array( $weight, -$idx ); + } + } + + arsort( $weighted ); + return array_keys( $weighted ); + } + } diff --git a/tests/Wikimania/Scholarship/LangTest.php b/tests/Wikimania/Scholarship/LangTest.php new file mode 100644 index 000..7dffb16 --- /dev/null +++ b/tests/Wikimania/Scholarship/LangTest.php @@ -0,0 +1,95 @@ +?php +/** + * @section LICENSE + * This program is free software; you can redistribute it and/or modify + *
[MediaWiki-commits] [Gerrit] Add language (interwiki) links on demand - change (mediawiki...MobileFrontend)
Theopolisme has uploaded a new change for review. https://gerrit.wikimedia.org/r/103739 Change subject: Add language (interwiki) links on demand .. Add language (interwiki) links on demand Don't load langlinks when initially loading the page; instead, wait until the button is pressed. Create Special:Languages as a fallback to the LanguageOverlay (primarily for users without JavaScript). Make LanguageOverlay load data from Special:Languages instead of the API, because language variant data isn't available through the API. This is all done in beta (when it goes stable, there are redundant functions that should be removed and have been marked as such). Bug: 40678 Change-Id: I7d5f2fa9c6d30fe2f2ca2d194f6ecbe72b02c88b --- M MobileFrontend.alias.php M MobileFrontend.i18n.php M MobileFrontend.php M includes/skins/MobileTemplateBeta.php M includes/skins/SkinMinerva.php A includes/specials/SpecialLanguages.php M javascripts/common/Page.js M javascripts/common/PageApi.js M javascripts/modules/languagesNew/languages.js 9 files changed, 219 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/39/103739/1 diff --git a/MobileFrontend.alias.php b/MobileFrontend.alias.php index b4f6118..6896faf 100644 --- a/MobileFrontend.alias.php +++ b/MobileFrontend.alias.php @@ -18,6 +18,7 @@ 'MobileEditor' = array( 'MobileEditor' ), 'MobileMenu' = array( 'MobileMenu' ), 'Nearby' = array( 'Nearby' ), + 'Languages' = array( 'Languages' ), 'UserProfile' = array( 'UserProfile' ), ); diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php index e181f0f..45bb4a3 100644 --- a/MobileFrontend.i18n.php +++ b/MobileFrontend.i18n.php @@ -73,13 +73,21 @@ 'mobile-frontend-on' = 'ON', 'mobile-frontend-featured-article' = 'Today\'s featured content', 'mobile-frontend-news-items' = 'In The News', - 'mobile-frontend-language-heading' = 'strongLanguages/strong', + + // languages special page + 'mobile-frontend-languages-title' = 'Languages for $1', + 'mobile-frontend-languages-text' = '$1 is available in $2 {{PLURAL:$2|language|languages}}.', + 'mobile-frontend-languages-header' = 'Languages', + 'mobile-frontend-languages-variant-header' = '{{#language:{{CONTENTLANG variants', + 'mobile-frontend-language-article-heading' = 'Read in another language', + 'mobile-frontend-language-heading' = 'strongLanguages/strong', 'mobile-frontend-current-language' = '{{#language:{{CONTENTLANG', 'mobile-frontend-language-header' = 'This page is available in $1 {{PLURAL:$1|language|languages}}', 'mobile-frontend-language-variant-header' = 'Choose {{#language:{{CONTENTLANG variant', 'mobile-frontend-language-footer' = 'Note: This page may not be written in your preferred language. You can see which languages {{SITENAME}} supports by clicking here.', 'mobile-frontend-language-site-choose' = 'Search language', + 'mobile-frontend-username' = 'Username:', 'mobile-frontend-password' = 'Password:', 'mobile-frontend-username-placeholder' = 'Username', @@ -518,6 +526,13 @@ {{Identical|On}}', 'mobile-frontend-featured-article' = 'The title that will appear before the element with the mf-tfa selector.', 'mobile-frontend-news-items' = 'The title that will appear before the element with the mf-itn selector.', + 'mobile-frontend-languages-title' = 'The title for the Special:Languages page.', + 'mobile-frontend-languages-text' = 'Introduction to the Special:Languages page. +* $1 - page title +* $2 - number of languages +', + 'mobile-frontend-languages-header' = 'Header on the Special:Languages page.', + 'mobile-frontend-languages-variant-header' = 'Header on the Special:Languages page.', 'mobile-frontend-language-heading' = 'The title for the list of languages for a page. {{Identical|Language}}', 'mobile-frontend-language-article-heading' = 'A heading within the page the content of which lists the other languages available for this page: translate the message considering the list to have an undetermined number of items.', diff --git a/MobileFrontend.php b/MobileFrontend.php index 8801a34..bcd9dce 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -76,6 +76,7 @@ 'SpecialMobileWatchlist' = 'specials/SpecialMobileWatchlist', 'SpecialMobileContributions' = 'specials/SpecialMobileContributions', 'SpecialNearby' = 'specials/SpecialNearby', + 'SpecialLanguages' = 'specials/SpecialLanguages', 'SpecialMobileNotifications' = 'specials/SpecialMobileNotifications', 'MobileSpecialPage' = 'specials/MobileSpecialPage', 'MobileSpecialPageFeed' = 'specials/MobileSpecialPageFeed', @@ -143,6 +144,7 @@
[MediaWiki-commits] [Gerrit] WIP: Remove uses of Special:GettingStarted from task toolbar - change (mediawiki...GettingStarted)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/103740 Change subject: WIP: Remove uses of Special:GettingStarted from task toolbar .. WIP: Remove uses of Special:GettingStarted from task toolbar * Remove now-unneeded dependencies * Don't put everything in doc ready, so AJAX request can kick off before it. * Needs design work for both regular state (changed to no longer have link to Special:GettingStarted) and error state (no Try Another either) Change-Id: I315352b72f9dd148c02e2078f22ca493d1f20dd9 --- M GettingStarted.i18n.php M GettingStarted.php M resources/ext.gettingstarted.taskToolbar.js 3 files changed, 55 insertions(+), 42 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GettingStarted refs/changes/40/103740/1 diff --git a/GettingStarted.i18n.php b/GettingStarted.i18n.php index 6266100..34337ef 100644 --- a/GettingStarted.i18n.php +++ b/GettingStarted.i18n.php @@ -36,8 +36,6 @@ // Toolbar above page, when they have chosen a task and been redirected /// Shared among all tasks - 'gettingstarted-task-toolbar-return-to-list-text' = '◄ Choose another task', - 'gettingstarted-task-toolbar-return-to-list-title' = 'Return to the task choice page', 'gettingstarted-task-toolbar-editing-help-text' = 'Show me how', 'gettingstarted-task-toolbar-editing-help-title' = 'Show a guide on how to edit', 'gettingstarted-task-toolbar-try-another-text' = 'Try another page ►', diff --git a/GettingStarted.php b/GettingStarted.php index f1ac607..8367d05 100644 --- a/GettingStarted.php +++ b/GettingStarted.php @@ -231,16 +231,13 @@ 'mediawiki.action.view.postEdit', 'mediawiki.jqueryMsg', 'mediawiki.Title', - 'mediawiki.Uri', - 'mediawiki.util', 'mediawiki.libs.guiders', 'ext.guidedTour.lib', 'ext.guidedTour.tour.gettingstartedtasktoolbarintro', + 'ext.gettingstarted.api', 'ext.gettingstarted.logging', ), 'messages' = array( - 'gettingstarted-task-toolbar-return-to-list-text', - 'gettingstarted-task-toolbar-return-to-list-title', 'gettingstarted-task-toolbar-editing-help-text', 'gettingstarted-task-toolbar-editing-help-title', 'gettingstarted-task-toolbar-try-another-text', diff --git a/resources/ext.gettingstarted.taskToolbar.js b/resources/ext.gettingstarted.taskToolbar.js index 781a8b4..48149d2 100644 --- a/resources/ext.gettingstarted.taskToolbar.js +++ b/resources/ext.gettingstarted.taskToolbar.js @@ -1,33 +1,30 @@ ( function ( $, mw ) { 'use strict'; - $( document ).ready( function () { - var $toolbar, $left, $center, $centerMessage, $right, $tryAnother, $close, - toolbarInfo, $relativeElements, $marginElements, logging, - cfg, $returnToList, returnToListUri, tryAnotherUri, $showGuide, - fullTask; - - logging = mw.gettingStarted.logging; - + var logging = mw.gettingStarted.logging, cfg = mw.config.get( [ 'wgGettingStarted', 'wgPageName', 'wgArticleId', 'wgRevisionId', 'wgPostEdit' ] ); - toolbarInfo = cfg.wgGettingStarted.toolbar; + + /** +* Builds and displays the toolbar +* +* @param {Object} toolbarInfo information for building the toolbar +* @param {string} toolbarInfo.taskName name of task type, such as 'copyedit' +* @param {string} toolbarInfo.description UI description of task type +* @param {string} toolbarInfo.tryAnotherTitle title text of 'Try Another' link +* @param {boolean} toolbarInfo.showIntro whether to show the intro tour +* @param {mw.Title} suggestedTitle title of a suggested article (for 'Try Another') +* or null if none is available +*/ + function displayToolbar( toolbarInfo, suggestedTitle ) { + var $toolbar, $left, $center, $centerMessage, $right, $tryAnother, $close, + $relativeElements, $marginElements, tryAnotherUrl, $showGuide, + fullTask; + fullTask = 'gettingstarted-' + toolbarInfo.taskName; - - returnToListUri = mw.util.wikiGetlink( 'Special:GettingStarted' ); - - $returnToList = $( 'a' ).attr( { - href: returnToListUri.toString(), - title: mw.message( 'gettingstarted-task-toolbar-return-to-list-title' ).text() - } ).text( mw.message( 'gettingstarted-task-toolbar-return-to-list-text' ).text() ) - .addClass( 'mw-gettingstarted-toolbar-link' ); - - $left = $( 'div' ).attr( { -
[MediaWiki-commits] [Gerrit] Send confirmation email when registering user - change (mediawiki...Translate)
SuchetaG has submitted this change and it was merged. Change subject: Send confirmation email when registering user .. Send confirmation email when registering user Change-Id: I0b0271bf965f30e86d7595c33539ee1288bcde8d --- M utils/TranslateSandbox.php 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: KartikMistry: Looks good to me, but someone else must approve SuchetaG: Looks good to me, approved jenkins-bot: Verified diff --git a/utils/TranslateSandbox.php b/utils/TranslateSandbox.php index 2edff2c..e598561 100644 --- a/utils/TranslateSandbox.php +++ b/utils/TranslateSandbox.php @@ -36,6 +36,7 @@ // Need to have an id first $user-addGroup( 'translate-sandboxed' ); $user-clearInstanceCache( 'name' ); + $user-sendConfirmationMail(); return $user; } @@ -207,7 +208,15 @@ return true; } - $rights = array( 'read', 'translate-sandboxaction', 'readapi', 'writeapi', 'editmyoptions' ); + $rights = array( + 'editmyoptions', + 'editmyprivateinfo', + 'read', + 'readapi', + 'translate-sandboxaction', + 'viewmyprivateinfo', + 'writeapi', + ); // Do not let other hooks add more actions return false; -- To view, visit https://gerrit.wikimedia.org/r/103409 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b0271bf965f30e86d7595c33539ee1288bcde8d Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com Gerrit-Reviewer: SuchetaG sucheta.ghos...@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] Fix typo in DerivativeContext doc - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/103741 Change subject: Fix typo in DerivativeContext doc .. Fix typo in DerivativeContext doc Change-Id: Ife6395fa7f78cb7b52b78cc60419fd387bd8509c --- M includes/context/DerivativeContext.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/41/103741/1 diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index 1e3fbf2..2137757 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -81,7 +81,7 @@ /** * Set the SiteConfiguration object * -* @param SiteConfiguration $c +* @param SiteConfiguration $s */ public function setConfig( SiteConfiguration $s ) { $this-config = $s; -- To view, visit https://gerrit.wikimedia.org/r/103741 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife6395fa7f78cb7b52b78cc60419fd387bd8509c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix typo in DerivativeContext doc - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Fix typo in DerivativeContext doc .. Fix typo in DerivativeContext doc Change-Id: Ife6395fa7f78cb7b52b78cc60419fd387bd8509c --- M includes/context/DerivativeContext.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index 1e3fbf2..2137757 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -81,7 +81,7 @@ /** * Set the SiteConfiguration object * -* @param SiteConfiguration $c +* @param SiteConfiguration $s */ public function setConfig( SiteConfiguration $s ) { $this-config = $s; -- To view, visit https://gerrit.wikimedia.org/r/103741 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ife6395fa7f78cb7b52b78cc60419fd387bd8509c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Aaron Schulz asch...@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 or other option for stubtreshold - change (mediawiki/core)
Chad has uploaded a new change for review. https://gerrit.wikimedia.org/r/103742 Change subject: Remove or other option for stubtreshold .. Remove or other option for stubtreshold People use this to set it to absolutely insane values. Enwiki-Stats: http://p.defau.lt/?1j4omOrfCZzQvIJ_z_dOEQ Change-Id: I88212703c69d0540f3134f661beee6c1428932a9 --- M includes/Preferences.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/42/103742/1 diff --git a/includes/Preferences.php b/includes/Preferences.php index 3ff99fc..8e08fc1 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -748,7 +748,7 @@ } $defaultPreferences['stubthreshold'] = array( - 'type' = 'selectorother', + 'type' = 'select', 'section' = 'rendering/advancedrendering', 'options' = $stubThresholdOptions, 'size' = 20, -- To view, visit https://gerrit.wikimedia.org/r/103742 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88212703c69d0540f3134f661beee6c1428932a9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Chad ch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits