[MediaWiki-commits] [Gerrit] Use the plain-text GPL - change (mediawiki...GlobalCssJs)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/187394 Change subject: Use the plain-text GPL .. Use the plain-text GPL Per Iaa30b8994b8e4034ace61df8202a8b5002093ff2 (commit a512ff8ab49b140e19306ff813caf2186a25f4b5 in MediaWiki core) Change-Id: I1cee933dd5d213106aea4884613e0429f2d9c6d2 --- M COPYING 1 file changed, 88 insertions(+), 91 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalCssJs refs/changes/94/187394/1 diff --git a/COPYING b/COPYING index 019694a..d159169 100644 --- a/COPYING +++ b/COPYING @@ -1,65 +1,65 @@ -== GNU GENERAL PUBLIC LICENSE == +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 -Version 2, June 1991 + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. +Preamble -=== Preamble === - -The licenses for most software are designed to take away your + The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. -When we speak of free software, we are referring to freedom, not + When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. -To protect your rights, we need to make restrictions that forbid + To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. -For example, if you distribute copies of such a program, whether + For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. -We protect your rights with two steps: (1) copyright the software, and + We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. -Also, for each author's protection and ours, we want to make certain + Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. -Finally, any free program is threatened constantly by software + Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. -The precise terms and conditions for copying, distribution and + The precise terms and conditions for copying, distribution and modification follow. -== TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION == +GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -'''0.''' This License applies to any program or other work which contains + 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License.
[MediaWiki-commits] [Gerrit] ExplodeIterator: Set explicit visiblity on functions - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187403 Change subject: ExplodeIterator: Set explicit visiblity on functions .. ExplodeIterator: Set explicit visiblity on functions Change-Id: I407280a432098d13ad75ff2d3468aa6a7d653da7 --- M includes/libs/ExplodeIterator.php 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/03/187403/1 diff --git a/includes/libs/ExplodeIterator.php b/includes/libs/ExplodeIterator.php index 64e33a4..3b34d9b 100644 --- a/includes/libs/ExplodeIterator.php +++ b/includes/libs/ExplodeIterator.php @@ -48,7 +48,7 @@ * @param string $delim * @param string $subject */ - function __construct( $delim, $subject ) { + public function __construct( $delim, $subject ) { $this-subject = $subject; $this-delim = $delim; @@ -59,13 +59,13 @@ $this-rewind(); } - function rewind() { + public function rewind() { $this-curPos = 0; $this-endPos = strpos( $this-subject, $this-delim ); $this-refreshCurrent(); } - function refreshCurrent() { + public function refreshCurrent() { if ( $this-curPos === false ) { $this-current = false; } elseif ( $this-curPos = $this-subjectLength ) { @@ -77,21 +77,21 @@ } } - function current() { + public function current() { return $this-current; } /** * @return int|bool Current position or boolean false if invalid */ - function key() { + public function key() { return $this-curPos; } /** * @return string */ - function next() { + public function next() { if ( $this-endPos === false ) { $this-curPos = false; } else { @@ -110,7 +110,7 @@ /** * @return bool */ - function valid() { + public function valid() { return $this-curPos !== false; } } -- To view, visit https://gerrit.wikimedia.org/r/187403 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I407280a432098d13ad75ff2d3468aa6a7d653da7 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] replacers: Set explicit visiblity on functions - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187400 Change subject: replacers: Set explicit visiblity on functions .. replacers: Set explicit visiblity on functions Change-Id: I4f35ea9b4bd2503bc612dc25dc8d34fc5ca040a0 --- M includes/libs/replacers/DoubleReplacer.php M includes/libs/replacers/HashtableReplacer.php M includes/libs/replacers/RegexlikeReplacer.php M includes/libs/replacers/Replacer.php 4 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/00/187400/1 diff --git a/includes/libs/replacers/DoubleReplacer.php b/includes/libs/replacers/DoubleReplacer.php index ab8ce95..20a4089 100644 --- a/includes/libs/replacers/DoubleReplacer.php +++ b/includes/libs/replacers/DoubleReplacer.php @@ -27,7 +27,7 @@ * @param mixed $to * @param int $index */ - function __construct( $from, $to, $index = 0 ) { + public function __construct( $from, $to, $index = 0 ) { $this-from = $from; $this-to = $to; $this-index = $index; @@ -37,7 +37,7 @@ * @param array $matches * @return mixed */ - function replace( $matches ) { + public function replace( $matches ) { return str_replace( $this-from, $this-to, $matches[$this-index] ); } } diff --git a/includes/libs/replacers/HashtableReplacer.php b/includes/libs/replacers/HashtableReplacer.php index 1bb6fbc..e1572f2 100644 --- a/includes/libs/replacers/HashtableReplacer.php +++ b/includes/libs/replacers/HashtableReplacer.php @@ -28,7 +28,7 @@ * @param array $table * @param int $index */ - function __construct( $table, $index = 0 ) { + public function __construct( $table, $index = 0 ) { $this-table = $table; $this-index = $index; } @@ -37,7 +37,7 @@ * @param array $matches * @return mixed */ - function replace( $matches ) { + public function replace( $matches ) { return $this-table[$matches[$this-index]]; } } diff --git a/includes/libs/replacers/RegexlikeReplacer.php b/includes/libs/replacers/RegexlikeReplacer.php index 2923f5b..630a754 100644 --- a/includes/libs/replacers/RegexlikeReplacer.php +++ b/includes/libs/replacers/RegexlikeReplacer.php @@ -27,7 +27,7 @@ /** * @param string $r */ - function __construct( $r ) { + public function __construct( $r ) { $this-r = $r; } @@ -35,7 +35,7 @@ * @param array $matches * @return string */ - function replace( $matches ) { + public function replace( $matches ) { $pairs = array(); foreach ( $matches as $i = $match ) { $pairs[\$$i] = $match; diff --git a/includes/libs/replacers/Replacer.php b/includes/libs/replacers/Replacer.php index 96f1660..924fb30 100644 --- a/includes/libs/replacers/Replacer.php +++ b/includes/libs/replacers/Replacer.php @@ -26,7 +26,7 @@ /** * @return array */ - function cb() { + public function cb() { return array( $this, 'replace' ); } } -- To view, visit https://gerrit.wikimedia.org/r/187400 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f35ea9b4bd2503bc612dc25dc8d34fc5ca040a0 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] replacers: Make Replacer abstract, and add abstract Replacer... - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187401 Change subject: replacers: Make Replacer abstract, and add abstract Replacer::replace() .. replacers: Make Replacer abstract, and add abstract Replacer::replace() Change-Id: Ib00dc8585e8ba599491e51e0b99a8667c3b4cd63 --- M includes/libs/replacers/DoubleReplacer.php M includes/libs/replacers/HashtableReplacer.php M includes/libs/replacers/RegexlikeReplacer.php M includes/libs/replacers/Replacer.php 4 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/01/187401/1 diff --git a/includes/libs/replacers/DoubleReplacer.php b/includes/libs/replacers/DoubleReplacer.php index 20a4089..fed023b 100644 --- a/includes/libs/replacers/DoubleReplacer.php +++ b/includes/libs/replacers/DoubleReplacer.php @@ -37,7 +37,7 @@ * @param array $matches * @return mixed */ - public function replace( $matches ) { + public function replace( array $matches ) { return str_replace( $this-from, $this-to, $matches[$this-index] ); } } diff --git a/includes/libs/replacers/HashtableReplacer.php b/includes/libs/replacers/HashtableReplacer.php index e1572f2..b3c219d 100644 --- a/includes/libs/replacers/HashtableReplacer.php +++ b/includes/libs/replacers/HashtableReplacer.php @@ -37,7 +37,7 @@ * @param array $matches * @return mixed */ - public function replace( $matches ) { + public function replace( array $matches ) { return $this-table[$matches[$this-index]]; } } diff --git a/includes/libs/replacers/RegexlikeReplacer.php b/includes/libs/replacers/RegexlikeReplacer.php index 630a754..2b1fa74 100644 --- a/includes/libs/replacers/RegexlikeReplacer.php +++ b/includes/libs/replacers/RegexlikeReplacer.php @@ -35,7 +35,7 @@ * @param array $matches * @return string */ - public function replace( $matches ) { + public function replace( array $matches ) { $pairs = array(); foreach ( $matches as $i = $match ) { $pairs[\$$i] = $match; diff --git a/includes/libs/replacers/Replacer.php b/includes/libs/replacers/Replacer.php index 924fb30..f4850bf 100644 --- a/includes/libs/replacers/Replacer.php +++ b/includes/libs/replacers/Replacer.php @@ -22,11 +22,17 @@ * Base class for replacers, objects used in preg_replace_callback() and * StringUtils::delimiterReplaceCallback() */ -class Replacer { +abstract class Replacer { /** * @return array */ public function cb() { return array( $this, 'replace' ); } + + /** +* @param array $matches +* @return string +*/ + abstract public function replace( array $matches ); } -- To view, visit https://gerrit.wikimedia.org/r/187401 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib00dc8585e8ba599491e51e0b99a8667c3b4cd63 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] Set context when parsing message 'redirectpagesub' in Article - change (mediawiki/core)
Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/187398 Change subject: Set context when parsing message 'redirectpagesub' in Article .. Set context when parsing message 'redirectpagesub' in Article Change-Id: I53fc0855fc8dd57cdfcae68751c9800969208310 --- M includes/page/Article.php 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/98/187398/1 diff --git a/includes/page/Article.php b/includes/page/Article.php index 0fc251e..089576d 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -687,9 +687,8 @@ $this-mParserOutput = $poolArticleView-getParserOutput(); $outputPage-addParserOutput( $this-mParserOutput ); if ( $content-getRedirectTarget() ) { - $outputPage-addSubtitle( - span id=\redirectsub\ . wfMessage( 'redirectpagesub' )-parse() . /span - ); + $outputPage-addSubtitle( span id=\redirectsub\ . + $this-getContext()-msg( 'redirectpagesub' )-parse() . /span ); } # Don't cache a dirty ParserOutput object @@ -1458,7 +1457,7 @@ $lang = $this-getTitle()-getPageLanguage(); $out = $this-getContext()-getOutput(); if ( $appendSubtitle ) { - $out-addSubtitle( wfMessage( 'redirectpagesub' )-parse() ); + $out-addSubtitle( wfMessage( 'redirectpagesub' ) ); } $out-addModuleStyles( 'mediawiki.action.view.redirectPage' ); return static::getRedirectHeaderHtml( $lang, $target, $forceKnown ); -- To view, visit https://gerrit.wikimedia.org/r/187398 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53fc0855fc8dd57cdfcae68751c9800969208310 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender umherirrender_de...@web.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] WIP: Introduce Mobile collection models - change (mediawiki...MobileFrontend)
Jhernandez has uploaded a new change for review. https://gerrit.wikimedia.org/r/187395 Change subject: WIP: Introduce Mobile collection models .. WIP: Introduce Mobile collection models * DONOTMERGE: Dependent on core patch for the base abstractions (WatchlistPageCollection PageCollectionItem PageCollection) Change-Id: I6b5ca2a02f3c71392d3777568bf06dc8b6cf2ea7 Dependency: Id31349cfa0db815d41d9c205bad3c7448ae120e7 --- M MobileFrontend.php D includes/models/MobileCollection.php A includes/models/MobileWatchlistCollection.php M includes/specials/SpecialMobileEditWatchlist.php 4 files changed, 74 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/95/187395/1 diff --git a/MobileFrontend.php b/MobileFrontend.php index 2a3c0f4..e8b8dce 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -61,7 +61,7 @@ 'MobileContext' = 'MobileContext', 'MobileFormatter' = 'MobileFormatter', - 'MobileCollection' = 'models/MobileCollection', + 'MobileWatchlistCollection' = 'models/MobileWatchlistCollection', 'MobilePage' = 'models/MobilePage', 'MobileUI' = 'MobileUI', diff --git a/includes/models/MobileCollection.php b/includes/models/MobileCollection.php deleted file mode 100644 index 9a87bb1..000 --- a/includes/models/MobileCollection.php +++ /dev/null @@ -1,31 +0,0 @@ -?php - -/** - * MobileCollection.php - */ - -/** - * A collection of pages, which are represented by the MobilePage class. - */ -class MobileCollection implements IteratorAggregate { - - /** -* The internal collection of pages. -* -* @var MobilePage[] -*/ - protected $pages = array(); - - /** -* Adds a page to the collection. -* -* @param MobilePage $page -*/ - public function add( MobilePage $page ) { - $this-pages[] = $page; - } - - public function getIterator() { - return new ArrayIterator( $this-pages ); - } -} diff --git a/includes/models/MobileWatchlistCollection.php b/includes/models/MobileWatchlistCollection.php new file mode 100644 index 000..7941b14 --- /dev/null +++ b/includes/models/MobileWatchlistCollection.php @@ -0,0 +1,70 @@ +?php + +/** + * MobileWatchlistCollection.php + */ + +/** + * A collection of pages, which are represented by the MobilePage class. + */ +class MobileWatchlistCollection extends WatchlistPageCollection { + protected $description = 'Pages I keep an eye on for editing purposes.'; + protected $title = ''; + + public function __construct( $user ) { + $this-user = $user; + $this-title = $this-getOwner()-getName() . '\'s Watchlist'; + parent::__construct( $user ); + } + + public function add( MobilePage $item ) { + $this-items[] = $item; + } + + public function load() { + $ids = array(); + $map = array(); + foreach ( $this-items as $item ) { + $id = $item-getTitle()-getArticleID(); + if ( $id !== 0 ) { + $ids[] = $id; + $map[$id] = $item; + } + } + + if ( count( $ids ) ) { + $api = new ApiMain( + new DerivativeRequest( + new FauxRequest(), + array( + 'action' = 'query', + 'prop' = 'extracts', + 'exlimit' = count( $ids ), + 'exintro' = true, + 'explaintext' = true, + 'pageids' = implode( '|', $ids ) + ) + ) + ); + $api-execute(); + $data = $api-getResult()-getData(); + $pagesData = $data[query][pages]; + foreach ( $pagesData as $pageData ) { + $item = $map[$pageData['pageid']]; + $item-getMobilePage()-setExtract( $pageData[extract][*] ); + } + } + } + + public function getDescription() { + return $this-description; + } + + public function getTitle() { + return $this-title; + } + + public function getLastModified() { + return new MWTimestamp(); + } +} diff --git a/includes/specials/SpecialMobileEditWatchlist.php
[MediaWiki-commits] [Gerrit] Move ReplacementArray into includes/libs/ - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187404 Change subject: Move ReplacementArray into includes/libs/ .. Move ReplacementArray into includes/libs/ Change-Id: I95b748c77522027753fb5bd0237f25e254938c16 --- M autoload.php A includes/libs/ReplacementArray.php M includes/utils/StringUtils.php 3 files changed, 126 insertions(+), 107 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/04/187404/1 diff --git a/autoload.php b/autoload.php index dc9ef19..e6f0f89 100644 --- a/autoload.php +++ b/autoload.php @@ -957,7 +957,7 @@ 'RemoveUnusedAccounts' = __DIR__ . '/maintenance/removeUnusedAccounts.php', 'RenameDbPrefix' = __DIR__ . '/maintenance/renameDbPrefix.php', 'RenderAction' = __DIR__ . '/includes/actions/RenderAction.php', - 'ReplacementArray' = __DIR__ . '/includes/utils/StringUtils.php', + 'ReplacementArray' = __DIR__ . '/includes/libs/ReplacementArray.php', 'Replacer' = __DIR__ . '/includes/libs/replacers/Replacer.php', 'RepoGroup' = __DIR__ . '/includes/filerepo/RepoGroup.php', 'RequestContext' = __DIR__ . '/includes/context/RequestContext.php', diff --git a/includes/libs/ReplacementArray.php b/includes/libs/ReplacementArray.php new file mode 100644 index 000..8c8c010 --- /dev/null +++ b/includes/libs/ReplacementArray.php @@ -0,0 +1,125 @@ +?php +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +/** + * Replacement array for FSS with fallback to strtr() + * Supports lazy initialisation of FSS resource + */ +class ReplacementArray { + private $data = false; + private $fss = false; + + /** +* Create an object with the specified replacement array +* The array should have the same form as the replacement array for strtr() +* @param array $data +*/ + function __construct( $data = array() ) { + $this-data = $data; + } + + /** +* @return array +*/ + function __sleep() { + return array( 'data' ); + } + + function __wakeup() { + $this-fss = false; + } + + /** +* Set the whole replacement array at once +* @param array $data +*/ + function setArray( $data ) { + $this-data = $data; + $this-fss = false; + } + + /** +* @return array|bool +*/ + function getArray() { + return $this-data; + } + + /** +* Set an element of the replacement array +* @param string $from +* @param string $to +*/ + function setPair( $from, $to ) { + $this-data[$from] = $to; + $this-fss = false; + } + + /** +* @param array $data +*/ + function mergeArray( $data ) { + $this-data = array_merge( $this-data, $data ); + $this-fss = false; + } + + /** +* @param ReplacementArray $other +*/ + function merge( $other ) { + $this-data = array_merge( $this-data, $other-data ); + $this-fss = false; + } + + /** +* @param string $from +*/ + function removePair( $from ) { + unset( $this-data[$from] ); + $this-fss = false; + } + + /** +* @param array $data +*/ + function removeArray( $data ) { + foreach ( $data as $from = $to ) { + $this-removePair( $from ); + } + $this-fss = false; + } + + /** +* @param string $subject +* @return string +*/ + function replace( $subject ) { + if ( function_exists( 'fss_prep_replace' ) ) { + if ( $this-fss === false ) { + $this-fss = fss_prep_replace( $this-data ); + } + $result = fss_exec_replace( $this-fss, $subject ); + } else { + $result = strtr( $subject, $this-data ); +
[MediaWiki-commits] [Gerrit] Move ExplodeIterator into includes/libs/ - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187402 Change subject: Move ExplodeIterator into includes/libs/ .. Move ExplodeIterator into includes/libs/ Change-Id: Ibb3b36dbce223454b9cd485743d7e7845f729bfb --- M autoload.php A includes/libs/ExplodeIterator.php M includes/utils/StringUtils.php 3 files changed, 117 insertions(+), 98 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/02/187402/1 diff --git a/autoload.php b/autoload.php index 5d382b2..dc9ef19 100644 --- a/autoload.php +++ b/autoload.php @@ -372,7 +372,7 @@ 'ErrorPageError' = __DIR__ . '/includes/exception/ErrorPageError.php', 'Exif' = __DIR__ . '/includes/media/Exif.php', 'ExifBitmapHandler' = __DIR__ . '/includes/media/ExifBitmap.php', - 'ExplodeIterator' = __DIR__ . '/includes/utils/StringUtils.php', + 'ExplodeIterator' = __DIR__ . '/includes/libs/ExplodeIterator.php', 'ExportProgressFilter' = __DIR__ . '/maintenance/backup.inc', 'ExtensionLanguages' = __DIR__ . '/maintenance/language/languages.inc', 'ExtensionProcessor' = __DIR__ . '/includes/registration/ExtensionProcessor.php', diff --git a/includes/libs/ExplodeIterator.php b/includes/libs/ExplodeIterator.php new file mode 100644 index 000..64e33a4 --- /dev/null +++ b/includes/libs/ExplodeIterator.php @@ -0,0 +1,116 @@ +?php +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +/** + * An iterator which works exactly like: + * + * foreach ( explode( $delim, $s ) as $element ) { + *... + * } + * + * Except it doesn't use 193 byte per element + */ +class ExplodeIterator implements Iterator { + // The subject string + private $subject, $subjectLength; + + // The delimiter + private $delim, $delimLength; + + // The position of the start of the line + private $curPos; + + // The position after the end of the next delimiter + private $endPos; + + // The current token + private $current; + + /** +* Construct a DelimIterator +* @param string $delim +* @param string $subject +*/ + function __construct( $delim, $subject ) { + $this-subject = $subject; + $this-delim = $delim; + + // Micro-optimisation (theoretical) + $this-subjectLength = strlen( $subject ); + $this-delimLength = strlen( $delim ); + + $this-rewind(); + } + + function rewind() { + $this-curPos = 0; + $this-endPos = strpos( $this-subject, $this-delim ); + $this-refreshCurrent(); + } + + function refreshCurrent() { + if ( $this-curPos === false ) { + $this-current = false; + } elseif ( $this-curPos = $this-subjectLength ) { + $this-current = ''; + } elseif ( $this-endPos === false ) { + $this-current = substr( $this-subject, $this-curPos ); + } else { + $this-current = substr( $this-subject, $this-curPos, $this-endPos - $this-curPos ); + } + } + + function current() { + return $this-current; + } + + /** +* @return int|bool Current position or boolean false if invalid +*/ + function key() { + return $this-curPos; + } + + /** +* @return string +*/ + function next() { + if ( $this-endPos === false ) { + $this-curPos = false; + } else { + $this-curPos = $this-endPos + $this-delimLength; + if ( $this-curPos = $this-subjectLength ) { + $this-endPos = false; + } else { + $this-endPos = strpos( $this-subject, $this-delim, $this-curPos ); + } + } + $this-refreshCurrent(); + + return $this-current; + } + + /** +* @return bool +*/
[MediaWiki-commits] [Gerrit] Move Replacers into includes/libs/replacers/ - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187399 Change subject: Move Replacers into includes/libs/replacers/ .. Move Replacers into includes/libs/replacers/ Split into separate files while we're at it Change-Id: I0bba4dcea686de088bd96964833fe6fb649a41e9 --- M autoload.php A includes/libs/replacers/DoubleReplacer.php A includes/libs/replacers/HashtableReplacer.php A includes/libs/replacers/RegexlikeReplacer.php A includes/libs/replacers/Replacer.php M includes/utils/StringUtils.php 6 files changed, 169 insertions(+), 92 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/99/187399/1 diff --git a/autoload.php b/autoload.php index 2015f59..5d382b2 100644 --- a/autoload.php +++ b/autoload.php @@ -332,7 +332,7 @@ 'DjVuImage' = __DIR__ . '/includes/media/DjVuImage.php', 'DoubleRedirectJob' = __DIR__ . '/includes/jobqueue/jobs/DoubleRedirectJob.php', 'DoubleRedirectsPage' = __DIR__ . '/includes/specials/SpecialDoubleRedirects.php', - 'DoubleReplacer' = __DIR__ . '/includes/utils/StringUtils.php', + 'DoubleReplacer' = __DIR__ . '/includes/libs/replacers/DoubleReplacer.php', 'DummyLinker' = __DIR__ . '/includes/Linker.php', 'DummyTermColorer' = __DIR__ . '/maintenance/term/MWTerm.php', 'Dump7ZipOutput' = __DIR__ . '/includes/Export.php', @@ -495,7 +495,7 @@ 'HashBagOStuff' = __DIR__ . '/includes/objectcache/HashBagOStuff.php', 'HashConfig' = __DIR__ . '/includes/config/HashConfig.php', 'HashRing' = __DIR__ . '/includes/libs/HashRing.php', - 'HashtableReplacer' = __DIR__ . '/includes/utils/StringUtils.php', + 'HashtableReplacer' = __DIR__ . '/includes/libs/replacers/HashtableReplacer.php', 'HistoryAction' = __DIR__ . '/includes/actions/HistoryAction.php', 'HistoryBlob' = __DIR__ . '/includes/HistoryBlob.php', 'HistoryBlobCurStub' = __DIR__ . '/includes/HistoryBlob.php', @@ -952,13 +952,13 @@ 'RefreshLinks' = __DIR__ . '/maintenance/refreshLinks.php', 'RefreshLinksJob' = __DIR__ . '/includes/jobqueue/jobs/RefreshLinksJob.php', 'RefreshLinksJob2' = __DIR__ . '/includes/jobqueue/jobs/RefreshLinksJob2.php', - 'RegexlikeReplacer' = __DIR__ . '/includes/utils/StringUtils.php', + 'RegexlikeReplacer' = __DIR__ . '/includes/libs/replacers/RegexlikeReplacer.php', 'RemoveInvalidEmails' = __DIR__ . '/maintenance/removeInvalidEmails.php', 'RemoveUnusedAccounts' = __DIR__ . '/maintenance/removeUnusedAccounts.php', 'RenameDbPrefix' = __DIR__ . '/maintenance/renameDbPrefix.php', 'RenderAction' = __DIR__ . '/includes/actions/RenderAction.php', 'ReplacementArray' = __DIR__ . '/includes/utils/StringUtils.php', - 'Replacer' = __DIR__ . '/includes/utils/StringUtils.php', + 'Replacer' = __DIR__ . '/includes/libs/replacers/Replacer.php', 'RepoGroup' = __DIR__ . '/includes/filerepo/RepoGroup.php', 'RequestContext' = __DIR__ . '/includes/context/RequestContext.php', 'ResetUserTokens' = __DIR__ . '/maintenance/resetUserTokens.php', diff --git a/includes/libs/replacers/DoubleReplacer.php b/includes/libs/replacers/DoubleReplacer.php new file mode 100644 index 000..ab8ce95 --- /dev/null +++ b/includes/libs/replacers/DoubleReplacer.php @@ -0,0 +1,43 @@ +?php +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +/** + * Class to perform secondary replacement within each replacement string + */ +class DoubleReplacer extends Replacer { + /** +* @param mixed $from +* @param mixed $to +* @param int $index +*/ + function __construct( $from, $to, $index = 0 ) { + $this-from = $from; + $this-to = $to; + $this-index = $index; + } + + /** +* @param array $matches +* @return mixed +*/ + function replace( $matches ) { + return str_replace( $this-from, $this-to, $matches[$this-index] ); + } +} diff --git a/includes/libs/replacers/HashtableReplacer.php
[MediaWiki-commits] [Gerrit] ReplacementArray: Set explicit visiblity on functions - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187405 Change subject: ReplacementArray: Set explicit visiblity on functions .. ReplacementArray: Set explicit visiblity on functions Also add a type-hint Change-Id: I78a322dfa11a71e22a3d0b7064b808aec6bfbf83 --- M includes/libs/ReplacementArray.php 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/05/187405/1 diff --git a/includes/libs/ReplacementArray.php b/includes/libs/ReplacementArray.php index 8c8c010..7fdb309 100644 --- a/includes/libs/ReplacementArray.php +++ b/includes/libs/ReplacementArray.php @@ -31,18 +31,18 @@ * The array should have the same form as the replacement array for strtr() * @param array $data */ - function __construct( $data = array() ) { + public function __construct( $data = array() ) { $this-data = $data; } /** * @return array */ - function __sleep() { + public function __sleep() { return array( 'data' ); } - function __wakeup() { + public function __wakeup() { $this-fss = false; } @@ -50,7 +50,7 @@ * Set the whole replacement array at once * @param array $data */ - function setArray( $data ) { + public function setArray( $data ) { $this-data = $data; $this-fss = false; } @@ -58,7 +58,7 @@ /** * @return array|bool */ - function getArray() { + public function getArray() { return $this-data; } @@ -67,7 +67,7 @@ * @param string $from * @param string $to */ - function setPair( $from, $to ) { + public function setPair( $from, $to ) { $this-data[$from] = $to; $this-fss = false; } @@ -75,7 +75,7 @@ /** * @param array $data */ - function mergeArray( $data ) { + public function mergeArray( $data ) { $this-data = array_merge( $this-data, $data ); $this-fss = false; } @@ -83,7 +83,7 @@ /** * @param ReplacementArray $other */ - function merge( $other ) { + public function merge( ReplacementArray $other ) { $this-data = array_merge( $this-data, $other-data ); $this-fss = false; } @@ -91,7 +91,7 @@ /** * @param string $from */ - function removePair( $from ) { + public function removePair( $from ) { unset( $this-data[$from] ); $this-fss = false; } @@ -99,7 +99,7 @@ /** * @param array $data */ - function removeArray( $data ) { + public function removeArray( $data ) { foreach ( $data as $from = $to ) { $this-removePair( $from ); } @@ -110,7 +110,7 @@ * @param string $subject * @return string */ - function replace( $subject ) { + public function replace( $subject ) { if ( function_exists( 'fss_prep_replace' ) ) { if ( $this-fss === false ) { $this-fss = fss_prep_replace( $this-data ); -- To view, visit https://gerrit.wikimedia.org/r/187405 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78a322dfa11a71e22a3d0b7064b808aec6bfbf83 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] WIP: Show in Special:Collections the user's Watchlist colle... - change (mediawiki...MobileFrontend)
Jhernandez has uploaded a new change for review. https://gerrit.wikimedia.org/r/187397 Change subject: WIP: Show in Special:Collections the user's Watchlist collectionized .. WIP: Show in Special:Collections the user's Watchlist collectionized NOT WORKING, doesnt load the collection right now As part of the first sprint we are creating the views by using watchlist as our backend for the moment. In the future in Special:Collections there will actually be the list of collections from the user. Change-Id: Id1e62c0ac97cfd20e52112b13c0970ccdb70f0e1 --- M MobileFrontend.php M includes/Resources.php M includes/models/MobilePage.php M includes/specials/SpecialCollections.php A includes/views/MobileCollectionItemCardView.php M includes/views/MobileCollectionView.php A less/specials/collections.less M less/specials/common.less 8 files changed, 212 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/97/187397/1 diff --git a/MobileFrontend.php b/MobileFrontend.php index 6196e56..cfda0d2 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -66,6 +66,7 @@ 'MobileView' = 'views/MobileView', 'MobileCollectionView' = 'views/MobileCollectionView', + 'MobileCollectionItemCardView' = 'views/MobileCollectionItemCardView', 'MobileUI' = 'MobileUI', 'MobileUserInfo' = 'MobileUserInfo', diff --git a/includes/Resources.php b/includes/Resources.php index 683db00..ce7fb63 100644 --- a/includes/Resources.php +++ b/includes/Resources.php @@ -1413,6 +1413,12 @@ * suffixed by '.styles' or '.scripts' */ $wgMobileSpecialPageModules = array( + 'mobile.special.collections.styles' = $wgMFMobileSpecialPageResourceBoilerplate + array( + 'styles' = array( + 'less/specials/collections.less', + ), + ), + 'mobile.special.mobilemenu.styles' = $wgMFMobileSpecialPageResourceBoilerplate + array( 'styles' = array( 'less/specials/mobilemenu.less', @@ -1543,6 +1549,7 @@ 'javascripts/specials/mobilediff.js', ), ), + ); /** diff --git a/includes/models/MobilePage.php b/includes/models/MobilePage.php index 902457c..1e41490 100644 --- a/includes/models/MobilePage.php +++ b/includes/models/MobilePage.php @@ -13,6 +13,8 @@ const SMALL_IMAGE_WIDTH = 150; const TINY_IMAGE_WIDTH = 80; + protected $extract; + /** * @var Title: Title for page */ @@ -53,6 +55,18 @@ return $this-title; } + public function getDescription() { + return 'WikiData description'; + } + + public function getExtract() { + return $this-extract; + } + + public function setExtract( $extract ) { + $this-extract = $extract; + } + /** * Get a placeholder div container for thumbnails * @param string $className diff --git a/includes/specials/SpecialCollections.php b/includes/specials/SpecialCollections.php index c920f41..723ea6c 100644 --- a/includes/specials/SpecialCollections.php +++ b/includes/specials/SpecialCollections.php @@ -23,13 +23,14 @@ public function executeWhenAvailable( $subpage ) { if ( $subpage ) { $args = explode( '/', $subpage ); - $user = User::newFromName( $args[0] ); - if ( isset( $args[1] ) ) { - // check permissions - // getCollection( id ) + // If there is a user argument, that's what we want to use + if ( isset( $args[0] ) ) { + $user = User::newFromName( $args[0] ); } else { - $collection = new MobileWatchlistCollection( $this-getUser() ); + // Otherwise just show the users page + $user = $this-getUser(); } + $collection = new MobileWatchlistCollection( $user ); } else { $collection = new MobileWatchlistCollection( $this-getUser() ); } @@ -41,9 +42,13 @@ public function render( $collection ) { $out = $this-getOutput(); $this-setHeaders(); - $title = $collection-getTitle(); - $out-setPageTitle( $title ); - $view = new MobileCollectionView( $collection ); - $view-render( $out ); + if ( count( $collection ) 0 ) { + $out-setPageTitle( $collection-getTitle() ); + } else { + // FIXME: Set title properly? Redirect to other not found? +
[MediaWiki-commits] [Gerrit] WIP: Add Special:Collections page to menu - change (mediawiki...MobileFrontend)
Jhernandez has uploaded a new change for review. https://gerrit.wikimedia.org/r/187396 Change subject: WIP: Add Special:Collections page to menu .. WIP: Add Special:Collections page to menu ** Just an empty page. More work on following patches Change-Id: I6bbfc5f0438ec0925039e11edfd0c5d491de7623 --- M MobileFrontend.alias.php M MobileFrontend.php M i18n/en.json M i18n/qqq.json M includes/skins/SkinMinervaAlpha.php A includes/specials/SpecialCollections.php A includes/views/MobileCollectionView.php A includes/views/MobileView.php 8 files changed, 125 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/96/187396/1 diff --git a/MobileFrontend.alias.php b/MobileFrontend.alias.php index 9d1dc0d..80459c2 100644 --- a/MobileFrontend.alias.php +++ b/MobileFrontend.alias.php @@ -11,6 +11,7 @@ /** English (English) */ $specialPageAliases['en'] = array( + 'Collections' = array( 'Collections' ), 'History' = array( 'History' ), 'MobileOptions' = array( 'MobileOptions' ), 'Uploads' = array( 'Uploads' ), diff --git a/MobileFrontend.php b/MobileFrontend.php index e8b8dce..6196e56 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -64,6 +64,9 @@ 'MobileWatchlistCollection' = 'models/MobileWatchlistCollection', 'MobilePage' = 'models/MobilePage', + 'MobileView' = 'views/MobileView', + 'MobileCollectionView' = 'views/MobileCollectionView', + 'MobileUI' = 'MobileUI', 'MobileUserInfo' = 'MobileUserInfo', @@ -79,6 +82,7 @@ 'SpecialUploads' = 'specials/SpecialUploads', 'SpecialUserProfile' = 'specials/SpecialUserProfile', 'SpecialMobileHistory' = 'specials/SpecialMobileHistory', + 'SpecialCollections' = 'specials/SpecialCollections', 'SpecialMobileDiff' = 'specials/SpecialMobileDiff', 'SpecialMobileEditor' = 'specials/SpecialMobileEditor', 'SpecialMobileOptions' = 'specials/SpecialMobileOptions', @@ -159,6 +163,7 @@ // use array_merge to ensure we do not override existing values set by core $wgSpecialPages = array_merge( $wgSpecialPages, array( + 'Collections' = 'SpecialCollections', 'History' = 'SpecialMobileHistory', 'MobileDiff' = 'SpecialMobileDiff', 'MobileEditor' = 'SpecialMobileEditor', diff --git a/i18n/en.json b/i18n/en.json index 9268874..92ae872 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -399,5 +399,6 @@ mobile-frontend-time-precision-BCE-0annum: $1 BCE, mobile-frontend-days-ago: $1 {{PLURAL:$1|day|days}} ago, mobile-frontend-months-ago: $1 {{PLURAL:$1|month|months}} ago, - mobile-frontend-years-ago: $1 {{PLURAL:$1|year|years}} ago + mobile-frontend-years-ago: $1 {{PLURAL:$1|year|years}} ago, + mobile-frontend-main-menu-collections: Collections } diff --git a/i18n/qqq.json b/i18n/qqq.json index ab911d8..f010f04 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -427,5 +427,6 @@ mobile-frontend-time-precision-BCE-0annum: Used to present a point in time BCE (before current era) with the precision of a year, mobile-frontend-days-ago: Expression of duration of time passed in days.\nParameter:\n* $1 - number of days that have passed., mobile-frontend-months-ago: Expression of duration of time passed in months.\nParameter:\n * $1 - number of months that have passed., - mobile-frontend-years-ago: Expression of duration of time passed in years.\nParameter:\n * $1 - number of years that have passed. + mobile-frontend-years-ago: Expression of duration of time passed in years.\nParameter:\n * $1 - number of years that have passed., + mobile-frontend-main-menu-collections: Experimental feature on mobile. } diff --git a/includes/skins/SkinMinervaAlpha.php b/includes/skins/SkinMinervaAlpha.php index 103e95e..bd0986c 100644 --- a/includes/skins/SkinMinervaAlpha.php +++ b/includes/skins/SkinMinervaAlpha.php @@ -90,6 +90,24 @@ /** * {@inheritdoc} */ + protected function getPersonalTools() { + $items = array( + 'collections' = array( + 'links' = array( + array( + 'text' = wfMessage( 'mobile-frontend-main-menu-collections' )-escaped(), + 'href' = $this-getPersonalUrl( SpecialPage::getTitleFor( 'Collections' ) ), + 'class' = MobileUI::iconClass( 'watchlist', 'before' ), + ), + ), + ), + ); + return array_merge( $items, parent::getPersonalTools() ); + } + + /** +* {@inheritdoc} +*/ protected
[MediaWiki-commits] [Gerrit] Add 'license-name' matching SPDX conventions - change (mediawiki...WikimediaEvents)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/187382 Change subject: Add 'license-name' matching SPDX conventions .. Add 'license-name' matching SPDX conventions References: http://spdx.org/licenses/ https://www.mediawiki.org/wiki/Manual:$wgExtensionCredits#license-name Change-Id: I49f434ca4ca80d575a4d248067017f648dc4ba61 --- M WikimediaEvents.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents refs/changes/82/187382/1 diff --git a/WikimediaEvents.php b/WikimediaEvents.php index 6a074c9..6bdc89b 100644 --- a/WikimediaEvents.php +++ b/WikimediaEvents.php @@ -23,6 +23,7 @@ 'Benny Situ', ), 'descriptionmsg' = 'wikimediaevents-desc', + 'license-name' = 'GPL-2.0+', ); // Configuration -- To view, visit https://gerrit.wikimedia.org/r/187382 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49f434ca4ca80d575a4d248067017f648dc4ba61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaEvents Gerrit-Branch: master Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add 'license-name' matching SPDX conventions - change (mediawiki...WikimediaMessages)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/187383 Change subject: Add 'license-name' matching SPDX conventions .. Add 'license-name' matching SPDX conventions References: http://spdx.org/licenses/ https://www.mediawiki.org/wiki/Manual:$wgExtensionCredits#license-name Change-Id: I73e86ece9533fe40215966b0d11fd5c530a866ab --- M WikimediaMessages.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages refs/changes/83/187383/1 diff --git a/WikimediaMessages.php b/WikimediaMessages.php index 30b1069..0ae7ea1 100644 --- a/WikimediaMessages.php +++ b/WikimediaMessages.php @@ -17,6 +17,7 @@ 'url'= 'https://www.mediawiki.org/wiki/Extension:WikimediaMessages', 'author' = array( 'Tim Starling', 'Siebrand Mazeland' ), 'descriptionmsg' = 'wikimediamessages-desc', + 'license-name' = 'GPL-2.0+', ); -- To view, visit https://gerrit.wikimedia.org/r/187383 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73e86ece9533fe40215966b0d11fd5c530a866ab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMessages Gerrit-Branch: master Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add 'license-name' - change (mediawiki...TemplateSandbox)
jenkins-bot has submitted this change and it was merged. Change subject: Add 'license-name' .. Add 'license-name' https://www.mediawiki.org/wiki/Manual:$wgExtensionCredits#license-name Change-Id: I83b90605d0875e14e8e54d112e58300913af8d5b --- M TemplateSandbox.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Anomie: Looks good to me, approved jenkins-bot: Verified diff --git a/TemplateSandbox.php b/TemplateSandbox.php index dfd18c4..84f1812 100644 --- a/TemplateSandbox.php +++ b/TemplateSandbox.php @@ -50,6 +50,7 @@ 'url' = 'https://www.mediawiki.org/wiki/Extension:TemplateSandbox', 'descriptionmsg' = 'templatesandbox-desc', 'version' = '1.1.0', + 'license-name' = 'GPL-2.0+', ); $wgAutoloadClasses['TemplateSandboxHooks'] = __DIR__ . '/TemplateSandbox.hooks.php'; -- To view, visit https://gerrit.wikimedia.org/r/187367 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83b90605d0875e14e8e54d112e58300913af8d5b Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/TemplateSandbox Gerrit-Branch: master Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org Gerrit-Reviewer: Anomie bjor...@wikimedia.org Gerrit-Reviewer: Jackmcbarn jackmcb...@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] Major refactoring of ClaimDifferenceVisualizer - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/187384 Change subject: Major refactoring of ClaimDifferenceVisualizer .. Major refactoring of ClaimDifferenceVisualizer Major changes: * Added crucial null check to getSnakValueHeader. * Drop dead code from visualizeRankChange. Note that the object can't be of an other type but DiffOpChange. * Introduced formatSnak and formatReference. Both add strong type checks that did not happened before (the old code just called getSnaks and getPropertyId on something that was known to be mixed). * Replaced getSnakListValues with formatReference. Main reason for this refactoring is to avoid duplicate code. Other changes: * protected by default. * Drop @since tags from private stuff. * Simplify code, e.g. by using the short ?: operator. * Split long lines. Change-Id: Ia49bdcce115a34f9f9416a2ad0bd67008d475b02 --- M repo/includes/Diff/ClaimDifferenceVisualizer.php 1 file changed, 124 insertions(+), 139 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/84/187384/1 diff --git a/repo/includes/Diff/ClaimDifferenceVisualizer.php b/repo/includes/Diff/ClaimDifferenceVisualizer.php index f77ee4a..253a6a1 100644 --- a/repo/includes/Diff/ClaimDifferenceVisualizer.php +++ b/repo/includes/Diff/ClaimDifferenceVisualizer.php @@ -15,8 +15,8 @@ use ValueFormatters\ValueFormatter; use Wikibase\DataModel\Claim\Claim; use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Reference; use Wikibase\DataModel\Snak\Snak; -use Wikibase\DataModel\Snak\SnakList; use Wikibase\Lib\Serializers\ClaimSerializer; use Wikibase\Lib\SnakFormatter; @@ -30,6 +30,7 @@ * @author Katie Filbert aude.w...@gmail.com * @author Adam Shorland * @author Daniel Kinzler + * @author Thiemo Mättig */ class ClaimDifferenceVisualizer { @@ -54,8 +55,6 @@ private $languageCode; /** -* Constructor. -* * @since 0.4 * * @param ValueFormatter $propertyIdFormatter Formatter for IDs, must generate HTML. @@ -103,35 +102,37 @@ * @return string */ public function visualizeClaimChange( ClaimDifference $claimDifference, Claim $baseClaim ) { + $oldSnak = null; $html = ''; if ( $claimDifference-getMainSnakChange() !== null ) { + $oldSnak = $claimDifference-getMainSnakChange()-getOldValue(); $html .= $this-visualizeMainSnakChange( $claimDifference-getMainSnakChange() ); - $oldMainSnak = $claimDifference-getMainSnakChange()-getOldValue(); - } else { - $oldMainSnak = null; } - if ( $claimDifference-getRankChange() !== null ) { + $rankChange = $claimDifference-getRankChange(); + if ( $rankChange !== null ) { $html .= $this-visualizeRankChange( - $claimDifference-getRankChange(), - $oldMainSnak, + $rankChange, + $oldSnak, $baseClaim-getMainSnak() ); } - if ( $claimDifference-getQualifierChanges() !== null ) { + $qualifierChanges = $claimDifference-getQualifierChanges(); + if ( $qualifierChanges !== null ) { $html .= $this-visualizeQualifierChanges( - $claimDifference-getQualifierChanges(), - $oldMainSnak, + $qualifierChanges, + $oldSnak, $baseClaim-getMainSnak() ); } - if ( $claimDifference-getReferenceChanges() !== null ) { - $html .= $this-visualizeSnakListChanges( - $claimDifference-getReferenceChanges(), - $oldMainSnak, + $referenceChanges = $claimDifference-getReferenceChanges(); + if ( $referenceChanges !== null ) { + $html .= $this-visualizeReferenceChanges( + $referenceChanges, + $oldSnak, $baseClaim-getMainSnak(), wfMessage( 'wikibase-diffview-reference' )-inLanguage( $this-languageCode ) ); @@ -173,24 +174,18 @@ /** * Get Html for a main snak change * -* @since 0.4 -* * @param DiffOpChange $mainSnakChange * * @return string */ - protected function visualizeMainSnakChange( DiffOpChange
[MediaWiki-commits] [Gerrit] Updated hierarchyParent and hierarchyChildren parser functions. - change (mediawiki...HierarchyBuilder)
Kji has submitted this change and it was merged. Change subject: Updated hierarchyParent and hierarchyChildren parser functions. .. Updated hierarchyParent and hierarchyChildren parser functions. The version number is now 1.4.0. Updated hierarchyParent parser function to support duplicate target instances within a single hierarchy. Change-Id: Id6abad8f95a914da62ec74e6ab9c9ad995536142 Removed some useless comments Change-Id: I7aae16b46dd25c6e154d317a714ce28c1a50bc52 Updated hierarchyChildren so the default behavior is to return all root nodes when the target is empty. Change-Id: I1c9c5ef423b3c0785ac5c6d88f19afede867104c --- M HierarchyBuilder.class.php M HierarchyBuilder.php 2 files changed, 105 insertions(+), 22 deletions(-) Approvals: Kji: Verified; Looks good to me, approved diff --git a/HierarchyBuilder.class.php b/HierarchyBuilder.class.php index 6083e04..371900c 100644 --- a/HierarchyBuilder.class.php +++ b/HierarchyBuilder.class.php @@ -78,12 +78,19 @@ * down to find the target page, and then looping further to identify the * immediate children. Once the loop to find immediate children finds a row * which has depth less than or equal to the target then the search is -* complete. If there are no immediate children in the hierarchy for the -* specified target page, or if the target page is not included in the -* hierarchy at all, then this function returns an empty array. +* complete. +* +* If the target page is empty, then target page is assumed to be the +* invisible/imaginary super root node Hierarchy Root and all the root +* level nodes in the hierarchy will be returned. +* +* If there are no immediate children in the hierarchy for the +* specified target page, then this function returns an empty array. * * @param string $targetPageName: is the name of the target page for which -* we want the list of immediate children. +* we want the list of immediate children. If this is empty, then we will +* assume the target is the invisible super root node Hierarchy Root and +* return all of the root level nodes from the hierarchy. * @param string $hierarchyPageName: is the name of the page containing the * hierarchy from which to retrieve the list of children. * @param string $hierarchyPropertyName: is the name of the property on the @@ -95,6 +102,19 @@ public static function getPageChildren( $targetPageName, $hierarchyPageName, $hierarchyPropertyName ) { + // handle the strange empty target case first + if ( $targetPageName == '' ) { + $rootRows = self::getHierarchyRowsByDepth( '*', $hierarchyPageName, $hierarchyPropertyName ); + + $children = array(); + foreach( $rootRows as $rootRow ) { + array_push( $children, self::getPageNameFromHierarchyRow( $rootRow ) ); + } + + return $children; + } + + // handle the normal case where a target page is given $hierarchy = self::getPropertyFromPage( $hierarchyPageName, $hierarchyPropertyName ); $hierarchyRows = preg_split( '/\n/', $hierarchy ); @@ -183,7 +203,8 @@ * @param string $hierarchyPropertyName: The name of the property on the * hierarchy page which contains the hierarhcy data. (ex: Hierarchy Data) * -* @return string: The hierarchical parent of target page within the hiearchy. +* @return array: The hierarchical parents of target page instances within +* the hierarchy. */ public static function getPageParent( $targetPageName, $hierarchyPageName, @@ -191,6 +212,9 @@ ) { $hierarchy = self::getPropertyFromPage( $hierarchyPageName, $hierarchyPropertyName ); $hierarchyRows = preg_split( '/\n/', $hierarchy ); + + // array to store the parents of the target instances + $parents = array(); $currentPagePattern = '/\[\[' . $targetPageName . '\]\]/'; // loop through the hierarchyRows looking for the row containing the currentPage @@ -204,11 +228,12 @@ // Note that if there is no hierarchical parent, then the parent // will be empty. $parent = self::getParent( $hierarchyRows, $row, $i ); - return $parent; + array_push( $parents, $parent); + //return $parent; } } - return ''; + return $parents;
[MediaWiki-commits] [Gerrit] [Josa] Register extension - change (translatewiki)
Raimond Spekking has uploaded a new change for review. https://gerrit.wikimedia.org/r/187406 Change subject: [Josa] Register extension .. [Josa] Register extension Change-Id: Ie2a0b8f0c5b4a0c054f3ea80f84611081133e3d2 --- M groups/MediaWiki/mediawiki-extensions.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/06/187406/1 diff --git a/groups/MediaWiki/mediawiki-extensions.txt b/groups/MediaWiki/mediawiki-extensions.txt index 31f82d2..0020082 100644 --- a/groups/MediaWiki/mediawiki-extensions.txt +++ b/groups/MediaWiki/mediawiki-extensions.txt @@ -1165,6 +1165,8 @@ file = InviteSignup/i18n/%CODE%.json aliasfile = InviteSignup/InviteSignup.alias.php +Josa + JS Bread Crumbs optional = jsbreadcrumbs-separator -- To view, visit https://gerrit.wikimedia.org/r/187406 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2a0b8f0c5b4a0c054f3ea80f84611081133e3d2 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] [Josa] Register extension - change (translatewiki)
Raimond Spekking has submitted this change and it was merged. Change subject: [Josa] Register extension .. [Josa] Register extension Change-Id: Ie2a0b8f0c5b4a0c054f3ea80f84611081133e3d2 --- M groups/MediaWiki/mediawiki-extensions.txt 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Raimond Spekking: Verified; Looks good to me, approved diff --git a/groups/MediaWiki/mediawiki-extensions.txt b/groups/MediaWiki/mediawiki-extensions.txt index 31f82d2..0020082 100644 --- a/groups/MediaWiki/mediawiki-extensions.txt +++ b/groups/MediaWiki/mediawiki-extensions.txt @@ -1165,6 +1165,8 @@ file = InviteSignup/i18n/%CODE%.json aliasfile = InviteSignup/InviteSignup.alias.php +Josa + JS Bread Crumbs optional = jsbreadcrumbs-separator -- To view, visit https://gerrit.wikimedia.org/r/187406 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie2a0b8f0c5b4a0c054f3ea80f84611081133e3d2 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] Special:CreateClass back to always being included - change (mediawiki...SemanticForms)
Yaron Koren has uploaded a new change for review. https://gerrit.wikimedia.org/r/187407 Change subject: Special:CreateClass back to always being included .. Special:CreateClass back to always being included Change-Id: I507198cceb4831b1d3aeaff262f00c095ab4a0a1 --- M SemanticForms.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/07/187407/1 diff --git a/SemanticForms.php b/SemanticForms.php index 917b583..7de8323 100644 --- a/SemanticForms.php +++ b/SemanticForms.php @@ -144,10 +144,10 @@ $GLOBALS['wgSpecialPages']['CreateProperty'] = 'SFCreateProperty'; $GLOBALS['wgAutoloadClasses']['SFCreateProperty'] = __DIR__ . '/specials/SF_CreateProperty.php'; $GLOBALS['wgSpecialPageGroups']['CreateProperty'] = 'sf_group'; - $GLOBALS['wgSpecialPages']['CreateClass'] = 'SFCreateClass'; - $GLOBALS['wgAutoloadClasses']['SFCreateClass'] = __DIR__ . '/specials/SF_CreateClass.php'; - $GLOBALS['wgSpecialPageGroups']['CreateClass'] = 'sf_group'; } +$GLOBALS['wgSpecialPages']['CreateClass'] = 'SFCreateClass'; +$GLOBALS['wgAutoloadClasses']['SFCreateClass'] = __DIR__ . '/specials/SF_CreateClass.php'; +$GLOBALS['wgSpecialPageGroups']['CreateClass'] = 'sf_group'; $GLOBALS['wgSpecialPages']['CreateCategory'] = 'SFCreateCategory'; $GLOBALS['wgAutoloadClasses']['SFCreateCategory'] = __DIR__ . '/specials/SF_CreateCategory.php'; $GLOBALS['wgSpecialPageGroups']['CreateCategory'] = 'sf_group'; -- To view, visit https://gerrit.wikimedia.org/r/187407 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I507198cceb4831b1d3aeaff262f00c095ab4a0a1 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] Special:CreateClass back to always being included - change (mediawiki...SemanticForms)
Yaron Koren has submitted this change and it was merged. Change subject: Special:CreateClass back to always being included .. Special:CreateClass back to always being included Change-Id: I507198cceb4831b1d3aeaff262f00c095ab4a0a1 --- M SemanticForms.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Yaron Koren: Checked; Looks good to me, approved diff --git a/SemanticForms.php b/SemanticForms.php index 917b583..7de8323 100644 --- a/SemanticForms.php +++ b/SemanticForms.php @@ -144,10 +144,10 @@ $GLOBALS['wgSpecialPages']['CreateProperty'] = 'SFCreateProperty'; $GLOBALS['wgAutoloadClasses']['SFCreateProperty'] = __DIR__ . '/specials/SF_CreateProperty.php'; $GLOBALS['wgSpecialPageGroups']['CreateProperty'] = 'sf_group'; - $GLOBALS['wgSpecialPages']['CreateClass'] = 'SFCreateClass'; - $GLOBALS['wgAutoloadClasses']['SFCreateClass'] = __DIR__ . '/specials/SF_CreateClass.php'; - $GLOBALS['wgSpecialPageGroups']['CreateClass'] = 'sf_group'; } +$GLOBALS['wgSpecialPages']['CreateClass'] = 'SFCreateClass'; +$GLOBALS['wgAutoloadClasses']['SFCreateClass'] = __DIR__ . '/specials/SF_CreateClass.php'; +$GLOBALS['wgSpecialPageGroups']['CreateClass'] = 'sf_group'; $GLOBALS['wgSpecialPages']['CreateCategory'] = 'SFCreateCategory'; $GLOBALS['wgAutoloadClasses']['SFCreateCategory'] = __DIR__ . '/specials/SF_CreateCategory.php'; $GLOBALS['wgSpecialPageGroups']['CreateCategory'] = 'sf_group'; -- To view, visit https://gerrit.wikimedia.org/r/187407 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I507198cceb4831b1d3aeaff262f00c095ab4a0a1 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 Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set $wmgUseFloatedToc to false at dewiki - change (operations/mediawiki-config)
Glaisher has uploaded a new change for review. https://gerrit.wikimedia.org/r/187408 Change subject: Set $wmgUseFloatedToc to false at dewiki .. Set $wmgUseFloatedToc to false at dewiki Bug: T87534 Change-Id: I6ed4ae5ed7de2eee518b3629ac00a6e0c36b7022 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/08/187408/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4e9c1f5..7aee1d9 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -10072,6 +10072,7 @@ 'wmgUseFloatedToc' = array( 'default' = true, + 'dewikivoyage' = false, // T87534 ), 'wmgUseGWToolset' = array( -- To view, visit https://gerrit.wikimedia.org/r/187408 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ed4ae5ed7de2eee518b3629ac00a6e0c36b7022 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Glaisher glaisher.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add high-level transactions. - change (mediawiki...VisualEditor)
Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/187409 Change subject: Add high-level transactions. .. Add high-level transactions. Depends on Iae33bb637a93fd4da09d75d4e01de39e404d1ed9 Change-Id: I0ebccac6a163a7d3ce6767a38043fd8dca14976f --- M .docs/eg-iframe.html M VisualEditor.hooks.php M VisualEditor.php M lib/ve 4 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/09/187409/1 diff --git a/.docs/eg-iframe.html b/.docs/eg-iframe.html index 2014210..d00bbcf 100644 --- a/.docs/eg-iframe.html +++ b/.docs/eg-iframe.html @@ -154,6 +154,7 @@ script src=lib/ve/src/dm/ve.dm.TableMatrix.js/script script src=lib/ve/src/dm/ve.dm.TransactionProcessor.js/script script src=lib/ve/src/dm/ve.dm.Transaction.js/script + script src=lib/ve/src/dm/ve.dm.Transaction.transpose.js/script script src=lib/ve/src/dm/ve.dm.Selection.js/script script src=lib/ve/src/dm/ve.dm.LinearSelection.js/script script src=lib/ve/src/dm/ve.dm.NullSelection.js/script diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index d4df34b..289327a 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -529,6 +529,7 @@ 'lib/ve/tests/dm/ve.dm.InternalList.test.js', 'modules/ve-mw/tests/dm/ve.dm.InternalList.test.js', 'lib/ve/tests/dm/ve.dm.Transaction.test.js', + 'lib/ve/tests/dm/ve.dm.Transaction.transpose.test.js', 'modules/ve-mw/tests/dm/ve.dm.Transaction.test.js', 'lib/ve/tests/dm/ve.dm.TransactionProcessor.test.js', 'lib/ve/tests/dm/ve.dm.Surface.test.js', diff --git a/VisualEditor.php b/VisualEditor.php index e38c372..fab7632 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -390,6 +390,7 @@ 'lib/ve/src/dm/ve.dm.TableMatrix.js', 'lib/ve/src/dm/ve.dm.TransactionProcessor.js', 'lib/ve/src/dm/ve.dm.Transaction.js', + 'lib/ve/src/dm/ve.dm.Transaction.transpose.js', 'lib/ve/src/dm/ve.dm.Selection.js', 'lib/ve/src/dm/ve.dm.LinearSelection.js', 'lib/ve/src/dm/ve.dm.NullSelection.js', diff --git a/lib/ve b/lib/ve index e56f537..0583e1a 16 --- a/lib/ve +++ b/lib/ve -Subproject commit e56f5372979164c54edfb4f5941000edeb34e6d9 +Subproject commit 0583e1a68b6d904a224a2a0d7b56e48ed4297561 -- To view, visit https://gerrit.wikimedia.org/r/187409 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ebccac6a163a7d3ce6767a38043fd8dca14976f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Cscott canan...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove support for obsolete J2ME and PhoneGap apps - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/187410 Change subject: Remove support for obsolete J2ME and PhoneGap apps .. Remove support for obsolete J2ME and PhoneGap apps Change-Id: Ie6d771b0eb7f6b4c4b76380ac49f5117bb6024cf --- M REPOCONF M REPOCONF.siebrand M bin/EXTERNAL-PROJECTS M bin/repocommit M bin/repocreate M bin/repoexport M bin/repoupdate M groups/Wikimedia/WikimediaMobile.yaml 8 files changed, 0 insertions(+), 80 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/10/187410/1 diff --git a/REPOCONF b/REPOCONF index b6a93f6..260999d 100644 --- a/REPOCONF +++ b/REPOCONF @@ -41,7 +41,5 @@ REPO_WIKIMANIA=https://gerrit.wikimedia.org/r/wikimedia/wikimania-scholarships REPO_WIKIPEDIAANDROID=https://gerrit.wikimedia.org/r/apps/android/wikipedia REPO_WIKIPEDIAIOS=https://gerrit.wikimedia.org/r/apps/ios/wikipedia -REPO_WIKIPEDIAMOBILE=git://github.com/wikimedia/WikipediaMobile.git -REPO_WIKIPEDIAMOBILEJ2ME=git://github.com/wikimedia/WikipediaMobileJ2ME.git REPO_WIKISOURCEMOBILE=git://github.com/wikimedia/WikisourceMobile.git REPO_WIKTIONARYMOBILE=git://github.com/wikimedia/WiktionaryMobile.git diff --git a/REPOCONF.siebrand b/REPOCONF.siebrand index e01333f..132ca81 100644 --- a/REPOCONF.siebrand +++ b/REPOCONF.siebrand @@ -39,7 +39,5 @@ REPO_WIKIMANIA=ssh://l10n-...@gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships REPO_WIKIPEDIAANDROID=ssh://l10n-...@gerrit.wikimedia.org:29418/apps/android/wikipedia REPO_WIKIPEDIAIOS=ssh://l10n-...@gerrit.wikimedia.org:29418/apps/ios/wikipedia -REPO_WIKIPEDIAMOBILE=g...@github.com:wikimedia/WikipediaMobile.git -REPO_WIKIPEDIAMOBILEJ2ME=g...@github.com:wikimedia/WikipediaMobileJ2ME.git REPO_WIKISOURCEMOBILE=g...@github.com:wikimedia/WikisourceMobile.git REPO_WIKTIONARYMOBILE=g...@github.com:wikimedia/WiktionaryMobile.git diff --git a/bin/EXTERNAL-PROJECTS b/bin/EXTERNAL-PROJECTS index 297fafe..8e6b1d2 100644 --- a/bin/EXTERNAL-PROJECTS +++ b/bin/EXTERNAL-PROJECTS @@ -25,7 +25,5 @@ wikimania wikipedia-android wikipedia-ios -WikipediaMobile -WikipediaMobileJ2ME WikisourceMobile WiktionaryMobile diff --git a/bin/repocommit b/bin/repocommit index 5b99f08..cbbc679 100755 --- a/bin/repocommit +++ b/bin/repocommit @@ -67,8 +67,6 @@ osm \ vicuna \ waymarked-trails-site \ -WikipediaMobile \ -WikipediaMobileJ2ME \ WikisourceMobile \ WiktionaryMobile diff --git a/bin/repocreate b/bin/repocreate index 55d68d2..6de6871 100755 --- a/bin/repocreate +++ b/bin/repocreate @@ -221,16 +221,6 @@ git clone $REPO_WIKIPEDIAIOS $PROJECT gitCreateGerrit $PROJECT -elif [ $PROJECT = WikipediaMobile ] -then - checkVar 'REPO_WIKIPEDIAMOBILE' - git clone $REPO_WIKIPEDIAMOBILE $PROJECT - -elif [ $PROJECT = WikipediaMobileJ2ME ] -then - checkVar 'REPO_WIKIPEDIAMOBILEJ2ME' - git clone $REPO_WIKIPEDIAMOBILEJ2ME $PROJECT - elif [ $PROJECT = WikisourceMobile ] then checkVar 'REPO_WIKISOURCEMOBILE' diff --git a/bin/repoexport b/bin/repoexport index ccd5625..5627584 100755 --- a/bin/repoexport +++ b/bin/repoexport @@ -185,16 +185,6 @@ php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-ios* --lang='*' --skip en,qqq $THRESHOLD php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-ios* --lang qqq -elif [ $PROJECT = WikipediaMobile ] -then - php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-phonegap --lang='*' --skip en,qqq $THRESHOLD - php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-phonegap --lang qqq - -elif [ $PROJECT = WikipediaMobileJ2ME ] -then - php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-j2me --lang='*' --skip en,qqq $THRESHOLD - php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-j2me --lang qqq - elif [ $PROJECT = WikisourceMobile ] then php $EXPORTER --target . --group=out-wikimedia-mobile-wikisource --lang='*' --skip en,qqq $THRESHOLD diff --git a/bin/repoupdate b/bin/repoupdate index 8638338..ffafb74 100755 --- a/bin/repoupdate +++ b/bin/repoupdate @@ -88,8 +88,6 @@ wikimania \ wikipedia-android \ wikipedia-ios \ -WikipediaMobile \ -WikipediaMobileJ2ME \ WikisourceMobile \ WiktionaryMobile diff --git a/groups/Wikimedia/WikimediaMobile.yaml b/groups/Wikimedia/WikimediaMobile.yaml index ac75a91..2d13210 100644 --- a/groups/Wikimedia/WikimediaMobile.yaml +++ b/groups/Wikimedia/WikimediaMobile.yaml @@ -20,58 +20,8 @@ GROUPS: - out-wikimedia-mobile-wikipedia-android-strings - out-wikimedia-mobile-wikipedia-ios-0-all - - out-wikimedia-mobile-wikipedia-j2me - - out-wikimedia-mobile-wikipedia-phonegap - out-wikimedia-mobile-wikisource - out-wikimedia-mobile-wiktionary - -BASIC: - icon: wiki://WikipediaMobile-icon.png - id: out-wikimedia-mobile-wikipedia-phonegap - label: Wikipedia Mobile PhoneGap -
[MediaWiki-commits] [Gerrit] Remove support for obsolete J2ME and PhoneGap apps - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Remove support for obsolete J2ME and PhoneGap apps .. Remove support for obsolete J2ME and PhoneGap apps Change-Id: Ie6d771b0eb7f6b4c4b76380ac49f5117bb6024cf --- M REPOCONF M REPOCONF.siebrand M bin/EXTERNAL-PROJECTS M bin/repocommit M bin/repocreate M bin/repoexport M bin/repoupdate M groups/Wikimedia/WikimediaMobile.yaml 8 files changed, 0 insertions(+), 80 deletions(-) Approvals: Siebrand: Looks good to me, approved jenkins-bot: Verified diff --git a/REPOCONF b/REPOCONF index b6a93f6..260999d 100644 --- a/REPOCONF +++ b/REPOCONF @@ -41,7 +41,5 @@ REPO_WIKIMANIA=https://gerrit.wikimedia.org/r/wikimedia/wikimania-scholarships REPO_WIKIPEDIAANDROID=https://gerrit.wikimedia.org/r/apps/android/wikipedia REPO_WIKIPEDIAIOS=https://gerrit.wikimedia.org/r/apps/ios/wikipedia -REPO_WIKIPEDIAMOBILE=git://github.com/wikimedia/WikipediaMobile.git -REPO_WIKIPEDIAMOBILEJ2ME=git://github.com/wikimedia/WikipediaMobileJ2ME.git REPO_WIKISOURCEMOBILE=git://github.com/wikimedia/WikisourceMobile.git REPO_WIKTIONARYMOBILE=git://github.com/wikimedia/WiktionaryMobile.git diff --git a/REPOCONF.siebrand b/REPOCONF.siebrand index e01333f..132ca81 100644 --- a/REPOCONF.siebrand +++ b/REPOCONF.siebrand @@ -39,7 +39,5 @@ REPO_WIKIMANIA=ssh://l10n-...@gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships REPO_WIKIPEDIAANDROID=ssh://l10n-...@gerrit.wikimedia.org:29418/apps/android/wikipedia REPO_WIKIPEDIAIOS=ssh://l10n-...@gerrit.wikimedia.org:29418/apps/ios/wikipedia -REPO_WIKIPEDIAMOBILE=g...@github.com:wikimedia/WikipediaMobile.git -REPO_WIKIPEDIAMOBILEJ2ME=g...@github.com:wikimedia/WikipediaMobileJ2ME.git REPO_WIKISOURCEMOBILE=g...@github.com:wikimedia/WikisourceMobile.git REPO_WIKTIONARYMOBILE=g...@github.com:wikimedia/WiktionaryMobile.git diff --git a/bin/EXTERNAL-PROJECTS b/bin/EXTERNAL-PROJECTS index 297fafe..8e6b1d2 100644 --- a/bin/EXTERNAL-PROJECTS +++ b/bin/EXTERNAL-PROJECTS @@ -25,7 +25,5 @@ wikimania wikipedia-android wikipedia-ios -WikipediaMobile -WikipediaMobileJ2ME WikisourceMobile WiktionaryMobile diff --git a/bin/repocommit b/bin/repocommit index 5b99f08..cbbc679 100755 --- a/bin/repocommit +++ b/bin/repocommit @@ -67,8 +67,6 @@ osm \ vicuna \ waymarked-trails-site \ -WikipediaMobile \ -WikipediaMobileJ2ME \ WikisourceMobile \ WiktionaryMobile diff --git a/bin/repocreate b/bin/repocreate index 55d68d2..6de6871 100755 --- a/bin/repocreate +++ b/bin/repocreate @@ -221,16 +221,6 @@ git clone $REPO_WIKIPEDIAIOS $PROJECT gitCreateGerrit $PROJECT -elif [ $PROJECT = WikipediaMobile ] -then - checkVar 'REPO_WIKIPEDIAMOBILE' - git clone $REPO_WIKIPEDIAMOBILE $PROJECT - -elif [ $PROJECT = WikipediaMobileJ2ME ] -then - checkVar 'REPO_WIKIPEDIAMOBILEJ2ME' - git clone $REPO_WIKIPEDIAMOBILEJ2ME $PROJECT - elif [ $PROJECT = WikisourceMobile ] then checkVar 'REPO_WIKISOURCEMOBILE' diff --git a/bin/repoexport b/bin/repoexport index ccd5625..5627584 100755 --- a/bin/repoexport +++ b/bin/repoexport @@ -185,16 +185,6 @@ php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-ios* --lang='*' --skip en,qqq $THRESHOLD php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-ios* --lang qqq -elif [ $PROJECT = WikipediaMobile ] -then - php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-phonegap --lang='*' --skip en,qqq $THRESHOLD - php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-phonegap --lang qqq - -elif [ $PROJECT = WikipediaMobileJ2ME ] -then - php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-j2me --lang='*' --skip en,qqq $THRESHOLD - php $EXPORTER --target . --group=out-wikimedia-mobile-wikipedia-j2me --lang qqq - elif [ $PROJECT = WikisourceMobile ] then php $EXPORTER --target . --group=out-wikimedia-mobile-wikisource --lang='*' --skip en,qqq $THRESHOLD diff --git a/bin/repoupdate b/bin/repoupdate index 8638338..ffafb74 100755 --- a/bin/repoupdate +++ b/bin/repoupdate @@ -88,8 +88,6 @@ wikimania \ wikipedia-android \ wikipedia-ios \ -WikipediaMobile \ -WikipediaMobileJ2ME \ WikisourceMobile \ WiktionaryMobile diff --git a/groups/Wikimedia/WikimediaMobile.yaml b/groups/Wikimedia/WikimediaMobile.yaml index ac75a91..2d13210 100644 --- a/groups/Wikimedia/WikimediaMobile.yaml +++ b/groups/Wikimedia/WikimediaMobile.yaml @@ -20,58 +20,8 @@ GROUPS: - out-wikimedia-mobile-wikipedia-android-strings - out-wikimedia-mobile-wikipedia-ios-0-all - - out-wikimedia-mobile-wikipedia-j2me - - out-wikimedia-mobile-wikipedia-phonegap - out-wikimedia-mobile-wikisource - out-wikimedia-mobile-wiktionary - -BASIC: - icon: wiki://WikipediaMobile-icon.png - id: out-wikimedia-mobile-wikipedia-phonegap - label: Wikipedia Mobile PhoneGap - description:
[MediaWiki-commits] [Gerrit] Remove usage of $wgRedactedFunctionArguments - change (mediawiki...LdapAuthentication)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187411 Change subject: Remove usage of $wgRedactedFunctionArguments .. Remove usage of $wgRedactedFunctionArguments Change-Id: If20ac745e22fe5efce00a374210b540610720522 --- M LdapAuthentication.php 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LdapAuthentication refs/changes/11/187411/1 diff --git a/LdapAuthentication.php b/LdapAuthentication.php index 5b258fc..e603a5b 100644 --- a/LdapAuthentication.php +++ b/LdapAuthentication.php @@ -95,12 +95,6 @@ # Schema changes $wgHooks['LoadExtensionSchemaUpdates'][] = 'efLdapAuthenticationSchemaUpdates'; -$wgRedactedFunctionArguments['LdapAuthenticationPlugin::ldap_bind'] = 2; -$wgRedactedFunctionArguments['LdapAuthenticationPlugin::authenticate'] = 2; -$wgRedactedFunctionArguments['LdapAuthenticationPlugin::getPasswordHash'] = 0; -$wgRedactedFunctionArguments['LdapAuthenticationPlugin::bindAs'] = 1; -$wgRedactedFunctionArguments['LdapAuthenticationPlugin::setOrDefaultPrivate'] = 0; - /** * @param $updater DatabaseUpdater * @return bool -- To view, visit https://gerrit.wikimedia.org/r/187411 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If20ac745e22fe5efce00a374210b540610720522 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LdapAuthentication 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] disable nginx udplog for SSL clusters - change (operations/puppet)
BBlack has submitted this change and it was merged. Change subject: disable nginx udplog for SSL clusters .. disable nginx udplog for SSL clusters ref: T86656 Change-Id: I3784f6d4f41590d74aac7a65f8eb827bdf9e --- M templates/nginx/nginx.conf.erb 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: BBlack: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/nginx/nginx.conf.erb b/templates/nginx/nginx.conf.erb index d9cbcd2..20cc5d1 100644 --- a/templates/nginx/nginx.conf.erb +++ b/templates/nginx/nginx.conf.erb @@ -39,8 +39,10 @@ access_log /var/log/nginx/access.log; % if has_variable?(nginx_use_ssl) then % -log_format squid_combined '$hostname $udplog_sequence $udplog_time$request_time $remote_addr-/$status $bytes_sent $request_method $scheme://$host$request_uri NONE/$proxy_host $content_type $http_referer $http_x_forwarded_for $http_user_agent $http_accept_language $sent_http_x_analytics'; -access_udplog 208.80.154.73:8419 squid_combined; +## -- udplog disabled, to be removed later assuming no issues, cf T86656 +## log_format squid_combined '$hostname$udplog_sequence $udplog_time$request_time $remote_addr-/$status $bytes_sent $request_method $scheme://$host$request_uri NONE/$proxy_host $content_type $http_referer $http_x_forwarded_for $http_user_agent $http_accept_language $sent_http_x_analytics'; +## access_udplog 208.80.154.73:8419 squid_combined; +## -- end of udplog stuff client_max_body_size 100m; large_client_header_buffers 4 16k; client_body_buffer_size 64k; -- To view, visit https://gerrit.wikimedia.org/r/186257 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3784f6d4f41590d74aac7a65f8eb827bdf9e Gerrit-PatchSet: 6 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlack bbl...@wikimedia.org Gerrit-Reviewer: BBlack bbl...@wikimedia.org Gerrit-Reviewer: Dzahn dz...@wikimedia.org Gerrit-Reviewer: Ottomata 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] Move Replacers into includes/libs/replacers/ - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Move Replacers into includes/libs/replacers/ .. Move Replacers into includes/libs/replacers/ Split into separate files while we're at it Change-Id: I0bba4dcea686de088bd96964833fe6fb649a41e9 --- M autoload.php A includes/libs/replacers/DoubleReplacer.php A includes/libs/replacers/HashtableReplacer.php A includes/libs/replacers/RegexlikeReplacer.php A includes/libs/replacers/Replacer.php M includes/utils/StringUtils.php 6 files changed, 169 insertions(+), 92 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 2015f59..5d382b2 100644 --- a/autoload.php +++ b/autoload.php @@ -332,7 +332,7 @@ 'DjVuImage' = __DIR__ . '/includes/media/DjVuImage.php', 'DoubleRedirectJob' = __DIR__ . '/includes/jobqueue/jobs/DoubleRedirectJob.php', 'DoubleRedirectsPage' = __DIR__ . '/includes/specials/SpecialDoubleRedirects.php', - 'DoubleReplacer' = __DIR__ . '/includes/utils/StringUtils.php', + 'DoubleReplacer' = __DIR__ . '/includes/libs/replacers/DoubleReplacer.php', 'DummyLinker' = __DIR__ . '/includes/Linker.php', 'DummyTermColorer' = __DIR__ . '/maintenance/term/MWTerm.php', 'Dump7ZipOutput' = __DIR__ . '/includes/Export.php', @@ -495,7 +495,7 @@ 'HashBagOStuff' = __DIR__ . '/includes/objectcache/HashBagOStuff.php', 'HashConfig' = __DIR__ . '/includes/config/HashConfig.php', 'HashRing' = __DIR__ . '/includes/libs/HashRing.php', - 'HashtableReplacer' = __DIR__ . '/includes/utils/StringUtils.php', + 'HashtableReplacer' = __DIR__ . '/includes/libs/replacers/HashtableReplacer.php', 'HistoryAction' = __DIR__ . '/includes/actions/HistoryAction.php', 'HistoryBlob' = __DIR__ . '/includes/HistoryBlob.php', 'HistoryBlobCurStub' = __DIR__ . '/includes/HistoryBlob.php', @@ -952,13 +952,13 @@ 'RefreshLinks' = __DIR__ . '/maintenance/refreshLinks.php', 'RefreshLinksJob' = __DIR__ . '/includes/jobqueue/jobs/RefreshLinksJob.php', 'RefreshLinksJob2' = __DIR__ . '/includes/jobqueue/jobs/RefreshLinksJob2.php', - 'RegexlikeReplacer' = __DIR__ . '/includes/utils/StringUtils.php', + 'RegexlikeReplacer' = __DIR__ . '/includes/libs/replacers/RegexlikeReplacer.php', 'RemoveInvalidEmails' = __DIR__ . '/maintenance/removeInvalidEmails.php', 'RemoveUnusedAccounts' = __DIR__ . '/maintenance/removeUnusedAccounts.php', 'RenameDbPrefix' = __DIR__ . '/maintenance/renameDbPrefix.php', 'RenderAction' = __DIR__ . '/includes/actions/RenderAction.php', 'ReplacementArray' = __DIR__ . '/includes/utils/StringUtils.php', - 'Replacer' = __DIR__ . '/includes/utils/StringUtils.php', + 'Replacer' = __DIR__ . '/includes/libs/replacers/Replacer.php', 'RepoGroup' = __DIR__ . '/includes/filerepo/RepoGroup.php', 'RequestContext' = __DIR__ . '/includes/context/RequestContext.php', 'ResetUserTokens' = __DIR__ . '/maintenance/resetUserTokens.php', diff --git a/includes/libs/replacers/DoubleReplacer.php b/includes/libs/replacers/DoubleReplacer.php new file mode 100644 index 000..ab8ce95 --- /dev/null +++ b/includes/libs/replacers/DoubleReplacer.php @@ -0,0 +1,43 @@ +?php +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +/** + * Class to perform secondary replacement within each replacement string + */ +class DoubleReplacer extends Replacer { + /** +* @param mixed $from +* @param mixed $to +* @param int $index +*/ + function __construct( $from, $to, $index = 0 ) { + $this-from = $from; + $this-to = $to; + $this-index = $index; + } + + /** +* @param array $matches +* @return mixed +*/ + function replace( $matches ) { + return str_replace( $this-from, $this-to, $matches[$this-index] ); + } +} diff --git a/includes/libs/replacers/HashtableReplacer.php b/includes/libs/replacers/HashtableReplacer.php new file mode 100644 index
[MediaWiki-commits] [Gerrit] replacers: Make Replacer abstract, and add abstract Replacer... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: replacers: Make Replacer abstract, and add abstract Replacer::replace() .. replacers: Make Replacer abstract, and add abstract Replacer::replace() Change-Id: Ib00dc8585e8ba599491e51e0b99a8667c3b4cd63 --- M includes/libs/replacers/DoubleReplacer.php M includes/libs/replacers/HashtableReplacer.php M includes/libs/replacers/RegexlikeReplacer.php M includes/libs/replacers/Replacer.php 4 files changed, 10 insertions(+), 4 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/replacers/DoubleReplacer.php b/includes/libs/replacers/DoubleReplacer.php index 20a4089..fed023b 100644 --- a/includes/libs/replacers/DoubleReplacer.php +++ b/includes/libs/replacers/DoubleReplacer.php @@ -37,7 +37,7 @@ * @param array $matches * @return mixed */ - public function replace( $matches ) { + public function replace( array $matches ) { return str_replace( $this-from, $this-to, $matches[$this-index] ); } } diff --git a/includes/libs/replacers/HashtableReplacer.php b/includes/libs/replacers/HashtableReplacer.php index e1572f2..b3c219d 100644 --- a/includes/libs/replacers/HashtableReplacer.php +++ b/includes/libs/replacers/HashtableReplacer.php @@ -37,7 +37,7 @@ * @param array $matches * @return mixed */ - public function replace( $matches ) { + public function replace( array $matches ) { return $this-table[$matches[$this-index]]; } } diff --git a/includes/libs/replacers/RegexlikeReplacer.php b/includes/libs/replacers/RegexlikeReplacer.php index 630a754..2b1fa74 100644 --- a/includes/libs/replacers/RegexlikeReplacer.php +++ b/includes/libs/replacers/RegexlikeReplacer.php @@ -35,7 +35,7 @@ * @param array $matches * @return string */ - public function replace( $matches ) { + public function replace( array $matches ) { $pairs = array(); foreach ( $matches as $i = $match ) { $pairs[\$$i] = $match; diff --git a/includes/libs/replacers/Replacer.php b/includes/libs/replacers/Replacer.php index 924fb30..f4850bf 100644 --- a/includes/libs/replacers/Replacer.php +++ b/includes/libs/replacers/Replacer.php @@ -22,11 +22,17 @@ * Base class for replacers, objects used in preg_replace_callback() and * StringUtils::delimiterReplaceCallback() */ -class Replacer { +abstract class Replacer { /** * @return array */ public function cb() { return array( $this, 'replace' ); } + + /** +* @param array $matches +* @return string +*/ + abstract public function replace( array $matches ); } -- To view, visit https://gerrit.wikimedia.org/r/187401 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib00dc8585e8ba599491e51e0b99a8667c3b4cd63 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Addshore addshorew...@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] Move ExplodeIterator into includes/libs/ - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Move ExplodeIterator into includes/libs/ .. Move ExplodeIterator into includes/libs/ Change-Id: Ibb3b36dbce223454b9cd485743d7e7845f729bfb --- M autoload.php A includes/libs/ExplodeIterator.php M includes/utils/StringUtils.php 3 files changed, 117 insertions(+), 98 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 5d382b2..dc9ef19 100644 --- a/autoload.php +++ b/autoload.php @@ -372,7 +372,7 @@ 'ErrorPageError' = __DIR__ . '/includes/exception/ErrorPageError.php', 'Exif' = __DIR__ . '/includes/media/Exif.php', 'ExifBitmapHandler' = __DIR__ . '/includes/media/ExifBitmap.php', - 'ExplodeIterator' = __DIR__ . '/includes/utils/StringUtils.php', + 'ExplodeIterator' = __DIR__ . '/includes/libs/ExplodeIterator.php', 'ExportProgressFilter' = __DIR__ . '/maintenance/backup.inc', 'ExtensionLanguages' = __DIR__ . '/maintenance/language/languages.inc', 'ExtensionProcessor' = __DIR__ . '/includes/registration/ExtensionProcessor.php', diff --git a/includes/libs/ExplodeIterator.php b/includes/libs/ExplodeIterator.php new file mode 100644 index 000..64e33a4 --- /dev/null +++ b/includes/libs/ExplodeIterator.php @@ -0,0 +1,116 @@ +?php +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +/** + * An iterator which works exactly like: + * + * foreach ( explode( $delim, $s ) as $element ) { + *... + * } + * + * Except it doesn't use 193 byte per element + */ +class ExplodeIterator implements Iterator { + // The subject string + private $subject, $subjectLength; + + // The delimiter + private $delim, $delimLength; + + // The position of the start of the line + private $curPos; + + // The position after the end of the next delimiter + private $endPos; + + // The current token + private $current; + + /** +* Construct a DelimIterator +* @param string $delim +* @param string $subject +*/ + function __construct( $delim, $subject ) { + $this-subject = $subject; + $this-delim = $delim; + + // Micro-optimisation (theoretical) + $this-subjectLength = strlen( $subject ); + $this-delimLength = strlen( $delim ); + + $this-rewind(); + } + + function rewind() { + $this-curPos = 0; + $this-endPos = strpos( $this-subject, $this-delim ); + $this-refreshCurrent(); + } + + function refreshCurrent() { + if ( $this-curPos === false ) { + $this-current = false; + } elseif ( $this-curPos = $this-subjectLength ) { + $this-current = ''; + } elseif ( $this-endPos === false ) { + $this-current = substr( $this-subject, $this-curPos ); + } else { + $this-current = substr( $this-subject, $this-curPos, $this-endPos - $this-curPos ); + } + } + + function current() { + return $this-current; + } + + /** +* @return int|bool Current position or boolean false if invalid +*/ + function key() { + return $this-curPos; + } + + /** +* @return string +*/ + function next() { + if ( $this-endPos === false ) { + $this-curPos = false; + } else { + $this-curPos = $this-endPos + $this-delimLength; + if ( $this-curPos = $this-subjectLength ) { + $this-endPos = false; + } else { + $this-endPos = strpos( $this-subject, $this-delim, $this-curPos ); + } + } + $this-refreshCurrent(); + + return $this-current; + } + + /** +* @return bool +*/ + function valid() { +
[MediaWiki-commits] [Gerrit] replacers: Set explicit visiblity on functions - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: replacers: Set explicit visiblity on functions .. replacers: Set explicit visiblity on functions Change-Id: I4f35ea9b4bd2503bc612dc25dc8d34fc5ca040a0 --- M includes/libs/replacers/DoubleReplacer.php M includes/libs/replacers/HashtableReplacer.php M includes/libs/replacers/RegexlikeReplacer.php M includes/libs/replacers/Replacer.php 4 files changed, 7 insertions(+), 7 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/replacers/DoubleReplacer.php b/includes/libs/replacers/DoubleReplacer.php index ab8ce95..20a4089 100644 --- a/includes/libs/replacers/DoubleReplacer.php +++ b/includes/libs/replacers/DoubleReplacer.php @@ -27,7 +27,7 @@ * @param mixed $to * @param int $index */ - function __construct( $from, $to, $index = 0 ) { + public function __construct( $from, $to, $index = 0 ) { $this-from = $from; $this-to = $to; $this-index = $index; @@ -37,7 +37,7 @@ * @param array $matches * @return mixed */ - function replace( $matches ) { + public function replace( $matches ) { return str_replace( $this-from, $this-to, $matches[$this-index] ); } } diff --git a/includes/libs/replacers/HashtableReplacer.php b/includes/libs/replacers/HashtableReplacer.php index 1bb6fbc..e1572f2 100644 --- a/includes/libs/replacers/HashtableReplacer.php +++ b/includes/libs/replacers/HashtableReplacer.php @@ -28,7 +28,7 @@ * @param array $table * @param int $index */ - function __construct( $table, $index = 0 ) { + public function __construct( $table, $index = 0 ) { $this-table = $table; $this-index = $index; } @@ -37,7 +37,7 @@ * @param array $matches * @return mixed */ - function replace( $matches ) { + public function replace( $matches ) { return $this-table[$matches[$this-index]]; } } diff --git a/includes/libs/replacers/RegexlikeReplacer.php b/includes/libs/replacers/RegexlikeReplacer.php index 2923f5b..630a754 100644 --- a/includes/libs/replacers/RegexlikeReplacer.php +++ b/includes/libs/replacers/RegexlikeReplacer.php @@ -27,7 +27,7 @@ /** * @param string $r */ - function __construct( $r ) { + public function __construct( $r ) { $this-r = $r; } @@ -35,7 +35,7 @@ * @param array $matches * @return string */ - function replace( $matches ) { + public function replace( $matches ) { $pairs = array(); foreach ( $matches as $i = $match ) { $pairs[\$$i] = $match; diff --git a/includes/libs/replacers/Replacer.php b/includes/libs/replacers/Replacer.php index 96f1660..924fb30 100644 --- a/includes/libs/replacers/Replacer.php +++ b/includes/libs/replacers/Replacer.php @@ -26,7 +26,7 @@ /** * @return array */ - function cb() { + public function cb() { return array( $this, 'replace' ); } } -- To view, visit https://gerrit.wikimedia.org/r/187400 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f35ea9b4bd2503bc612dc25dc8d34fc5ca040a0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Addshore addshorew...@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] Remove usage of $wgRedactedFunctionArguments - change (mediawiki...CentralAuth)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/187412 Change subject: Remove usage of $wgRedactedFunctionArguments .. Remove usage of $wgRedactedFunctionArguments Change-Id: I68551635b712c529f307147c45dd023b294b2031 --- M CentralAuth.php 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/12/187412/1 diff --git a/CentralAuth.php b/CentralAuth.php index 93eb314..e867280 100644 --- a/CentralAuth.php +++ b/CentralAuth.php @@ -474,10 +474,6 @@ $wgLogActionsHandlers[gblrights/{$type}] = 'efHandleWikiSetLogEntry'; } -$wgRedactedFunctionArguments['CentralAuthPlugin::authenticate'] = 1; -$wgRedactedFunctionArguments['CentralAuthUser::attemptPasswordMigration'] = 0; -$wgRedactedFunctionArguments['CentralAuthUser::register'] = 0; - $commonModuleInfo = array( 'localBasePath' = __DIR__ . '/modules', 'remoteExtPath' = 'CentralAuth/modules', -- To view, visit https://gerrit.wikimedia.org/r/187412 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68551635b712c529f307147c45dd023b294b2031 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth 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] Register the 'contenttranslation' change tag and add descrip... - change (mediawiki...ContentTranslation)
TTO has uploaded a new change for review. https://gerrit.wikimedia.org/r/187341 Change subject: Register the 'contenttranslation' change tag and add description .. Register the 'contenttranslation' change tag and add description This is necessary for the tag to appear correctly on Special:Tags. The ChangeTagsListActive hook was introduced to core in I77f476c8d0f32c80f720aa2c5e66869c81faa282 Change-Id: If721358dade947999f22e26eab9edd84943f11b5 --- M ContentTranslation.hooks.php M ContentTranslation.php M i18n/en.json M i18n/qqq.json 4 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/41/187341/1 diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php index 4cdd485..e5eac6b 100644 --- a/ContentTranslation.hooks.php +++ b/ContentTranslation.hooks.php @@ -124,4 +124,15 @@ $vars['wgContentTranslationDatabase'] = $wgContentTranslationDatabase; $vars['wgContentTranslationTargetNamespace'] = $wgContentTranslationTargetNamespace; } + + /** +* Hooks: ListDefinedTags and ChangeTagsListActive +* Define the content translation change tag, and mark it as active. +* @param array $tags +* @return bool +*/ + public static function registerTags( array $tags ) { + $tags[] = 'contenttranslation'; + return true; + } } diff --git a/ContentTranslation.php b/ContentTranslation.php index fd5d096..1aa204c 100644 --- a/ContentTranslation.php +++ b/ContentTranslation.php @@ -63,6 +63,8 @@ $GLOBALS['wgHooks']['ResourceLoaderGetConfigVars'][] = 'ContentTranslationHooks::addConfig'; $GLOBALS['wgHooks']['SpecialContributionsBeforeMainOutput'][] = 'ContentTranslationHooks::addNewContributionButton'; +$GLOBALS['wgHooks']['ListDefinedTags'][] = 'ContentTranslationHooks::registerTags'; +$GLOBALS['wgHooks']['ChangeTagsListActive'][] = 'ContentTranslationHooks::registerTags'; $GLOBALS['wgExtensionFunctions'][] = function () { global $wgResourceModules, $wgContentTranslationEventLogging; diff --git a/i18n/en.json b/i18n/en.json index c1cd9d9..7b7058c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -37,6 +37,7 @@ cx-translation-add-translation: + Add translation, cx-translation-target-page-exists: A page with the title [$1 $2] exists in the target wiki. Consider giving the page a different title., tag-contenttranslation: ContentTranslation, + tag-contenttranslation-description: The content was translated from another language using the ContentTranslation tool., cx-source-loading: Loading $1, cx-beta: Content translation, cx-beta-desc: A tool to quickly translate pages into your language. Start translations from your contributions page, and edit them with our side-by-side editor especially designed for translation. Some of the tools may be only available for specific languages., diff --git a/i18n/qqq.json b/i18n/qqq.json index 1dfb3e3..c01a227 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -42,6 +42,7 @@ cx-translation-add-translation: This appears in the empty paragraph in the translation column. Clicking the paragraph adds an automatic translation of the corresponding source paragraph. The plus sign is used as an icon that hints that something is being added., cx-translation-target-page-exists: A warning that is shown if a user tries to translate a page with a title that already exists in the target wiki. $1 is a URL to the target page and $2 is the target page title., tag-contenttranslation: A short description of the contenttranslation revision tag. It appears in the edit summary when a translated page is created. It doesn't have to be CamelCase., + tag-contenttranslation-description: A brief sentence to explain the use of the contenttranslation revision tag. This appears on [[Special:Tags]]., cx-source-loading: Status text shown in the source pane while the page is being loaded.\n\nParameters:\n* $1 - the title of the page being loaded\n{{Identical|Loading}}, cx-beta: Beta feature title. Appears in the beta tab in user preferences., cx-beta-desc: Beta feature description. Appears in the beta tab in user preferences., -- To view, visit https://gerrit.wikimedia.org/r/187341 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If721358dade947999f22e26eab9edd84943f11b5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation 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] Allow a resizeable toolbar index - change (mediawiki...WikiEditor)
Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/187339 Change subject: Allow a resizeable toolbar index .. Allow a resizeable toolbar index Change-Id: I329a143e2ee0a21bee4a9b146c28e6e8df58d570 --- M modules/jquery.wikiEditor.toolbar.css 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/39/187339/1 diff --git a/modules/jquery.wikiEditor.toolbar.css b/modules/jquery.wikiEditor.toolbar.css index 94971b5..64a3de7 100644 --- a/modules/jquery.wikiEditor.toolbar.css +++ b/modules/jquery.wikiEditor.toolbar.css @@ -211,6 +211,7 @@ width: 20%; height: 125px; overflow: auto; + resize: horizontal; } .wikiEditor-ui-toolbar .booklet .index div { padding: 4px; @@ -224,8 +225,6 @@ cursor: default; } .wikiEditor-ui-toolbar .booklet .pages { - float: right; - width: 80%; height: 125px; overflow: auto; background-color: #FAFAFA; -- To view, visit https://gerrit.wikimedia.org/r/187339 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I329a143e2ee0a21bee4a9b146c28e6e8df58d570 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] NPE crash from onPrepareOptionsMenu - change (apps...wikipedia)
BearND has uploaded a new change for review. https://gerrit.wikimedia.org/r/187335 Change subject: NPE crash from onPrepareOptionsMenu .. NPE crash from onPrepareOptionsMenu Maybe related to https://github.com/Prototik/HoloEverywhere/issues/577 'In onPrepareOptionsMenu, calling menu.findItem returns null when pressing menu key' Also refactored the findItem calls since they are potentially expensive and savePageMenu is used multiple times. I assume that if the first menu item is not null the others would not be null as well. If that's not the case we should get more reports like this with newer releases. But it think that's unlikely. Bug: T87109 Change-Id: Ic956ce57ea8a440c7d887978b43acdd432af92f8 --- M wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java 1 file changed, 24 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/35/187335/1 diff --git a/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java b/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java index 89ff220..2cb14d5 100644 --- a/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java +++ b/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java @@ -612,28 +612,38 @@ } public void onPrepareOptionsMenu(Menu menu) { +MenuItem savePageMenu = menu.findItem(R.id.menu_save_page); +if (savePageMenu == null) { +return; +} + +MenuItem shareMenu = menu.findItem(R.id.menu_share_page); +MenuItem otherLangMenu = menu.findItem(R.id.menu_other_languages); +MenuItem findInPageMenu = menu.findItem(R.id.menu_find_in_page); +MenuItem themeChooserMenu = menu.findItem(R.id.menu_themechooser); + switch (state) { case PageViewFragmentInternal.STATE_NO_FETCH: case PageViewFragmentInternal.STATE_INITIAL_FETCH: -menu.findItem(R.id.menu_save_page).setEnabled(false); -menu.findItem(R.id.menu_share_page).setEnabled(false); -menu.findItem(R.id.menu_other_languages).setEnabled(false); -menu.findItem(R.id.menu_find_in_page).setEnabled(false); -menu.findItem(R.id.menu_themechooser).setEnabled(false); +savePageMenu.setEnabled(false); +shareMenu.setEnabled(false); +otherLangMenu.setEnabled(false); +findInPageMenu.setEnabled(false); +themeChooserMenu.setEnabled(false); break; case PageViewFragmentInternal.STATE_COMPLETE_FETCH: -menu.findItem(R.id.menu_save_page).setEnabled(true); -menu.findItem(R.id.menu_share_page).setEnabled(true); -menu.findItem(R.id.menu_other_languages).setEnabled(true); -menu.findItem(R.id.menu_find_in_page).setEnabled(true); -menu.findItem(R.id.menu_themechooser).setEnabled(true); +savePageMenu.setEnabled(true); +shareMenu.setEnabled(true); +otherLangMenu.setEnabled(true); +findInPageMenu.setEnabled(true); +themeChooserMenu.setEnabled(true); if (subState == PageViewFragmentInternal.SUBSTATE_PAGE_SAVED) { -menu.findItem(R.id.menu_save_page).setEnabled(false); - menu.findItem(R.id.menu_save_page).setTitle(WikipediaApp.getInstance().getString(R.string.menu_page_saved)); +savePageMenu.setEnabled(false); + savePageMenu.setTitle(WikipediaApp.getInstance().getString(R.string.menu_page_saved)); } else if (subState == PageViewFragmentInternal.SUBSTATE_SAVED_PAGE_LOADED) { - menu.findItem(R.id.menu_save_page).setTitle(WikipediaApp.getInstance().getString(R.string.menu_refresh_saved_page)); + savePageMenu.setTitle(WikipediaApp.getInstance().getString(R.string.menu_refresh_saved_page)); } else { - menu.findItem(R.id.menu_save_page).setTitle(WikipediaApp.getInstance().getString(R.string.menu_save_page)); + savePageMenu.setTitle(WikipediaApp.getInstance().getString(R.string.menu_save_page)); } break; default: -- To view, visit https://gerrit.wikimedia.org/r/187335 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic956ce57ea8a440c7d887978b43acdd432af92f8 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: BearND bsitzm...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move buildErrorOutput out of wb.utilities.ui - change (mediawiki...Wikibase)
Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/187336 Change subject: Move buildErrorOutput out of wb.utilities.ui .. Move buildErrorOutput out of wb.utilities.ui Bug: T87433 Change-Id: Ibff02a33351b69e1f5fc736b40da53ef9485d75b --- M lib/resources/Resources.php M lib/resources/jquery.wikibase-shared/jquery.wikibase.wbtooltip.js M lib/resources/jquery.wikibase-shared/resources.php M lib/resources/jquery.wikibase/jquery.wikibase.sitelinkgroupview.js M lib/resources/jquery.wikibase/resources.php M lib/resources/utilities/resources.php M lib/resources/utilities/wikibase.utilities.ui.js A lib/resources/wikibase.buildErrorOutput.js 8 files changed, 60 insertions(+), 42 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/36/187336/1 diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php index 2d245f7..9bf5d48 100644 --- a/lib/resources/Resources.php +++ b/lib/resources/Resources.php @@ -58,6 +58,19 @@ ), ), + 'wikibase.buildErrorOutput' = $moduleTemplate + array( + 'scripts' = array( + 'wikibase.buildErrorOutput.js', + ), + 'dependencies' = array( + 'wikibase', + 'jquery.ui.toggler' + ), + 'messages' = array( + 'wikibase-tooltip-error-details', + ), + ), + 'wikibase.Site' = $moduleTemplate + array( 'scripts' = array( 'wikibase.Site.js', diff --git a/lib/resources/jquery.wikibase-shared/jquery.wikibase.wbtooltip.js b/lib/resources/jquery.wikibase-shared/jquery.wikibase.wbtooltip.js index 50a5646..453c5bd 100644 --- a/lib/resources/jquery.wikibase-shared/jquery.wikibase.wbtooltip.js +++ b/lib/resources/jquery.wikibase-shared/jquery.wikibase.wbtooltip.js @@ -283,7 +283,7 @@ * @TODO: Error tooltip should be a separate tooltip derivative. */ _buildErrorTooltip: function() { - return wb.utilities.ui.buildErrorOutput( this.options.content ) + return wb.buildErrorOutput( this.options.content ) .addClass( this.widgetFullName + '-error' ); }, diff --git a/lib/resources/jquery.wikibase-shared/resources.php b/lib/resources/jquery.wikibase-shared/resources.php index 43be3b0..8057e5d 100644 --- a/lib/resources/jquery.wikibase-shared/resources.php +++ b/lib/resources/jquery.wikibase-shared/resources.php @@ -38,7 +38,7 @@ 'dependencies' = array( 'jquery.tipsy', 'jquery.ui.widget', - 'wikibase.utilities', + 'wikibase.buildErrorOutput', ), ), diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.sitelinkgroupview.js b/lib/resources/jquery.wikibase/jquery.wikibase.sitelinkgroupview.js index 4f49908..b7b3cde 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.sitelinkgroupview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.sitelinkgroupview.js @@ -337,7 +337,7 @@ if( error ) { var self = this; - var $error = wb.utilities.ui.buildErrorOutput( error, { + var $error = wb.buildErrorOutput( error, { progress: function() { self.$headingSection.data( 'sticknode' ).refresh(); } diff --git a/lib/resources/jquery.wikibase/resources.php b/lib/resources/jquery.wikibase/resources.php index 5af19f5..c032ca3 100644 --- a/lib/resources/jquery.wikibase/resources.php +++ b/lib/resources/jquery.wikibase/resources.php @@ -339,6 +339,7 @@ 'jquery.util.EventSingletonManager', 'jquery.wikibase.sitelinklistview', 'mediawiki.jqueryMsg', // for {{plural}} and {{gender}} support in messages + 'wikibase.buildErrorOutput', 'wikibase.sites', 'wikibase.utilities', ), diff --git a/lib/resources/utilities/resources.php b/lib/resources/utilities/resources.php index 61d5663..ac6e349 100644 --- a/lib/resources/utilities/resources.php +++ b/lib/resources/utilities/resources.php @@ -46,8 +46,6 @@ 'dependencies' = array( 'wikibase', 'jquery.tipsy', - 'jquery.ui.toggler', -
[MediaWiki-commits] [Gerrit] Fix whitespaces - change (mediawiki...CodeEditor)
Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/187337 Change subject: Fix whitespaces .. Fix whitespaces Change-Id: Ia26f885ac2423d9f4a67b9e4d58a90aba22d0f07 --- M modules/jquery.codeEditor.js 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor refs/changes/37/187337/1 diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index e0c4803..68a57c6 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -7,7 +7,7 @@ */ 'req': [ 'codeEditor' ], /** -* Compatability map +* Compatability map */ browsers: { msie: [['=', 8]], @@ -125,8 +125,8 @@ }; context.api.addToToolbar( context, { 'section': 'main', - 'groups' : { - 'codeeditor-main' : { + 'groups': { + 'codeeditor-main': { 'tools': { 'codeEditor': { 'labelMsg': 'codeeditor-toolbar-toggle', @@ -139,8 +139,8 @@ } } }, - 'codeeditor-tools' : { - 'tools' : { + 'codeeditor-tools': { + 'tools': { } } } @@ -257,7 +257,7 @@ }, /** -* Turn off the code editor view and return to the plain textarea. +* Turn off the code editor view and return to the plain textarea. * May be needed by some folks with funky browsers, or just to compare. */ 'disableCodeEditor': function () { @@ -429,7 +429,7 @@ addToStatus( status, ( c.row + 1 ) + ':' + c.column, '' ); if ( !editor.selection.isEmpty() ) { r = editor.getSelectionRange(); - addToStatus( status, '(' + ( r.end.row - r.start.row ) + ':' + ( r.end.column - r.start.column ) + ')' ); + addToStatus( status, '(' + ( r.end.row - r.start.row ) + ':' + ( r.end.column - r.start.column ) + ')' ); } status.pop(); $lineAndMode.text( status.join( '' ) ); @@ -640,7 +640,7 @@ row++; } col = offset - pos; - return {row: row, column: col}; + return { row: row, column: col }; }; start = offsetToPos( options.start ); end = offsetToPos( options.end ); -- To view, visit https://gerrit.wikimedia.org/r/187337 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia26f885ac2423d9f4a67b9e4d58a90aba22d0f07 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeEditor Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix snak type selector - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Fix snak type selector .. Fix snak type selector Change-Id: I7780a7adec39d0385f01f4c40143720a66f56c49 --- M lib/resources/jquery.wikibase/snakview/snakview.SnakTypeSelector.js 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Henning Snater: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/resources/jquery.wikibase/snakview/snakview.SnakTypeSelector.js b/lib/resources/jquery.wikibase/snakview/snakview.SnakTypeSelector.js index b801e53..2440629 100644 --- a/lib/resources/jquery.wikibase/snakview/snakview.SnakTypeSelector.js +++ b/lib/resources/jquery.wikibase/snakview/snakview.SnakTypeSelector.js @@ -179,11 +179,11 @@ .data( 'snaktypeselector-menuitem-type', type ) .append( $( 'a/' ) - .text( mw.msg( 'wikibase-snakview-snaktypeselector-' + type ) + .text( mw.msg( 'wikibase-snakview-snaktypeselector-' + type ) ) .on( 'click.' + this.widgetName, function( event ) { event.preventDefault(); } ) - ) ) + ) ); } ); -- To view, visit https://gerrit.wikimedia.org/r/187111 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7780a7adec39d0385f01f4c40143720a66f56c49 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Henning Snater henning.sna...@wikimedia.de Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.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] Add missing .yaml extension to deployment-mx hiera file - change (operations/puppet)
Yuvipanda has submitted this change and it was merged. Change subject: Add missing .yaml extension to deployment-mx hiera file .. Add missing .yaml extension to deployment-mx hiera file Change-Id: I7c3c8952896c45e6fcc0cfedda54a95d6fef47a0 --- R hieradata/labs/deployment-prep/host/deployment-mx.yaml 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Yuvipanda: Verified; Looks good to me, approved diff --git a/hieradata/labs/deployment-prep/host/deployment-mx b/hieradata/labs/deployment-prep/host/deployment-mx.yaml similarity index 100% rename from hieradata/labs/deployment-prep/host/deployment-mx rename to hieradata/labs/deployment-prep/host/deployment-mx.yaml -- To view, visit https://gerrit.wikimedia.org/r/187340 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7c3c8952896c45e6fcc0cfedda54a95d6fef47a0 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add missing .yaml extension to deployment-mx hiera file - change (operations/puppet)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/187340 Change subject: Add missing .yaml extension to deployment-mx hiera file .. Add missing .yaml extension to deployment-mx hiera file Change-Id: I7c3c8952896c45e6fcc0cfedda54a95d6fef47a0 --- R hieradata/labs/deployment-prep/host/deployment-mx.yaml 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/40/187340/1 diff --git a/hieradata/labs/deployment-prep/host/deployment-mx b/hieradata/labs/deployment-prep/host/deployment-mx.yaml similarity index 100% rename from hieradata/labs/deployment-prep/host/deployment-mx rename to hieradata/labs/deployment-prep/host/deployment-mx.yaml -- To view, visit https://gerrit.wikimedia.org/r/187340 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c3c8952896c45e6fcc0cfedda54a95d6fef47a0 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] delete initial clone from github since everything there is n... - change (mediawiki...WikidataQuality)
Tamslo has submitted this change and it was merged. Change subject: delete initial clone from github since everything there is not used anymore; add helpers folder containing scripts to generate table for constraints from property talk pages .. delete initial clone from github since everything there is not used anymore; add helpers folder containing scripts to generate table for constraints from property talk pages Change-Id: I402b01925496155e167110b64fc213462d097b7d --- D README.md D examples/wikidata_paris/Paris - Wikidata.htm D examples/wikidata_paris/Paris - Wikidata_files/load.css D examples/wikidata_paris/Paris - Wikidata_files/load.php D examples/wikidata_paris/Paris - Wikidata_files/load_002.css D examples/wikidata_paris/Paris - Wikidata_files/load_002.php D examples/wikidata_paris/Paris - Wikidata_files/load_003.css D examples/wikidata_paris/Paris - Wikidata_files/load_003.php D examples/wikidata_paris/Paris - Wikidata_files/poweredby_mediawiki_88x31.png D examples/wikidata_paris/Paris - Wikidata_files/wikimedia-button.png D external validation/crosscheck.py D external validation/musicbrainz/MusicBrainzService.py D external validation/requirements.txt D external validation/wikidata/api.py D external validation/wikidata/claim.py D external validation/wikidata/claimdict.py D external validation/wikidata/datatypes.py D external validation/wikidata/entity.py D external validation/wikidata/entitydict.py D external validation/wikidata/helpers.py A helpers/SQL_constraints_parameters.sql A helpers/analyseConstraints.py A helpers/create_table_statement.sql D images/early_mockups/cross-checking_bars.png D images/early_mockups/cross-checking_button.png D images/early_mockups/cross-checking_id-result.png D images/early_mockups/cross-checking_identifier.png D images/early_mockups/highlighting_constraint_violation_severeness.png D images/early_mockups/highlighting_constraint_violations_edit.png D images/readme D images/really_early_mockups/Buxtehude.jpg D images/really_early_mockups/Paris.jpg D images/really_early_mockups/Washington.jpg D images/really_early_mockups/mockup_01.png D images/really_early_mockups/mockup_02.png D images/really_early_mockups/mockup_03.png D images/really_early_mockups/mockup_04.png 37 files changed, 16,550 insertions(+), 17,100 deletions(-) Approvals: Tamslo: Verified; Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/186095 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I402b01925496155e167110b64fc213462d097b7d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikidataQuality Gerrit-Branch: master Gerrit-Owner: Jonaskeutel jonas.keu...@student.hpi.de Gerrit-Reviewer: Springle sprin...@wikimedia.org Gerrit-Reviewer: Tamslo tamaraslosa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add no-gravity configuration option - change (operations...pybal)
Mark Bergsma has uploaded a new change for review. https://gerrit.wikimedia.org/r/187346 Change subject: Add no-gravity configuration option .. Add no-gravity configuration option If no-gravity = True on an LVS service, instead of removing a server from IPVS for depooling, its weight is set to 0 instead. This adds a lot of complications, as previously held invariants (e.g. (server.pooled == server listed in IPVS)) no longer hold. * server.pooled has been renamed to server.listed to clarify the distinction between being used and being configured in IPVS * server.listWeight has been added to distinguish between desired server weight when pooled vs weight configured in IPVS The existing code is also inconsistent with (boolean) server state variables that indicate _intent_ and _current state_. This is (at least partially) resolved by creating new variables: * server.list vs server.listed * server.pool vs server.pooled These are now maintained as separate concerns in the code. Tests still need to be adapted. Bug: T86650 Change-Id: I1f8aec57401481520eec80c7f9bfd0ca5271f7c2 --- M pybal/ipvs.py M pybal/pybal.py 2 files changed, 98 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/46/187346/1 diff --git a/pybal/ipvs.py b/pybal/ipvs.py index 6d4aa76..25cba80 100644 --- a/pybal/ipvs.py +++ b/pybal/ipvs.py @@ -141,8 +141,8 @@ cmd = .join(['-a', cls.subCommandService(service), cls.subCommandServer(server)]) # Include weight if specified -if server.weight: -cmd += ' -w %d' % server.weight +if server.listWeight: +cmd += ' -w %d' % server.listWeight return cmd @@ -159,8 +159,8 @@ cmd = .join(['-e', cls.subCommandService(service), cls.subCommandServer(server)]) # Include weight if specified -if server.weight: -cmd += ' -w %d' % server.weight +if server.listWeight: +cmd += ' -w %d' % server.listWeight return cmd @@ -192,6 +192,7 @@ self.configuration = configuration self.ipvsManager.DryRun = configuration.getboolean('dryrun', False) +self.noGravity = configuration.getboolean('no-gravity', False) if self.configuration.getboolean('bgp', False): from pybal import BGPFailover @@ -228,8 +229,15 @@ [self.ipvsManager.commandEditServer(self.service(), server) for server in newServers self.servers] + \ [self.ipvsManager.commandRemoveServer(self.service(), server) for server in self.servers - newServers] -self.servers = newServers self.ipvsManager.modifyState(cmdList) + +# Update server.listed server.pooled with new status +for server in self.servers + newServers: +server.listed = server in newServers +server.pooled = (server.listed and server.listWeight 0) + +self.servers = newServers + def addServer(self, server): Adds (pools) a single Server to the LVS state @@ -243,7 +251,8 @@ self.servers.add(server) self.ipvsManager.modifyState(cmdList) -server.pooled = True +server.listed = True +server.pooled = (server.weight != 0) def removeServer(self, server): Removes (depools) a single Server from the LVS state @@ -252,8 +261,25 @@ self.servers.remove(server) # May raise KeyError -server.pooled = False self.ipvsManager.modifyState(cmdList) +server.listed = False +server.pooled = False + + +def editServer(self, server): + +Changes the IPVS attributes of an existing server. + +Handles weight 0 as special (depooled) case +Does NOT modify server.weight + + +assert server.listed and server in self.servers + +cmdList = [self.ipvsManager.commandEditServer(self.service(), server)] +self.ipvsManager.modifyState(cmdList) +server.pooled = (server.weight != 0) + def initServer(self, server): Initializes a server instance with LVS service specific configuration. diff --git a/pybal/pybal.py b/pybal/pybal.py index 6dae0d3..4a4249e 100644 --- a/pybal/pybal.py +++ b/pybal/pybal.py @@ -49,15 +49,19 @@ self.monitors = set() # A few invariants that SHOULD be maintained (but currently may not be): -# P0: pooled = enabled /\ ready -# P1: up = pooled \/ !enabled \/ !ready +# P0: list = enabled /\ ready +# P1: up = pool \/ !enabled \/ !ready # P2: pooled = up \/ !canDepool -self.weight = self.DEF_WEIGHT -self.up = False -self.pooled = False -self.enabled = True -self.ready = False +self.weight =
[MediaWiki-commits] [Gerrit] [IMPROV] Throttle: Use general read/write methods - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/187348 Change subject: [IMPROV] Throttle: Use general read/write methods .. [IMPROV] Throttle: Use general read/write methods Instead of having to read and write the file always manually this is doing it in two methods. It also encodes the files as UTF-8 in case any family or code uses non-ascii characters. It also closes reliably opened files. Change-Id: I73208c5492a58971a94046fa594c8f4355fc9a5f --- M pywikibot/throttle.py 1 file changed, 49 insertions(+), 75 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/48/187348/1 diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py index a311a20..824c26c 100644 --- a/pywikibot/throttle.py +++ b/pywikibot/throttle.py @@ -8,6 +8,7 @@ __version__ = '$Id$' # +import codecs import math import threading import time @@ -81,58 +82,26 @@ pywikibot.debug(uChecking multiplicity: pid = %(pid)s % globals(), _logger) try: -processes = [] -my_pid = pid or 1 # start at 1 if global pid not yet set count = 1 -# open throttle.log -try: -f = open(self.ctrlfilename, 'r') -except IOError: -if not pid: -pass -else: -raise -else: -now = time.time() -for line in f.readlines(): -# parse line; format is pid timestamp site -try: -line = line.split(' ') -this_pid = int(line[0]) -ptime = int(line[1].split('.')[0]) -this_site = line[2].rstrip() -except (IndexError, ValueError): -# Sometimes the file gets corrupted ignore that line -continue -if now - ptime self.releasepid: -continue# process has expired, drop from file -if now - ptime = self.dropdelay \ - and this_site == mysite \ - and this_pid != pid: -count += 1 -if this_site != self.mysite or this_pid != pid: -processes.append({'pid': this_pid, - 'time': ptime, - 'site': this_site}) -if not pid and this_pid = my_pid: -my_pid = this_pid + 1 # next unused process id -f.close() - +processes = [p for p in self._read_processes() + if p['site'] != self.mysite or p['pid'] != pid] if not pid: -pid = my_pid +if processes: +pid = max(processes, key=lambda p: p['pid']) + 1 +else: +pid = 1 # start at 1 if global pid not yet set +now = time.time() +for process in processes: +if (now - process['ptime'] = self.dropdelay and +process['site'] == self.mysite and +process['pid'] != pid): +count += 1 + self.checktime = time.time() processes.append({'pid': pid, 'time': self.checktime, 'site': mysite}) -processes.sort(key=lambda p: (p['pid'], p['site'])) -try: -f = open(self.ctrlfilename, 'w') -for p in processes: -f.write(%(pid)s %(time)s %(site)s\n % p) -except IOError: -pass -else: -f.close() +self._write_processes(processes) self.process_multiplicity = count pywikibot.log(uFound %(count)s %(mysite)s processes urunning, including this one. % locals()) @@ -195,39 +164,44 @@ else: return 0.0 +def _read_processes(self): +processes = [] +try: +with codecs.open(self.ctrlfilename, 'r', 'utf-8') as f: +now = time.time() +for line in f.readlines(): +# parse line; format is pid timestamp site +try: +line = line.split(' ') +this_pid = int(line[0]) +ptime = int(line[1].split('.')[0]) +this_site = line[2].rstrip() +except (IndexError, ValueError): +# Sometimes the file gets corrupted ignore that line +continue +if now - ptime = self.releasepid: +# not outdated
[MediaWiki-commits] [Gerrit] Register the staff edit change tag and mark it as active - change (mediawiki...StaffEdits)
TTO has uploaded a new change for review. https://gerrit.wikimedia.org/r/187349 Change subject: Register the staff edit change tag and mark it as active .. Register the staff edit change tag and mark it as active This allows users to visit Special:Tags or use the API to see which change tags are defined and in active use. The ChangeTagsListActive hook was introduced to core in I77f476c8d0f32c80f720aa2c5e66869c81faa282 Change-Id: I11ecfd65b5ad320d56e86f502dc9e40192c7d212 --- M StaffEdits.class.php M StaffEdits.php 2 files changed, 15 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StaffEdits refs/changes/49/187349/1 diff --git a/StaffEdits.class.php b/StaffEdits.class.php index a6e9792..cd8de2f 100644 --- a/StaffEdits.class.php +++ b/StaffEdits.class.php @@ -85,4 +85,15 @@ return true; } -} \ No newline at end of file + + /** +* Registers, and marks as active, the staff edit change tag. +* +* @param array $tags +* @return bool +*/ + public static function onListDefinedAndActiveTags( array $tags ) { + $tags[] = self::msgKey( 'staffedit' ); + return true; + } +} diff --git a/StaffEdits.php b/StaffEdits.php index 0b89605..e41c2f4 100644 --- a/StaffEdits.php +++ b/StaffEdits.php @@ -48,4 +48,6 @@ $wgHooks['EditPage::showEditForm:initial'][] = 'StaffEdits::onEditPage'; $wgHooks['ListDefinedTags'][] = 'StaffEdits::onListDefinedTags'; -$wgHooks['RecentChange_save'][] = 'StaffEdits::onRecentChange_save'; \ No newline at end of file +$wgHooks['RecentChange_save'][] = 'StaffEdits::onRecentChange_save'; +$wgHooks['ListDefinedTags'][] = 'StaffEdits::onListDefinedAndActiveTags'; +$wgHooks['ChangeTagsListActive'][] = 'StaffEdits::onListDefinedAndActiveTags'; -- To view, visit https://gerrit.wikimedia.org/r/187349 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11ecfd65b5ad320d56e86f502dc9e40192c7d212 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/StaffEdits 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] Fixed sitelinklistview QUnit test - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Fixed sitelinklistview QUnit test .. Fixed sitelinklistview QUnit test As of change Iee90bfa54e8fdb0692d4bbe21ef2fd2d60aaccb8, sitelinklistview encapsulates its listview using TemplatedWidget's encapsulate option. Hence, listview events should not bubble up to the sitelinklistview node anymore. Change-Id: I0a325f639dccd0dfee61c5de83ba75f763ebc787 --- M lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js 1 file changed, 10 insertions(+), 2 deletions(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js b/lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js index 968e9e9..da52e4b 100644 --- a/lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js +++ b/lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js @@ -354,11 +354,19 @@ var $sitelinklistview = createSitelinklistview(), sitelinklistview = $sitelinklistview.data( 'sitelinklistview' ); + sitelinklistview.$listview + .on( 'listviewenternewitem', function() { + assert.ok( + true, + 'Triggered listview\'s enternewitem event on the listview node.' + ); + } ); + $sitelinklistview .on( 'listviewenternewitem', function( event, $sitelinkview ) { assert.ok( - true, - 'Added listview item.' + false, + 'Triggered listview\'s enternewitem event on the sitelinklistview node.' ); } ) .on( 'sitelinklistviewafterstartediting', function() { -- To view, visit https://gerrit.wikimedia.org/r/187342 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a325f639dccd0dfee61c5de83ba75f763ebc787 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.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] Fixed sitelinklistview QUnit test - change (mediawiki...Wikibase)
Henning Snater has uploaded a new change for review. https://gerrit.wikimedia.org/r/187342 Change subject: Fixed sitelinklistview QUnit test .. Fixed sitelinklistview QUnit test As of change Iee90bfa54e8fdb0692d4bbe21ef2fd2d60aaccb8, sitelinklistview encapsulates its listview using TemplatedWidget's encapsulate option. Hence, listview events should not bubble up to the sitelinklistview node anymore. Change-Id: I0a325f639dccd0dfee61c5de83ba75f763ebc787 --- M lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/42/187342/1 diff --git a/lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js b/lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js index 968e9e9..da52e4b 100644 --- a/lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js +++ b/lib/tests/qunit/jquery.wikibase/jquery.wikibase.sitelinklistview.tests.js @@ -354,11 +354,19 @@ var $sitelinklistview = createSitelinklistview(), sitelinklistview = $sitelinklistview.data( 'sitelinklistview' ); + sitelinklistview.$listview + .on( 'listviewenternewitem', function() { + assert.ok( + true, + 'Triggered listview\'s enternewitem event on the listview node.' + ); + } ); + $sitelinklistview .on( 'listviewenternewitem', function( event, $sitelinkview ) { assert.ok( - true, - 'Added listview item.' + false, + 'Triggered listview\'s enternewitem event on the sitelinklistview node.' ); } ) .on( 'sitelinklistviewafterstartediting', function() { -- To view, visit https://gerrit.wikimedia.org/r/187342 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a325f639dccd0dfee61c5de83ba75f763ebc787 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge TemplateRegistry into TemplateFactory - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/187343 Change subject: Merge TemplateRegistry into TemplateFactory .. Merge TemplateRegistry into TemplateFactory This is a *possible* refactoring of the template related classes. If you disagree, please tell me. * Drop TemplateRegistry. * Move registry functionality into TemplateFactory. * Drop TemplateFactory::get because it's only needed internally. * Change Template to not require a TemplateRegistry. The benefit of this (you can construct a Template first and add the needed template strings to the registry later) is theoretical and of no practical use, as far as I can see. Change-Id: Ia55eb1307432376e0c84019774b0ce8da231cdeb --- M repo/includes/Template/Template.php M repo/includes/Template/TemplateFactory.php D repo/includes/Template/TemplateRegistry.php A repo/tests/phpunit/includes/Template/TemplateFactoryTest.php D repo/tests/phpunit/includes/Template/TemplateRegistryTest.php M repo/tests/phpunit/includes/Template/TemplateTest.php 6 files changed, 117 insertions(+), 184 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/43/187343/1 diff --git a/repo/includes/Template/Template.php b/repo/includes/Template/Template.php index 02c85e1..9344fdc 100644 --- a/repo/includes/Template/Template.php +++ b/repo/includes/Template/Template.php @@ -14,43 +14,33 @@ * * @licence GNU GPL v2+ * @author H. Snater mediaw...@snater.com + * @author Thiemo Mättig */ class Template extends Message { - - protected $templateRegistry; /** * important! note that the Template class does not escape anything. * be sure to escape your params before using this class! * -* @param TemplateRegistry $templateRegistry -* @param $key: message key, or array of message keys to try -* and use the first non-empty message for -* @param $params Array message parameters +* @param string|string[] $key Message key or array of message keys to try and use the first +* non-empty message for. +* @param string|null $template A raw, non-empty template string or null, if a template with +* that name could not be found. +* @param array $params Message parameters. */ - public function __construct( TemplateRegistry $templateRegistry, $key, $params = array() ) { - $this-templateRegistry = $templateRegistry; + public function __construct( $key, $template, $params = array() ) { parent::__construct( $key, $params ); - } - /** -* Fetch a template from the template store. -* @see \Message.fetchMessage() -* -* @return string template -*/ - protected function fetchMessage() { - if ( !isset( $this-message ) ) { - $this-message = $this-templateRegistry-getTemplate( $this-key ); + if ( is_string( $template ) $template !== '' ) { + $this-message = $template; } - return $this-message; } /** * @return string */ public function render() { - // Use plain() to prevent replacing {{...}}: + // Use plain() to prevent replacing {{...}} return $this-plain(); } diff --git a/repo/includes/Template/TemplateFactory.php b/repo/includes/Template/TemplateFactory.php index fcf364d..4b7b044 100644 --- a/repo/includes/Template/TemplateFactory.php +++ b/repo/includes/Template/TemplateFactory.php @@ -15,42 +15,61 @@ private static $instance; /** -* @var TemplateRegistry +* @var string[] */ - private $templateRegistry; + private $templates = array(); public static function getDefaultInstance() { if ( self::$instance === null ) { - self::$instance = new self( - new TemplateRegistry( include( __DIR__ . '/../../resources/templates.php' ) ) - ); + self::$instance = new self( include( __DIR__ . '/../../resources/templates.php' ) ); } return self::$instance; } /** -* @param TemplateRegistry $templateRegistry +* @param string[] $templates */ - public function __construct( TemplateRegistry $templateRegistry ) { - $this-templateRegistry = $templateRegistry; + public function __construct( array $templates = array() ) { + $this-addTemplates( $templates ); + } + + /** +* Adds multiple raw template strings to the internal store. +* +* @param string[] $templates +*/ + public function addTemplates(
[MediaWiki-commits] [Gerrit] Fix main snak displaying in diffs of qualifiers, ranks and r... - change (mediawiki...Wikibase)
Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/187344 Change subject: Fix main snak displaying in diffs of qualifiers, ranks and references .. Fix main snak displaying in diffs of qualifiers, ranks and references Bug: T87096 Change-Id: Ifcea7bf9ccc0291d94e04f996ddf1f50ee22bab0 --- M repo/includes/Diff/ClaimDifferenceVisualizer.php M repo/tests/phpunit/includes/Diff/ClaimDifferenceVisualizerTest.php 2 files changed, 61 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/44/187344/1 diff --git a/repo/includes/Diff/ClaimDifferenceVisualizer.php b/repo/includes/Diff/ClaimDifferenceVisualizer.php index d794289..f77ee4a 100644 --- a/repo/includes/Diff/ClaimDifferenceVisualizer.php +++ b/repo/includes/Diff/ClaimDifferenceVisualizer.php @@ -107,23 +107,32 @@ if ( $claimDifference-getMainSnakChange() !== null ) { $html .= $this-visualizeMainSnakChange( $claimDifference-getMainSnakChange() ); + $oldMainSnak = $claimDifference-getMainSnakChange()-getOldValue(); + } else { + $oldMainSnak = null; } if ( $claimDifference-getRankChange() !== null ) { - $html .= $this-visualizeRankChange( $claimDifference-getRankChange(), $baseClaim ); + $html .= $this-visualizeRankChange( + $claimDifference-getRankChange(), + $oldMainSnak, + $baseClaim-getMainSnak() + ); } if ( $claimDifference-getQualifierChanges() !== null ) { $html .= $this-visualizeQualifierChanges( $claimDifference-getQualifierChanges(), - $baseClaim + $oldMainSnak, + $baseClaim-getMainSnak() ); } if ( $claimDifference-getReferenceChanges() !== null ) { $html .= $this-visualizeSnakListChanges( $claimDifference-getReferenceChanges(), - $baseClaim, + $oldMainSnak, + $baseClaim-getMainSnak(), wfMessage( 'wikibase-diffview-reference' )-inLanguage( $this-languageCode ) ); } @@ -197,14 +206,22 @@ * @since 0.4 * * @param DiffOpChange $rankChange -* @param Claim $claim the claim, as context for display +* @param Snak|null $oldMainSnak +* @param Snak|null $newMainSnak * * @return string */ - protected function visualizeRankChange( DiffOpChange $rankChange, Claim $claim ) { - $claimMainSnak = $claim-getMainSnak(); - $claimHeader = $this-getSnakValueHeader( $claimMainSnak ); - + protected function visualizeRankChange( DiffOpChange $rankChange, Snak $oldMainSnak = null, Snak $newMainSnak = null ) { + if ( $rankChange instanceof DiffOpAdd $newMainSnak ) { + $claimHeader = $this-getSnakValueHeader( $newMainSnak ); + } else if ( $rankChange instanceof DiffOpRemove $oldMainSnak ) { + $claimHeader = $this-getSnakValueHeader( $oldMainSnak ); + } else if ( $rankChange instanceof DiffOpChange ) { + // FIXME: Should show different headers for left and right side of the diff + $claimHeader = $this-getSnakValueHeader( $newMainSnak ); + } else { + $claimHeader = $this-getSnakValueHeader( $newMainSnak ?: $oldMainSnak ); + } $valueFormatter = new DiffOpValueFormatter( $claimHeader . ' / ' . wfMessage( 'wikibase-diffview-rank' )-inLanguage( $this-languageCode )-parse(), $this-getRankHtml( $rankChange-getOldValue() ), @@ -320,11 +337,11 @@ * * @since 0.4 * -* @param Snak $snak +* @param Snak|null $snak * * @return string HTML */ - protected function getSnakValueHeader( Snak $snak ) { + protected function getSnakValueHeader( Snak $snak = null ) { $headerText = $this-getSnakLabelHeader( $snak ); try { @@ -343,17 +360,23 @@ * @since 0.4 * * @param Diff $changes -* @param Claim $claim +* @param Snak|null $oldMainSnak +* @param Snak|null $newMainSnak * @param Message $breadCrumb * * @return string * @throws
[MediaWiki-commits] [Gerrit] New Wikidata Build - 2015/01/29 - change (mediawiki...Wikidata)
Tobias Gritschacher has submitted this change and it was merged. Change subject: New Wikidata Build - 2015/01/29 .. New Wikidata Build - 2015/01/29 Change-Id: Idc8f79cbc5c2c0de7e474c2c544b0c2c836e0756 --- M WikibaseClient.settings.php M WikibaseRepo.settings.php M composer.json M composer.lock M extensions/PropertySuggester/PropertySuggester.php M extensions/PropertySuggester/README.md M extensions/PropertySuggester/src/PropertySuggester/ResultBuilder.php M extensions/ValueView/README.md M extensions/ValueView/ValueView.php M extensions/ValueView/lib/jquery.ui/jquery.ui.listrotator.css M extensions/ValueView/lib/jquery.ui/jquery.ui.listrotator.js M extensions/ValueView/lib/jquery.ui/jquery.ui.suggester.js M extensions/ValueView/lib/jquery.ui/jquery.ui.toggler.css M extensions/ValueView/lib/jquery.ui/jquery.ui.toggler.js M extensions/ValueView/lib/jquery/jquery.inputautoexpand.js M extensions/ValueView/src/ExpertExtender/ExpertExtender.CalendarHint.css M extensions/ValueView/src/ExpertExtender/ExpertExtender.CalendarHint.js M extensions/ValueView/src/ExpertExtender/ExpertExtender.LanguageSelector.js M extensions/ValueView/src/ExpertExtender/resources.php M extensions/ValueView/tests/lib/jquery.ui/jquery.ui.toggler.tests.js M extensions/ValueView/tests/lib/jquery/jquery.inputautoexpand.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.CalendarHint.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Container.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.LanguageSelector.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Listrotator.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Preview.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Toggler.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.tests.js M extensions/ValueView/tests/src/ExpertExtender/testExpertExtenderExtension.js M extensions/Wikibase/.gitignore A extensions/Wikibase/.jscsrc M extensions/Wikibase/.jshintignore D extensions/Wikibase/client/composer.json M extensions/Wikibase/client/config/WikibaseClient.default.php M extensions/Wikibase/client/i18n/bg.json M extensions/Wikibase/client/i18n/da.json M extensions/Wikibase/client/i18n/diq.json M extensions/Wikibase/client/i18n/en.json M extensions/Wikibase/client/i18n/fi.json M extensions/Wikibase/client/i18n/nds-nl.json M extensions/Wikibase/client/i18n/qqq.json M extensions/Wikibase/client/i18n/roa-tara.json M extensions/Wikibase/client/i18n/sr-ec.json M extensions/Wikibase/client/i18n/uz.json M extensions/Wikibase/client/includes/Changes/ChangeHandler.php M extensions/Wikibase/client/includes/Hooks/DataUpdateHookHandlers.php M extensions/Wikibase/client/includes/Hooks/LanguageLinkBadgeDisplay.php M extensions/Wikibase/client/includes/Hooks/OtherProjectsSidebarGenerator.php M extensions/Wikibase/client/includes/Hooks/OtherProjectsSidebarGeneratorFactory.php M extensions/Wikibase/client/includes/Hooks/SidebarHookHandlers.php M extensions/Wikibase/client/includes/OtherProjectsSitesGenerator.php A extensions/Wikibase/client/includes/Usage/NullSubscriptionManager.php A extensions/Wikibase/client/includes/Usage/Sql/SqlSubscriptionManager.php M extensions/Wikibase/client/includes/Usage/SubscriptionManager.php M extensions/Wikibase/client/includes/api/PageTerms.php M extensions/Wikibase/client/includes/recentchanges/ChangeLineFormatter.php M extensions/Wikibase/client/includes/recentchanges/ExternalRecentChange.php M extensions/Wikibase/client/includes/recentchanges/RecentChangesFilterOptions.php M extensions/Wikibase/client/includes/scribunto/WikibaseLuaBindings.php M extensions/Wikibase/client/includes/specials/SpecialUnconnectedPages.php M extensions/Wikibase/client/includes/store/sql/DirectSqlStore.php M extensions/Wikibase/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js M extensions/Wikibase/client/resources/wikibase.client.PageConnector.js M extensions/Wikibase/client/tests/phpunit/MockClientStore.php M extensions/Wikibase/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php M extensions/Wikibase/client/tests/phpunit/includes/Hooks/SidebarHookHandlersTest.php M extensions/Wikibase/client/tests/phpunit/includes/LangLinkHandlerTest.php M extensions/Wikibase/client/tests/phpunit/includes/OtherProjectsSitesGeneratorTest.php A extensions/Wikibase/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php M extensions/Wikibase/client/tests/phpunit/includes/api/PageTermsTest.php M extensions/Wikibase/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php M extensions/Wikibase/composer.json M extensions/Wikibase/docs/options.wiki D extensions/Wikibase/lib/composer.json M extensions/Wikibase/lib/i18n/ce.json M extensions/Wikibase/lib/i18n/cs.json M extensions/Wikibase/lib/i18n/de.json M
[MediaWiki-commits] [Gerrit] Added special pages for constraint review and external valid... - change (mediawiki...WikidataQuality)
Tamslo has uploaded a new change for review. https://gerrit.wikimedia.org/r/187347 Change subject: Added special pages for constraint review and external validation and the importer for exernal data .. Added special pages for constraint review and external validation and the importer for exernal data Change-Id: Ic523a63943507b8469f7b3ffb6c6cce03db7d9a4 --- A .gitignore A README.md A WikidataQuality.alias.php A WikidataQuality.i18n.php A WikidataQuality.php A WikidataQualityHooks.php A composer.json A constraint-report/specials/SpecialWikidataConstraintReport.php A constraint-report/sql/create_wbq_constraints_from_templates.sql A external-validation/maintenance/UpdateTable.php A external-validation/modules/SpecialCrossCheck.css A external-validation/specials/SpecialCrossCheck.php A external-validation/sql/create_wdq_dump_information.sql A external-validation/sql/create_wdq_external_data.sql A external-validation/src/CrossCheck/Comparer/DataValueComparer.php A external-validation/src/CrossCheck/Comparer/EntityIdValueComparer.php A external-validation/src/CrossCheck/CrossChecker.php A external-validation/src/CrossCheck/MappingEvaluator/MappingEvaluator.php A external-validation/src/CrossCheck/MappingEvaluator/XPathEvaluator.php A external-validation/src/CrossCheck/Result/CompareResult.php A external-validation/src/CrossCheck/Result/CompareResultList.php A external-validation/src/CrossCheck/mapping.inc.php A external-validation/src/UpdateTable/ImportContext.php A external-validation/src/UpdateTable/Importer/GndImporter.php A external-validation/src/UpdateTable/Importer/Importer.php D helpers/SQL_constraints_parameters.sql D helpers/analyseConstraints.py D helpers/create_table_statement.sql A i18n/en.json A i18n/qqq.json 30 files changed, 18,295 insertions(+), 16,550 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikidataQuality refs/changes/47/187347/1 -- To view, visit https://gerrit.wikimedia.org/r/187347 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic523a63943507b8469f7b3ffb6c6cce03db7d9a4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikidataQuality Gerrit-Branch: master Gerrit-Owner: Tamslo tamaraslosa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added special pages for constraint review and external valid... - change (mediawiki...WikidataQuality)
Soeren.oldag has submitted this change and it was merged. Change subject: Added special pages for constraint review and external validation and the importer for exernal data .. Added special pages for constraint review and external validation and the importer for exernal data Change-Id: Ic523a63943507b8469f7b3ffb6c6cce03db7d9a4 --- A .gitignore A README.md A WikidataQuality.alias.php A WikidataQuality.i18n.php A WikidataQuality.php A WikidataQualityHooks.php A composer.json A constraint-report/specials/SpecialWikidataConstraintReport.php A constraint-report/sql/create_wbq_constraints_from_templates.sql A external-validation/maintenance/UpdateTable.php A external-validation/modules/SpecialCrossCheck.css A external-validation/specials/SpecialCrossCheck.php A external-validation/sql/create_wdq_dump_information.sql A external-validation/sql/create_wdq_external_data.sql A external-validation/src/CrossCheck/Comparer/DataValueComparer.php A external-validation/src/CrossCheck/Comparer/EntityIdValueComparer.php A external-validation/src/CrossCheck/CrossChecker.php A external-validation/src/CrossCheck/MappingEvaluator/MappingEvaluator.php A external-validation/src/CrossCheck/MappingEvaluator/XPathEvaluator.php A external-validation/src/CrossCheck/Result/CompareResult.php A external-validation/src/CrossCheck/Result/CompareResultList.php A external-validation/src/CrossCheck/mapping.inc.php A external-validation/src/UpdateTable/ImportContext.php A external-validation/src/UpdateTable/Importer/GndImporter.php A external-validation/src/UpdateTable/Importer/Importer.php D helpers/SQL_constraints_parameters.sql D helpers/analyseConstraints.py D helpers/create_table_statement.sql A i18n/en.json A i18n/qqq.json 30 files changed, 18,295 insertions(+), 16,550 deletions(-) Approvals: Soeren.oldag: Verified; Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/187347 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic523a63943507b8469f7b3ffb6c6cce03db7d9a4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikidataQuality Gerrit-Branch: master Gerrit-Owner: Tamslo tamaraslosa...@gmail.com Gerrit-Reviewer: Soeren.oldag soeren.ol...@student.hpi.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement ChangeTagsListActive hook - change (mediawiki...AutoProxyBlock)
TTO has uploaded a new change for review. https://gerrit.wikimedia.org/r/187350 Change subject: Implement ChangeTagsListActive hook .. Implement ChangeTagsListActive hook This allows users to visit Special:Tags or use the API to see which change tags are still in active use. The ChangeTagsListActive hook was introduced to core in I77f476c8d0f32c80f720aa2c5e66869c81faa282 Change-Id: I38b3e607366191106a12cad0c146f2bd278a --- M AutoProxyBlock.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AutoProxyBlock refs/changes/50/187350/1 diff --git a/AutoProxyBlock.php b/AutoProxyBlock.php index 9f5731e..e8f843c 100644 --- a/AutoProxyBlock.php +++ b/AutoProxyBlock.php @@ -24,6 +24,7 @@ $wgHooks['getUserPermissionsErrorsExpensive'][] = 'AutoProxyBlock::checkProxy'; $wgHooks['RecentChange_save'][] = 'AutoProxyBlock::tagProxyChange'; $wgHooks['ListDefinedTags'][] = 'AutoProxyBlock::addProxyTag'; +$wgHooks['ChangeTagsListActive'][] = 'AutoProxyBlock::addProxyTag'; $wgHooks['AbuseFilter-filterAction'][] = 'AutoProxyBlock::AFSetVar'; $wgHooks['AbuseFilter-builder'][] = 'AutoProxyBlock::AFBuilderVars'; -- To view, visit https://gerrit.wikimedia.org/r/187350 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38b3e607366191106a12cad0c146f2bd278a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AutoProxyBlock 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] New Wikidata Build - 2015/01/29 - change (mediawiki...Wikidata)
Tobias Gritschacher has uploaded a new change for review. https://gerrit.wikimedia.org/r/187345 Change subject: New Wikidata Build - 2015/01/29 .. New Wikidata Build - 2015/01/29 Change-Id: Idc8f79cbc5c2c0de7e474c2c544b0c2c836e0756 --- M WikibaseClient.settings.php M WikibaseRepo.settings.php M composer.json M composer.lock M extensions/ValueView/README.md M extensions/ValueView/ValueView.php M extensions/ValueView/lib/jquery.ui/jquery.ui.listrotator.css M extensions/ValueView/lib/jquery.ui/jquery.ui.listrotator.js M extensions/ValueView/lib/jquery.ui/jquery.ui.suggester.js M extensions/ValueView/lib/jquery.ui/jquery.ui.toggler.css M extensions/ValueView/lib/jquery.ui/jquery.ui.toggler.js M extensions/ValueView/lib/jquery/jquery.inputautoexpand.js M extensions/ValueView/src/ExpertExtender/ExpertExtender.CalendarHint.css M extensions/ValueView/src/ExpertExtender/ExpertExtender.CalendarHint.js M extensions/ValueView/src/ExpertExtender/ExpertExtender.LanguageSelector.js M extensions/ValueView/src/ExpertExtender/resources.php M extensions/ValueView/tests/lib/jquery.ui/jquery.ui.toggler.tests.js M extensions/ValueView/tests/lib/jquery/jquery.inputautoexpand.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.CalendarHint.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Container.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.LanguageSelector.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Listrotator.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Preview.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.Toggler.tests.js M extensions/ValueView/tests/src/ExpertExtender/ExpertExtender.tests.js M extensions/ValueView/tests/src/ExpertExtender/testExpertExtenderExtension.js M extensions/Wikibase/.gitignore A extensions/Wikibase/.jscsrc M extensions/Wikibase/.jshintignore D extensions/Wikibase/client/composer.json M extensions/Wikibase/client/config/WikibaseClient.default.php M extensions/Wikibase/client/i18n/bg.json M extensions/Wikibase/client/i18n/da.json M extensions/Wikibase/client/i18n/diq.json M extensions/Wikibase/client/i18n/en.json M extensions/Wikibase/client/i18n/fi.json M extensions/Wikibase/client/i18n/nds-nl.json M extensions/Wikibase/client/i18n/qqq.json M extensions/Wikibase/client/i18n/roa-tara.json M extensions/Wikibase/client/i18n/sr-ec.json M extensions/Wikibase/client/i18n/uz.json M extensions/Wikibase/client/includes/Changes/ChangeHandler.php M extensions/Wikibase/client/includes/Hooks/DataUpdateHookHandlers.php M extensions/Wikibase/client/includes/Hooks/LanguageLinkBadgeDisplay.php M extensions/Wikibase/client/includes/Hooks/OtherProjectsSidebarGenerator.php M extensions/Wikibase/client/includes/Hooks/OtherProjectsSidebarGeneratorFactory.php M extensions/Wikibase/client/includes/Hooks/SidebarHookHandlers.php M extensions/Wikibase/client/includes/OtherProjectsSitesGenerator.php A extensions/Wikibase/client/includes/Usage/NullSubscriptionManager.php A extensions/Wikibase/client/includes/Usage/Sql/SqlSubscriptionManager.php M extensions/Wikibase/client/includes/Usage/SubscriptionManager.php M extensions/Wikibase/client/includes/api/PageTerms.php M extensions/Wikibase/client/includes/recentchanges/ChangeLineFormatter.php M extensions/Wikibase/client/includes/recentchanges/ExternalRecentChange.php M extensions/Wikibase/client/includes/recentchanges/RecentChangesFilterOptions.php M extensions/Wikibase/client/includes/scribunto/WikibaseLuaBindings.php M extensions/Wikibase/client/includes/specials/SpecialUnconnectedPages.php M extensions/Wikibase/client/includes/store/sql/DirectSqlStore.php M extensions/Wikibase/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js M extensions/Wikibase/client/resources/wikibase.client.PageConnector.js M extensions/Wikibase/client/tests/phpunit/MockClientStore.php M extensions/Wikibase/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php M extensions/Wikibase/client/tests/phpunit/includes/Hooks/SidebarHookHandlersTest.php M extensions/Wikibase/client/tests/phpunit/includes/LangLinkHandlerTest.php M extensions/Wikibase/client/tests/phpunit/includes/OtherProjectsSitesGeneratorTest.php A extensions/Wikibase/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php M extensions/Wikibase/client/tests/phpunit/includes/api/PageTermsTest.php M extensions/Wikibase/client/tests/phpunit/includes/store/sql/DirectSqlStoreTest.php M extensions/Wikibase/composer.json M extensions/Wikibase/docs/options.wiki D extensions/Wikibase/lib/composer.json M extensions/Wikibase/lib/i18n/ce.json M extensions/Wikibase/lib/i18n/cs.json M extensions/Wikibase/lib/i18n/de.json M extensions/Wikibase/lib/i18n/en.json M extensions/Wikibase/lib/i18n/eo.json M extensions/Wikibase/lib/i18n/et.json M extensions/Wikibase/lib/i18n/eu.json M
[MediaWiki-commits] [Gerrit] Consistency tweaks in preparation for adding extension to tr... - change (mediawiki...Josa)
Raimond Spekking has uploaded a new change for review. https://gerrit.wikimedia.org/r/187352 Change subject: Consistency tweaks in preparation for adding extension to translatewiki.net .. Consistency tweaks in preparation for adding extension to translatewiki.net * Move magic file * Add i18n JSON file Change-Id: I6c149d81927cc1cd152be7b53caee1a0a894fe3e --- R Josa.i18n.magic.php M Josa.php A i18n/en.json A i18n/qqq.json 4 files changed, 24 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Josa refs/changes/52/187352/1 diff --git a/Josa.i18n.php b/Josa.i18n.magic.php similarity index 100% rename from Josa.i18n.php rename to Josa.i18n.magic.php diff --git a/Josa.php b/Josa.php index 2d4d043..62789c0 100644 --- a/Josa.php +++ b/Josa.php @@ -16,9 +16,13 @@ 'name' = 'Josa', 'author' = 'JuneHyeon Bae (devunt)', 'url' = 'https://www.mediawiki.org/wiki/Extension:Josa', - 'description' = 'Automates some part of Korean transliteration process.', - 'version' = '0.1', + 'descriptionmsg' = 'josa-desc', + 'version' = '0.1.1', ); $wgHooks['ParserFirstCallInit'][] = 'Josa::InitParserFunction'; -$wgExtensionMessagesFiles['Josa'] = dirname( __FILE__ ) . '/Josa.i18n.php'; -$wgAutoloadClasses['Josa'] = dirname( __FILE__ ) . '/Josa.class.php'; + +// Load i18n files +$wgMessagesDirs['Josa'] = __DIR__ . '/i18n'; +$wgExtensionMessagesFiles['JosaMagic'] = __DIR__ . '/Josa.i18n.magic.php'; + +$wgAutoloadClasses['Josa'] = __DIR__ . '/Josa.class.php'; diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 000..b23834b --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,8 @@ +{ + @metadata: { + authors: [ + JuneHyeon Bae + ] + }, + josa-desc: Automates some part of Korean transliteration process +} diff --git a/i18n/qqq.json b/i18n/qqq.json new file mode 100644 index 000..cfe6e13 --- /dev/null +++ b/i18n/qqq.json @@ -0,0 +1,8 @@ +{ + @metadata: { + authors: [ + Raimond Spekking + ] + }, + josa-desc: {{desc|name=Josa|url=https://www.mediawiki.org/wiki/Extension:Josa}}; +} -- To view, visit https://gerrit.wikimedia.org/r/187352 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c149d81927cc1cd152be7b53caee1a0a894fe3e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Josa 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] Register the staff edit change tag and mark it as active - change (mediawiki...GoogleLogin)
TTO has uploaded a new change for review. https://gerrit.wikimedia.org/r/187351 Change subject: Register the staff edit change tag and mark it as active .. Register the staff edit change tag and mark it as active This allows users to visit Special:Tags or use the API to see which change tags are defined and in active use. The ChangeTagsListActive hook was introduced to core in I77f476c8d0f32c80f720aa2c5e66869c81faa282 Change-Id: I0a5c81cad29e7dfe62a472ee265dcb074f7330e1 --- M GoogleLogin.php M includes/GoogleLogin.hooks.php 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleLogin refs/changes/51/187351/1 diff --git a/GoogleLogin.php b/GoogleLogin.php index bf07d15..bf46e26 100644 --- a/GoogleLogin.php +++ b/GoogleLogin.php @@ -82,6 +82,8 @@ $wgHooks['SpecialPage_initList'][] = 'GoogleLoginHooks::onSpecialPage_initList'; $wgHooks['GetPreferences'][] = 'GoogleLoginHooks::onGetPreferences'; $wgHooks['RecentChange_save'][] = 'GoogleLoginHooks::onRecentChange_save'; + $wgHooks['ListDefinedTags'][] = 'GoogleLoginHooks::onListDefinedAndActiveTags'; + $wgHooks['ChangeTagsListActive'][] = 'GoogleLoginHooks::onListDefinedAndActiveTags'; // ResourceLoader modules $wgResourceModules['ext.GoogleLogin.style'] = array( diff --git a/includes/GoogleLogin.hooks.php b/includes/GoogleLogin.hooks.php index b548d42..7e8e43a 100644 --- a/includes/GoogleLogin.hooks.php +++ b/includes/GoogleLogin.hooks.php @@ -137,4 +137,15 @@ ChangeTags::addTags( 'googlelogin', $attribs['rc_id'] ); } } + + /** +* Register, and mark as active, the 'googlelogin' change tag +* +* @param array $tags +* @return bool +*/ + public static function onListDefinedAndActiveTags( array $tags ) { + $tags[] = 'googlelogin'; + return true; + } } -- To view, visit https://gerrit.wikimedia.org/r/187351 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a5c81cad29e7dfe62a472ee265dcb074f7330e1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GoogleLogin 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] Fix wrong variable name in EntityIdHtmlLinkFormatter - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/187353 Change subject: Fix wrong variable name in EntityIdHtmlLinkFormatter .. Fix wrong variable name in EntityIdHtmlLinkFormatter * Wrong variable name was introduced in Iadacb82. * Actual language can't be null. * Inline some really trivial code. * Add docs. Change-Id: I80c57be4181c53c2646657f949f157925d253d03 --- M lib/includes/formatters/EntityIdHtmlLinkFormatter.php 1 file changed, 23 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/53/187353/1 diff --git a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php index 6fe97fc..7521180 100644 --- a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php +++ b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php @@ -75,7 +75,6 @@ * @return string HTML */ private function getHtmlForTerm( $targetUrl, Term $term, $titleText = '' ) { - $label = $term-getText(); $fallbackIndicatorHtml = ''; $attributes = array( @@ -92,13 +91,9 @@ } } - $html = Html::element( 'a', $attributes, $label ); + $html = Html::element( 'a', $attributes, $term-getText() ); - if ( $fallbackIndicatorHtml !== '' ) { - $html .= $fallbackIndicatorHtml; - } - - return $html; + return $html . $fallbackIndicatorHtml; } /** @@ -119,6 +114,12 @@ return $entityId-getSerialization() . $separator . $undefinedInfo; } + /** +* @param string $languageCode +* @param string $inLanguage +* +* @return string +*/ private function getLanguageName( $languageCode, $inLanguage ) { //TODO: inject language name lookup! return Utils::fetchLanguageName( $languageCode, $inLanguage ); @@ -130,8 +131,7 @@ $sourceLanguage = $term-getSourceLanguageCode(); // FIXME: TermFallback should either return equal values or null - $actualLanguage = ( $actualLanguage === null ? $requestedLanguage : $actualLanguage ); - $sourceLanguage = ( $sourceLanguage === null ? $actualLanguage : $sourceLanguage ); + $sourceLanguage = $sourceLanguage === null ? $actualLanguage : $sourceLanguage; $isInRequestedLanguage = $actualLanguage === $requestedLanguage; $isInSourceLanguage = $actualLanguage === $sourceLanguage; @@ -142,40 +142,43 @@ } $sourceLanguageName = $this-getLanguageName( $sourceLanguage, $requestedLanguage ); - $requestedLanguageName = $this-getLanguageName( $actualLanguage, $requestedLanguage ); + $actualLanguageName = $this-getLanguageName( $actualLanguage, $requestedLanguage ); // Generate indicator text if ( $isInSourceLanguage ) { $text = $sourceLanguageName; } else { - $msg = wfMessage( + $text = wfMessage( 'wikibase-language-fallback-transliteration-hint', $sourceLanguageName, - $requestedLanguageName - ); - $text = $msg-text(); + $actualLanguageName + )-text(); } // Generate HTML class names - $classes = array( 'wb-language-fallback-indicator' ); + $classes = 'wb-language-fallback-indicator'; if ( !$isInSourceLanguage ) { - $classes[] = 'wb-language-fallback-transliteration'; + $classes .= ' wb-language-fallback-transliteration'; } if ( !$isInRequestedLanguage $this-getBaseLanguage( $actualLanguage ) === $this-getBaseLanguage( $requestedLanguage ) ) { - $classes[] = 'wb-language-fallback-variant'; + $classes .= ' wb-language-fallback-variant'; } - $attributes = array( - 'class' = implode( ' ', $classes ) - ); + $attributes = array( 'class' = $classes ); $html = Html::element( 'sup', $attributes, $text ); return $html; } + /** +* @param string $languageCode +* +* @return string +*/ private function getBaseLanguage( $languageCode ) { return preg_replace( '/-.*/', '', $languageCode
[MediaWiki-commits] [Gerrit] fix for no links in insertimage - change (mediawiki...BlueSpiceExtensions)
Tweichart has uploaded a new change for review. https://gerrit.wikimedia.org/r/187357 Change subject: fix for no links in insertimage .. fix for no links in insertimage Change-Id: Idd9a9cbd490c58d3dbe4f95118699288cbee729c --- M InsertFile/resources/BS.InsertFile/ImageDialog.js 1 file changed, 8 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions refs/changes/57/187357/1 diff --git a/InsertFile/resources/BS.InsertFile/ImageDialog.js b/InsertFile/resources/BS.InsertFile/ImageDialog.js index 50a41d7..f584ae0 100644 --- a/InsertFile/resources/BS.InsertFile/ImageDialog.js +++ b/InsertFile/resources/BS.InsertFile/ImageDialog.js @@ -226,12 +226,9 @@ frame: false, //VisualEditor stuff imagename: this.tfFileName.getValue(), + noLink: this.cbxNoLink.getValue(), src: Ext.htmlDecode(this.hdnUrl.getValue()) //Ext.htmlDecode(): this feels like the wrong place... }); - - if(this.cbxNoLink.getValue() === true ) { - cfg.link = ''; - } var format = this.rgFormat.getValue(); format = format['img-type']; @@ -339,12 +336,14 @@ if( obj.link !== '' obj.link !== false obj.link !== 'false' ) { this.cbPages.setValue( obj.link ); } - - if( obj.link === '' ) { - this.cbxNoLink.setValue(true); - } else { - this.cbxNoLink.setValue(false); + if (obj.nolink === true){ + this.cbPages.disable( ); } + else{ + this.cbPages.enable( ); + } + + this.cbxNoLink.setValue(obj.nolink); this.hdnUrl.setValue( obj.src ); this.isSetData = false; -- To view, visit https://gerrit.wikimedia.org/r/187357 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd9a9cbd490c58d3dbe4f95118699288cbee729c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions Gerrit-Branch: master Gerrit-Owner: Tweichart weich...@hallowelt.biz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement ChangeTagsListActive hook - change (mediawiki...MobileFrontend)
Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/187354 Change subject: Implement ChangeTagsListActive hook .. Implement ChangeTagsListActive hook This allows users to visit Special:Tags or use the API to see which change tags are still in active use. The ChangeTagsListActive hook was introduced to core in I77f476c8d0f32c80f720aa2c5e66869c81faa282 Change-Id: I6ebf93291c5af594901ce6a244579c46aa973302 --- M MobileFrontend.php M includes/MobileFrontend.hooks.php 2 files changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/54/187354/1 diff --git a/MobileFrontend.php b/MobileFrontend.php index 2a3c0f4..0ac215a 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -133,6 +133,7 @@ $wgHooks['ResourceLoaderGetConfigVars'][] = 'MobileFrontendHooks::onResourceLoaderGetConfigVars'; $wgHooks['SpecialPage_initList'][] = 'MobileFrontendHooks::onSpecialPage_initList'; $wgHooks['ListDefinedTags'][] = 'MobileFrontendHooks::onListDefinedTags'; +$wgHooks['ChangeTagsListActive'][] = 'MobileFrontendHooks::onListDefinedTags'; $wgHooks['RecentChange_save'][] = 'MobileFrontendHooks::onRecentChange_save'; $wgHooks['AbuseFilter-generateUserVars'][] = 'MobileFrontendHooks::onAbuseFilterGenerateUserVars'; $wgHooks['AbuseFilter-builder'][] = 'MobileFrontendHooks::onAbuseFilterBuilder'; diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 55517c7..ca1a0b6 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -407,10 +407,11 @@ } /** -* ListDefinedTags hook handler +* ListDefinedTags and ChangeTagsListActive hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/ListDefinedTags -* @param array $tags +* @see https://www.mediawiki.org/wiki/Manual:Hooks/ChangeTagsListActive * +* @param array $tags * @return bool */ public static function onListDefinedTags( $tags ) { @@ -422,8 +423,8 @@ /** * RecentChange_save hook handler that tags mobile changes * @see https://www.mediawiki.org/wiki/Manual:Hooks/RecentChange_save -* @param RecentChange $rc * +* @param RecentChange $rc * @return bool */ public static function onRecentChange_save( RecentChange $rc ) { -- To view, visit https://gerrit.wikimedia.org/r/187354 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ebf93291c5af594901ce6a244579c46aa973302 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: 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] Introduce content language concept for SpecialNewEntity - change (mediawiki...Wikibase)
Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/187355 Change subject: Introduce content language concept for SpecialNewEntity .. Introduce content language concept for SpecialNewEntity Bug: T86929 Change-Id: Icfd92988f56a00955b1f26132799d572b9e39d4e --- M repo/includes/specials/SpecialNewEntity.php 1 file changed, 24 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/55/187355/1 diff --git a/repo/includes/specials/SpecialNewEntity.php b/repo/includes/specials/SpecialNewEntity.php index 9575dce..df8406d 100644 --- a/repo/includes/specials/SpecialNewEntity.php +++ b/repo/includes/specials/SpecialNewEntity.php @@ -41,6 +41,11 @@ protected $description = null; /** +* @var Language +*/ + private $contentLanguage = null; + + /** * @var SummaryFormatter */ protected $summaryFormatter; @@ -92,6 +97,8 @@ $out = $this-getOutput(); + $uiLanguageCode = $this-getLanguage()-getCode(); + if ( $this-getRequest()-wasPosted() $this-getUser()-matchEditToken( $this-getRequest()-getVal( 'token' ) ) ) { @@ -102,7 +109,7 @@ if ( $status-isGood() ) { $summary = new Summary( 'wbeditentity', 'create' ); - $summary-setLanguage( $this-getLanguage()-getCode() ); + $summary-setLanguage( $uiLanguageCode ); $summary-addAutoSummaryArgs( $this-label, $this-description ); $status = $this-saveEntity( @@ -148,6 +155,7 @@ protected function prepareArguments() { $this-label = $this-getRequest()-getVal( 'label', isset( $this-parts[0] ) ? $this-parts[0] : '' ); $this-description = $this-getRequest()-getVal( 'description', isset( $this-parts[1] ) ? $this-parts[1] : '' ); + $this-contentLanguage = Language::factory( $this-getRequest()-getVal( 'lang', $this-getLanguage()-getCode() ) ); return true; } @@ -182,12 +190,12 @@ * @return Status */ protected function modifyEntity( Entity $entity ) { - $lang = $this-getLanguage()-getCode(); + $contentLanguageCode = $this-contentLanguage-getCode(); if ( $this-label !== '' ) { - $entity-setLabel( $lang, $this-label ); + $entity-setLabel( $contentLanguageCode, $this-label ); } if ( $this-description !== '' ) { - $entity-setDescription( $lang, $this-description ); + $entity-setDescription( $contentLanguageCode, $this-description ); } return \Status::newGood(); } @@ -201,7 +209,12 @@ */ protected function additionalFormElements() { global $wgLang; - return Html::element( + return + Html::hidden( + 'lang', + $this-contentLanguage-getCode() + ) + . Html::element( 'label', array( 'for' = 'wb-newentity-label', @@ -217,11 +230,11 @@ 'id' = 'wb-newentity-label', 'size' = 12, 'class' = 'wb-input', - 'lang' = $wgLang-getCode(), - 'dir' = $wgLang-getDir(), + 'lang' = $this-contentLanguage-getCode(), + 'dir' = $this-contentLanguage-getDir(), 'placeholder' = $this-msg( 'wikibase-label-edit-placeholder-language-aware', - Language::fetchLanguageName( $wgLang-getCode() ) + Language::fetchLanguageName( $this-contentLanguage-getCode() ) )-text(), ) ) @@ -242,11 +255,11 @@ 'id' = 'wb-newentity-description', 'size' = 36, 'class' = 'wb-input', - 'lang' = $wgLang-getCode(), - 'dir' = $wgLang-getDir(), + 'lang' = $this-contentLanguage-getCode(), + 'dir' = $this-contentLanguage-getDir(), 'placeholder' = $this-msg(
[MediaWiki-commits] [Gerrit] Init nullable with null instead of false - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Init nullable with null instead of false .. Init nullable with null instead of false Change-Id: I0600d9180288837b37126e5dda09590262fb2462 --- M lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, but someone else must approve Jeroen De Dauw: Looks good to me, approved diff --git a/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js b/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js index 7a08711..c85c521 100644 --- a/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js +++ b/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js @@ -165,7 +165,7 @@ var dataTypeId = fetchedProperty ? fetchedProperty.getContent().getDataTypeId() : false; - var dataType = false; + var dataType = null; if( dataTypeId ) { dataType = self._dataTypeStore.getDataType( dataTypeId ); @@ -173,8 +173,7 @@ // If the new value's type is not the data value type used by the Snak's // property data type, something is very wrong. Display warning! - var isComparable = newValue dataType; - if( isComparable newValue.getType() !== dataType.getDataValueType() ) { + if( newValue dataType newValue.getType() !== dataType.getDataValueType() ) { handleDataValueTypeMismatch( newValue.getType(), dataType.getDataValueType() -- To view, visit https://gerrit.wikimedia.org/r/180149 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0600d9180288837b37126e5dda09590262fb2462 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.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] Add 'license-name' matching SPDX conventions - change (mediawiki...Score)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/187362 Change subject: Add 'license-name' matching SPDX conventions .. Add 'license-name' matching SPDX conventions References: http://spdx.org/licenses/ https://www.mediawiki.org/wiki/Manual:$wgExtensionCredits#license-name Change-Id: I7c21969a23931ba52f7780b3c8b47970e48daaa6 --- M Score.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score refs/changes/62/187362/1 diff --git a/Score.php b/Score.php index 278c9ca..830f351 100644 --- a/Score.php +++ b/Score.php @@ -83,7 +83,8 @@ 'version' = '0.3.0', 'author' = 'Alexander Klauer', 'url' = 'https://www.mediawiki.org/wiki/Extension:Score', - 'descriptionmsg' = 'score-desc' + 'descriptionmsg' = 'score-desc', + 'license-name' = 'GPL-3.0+' ); /* -- To view, visit https://gerrit.wikimedia.org/r/187362 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c21969a23931ba52f7780b3c8b47970e48daaa6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Score Gerrit-Branch: master Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make dumpJson::logMessage public, needed by callback - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Make dumpJson::logMessage public, needed by callback .. Make dumpJson::logMessage public, needed by callback probably is only a php 5.3 thing, but we still support it and is still used in some places in production. Bug: T87823 Change-Id: Ie69776854ae71b86c2de666b2f12a7b832ba32d4 --- M repo/maintenance/dumpJson.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/maintenance/dumpJson.php b/repo/maintenance/dumpJson.php index 75e90a2..c9fbb2e 100644 --- a/repo/maintenance/dumpJson.php +++ b/repo/maintenance/dumpJson.php @@ -100,7 +100,7 @@ * * @param string $message */ - private function logMessage( $message ) { + public function logMessage( $message ) { if ( $this-logFileHandle ) { fwrite( $this-logFileHandle, $message\n ); fflush( $this-logFileHandle ); -- To view, visit https://gerrit.wikimedia.org/r/187284 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie69776854ae71b86c2de666b2f12a7b832ba32d4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude aude.w...@gmail.com Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.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] Slighty more readable fallback indicator generation - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Slighty more readable fallback indicator generation .. Slighty more readable fallback indicator generation Change-Id: Iadacb82de8836caccd242f0326866c16a5af9253 --- M lib/includes/formatters/EntityIdHtmlLinkFormatter.php 1 file changed, 22 insertions(+), 14 deletions(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, approved jenkins-bot: Verified Objections: JanZerebecki: There's a problem with this change, please improve diff --git a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php index 864afe6..6fe97fc 100644 --- a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php +++ b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php @@ -129,31 +129,39 @@ $actualLanguage = $term-getActualLanguageCode(); $sourceLanguage = $term-getSourceLanguageCode(); + // FIXME: TermFallback should either return equal values or null $actualLanguage = ( $actualLanguage === null ? $requestedLanguage : $actualLanguage ); $sourceLanguage = ( $sourceLanguage === null ? $actualLanguage : $sourceLanguage ); - if ( $actualLanguage === $requestedLanguage $sourceLanguage === $requestedLanguage ) { - // no fallback + $isInRequestedLanguage = $actualLanguage === $requestedLanguage; + $isInSourceLanguage = $actualLanguage === $sourceLanguage; + + if ( $isInRequestedLanguage $isInSourceLanguage ) { + // This is neither a fallback nor a transliteration return ''; } - $name = $this-getLanguageName( $sourceLanguage, $term-getLanguageCode() ); + $sourceLanguageName = $this-getLanguageName( $sourceLanguage, $requestedLanguage ); + $requestedLanguageName = $this-getLanguageName( $actualLanguage, $requestedLanguage ); - $classes = array( 'wb-language-fallback-indicator' ); - - if ( $actualLanguage !== $sourceLanguage ) { - $classes[] = 'wb-language-fallback-transliteration'; - + // Generate indicator text + if ( $isInSourceLanguage ) { + $text = $sourceLanguageName; + } else { $msg = wfMessage( 'wikibase-language-fallback-transliteration-hint', - $name, - $this-getLanguageName( $actualLanguage, $term-getLanguageCode() ) + $sourceLanguageName, + $requestedLanguageName ); - - $name = $msg-text(); + $text = $msg-text(); } - if ( $actualLanguage !== $requestedLanguage + // Generate HTML class names + $classes = array( 'wb-language-fallback-indicator' ); + if ( !$isInSourceLanguage ) { + $classes[] = 'wb-language-fallback-transliteration'; + } + if ( !$isInRequestedLanguage $this-getBaseLanguage( $actualLanguage ) === $this-getBaseLanguage( $requestedLanguage ) ) { $classes[] = 'wb-language-fallback-variant'; @@ -163,7 +171,7 @@ 'class' = implode( ' ', $classes ) ); - $html = Html::element( 'sup', $attributes, $name ); + $html = Html::element( 'sup', $attributes, $text ); return $html; } -- To view, visit https://gerrit.wikimedia.org/r/186166 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iadacb82de8836caccd242f0326866c16a5af9253 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.de Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.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] Fix method signatures in all maintenance scripts - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Fix method signatures in all maintenance scripts .. Fix method signatures in all maintenance scripts This patch focuses on cleaning up method signatures. Sometimes this means adding missing or fixing incomplete PHPDoc tags. Sometimes this means refining the signature, more precisely: * adding missing type hints, * removing a return from a method that isn't supposed to do so, * removing = null if a parameter isn't allowed to be null. This is split from I0b2be11 to make it easier to review. Change-Id: Ic96148297f8ad1910e394cedd8b24119fd1eace9 --- M repo/maintenance/dumpJson.php M repo/maintenance/importInterlang.php M repo/maintenance/importProperties.php M repo/maintenance/populateChangesSubscription.php M repo/maintenance/pruneChanges.php M repo/maintenance/rebuildEntityPerPage.php M repo/maintenance/rebuildItemsPerSite.php M repo/maintenance/rebuildPropertyInfo.php M repo/maintenance/rebuildTermsSearchKey.php 9 files changed, 67 insertions(+), 37 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/maintenance/dumpJson.php b/repo/maintenance/dumpJson.php index 75e90a2..9a158f1 100644 --- a/repo/maintenance/dumpJson.php +++ b/repo/maintenance/dumpJson.php @@ -19,6 +19,7 @@ use Wikibase\Repo\IO\EntityIdReader; use Wikibase\Repo\IO\LineReader; use Wikibase\Repo\Store\EntityIdPager; +use Wikibase\Repo\Store\EntityPerPage; use Wikibase\Repo\Store\SQL\EntityPerPageIdPager; use Wikibase\Repo\WikibaseRepo; @@ -52,7 +53,7 @@ private $entityPerPage; /** -* @var bool|resource +* @var resource|bool */ private $logFileHandle = false; @@ -112,9 +113,9 @@ /** * Opens the given file for use by logMessage(). * -* @param $file +* @param string $file * -* @throws \MWException +* @throws MWException */ private function openLogFile( $file ) { $this-closeLogFile(); @@ -127,7 +128,7 @@ $this-logFileHandle = fopen( $file, 'a' ); if ( !$this-logFileHandle ) { - throw new \MWException( 'Failed to open log file: ' . $file ); + throw new MWException( 'Failed to open log file: ' . $file ); } } @@ -170,7 +171,7 @@ $output = fopen( $outFile, 'w' ); //TODO: Allow injection of an OutputStream if ( !$output ) { - throw new \MWException( 'Failed to open ' . $outFile . '!' ); + throw new MWException( 'Failed to open ' . $outFile . '!' ); } if ( $this-hasOption( 'list-file' ) ) { @@ -213,12 +214,12 @@ } /** -* @param null|string $entityType +* @param string|null $entityType * @param ExceptionHandler $exceptionReporter * * @return EntityIdPager a stream of EntityId objects */ - private function makeIdStream( $entityType = null, ExceptionHandler $exceptionReporter = null ) { + private function makeIdStream( $entityType, ExceptionHandler $exceptionReporter ) { $listFile = $this-getOption( 'list-file' ); if ( $listFile !== null ) { @@ -231,7 +232,7 @@ } /** -* @param $entityType +* @param string|null $entityType * * @return EntityIdPager */ @@ -241,17 +242,17 @@ } /** -* @param $listFile +* @param string $listFile * @param ExceptionHandler $exceptionReporter * * @throws MWException * @return EntityIdPager */ - private function makeIdFileStream( $listFile, ExceptionHandler $exceptionReporter = null ) { + private function makeIdFileStream( $listFile, ExceptionHandler $exceptionReporter ) { $input = fopen( $listFile, 'r' ); if ( !$input ) { - throw new \MWException( Failed to open ID file: $input ); + throw new MWException( Failed to open ID file: $input ); } $stream = new EntityIdReader( new LineReader( $input ), new BasicEntityIdParser() ); diff --git a/repo/maintenance/importInterlang.php b/repo/maintenance/importInterlang.php index 5dcff04..b9ee573 100644 --- a/repo/maintenance/importInterlang.php +++ b/repo/maintenance/importInterlang.php @@ -24,20 +24,35 @@ class importInterlang extends Maintenance { + /** +* @var bool +*/ private $verbose = false; + + /** +* @var bool +*/ private $ignore_errors = false; + + /** +* @var int +*/ private $skip = 0; + + /** +* @var int +
[MediaWiki-commits] [Gerrit] Added snakview.value() QUnit tests - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Added snakview.value() QUnit tests .. Added snakview.value() QUnit tests As there is no use in returning datavalue: null in the Value variation, the datavalue field is not returned at all anymore in order to achieve consistency of setting and getting the snakview's value. Change-Id: I63fa416beaad65a5d71ad739e8c18fc274788166 --- M lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js M lib/tests/qunit/jquery.wikibase/snakview/resources.php M lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js 3 files changed, 61 insertions(+), 10 deletions(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js b/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js index e88f116..a4a6c72 100644 --- a/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js +++ b/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js @@ -70,10 +70,7 @@ dataValue = this._valueView.value(); } - return { - // null if no value yet or if value with no suitable valueview for - datavalue: dataValue - }; + return !dataValue ? {} : { datavalue: dataValue }; }, /** diff --git a/lib/tests/qunit/jquery.wikibase/snakview/resources.php b/lib/tests/qunit/jquery.wikibase/snakview/resources.php index 5d5a314..d3cf6d0 100644 --- a/lib/tests/qunit/jquery.wikibase/snakview/resources.php +++ b/lib/tests/qunit/jquery.wikibase/snakview/resources.php @@ -22,10 +22,14 @@ 'snakview.tests.js', ), 'dependencies' = array( + 'dataTypes.DataTypeStore', 'jquery.wikibase.snakview', 'mediawiki.Title', 'wikibase.datamodel.Fingerprint', 'wikibase.datamodel.Property', + 'wikibase.datamodel.PropertyNoValueSnak', + 'wikibase.datamodel.PropertySomeValueSnak', + 'wikibase.datamodel.PropertyValueSnak', 'wikibase.datamodel.Term', 'wikibase.datamodel.TermMap', 'wikibase.serialization.SnakSerializer', diff --git a/lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js b/lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js index e0443e2..b8b83c4 100644 --- a/lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js +++ b/lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js @@ -2,7 +2,7 @@ * @licence GNU GPL v2+ * @author H. Snater mediaw...@snater.com */ -( function( $, QUnit, wb, mw ) { +( function( $, QUnit, wb, dt, mw ) { 'use strict'; QUnit.module( 'jquery.wikibase.snakview', QUnit.newMwEnvironment( { @@ -35,6 +35,8 @@ } }; +var snakSerializer = new wb.serialization.SnakSerializer(); + /** * @param {Object} [options={}] * @param {jQuery} [$node] @@ -44,7 +46,7 @@ options = $.extend( { entityStore: entityStore, valueViewBuilder: 'I am a ValueViewBuilder', - dataTypeStore: 'I am a DataTypeStore' + dataTypeStore: new dt.DataTypeStore() }, options || {} ); $node = $node || $( 'div/' ).appendTo( 'body' ); @@ -88,9 +90,7 @@ ); $snakview = createSnakview( { - value: ( new wb.serialization.SnakSerializer() ).serialize( - new wb.datamodel.PropertyNoValueSnak( 'P1' ) - ) + value: snakSerializer.serialize( new wb.datamodel.PropertyNoValueSnak( 'P1' ) ) } ); snakview = $snakview.data( 'snakview' ); @@ -107,4 +107,54 @@ ); } ); -}( jQuery, QUnit, wikibase, mediaWiki ) ); +QUnit.test( 'value()', function( assert ) { + var $snakview = createSnakview(), + snakview = $snakview.data( 'snakview' ); + + assert.deepEqual( + snakview.value(), + { + property: null, + snaktype: wb.datamodel.PropertyValueSnak.TYPE + }, + 'Verified default value.' + ); + + var newValue = { + property: 'P1', + snaktype: wb.datamodel.PropertySomeValueSnak.TYPE + }; + + snakview.value( newValue ); + + assert.deepEqual( + snakview.value(), + newValue, + 'Set Snak serialization value.' + ); + + newValue = new
[MediaWiki-commits] [Gerrit] Added basic snakview QUnit tests - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Added basic snakview QUnit tests .. Added basic snakview QUnit tests Change-Id: Ib1a9c7e350aba2d9ca025352ef1e65ad11fa0539 --- M lib/tests/qunit/jquery.wikibase/resources.php A lib/tests/qunit/jquery.wikibase/snakview/resources.php A lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js 3 files changed, 150 insertions(+), 0 deletions(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/tests/qunit/jquery.wikibase/resources.php b/lib/tests/qunit/jquery.wikibase/resources.php index 001db94..5492573 100644 --- a/lib/tests/qunit/jquery.wikibase/resources.php +++ b/lib/tests/qunit/jquery.wikibase/resources.php @@ -308,6 +308,7 @@ return array_merge( $modules, + include( __DIR__ . '/snakview/resources.php' ), include( __DIR__ . '/toolbar/resources.php' ) ); diff --git a/lib/tests/qunit/jquery.wikibase/snakview/resources.php b/lib/tests/qunit/jquery.wikibase/snakview/resources.php new file mode 100644 index 000..5d5a314 --- /dev/null +++ b/lib/tests/qunit/jquery.wikibase/snakview/resources.php @@ -0,0 +1,39 @@ +?php +/** + * @licence GNU GPL v2+ + * @author H. Snater mediaw...@snater.com + * + * @codeCoverageIgnoreStart + */ +return call_user_func( function() { + + $remoteExtPathParts = explode( + DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR, __DIR__, 2 + ); + $moduleTemplate = array( + 'localBasePath' = __DIR__, + 'remoteExtPath' = $remoteExtPathParts[1], + ); + + $resources = array( + + 'jquery.wikibase.snakview.tests' = $moduleTemplate + array( + 'scripts' = array( + 'snakview.tests.js', + ), + 'dependencies' = array( + 'jquery.wikibase.snakview', + 'mediawiki.Title', + 'wikibase.datamodel.Fingerprint', + 'wikibase.datamodel.Property', + 'wikibase.datamodel.Term', + 'wikibase.datamodel.TermMap', + 'wikibase.serialization.SnakSerializer', + 'wikibase.store.FetchedContent', + ), + ), + + ); + + return $resources; +} ); diff --git a/lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js b/lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js new file mode 100644 index 000..e0443e2 --- /dev/null +++ b/lib/tests/qunit/jquery.wikibase/snakview/snakview.tests.js @@ -0,0 +1,110 @@ +/** + * @licence GNU GPL v2+ + * @author H. Snater mediaw...@snater.com + */ +( function( $, QUnit, wb, mw ) { +'use strict'; + +QUnit.module( 'jquery.wikibase.snakview', QUnit.newMwEnvironment( { + teardown: function() { + $( '.test_snakview' ).each( function() { + var $snakview = $( this ), + snakview = $snakview.data( 'snakview' ); + + if( snakview ) { + snakview.destroy(); + } + + $snakview.remove(); + } ); + } +} ) ); + +var entityStore = { + get: function() { + return $.Deferred().resolve( new wb.store.FetchedContent( { + title: new mw.Title( 'Property:P1' ), + content: new wb.datamodel.Property( + 'P1', + 'string', + new wb.datamodel.Fingerprint( new wb.datamodel.TermMap( [ + new wb.datamodel.Term( 'en', 'P1' ) + ] ) ) + ) + } ) ); + } +}; + +/** + * @param {Object} [options={}] + * @param {jQuery} [$node] + * @return {jQuery} + */ +var createSnakview = function( options, $node ) { + options = $.extend( { + entityStore: entityStore, + valueViewBuilder: 'I am a ValueViewBuilder', + dataTypeStore: 'I am a DataTypeStore' + }, options || {} ); + + $node = $node || $( 'div/' ).appendTo( 'body' ); + + return $node + .addClass( 'test_snakview' ) + .snakview( options ); +}; + +QUnit.test( 'Create destroy', function( assert ) { + var $snakview = createSnakview(), + snakview = $snakview.data( 'snakview' ); + + assert.ok( + snakview instanceof $.wikibase.snakview, + 'Created widget.' + ); + + snakview.destroy(); + + assert.ok( + $snakview.data( 'snakview' ) ===
[MediaWiki-commits] [Gerrit] Add COPYING file - change (mediawiki...Josa)
devunt has uploaded a new change for review. https://gerrit.wikimedia.org/r/187361 Change subject: Add COPYING file .. Add COPYING file Change-Id: I2c35ebc3d75ed9747b7c6738296c1bb44842f3b3 --- A COPYING 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Josa refs/changes/61/187361/1 diff --git a/COPYING b/COPYING new file mode 100644 index 000..0722734 --- /dev/null +++ b/COPYING @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015 dev...@gmail.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. -- To view, visit https://gerrit.wikimedia.org/r/187361 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c35ebc3d75ed9747b7c6738296c1bb44842f3b3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Josa Gerrit-Branch: master Gerrit-Owner: devunt dev...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused message reference - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused message reference .. Remove unused message reference claimlistview used to use buildMissingEntityInfo which used to reference wikibase-entity-* messages. Both is not true anymore. Change-Id: Ia7ca369059b43cf13bc5844f9c3911e1c550a216 --- M lib/resources/jquery.wikibase/resources.php 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/lib/resources/jquery.wikibase/resources.php b/lib/resources/jquery.wikibase/resources.php index 5af19f5..4f08305 100644 --- a/lib/resources/jquery.wikibase/resources.php +++ b/lib/resources/jquery.wikibase/resources.php @@ -104,9 +104,6 @@ 'wikibase.datamodel.StatementList', 'wikibase.utilities.ClaimGuidGenerator', ), - 'messages' = array( - 'wikibase-entity-property', - ), ), 'jquery.wikibase.descriptionview' = $moduleTemplate + array( -- To view, visit https://gerrit.wikimedia.org/r/187359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia7ca369059b43cf13bc5844f9c3911e1c550a216 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.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] Drop dead code from snakview.variations.Value - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/187363 Change subject: Drop dead code from snakview.variations.Value .. Drop dead code from snakview.variations.Value See I0600d91. I decided to drop the explicit null checks in favor of simple comparisons (they are much more common in JS than they are in PHP) because the data type is either a string or not. There is no difference between it being null or false. Change-Id: Id438672a407154f3018bd0bfdc1ea8af6dec57c1 --- M lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/63/187363/1 diff --git a/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js b/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js index a876097..fb2053b 100644 --- a/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js +++ b/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js @@ -183,10 +183,9 @@ // can't check whether current valueview is most suitable for empty value if // no indication for what kind of value (specified by the data type) is // available -( dataType || newValue !== null ) +( dataType || newValue ) ) { // display current Snak's data value in existing valueview: - self._valueView.option( 'on', dataType ); self._valueView.value( newValue ); } else { // remove old view, create a new one or display message if unsupported data -- To view, visit https://gerrit.wikimedia.org/r/187363 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id438672a407154f3018bd0bfdc1ea8af6dec57c1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add 'license-name' matching SPDX conventions - change (mediawiki...TitleBlacklist)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/187385 Change subject: Add 'license-name' matching SPDX conventions .. Add 'license-name' matching SPDX conventions References: http://spdx.org/licenses/ https://www.mediawiki.org/wiki/Manual:$wgExtensionCredits#license-name Change-Id: Ic19d23be1b816ae5be307f224ab6c05512b2f3bf --- M TitleBlacklist.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TitleBlacklist refs/changes/85/187385/1 diff --git a/TitleBlacklist.php b/TitleBlacklist.php index c524d80..f517c33 100644 --- a/TitleBlacklist.php +++ b/TitleBlacklist.php @@ -16,6 +16,7 @@ 'version'= '1.5.0', 'url'= 'https://www.mediawiki.org/wiki/Extension:Title_Blacklist', 'descriptionmsg' = 'titleblacklist-desc', + 'license-name' = 'GPL-2.0+', ); $dir = __DIR__; -- To view, visit https://gerrit.wikimedia.org/r/187385 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic19d23be1b816ae5be307f224ab6c05512b2f3bf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TitleBlacklist Gerrit-Branch: master Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace $.merge with Array::concat - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Replace $.merge with Array::concat .. Replace $.merge with Array::concat Change-Id: Ie824fb2d8a3db00551ebd058268f42260311e663 --- M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js M repo/resources/wikibase.ui.entityViewInit.js 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js index fb09eb7..acdf36f 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js @@ -398,7 +398,7 @@ var deferred = $.Deferred(); if( self._cache[searchTerm] ) { - $.merge( self._cache[searchTerm].suggestions, suggestions ); + self._cache[searchTerm].suggestions = self._cache[searchTerm].suggestions.concat( suggestions ); self._cache[searchTerm].nextSuggestionOffset = nextSuggestionOffset; } else { self._cache = {}; diff --git a/repo/resources/wikibase.ui.entityViewInit.js b/repo/resources/wikibase.ui.entityViewInit.js index d7aa2bd..edb7ebc 100644 --- a/repo/resources/wikibase.ui.entityViewInit.js +++ b/repo/resources/wikibase.ui.entityViewInit.js @@ -160,12 +160,12 @@ function getUserLanguages() { var userLanguages = mw.config.get( 'wbUserSpecifiedLanguages' ), isUlsDefined = mw.uls $.uls $.uls.data, - languages = []; + languages; if( !userLanguages.length isUlsDefined ) { languages = mw.uls.getFrequentLanguageList().slice( 1, 4 ); } else { - languages = $.merge( [], userLanguages ); + languages = userLanguages.slice(); languages.splice( $.inArray( mw.config.get( 'wgUserLanguage' ), userLanguages ), 1 ); } -- To view, visit https://gerrit.wikimedia.org/r/183238 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie824fb2d8a3db00551ebd058268f42260311e663 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.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] file helper + js links change - change (mediawiki...BlueSpiceFoundation)
Tweichart has uploaded a new change for review. https://gerrit.wikimedia.org/r/187356 Change subject: file helper + js links change .. file helper + js links change * change for filesystemhelper to set the right fields * changed params in wikitext for insertimage Change-Id: Iafcfe91c19308fed2b6d0e95cc914733fea3e7f4 --- M includes/utility/FileSystemHelper.class.php M resources/bluespice/bluespice.wikiText.js 2 files changed, 17 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/56/187356/1 diff --git a/includes/utility/FileSystemHelper.class.php b/includes/utility/FileSystemHelper.class.php index dd1190e..4feb96c 100644 --- a/includes/utility/FileSystemHelper.class.php +++ b/includes/utility/FileSystemHelper.class.php @@ -545,6 +545,8 @@ unlink($sFilename); $oFile = wfFindFile(basename($sFilename)); if ($status-isGood() $oFile !== false){ + $oPage = WikiPage::factory($oFile-getTitle()); + $oPage-doEditContent(new WikitextContent($sPageText), ); if ( BsExtensionManager::isContextActive( 'MW::SecureFileStore::Active' ) ) { return Status::newGood(SecureFileStore::secureStuff($oFile-getUrl(), true)); } diff --git a/resources/bluespice/bluespice.wikiText.js b/resources/bluespice/bluespice.wikiText.js index 7318713..c4f4c88 100644 --- a/resources/bluespice/bluespice.wikiText.js +++ b/resources/bluespice/bluespice.wikiText.js @@ -94,7 +94,7 @@ //'baseline', 'sub', 'super', 'top', 'text-top', 'middle', 'bottom', 'text-bottom' //Vertical alignment (UNSUPPORTED) ]; var wikiLinkProperties = [ - 'alt', 'link' + 'alt', 'link', 'nolink' ]; var additionalProperties = [ @@ -125,7 +125,8 @@ displayText: '', link: false, sizewidth: false, - sizeheight: false + sizeheight: false, + nolink: false }; if ( typeof(cfg) === 'object' ) { @@ -227,7 +228,12 @@ var key = kvpair[0], value = kvpair[1]; if( $.inArray( key, ['link', 'verweis'] ) !== -1 ) { - me.properties.link = value; + if (value === ){ + me.properties.nolink = true; + } + else{ + me.properties.link = value; + } continue; } @@ -260,11 +266,16 @@ if ( $.inArray(property, ['left','right', 'center']) !== -1 ) continue; //Not yet used. Instead 'align' is set. var value = this.properties[property]; + if (property === 'noLink' value === true){ + wikiText.push('link='); + continue; + } //link may be intentionally empty. Therefore we have to //check it _before_ value is empty? if ( property === 'link' ( value !== null value !== 'false' value !== false - typeof value !== undefined ) ) { + typeof value !== undefined value !== + this.properties['nolink'] === false) ) { wikiText.push(property + '=' + value); continue; } -- To view, visit https://gerrit.wikimedia.org/r/187356 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iafcfe91c19308fed2b6d0e95cc914733fea3e7f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Tweichart weich...@hallowelt.biz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement ChangeTagsListActive hook - change (mediawiki...AbuseFilter)
TTO has uploaded a new change for review. https://gerrit.wikimedia.org/r/187360 Change subject: Implement ChangeTagsListActive hook .. Implement ChangeTagsListActive hook This allows users to visit Special:Tags or use the API to see which change tags are still in active use. The ChangeTagsListActive hook was introduced to core in I77f476c8d0f32c80f720aa2c5e66869c81faa282 Change-Id: I456da1d151b576a4b4b62569a7804e3a3dd5e611 --- M AbuseFilter.hooks.php M AbuseFilter.php 2 files changed, 27 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/60/187360/1 diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php index 0e56125..cbceacb 100644 --- a/AbuseFilter.hooks.php +++ b/AbuseFilter.hooks.php @@ -442,25 +442,30 @@ } /** -* @param $emptyTags array +* @param array $tags +* @param bool $enabled * @return bool */ - public static function onListDefinedTags( $emptyTags ) { + private static function fetchAllTags( array $tags, $enabled ) { # This is a pretty awful hack. $dbr = wfGetDB( DB_SLAVE ); + $where = array( 'afa_consequence' = 'tag' ); + if ( $enabled ) { + $where['af_enabled'] = true; + } $res = $dbr-select( array( 'abuse_filter_action', 'abuse_filter' ), 'afa_parameters', - array( 'afa_consequence' = 'tag', 'af_enabled' = true ), + $where, __METHOD__, array(), array( 'abuse_filter' = array( 'INNER JOIN', 'afa_filter=af_id' ) ) ); foreach ( $res as $row ) { - $emptyTags = array_filter( - array_merge( explode( \n, $row-afa_parameters ), $emptyTags ) + $tags = array_filter( + array_merge( explode( \n, $row-afa_parameters ), $tags ) ); } @@ -468,6 +473,22 @@ } /** +* @param array $tags +* @return bool +*/ + public static function onListDefinedTags( array $tags ) { + return self::fetchAllTags( $tags, false ); + } + + /** +* @param array $tags +* @return bool +*/ + public static function onChangeTagsListActive( array $tags ) { + return self::fetchAllTags( $tags, true ); + } + + /** * @param $updater DatabaseUpdater * @throws MWException * @return bool diff --git a/AbuseFilter.php b/AbuseFilter.php index 3b7de9b..46f7fb1 100644 --- a/AbuseFilter.php +++ b/AbuseFilter.php @@ -95,6 +95,7 @@ $wgHooks['ArticleDelete'][] = 'AbuseFilterHooks::onArticleDelete'; $wgHooks['RecentChange_save'][] = 'AbuseFilterHooks::onRecentChangeSave'; $wgHooks['ListDefinedTags'][] = 'AbuseFilterHooks::onListDefinedTags'; +$wgHooks['ChangeTagsListActive'][] = 'AbuseFilterHooks::onChangeTagsListActive'; $wgHooks['LoadExtensionSchemaUpdates'][] = 'AbuseFilterHooks::onLoadExtensionSchemaUpdates'; $wgHooks['ContributionsToolLinks'][] = 'AbuseFilterHooks::onContributionsToolLinks'; $wgHooks['UploadVerifyFile'][] = 'AbuseFilterHooks::onUploadVerifyFile'; -- To view, visit https://gerrit.wikimedia.org/r/187360 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I456da1d151b576a4b4b62569a7804e3a3dd5e611 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter 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] Don't attach event handlers if they don't do anything - change (mediawiki...Wikibase)
Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/187365 Change subject: Don't attach event handlers if they don't do anything .. Don't attach event handlers if they don't do anything Change-Id: Idb8af78a7c75b889dfcfd34ed60ee4559f159f97 --- M repo/resources/wikibase.ui.entityViewInit.js 1 file changed, 38 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/65/187365/1 diff --git a/repo/resources/wikibase.ui.entityViewInit.js b/repo/resources/wikibase.ui.entityViewInit.js index 9e6e70e..088d6e4 100644 --- a/repo/resources/wikibase.ui.entityViewInit.js +++ b/repo/resources/wikibase.ui.entityViewInit.js @@ -21,9 +21,7 @@ entityInitializer.getEntity().done( function( entity ) { createEntityView( entity, $entityview.first() ); - $entityview.on( 'entityviewafterstartediting', function() { - triggerAnonymousEditWarning( entity.getType() ); - } ) + attachAnonymousEditWarningTrigger( $entityview, entity.getType() ); evaluateRestrictions(); @@ -188,22 +186,26 @@ } /** -* @param {boolean} dropValue +* Update the state of the watch link if the user has watchdefault enabled. */ - function updateWatchLink( dropValue ) { + function attachWatchLinkUpdater( $entityview ) { var update = mw.page mw.page.watch ? mw.page.watch.updateWatchLink : null; - if( dropValue || !update || !mw.user.options.get( 'watchdefault' ) ) { + if( !update || !mw.user.options.get( 'watchdefault' ) ) { return; } - // All four supported skins are using the same ID, the other selectors - // in mediawiki.page.watch.ajax.js are undocumented and probably legacy stuff - var $link = $( '#ca-watch a' ); + function updateWatchLink() { + // All four supported skins are using the same ID, the other selectors + // in mediawiki.page.watch.ajax.js are undocumented and probably legacy stuff + var $link = $( '#ca-watch a' ); - // Skip if page is already watched and there is no watch this page link - // Note: The exposed function fails for empty jQuery collections - if( $link.length ) { + // Skip if page is already watched and there is no watch this page link + // Note: The exposed function fails for empty jQuery collections + if( !$link.length ) { + return; + } + update( $link, 'watch', 'loading' ); var api = new mw.Api(), @@ -222,22 +224,36 @@ update( $link, 'watch' ); } ); } + + $entityview.on( 'entityviewafterstopediting', function( event, dropValue ) { + if( !dropValue) ) { + updateWatchLink(); + } + } ) } /** +* @param {jQuery.wikibase.entityview} $entityview * @param {string} entityType */ - function triggerAnonymousEditWarning( entityType ) { - if( - mw.user mw.user.isAnon() -$.find( '.mw-notification-content' ).length === 0 + function attachAnonymousEditWarningTrigger( $entityview, entityType ) { + if( !mw.user || !mw.user.isAnon() ) { + return; + } + + $entityview.on( 'entityviewafterstartediting', function() { + if( + $.find( '.mw-notification-content' ).length === 0 !$.cookie( 'wikibase-no-anonymouseditwarning' ) - ) { - mw.notify( - mw.msg( 'wikibase-anonymouseditwarning', - mw.msg( 'wikibase-entity-' + entityType ) - ) - ); + ) { + mw.notify( + mw.msg( 'wikibase-anonymouseditwarning', + mw.msg( 'wikibase-entity-' + entityType ) + ) + ); + } + } ); + } } -- To view, visit https://gerrit.wikimedia.org/r/187365 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
[MediaWiki-commits] [Gerrit] Add 'license-name' matching SPDX conventions - change (mediawiki...Thanks)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/187366 Change subject: Add 'license-name' matching SPDX conventions .. Add 'license-name' matching SPDX conventions References: http://spdx.org/licenses/ https://www.mediawiki.org/wiki/Manual:$wgExtensionCredits#license-name Change-Id: I64e4f018a45c1b20390c19bf55679f853edb35d5 --- M Thanks.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Thanks refs/changes/66/187366/1 diff --git a/Thanks.php b/Thanks.php index add8fbf..465311b 100644 --- a/Thanks.php +++ b/Thanks.php @@ -35,6 +35,7 @@ 'version' = '1.2.0', 'url' = 'https://www.mediawiki.org/wiki/Extension:Thanks', 'descriptionmsg' = 'thanks-desc', + 'license-name' = 'MIT', ); -- To view, visit https://gerrit.wikimedia.org/r/187366 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64e4f018a45c1b20390c19bf55679f853edb35d5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Thanks Gerrit-Branch: master Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add 'license-name' matching SPDX conventions - change (mediawiki...TemplateSandbox)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/187367 Change subject: Add 'license-name' matching SPDX conventions .. Add 'license-name' matching SPDX conventions References: http://spdx.org/licenses/ https://www.mediawiki.org/wiki/Manual:$wgExtensionCredits#license-name Change-Id: I83b90605d0875e14e8e54d112e58300913af8d5b --- M TemplateSandbox.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateSandbox refs/changes/67/187367/1 diff --git a/TemplateSandbox.php b/TemplateSandbox.php index dfd18c4..84f1812 100644 --- a/TemplateSandbox.php +++ b/TemplateSandbox.php @@ -50,6 +50,7 @@ 'url' = 'https://www.mediawiki.org/wiki/Extension:TemplateSandbox', 'descriptionmsg' = 'templatesandbox-desc', 'version' = '1.1.0', + 'license-name' = 'GPL-2.0+', ); $wgAutoloadClasses['TemplateSandboxHooks'] = __DIR__ . '/TemplateSandbox.hooks.php'; -- To view, visit https://gerrit.wikimedia.org/r/187367 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83b90605d0875e14e8e54d112e58300913af8d5b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TemplateSandbox Gerrit-Branch: master Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Consolidated snaklistview - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Consolidated snaklistview .. Consolidated snaklistview - snaklistview handles SnakLists only (accepts and returns nothing but a SnakList object) - As to other widget, snaklistview consistently uses value option to store initial value which may be retrieved via .option( 'value' ) while the current value may be retrieved using .value() - Moved .value() setter logic to ._setOption() - Using SnakList native equals() to check for initial value. Change-Id: Ib93d77c2d88f0fd5f707ce4e4276335789d4afc8 --- M lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js M lib/resources/jquery.wikibase/jquery.wikibase.snaklistview.js M lib/resources/jquery.wikibase/jquery.wikibase.statementview.js M lib/tests/qunit/jquery.wikibase/jquery.wikibase.referenceview.tests.js M lib/tests/qunit/jquery.wikibase/jquery.wikibase.snaklistview.tests.js 5 files changed, 89 insertions(+), 118 deletions(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js b/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js index 7007d05..7b293e2 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js @@ -130,7 +130,7 @@ listItemWidget: $.wikibase.snaklistview, newItemOptionsFn: function( value ) { return { - value: value || null, + value: value || undefined, singleProperty: true, dataTypeStore: self.option( 'dataTypeStore' ), entityStore: self.option( 'entityStore' ), diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.snaklistview.js b/lib/resources/jquery.wikibase/jquery.wikibase.snaklistview.js index ba5fb20..2bfb07c 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.snaklistview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.snaklistview.js @@ -17,9 +17,8 @@ * @constructor * * @param {Object} options - * @param {wikibase.datamodel.SnakList|null} [value=null] - *The `SnakList` to be displayed by this view. If `null`, the view will start edit mode upon - *initialization. + * @param {wikibase.datamodel.SnakList} [value=new wikibase.datamodel.SnakList()] + *The `SnakList` to be displayed by this view. * @param {boolean} [singleProperty=true] *If `true`, it is assumed that the widget is filled with `Snak`s featuring a single common *property. @@ -75,20 +74,10 @@ value: null, singleProperty: false, helpMessage: mw.msg( 'wikibase-claimview-snak-new-tooltip' ), - dataTypeStore: null, entityStore: null, - valueViewBuilder: null + valueViewBuilder: null, + dataTypeStore: null }, - - /** -* The `SnakList` represented by this widget. This variable is not updated while in edit -* mode and does not contain temporary `Snak`s. To get the temporary `Snak`s, `value()` should -* be used. As soon as the `snaklistview`'s save operation is performed via `stopEditing()` is -* performed, this variable gets updated. -* @property {wikibase.datamodel.SnakList} -* @private -*/ - _snakList: null, /** * Short-cut to the `listview` widget used by the `snaklistview` to manage the `snakview` @@ -115,13 +104,24 @@ /** * @inheritdoc * @protected +* +* @throws {Error} if a required option is not specified properly. */ _create: function() { - this._snakList = this.option( 'value' ); + this.options.value = this.options.value || new wb.datamodel.SnakList(); + + if( + !this.options.entityStore + || !this.options.valueViewBuilder + || !this.options.dataTypeStore + || !( this.options.value instanceof wb.datamodel.SnakList ) + ) { + throw new Error( 'Required option not specified properly' ); + } PARENT.prototype._create.call( this ); - if ( !this.option( 'value' ) ) { + if ( !this.options.value.length ) { this.$listview.addClass( 'wikibase-snaklistview-listview-new' ); } @@ -165,7 +165,7 @@ }; }
[MediaWiki-commits] [Gerrit] Only allow QUnit and sinon in test files - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Only allow QUnit and sinon in test files .. Only allow QUnit and sinon in test files Change-Id: I413b9e8dcf92eccbdbbae4352b27a369db1ffc5e --- M .jshintrc 1 file changed, 25 insertions(+), 12 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved diff --git a/.jshintrc b/.jshintrc index e7e9ce3..0d8273e 100644 --- a/.jshintrc +++ b/.jshintrc @@ -27,16 +27,29 @@ browser: true, // Globals - predef: [ - jQuery, - QUnit, - mediaWiki, - wikibase, - dataValues, - dataTypes, - sinon, - util, - valueFormatters, - valueParsers - ] + globals: { + jQuery: false, + mediaWiki: false, + wikibase: true, + dataValues: false, + dataTypes: false, + util: false, + valueFormatters: false, + valueParsers: false + }, + + overrides: { + */tests/qunit/**/*.tests.js: { + globals: { + sinon: false, + QUnit: false + } + }, + lib/tests/qunit/data/testrunner.js: { + globals: { + QUnit: false + } + } + + } } -- To view, visit https://gerrit.wikimedia.org/r/180143 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I413b9e8dcf92eccbdbbae4352b27a369db1ffc5e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Henning Snater henning.sna...@wikimedia.de Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.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] Remove unused message reference - change (mediawiki...Wikibase)
Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/187359 Change subject: Remove unused message reference .. Remove unused message reference claimlistview used to use buildMissingEntityInfo which used to reference wikibase-entity-* messages. Both is not true anymore. Change-Id: Ia7ca369059b43cf13bc5844f9c3911e1c550a216 --- M lib/resources/jquery.wikibase/resources.php 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/59/187359/1 diff --git a/lib/resources/jquery.wikibase/resources.php b/lib/resources/jquery.wikibase/resources.php index 5af19f5..4f08305 100644 --- a/lib/resources/jquery.wikibase/resources.php +++ b/lib/resources/jquery.wikibase/resources.php @@ -104,9 +104,6 @@ 'wikibase.datamodel.StatementList', 'wikibase.utilities.ClaimGuidGenerator', ), - 'messages' = array( - 'wikibase-entity-property', - ), ), 'jquery.wikibase.descriptionview' = $moduleTemplate + array( -- To view, visit https://gerrit.wikimedia.org/r/187359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7ca369059b43cf13bc5844f9c3911e1c550a216 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang adrian.he...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix wrong variable name in EntityIdHtmlLinkFormatter - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Fix wrong variable name in EntityIdHtmlLinkFormatter .. Fix wrong variable name in EntityIdHtmlLinkFormatter * Wrong variable name was introduced in Iadacb82. * Actual language can't be null. * Inline some really trivial code. * Add docs. Change-Id: I80c57be4181c53c2646657f949f157925d253d03 --- M lib/includes/formatters/EntityIdHtmlLinkFormatter.php 1 file changed, 23 insertions(+), 20 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved diff --git a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php index 6fe97fc..7521180 100644 --- a/lib/includes/formatters/EntityIdHtmlLinkFormatter.php +++ b/lib/includes/formatters/EntityIdHtmlLinkFormatter.php @@ -75,7 +75,6 @@ * @return string HTML */ private function getHtmlForTerm( $targetUrl, Term $term, $titleText = '' ) { - $label = $term-getText(); $fallbackIndicatorHtml = ''; $attributes = array( @@ -92,13 +91,9 @@ } } - $html = Html::element( 'a', $attributes, $label ); + $html = Html::element( 'a', $attributes, $term-getText() ); - if ( $fallbackIndicatorHtml !== '' ) { - $html .= $fallbackIndicatorHtml; - } - - return $html; + return $html . $fallbackIndicatorHtml; } /** @@ -119,6 +114,12 @@ return $entityId-getSerialization() . $separator . $undefinedInfo; } + /** +* @param string $languageCode +* @param string $inLanguage +* +* @return string +*/ private function getLanguageName( $languageCode, $inLanguage ) { //TODO: inject language name lookup! return Utils::fetchLanguageName( $languageCode, $inLanguage ); @@ -130,8 +131,7 @@ $sourceLanguage = $term-getSourceLanguageCode(); // FIXME: TermFallback should either return equal values or null - $actualLanguage = ( $actualLanguage === null ? $requestedLanguage : $actualLanguage ); - $sourceLanguage = ( $sourceLanguage === null ? $actualLanguage : $sourceLanguage ); + $sourceLanguage = $sourceLanguage === null ? $actualLanguage : $sourceLanguage; $isInRequestedLanguage = $actualLanguage === $requestedLanguage; $isInSourceLanguage = $actualLanguage === $sourceLanguage; @@ -142,40 +142,43 @@ } $sourceLanguageName = $this-getLanguageName( $sourceLanguage, $requestedLanguage ); - $requestedLanguageName = $this-getLanguageName( $actualLanguage, $requestedLanguage ); + $actualLanguageName = $this-getLanguageName( $actualLanguage, $requestedLanguage ); // Generate indicator text if ( $isInSourceLanguage ) { $text = $sourceLanguageName; } else { - $msg = wfMessage( + $text = wfMessage( 'wikibase-language-fallback-transliteration-hint', $sourceLanguageName, - $requestedLanguageName - ); - $text = $msg-text(); + $actualLanguageName + )-text(); } // Generate HTML class names - $classes = array( 'wb-language-fallback-indicator' ); + $classes = 'wb-language-fallback-indicator'; if ( !$isInSourceLanguage ) { - $classes[] = 'wb-language-fallback-transliteration'; + $classes .= ' wb-language-fallback-transliteration'; } if ( !$isInRequestedLanguage $this-getBaseLanguage( $actualLanguage ) === $this-getBaseLanguage( $requestedLanguage ) ) { - $classes[] = 'wb-language-fallback-variant'; + $classes .= ' wb-language-fallback-variant'; } - $attributes = array( - 'class' = implode( ' ', $classes ) - ); + $attributes = array( 'class' = $classes ); $html = Html::element( 'sup', $attributes, $text ); return $html; } + /** +* @param string $languageCode +* +* @return string +*/ private function getBaseLanguage( $languageCode ) { return preg_replace( '/-.*/', '', $languageCode ); } + } -- To view, visit https://gerrit.wikimedia.org/r/187353 To
[MediaWiki-commits] [Gerrit] Add COPYING file - change (mediawiki...Josa)
jenkins-bot has submitted this change and it was merged. Change subject: Add COPYING file .. Add COPYING file Change-Id: I2c35ebc3d75ed9747b7c6738296c1bb44842f3b3 --- A COPYING 1 file changed, 21 insertions(+), 0 deletions(-) Approvals: devunt: Looks good to me, approved jenkins-bot: Verified diff --git a/COPYING b/COPYING new file mode 100644 index 000..0722734 --- /dev/null +++ b/COPYING @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015 dev...@gmail.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. -- To view, visit https://gerrit.wikimedia.org/r/187361 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2c35ebc3d75ed9747b7c6738296c1bb44842f3b3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Josa Gerrit-Branch: master Gerrit-Owner: devunt dev...@gmail.com Gerrit-Reviewer: devunt dev...@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] Drop dead code from snakview.variations.Value - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Drop dead code from snakview.variations.Value .. Drop dead code from snakview.variations.Value See I0600d91. I decided to not do explicit null checks in favor of simple comparisons (they are much more common in JS than they are in PHP) because the data type is either a string or not. There is no difference between it being null or false. Change-Id: Id438672a407154f3018bd0bfdc1ea8af6dec57c1 --- M lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Adrian Lang: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js b/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js index a876097..cf7b40b 100644 --- a/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js +++ b/lib/resources/jquery.wikibase/snakview/snakview.variations.Value.js @@ -186,7 +186,6 @@ ( dataType || newValue !== null ) ) { // display current Snak's data value in existing valueview: - self._valueView.option( 'on', dataType ); self._valueView.value( newValue ); } else { // remove old view, create a new one or display message if unsupported data -- To view, visit https://gerrit.wikimedia.org/r/187363 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id438672a407154f3018bd0bfdc1ea8af6dec57c1 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de Gerrit-Reviewer: Adrian Lang adrian.he...@wikimedia.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] Drop constructor is a constructor docs - change (mediawiki...Wikibase)
Thiemo Mättig (WMDE) has uploaded a new change for review. https://gerrit.wikimedia.org/r/187368 Change subject: Drop constructor is a constructor docs .. Drop constructor is a constructor docs Change-Id: I1b4642021099799545a90b2d4a059d2f84339f73 --- M lib/includes/LanguageWithConversion.php M lib/includes/store/sql/TermSqlIndex.php M lib/maintenance/dispatchChanges.php M repo/includes/DataTypeSelector.php M repo/includes/Diff/ClaimDifferenceVisualizer.php M repo/includes/Diff/DiffOpValueFormatter.php M repo/includes/Diff/DiffView.php M repo/includes/Diff/EntityDiffVisualizer.php M repo/includes/ExceptionWithCode.php M repo/includes/ItemDisambiguation.php M repo/includes/content/EntityContentDiff.php M repo/includes/store/sql/TermSearchKeyBuilder.php 12 files changed, 2 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/68/187368/1 diff --git a/lib/includes/LanguageWithConversion.php b/lib/includes/LanguageWithConversion.php index c670894..441c12f 100644 --- a/lib/includes/LanguageWithConversion.php +++ b/lib/includes/LanguageWithConversion.php @@ -25,8 +25,6 @@ protected $translatePool = array(); /** -* Constructor. -* * @param null|Language $language * @param string $languageCode * @param null|Language $sourceLanguage diff --git a/lib/includes/store/sql/TermSqlIndex.php b/lib/includes/store/sql/TermSqlIndex.php index fd6b738..9f797e4 100644 --- a/lib/includes/store/sql/TermSqlIndex.php +++ b/lib/includes/store/sql/TermSqlIndex.php @@ -61,8 +61,6 @@ ); /** -* Constructor. -* * @since0.4 * * @param StringNormalizer $stringNormalizer diff --git a/lib/maintenance/dispatchChanges.php b/lib/maintenance/dispatchChanges.php index 4028a59..3ea57a9 100644 --- a/lib/maintenance/dispatchChanges.php +++ b/lib/maintenance/dispatchChanges.php @@ -105,9 +105,6 @@ */ protected $verbose; - /** -* Constructor. -*/ public function __construct() { parent::__construct(); diff --git a/repo/includes/DataTypeSelector.php b/repo/includes/DataTypeSelector.php index b68ae5c..f0ae7fa 100644 --- a/repo/includes/DataTypeSelector.php +++ b/repo/includes/DataTypeSelector.php @@ -26,8 +26,6 @@ protected $languageCode; /** -* Constructor. -* * @since 0.4 * * @param DataType[] $dataTypes diff --git a/repo/includes/Diff/ClaimDifferenceVisualizer.php b/repo/includes/Diff/ClaimDifferenceVisualizer.php index d794289..8c19771 100644 --- a/repo/includes/Diff/ClaimDifferenceVisualizer.php +++ b/repo/includes/Diff/ClaimDifferenceVisualizer.php @@ -54,8 +54,6 @@ private $languageCode; /** -* Constructor. -* * @since 0.4 * * @param ValueFormatter $propertyIdFormatter Formatter for IDs, must generate HTML. diff --git a/repo/includes/Diff/DiffOpValueFormatter.php b/repo/includes/Diff/DiffOpValueFormatter.php index 3435cdc..f4a5565 100644 --- a/repo/includes/Diff/DiffOpValueFormatter.php +++ b/repo/includes/Diff/DiffOpValueFormatter.php @@ -38,8 +38,6 @@ protected $newValues; /** -* Constructor. -* * @since 0.4 * * @param string $name HTML of name diff --git a/repo/includes/Diff/DiffView.php b/repo/includes/Diff/DiffView.php index 3ae0066..fdf069d 100644 --- a/repo/includes/Diff/DiffView.php +++ b/repo/includes/Diff/DiffView.php @@ -57,8 +57,6 @@ private $entityRevisionLookup; /** -* Constructor. -* * @since 0.1 * * @param string[] $path diff --git a/repo/includes/Diff/EntityDiffVisualizer.php b/repo/includes/Diff/EntityDiffVisualizer.php index c1c9ed9..90e7436 100644 --- a/repo/includes/Diff/EntityDiffVisualizer.php +++ b/repo/includes/Diff/EntityDiffVisualizer.php @@ -59,14 +59,14 @@ private $entityRevisionLookup; /** -* Constructor. -* * @since 0.4 * * @param IContextSource $contextSource * @param ClaimDiffer $claimDiffer * @param ClaimDifferenceVisualizer $claimDiffView * @param SiteStore $siteStore +* @param EntityTitleLookup $entityTitleLookup +* @param EntityRevisionLookup $entityRevisionLookup */ public function __construct( IContextSource $contextSource, ClaimDiffer $claimDiffer, diff --git a/repo/includes/ExceptionWithCode.php b/repo/includes/ExceptionWithCode.php index ebf9687..c6d4f5b 100644 --- a/repo/includes/ExceptionWithCode.php +++ b/repo/includes/ExceptionWithCode.php @@ -18,8 +18,6 @@ private $stringCode; /** -* Constructor. -* * @since 0.4 * * @param string
[MediaWiki-commits] [Gerrit] Split Wikimedia obsolete into types of codes - change (pywikibot/core)
John Vandenberg has uploaded a new change for review. https://gerrit.wikimedia.org/r/187358 Change subject: Split Wikimedia obsolete into types of codes .. Split Wikimedia obsolete into types of codes All family class line lengths 80. Change-Id: Ia71f80294a3f99aaa0bf49872e009d716023459f --- M pywikibot/families/wikibooks_family.py M pywikibot/families/wikimedia_family.py M pywikibot/families/wikinews_family.py M pywikibot/families/wikipedia_family.py M pywikibot/families/wikiquote_family.py M pywikibot/families/wikisource_family.py M pywikibot/families/wikiversity_family.py M pywikibot/families/wikivoyage_family.py M pywikibot/families/wiktionary_family.py M pywikibot/family.py 10 files changed, 324 insertions(+), 181 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/58/187358/1 diff --git a/pywikibot/families/wikibooks_family.py b/pywikibot/families/wikibooks_family.py index baf844c..50fdf6a 100644 --- a/pywikibot/families/wikibooks_family.py +++ b/pywikibot/families/wikibooks_family.py @@ -11,6 +11,97 @@ Family class for Wikibooks. +closed_wikis = [ +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Afar_Wikibooks +'aa', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Akan_Wikibooks +'ak', +# https://als.wikipedia.org/wiki/Wikipedia:Stammtisch/Archiv_2008-1#Afterwards.2C_closure_and_deletion_of_Wiktionary.2C_Wikibooks_and_Wikiquote_sites +'als', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Assamese_Wikibooks +'as', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Asturianu_Wikibooks +'ast', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Aymar_Wikibooks +'ay', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bashkir_Wikibooks +'ba', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bislama_Wikibooks +'bi', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bambara_Wikibooks +'bm', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Tibetan_Wikibooks +'bo', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Chamorro_Wikibooks +'ch', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Corsu_Wikibooks +'co', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gaeilge_Wikibooks +'ga', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gothic_Wikibooks +'got', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Guarani_Wikibooks +'gn', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gujarati_Wikibooks +'gu', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kannada_Wikibooks +'kn', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kashmiri_Wikibooks +'ks', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_L%C3%ABtzebuergesch_Wikibooks +'lb', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Lingala_Wikibooks +'ln', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Latvian_Wikibooks +'lv', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Maori_Wikibooks +'mi', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Mongolian_Wikibooks +'mn', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Burmese_Wikibooks +'my', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nauruan_Wikibooks +'na', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nahuatl_Wikibooks +'nah', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Plattd%C3%BC%C3%BCtsch_Wikibooks +'nds', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Pashto_Wikibooks +'ps', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Quechua_Wikibooks +'qu', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Rumantsch_Wikibooks +'rm', +# https://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Sami_Wikibooks +'se', +#
[MediaWiki-commits] [Gerrit] Consistency tweaks in preparation for adding extension to tr... - change (mediawiki...Josa)
devunt has submitted this change and it was merged. Change subject: Consistency tweaks in preparation for adding extension to translatewiki.net .. Consistency tweaks in preparation for adding extension to translatewiki.net * Move magic file * Add i18n JSON file Change-Id: I6c149d81927cc1cd152be7b53caee1a0a894fe3e --- R Josa.i18n.magic.php M Josa.php A i18n/en.json A i18n/ko.json A i18n/qqq.json 5 files changed, 32 insertions(+), 4 deletions(-) Approvals: devunt: Verified; Looks good to me, approved diff --git a/Josa.i18n.php b/Josa.i18n.magic.php similarity index 100% rename from Josa.i18n.php rename to Josa.i18n.magic.php diff --git a/Josa.php b/Josa.php index 2d4d043..62789c0 100644 --- a/Josa.php +++ b/Josa.php @@ -16,9 +16,13 @@ 'name' = 'Josa', 'author' = 'JuneHyeon Bae (devunt)', 'url' = 'https://www.mediawiki.org/wiki/Extension:Josa', - 'description' = 'Automates some part of Korean transliteration process.', - 'version' = '0.1', + 'descriptionmsg' = 'josa-desc', + 'version' = '0.1.1', ); $wgHooks['ParserFirstCallInit'][] = 'Josa::InitParserFunction'; -$wgExtensionMessagesFiles['Josa'] = dirname( __FILE__ ) . '/Josa.i18n.php'; -$wgAutoloadClasses['Josa'] = dirname( __FILE__ ) . '/Josa.class.php'; + +// Load i18n files +$wgMessagesDirs['Josa'] = __DIR__ . '/i18n'; +$wgExtensionMessagesFiles['JosaMagic'] = __DIR__ . '/Josa.i18n.magic.php'; + +$wgAutoloadClasses['Josa'] = __DIR__ . '/Josa.class.php'; diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 000..b23834b --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,8 @@ +{ + @metadata: { + authors: [ + JuneHyeon Bae + ] + }, + josa-desc: Automates some part of Korean transliteration process +} diff --git a/i18n/ko.json b/i18n/ko.json new file mode 100644 index 000..2cb9d97 --- /dev/null +++ b/i18n/ko.json @@ -0,0 +1,8 @@ +{ + @metadata: { + authors: [ + JuneHyeon Bae + ] + }, + josa-desc: 한국어 조사 처리의 일부 과정을 자동화합니다 +} diff --git a/i18n/qqq.json b/i18n/qqq.json new file mode 100644 index 000..cfe6e13 --- /dev/null +++ b/i18n/qqq.json @@ -0,0 +1,8 @@ +{ + @metadata: { + authors: [ + Raimond Spekking + ] + }, + josa-desc: {{desc|name=Josa|url=https://www.mediawiki.org/wiki/Extension:Josa}}; +} -- To view, visit https://gerrit.wikimedia.org/r/187352 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c149d81927cc1cd152be7b53caee1a0a894fe3e Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Josa Gerrit-Branch: master Gerrit-Owner: Raimond Spekking raimond.spekk...@gmail.com Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: devunt dev...@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] Remove _fetchItems - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Remove _fetchItems .. Remove _fetchItems Change-Id: I69a7a282e2760d931677d3fefa1bc18bb9cba1e3 --- M lib/resources/jquery.wikibase/jquery.wikibase.badgeselector.js 1 file changed, 15 insertions(+), 44 deletions(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, approved Jeroen De Dauw: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.badgeselector.js b/lib/resources/jquery.wikibase/jquery.wikibase.badgeselector.js index 7431b97..7b1d79e 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.badgeselector.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.badgeselector.js @@ -193,10 +193,10 @@ this._addPlaceholderBadge( this.options.value[i] ); } - this._fetchItems( this.options.value ) + this.options.entityStore.getMultiple( this.options.value ) .done( function( items ) { - for( var i = 0; i self.options.value.length; i++ ) { - self._addBadge( items[ self.options.value[i] ] ); + for( var i = 0; i items.length; i++ ) { + self._addBadge( items[ i ].getContent() ); } deferred.resolve(); } ) @@ -271,18 +271,20 @@ */ _fillMenu: function() { var self = this, - deferred = $.Deferred(); + deferred = $.Deferred(), + badgeIds = $.map( this.options.badges, function( cssClasses, itemId ) { + return itemId; + } ); - this._fetchItems( $.map( this.options.badges, function( cssClasses, itemId ) { - return itemId; - } ) ) + this.options.entityStore.getMultiple( badgeIds ) .done( function( badges ) { $menu.empty(); - $.each( self.options.badges, function( itemId, cssClasses ) { - var item = badges[itemId], + $.each( badgeIds, function( index, itemId ) { + var item = badges[index] badges[index].getContent(), term = item item.getFingerprint().getLabelFor( self.options.languageCode ), - label = term term.getText(); + label = term term.getText(), + cssClasses = self.options.badges[ itemId ]; var $item = $( 'a/' ) .on( 'click.' + self.widgetName, function( event ) { @@ -318,37 +320,6 @@ } ); return deferred; - }, - - /** -* Fetches item data for a list of item ids. -* -* @param {string[]} itemIds -* @return {jQuery.Promise} -* No resolved parameters. -* No rejected parameters. -*/ - _fetchItems: function( itemIds ) { - var deferred = $.Deferred(); - - this.options.entityStore.getMultiple( itemIds ) - .done( function( items ) { - var item, - itemsObj = {}; - for( var i = 0; i items.length; ++i ) { - if( items[i] ) { - item = items[i].getContent(); - itemsObj[item.getId()] = item; - } - } - deferred.resolve( itemsObj ); - } ) - .fail( function() { - // TODO: Have entityStore return a proper RepoApiError object. - deferred.reject(); - } ); - - return deferred.promise(); }, /** @@ -479,10 +450,10 @@ // Since the widget might have been initialized on pre-existing DOM, badges need to be // fetched to ensure their data is available for resetting: - this._fetchItems( this.options.value ) + this.options.entityStore.getMultiple( this.options.value ) .done( function( items ) { - for( var i = 0; i self.options.value.length; i++ ) { - self._addBadge( items[ self.options.value[i] ] ); + for( var i = 0; i items.length; i++ ) { + self._addBadge( items[ i ].getContent() );
[MediaWiki-commits] [Gerrit] Move stuff around in entityViewInit - change (mediawiki...Wikibase)
Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/187364 Change subject: Move stuff around in entityViewInit .. Move stuff around in entityViewInit This tries to separate the instantiation of entityviews and toolbarcontrollers from those parts adding functionality around them. Change-Id: I9dc3291195d85d17e2d42d1d014859edaf238db1 --- M repo/resources/wikibase.ui.entityViewInit.js 1 file changed, 46 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/64/187364/1 diff --git a/repo/resources/wikibase.ui.entityViewInit.js b/repo/resources/wikibase.ui.entityViewInit.js index 7621ad8..9e6e70e 100644 --- a/repo/resources/wikibase.ui.entityViewInit.js +++ b/repo/resources/wikibase.ui.entityViewInit.js @@ -8,22 +8,43 @@ 'use strict'; mw.hook( 'wikipage.content' ).add( function() { - var $entityview = $( '.wikibase-entityview' ); - if( mw.config.get( 'wbEntity' ) !== null ) { - initToolbarController( $entityview ); - - var entityInitializer = new wb.EntityInitializer( 'wbEntity' ); - - entityInitializer.getEntity().done( function( entity ) { - createEntityDom( entity, $entityview.first() ); - evaluateRestrictions(); - - // Remove loading spinner after JavaScript has kicked in: - $entityview.removeClass( 'loading' ); - $( '.wb-entity-spinner' ).remove(); - } ); + if( mw.config.get( 'wbEntity' ) === null ) { + return; } + + var $entityview = $( '.wikibase-entityview' ); + var entityInitializer = new wb.EntityInitializer( 'wbEntity' ); + + initToolbarController( $entityview ); + + entityInitializer.getEntity().done( function( entity ) { + createEntityView( entity, $entityview.first() ); + + $entityview.on( 'entityviewafterstartediting', function() { + triggerAnonymousEditWarning( entity.getType() ); + } ) + + evaluateRestrictions(); + + // Remove loading spinner after JavaScript has kicked in: + $entityview.removeClass( 'loading' ); + $( '.wb-entity-spinner' ).remove(); + } ); + + attachWatchLinkUpdater( $entityview ); + + $entityview.on( 'labelviewchange labelviewafterstopediting', function( event ) { + var $labelview = $( event.target ), + labelview = $labelview.data( 'labelview' ), + label = labelview.value().getText(); + + $( 'title' ).text( + mw.msg( 'pagetitle', label !== '' ? label : mw.config.get( 'wgTitle' ) ) + ); + } ); + + attachCopyrightTooltip( $entityview ); } ); /** @@ -58,9 +79,14 @@ } }; - $entityview - .toolbarcontroller( toolbarControllerConfig ) - .on( 'edittoolbarafterstartediting', function( event ) { + $entityview.toolbarcontroller( toolbarControllerConfig ); + } + + /** +* @param {jQuery} $entityview +*/ + function attachCopyrightTooltip( $entityview ) { + $entityview.on( 'edittoolbarafterstartediting', function( event ) { var $target = $( event.target ), gravity = 'sw'; @@ -73,7 +99,7 @@ gravity = 'nw'; } - showCopyrightTooltip( $entityview, $( event.target ), gravity ); + showCopyrightTooltip( $entityview, $target, gravity ); } ); } @@ -107,7 +133,7 @@ * * @throws {Error} if no widget to render the entity exists. */ - function createEntityDom( entity, $entityview ) { + function createEntityView( entity, $entityview ) { var repoConfig = mw.config.get( 'wbRepo' ); var mwApi = wb.api.getLocationAgnosticMwApi( repoConfig.url + repoConfig.scriptPath + '/api.php' ); var repoApi = new wb.api.RepoApi( mwApi ), @@ -125,7 +151,7 @@ throw new Error( 'View for entity type ' + entity.getType() + ' does not exist' ); } - $entityview[entity.getType() + 'view']( { + $entityview[ view ]( { value: entity,
[MediaWiki-commits] [Gerrit] ReplacementArray: Set explicit visiblity on functions - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: ReplacementArray: Set explicit visiblity on functions .. ReplacementArray: Set explicit visiblity on functions Also add a type-hint Change-Id: I78a322dfa11a71e22a3d0b7064b808aec6bfbf83 --- M includes/libs/ReplacementArray.php 1 file changed, 11 insertions(+), 11 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/ReplacementArray.php b/includes/libs/ReplacementArray.php index 8c8c010..7fdb309 100644 --- a/includes/libs/ReplacementArray.php +++ b/includes/libs/ReplacementArray.php @@ -31,18 +31,18 @@ * The array should have the same form as the replacement array for strtr() * @param array $data */ - function __construct( $data = array() ) { + public function __construct( $data = array() ) { $this-data = $data; } /** * @return array */ - function __sleep() { + public function __sleep() { return array( 'data' ); } - function __wakeup() { + public function __wakeup() { $this-fss = false; } @@ -50,7 +50,7 @@ * Set the whole replacement array at once * @param array $data */ - function setArray( $data ) { + public function setArray( $data ) { $this-data = $data; $this-fss = false; } @@ -58,7 +58,7 @@ /** * @return array|bool */ - function getArray() { + public function getArray() { return $this-data; } @@ -67,7 +67,7 @@ * @param string $from * @param string $to */ - function setPair( $from, $to ) { + public function setPair( $from, $to ) { $this-data[$from] = $to; $this-fss = false; } @@ -75,7 +75,7 @@ /** * @param array $data */ - function mergeArray( $data ) { + public function mergeArray( $data ) { $this-data = array_merge( $this-data, $data ); $this-fss = false; } @@ -83,7 +83,7 @@ /** * @param ReplacementArray $other */ - function merge( $other ) { + public function merge( ReplacementArray $other ) { $this-data = array_merge( $this-data, $other-data ); $this-fss = false; } @@ -91,7 +91,7 @@ /** * @param string $from */ - function removePair( $from ) { + public function removePair( $from ) { unset( $this-data[$from] ); $this-fss = false; } @@ -99,7 +99,7 @@ /** * @param array $data */ - function removeArray( $data ) { + public function removeArray( $data ) { foreach ( $data as $from = $to ) { $this-removePair( $from ); } @@ -110,7 +110,7 @@ * @param string $subject * @return string */ - function replace( $subject ) { + public function replace( $subject ) { if ( function_exists( 'fss_prep_replace' ) ) { if ( $this-fss === false ) { $this-fss = fss_prep_replace( $this-data ); -- To view, visit https://gerrit.wikimedia.org/r/187405 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I78a322dfa11a71e22a3d0b7064b808aec6bfbf83 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Addshore addshorew...@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] Move ReplacementArray into includes/libs/ - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Move ReplacementArray into includes/libs/ .. Move ReplacementArray into includes/libs/ Change-Id: I95b748c77522027753fb5bd0237f25e254938c16 --- M autoload.php A includes/libs/ReplacementArray.php M includes/utils/StringUtils.php 3 files changed, 126 insertions(+), 107 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index dc9ef19..e6f0f89 100644 --- a/autoload.php +++ b/autoload.php @@ -957,7 +957,7 @@ 'RemoveUnusedAccounts' = __DIR__ . '/maintenance/removeUnusedAccounts.php', 'RenameDbPrefix' = __DIR__ . '/maintenance/renameDbPrefix.php', 'RenderAction' = __DIR__ . '/includes/actions/RenderAction.php', - 'ReplacementArray' = __DIR__ . '/includes/utils/StringUtils.php', + 'ReplacementArray' = __DIR__ . '/includes/libs/ReplacementArray.php', 'Replacer' = __DIR__ . '/includes/libs/replacers/Replacer.php', 'RepoGroup' = __DIR__ . '/includes/filerepo/RepoGroup.php', 'RequestContext' = __DIR__ . '/includes/context/RequestContext.php', diff --git a/includes/libs/ReplacementArray.php b/includes/libs/ReplacementArray.php new file mode 100644 index 000..8c8c010 --- /dev/null +++ b/includes/libs/ReplacementArray.php @@ -0,0 +1,125 @@ +?php +/** + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +/** + * Replacement array for FSS with fallback to strtr() + * Supports lazy initialisation of FSS resource + */ +class ReplacementArray { + private $data = false; + private $fss = false; + + /** +* Create an object with the specified replacement array +* The array should have the same form as the replacement array for strtr() +* @param array $data +*/ + function __construct( $data = array() ) { + $this-data = $data; + } + + /** +* @return array +*/ + function __sleep() { + return array( 'data' ); + } + + function __wakeup() { + $this-fss = false; + } + + /** +* Set the whole replacement array at once +* @param array $data +*/ + function setArray( $data ) { + $this-data = $data; + $this-fss = false; + } + + /** +* @return array|bool +*/ + function getArray() { + return $this-data; + } + + /** +* Set an element of the replacement array +* @param string $from +* @param string $to +*/ + function setPair( $from, $to ) { + $this-data[$from] = $to; + $this-fss = false; + } + + /** +* @param array $data +*/ + function mergeArray( $data ) { + $this-data = array_merge( $this-data, $data ); + $this-fss = false; + } + + /** +* @param ReplacementArray $other +*/ + function merge( $other ) { + $this-data = array_merge( $this-data, $other-data ); + $this-fss = false; + } + + /** +* @param string $from +*/ + function removePair( $from ) { + unset( $this-data[$from] ); + $this-fss = false; + } + + /** +* @param array $data +*/ + function removeArray( $data ) { + foreach ( $data as $from = $to ) { + $this-removePair( $from ); + } + $this-fss = false; + } + + /** +* @param string $subject +* @return string +*/ + function replace( $subject ) { + if ( function_exists( 'fss_prep_replace' ) ) { + if ( $this-fss === false ) { + $this-fss = fss_prep_replace( $this-data ); + } + $result = fss_exec_replace( $this-fss, $subject ); + } else { + $result = strtr( $subject, $this-data ); + } + + return $result; +
[MediaWiki-commits] [Gerrit] ExplodeIterator: Set explicit visiblity on functions - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: ExplodeIterator: Set explicit visiblity on functions .. ExplodeIterator: Set explicit visiblity on functions Change-Id: I407280a432098d13ad75ff2d3468aa6a7d653da7 --- M includes/libs/ExplodeIterator.php 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/ExplodeIterator.php b/includes/libs/ExplodeIterator.php index 64e33a4..3b34d9b 100644 --- a/includes/libs/ExplodeIterator.php +++ b/includes/libs/ExplodeIterator.php @@ -48,7 +48,7 @@ * @param string $delim * @param string $subject */ - function __construct( $delim, $subject ) { + public function __construct( $delim, $subject ) { $this-subject = $subject; $this-delim = $delim; @@ -59,13 +59,13 @@ $this-rewind(); } - function rewind() { + public function rewind() { $this-curPos = 0; $this-endPos = strpos( $this-subject, $this-delim ); $this-refreshCurrent(); } - function refreshCurrent() { + public function refreshCurrent() { if ( $this-curPos === false ) { $this-current = false; } elseif ( $this-curPos = $this-subjectLength ) { @@ -77,21 +77,21 @@ } } - function current() { + public function current() { return $this-current; } /** * @return int|bool Current position or boolean false if invalid */ - function key() { + public function key() { return $this-curPos; } /** * @return string */ - function next() { + public function next() { if ( $this-endPos === false ) { $this-curPos = false; } else { @@ -110,7 +110,7 @@ /** * @return bool */ - function valid() { + public function valid() { return $this-curPos !== false; } } -- To view, visit https://gerrit.wikimedia.org/r/187403 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I407280a432098d13ad75ff2d3468aa6a7d653da7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Addshore addshorew...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added Special page to set label, description and aliases at ... - change (mediawiki...Wikibase)
Henning Snater has uploaded a new change for review. https://gerrit.wikimedia.org/r/187423 Change subject: Added Special page to set label, description and aliases at once .. Added Special page to set label, description and aliases at once Change-Id: I9c23eca9f7303c3be04e3ac2c07f45779f1a0746 --- M repo/Wikibase.i18n.alias.php M repo/Wikibase.php M repo/i18n/en.json M repo/i18n/qqq.json M repo/includes/View/EntityTermsView.php M repo/includes/specials/SpecialModifyEntity.php A repo/includes/specials/SpecialSetLabelDescriptionAliases.php A repo/tests/phpunit/includes/specials/SpecialSetLabelDescritionAliasesTest.php 8 files changed, 520 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/23/187423/1 diff --git a/repo/Wikibase.i18n.alias.php b/repo/Wikibase.i18n.alias.php index ba42ce4..f73679f 100644 --- a/repo/Wikibase.i18n.alias.php +++ b/repo/Wikibase.i18n.alias.php @@ -25,6 +25,7 @@ 'SetLabel' = array( 'SetLabel' ), 'SetDescription' = array( 'SetDescription' ), 'SetAliases' = array( 'SetAliases' ), + 'SetLabelDescriptionAliases' = array( 'SetLabelDescriptionAliases' ), 'SetSiteLink' = array( 'SetSiteLink' ), 'MergeItems' = array( 'MergeItems', 'MergeItem' ), 'EntitiesWithoutLabel' = array( 'EntitiesWithoutLabel' ), diff --git a/repo/Wikibase.php b/repo/Wikibase.php index 7010a28..3b3052f 100644 --- a/repo/Wikibase.php +++ b/repo/Wikibase.php @@ -150,6 +150,7 @@ $wgSpecialPages['SetLabel'] = 'Wikibase\Repo\Specials\SpecialSetLabel'; $wgSpecialPages['SetDescription'] = 'Wikibase\Repo\Specials\SpecialSetDescription'; $wgSpecialPages['SetAliases'] = 'Wikibase\Repo\Specials\SpecialSetAliases'; + $wgSpecialPages['SetLabelDescriptionAliases'] = 'Wikibase\Repo\Specials\SpecialSetLabelDescriptionAliases'; $wgSpecialPages['SetSiteLink'] = 'Wikibase\Repo\Specials\SpecialSetSiteLink'; $wgSpecialPages['EntitiesWithoutLabel'] = array( 'Wikibase\Repo\Specials\SpecialEntitiesWithoutPageFactory', 'newSpecialEntitiesWithoutLabel' ); $wgSpecialPages['EntitiesWithoutDescription'] = array( 'Wikibase\Repo\Specials\SpecialEntitiesWithoutPageFactory', 'newSpecialEntitiesWithoutDescription' ); diff --git a/repo/i18n/en.json b/repo/i18n/en.json index a5fe18f..04ccc62 100644 --- a/repo/i18n/en.json +++ b/repo/i18n/en.json @@ -184,6 +184,13 @@ wikibase-setaliases-label: Aliases:, wikibase-setaliases-submit: Set aliases, wikibase-setaliases-warning-remove: Do you really want to remove all aliases of [[$1]]?, + special-setlabeldescriptionaliases: Set label, description and aliases, + wikibase-setlabeldescriptionaliases-introfull: You are setting label, description and aliases in $2 for [[$1]]., + wikibase-setlabeldescriptionaliases-intro: This form allows you to set label, description and aliases of an entity. You need to provide the id of the entity (e.g. Q23), a language code (e.g. \en\) as well as label, description and aliases to set to. Several aliases are separated by a pipe (code|/code) character., + wikibase-setlabeldescriptionaliases-label-label: Label:, + wikibase-setlabeldescriptionaliases-description-label: Description:, + wikibase-setlabeldescriptionaliases-aliases-label: Aliases:, + wikibase-setlabeldescriptionaliases-submit: Set label, description and aliases, special-setsitelink: Set a site link, wikibase-setsitelink-introfull: You are setting the site link of $2 for [[$1]]., wikibase-setsitelink-intro: This form allows you to set the site link of an item. You need to provide the id of the item (e.g. Q23), a site id (e.g. \enwiki\) and the site link to set to., diff --git a/repo/i18n/qqq.json b/repo/i18n/qqq.json index 930f9f5..6434671 100644 --- a/repo/i18n/qqq.json +++ b/repo/i18n/qqq.json @@ -210,6 +210,13 @@ wikibase-setaliases-label: Label for the input field to type the aliases to set the entity to.\n{{Identical|Alias}}, wikibase-setaliases-submit: Label for the button that activates the action., wikibase-setaliases-warning-remove: A warning message to ask the user if he wants to remove all aliases.\n\nParameters:\n* $1 - the id that links to the entity, + special-setlabel: {{doc-special|SetLabelAliasesDescription}}\nThe special page allows the user to set an entity's label, description and aliases in a particular language., + wikibase-setlabel-introfull: Intro text when label, description and aliases are to be set. Parameters:\n* $1 - the ID that links to the entity\n* $2 - the translated language name
[MediaWiki-commits] [Gerrit] Set context when parsing message in SpecialLog::addHeader - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Set context when parsing message in SpecialLog::addHeader .. Set context when parsing message in SpecialLog::addHeader Also direct passing a message object to OutputPage::setPageTitle Change-Id: If88ca673bffa033f9cd9cc7a680b73aa701578f3 --- M includes/specials/SpecialLog.php 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index 923283e..9315eb8 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -237,8 +237,9 @@ */ protected function addHeader( $type ) { $page = new LogPage( $type ); - $this-getOutput()-setPageTitle( $page-getName()-text() ); - $this-getOutput()-addHTML( $page-getDescription()-parseAsBlock() ); + $this-getOutput()-setPageTitle( $page-getName() ); + $this-getOutput()-addHTML( $page-getDescription() + -setContext( $this-getContext() )-parseAsBlock() ); } protected function getGroupName() { -- To view, visit https://gerrit.wikimedia.org/r/187387 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If88ca673bffa033f9cd9cc7a680b73aa701578f3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender umherirrender_de...@web.de Gerrit-Reviewer: Legoktm legoktm.wikipe...@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] View in browser link limited to the text - change (mediawiki...MultimediaViewer)
jenkins-bot has submitted this change and it was merged. Change subject: View in browser link limited to the text .. View in browser link limited to the text Only the image and the text(View in browser) is now clickable. Bug: T87427 Change-Id: I6650cf5a7b7cf2b8200087c7687495cdeaf0a3e1 --- M resources/mmv/ui/mmv.ui.download.pane.less 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Gilles: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/mmv/ui/mmv.ui.download.pane.less b/resources/mmv/ui/mmv.ui.download.pane.less index 43e9631..01ae5d9 100644 --- a/resources/mmv/ui/mmv.ui.download.pane.less +++ b/resources/mmv/ui/mmv.ui.download.pane.less @@ -57,7 +57,7 @@ } .mw-mmv-download-preview-link { - display: block; + display: inline-block; margin-top: 12px; margin-left: -6px; font-size: 16px; -- To view, visit https://gerrit.wikimedia.org/r/187371 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6650cf5a7b7cf2b8200087c7687495cdeaf0a3e1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: master Gerrit-Owner: Namit namit.o...@gmail.com Gerrit-Reviewer: Gilles gdu...@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] Set context when parsing message 'redirectpagesub' in Article - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Set context when parsing message 'redirectpagesub' in Article .. Set context when parsing message 'redirectpagesub' in Article Change-Id: I53fc0855fc8dd57cdfcae68751c9800969208310 --- M includes/page/Article.php 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/page/Article.php b/includes/page/Article.php index 0fc251e..089576d 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -687,9 +687,8 @@ $this-mParserOutput = $poolArticleView-getParserOutput(); $outputPage-addParserOutput( $this-mParserOutput ); if ( $content-getRedirectTarget() ) { - $outputPage-addSubtitle( - span id=\redirectsub\ . wfMessage( 'redirectpagesub' )-parse() . /span - ); + $outputPage-addSubtitle( span id=\redirectsub\ . + $this-getContext()-msg( 'redirectpagesub' )-parse() . /span ); } # Don't cache a dirty ParserOutput object @@ -1458,7 +1457,7 @@ $lang = $this-getTitle()-getPageLanguage(); $out = $this-getContext()-getOutput(); if ( $appendSubtitle ) { - $out-addSubtitle( wfMessage( 'redirectpagesub' )-parse() ); + $out-addSubtitle( wfMessage( 'redirectpagesub' ) ); } $out-addModuleStyles( 'mediawiki.action.view.redirectPage' ); return static::getRedirectHeaderHtml( $lang, $target, $forceKnown ); -- To view, visit https://gerrit.wikimedia.org/r/187398 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53fc0855fc8dd57cdfcae68751c9800969208310 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender umherirrender_de...@web.de Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use context when parsing messages in Article::setOldSubtitle - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Use context when parsing messages in Article::setOldSubtitle .. Use context when parsing messages in Article::setOldSubtitle Change-Id: Iec4985021b862d6e99f5531545b7db287325263b --- M includes/page/Article.php 1 file changed, 20 insertions(+), 19 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/page/Article.php b/includes/page/Article.php index 0fc251e..734fe70 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1326,7 +1326,8 @@ return; } - $unhide = $this-getContext()-getRequest()-getInt( 'unhide' ) == 1; + $context = $this-getContext(); + $unhide = $context-getRequest()-getInt( 'unhide' ) == 1; # Cascade unhide param in links for easy deletion browsing $extraParams = array(); @@ -1343,8 +1344,8 @@ $timestamp = $revision-getTimestamp(); $current = ( $oldid == $this-mPage-getLatest() ); - $language = $this-getContext()-getLanguage(); - $user = $this-getContext()-getUser(); + $language = $context-getLanguage(); + $user = $context-getUser(); $td = $language-userTimeAndDate( $timestamp, $user ); $tddate = $language-userDate( $timestamp, $user ); @@ -1353,13 +1354,13 @@ # Show user links if allowed to see them. If hidden, then show them only if requested... $userlinks = Linker::revUserTools( $revision, !$unhide ); - $infomsg = $current !wfMessage( 'revision-info-current' )-isDisabled() + $infomsg = $current !$context-msg( 'revision-info-current' )-isDisabled() ? 'revision-info-current' : 'revision-info'; - $outputPage = $this-getContext()-getOutput(); + $outputPage = $context-getOutput(); $outputPage-addSubtitle( div id=\mw-{$infomsg}\ . - wfMessage( $infomsg, $td ) + $context-msg( $infomsg, $td ) -rawParams( $userlinks ) -params( $revision-getID(), $tddate, $tdtime, $revision-getUserText() ) -rawParams( Linker::revComment( $revision, true, true ) ) @@ -1368,18 +1369,18 @@ ); $lnk = $current - ? wfMessage( 'currentrevisionlink' )-escaped() + ? $context-msg( 'currentrevisionlink' )-escaped() : Linker::linkKnown( $this-getTitle(), - wfMessage( 'currentrevisionlink' )-escaped(), + $context-msg( 'currentrevisionlink' )-escaped(), array(), $extraParams ); $curdiff = $current - ? wfMessage( 'diff' )-escaped() + ? $context-msg( 'diff' )-escaped() : Linker::linkKnown( $this-getTitle(), - wfMessage( 'diff' )-escaped(), + $context-msg( 'diff' )-escaped(), array(), array( 'diff' = 'cur', @@ -1390,30 +1391,30 @@ $prevlink = $prev ? Linker::linkKnown( $this-getTitle(), - wfMessage( 'previousrevision' )-escaped(), + $context-msg( 'previousrevision' )-escaped(), array(), array( 'direction' = 'prev', 'oldid' = $oldid ) + $extraParams ) - : wfMessage( 'previousrevision' )-escaped(); + : $context-msg( 'previousrevision' )-escaped(); $prevdiff = $prev ? Linker::linkKnown( $this-getTitle(), - wfMessage( 'diff' )-escaped(), + $context-msg( 'diff' )-escaped(), array(), array( 'diff' = 'prev', 'oldid' = $oldid ) + $extraParams ) - : wfMessage( 'diff' )-escaped(); + :
[MediaWiki-commits] [Gerrit] Revert Enable Extension:Graph on cawiki - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Revert Enable Extension:Graph on cawiki .. Revert Enable Extension:Graph on cawiki This reverts commit 0bb7fc172e0cea6002342bec7d44c6b875f7c137. Change-Id: Ib1b5fdfc97e2786d995f34a327e15a9a01e17b15 --- M wmf-config/InitialiseSettings.php 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4e9c1f5..b5b2ff1 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -12320,7 +12320,6 @@ 'wmgUseGraph' = array( 'default' = false, - 'cawiki' = true, 'collabwiki' = true, 'labswiki' = true, 'mediawikiwiki' = true, -- To view, visit https://gerrit.wikimedia.org/r/187421 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1b5fdfc97e2786d995f34a327e15a9a01e17b15 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@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] Alpha login form tweaks - change (mediawiki...MobileFrontend)
jenkins-bot has submitted this change and it was merged. Change subject: Alpha login form tweaks .. Alpha login form tweaks Make it more closely aligned with the stable/beta experience In particular: * mark remember me for mobile devices * make warning boxes yellow * make the padding of the links below the form consistent Also: Bug: T87257 Change-Id: Ia8204fe1324283cdd830b3df74a2090ce9b01315 --- M includes/MobileFrontend.hooks.php M includes/Resources.php A javascripts/specials/userlogin.js M less/specials/userlogin.less 4 files changed, 42 insertions(+), 7 deletions(-) Approvals: Bmansurov: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 55517c7..49f226c 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -510,6 +510,7 @@ $out-addModuleStyles( 'skins.minerva.special.search.styles' ); } elseif ( $name === 'Userlogin' ) { $out-addModuleStyles( 'skins.minerva.special.userlogin.styles' ); + $out-addModules( 'mobile.special.userlogin.scripts' ); // make sure we're on https if we're supposed to be and currently aren't. // most of this is lifted from https redirect code in SpecialUserlogin::execute() // also, checking for 'https' in $wgServer is a little funky, but this is what diff --git a/includes/Resources.php b/includes/Resources.php index 683db00..aa1ef61 100644 --- a/includes/Resources.php +++ b/includes/Resources.php @@ -1460,6 +1460,16 @@ ), ), + 'mobile.special.userlogin.scripts' = $wgMFResourceFileModuleBoilerplate + array( + 'dependencies' = array( + 'mobile.head', + ), + 'scripts' = array( + 'javascripts/specials/userlogin.js', + ), + 'position' = 'top', + ), + 'mobile.special.nearby.scripts' = $wgMFResourceFileModuleBoilerplate + array( 'dependencies' = array( 'mobile.nearby', diff --git a/javascripts/specials/userlogin.js b/javascripts/specials/userlogin.js new file mode 100644 index 000..319f5be --- /dev/null +++ b/javascripts/specials/userlogin.js @@ -0,0 +1,11 @@ +( function ( M, $ ) { + var browser = M.require( 'browser' ); + + if ( !browser.isWideScreen() ) { + // Most people on mobile devices are on a personal device so this property should be assumed. + $( function () { + $( '#wpRemember' ).prop( 'checked', true ); + } ); + } + +} )( mw.mobileFrontend, jQuery ); diff --git a/less/specials/userlogin.less b/less/specials/userlogin.less index aa522e3..c1ad286 100644 --- a/less/specials/userlogin.less +++ b/less/specials/userlogin.less @@ -68,16 +68,34 @@ #mw-mf-login .headmsg, // Styles for new login form. .alpha .warningbox { + padding: 0.5em 1em; + margin: 1em 0; +} + +#mw-mf-accountcreate .headmsg, +#mw-mf-login .headmsg { background-color: @colorGray14; border: 1px solid @colorGray12; color: @grayDark; - padding: 0.5em 1em; - margin: 1em 0; } .alpha { .mw-ui-vform { margin: auto; + } + + .mw-form-related-link-container { + a { + padding-bottom: 12px; + display: block; + } + } +} + +.alpha { + // reason for account creation is not so important on mobile - it should be obvious through the workflows + .mw-createacct-benefits-container { + display: none; } } @@ -87,11 +105,6 @@ @margin: 12px; .alpha { - // reason for account creation is not so important on mobile - it should be obvious through the workflows - .mw-createacct-benefits-container { - display: none; - } - #userloginForm { // tips are not useful .prefsectiontip, -- To view, visit https://gerrit.wikimedia.org/r/185565 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8204fe1324283cdd830b3df74a2090ce9b01315 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson jrob...@wikimedia.org Gerrit-Reviewer: Bmansurov bmansu...@wikimedia.org Gerrit-Reviewer: Florianschmidtwelzow florian.schmidt.wel...@t-online.de Gerrit-Reviewer: Jdlrobson jrob...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing
[MediaWiki-commits] [Gerrit] Update version before MLEB release - change (mediawiki...Translate)
jenkins-bot has submitted this change and it was merged. Change subject: Update version before MLEB release .. Update version before MLEB release Change-Id: I1e3ba2e6f47db14cd2cc95b3ee2d16f25c4819d6 --- M Translate.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/Translate.php b/Translate.php index 931acad..537cc01 100644 --- a/Translate.php +++ b/Translate.php @@ -17,7 +17,7 @@ /** * Version number used in extension credits and in other places where needed. */ -define( 'TRANSLATE_VERSION', '2014-12-29' ); +define( 'TRANSLATE_VERSION', '2015-01-29' ); /** * Extension credits properties. -- To view, visit https://gerrit.wikimedia.org/r/187427 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e3ba2e6f47db14cd2cc95b3ee2d16f25c4819d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: KartikMistry kartik.mis...@gmail.com Gerrit-Reviewer: Nikerabbit niklas.laxst...@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] Kill upstart-nfs-noidmapd.conf, unused - change (operations/puppet)
Faidon Liambotis has submitted this change and it was merged. Change subject: Kill upstart-nfs-noidmapd.conf, unused .. Kill upstart-nfs-noidmapd.conf, unused This was only applied with role::labsnfs, only in pmtpa. Change-Id: If1d917c3d6f693a3b391000365a68369b86e52fe --- D files/nfs/upstart-nfs-noidmap.conf 1 file changed, 0 insertions(+), 15 deletions(-) Approvals: Faidon Liambotis: Verified; Looks good to me, approved diff --git a/files/nfs/upstart-nfs-noidmap.conf b/files/nfs/upstart-nfs-noidmap.conf deleted file mode 100644 index 91dc558..000 --- a/files/nfs/upstart-nfs-noidmap.conf +++ /dev/null @@ -1,15 +0,0 @@ -# nfs-noidmap - disable idmap for cross-project NFS -# -# This task disables the kernel's automatic idmap for NFSv4 to allow -# conflicting group names across projects. -# -# Made into an upstart task because that setting is annoyingly not -# made available through sysctl. - -description disable idmap for cross-project NFS - -start on starting autofs - -task - -exec echo 1 /sys/module/nfs/parameters/nfs4_disable_idmapping -- To view, visit https://gerrit.wikimedia.org/r/187428 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1d917c3d6f693a3b391000365a68369b86e52fe Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon Liambotis fai...@wikimedia.org Gerrit-Reviewer: Faidon Liambotis fai...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Decom webstatscollector step 1 - change (operations/puppet)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/187432 Change subject: Decom webstatscollector step 1 .. Decom webstatscollector step 1 Step two will remove the remaining puppetization once the services are stopped and packages removed. Bug: T87868 Change-Id: I25ff1880cb9ff4d5f643bf1c0588ec1d6125cdda --- M manifests/role/analytics/kafkatee.pp M manifests/role/logging.pp M manifests/role/statistics.pp M templates/udp2log/filters.oxygen.erb 4 files changed, 31 insertions(+), 161 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/32/187432/1 diff --git a/manifests/role/analytics/kafkatee.pp b/manifests/role/analytics/kafkatee.pp index 005d5eb..0db257e 100644 --- a/manifests/role/analytics/kafkatee.pp +++ b/manifests/role/analytics/kafkatee.pp @@ -161,130 +161,6 @@ - -# == role::analytics::kafkatee::webstatscollector -# We want to run webstatscollector via kafkatee for testing. -# Some of the production (role::logging::webstatscollector) -# configs are not relevant here, so we copy the class -# and edit it. -# -# webstatscollector needs the mobile and text webrequest logs, -# so this class makes sure that these topics are consumed by kafkaee -# by including their kafkatee::input::* roles. -# -class role::analytics::kafkatee::webrequest::webstatscollector { -include role::analytics::kafkatee::input::webrequest::mobile -include role::analytics::kafkatee::input::webrequest::text - -# webstatscollector package creates this directory. -# webstats-collector process writes dump files here. -$webstats_dumps_directory = '/srv/log/webstats/dumps' -# collector creates temporary Berkeley DB files that have -# very high write IO. Upstart will chdir into -# this temp directory before starting collector. -$webstats_temp_directory = '/run/webstats' - -$collector_host = $::fqdn -$collector_port = 3815 - -file { $webstats_temp_directory: -ensure = 'directory', -owner = 'nobody', -group = 'nogroup', -} -# Mount the temp directory as a tmpfs in /run -mount { $webstats_temp_directory: -ensure = 'mounted', -device = 'tmpfs', -fstype = 'tmpfs', -options = 'uid=nobody,gid=nogroup,mode=0755,noatime,defaults,size=2000m', -pass= 0, -dump= 0, -require = File[$webstats_temp_directory], -} - -# Create the dumps/ directory in which -# we want collector to output hourly dump files. -file { $webstats_dumps_directory: -ensure = 'directory', -owner = 'nobody', -group = 'nogroup', -require = Mount[$webstats_temp_directory], -} -# collector writes dumps to $cwd/dumps. We are going -# run collector in $webstats_temp_directory, but we want dumps to be -# on the normal filesystem. Symlink $webstats_temp_directory/dumps -# to the dumps directory. -file { ${webstats_temp_directory}/dumps: -ensure = 'link', -target = $webstats_dumps_directory, -require = File[$webstats_dumps_directory], -} - -package { 'webstatscollector': -ensure = 'installed', -} -# Install a custom webstats-collector init script to use -# custom temp directory. -file { '/etc/init/webstats-collector.conf': -content = template('webstatscollector/webstats-collector.init.erb'), -owner = 'root', -group = 'root', -mode= '0444', -require = Package['webstatscollector'], -} - -service { 'webstats-collector': -# 2014-10-30 turning of webstatscollector here while we -# troubleshoot some kafkatee missing lines. - otto -ensure = 'stopped', -hasstatus = 'false', -hasrestart = 'true', -require= Package['webstatscollector'], -} - -ferm::service { 'webstats-collector': -proto = 'tcp', -port = $collector_port, -srange = '$ALL_NETWORKS', -} - -# Gzip pagecounts files hourly. -cron { 'webstats-dumps-gzip': -# 2014-10-30 turning of webstatscollector here while we -# troubleshoot some kafkatee missing lines. - otto -ensure = 'absent', -command = /bin/gzip ${webstats_dumps_directory}/pagecounts--?? 2 /dev/null, -minute = 2, -user= 'nobody', -require = Service['webstats-collector'], -} - -# Delete webstats dumps that are older than 10 days daily. -cron { 'webstats-dumps-delete': -# 2014-10-30 turning of webstatscollector here while we -# troubleshoot some kafkatee missing lines. - otto -ensure = 'absent', -command = /usr/bin/find ${webstats_dumps_directory} -maxdepth 1 -type f -mtime +10 -delete, -minute = 28, -hour= 1, -user= 'nobody', -