[MediaWiki-commits] [Gerrit] Update mw.Api so it uses new token handling - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/223572 Change subject: Update mw.Api so it uses new token handling .. Update mw.Api so it uses new token handling Also, update ResourceLoaderUserTokensModule so it provides csrfToken instead of old editToken. Bug: T72059 Change-Id: I265913dcb28a09b2ba803a226ee03b96fc543ab9 --- M includes/resourceloader/ResourceLoaderUserTokensModule.php M resources/src/mediawiki.api/mediawiki.api.js M tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js 3 files changed, 27 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/223572/1 diff --git a/includes/resourceloader/ResourceLoaderUserTokensModule.php b/includes/resourceloader/ResourceLoaderUserTokensModule.php index ccd1dfd..3a0c7ee 100644 --- a/includes/resourceloader/ResourceLoaderUserTokensModule.php +++ b/includes/resourceloader/ResourceLoaderUserTokensModule.php @@ -44,7 +44,7 @@ $user = $context-getUserObj(); return array( - 'editToken' = $user-getEditToken(), + 'csrfToken' = $user-getEditToken(), 'patrolToken' = $user-getEditToken( 'patrol' ), 'watchToken' = $user-getEditToken( 'watch' ), ); diff --git a/resources/src/mediawiki.api/mediawiki.api.js b/resources/src/mediawiki.api/mediawiki.api.js index 0b57907..21cb583 100644 --- a/resources/src/mediawiki.api/mediawiki.api.js +++ b/resources/src/mediawiki.api/mediawiki.api.js @@ -271,11 +271,29 @@ */ getToken: function ( type, assert ) { var apiPromise, + oldTokens = [ 'block', 'delete', 'edit', 'email', 'import', 'move', 'options', + 'protect', 'unblock' ], promiseGroup = promises[ this.defaults.ajax.url ], d = promiseGroup promiseGroup[ type + 'Token' ]; if ( !d ) { - apiPromise = this.get( { action: 'tokens', type: type, assert: assert } ); + if ( $.inArray( type, oldTokens ) ) { + // Old-school token retrieval + apiPromise = this.get( { + action: 'tokens', + type: type, + assert: assert + } ); + mw.log.warn( Use of + type + Token is deprecated since 1.24. + + Use new token types instead. ); + } else { + apiPromise = this.get( { + action: 'query', + meta: 'tokens', + type: type, + assert: assert + } ); + } d = apiPromise .then( function ( data ) { diff --git a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js b/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js index 4f199bd..ba8d546 100644 --- a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js +++ b/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js @@ -78,10 +78,10 @@ var api = new mw.Api(); - // Get editToken for local wiki, this should not make + // Get csrfToken for local wiki, this should not make // a request as it should be retrieved from user.tokens. // This means that this test must run before the #badToken test below. - api.getToken( 'edit' ) + api.getToken( 'csrf' ) .done( function ( token ) { assert.ok( token.length, 'Got a token' ); } ) @@ -98,9 +98,9 @@ var api = new mw.Api(); // Clear the default cached token - api.badToken( 'edit' ); + api.badToken( 'csrf' ); - api.getToken( 'edit' ) + api.getToken( 'csrf' ) .done( function ( token ) { assert.equal( token, '0123abc', 'Got a non-cached token' ); } ) @@ -109,7 +109,7 @@ } ); this.server.requests[0].respond( 200, { 'Content-Type': 'application/json' }, - '{ tokens: {
[MediaWiki-commits] [Gerrit] Add mw.Title.newFromLink function - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/222887 Change subject: Add mw.Title.newFromLink function .. Add mw.Title.newFromLink function Bug: T58303 Change-Id: I718e6e6ddfcb566d87c0859320ba68d26471a470 --- M resources/src/mediawiki/mediawiki.Title.js 1 file changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/87/222887/1 diff --git a/resources/src/mediawiki/mediawiki.Title.js b/resources/src/mediawiki/mediawiki.Title.js index 661ab74..5a2e700 100644 --- a/resources/src/mediawiki/mediawiki.Title.js +++ b/resources/src/mediawiki/mediawiki.Title.js @@ -678,6 +678,37 @@ }; /** +* Get the title from a link element. +* +* var title = mw.Title.newFromLink( $( 'a.new:first' ) ); +* +* @static +* @param {HTMLElement|jQuery} link The link to use +* @return {mw.Title|null} The link title or null if unsuccessful +*/ + Title.newFromLink = function ( link ) { + var serverUrl, url, regex, href, decodedHref, matches; + + serverUrl = mw.config.get( 'wgServer' ); + // The regex matches everything either until the end of the string or first ? or found + url = serverUrl + mw.config.get( 'wgArticlePath' ).replace( '$1', '(.+?(?=[\?\])|.+)' ); + regex = new RegExp( url ); + + href = link.jquery ? link[0].href : link.href; + decodedHref = decodeURIComponent( href ); + matches = decodedHref.match( regex ); + + if ( matches matches[1] ) { + return mw.Title.newFromText( matches[1] ); + } else if ( href.indexOf( serverUrl + mw.config.get( 'wgScript' ) ) !== -1 ) { + // Handle redlinks and other special links which does not use $wgArticlePath pattern + return mw.Title.newFromText( mw.util.getParamValue( 'title', href ) ); + } + + return null; + }; + + /** * Whether this title exists on the wiki. * * @static -- To view, visit https://gerrit.wikimedia.org/r/222887 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I718e6e6ddfcb566d87c0859320ba68d26471a470 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve automatical reducing the query increment - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/186243 Change subject: Improve automatical reducing the query increment .. Improve automatical reducing the query increment Improve APIGenerator.set_maximum_items so the item limit is automatically increased if needed (if both new maximum_items value and query increment are higer than the current limit set for request). Also, handle it in set_query_increment as well. Bug: T68949 Change-Id: Id3ef14c6fec722718ece622195945fcc2b68acdd --- M pywikibot/data/api.py 1 file changed, 13 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/43/186243/1 diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 5d3b2ff..7a7a7dc 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1519,10 +1519,10 @@ @type value: int self.query_increment = int(value) -self.request[self.limit_name] = self.query_increment pywikibot.debug(u%s: Set query_increment to %i. % (self.__class__.__name__, self.query_increment), _logger) +self._update_request_limit() def set_maximum_items(self, value): @@ -1536,13 +1536,21 @@ @type value: int self.limit = int(value) -if self.limit self.query_increment: -self.request[self.limit_name] = self.limit -pywikibot.debug(u%s: Set request item limit to %i -% (self.__class__.__name__, self.limit), _logger) +self._update_request_limit() pywikibot.debug(u%s: Set limit (maximum_items) to %i. % (self.__class__.__name__, self.limit), _logger) +def _update_request_limit(self): + +Updates the number of items requested in an API query, so it's never +higher than the number of items we are going to work on. + +if self.limit is not None: +limit = min(self.limit, self.query_increment) +self.request[self.limit_name] = limit +pywikibot.debug(u%s: Set request item limit to %i. +% (self.__class__.__name__, limit), _logger) + def __iter__(self): Submit request and iterate the response. -- To view, visit https://gerrit.wikimedia.org/r/186243 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3ef14c6fec722718ece622195945fcc2b68acdd Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix TypeError in APIGenerator.set_maximum_items on Python3 - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/186176 Change subject: Fix TypeError in APIGenerator.set_maximum_items on Python3 .. Fix TypeError in APIGenerator.set_maximum_items on Python3 Also, add comments to the function, and update the query increment in set_maximum_items to higher value if needed. Bug: T68949 Change-Id: I17122aac2b0ee86bb131c1a905a0ca87cff0c402 --- M pywikibot/data/api.py 1 file changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/76/186176/1 diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index d5100ad..52e6383 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1502,10 +1502,11 @@ self.limit_name = limit_name self.data_name = data_name +self.query_increment = 50 self.limit = None self.starting_offset = kwargs.pop(self.continue_name, 0) self.request = Request(**kwargs) -self.request[self.limit_name] = 50 +self.request[self.limit_name] = self.query_increment def set_query_increment(self, value): @@ -1517,9 +1518,11 @@ per API request to set. @type value: int -self.request[self.limit_name] = int(value) +self.query_increment = int(value) +self.request[self.limit_name] = self.query_increment pywikibot.debug(u%s: Set query_limit to %i. -% (self.__class__.__name__, int(value)), _logger) +% (self.__class__.__name__, self.query_increment), +_logger) def set_maximum_items(self, value): @@ -1533,8 +1536,14 @@ @type value: int self.limit = int(value) -if self.limit self.request[self.limit_name]: +if self.limit self.query_increment: +# If the new limit of maximum number of items to be retrieved is +# low, there's no point in retrieving more in API query self.request[self.limit_name] = self.limit +else: +# The limit might have been updated earlier to the lower value, +# so restore the original one +self.request[self.limit_name] = self.query_increment def __iter__(self): Submit request and iterate the response. -- To view, visit https://gerrit.wikimedia.org/r/186176 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17122aac2b0ee86bb131c1a905a0ca87cff0c402 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make data provider in MediaHandlerTest static - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/186083 Change subject: Make data provider in MediaHandlerTest static .. Make data provider in MediaHandlerTest static Also, improve function names. Follows-up Ie1cf501a6a0c8e688aca1a5577a293f526398dd3 Change-Id: I5eef5f193192041d7b0514eaa8b779c03e6647c7 --- M tests/phpunit/includes/media/MediaHandlerTest.php 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/83/186083/1 diff --git a/tests/phpunit/includes/media/MediaHandlerTest.php b/tests/phpunit/includes/media/MediaHandlerTest.php index 5fa609a..6c9d7b1 100644 --- a/tests/phpunit/includes/media/MediaHandlerTest.php +++ b/tests/phpunit/includes/media/MediaHandlerTest.php @@ -19,24 +19,24 @@ ($width, $height, $max) wanted: {$expected}x$y, got: {z$result}x$y2 ); } - public function provideTestFitBoxWidth() { + public static function provideTestFitBoxWidth() { return array_merge( - $this-provideTestFitBoxWidthSingle( 50, 50, array( + static::generateTestFitBoxWidthData( 50, 50, array( 50 = 50, 17 = 17, 18 = 18 ) ), - $this-provideTestFitBoxWidthSingle( 366, 300, array( + static::generateTestFitBoxWidthData( 366, 300, array( 50 = 61, 17 = 21, 18 = 22 ) ), - $this-provideTestFitBoxWidthSingle( 300, 366, array( + static::generateTestFitBoxWidthData( 300, 366, array( 50 = 41, 17 = 14, 18 = 15 ) ), - $this-provideTestFitBoxWidthSingle( 100, 400, array( + static::generateTestFitBoxWidthData( 100, 400, array( 50 = 12, 17 = 4, 18 = 4 ) @@ -44,7 +44,7 @@ ); } - private function provideTestFitBoxWidthSingle( $width, $height, $tests ) { + private static function generateTestFitBoxWidthData( $width, $height, $tests ) { $result = array(); foreach ( $tests as $max = $expected ) { $result[] = array( $width, $height, $max, $expected ); -- To view, visit https://gerrit.wikimedia.org/r/186083 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5eef5f193192041d7b0514eaa8b779c03e6647c7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix download panel not showing on rclick after pressing esc - change (mediawiki...MultimediaViewer)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184630 Change subject: Fix download panel not showing on rclick after pressing esc .. Fix download panel not showing on rclick after pressing esc Bug: T86389 Change-Id: Ic158c579c4a7a6e48bcbd9cdfb724712b1e2fece --- M resources/mmv/mmv.lightboxinterface.js 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/30/184630/1 diff --git a/resources/mmv/mmv.lightboxinterface.js b/resources/mmv/mmv.lightboxinterface.js index f7a0642..bb56427 100644 --- a/resources/mmv/mmv.lightboxinterface.js +++ b/resources/mmv/mmv.lightboxinterface.js @@ -242,8 +242,6 @@ this.currentlyAttached = false; - this.canvas.unattach(); - this.buttons.unattach(); this.$postDiv.off( '.lip' ); @@ -258,6 +256,9 @@ this.optionsDialog.unattach(); this.optionsDialog.closeDialog(); + // Canvas listens for events from dialogs, so should be unattached at the end + this.canvas.unattach(); + this.clearEvents(); // We trigger this event on the document because unattach() can run -- To view, visit https://gerrit.wikimedia.org/r/184630 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic158c579c4a7a6e48bcbd9cdfb724712b1e2fece Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: wmf/1.25wmf14 Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update MultimediaViewer - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184633 Change subject: Update MultimediaViewer .. Update MultimediaViewer Change-Id: I144cf03dab6f15725a0e021b7abf2a2c0003fb8b --- M extensions/MultimediaViewer 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/33/184633/1 diff --git a/extensions/MultimediaViewer b/extensions/MultimediaViewer index 4c2b67a..d374f78 16 --- a/extensions/MultimediaViewer +++ b/extensions/MultimediaViewer -Subproject commit 4c2b67a339638496f020251e8e56b0e6eca4140a +Subproject commit d374f788d0fd17bc06a717bdc6236b0be3158f06 -- To view, visit https://gerrit.wikimedia.org/r/184633 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I144cf03dab6f15725a0e021b7abf2a2c0003fb8b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.25wmf14 Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve error messages UI for Media Viewer - change (mediawiki...MultimediaViewer)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184753 Change subject: Improve error messages UI for Media Viewer .. Improve error messages UI for Media Viewer Bug: T77272 Change-Id: I97ffa70903da32c66697c52969cfec2df03c1d57 --- M MultimediaViewer.php M i18n/en.json M i18n/qqq.json M resources/mmv/mmv.js A resources/mmv/ui/img/error-media-icon.svg D resources/mmv/ui/img/error.svg M resources/mmv/ui/mmv.ui.canvas.js M resources/mmv/ui/mmv.ui.canvas.less M resources/mmv/ui/mmv.ui.metadataPanel.js 9 files changed, 66 insertions(+), 60 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/53/184753/1 diff --git a/MultimediaViewer.php b/MultimediaViewer.php index 90949e6..586d660 100644 --- a/MultimediaViewer.php +++ b/MultimediaViewer.php @@ -371,6 +371,7 @@ 'messages' = array( 'multimediaviewer-thumbnail-error', + 'multimediaviewer-thumbnail-error-description', ), 'dependencies' = array( diff --git a/i18n/en.json b/i18n/en.json index 1f09e3b..00957ab 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -17,8 +17,9 @@ multimediaviewer-credit-fallback: View author information, multimediaviewer-multiple-authors: {{PLURAL:$1|one more author|$1 more authors}}, multimediaviewer-multiple-authors-combine: $1 and $2, - multimediaviewer-metadata-error: Error: Could not load image data. $1, - multimediaviewer-thumbnail-error: Error: Could not load thumbnail data. $1, + multimediaviewer-metadata-error: Could not load image details, + multimediaviewer-thumbnail-error: Sorry, the file cannot be displayed, + multimediaviewer-thumbnail-error-description: There seems to be a technical issue. You can retry or [https://phabricator.wikimedia.org/maniphest/task/create/?projects=PHID-PROJ-cabyqp5sf4hyvauln3sq report the issue] if it persists., multimediaviewer-license-cc-by-1.0: CC BY 1.0, multimediaviewer-license-cc-sa-1.0: CC SA 1.0, multimediaviewer-license-cc-by-sa-1.0: CC BY-SA 1.0, diff --git a/i18n/qqq.json b/i18n/qqq.json index d849f7b..9c42502 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -24,8 +24,9 @@ multimediaviewer-credit-fallback: Text shown in place of the credit line ({{msg-mw|multimediaviewer-credit}}) when neither author nor source information is available., multimediaviewer-multiple-authors: Text shown after the author name when there are multiple authors. The text will link to the file description page.\n* $1 - number of additional authors., multimediaviewer-multiple-authors-combine: Combines the author name and the message about other authors.\n* $1 - author name, parsed from the file page\n* $2 - {{msg-mw|multimediaviewer-multiple-authors}} wrapped in a link., - multimediaviewer-metadata-error: Text shown when the information on the metadata panel could not be loaded.\n\nParameters:\n* $1 - the error message (not localized)\nSee also:\n* {{msg-mw|Multimediaviewer-thumbnail-error}}, - multimediaviewer-thumbnail-error: Text shown when the image could not be loaded. Parameters:\n* $1 - the error message (not localized)\nSee also:\n* {{msg-mw|Multimediaviewer-metadata-error}}, + multimediaviewer-metadata-error: Text shown when the information on the metadata panel could not be loaded.\nSee also:\n* {{msg-mw|multimediaviewer-thumbnail-error}}, + multimediaviewer-thumbnail-error: Text shown when the image could not be loaded. Followed by {{msg-mw|multimediaviewer-thumbnail-error-description}}.\nSee also:\n* {{msg-mw|multimediaviewer-thumbnail-error-description}}\n* {{msg-mw|multimediaviewer-metadata-error}}, + multimediaviewer-thumbnail-error-description: Text shown when the image could not be loaded. Follows {{msg-mw|multimediaviewer-thumbnail-error}}.\nSee also:\n* {{msg-mw|multimediaviewer-thumbnail-error}}, multimediaviewer-license-cc-by-1.0: Very short label for the Creative Commons Attribution license, version 1.0, used in a link to the file information page that has more licensing information.\n{{Identical|CC BY}}, multimediaviewer-license-cc-sa-1.0: Very short label for the Creative Commons ShareAlike license, version 1.0, used in a link to the file information page that has more licensing information., multimediaviewer-license-cc-by-sa-1.0: Very short label for the Creative Commons Attribution ShareAlike license, version 1.0, used in a link to the file information page that has more licensing information.\n{{Identical|CC BY-SA}}, diff --git a/resources/mmv/mmv.js b/resources/mmv/mmv.js index cba79a6..ca94446 100644 --- a/resources/mmv/mmv.js +++ b/resources/mmv/mmv.js @@ -345,7 +345,7 @@ return; } -
[MediaWiki-commits] [Gerrit] Fix download panel not showing on rclick after pressing esc - change (mediawiki...MultimediaViewer)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184520 Change subject: Fix download panel not showing on rclick after pressing esc .. Fix download panel not showing on rclick after pressing esc Bug: T86389 Change-Id: Ic158c579c4a7a6e48bcbd9cdfb724712b1e2fece --- M resources/mmv/mmv.lightboxinterface.js 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/20/184520/1 diff --git a/resources/mmv/mmv.lightboxinterface.js b/resources/mmv/mmv.lightboxinterface.js index f7a0642..bb56427 100644 --- a/resources/mmv/mmv.lightboxinterface.js +++ b/resources/mmv/mmv.lightboxinterface.js @@ -242,8 +242,6 @@ this.currentlyAttached = false; - this.canvas.unattach(); - this.buttons.unattach(); this.$postDiv.off( '.lip' ); @@ -258,6 +256,9 @@ this.optionsDialog.unattach(); this.optionsDialog.closeDialog(); + // Canvas listens for events from dialogs, so should be unattached at the end + this.canvas.unattach(); + this.clearEvents(); // We trigger this event on the document because unattach() can run -- To view, visit https://gerrit.wikimedia.org/r/184520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic158c579c4a7a6e48bcbd9cdfb724712b1e2fece Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape unescaped messages in Special:Ask - change (mediawiki...SemanticMaps)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184239 Change subject: Escape unescaped messages in Special:Ask .. Escape unescaped messages in Special:Ask Bug: T85864 Change-Id: Ie750efba7c2697e58d84a818d2f19384d77e4c58 --- M src/queryprinters/SM_KMLPrinter.php M src/queryprinters/SM_MapPrinter.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMaps refs/changes/39/184239/1 diff --git a/src/queryprinters/SM_KMLPrinter.php b/src/queryprinters/SM_KMLPrinter.php index 8efeed1..4a00a83 100644 --- a/src/queryprinters/SM_KMLPrinter.php +++ b/src/queryprinters/SM_KMLPrinter.php @@ -184,6 +184,6 @@ * @see SMWResultPrinter::getName() */ public final function getName() { - return wfMessage( 'semanticmaps-kml' )-text(); + return wfMessage( 'semanticmaps-kml' )-escaped(); } } diff --git a/src/queryprinters/SM_MapPrinter.php b/src/queryprinters/SM_MapPrinter.php index 8499a54..a3e08f1 100644 --- a/src/queryprinters/SM_MapPrinter.php +++ b/src/queryprinters/SM_MapPrinter.php @@ -349,7 +349,7 @@ * @return string */ public final function getName() { - return wfMessage( 'maps_' . $this-service-getName() )-text(); + return wfMessage( 'maps_' . $this-service-getName() )-escaped(); } /** -- To view, visit https://gerrit.wikimedia.org/r/184239 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie750efba7c2697e58d84a818d2f19384d77e4c58 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticMaps Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape unescaped messages in Special:CreateClass - change (mediawiki...SemanticForms)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184281 Change subject: Escape unescaped messages in Special:CreateClass .. Escape unescaped messages in Special:CreateClass Bug: T85864 Change-Id: I6e6cdaf7a6fd926f66d57145932234fa6405bb30 --- M specials/SF_CreateClass.php M specials/SF_CreateTemplate.php 2 files changed, 14 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms refs/changes/81/184281/1 diff --git a/specials/SF_CreateClass.php b/specials/SF_CreateClass.php index b4a1074..16af1aa 100644 --- a/specials/SF_CreateClass.php +++ b/specials/SF_CreateClass.php @@ -214,15 +214,18 @@ $creation_links[] = SFUtils::linkForSpecialPage( 'CreateCategory' ); $form_name_label = wfMessage( 'sf_createclass_nameinput' )-text(); $category_name_label = wfMessage( 'sf_createcategory_name' )-text(); - $field_name_label = wfMessage( 'sf_createtemplate_fieldname' )-text(); - $list_of_values_label = wfMessage( 'sf_createclass_listofvalues' )-text(); - $property_name_label = wfMessage( 'sf_createproperty_propname' )-text(); - $type_label = wfMessage( 'sf_createproperty_proptype' )-text(); - $allowed_values_label = wfMessage( 'sf_createclass_allowedvalues' )-text(); + $field_name_label = wfMessage( 'sf_createtemplate_fieldname' )-escaped(); + $list_of_values_label = wfMessage( 'sf_createclass_listofvalues' )-escaped(); + $property_name_label = wfMessage( 'sf_createproperty_propname' )-escaped(); + $type_label = wfMessage( 'sf_createproperty_proptype' )-escaped(); + $allowed_values_label = wfMessage( 'sf_createclass_allowedvalues' )-escaped(); $text = 'form action= method=post' . \n; - $text .= \t . Html::rawElement( 'p', null, wfMessage( 'sf_createclass_docu', $wgLang-listToText( $creation_links ) )-text() ) . \n; - $templateNameLabel = wfMessage( 'sf_createtemplate_namelabel' )-text(); + $text .= \t . Html::rawElement( 'p', null, + wfMessage( 'sf_createclass_docu' ) + -rawParams( $wgLang-listToText( $creation_links ) ) + -escaped() ) . \n; + $templateNameLabel = wfMessage( 'sf_createtemplate_namelabel' )-escaped(); $templateNameInput = Html::input( 'template_name', null, 'text', array( 'size' = 30 ) ); $text .= \t . Html::rawElement( 'p', null, $templateNameLabel . ' ' . $templateNameInput ) . \n; $templateInfo = SFCreateTemplate::printTemplateStyleInput( 'template_format' ); @@ -232,13 +235,13 @@ 'name' = 'template_multiple', 'id' = 'template_multiple', 'onclick' = disableFormAndCategoryInputs(), - ) ) . ' ' . wfMessage( 'sf_createtemplate_multipleinstance' )-text() ) . \n; + ) ) . ' ' . wfMessage( 'sf_createtemplate_multipleinstance' )-escaped() ) . \n; // Either #set_internal or #subobject will be added to the // template, depending on whether Semantic Internal Objects is // installed. global $smwgDefaultStore; if ( defined( 'SIO_VERSION' ) || $smwgDefaultStore == SMWSQLStore3 ) { - $templateInfo .= Html::rawElement( 'div', + $templateInfo .= Html::element( 'div', array ( 'id' = 'connecting_property_div', 'style' = 'display: none;', @@ -254,7 +257,7 @@ $text .= \t . Html::rawElement( 'p', null, Html::element( 'label', array( 'for' = 'form_name' ), $form_name_label ) . ' ' . Html::element( 'input', array( 'size' = '30', 'name' = 'form_name', 'id' = 'form_name' ), null ) ) . \n; $text .= \t . Html::rawElement( 'p', null, Html::element( 'label', array( 'for' = 'category_name' ), $category_name_label ) . ' ' . Html::element( 'input', array( 'size' = '30', 'name' = 'category_name', 'id' = 'category_name' ), null ) ) . \n; $text .= \t . Html::element( 'br', null, null ) . \n; - $property_label = wfMessage( 'smw_pp_type' )-text(); + $property_label = wfMessage( 'smw_pp_type' )-escaped(); $text .= END div table id=mainTable style=border-collapse: collapse; diff --git a/specials/SF_CreateTemplate.php b/specials/SF_CreateTemplate.php index cfae77d..b8cf60b 100644 --- a/specials/SF_CreateTemplate.php +++ b/specials/SF_CreateTemplate.php @@ -170,7 +170,7
[MediaWiki-commits] [Gerrit] Escape value returned by SpecialPage::getDescription() - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184282 Change subject: Escape value returned by SpecialPage::getDescription() .. Escape value returned by SpecialPage::getDescription() Bug: T85864 Change-Id: If930fa446b0c652d5341a15f0c9db950a986dc7a --- M includes/specialpage/SpecialPage.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/82/184282/1 diff --git a/includes/specialpage/SpecialPage.php b/includes/specialpage/SpecialPage.php index 31d679a..2c3773f 100644 --- a/includes/specialpage/SpecialPage.php +++ b/includes/specialpage/SpecialPage.php @@ -462,7 +462,7 @@ * @return string */ function getDescription() { - return $this-msg( strtolower( $this-mName ) )-text(); + return $this-msg( strtolower( $this-mName ) )-escaped(); } /** -- To view, visit https://gerrit.wikimedia.org/r/184282 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If930fa446b0c652d5341a15f0c9db950a986dc7a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape unescaped messages in Special:Ask - change (mediawiki...SemanticMediaWiki)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184203 Change subject: Escape unescaped messages in Special:Ask .. Escape unescaped messages in Special:Ask Bug: T85864 Change-Id: Ic98b6f52c77c2a401a448dcc4ad6e5461f146535 --- M includes/specials/SMW_SpecialAsk.php 1 file changed, 19 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/03/184203/1 diff --git a/includes/specials/SMW_SpecialAsk.php b/includes/specials/SMW_SpecialAsk.php index 55808c1..0d2fc58 100644 --- a/includes/specials/SMW_SpecialAsk.php +++ b/includes/specials/SMW_SpecialAsk.php @@ -42,7 +42,7 @@ $this-setHeaders(); if ( !$smwgQEnabled ) { - $wgOut-addHTML( 'br /' . wfMessage( 'smw_iq_disabled' )-text() ); + $wgOut-addHTML( 'br /' . wfMessage( 'smw_iq_disabled' )-escaped() ); } else { if ( $wgRequest-getCheck( 'showformatoptions' ) ) { // handle Ajax action @@ -352,8 +352,8 @@ $result .= Html::hidden( 'title', $title-getPrefixedDBKey() ); // Table for main query and printouts. - $result .= 'table class=smw-ask-query style=width: 100%;trth' . wfMessage( 'smw_ask_queryhead' )-text() . /th\nth . wfMessage( 'smw_ask_printhead' )-text() . br /\n . - 'span style=font-weight: normal;' . wfMessage( 'smw_ask_printdesc' )-text() . '/span' . /th/tr\n . + $result .= 'table class=smw-ask-query style=width: 100%;trth' . wfMessage( 'smw_ask_queryhead' )-escaped() . /th\nth . wfMessage( 'smw_ask_printhead' )-escaped() . br /\n . + 'span style=font-weight: normal;' . wfMessage( 'smw_ask_printdesc' )-escaped() . '/span' . /th/tr\n . 'trtd style=padding-left: 0px;textarea class=smw-ask-query-condition name=q cols=20 rows=6' . htmlspecialchars( $this-m_querystring ) . /textarea/td\n . 'td style=padding-left: 7px;textarea id=add_property class=smw-ask-query-printout name=po cols=20 rows=6' . htmlspecialchars( $printoutstring ) . '/textarea/td/tr/table' . \n; @@ -385,7 +385,7 @@ $urltail = str_replace( 'eq=yes', '', $urltail ) . 'eq=no'; // FIXME: doing it wrong, srysly // Submit - $result .= 'br /input type=submit value=' . wfMessage( 'smw_ask_submit' )-text() . '/' . + $result .= 'br /input type=submit value=' . wfMessage( 'smw_ask_submit' )-escaped() . '/' . 'input type=hidden name=eq value=yes/' . Html::element( 'a', @@ -396,7 +396,7 @@ wfMessage( 'smw_ask_hidequery' )-text() ) . ' | ' . SMWAskPage::getEmbedToggle() . - ' | a href=' . htmlspecialchars( wfMessage( 'smw_ask_doculink' )-text() ) . '' . wfMessage( 'smw_ask_help' )-text() . '/a' . + ' | a href=' . wfMessage( 'smw_ask_doculink' )-escaped() . '' . wfMessage( 'smw_ask_help' )-escaped() . '/a' . \n/form; } else { // if $this-m_editquery == false $urltail = str_replace( 'eq=no', '', $urltail ) . 'eq=yes'; @@ -413,7 +413,7 @@ '/p'; } //show|hide inline embed code - $result .= 'div id=inlinequeryembed style=display: nonediv id=inlinequeryembedinstruct' . wfMessage( 'smw_ask_embed_instr' )-text() . '/divtextarea id=inlinequeryembedarea readonly=yes cols=20 rows=6 onclick=this.select()' . + $result .= 'div id=inlinequeryembed style=display: nonediv id=inlinequeryembedinstruct' . wfMessage( 'smw_ask_embed_instr' )-escaped() . '/divtextarea id=inlinequeryembedarea readonly=yes cols=20 rows=6 onclick=this.select()' . '{{#ask:' . htmlspecialchars( $this-m_querystring ) . \n; foreach ( $this-m_printouts as $printout ) { @@ -453,7 +453,7 @@ } } - $result .= 'br /span class=smw-ask-query-format style=vertical-align:middle;' . wfMessage( 'smw_ask_format_as' )-text() . ' input type=hidden name=eq value=yes/' . \n . + $result .= 'br /span class=smw-ask-query-format style=vertical-align:middle;' . wfMessage( 'smw_ask_format_as' )-escaped() . ' input type=hidden name=eq value=yes/' . \n . Html::openElement(
[MediaWiki-commits] [Gerrit] Fix gallery rearrange on resize with missing images - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/183989 Change subject: Fix gallery rearrange on resize with missing images .. Fix gallery rearrange on resize with missing images Bug: T55664 Follow-ups I286e0a4c8230c11619ca30f8f3b66778de835a33 Change-Id: I95cc64de11df3197378f4873d62a76333d55b452 --- M resources/src/mediawiki.page/mediawiki.page.gallery.js 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/89/183989/1 diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.js b/resources/src/mediawiki.page/mediawiki.page.gallery.js index ba1f323..5be1fea 100644 --- a/resources/src/mediawiki.page/mediawiki.page.gallery.js +++ b/resources/src/mediawiki.page/mediawiki.page.gallery.js @@ -221,12 +221,14 @@ var imgWidth = $( this ).data( 'imgWidth' ), imgHeight = $( this ).data( 'imgHeight' ), width = $( this ).data( 'width' ), - captionWidth = $( this ).data( 'captionWidth' ); + captionWidth = $( this ).data( 'captionWidth' ), + $innerDiv = $( this ).children( 'div' ).first(), + $imageDiv = $innerDiv.children( 'div.thumb' ); // Restore original sizes so we can arrange the elements as on freshly loaded page $( this ).width( width ); - $( this ).children( 'div' ).first().width( width ); - $( this ).children( 'div' ).first().children( 'div.thumb' ).width( imgWidth ); + $innerDiv.width( width ); + $imageDiv.width( imgWidth ); $( this ).find( 'div.gallerytextwrapper' ).width( captionWidth ); var $imageElm = $( this ).find( 'img' ).first(), @@ -234,6 +236,8 @@ if ( imageElm ) { imageElm.width = imgWidth; imageElm.height = imgHeight; + } else { + $imageDiv.height( imgHeight ); } } ); } ) ); -- To view, visit https://gerrit.wikimedia.org/r/183989 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95cc64de11df3197378f4873d62a76333d55b452 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Wikidata support to isbn.py script - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/182989 Change subject: Add Wikidata support to isbn.py script .. Add Wikidata support to isbn.py script The support is done via a separate Bot class. It can find ISBN-10 and ISBN-13 property IDs or they can be provided manually by the user. Bug: T85242 Change-Id: I38cf459d78eb02102da6a169c9c0633ee95b1f3b --- M scripts/isbn.py M tests/isbn_tests.py 2 files changed, 152 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/89/182989/1 diff --git a/scripts/isbn.py b/scripts/isbn.py index fa7f472..a59e741 100755 --- a/scripts/isbn.py +++ b/scripts/isbn.py @@ -27,6 +27,13 @@ -always Don't prompt you for each replacement. +-prop-isbn-10 Sets ISBN-10 property ID, so it's not tried to be found + automatically. + The usage is as follows: -prop-isbn-10:propid + +-prop-isbn-13 Sets ISBN-13 property ID. The format and purpose is the + same as in -prop-isbn-10. + # # (C) Pywikibot team, 2009-2014 @@ -38,7 +45,7 @@ import re import pywikibot -from pywikibot import i18n, pagegenerators, Bot +from pywikibot import i18n, pagegenerators, Bot, WikidataBot, PropertyPage docuReplacements = { 'params;': pagegenerators.parameterHelp, @@ -1415,6 +1422,94 @@ self.treat(page) +class IsbnWikibaseBot(WikidataBot): + +ISBN bot to be run on Wikibase sites. + +def __init__(self, generator, **kwargs): +self.availableOptions.update({ +'to13': False, +'format': False, +}) +self.isbn_10_prop_id = kwargs.pop('prop-isbn-10', None) +self.isbn_13_prop_id = kwargs.pop('prop-isbn-13', None) + +super(IsbnWikibaseBot, self).__init__(use_from_page=None, **kwargs) + +self.generator = generator +self.comment = i18n.twtranslate(pywikibot.Site(), 'isbn-formatting') +if self.isbn_10_prop_id is None: +self.isbn_10_prop_id = self._get_isbn_property_id('ISBN-10') +if self.isbn_13_prop_id is None: +self.isbn_13_prop_id = self._get_isbn_property_id('ISBN-13') + +def _get_isbn_property_id(self, property_name): + +Find given property and return its ID. + +Method first uses site.search() and if the property isn't found, then +asks user to provide the property ID. + +@param property_name: property to find +@type property_name: str + +ns = self.site.data_repository().property_namespace +for page in self.site.search(property_name, step=1, total=1, + namespaces=ns): +page = PropertyPage(self.site.data_repository(), page.title()) +pywikibot.output(uAssuming that %s property is %s (you can + uoverride this with -prop-%s:pid) % + (property_name, page.id, property_name.lower())) +return page.id +pywikibot.output(uProperty %s was not found. % property_name) +return pywikibot.input(u'Please enter the property ID (e.g. P123) of ' + u'it:').upper() + +def treat(self, page, item): +if self.isbn_10_prop_id in item.claims: +for claim in item.claims[self.isbn_10_prop_id]: +try: +isbn = getIsbn(claim.getTarget()) +except InvalidIsbnException as e: +pywikibot.output(e) +continue + +if self.getOption('format'): +isbn.format() + +if self.getOption('to13'): +isbn = isbn.toISBN13() +pywikibot.output('Removing %s (%s) and adding %s (%s)' % + (self.isbn_10_prop_id, claim.getTarget(), + self.isbn_13_prop_id, isbn.code)) +new_claim = pywikibot.Claim(self.site.data_repository(), +self.isbn_13_prop_id) +new_claim.setTarget(isbn.code) +item.removeClaims(claim) +item.addClaim(new_claim) +continue + +pywikibot.output('Changing %s (%s -- %s)' + % (self.isbn_10_prop_id, claim.getTarget(), +isbn.code)) +claim.changeTarget(isbn.code) + +# -format is the only option that has any effect on ISBN13 +if self.getOption('format') and self.isbn_13_prop_id in item.claims: +for claim in item.claims[self.isbn_13_prop_id]: +try: +isbn = getIsbn(claim.getTarget()) +except InvalidIsbnException as e: +
[MediaWiki-commits] [Gerrit] Adjust images in packed gallery on window resize - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/182652 Change subject: Adjust images in packed gallery on window resize .. Adjust images in packed gallery on window resize Clones of original gallery elements are stored separately, in case of further need of item rearrange. While it's not the most efficient solution, it's probably the most elegant and simple one. Bug: T55664 Change-Id: I286e0a4c8230c11619ca30f8f3b66778de835a33 --- M resources/src/mediawiki.page/mediawiki.page.gallery.js 1 file changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/52/182652/1 diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.js b/resources/src/mediawiki.page/mediawiki.page.gallery.js index 1892967..af98306 100644 --- a/resources/src/mediawiki.page/mediawiki.page.gallery.js +++ b/resources/src/mediawiki.page/mediawiki.page.gallery.js @@ -27,9 +27,7 @@ } // Now on to justification. - // We may still get ragged edges if someone resizes their window. Could bind to - // that event, otoh do we really want to constantly be resizing galleries? - $( galleries ).each( function () { + var justify = function () { var lastTop, $img, imgWidth, @@ -207,6 +205,23 @@ } } }() ); + }; + + // Save the galleries in case we want to restore them + $( galleries ).each( function() { + $( this ).data( 'original-gallery', $( this ).clone() ); } ); + $( galleries ).each( justify ); + + $( window ).resize(function() { + $( galleries ).each( function() { + // Restore the saved galleries, and save the original ones again in new instances + var $new = $( this ).data( 'original-gallery' ); + $new.removeData( 'original-gallery' ); + $new.data( 'original-gallery', $new.clone() ); + $( this ).replaceWith( $new ); + } ); + $( galleries ).each( justify ); + }); } ); }( jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/182652 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I286e0a4c8230c11619ca30f8f3b66778de835a33 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add missing documentation in DateFormatter.php - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/182550 Change subject: Add missing documentation in DateFormatter.php .. Add missing documentation in DateFormatter.php Change-Id: Ic5c04bdb88bc57a7c44159d7858ef791c24354c4 --- M includes/parser/DateFormatter.php 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/50/182550/1 diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index 82f0e9d..3db8d1e 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -315,8 +315,8 @@ } /** -* @todo document -* @return string +* Return a regex that can be used to find month names in string +* @return string regex to find the months with */ public function getMonthRegex() { $names = array(); @@ -338,7 +338,7 @@ } /** -* @todo document +* Make an ISO year from a year name, for instance: '-1199' from '1200 BC' * @param string $year Year name * @return string ISO year name */ @@ -356,9 +356,10 @@ } /** -* @todo document -* @param string $iso -* @return int|string +* Make a year one from an ISO year, for instance: '400 BC' from '-0399'. +* @param string $iso ISO year +* @return int|string int representing year number in case of AD dates, or string containing +* year number and 'BC' at the end otherwise. */ public function makeNormalYear( $iso ) { if ( $iso[0] == '-' ) { -- To view, visit https://gerrit.wikimedia.org/r/182550 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5c04bdb88bc57a7c44159d7858ef791c24354c4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add data provider to MediaHandlerTest::testFitBoxWidth - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/182470 Change subject: Add data provider to MediaHandlerTest::testFitBoxWidth .. Add data provider to MediaHandlerTest::testFitBoxWidth Change-Id: Ie1cf501a6a0c8e688aca1a5577a293f526398dd3 --- M tests/phpunit/includes/media/MediaHandlerTest.php 1 file changed, 33 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/70/182470/1 diff --git a/tests/phpunit/includes/media/MediaHandlerTest.php b/tests/phpunit/includes/media/MediaHandlerTest.php index d8cfcc4..2e2a768 100644 --- a/tests/phpunit/includes/media/MediaHandlerTest.php +++ b/tests/phpunit/includes/media/MediaHandlerTest.php @@ -7,50 +7,48 @@ /** * @covers MediaHandler::fitBoxWidth -* @todo split into a dataprovider and test method +* +* @dataProvider provideTestFitBoxWidth */ - public function testFitBoxWidth() { - $vals = array( - array( - 'width' = 50, - 'height' = 50, - 'tests' = array( + public function testFitBoxWidth( $width, $height, $max, $expected ) { + $y = round( $expected * $height / $width ); + $result = MediaHandler::fitBoxWidth( $width, $height, $max ); + $y2 = round( $result * $height / $width ); + $this-assertEquals( $expected, + $result, + ($width, $height, $max) wanted: {$expected}x$y, got: {z$result}x$y2 ); + } + + public function provideTestFitBoxWidth() { + return array_merge( + $this-provideTestFitBoxWidthSingle( 50, 50, array( 50 = 50, 17 = 17, - 18 = 18 ) ), - array( - 'width' = 366, - 'height' = 300, - 'tests' = array( + 18 = 18 ) + ), + $this-provideTestFitBoxWidthSingle( 366, 300, array( 50 = 61, 17 = 21, - 18 = 22 ) ), - array( - 'width' = 300, - 'height' = 366, - 'tests' = array( + 18 = 22 ) + ), + $this-provideTestFitBoxWidthSingle( 300, 366, array( 50 = 41, 17 = 14, - 18 = 15 ) ), - array( - 'width' = 100, - 'height' = 400, - 'tests' = array( + 18 = 15 ) + ), + $this-provideTestFitBoxWidthSingle( 100, 400, array( 50 = 12, 17 = 4, - 18 = 4 ) ) ); - foreach ( $vals as $row ) { - $tests = $row['tests']; - $height = $row['height']; - $width = $row['width']; - foreach ( $tests as $max = $expected ) { - $y = round( $expected * $height / $width ); - $result = MediaHandler::fitBoxWidth( $width, $height, $max ); - $y2 = round( $result * $height / $width ); - $this-assertEquals( $expected, - $result, - ($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2 ); - } + 18 = 4 ) + ) + ); + } + + private function provideTestFitBoxWidthSingle( $width, $height, $tests ) { + $result = array(); + foreach ( $tests as $max = $expected ) { + array_push( $result, array( $width, $height, $max, $expected ) ); } + return $result; } } -- To view, visit https://gerrit.wikimedia.org/r/182470 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1cf501a6a0c8e688aca1a5577a293f526398dd3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl
[MediaWiki-commits] [Gerrit] Use Config in SpecialUpload::getInitialPageText - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/182553 Change subject: Use Config in SpecialUpload::getInitialPageText .. Use Config in SpecialUpload::getInitialPageText Change-Id: I7edfe23278acff8d3089d9ad23b588f937d9e337 --- M includes/specials/SpecialUpload.php 1 file changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/53/182553/1 diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index d9e3a67..1c7a352 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -491,13 +491,16 @@ * @param string $license * @param string $copyStatus * @param string $source +* @param Config $config Configuration object to load data from * @return string -* @todo Use Config obj instead of globals */ public static function getInitialPageText( $comment = '', $license = '', - $copyStatus = '', $source = '' + $copyStatus = '', $source = '', Config $config = null ) { - global $wgUseCopyrightUpload, $wgForceUIMsgAsContentMsg; + if ( $config === null ) { + wfDebug( __METHOD__ . ' called without a Config instance passed to it' ); + $config = ConfigFactory::getDefaultInstance()-makeConfig( 'main' ); + } $msg = array(); /* These messages are transcluded into the actual text of the description page. @@ -505,14 +508,14 @@ * instead of hardcoding it there in the uploader language. */ foreach ( array( 'license-header', 'filedesc', 'filestatus', 'filesource' ) as $msgName ) { - if ( in_array( $msgName, (array)$wgForceUIMsgAsContentMsg ) ) { + if ( in_array( $msgName, (array)$config-get( 'ForceUIMsgAsContentMsg' ) ) ) { $msg[$msgName] = {{int:$msgName}}; } else { $msg[$msgName] = wfMessage( $msgName )-inContentLanguage()-text(); } } - if ( $wgUseCopyrightUpload ) { + if ( $config-get( 'UseCopyrightUpload' ) ) { $licensetxt = ''; if ( $license != '' ) { $licensetxt = '== ' . $msg['license-header'] . ==\n . '{{' . $license . '}}' . \n; -- To view, visit https://gerrit.wikimedia.org/r/182553 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7edfe23278acff8d3089d9ad23b588f937d9e337 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't replace user text with suggestion in searchbox - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/182427 Change subject: Don't replace user text with suggestion in searchbox .. Don't replace user text with suggestion in searchbox On Enter press, there was highlight() called, which also replaced the text. Since it seems to have no use here (highlight() highlights the selected suggestion in the box, but the box is immediately hidden, and there's probably no case when the suggestion is chosen, but the text in searchbox does not match it), it was removed. Bug: T53900 Change-Id: I9fc2e954ae429ba166ddc7c713f9790a25a837c2 --- M resources/src/jquery/jquery.suggestions.js 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/27/182427/1 diff --git a/resources/src/jquery/jquery.suggestions.js b/resources/src/jquery/jquery.suggestions.js index 3369cde..a83a70a 100644 --- a/resources/src/jquery/jquery.suggestions.js +++ b/resources/src/jquery/jquery.suggestions.js @@ -474,8 +474,6 @@ } } } else { - $.suggestions.highlight( context, selected, true ); - if ( typeof context.config.result.select === 'function' ) { // Allow the callback to decide whether to prevent default or not if ( context.config.result.select.call( selected, context.data.$textbox ) === true ) { -- To view, visit https://gerrit.wikimedia.org/r/182427 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9fc2e954ae429ba166ddc7c713f9790a25a837c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] More accurate looking for image caption - change (mediawiki...MultimediaViewer)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/182130 Change subject: More accurate looking for image caption .. More accurate looking for image caption MediaViewer now handles Template:Multiple_image. Instead of looking for caption in whole thumbnail container, it tries to find the closest one to the image. Bug: T85354 Change-Id: I18d982a4bf245c4925213d83a3410274d499845e --- M resources/mmv/mmv.bootstrap.js 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/30/182130/1 diff --git a/resources/mmv/mmv.bootstrap.js b/resources/mmv/mmv.bootstrap.js index 4efd48d..d18b4ba 100644 --- a/resources/mmv/mmv.bootstrap.js +++ b/resources/mmv/mmv.bootstrap.js @@ -326,7 +326,14 @@ var $thumbCaption; if ( $thumbContain.length !== 0 $thumbContain.is( '.thumb' ) ) { - $thumbCaption = $thumbContain.find( '.thumbcaption' ).clone(); + // try to find closest caption to the image + $thumbCaption = $link.closest( ':has( .thumbcaption)', $thumbContain ) + .find( ' .thumbcaption' ) + .clone(); + if ( !$thumbCaption.length ) { + // if nothing is found, look for the caption in whole container + $thumbCaption = $thumbContain.find( '.thumbcaption' ).clone(); + } $thumbCaption.find( '.magnify' ).remove(); if ( !$thumbCaption.length ) { // gallery, maybe $thumbCaption = $thumbContain -- To view, visit https://gerrit.wikimedia.org/r/182130 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18d982a4bf245c4925213d83a3410274d499845e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Parse time element in DateTimeOriginal - change (mediawiki...CommonsMetadata)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/181978 Change subject: Parse time element in DateTimeOriginal .. Parse time element in DateTimeOriginal If one is found, then only the value of datetime attribute is returned. Bug: T63701 Change-Id: Ib86865b9d049cace5e8710d2eb6c7d4a451cc673 --- M DomNavigator.php M TemplateParser.php M tests/data/File_Dala_Kyrka.JPG.php M tests/data/File_Sunrise_over_fishing_boats_in_Kerala.jpg.php 4 files changed, 32 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommonsMetadata refs/changes/78/181978/1 diff --git a/DomNavigator.php b/DomNavigator.php index c3efee1..fa92f49 100644 --- a/DomNavigator.php +++ b/DomNavigator.php @@ -105,6 +105,21 @@ } /** +* Returns a list of elements of the given type which have the given attribute with any value. +* (In other words, this is equivalent to the CSS selector 'element[attribute]'.) +* When there are multiple elements with this attribute, all are returned. +* @param string|array $element HTML tag name (* to accept all) or array of tag names +* @param string $attribute +* @param DOMNode $context if present, the method will only search inside this element +* @return DOMNodeList|DOMElement[] +*/ + public function findElementsWithAttribute( $element, $attribute, DOMNode $context = null ) { + $element = $this-handleElementOrList( $element ); + $xpath = ./descendant-or-self::{$element}[@{$attribute}]; + return $this-findByXpath( $xpath, $context ); + } + + /** * Returns true if the node has all the specified classes. * @param DOMNode $node * @param string $classes one or more class names (separated with space) diff --git a/TemplateParser.php b/TemplateParser.php index ebfcf95..82cee16 100644 --- a/TemplateParser.php +++ b/TemplateParser.php @@ -272,6 +272,21 @@ } /** +* Parses the DateTimeOriginal - finds time tag and returns the value of datetime attribute +* @param DomNavigator $domNavigator +* @param DOMNode $node +* @return string +*/ + protected function parseFieldDateTimeOriginal( DomNavigator $domNavigator, DOMNode $node ) { + $nodes = $domNavigator-findElementsWithAttribute( 'time', 'datetime', $node ); + foreach ( $nodes as $time ) { + return $time-getAttribute( 'datetime' ); + } + + return $this-parseContents( $domNavigator, $node ); + } + + /** * Extracts an hCard property from a DOMNode that contains an hCard * @param DomNavigator $domNavigator * @param DOMNode $node diff --git a/tests/data/File_Dala_Kyrka.JPG.php b/tests/data/File_Dala_Kyrka.JPG.php index e24b365..a69dac2 100644 --- a/tests/data/File_Dala_Kyrka.JPG.php +++ b/tests/data/File_Dala_Kyrka.JPG.php @@ -7,7 +7,7 @@ return array ( 'DateTimeOriginal' = array ( - 'value' = 'time class=dtstart datetime=2013-10-2727 October 2013/time, 10:27:44', + 'value' = '2013-10-27', 'source' = 'commons-desc-page', ), 'License' = diff --git a/tests/data/File_Sunrise_over_fishing_boats_in_Kerala.jpg.php b/tests/data/File_Sunrise_over_fishing_boats_in_Kerala.jpg.php index 5108133..65d3232 100644 --- a/tests/data/File_Sunrise_over_fishing_boats_in_Kerala.jpg.php +++ b/tests/data/File_Sunrise_over_fishing_boats_in_Kerala.jpg.php @@ -8,7 +8,7 @@ return array ( 'DateTimeOriginal' = array ( - 'value' = 'time class=dtstart datetime=2009-02-1818 February 2009/time' . \xc2\xa0 . '(according to a href=//en.wikipedia.org/wiki/Exchangeable_image_file_format class=extiw title=en:Exchangeable image file formatEXIF/a data)', + 'value' = '2009-02-18', 'source' = 'commons-desc-page', ), 'License' = -- To view, visit https://gerrit.wikimedia.org/r/181978 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib86865b9d049cace5e8710d2eb6c7d4a451cc673 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CommonsMetadata Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change view terms to hide terms once clicked - change (mediawiki...MultimediaViewer)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/182038 Change subject: Change view terms to hide terms once clicked .. Change view terms to hide terms once clicked metadataPanel overrides the grow() and shrink() methods in Permission class instance, so the text is changed also when user clicks the view more link inside the box. Bug: T71233 Change-Id: I66fe57980c6f469d86e3d52b67d01e06a3a14270 --- M MultimediaViewer.php M i18n/en.json M i18n/qqq.json M resources/mmv/ui/mmv.ui.metadataPanel.js M resources/mmv/ui/mmv.ui.permission.js M tests/qunit/mmv/ui/mmv.ui.permission.test.js 6 files changed, 51 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/38/182038/1 diff --git a/MultimediaViewer.php b/MultimediaViewer.php index 9f140cc..c0b4bef 100644 --- a/MultimediaViewer.php +++ b/MultimediaViewer.php @@ -594,6 +594,7 @@ // for license messages see end of file 'multimediaviewer-permission-link', + 'multimediaviewer-permission-link-hide', 'multimediaviewer-geoloc-north', 'multimediaviewer-geoloc-east', diff --git a/i18n/en.json b/i18n/en.json index 388561d..1f09e3b 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -38,6 +38,7 @@ multimediaviewer-license-default: View license, multimediaviewer-permission-title: Permission details, multimediaviewer-permission-link: view terms, + multimediaviewer-permission-link-hide: hide terms, multimediaviewer-permission-viewmore: View more, multimediaviewer-about-mmv: About Media Viewer, multimediaviewer-discuss-mmv: Discuss this feature, diff --git a/i18n/qqq.json b/i18n/qqq.json index 613061f..d849f7b 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -44,7 +44,8 @@ multimediaviewer-license-pd: Very short label for Public Domain images, used in a link to the file information page that has more licensing information.\n{{Identical|Public domain}}, multimediaviewer-license-default: Short label for a link to generic license information., multimediaviewer-permission-title: Title of the box containing additional permission (by the copyright owner via OTRS) terms, - multimediaviewer-permission-link: Text of the link (on top of the metadata box) which shows additional permission (by the copyright owner via OTRS) terms, + multimediaviewer-permission-link: Text of the link (on top of the metadata box) which shows additional permission (by the copyright owner via OTRS) terms\n\nSee also:\n* {{msg-mw|multimediaviewer-permission-link-hide}}, + multimediaviewer-permission-link-hide: Text of the link (on top of the metadata box) which hides additional permission terms\n\nSee also:\n* {{msg-mw|multimediaviewer-permission-link}}, multimediaviewer-permission-viewmore: Text of the link (at the cutoff of the permission term preview) which shows additional permission (by the copyright owner via OTRS) terms.\n{{Identical|View more}}, multimediaviewer-about-mmv: Text for a link to a page with more information about Media Viewer software., multimediaviewer-discuss-mmv: Text for a link to a page where the user can discuss the Media Viewer software., diff --git a/resources/mmv/ui/mmv.ui.metadataPanel.js b/resources/mmv/ui/mmv.ui.metadataPanel.js index 08092df..7b1b428 100644 --- a/resources/mmv/ui/mmv.ui.metadataPanel.js +++ b/resources/mmv/ui/mmv.ui.metadataPanel.js @@ -321,10 +321,29 @@ .appendTo( this.$licenseLi ) .hide() .on( 'click', function() { - panel.permission.grow(); - panel.scroller.toggle( 'up' ); + if ( panel.permission.isFullSize() ) { + panel.permission.shrink(); + } else { + panel.permission.grow(); + panel.scroller.toggle( 'up' ); + } return false; } ); + // override grow() and shrink() of Permission box so the text in $permissionLink is updated, + // regardless of whether the user clicked our link, or the View more link inside the box + var that = this; + panel.permission._grow = panel.permission.grow; + panel.permission.grow = function() { + that.$permissionLink + .text( mw.message( 'multimediaviewer-permission-link-hide' ).text() ); + this._grow(); + }; + panel.permission._shrink =
[MediaWiki-commits] [Gerrit] Display preview file format - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/181749 Change subject: Display preview file format .. Display preview file format The file format is displayed only if it is different than the file format of the original file. Bug: T58546 Change-Id: Ic2e21a836840c47fd47a621132f7019e7a5bd4f7 --- M images/.htaccess M images/README M includes/page/ImagePage.php M languages/i18n/en.json M languages/i18n/qqq.json 5 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/49/181749/1 diff --git a/images/.htaccess b/images/.htaccess old mode 100644 new mode 100755 diff --git a/images/README b/images/README old mode 100644 new mode 100755 diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index b9f99c8..6c9f411 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -388,6 +388,21 @@ params( count( $otherSizes ) )-parse() ); } + + # Get the file format (extension) of the preview and display it + $params['width'] = $width; + $params['height'] = $height; + $thumbnail = $this-displayImg-transform( $params ); + if ( $thumbnail !$thumbnail-isError() +$thumbnail-getExtension() != $this-displayImg-getExtension() ) { + $msgsmall .= ' ' . + Html::rawElement( 'span', array( 'class' = 'mw-filepage-preview-format' ), + wfMessage( 'show-big-image-format' )- + params( strtoupper( $thumbnail-getExtension() ), + count( $otherSizes ) + 1 + )-parse() + ); + } } elseif ( $width == 0 $height == 0 ) { # Some sort of audio file that doesn't have dimensions # Don't output a no hi res message for such a file diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 2ee3df2..a37c1de 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2600,6 +2600,7 @@ show-big-image: Original file, show-big-image-preview: Size of this preview: $1., show-big-image-other: Other {{PLURAL:$2|resolution|resolutions}}: $1., + show-big-image-format: {{PLURAL:$2|The preview is|The previews are}} rendered as $1., show-big-image-size: $1 × $2 pixels, file-info-gif-looped: looped, file-info-gif-frames: $1 {{PLURAL:$1|frame|frames}}, diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 813064d..e26f9768 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2762,8 +2762,9 @@ svg-long-desc-animated: Displayed under an SVG image at the image description page if the image is animated.\n* $1 - the width in pixels\n* $2 - the height in pixels\n* $3 - the file size including a unit (for example \10 KB\)\nNon-animated images use {{msg-mw|svg-long-desc}}., svg-long-error: Displayed for invalid SVG file metadata. Parameters:\n* $1 - the error message\nSee also:\n* {{msg-mw|Thumbnail error}}, show-big-image: Displayed under the file on file description pages, when a reduced-size thumbnail of the original file is being displayed.\n{{Identical|Original file}}, - show-big-image-preview: Message shown under the image description page thumbnail.\n\nCan be followed by {{msg-mw|Show-big-image-other}}.\n\nParameters:\n* $1 - a link which points to the thumbnail. Its text is {{msg-mw|Show-big-image-size}}, - show-big-image-other: Message shown under the image description page thumbnail.\n\nPreceded by {{msg-mw|Show-big-image-preview}}, if the image is in high resolution.\n\nParameters:\n* $1 - list of resolutions (pipe-separated)\n* $2 - number of resolutions, + show-big-image-preview: Message shown under the image description page thumbnail.\n\nFollowed by {{msg-mw|Show-big-image-format}}, and can be followed by {{msg-mw|Show-big-image-other}}.\n\nParameters:\n* $1 - a link which points to the thumbnail. Its text is {{msg-mw|Show-big-image-size}}, + show-big-image-other: Message shown under the image description page thumbnail.\n\nPreceded by
[MediaWiki-commits] [Gerrit] Make account exists message more user-friendly - change (mediawiki...CentralAuth)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/181751 Change subject: Make account exists message more user-friendly .. Make account exists message more user-friendly Bug: T75123 Change-Id: I981632b6d10801e5e69daf7fb87b11c90d6e8967 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/51/181751/1 diff --git a/i18n/en.json b/i18n/en.json index 14eea08..9052937 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -213,7 +213,7 @@ centralauth-invalid-wiki: No such wiki database: $1, centralauth-account-exists: Cannot create account: The requested username is already taken in the unified login system., centralauth-account-unattached-exists: Cannot create account: The requested username would conflict with another username in the unified login system., - centralauth-account-rename-exists: Cannot create account: The requested username would conflict with another username in the unified login system., + centralauth-account-rename-exists: Cannot create account: The requested username is already taken by a user on another wiki., centralauth-account-exists-reset: The username $1 is not registered on this wiki, but you can reset its password on [[Special:CentralAuth/$1|a wiki where it is]]., centralauth-login-progress: Logging you in to wikis of {{int:Centralauth-groupname}}:, centralauth-logout-progress: Logging you out from other wikis of {{int:Centralauth-groupname}}:, -- To view, visit https://gerrit.wikimedia.org/r/181751 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I981632b6d10801e5e69daf7fb87b11c90d6e8967 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update CC BY conditions message - change (mediawiki...WikimediaMessages)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/181776 Change subject: Update CC BY conditions message .. Update CC BY conditions message Information about the requirement of providing the link to license text was added. Bug: T75387 Change-Id: I8c3137466074de8a7597d49dddb3a48b165e9080 --- M i18n/cclicensetexts/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages refs/changes/76/181776/1 diff --git a/i18n/cclicensetexts/en.json b/i18n/cclicensetexts/en.json index a610c00..2b2930e 100644 --- a/i18n/cclicensetexts/en.json +++ b/i18n/cclicensetexts/en.json @@ -208,7 +208,7 @@ wm-license-cc-free-to-remix-text: to adapt the work, wm-license-cc-conditions: Under the following conditions:, wm-license-cc-conditions-attribution-header: attribution, -wm-license-cc-conditions-attribution-text: You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work)., +wm-license-cc-conditions-attribution-text: You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work) and provide a link to the license text., wm-license-cc-conditions-share_alike-header: share alike, wm-license-cc-conditions-share_alike-text: If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one., wm-license-cc-pd-mark-link: https://creativecommons.org/publicdomain/mark/1.0/deed.en;, -- To view, visit https://gerrit.wikimedia.org/r/181776 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c3137466074de8a7597d49dddb3a48b165e9080 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMessages Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove index on br_user_email in bounce_records - change (mediawiki...BounceHandler)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/181626 Change subject: Remove index on br_user_email in bounce_records .. Remove index on br_user_email in bounce_records The index is dropped and a new one (only on br_timestamp) is created instead. Bug: T85214 Change-Id: I1fdd033b6088c506c7f5ec41feaddf8febfcad56 --- M BounceHandlerHooks.php M sql/bounce_records.sql M sql/create_index.sql A sql/drop_mail_timestamp_index.sql 4 files changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler refs/changes/26/181626/1 diff --git a/BounceHandlerHooks.php b/BounceHandlerHooks.php index 35f8998..11b4f62 100644 --- a/BounceHandlerHooks.php +++ b/BounceHandlerHooks.php @@ -85,7 +85,10 @@ public static function LoadExtensionSchemaUpdates( DatabaseUpdater $updater ) { $updater-addExtensionTable( 'bounce_records', __DIR__ . '/sql/bounce_records.sql', true ); $updater-modifyExtensionField( 'bounce_records', 'br_user', __DIR__ . '/sql/alter_user_column.sql' ); - $updater-addExtensionIndex( 'bounce_records', 'br_mail_timestamp', __DIR__ .'/sql/create_index.sql' ); + $updater-dropExtensionIndex( 'bounce_records', 'br_mail_timestamp', + __DIR__ . '/sql/drop_mail_timestamp_index.sql' ); + $updater-addExtensionIndex( 'bounce_records', 'br_timestamp', + __DIR__ . '/sql/create_index.sql' ); return true; } diff --git a/sql/bounce_records.sql b/sql/bounce_records.sql index e1e6b17..d24c2ad 100644 --- a/sql/bounce_records.sql +++ b/sql/bounce_records.sql @@ -9,4 +9,4 @@ br_reason VARCHAR(255)NOT NULL -- Failure reasons )/*$wgDBTableOptions*/; -CREATE INDEX /*i*/br_mail_timestamp ON /*_*/bounce_records(br_user_email(50), br_timestamp); +CREATE INDEX /*i*/br_timestamp ON /*_*/bounce_records(br_timestamp); diff --git a/sql/create_index.sql b/sql/create_index.sql index 263ce9a..759e53e 100644 --- a/sql/create_index.sql +++ b/sql/create_index.sql @@ -3,6 +3,4 @@ -- Author: Tony Thomas, Legoktm, Jeff Green -CREATE INDEX /*i*/br_mail_timestamp ON /*_*/bounce_records(br_user_email(50), br_timestamp); - - +CREATE INDEX /*i*/br_timestamp ON /*_*/bounce_records(br_timestamp); diff --git a/sql/drop_mail_timestamp_index.sql b/sql/drop_mail_timestamp_index.sql new file mode 100644 index 000..b4fc953 --- /dev/null +++ b/sql/drop_mail_timestamp_index.sql @@ -0,0 +1,4 @@ +-- MySQL version of the database schema for removing br_mail_timestamp index for the BounceHandler extension. +-- Licence: GNU GPL v2+ + +ALTER TABLE /*_*/bounce_records DROP INDEX /*i*/br_mail_timestamp; -- To view, visit https://gerrit.wikimedia.org/r/181626 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1fdd033b6088c506c7f5ec41feaddf8febfcad56 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BounceHandler Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add unit test for isbn script - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/181427 Change subject: Add unit test for isbn script .. Add unit test for isbn script Bug: T72336 Change-Id: I006570c68e83c52ae5cb0051ad7336eb5e02f93f --- A tests/isbn_tests.py 1 file changed, 81 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/27/181427/1 diff --git a/tests/isbn_tests.py b/tests/isbn_tests.py new file mode 100644 index 000..bf15f15 --- /dev/null +++ b/tests/isbn_tests.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +Tests for isbn script. +# +# (C) Pywikibot team, 2014 +# +# Distributed under the terms of the MIT license. +# +__version__ = '$Id$' + +import unittest +from scripts.isbn import ISBN10, ISBN13, InvalidIsbnException as IsbnExc, \ +getIsbn, hyphenateIsbnNumbers, convertIsbn10toIsbn13 +from tests.aspects import TestCase + + +class TestIsbn(TestCase): +net = False + +Test ISBN-related classes and helper functions. + +def test_isbn10(self): +Test ISBN10. +# Test general features +isbn = ISBN10('097522980x') +isbn.format() +self.assertEqual(isbn.code, '0-9752298-0-X') +self.assertEqual(isbn.digits(), + ['0', '9', '7', '5', '2', '2', '9', '8', '0', 'X']) + +# Converting to ISBN13 +isbn13 = isbn.toISBN13() +self.assertEqual(isbn13.code, '978-0-9752298-0-4') + +# Errors +self.assertRaises(IsbnExc, ISBN10, '0975229LOL') # Invalid characters +self.assertRaises(IsbnExc, ISBN10, '0975229801') # Invalid checksum +self.assertRaises(IsbnExc, ISBN10, '09752298') # Invalid length +self.assertRaises(IsbnExc, ISBN10, '09752X9801') # X in the middle + +def test_isbn13(self): +Test ISBN13. +# Test general features +isbn = ISBN13('9783161484100') +isbn.format() +self.assertEqual(isbn.code, '978-3-16-148410-0') +self.assertEqual(isbn.digits(), + [9, 7, 8, 3, 1, 6, 1, 4, 8, 4, 1, 0, 0]) + +# Errors +self.assertRaises(IsbnExc, ISBN13, '9783161484LOL') # Invalid chars +self.assertRaises(IsbnExc, ISBN13, '9783161484105') # Invalid checksum +self.assertRaises(IsbnExc, ISBN13, '9783161484') # Invalid length + +def test_general(self): +Test things that apply both to ISBN10 and ISBN13. +# getIsbn +self.assertIsInstance(getIsbn('097522980x'), ISBN10) +self.assertIsInstance(getIsbn('9783161484100'), ISBN13) +self.assertRaises(IsbnExc, getIsbn, '097522') + +# hyphenateIsbnNumbers +self.assertEqual(hyphenateIsbnNumbers('ISBN 097522980x'), + 'ISBN 0-9752298-0-X') +self.assertEqual(hyphenateIsbnNumbers('ISBN 0975229801'), + 'ISBN 0975229801') # Invalid ISBN - no changes + +# convertIsbn10toIsbn13 +self.assertEqual(convertIsbn10toIsbn13('ISBN 0-9752298-0-X'), + 'ISBN 978-0-9752298-0-4') +self.assertEqual(convertIsbn10toIsbn13('ISBN 0-9752298-0-1'), + 'ISBN 0-9752298-0-1') # Invalid ISBN - no changes + +# Errors +isbn = ISBN10('9492098059') +self.assertRaises(IsbnExc, isbn.format) # Invalid group number +isbn = ISBN10('9095012042') +self.assertRaises(IsbnExc, isbn.format) # Invalid publisher number + + +if __name__ == __main__: +unittest.main() -- To view, visit https://gerrit.wikimedia.org/r/181427 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I006570c68e83c52ae5cb0051ad7336eb5e02f93f Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add i18n for API module help - change (mediawiki...PollNY)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/180776 Change subject: Add i18n for API module help .. Add i18n for API module help Bug: T76888 Change-Id: I1c7bf76a9c1808273c45bcc3f95847f36199 --- M ApiPollNY.php M i18n/en.json M i18n/qqq.json 3 files changed, 56 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PollNY refs/changes/76/180776/1 diff --git a/ApiPollNY.php b/ApiPollNY.php index 1cc38f5..f61cbc6 100644 --- a/ApiPollNY.php +++ b/ApiPollNY.php @@ -211,7 +211,7 @@ } /** -* @return String: human-readable module description +* @deprecated since MediaWiki core 1.25 */ public function getDescription() { return 'PollNY API - includes both user and admin functions'; @@ -244,7 +244,9 @@ ); } - // Describe the parameter + /** +* @deprecated since MediaWiki core 1.25 +*/ public function getParamDescription() { return array_merge( parent::getParamDescription(), array( 'what' = 'What to do?', @@ -256,7 +258,9 @@ ) ); } - // Get examples + /** +* @deprecated since MediaWiki core 1.25 +*/ public function getExamples() { return array( 'api.php?action=pollnywhat=deletepollID=66' = 'Deletes the poll #66', @@ -267,4 +271,24 @@ 'api.php?action=pollnywhat=votepollID=33choiceID=4' = 'Votes (answers) the poll #33 with the 4th choice', ); } -} \ No newline at end of file + + /** +* @see ApiBase::getExamplesMessages() +*/ + protected function getExamplesMessages() { + return array( + 'action=pollnywhat=deletepollID=66' + = 'apihelp-pollny-example-1', + 'action=pollnywhat=getPollResultspollID=666' + = 'apihelp-pollny-example-2', + 'action=pollnywhat=getRandom' + = 'apihelp-pollny-example-3', + 'action=pollnywhat=titleExistspageName=Is%20PollNY%20awesome%3F' + = 'apihelp-pollny-example-4', + 'action=pollnywhat=updateStatuspollID=47status=1' + = 'apihelp-pollny-example-5', + 'action=pollnywhat=votepollID=33choiceID=4' + = 'apihelp-pollny-example-6' + ); + } +} diff --git a/i18n/en.json b/i18n/en.json index ba654bb..3f4e5dc 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -91,5 +91,18 @@ poll-time-minutes: {{PLURAL:$1|one minute|$1 minutes}}, poll-time-seconds: {{PLURAL:$1|one second|$1 seconds}}, specialpages-group-poll: Polls, -right-polladmin: Administer polls +right-polladmin: Administer polls, +apihelp-pollny-description: PollNY API - includes both user and admin functions., +apihelp-pollny-param-what: What to do?, +apihelp-pollny-param-choiceID: Same as clicking the choiceIDth choice via the GUI; only used when what=vote., +apihelp-pollny-param-pageName: Title to check for (only used when what=titleExists); should be URL-encoded., +apihelp-pollny-param-pollID: Poll ID of the poll that is being deleted/updated/voted for., +apihelp-pollny-param-pageID: Page ID (only used when what=getPollResults)., +apihelp-pollny-param-status: New status of the poll (when what=updateStatus); possible values are 0 (=closed), 1 and 2 (=flagged)., +apihelp-pollny-example-1: Deletes the poll #66, +apihelp-pollny-example-2: Gets the results of the poll #666, +apihelp-pollny-example-3: Gets a random poll to which the current user hasn't answered yet, +apihelp-pollny-example-4: Checks if there is already a poll with the title \Is PollNY awesome?\, +apihelp-pollny-example-5: Sets the status of the poll #47 to 1 (=open); possible status values are 0 (=closed), 1 and 2 (=flagged), +apihelp-pollny-example-6: Votes (answers) the poll #33 with the 4th choice } diff --git a/i18n/qqq.json b/i18n/qqq.json index b502890..e1104ed 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -93,5 +93,18 @@ poll-time-minutes: Used as code$1/code in the following messages:\n* {{msg-mw|Poll-ago}}\n* {{msg-mw|Poll-time-ago}}\nParameters:\n* $1 - number of minutes\n{{Related|Poll-time}}\n{{Identical|Minute}}, poll-time-seconds: Used as code$1/code in the following messages:\n* {{msg-mw|Poll-ago}}\n* {{msg-mw|Poll-time-ago}}\nParameters:\n* $1 - number of seconds\n{{Related|Poll-time}}\n{{Identical|Second}}, specialpages-group-poll: {{doc-special-group}}\n{{Identical|Poll}}, - right-polladmin: {{doc-right|polladmin}} +
[MediaWiki-commits] [Gerrit] Fix preferences ('gear') icons to be consistent - change (mediawiki...UniversalLanguageSelector)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/180527 Change subject: Fix preferences ('gear') icons to be consistent .. Fix preferences ('gear') icons to be consistent Resources are based on: https://www.mediawiki.org/wiki/File:Gear_icon.svg made by MGalloway. Bug: T52843 Bug: T76515 Change-Id: Iabd3139fcdb033712550a3d61a8cc96fe90ee57c --- M resources/images/cog-sprite.png M resources/images/cog-sprite.svg M resources/images/cog.png M resources/images/cog.svg 4 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/27/180527/1 diff --git a/resources/images/cog-sprite.png b/resources/images/cog-sprite.png index 7dd54f6..66e83c8 100644 --- a/resources/images/cog-sprite.png +++ b/resources/images/cog-sprite.png Binary files differ diff --git a/resources/images/cog-sprite.svg b/resources/images/cog-sprite.svg index 76becd4..a98a974 100644 --- a/resources/images/cog-sprite.svg +++ b/resources/images/cog-sprite.svg @@ -1 +1,2 @@ -?xml version=1.0 encoding=UTF-8?svg xmlns=http://www.w3.org/2000/svg; xmlns:xlink=http://www.w3.org/1999/xlink; width=14 height=32defspath d=M13.582 6.632h-1.064c-.133-.538-.354-1.065-.645-1.552l.75-.75c.164-.164.164-.429 0-.593l-1.359-1.36c-.164-.164-.43-.164-.594 0l-.75.75c-.49-.294-1.012-.512-1.551-.645v-1.064c0-.231-.187-.418-.419-.418h-1.918c-.231 0-.418.187-.418.418v1.063c-.541.135-1.062.352-1.552.646l-.75-.75c-.164-.164-.429-.164-.593 0l-1.36 1.36c-.164.164-.164.429 0 .593l.75.75c-.292.488-.494 1.015-.627 1.551h-1.064c-.231 0-.418.187-.418.419v1.918c0 .231.187.418.418.418h1.046c.134.542.351 1.062.645 1.551l-.75.75c-.164.164-.164.429 0 .593l1.36 1.36c.164.164.429.164.593 0l.75-.75c.491.296 1.01.493 1.551.627v1.063c.001.233.188.42.419.42h1.918c.231 0 .419-.187.419-.418v-1.063c.542-.134 1.061-.333 1.551-.627l.75.75c.164.164.43.164.594 0l1.359-1.36c.164-.164.164-.429 0-.593l-.75-.75c.295-.489.51-1.013.645-1.551h1.064c.23-.002.418-.189.418-.42v-1.918c0-.232-.188-.418-.418-.418zm-6.582 4.012c-1.461 0-2.645-1.184-2.645-2.644s1.184-2.644 2.645-2.644 2.645 1.184 2.645 2.644-1.184 2.644-2.645 2.644z id=a//defsuse xlink:href=#a fill=#808080/use xlink:href=#a transform=translate(0 16) fill=#555//svg \ No newline at end of file +?xml version=1.0 encoding=UTF-8? +svg xmlns=http://www.w3.org/2000/svg; width=14 height=32defspath d=M13.582 6.632h-1.064c-.133-.538-.354-1.065-.645-1.552l.75-.75c.164-.164.164-.43 0-.593l-1.36-1.36c-.163-.164-.43-.164-.593 0l-.75.75c-.49-.294-1.012-.512-1.55-.645V1.418c0-.23-.188-.418-.42-.418H6.032c-.23 0-.418.187-.418.418V2.48c-.54.136-1.062.353-1.552.647l-.75-.75c-.164-.164-.43-.164-.593 0l-1.36 1.36c-.166.164-.166.43 0 .593l.75.75c-.294.488-.496 1.015-.63 1.55H.42c-.23 0-.418.188-.418.42v1.918c0 .23.187.418.418.418h1.046c.134.542.35 1.062.645 1.55l-.75.75c-.166.165-.166.43 0 .594l1.36 1.36c.162.164.427.164.59 0l.75-.75c.49.296 1.01.493 1.55.627v1.063c.003.233.19.42.42.42h1.92c.23 0 .42-.187.42-.418V13.52c.54-.135 1.06-.334 1.55-.628l.75.75c.164.164.43.164.594 0l1.36-1.36c.163-.164.163-.43 0-.593l-.75-.75c.294-.49.51-1.015.644-1.553h1.064c.23-.002.418-.19.418-.42V7.05c0-.232-.188-.418-.418-.418zM7 10.644C5.54 10.644 4.355 9.46 4.355 8S5.54 5.356 7 5.356 9.645 6.54 9.645 8 8.46 10.644 7 10.644z//defspath d=M14 9.3V6.73l-1.575-.264c-.117-.44-.292-.848-.496-1.2l.932-1.285-1.81-1.84-1.31.907c-.38-.205-.79-.38-1.197-.497L8.283 1H5.717l-.263 1.578c-.437.117-.816.293-1.196.497L2.975 2.17 1.137 3.98l.934 1.287c-.202.38-.377.79-.494 1.228L0 6.73V9.3l1.575.264c.117.438.292.818.496 1.198l-.93 1.315 1.807 1.812 1.312-.937c.38.205.787.38 1.224.497L5.746 15h2.566l.263-1.578c.408-.117.817-.293 1.196-.497l1.314.935 1.81-1.812-.935-1.315c.203-.38.38-.76.495-1.2L14 9.303zm-7 1.404c-1.488 0-2.683-1.2-2.683-2.69S5.542 5.327 7 5.327c1.458 0 2.683 1.198 2.683 2.69 0 1.49-1.195 2.688-2.683 2.688z fill=#808080/path d=M14 25.3v-2.57l-1.575-.264c-.117-.44-.292-.848-.496-1.2l.932-1.285-1.81-1.84-1.31.907c-.38-.205-.79-.38-1.197-.497L8.283 17H5.717l-.263 1.578c-.437.117-.816.293-1.196.497l-1.283-.906-1.838 1.81.934 1.286c-.202.38-.377.79-.494 1.228L0 22.73v2.57l1.575.264c.117.438.292.818.496 1.198l-.93 1.315 1.807 1.812 1.312-.937c.38.205.787.38 1.224.497L5.746 31h2.566l.263-1.578c.408-.117.817-.293 1.196-.497l1.314.935 1.81-1.812-.935-1.315c.203-.38.38-.76.495-1.2l1.545-.23zm-7 1.404c-1.488 0-2.683-1.2-2.683-2.69S5.542 21.327 7 21.327c1.458 0 2.683 1.198 2.683 2.69 0 1.49-1.195 2.688-2.683 2.688z fill=#555//svg diff --git a/resources/images/cog.png b/resources/images/cog.png index 7d48155..21de5c4 100644 --- a/resources/images/cog.png +++ b/resources/images/cog.png Binary files differ diff --git a/resources/images/cog.svg b/resources/images/cog.svg index edfbbf3..2a342f1 100644 --- a/resources/images/cog.svg +++ b/resources/images/cog.svg
[MediaWiki-commits] [Gerrit] Add id=mw-wikilove-overlay to dialog div - change (mediawiki...WikiLove)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/180238 Change subject: Add id=mw-wikilove-overlay to dialog div .. Add id=mw-wikilove-overlay to dialog div Bug: T78475 Change-Id: I54092c5b50ecb20aeb21712d42aa8fbc6dc2b93d --- M resources/ext.wikiLove.core.js 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLove refs/changes/38/180238/1 diff --git a/resources/ext.wikiLove.core.js b/resources/ext.wikiLove.core.js index d8c90e8..bb2fa23 100644 --- a/resources/ext.wikiLove.core.js +++ b/resources/ext.wikiLove.core.js @@ -159,6 +159,7 @@ modal: true, resizable: false }); + $dialog.parent().attr( 'id', 'mw-wikilove-overlay' ); $( '#mw-wikilove-button-preview' ).text( mw.msg( 'wikilove-button-preview' ) ); $( '#mw-wikilove-button-send' ).text( mw.msg( 'wikilove-button-send' ) ); -- To view, visit https://gerrit.wikimedia.org/r/180238 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54092c5b50ecb20aeb21712d42aa8fbc6dc2b93d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiLove Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace deprecated wfMsg() and friends - change (mediawiki...Farmer)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/180366 Change subject: Replace deprecated wfMsg() and friends .. Replace deprecated wfMsg() and friends Bug: 68750 Change-Id: I48ba5b5710eac6300d71fde65c6c7fffec61af95 --- M SpecialFarmer.php 1 file changed, 26 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Farmer refs/changes/66/180366/1 diff --git a/SpecialFarmer.php b/SpecialFarmer.php index 7a9fe15..94d55d8 100644 --- a/SpecialFarmer.php +++ b/SpecialFarmer.php @@ -148,13 +148,13 @@ $wgOut-addHtml( Xml::openElement( 'table', array( 'class' = 'wikitable' ) ) . \n . Xml::tags( 'tr', array(), Xml::tags( 'th', array(), - wfMsgExt( 'farmer-confirmsetting-name', 'parseinline' ) ) . Xml::element( 'td', array(), $name ) ) . \n . + wfMessage( 'farmer-confirmsetting-name' )-parse() ) . Xml::element( 'td', array(), $name ) ) . \n . Xml::tags( 'tr', array(), Xml::tags( 'th', array(), - wfMsgExt( 'farmer-confirmsetting-title', 'parseinline' ) ) . Xml::element( 'td', array(), $title ) ) . \n . + wfMessage( 'farmer-confirmsetting-title' )-parse() ) . Xml::element( 'td', array(), $title ) ) . \n . Xml::tags( 'tr', array(), Xml::tags( 'th', array(), - wfMsgExt( 'farmer-confirmsetting-description', 'parseinline' ) ) . Xml::element( 'td', array(), $description ) ) . \n . + wfMessage( 'farmer-confirmsetting-description' )-parse() ) . Xml::element( 'td', array(), $description ) ) . \n . Xml::tags( 'tr', array(), Xml::tags( 'th', array(), - wfMsgExt( 'farmer-confirmsetting-reason', 'parseinline' ) ) . Xml::element( 'td', array(), $reason ) ) . \n . + wfMessage( 'farmer-confirmsetting-reason' )-parse() ) . Xml::element( 'td', array(), $reason ) ) . \n . Xml::closeElement( 'table' ) ); $wgOut-addWikiMsg( 'farmer-confirmsetting-text', $name, $title, $url ); @@ -192,9 +192,9 @@ 'farmer-createwiki-form-text4' ); - $formURL = wfMsgHTML( 'farmercreateurl' ); - $formSitename = wfMsgHTML( 'farmercreatesitename' ); - $formNextStep = wfMsgHTML( 'farmercreatenextstep' ); + $formURL = wfMessage( 'farmercreateurl' )-escaped(); + $formSitename = wfMessage( 'farmercreatesitename' )-escaped(); + $formNextStep = wfMessage( 'farmercreatenextstep' )-escaped(); $token = htmlspecialchars( $wgUser-editToken() ); @@ -270,7 +270,7 @@ $wgOut-wrapWikiMsg( == $1 ==\n$2, 'farmer-delete-title', 'farmer-delete-text' ); $select = new XmlSelect( 'wpWiki', false, $wgRequest-getVal( 'wpWiki' ) ); - $select-addOption( wfMsg( 'farmer-delete-form' ), '-1' ); + $select-addOption( wfMessage( 'farmer-delete-form' )-text(), '-1' ); foreach ( $list as $wiki ) { if ( $wiki['name'] != $wgFarmer-getDefaultWiki() ) { $name = $wiki['name']; @@ -282,7 +282,7 @@ $wgOut-addHTML( Xml::openElement( 'form', array( 'method' = 'post', 'name' = 'deleteWiki' ) ) . \n . $select-getHTML() . \n . - Xml::submitButton( wfMsg( 'farmer-delete-form-submit' ) ) . \n . + Xml::submitButton( wfMessage( 'farmer-delete-form-submit' )-text() ) . \n . Xml::closeElement( 'form' ) ); } @@ -378,10 +378,10 @@ $wgOut-addWikiMsg( 'farmer-basic-permission-visitor-text' ); $doArray = array( - array( 'read', wfMsg( 'right-read' ) ), - array( 'edit', wfMsg( 'right-edit' ) ), - array( 'createpage', wfMsg( 'right-createpage' ) ), - array( 'createtalk', wfMsg( 'right-createtalk' ) ) + array( 'read', wfMessage( 'right-read' )-text() ), + array( 'edit', wfMessage( 'right-edit' )-text() ), + array( 'createpage', wfMessage( 'right-createpage' )-text() ), + array(
[MediaWiki-commits] [Gerrit] Fix NoSuchSite error on multi-lang sites that have 'test' la... - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/179599 Change subject: Fix NoSuchSite error on multi-lang sites that have 'test' language family. .. Fix NoSuchSite error on multi-lang sites that have 'test' language family. Bug: T71255 Change-Id: Id83b6cc040e7dbdff4164f587fba057338c51bdb --- M pywikibot/site.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/99/179599/1 diff --git a/pywikibot/site.py b/pywikibot/site.py index aea95ca..b6b26b5 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -443,8 +443,8 @@ # no such language anymore self.obsolete = True elif self.__code not in self.languages(): -if self.__family.name in list(self.__family.langs.keys()) and \ - len(self.__family.langs) == 1: +if (self.__family.name in list(self.__family.langs.keys()) and +len(set(self.__family.langs) - {'test'}) == 1): oldcode = self.__code self.__code = self.__family.name if self.__family == pywikibot.config.family \ -- To view, visit https://gerrit.wikimedia.org/r/179599 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id83b6cc040e7dbdff4164f587fba057338c51bdb Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement wbsearchentities - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/179586 Change subject: Implement wbsearchentities .. Implement wbsearchentities 'wbsearchentities' API request was implemented as search_entities method in DataSite class. WikibaseSearchItemPageGenerator was created which yields the pages from the newly created method, regarding the language code specified in new data_lang config variable. Also, fixed a bug that caused NoSuchSite error on multi-lang sites that have 'test' language family. Bug: T68949 Bug: T71255 Change-Id: Ib7459a4b7c6bafe04d56dcd09ee0f8386711b4cf --- M pywikibot/config2.py M pywikibot/pagegenerators.py M pywikibot/site.py M tests/pagegenerators_tests.py M tests/site_tests.py 5 files changed, 131 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/86/179586/1 diff --git a/pywikibot/config2.py b/pywikibot/config2.py index 2a2be84..cdb130d 100644 --- a/pywikibot/config2.py +++ b/pywikibot/config2.py @@ -53,6 +53,10 @@ # If family and mylang are not modified from the above, the default is changed # to test:test, which is test.wikipedia.org, at the end of this module. +# The language to retrieve data for, used in case of multi-language sites ( +# like Wikidata) +data_lang = 'en' + # The dictionary usernames should contain a username for each site where you # have a bot account. Please set your usernames by adding such lines to your # user-config.py: diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index f3ef025..c4c070a 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -187,6 +187,11 @@ -wikidataqueryTakes a WikidataQuery query string like claim[31:12280] and works on the resulting pages. +-searchitem Takes a search string and works on Wikibase pages that + contain it. + Argument can be given as -searchentity:text, where text + is the string to look for. + -random Work on random pages returned by [[Special:Random]]. Can also be given as -random:n where n is the number of pages to be returned, otherwise the default is 10 pages. @@ -593,6 +598,11 @@ imagelinksPage = pywikibot.Page(pywikibot.Link(imagelinkstitle, self.site)) gen = ImagesPageGenerator(imagelinksPage) +elif arg.startswith('-searchitem'): +text = arg[len('-searchitem:'):] +if not text: +text = pywikibot.input(u'Text to look for:') +gen = WikibaseSearchItemPageGenerator(text, site=self.site) elif arg.startswith('-search'): mediawikiQuery = arg[8:] if not mediawikiQuery: @@ -2149,6 +2159,32 @@ yield pywikibot.Page(pywikibot.Link(link, site)) +def WikibaseSearchItemPageGenerator(text, language=None, total=50, site=None): + +Generate pages that contain the provided text. + +@param text: Text to look for. +@type text: str +@param language: Code of the language to search in. If not specified, +value from pywikibot.config.data_lang is used. +@type language: str +@param total: Maximum number of pages to retrieve in total. +@type total: int +@param site: Site for generator results. +@type site: L{pywikibot.site.BaseSite} + +if site is None: +site = pywikibot.Site() +if language is None: +language = pywikibot.config.data_lang +repo = site.data_repository() + +data = repo.search_entities(text, language, limit=total) +pywikibot.output(u'retrieved %d items' % len(data)) +for item in data: +yield pywikibot.ItemPage(repo, item['id']) + + if __name__ == __main__: pywikibot.output(u'Pagegenerators cannot be run as script - are you ' u'looking for listpages.py?') diff --git a/pywikibot/site.py b/pywikibot/site.py index aea95ca..b17c572 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -443,13 +443,14 @@ # no such language anymore self.obsolete = True elif self.__code not in self.languages(): -if self.__family.name in list(self.__family.langs.keys()) and \ - len(self.__family.langs) == 1: +if (self.__family.name in list(self.__family.langs.keys()) and +len(set(self.__family.langs) - {'test'}) == 1): oldcode = self.__code self.__code = self.__family.name if self.__family == pywikibot.config.family \ and oldcode == pywikibot.config.mylang: pywikibot.config.mylang = self.__code +pywikibot.config.data_lang = oldcode else: raise UnknownSite(Language
[MediaWiki-commits] [Gerrit] Add ItemClaimFilterPageGenerator - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/179158 Change subject: Add ItemClaimFilterPageGenerator .. Add ItemClaimFilterPageGenerator The generator filters ItemPages which doesn't contain a specified claim. Can be used via the -onlyif command line option. Bug: T69568 Bug: T57005 Change-Id: I850f1063016fd0c8845c9509634f85b1830724ef --- M pywikibot/pagegenerators.py M tests/pagegenerators_tests.py 2 files changed, 135 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/58/179158/1 diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index e5c0e31..5893712 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -223,6 +223,14 @@ Case insensitive regular expressions will be used and dot matches any character, including a newline. +-onlyif A claim the page needs to contain, otherwise the item won't + be returned. + The format is property:value,qualifier=value. Multiple (or + none) qualifiers can be passed, separated by commas. + The argument can be provided multiple times and the item + page will be returned only if all of the claims are present. + Argument can be also given as -onlyif:expression. + -intersectWork on the intersection of all the provided generators. @@ -258,6 +266,7 @@ self.step = None self.limit = None self.articlefilter_list = [] +self.claimfilter_list = [] self.intersect = False self._site = site @@ -311,6 +320,14 @@ else: gensList = CombinedPageGenerator(self.gens) dupfiltergen = DuplicateFilterPageGenerator(gensList) + +if self.claimfilter_list: +dupfiltergen = PreloadingItemGenerator(dupfiltergen) +for claim in self.claimfilter_list: +dupfiltergen = ItemClaimFilterPageGenerator(dupfiltergen, +claim[0], +claim[1], +claim[2]) if self.articlefilter_list: return RegexBodyFilterPageGenerator( @@ -589,6 +606,17 @@ u'Which pattern do you want to grep?')) else: self.articlefilter_list.append(arg[6:]) +return True +elif arg.startswith('-onlyif'): +if len(arg) == 7: +claim = pywikibot.input(u'Which claim do you want to filter?') +else: +claim = arg[8:] +temp = [] +for arg in claim.split(','): +temp.append(arg.split('=')) +self.claimfilter_list.append((temp[0][0], temp[0][1], + dict(temp[1:]))) return True elif arg.startswith('-yahoo'): gen = YahooSearchPageGenerator(arg[7:], site=self.site) @@ -1099,6 +1127,50 @@ yield page +def ItemClaimFilterPageGenerator(generator, prop, claim, qualifiers): + +Yield all ItemPages which does contain certain claim in provided property. + +@param prop: property id to check +@type prop: str +@param claim: value of the property to check. Can be exact value (for +instance, ItemPage instance) or ItemPage ID string (e.g. 'Q37470'). +@param qualifiers: dict of qualifiers that must be present, or None if +qualifiers are irrelevant +@type qualifiers: dict or None + +for page in generator: +if not isinstance(page, pywikibot.ItemPage): +continue +for page_claim in page.get()['claims'][prop]: +if page_claim.target == claim or \ +(isinstance(page_claim.target, pywikibot.ItemPage) and + page_claim.target.id == claim): +if not qualifiers: +yield page +continue + +found_all = True +for prop, val in qualifiers.items(): +if prop in page_claim.qualifiers: +found = False +for page_val in page_claim.qualifiers[prop]: +if page_val.target == val or \ +(isinstance(page_val.target, +pywikibot.ItemPage) and + page_val.target.id == val): +found = True +break +if not found: +found_all = False +break +else: +
[MediaWiki-commits] [Gerrit] Optimize assets added in changeset 178048 - change (mediawiki...Vector)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/178468 Change subject: Optimize assets added in changeset 178048 .. Optimize assets added in changeset 178048 Bug: T56307 Change-Id: I802146e62860dfd74384dc63c12afd42a0f36df0 --- M images/unwatch-icon.png M images/unwatch-icon.svg M images/watch-icon.png M images/watch-icon.svg 4 files changed, 10 insertions(+), 46 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector refs/changes/68/178468/1 diff --git a/images/unwatch-icon.png b/images/unwatch-icon.png index ccade3e..b705887 100644 --- a/images/unwatch-icon.png +++ b/images/unwatch-icon.png Binary files differ diff --git a/images/unwatch-icon.svg b/images/unwatch-icon.svg index 0f4a348..f1d61d3 100644 --- a/images/unwatch-icon.svg +++ b/images/unwatch-icon.svg @@ -1,24 +1,6 @@ -?xml version=1.0 encoding=UTF-8 standalone=no? -!-- Created with Inkscape (http://www.inkscape.org/) -- - -svg - xmlns:dc=http://purl.org/dc/elements/1.1/; - xmlns:cc=http://creativecommons.org/ns#; - xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; - xmlns:svg=http://www.w3.org/2000/svg; - xmlns=http://www.w3.org/2000/svg; - version=1.1 - width=16 - height=16 - viewBox=0 0 16 16 - id=Layer_1 - xml:space=preservemetadata - id=metadata11rdf:RDFcc:Work - rdf:about=dc:formatimage/svg+xml/dc:formatdc:type - rdf:resource=http://purl.org/dc/dcmitype/StillImage; /dc:title/dc:title/cc:Work/rdf:RDF/metadatadefs - id=defs9 /g - transform=matrix(0.50724409,0,0,0.50724409,-1.65435e-7,0.39133865) - id=g3polygon - points=20.646,9.875 31.543,11.458 23.656,19.145 25.518,29.996 15.771,24.873 6.024,30 7.886,19.145 0,11.459 10.898,9.876 15.771,0 - id=polygon5 - style=fill:#00af89 //g/svg \ No newline at end of file +?xml version=1.0 encoding=UTF-8? +svg xmlns=http://www.w3.org/2000/svg; width=16 height=16 viewBox=0 0 16 16 +g +path fill=#00af89 d=M20.646 9.875L31.543 11.458 23.656 19.145 25.518 29.996 15.771 24.873 6.024 30 7.886 19.145 0 11.459 10.898 9.876 15.771 0z transform=matrix(.507 0 0 .507 0 .391)/ +/g +/svg diff --git a/images/watch-icon.png b/images/watch-icon.png index 3fdac0e..a5dde3e 100644 --- a/images/watch-icon.png +++ b/images/watch-icon.png Binary files differ diff --git a/images/watch-icon.svg b/images/watch-icon.svg index 2015f1d..0369128 100644 --- a/images/watch-icon.svg +++ b/images/watch-icon.svg @@ -1,22 +1,4 @@ -?xml version=1.0 encoding=UTF-8 standalone=no? -!-- Created with Inkscape (http://www.inkscape.org/) -- - -svg - xmlns:dc=http://purl.org/dc/elements/1.1/; - xmlns:cc=http://creativecommons.org/ns#; - xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; - xmlns:svg=http://www.w3.org/2000/svg; - xmlns=http://www.w3.org/2000/svg; - version=1.1 - width=16 - height=16 - viewBox=0 0 16 16 - id=Layer_1 - xml:space=preservemetadata - id=metadata9rdf:RDFcc:Work - rdf:about=dc:formatimage/svg+xml/dc:formatdc:type - rdf:resource=http://purl.org/dc/dcmitype/StillImage; /dc:title/dc:title/cc:Work/rdf:RDF/metadatadefs - id=defs7 /path - d=m 7.999493,3.57443 1.2092315,2.44992 0.3276693,0.66396 0.7329442,0.10601 2.703526,0.3931 -1.956379,1.90718 -0.530053,0.51636 0.124778,0.73091 0.461577,2.69287 L 8.6543243,11.76363 7.9989857,11.4177 7.3436471,11.76363 4.925184,13.03474 5.3867615,10.34035 5.5115396,9.61096 4.9819935,9.0946 3.0266295,7.18691 5.7291404,6.79483 6.4620849,6.6878 6.7897542,6.02536 7.999493,3.57443 m 0,-3.18285 L 5.5272636,5.40147 0,6.20492 3.9994929,10.10246 3.0550343,15.60842 7.9989857,13.00888 12.943444,15.60842 12.000508,10.10246 16,6.2039 10.471722,5.40096 7.999493,0.39158 l 0,0 z - id=path3 - style=fill:#6d6e70 //svg \ No newline at end of file +?xml version=1.0 encoding=UTF-8? +svg xmlns=http://www.w3.org/2000/svg; width=16 height=16 viewBox=0 0 16 16 +path d=m 7.999493,3.57443 1.2092315,2.44992 0.3276693,0.66396 0.7329442,0.10601 2.703526,0.3931 -1.956379,1.90718 -0.530053,0.51636 0.124778,0.73091 0.461577,2.69287 L 8.6543243,11.76363 7.9989857,11.4177 7.3436471,11.76363 4.925184,13.03474 5.3867615,10.34035 5.5115396,9.61096 4.9819935,9.0946 3.0266295,7.18691 5.7291404,6.79483 6.4620849,6.6878 6.7897542,6.02536 7.999493,3.57443 m 0,-3.18285 L 5.5272636,5.40147 0,6.20492 3.9994929,10.10246 3.0550343,15.60842 7.9989857,13.00888 12.943444,15.60842 12.000508,10.10246 16,6.2039 10.471722,5.40096 7.999493,0.39158 l 0,0 z fill=#6d6e70/ +/svg -- To view, visit https://gerrit.wikimedia.org/r/178468 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I802146e62860dfd74384dc63c12afd42a0f36df0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Vector Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___
[MediaWiki-commits] [Gerrit] Display error when user tries to create self-redirect - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/178238 Change subject: Display error when user tries to create self-redirect .. Display error when user tries to create self-redirect Bug: T29683 Change-Id: Idcd7a50d12c8f124bc447805654b1a9e86dee3e4 --- M includes/EditPage.php M languages/i18n/en.json M languages/i18n/qqq.json 3 files changed, 38 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/38/178238/1 diff --git a/includes/EditPage.php b/includes/EditPage.php index 4a013ef..e330dbb 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -151,6 +151,12 @@ const AS_NO_CHANGE_CONTENT_MODEL = 235; /** +* Status: user tried to create self-redirect (redirect to the same article) and +* wpIgnoreSelfRedirect == false +*/ + const AS_SELF_REDIRECT = 236; + + /** * Status: can't parse content */ const AS_PARSE_ERROR = 240; @@ -165,7 +171,6 @@ * The revision id edited is added after this */ const POST_EDIT_COOKIE_KEY_PREFIX = 'PostEditRevision'; - /** * Duration of PostEdit cookie, in seconds. * The cookie will be removed instantly if the JavaScript runs. @@ -186,7 +191,6 @@ /** @var Title */ public $mTitle; - /** @var null|Title */ private $mContextTitle = null; @@ -255,6 +259,12 @@ /** @var bool */ protected $allowBlankArticle = false; + + /** @var bool */ + protected $selfRedirect = false; + + /** @var bool */ + protected $allowSelfRedirect = false; /** @var string */ public $autoSumm = ''; @@ -848,6 +858,7 @@ $this-autoSumm = $request-getText( 'wpAutoSummary' ); $this-allowBlankArticle = $request-getBool( 'wpIgnoreBlankArticle' ); + $this-allowSelfRedirect = $request-getBool( 'wpIgnoreSelfRedirect' ); } else { # Not a posted form? Start with nothing. wfDebug( __METHOD__ . : Not a posted form.\n ); @@ -1334,6 +1345,7 @@ case self::AS_MAX_ARTICLE_SIZE_EXCEEDED: case self::AS_END: case self::AS_BLANK_ARTICLE: + case self::AS_SELF_REDIRECT: return true; case self::AS_HOOK_ERROR: @@ -1901,6 +1913,19 @@ $status-value = self::AS_SUCCESS_UPDATE; } + $redirectTarget = $content-getRedirectTarget()-getPrefixedText(); + $title = $this-getTitle()-getPrefixedText(); + if ( !$this-allowSelfRedirect +$content-isRedirect() +$redirectTarget == $title + ) { + $this-selfRedirect = true; + $status-fatal( 'selfredirect' ); + $status-value = self::AS_SELF_REDIRECT; + wfProfileOut( __METHOD__ ); + return $status; + } + // Check for length errors again now that the section is merged in $this-kblength = (int)( strlen( $this-toEditText( $content ) ) / 1024 ); if ( $this-kblength $wgMaxArticleSize ) { @@ -2430,6 +2455,7 @@ $wgOut-addHTML( Html::hidden( 'nosummary', true ) ); } + # If a blank edit summary was previously provided, and the appropriate # user preference is active, pass a hidden tag as wpIgnoreBlankSummary. This will stop the # user being bounced back more than once in the event that a summary @@ -2443,6 +2469,10 @@ if ( $this-undidRev ) { $wgOut-addHTML( Html::hidden( 'wpUndidRevision', $this-undidRev ) ); + } + + if ( $this-selfRedirect ) { + $wgOut-addHTML( Html::hidden( 'wpIgnoreSelfRedirect', true ) ); } if ( $this-hasPresetSummary ) { @@ -2609,6 +2639,10 @@ $wgOut-wrapWikiMsg( div id='mw-blankarticle'\n$1\n/div, 'blankarticle' ); } + if ( $this-selfRedirect ) { + $wgOut-wrapWikiMsg( div id='mw-selfredirect'\n$1\n/div, 'selfredirect' ); + } + if ( $this-hookError !== '' ) { $wgOut-addWikiText( $this-hookError ); } diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 4b4188d..34cc07a 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -590,6 +590,7 @@ anoneditwarning:
[MediaWiki-commits] [Gerrit] Replace desktop watchstar icon with mobile skin one - change (mediawiki...Vector)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/178048 Change subject: Replace desktop watchstar icon with mobile skin one .. Replace desktop watchstar icon with mobile skin one Also, replaces the old animation with the same as in the mobile skin. Bug: T56307 Change-Id: Ida98e080dd26b0354884eee2af3269c6228e3a75 --- M components/watchstar.less D images/unwatch-icon-hl.png D images/unwatch-icon-hl.svg M images/unwatch-icon.png M images/unwatch-icon.svg D images/watch-icon-hl.png D images/watch-icon-hl.svg D images/watch-icon-loading.png D images/watch-icon-loading.svg M images/watch-icon.png M images/watch-icon.svg 11 files changed, 54 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector refs/changes/48/178048/1 diff --git a/components/watchstar.less b/components/watchstar.less index a389ed6..44dfbba 100644 --- a/components/watchstar.less +++ b/components/watchstar.less @@ -15,33 +15,26 @@ height: 0; overflow: hidden; background-position: 5px 60%; + + -webkit-transform-origin: 50% 57%; // Chrome 4-36, Safari 3.2+, Opera 15-23 + transform-origin: 50% 57%; + .transition(transform .5s); + /* Suppress the hilarious rotating focus outline on Firefox */ + outline: none; } #ca-unwatch.icon a { .background-image-svg('images/unwatch-icon.svg', 'images/unwatch-icon.png'); + .transform-rotate(72deg); } #ca-watch.icon a { .background-image-svg('images/watch-icon.svg', 'images/watch-icon.png'); } -#ca-unwatch.icon a:hover, -#ca-unwatch.icon a:focus { - .background-image-svg('images/unwatch-icon-hl.svg', 'images/unwatch-icon-hl.png'); -} -#ca-watch.icon a:hover, -#ca-watch.icon a:focus { - .background-image-svg('images/watch-icon-hl.svg', 'images/watch-icon-hl.png'); -} #ca-unwatch.icon a.loading, #ca-watch.icon a.loading { - .background-image-svg('images/watch-icon-loading.svg', 'images/watch-icon-loading.png'); - .rotation(700ms); - /* Suppress the hilarious rotating focus outline on Firefox */ - outline: none; cursor: default; pointer-events: none; - background-position: 50% 60%; - -webkit-transform-origin: 50% 57%; - transform-origin: 50% 57%; } + #ca-unwatch.icon a span, #ca-watch.icon a span { display: none; diff --git a/images/unwatch-icon-hl.png b/images/unwatch-icon-hl.png deleted file mode 100644 index 6b2b502..000 --- a/images/unwatch-icon-hl.png +++ /dev/null Binary files differ diff --git a/images/unwatch-icon-hl.svg b/images/unwatch-icon-hl.svg deleted file mode 100644 index d52d547..000 --- a/images/unwatch-icon-hl.svg +++ /dev/null @@ -1 +0,0 @@ -?xml version=1.0 encoding=UTF-8?svg xmlns=http://www.w3.org/2000/svg; xmlns:xlink=http://www.w3.org/1999/xlink; width=16 height=16defslinearGradient id=astop offset=0 stop-color=#c2edff/stop offset=.5 stop-color=#68bdff/stop offset=1 stop-color=#fff//linearGradientlinearGradient x1=13.47 y1=14.363 x2=4.596 y2=3.397 id=b xlink:href=#a gradientUnits=userSpaceOnUse//defspath d=M8.103 1.146l2.175 4.408 4.864.707-3.52 3.431.831 4.845-4.351-2.287-4.351 2.287.831-4.845-3.52-3.431 4.864-.707z fill=url(#b) stroke=#c8b250 stroke-width=0.1999//svg \ No newline at end of file diff --git a/images/unwatch-icon.png b/images/unwatch-icon.png index 9fd9436..ccade3e 100644 --- a/images/unwatch-icon.png +++ b/images/unwatch-icon.png Binary files differ diff --git a/images/unwatch-icon.svg b/images/unwatch-icon.svg index cde7bc5..0f4a348 100644 --- a/images/unwatch-icon.svg +++ b/images/unwatch-icon.svg @@ -1 +1,24 @@ -?xml version=1.0 encoding=UTF-8?svg xmlns=http://www.w3.org/2000/svg; xmlns:xlink=http://www.w3.org/1999/xlink; width=16 height=16defslinearGradient id=astop offset=0 stop-color=#c2edff/stop offset=.5 stop-color=#68bdff/stop offset=1 stop-color=#fff//linearGradientlinearGradient x1=13.47 y1=14.363 x2=4.596 y2=3.397 id=b xlink:href=#a gradientUnits=userSpaceOnUse//defspath d=M8.103 1.146l2.175 4.408 4.864.707-3.52 3.431.831 4.845-4.351-2.287-4.351 2.287.831-4.845-3.52-3.431 4.864-.707z fill=url(#b) stroke=#7cb5d1 stroke-width=0.1999//svg \ No newline at end of file +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + version=1.1 + width=16 + height=16 + viewBox=0 0 16 16 + id=Layer_1 + xml:space=preservemetadata + id=metadata11rdf:RDFcc:Work + rdf:about=dc:formatimage/svg+xml/dc:formatdc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage;
[MediaWiki-commits] [Gerrit] Add status codes parsing - change (mediawiki...BounceHandler)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/177456 Change subject: Add status codes parsing .. Add status codes parsing Extension now looks for status code returned by SMTP server and differentiates between permanent and temporary failures. Sticks to RFC3464 whenever possible and uses heuristic way to obtain the status code otherwise. Change-Id: Ice9d580ba81d7f3575a37267e97f33a9dafdcef5 --- M includes/ProcessBounceEmails.php M includes/ProcessBounceWithRegex.php M tests/ProcessBounceWithRegexTest.php A tests/bounce_emails/emailStatus A tests/bounce_emails/emailStatus2 5 files changed, 230 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler refs/changes/56/177456/1 diff --git a/includes/ProcessBounceEmails.php b/includes/ProcessBounceEmails.php index 13609de..58e0633 100644 --- a/includes/ProcessBounceEmails.php +++ b/includes/ProcessBounceEmails.php @@ -149,11 +149,26 @@ * @return bool */ protected function checkPermanentFailure( $emailHeaders ) { - $permanentFailure = $emailHeaders[ 'x-failed-recipients' ]; - if ( $permanentFailure == null ) { - return false; - } else { + if ( isset( $emailHeaders['status'] ) ) { + $status = explode( '.', $emailHeaders['status'] ); + if ( $status[0] == 5 ) { + // According to RFC1893 status codes starting with 5 mean Permanent Failures + return true; + } else { + return false; + } + } elseif ( isset( $emailHeaders['smtp-status'] ) ) { + if ( $emailHeaders['smtp-status'] = 500 ) { + return true; + } else { + return false; + } + } elseif ( isset( $emailHeaders['x-failed-recipients'] ) ) { + // If not status code was found, let's presume that the presence of + // X-Failed-Recipients means permanent failure return true; + } else { + return false; } } diff --git a/includes/ProcessBounceWithRegex.php b/includes/ProcessBounceWithRegex.php index c651e34..09b8858 100644 --- a/includes/ProcessBounceWithRegex.php +++ b/includes/ProcessBounceWithRegex.php @@ -16,6 +16,49 @@ } /** +* Parse the single part of delivery status message +* +* @param array $partLines array of strings that contain single lines of the email part +* @return string|null String that contains the status code or null if it wasn't found +*/ + private function parseMessagePart( $partLines ) { + foreach ( $partLines as $partLine ) { + if ( preg_match( /^Content-Type: (.+)/, $partLine, $contentTypeMatch ) ) { + if ( $contentTypeMatch[1] != 'message/delivery-status' ) { + break; + } + } + if ( preg_match( /^Status: (\\d\\.\\d{1,3}\\.\\d{1,3})/, $partLine, $statusMatch ) ) { + return $statusMatch[1]; + } + } + return null; + } + + /** +* Parse the multi-part delivery status message (DSN) according to RFC3464 +* +* @param array $emailLines array of strings that contain single lines of the email +* @return string|null String that contains the status code or null if it wasn't found +*/ + private function parseDeliveryStatusMessage( $emailLines ) { + for ( $i = 0; $i count( $emailLines ) - 1; ++$i ) { + $line = $emailLines[$i] . \n . $emailLines[$i + 1]; + if ( preg_match( /Content-Type: multipart\\/report;\\s*report-type=delivery-status;\\s*boundary=\(.+?)\/, + $line, $contentTypeMatch ) ) { + $partIndices = array_keys( $emailLines, --$contentTypeMatch[1] ); + foreach ( $partIndices as $index ) { + $result = $this-parseMessagePart( array_slice( $emailLines, $index ) ); + if ( !is_null( $result ) ) { + return $result; + } + } + } + } + return null; + } + + /** * Extract headers from the received bounce
[MediaWiki-commits] [Gerrit] Fix group separator in installer's sidebar - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/176721 Change subject: Fix group separator in installer's sidebar .. Fix group separator in installer's sidebar Uses explode() to split the sections and puts correct separators between them. Bug: T39362 Change-Id: I9a287b6ac206debb9bd93dbfad0703a8fad0931f --- M includes/installer/WebInstallerOutput.php 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/176721/1 diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index 22fb1df..8ff3d2f 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -296,11 +296,14 @@ href=https://www.mediawiki.org/; title=Main Page/a /div - div class=portaldiv class=body ?php - echo $this-parent-parse( wfMessage( 'config-sidebar' )-plain(), true ); + $message = wfMessage( 'config-sidebar' )-plain(); + foreach( explode( '', $message ) as $section ) { + echo 'div class=portaldiv class=body'; + echo $this-parent-parse( $section, true ); + echo '/div/div'; + } ? - /div/div /div ?php -- To view, visit https://gerrit.wikimedia.org/r/176721 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9a287b6ac206debb9bd93dbfad0703a8fad0931f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace Powered by Mediawiki PNG image with SVG version - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/142860 Change subject: Replace Powered by Mediawiki PNG image with SVG version .. Replace Powered by Mediawiki PNG image with SVG version Bug: 63872 Change-Id: I451f8895805dcde7c231f0f4b1027cff6cae4ac6 --- M includes/DefaultSettings.php M includes/Setup.php M includes/Skin.php A skins/common/images/poweredby_mediawiki.svg D skins/common/images/poweredby_mediawiki_88x31.png 5 files changed, 287 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/60/142860/1 -- To view, visit https://gerrit.wikimedia.org/r/142860 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I451f8895805dcde7c231f0f4b1027cff6cae4ac6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add missing SVG icons - change (mediawiki...Translate)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/142868 Change subject: Add missing SVG icons .. Add missing SVG icons Add add.svg, remove.svg and help.svg. Replace 1 use of action-edit.png with action-edit.svg. Bug: 60948 Change-Id: Id76046f7af2c05f3dd5fa8cef44e9370cd9c7a2d --- M resources/css/ext.translate.helplink.css M resources/css/ext.translate.special.aggregategroups.css M resources/css/ext.translate.special.pagemigration.css A resources/images/add.svg A resources/images/help.svg A resources/images/remove.svg 6 files changed, 338 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/68/142868/1 diff --git a/resources/css/ext.translate.helplink.css b/resources/css/ext.translate.helplink.css index fd521b4..a473f5c 100644 --- a/resources/css/ext.translate.helplink.css +++ b/resources/css/ext.translate.helplink.css @@ -7,8 +7,10 @@ } .mw-translate-helplink a { - /* @embed */ background: url(../images/help.png) no-repeat scroll left center transparent; + background-image: -webkit-linear-gradient(transparent, transparent), url('../images/help.svg'); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url('../images/help.svg'); padding-left: 20px; float: right; } diff --git a/resources/css/ext.translate.special.aggregategroups.css b/resources/css/ext.translate.special.aggregategroups.css index 0468898..4345288 100644 --- a/resources/css/ext.translate.special.aggregategroups.css +++ b/resources/css/ext.translate.special.aggregategroups.css @@ -1,21 +1,28 @@ span.tp-aggregate-remove-ag-button, span.tp-aggregate-remove-button { - /* @embed */ background: url(../images/remove.png) no-repeat scroll left center transparent; + background-image: -webkit-linear-gradient(transparent, transparent), url('../images/remove.svg'); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url('../images/remove.svg'); padding: 10px; cursor: pointer; } span.tp-aggregate-edit-ag-button { - /* @embed */ background: url(../images/action-edit.png) no-repeat scroll left center transparent; + background-image: -webkit-linear-gradient(transparent, transparent), url('../images/action-edit.svg'); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url('../images/action-edit.svg'); + background-size: 18px 18px; padding: 10px; cursor: pointer; } a.tpt-add-new-group { - /* @embed */ background: url(../images/add.png) no-repeat scroll left center transparent; + background-image: -webkit-linear-gradient(transparent, transparent), url('../images/add.svg'); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url('../images/add.svg'); padding-left: 20px; } diff --git a/resources/css/ext.translate.special.pagemigration.css b/resources/css/ext.translate.special.pagemigration.css index adb999b..e512950 100644 --- a/resources/css/ext.translate.special.pagemigration.css +++ b/resources/css/ext.translate.special.pagemigration.css @@ -40,8 +40,9 @@ .mw-tpm-sp-action--delete { background: url('../images/remove.png') transparent no-repeat; - background-image: linear-gradient(transparent, transparent), url('../images/remove.png'); - background-image: -webkit-linear-gradient(transparent, transparent), url('../images/remove.png'); + background-image: -webkit-linear-gradient(transparent, transparent), url('../images/remove.svg'); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url('../images/remove.svg'); } .mw-tpm-sp-action--swap { @@ -52,8 +53,9 @@ .mw-tpm-sp-action--add { background: url('../images/add.png') transparent no-repeat; - background-image: linear-gradient(transparent, transparent), url('../images/add.png'); - background-image: -webkit-linear-gradient(transparent, transparent), url('../images/add.png'); + background-image: -webkit-linear-gradient(transparent, transparent), url('../images/add.svg'); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url('../images/add.svg'); } .mw-tpm-sp-error__message { diff --git a/resources/images/add.svg b/resources/images/add.svg new file mode 100644 index 000..efff358 --- /dev/null +++ b/resources/images/add.svg @@ -0,0 +1,137 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg;
[MediaWiki-commits] [Gerrit] Change link to Printable version to JS's print() - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/142822 Change subject: Change link to Printable version to JS's print() .. Change link to Printable version to JS's print() mediawiki.page.ready.js now changes the Printable version link to Print link which triggers window.print(). Bug: 22256 Change-Id: I7faecdbc2ddc0c15a9f31ca6414ede81fa93462a --- M resources/Resources.php M resources/src/mediawiki.page/mediawiki.page.ready.js 2 files changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/22/142822/1 diff --git a/resources/Resources.php b/resources/Resources.php index 4f854fb..de963c5 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1149,6 +1149,9 @@ 'mediawiki.util', ), 'targets' = array( 'desktop', 'mobile' ), + 'messages' = array( + 'print', + ), ), 'mediawiki.page.startup' = array( 'scripts' = 'resources/src/mediawiki.page/mediawiki.page.startup.js', diff --git a/resources/src/mediawiki.page/mediawiki.page.ready.js b/resources/src/mediawiki.page/mediawiki.page.ready.js index ccddb3e..566c51f 100644 --- a/resources/src/mediawiki.page/mediawiki.page.ready.js +++ b/resources/src/mediawiki.page/mediawiki.page.ready.js @@ -35,6 +35,12 @@ // Add accesskey hints to the tooltips mw.util.updateTooltipAccessKeys(); + // Replace Printable version link with Print + $( '#t-print a' ).text( mw.message( 'print' ) ).click( function() { + event.preventDefault(); + window.print(); + } ); + } ); }( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/142822 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7faecdbc2ddc0c15a9f31ca6414ede81fa93462a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/me... - change (mediawiki...UploadWizard)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/106291 Change subject: Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard into bug/42964 .. Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard into bug/42964 Conflicts: resources/mw.FlickrChecker.js Change-Id: I2a5b01e37a5dbcda9a8d43d71884283f0a3891d0 --- M resources/mw.FlickrChecker.js 1 file changed, 33 insertions(+), 62 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/91/106291/1 diff --git a/resources/mw.FlickrChecker.js b/resources/mw.FlickrChecker.js index 70fe3e2..12750e3 100644 --- a/resources/mw.FlickrChecker.js +++ b/resources/mw.FlickrChecker.js @@ -86,7 +86,39 @@ }, /** - HEAD (6685b5 Add support for more Flickr URLs) +* Returns a suggested filename for the image. +* Usually the filename is just the Flickr title plus an extension, but in case of name conflicts +* or empty title a unique filename is generated. +* @param {String} title image title on Flickr +* @param {number} id image id on Flickr +* @param {String} ownername owner name on Flickr +* @return {String} +*/ + getFilenameFromItem: function( title, id, ownername ) { + var fileName; + + if ( title === '' ) { + fileName = ownername + ' - ' + id + '.jpg'; + } else if ( mw.FlickrChecker.fileNames[title + '.jpg'] ) { + fileName = title + ' - ' + id + '.jpg'; + } else { + fileName = title + '.jpg'; + } + + return fileName; + }, + + /** +* Reserves a filename; used by mw.FlickrChecker.getFileNameFromItem() which tries to +* avoid returning a filename which is already reserved. +* This works even when the filename was reserved in a different FlickrChecker instance. +* @param {String} fileName +*/ + reserveFileName: function( fileName ) { + mw.FlickrChecker.fileNames[fileName] = true; + }, + + /* * Retrieves a list of photos in photostream and displays it. * @param {string} mode may be: 'favorites' - user's favorites are retrieved, * or 'stream' - user's photostream is retrieved @@ -248,40 +280,6 @@ * @param albumIdMatches result of this.url.match * @see {@link getPhotos} */ -=== -* Returns a suggested filename for the image. -* Usually the filename is just the Flickr title plus an extension, but in case of name conflicts -* or empty title a unique filename is generated. -* @param {String} title image title on Flickr -* @param {number} id image id on Flickr -* @param {String} ownername owner name on Flickr -* @return {String} -*/ - getFilenameFromItem: function( title, id, ownername ) { - var fileName; - - if ( title === '' ) { - fileName = ownername + ' - ' + id + '.jpg'; - } else if ( mw.FlickrChecker.fileNames[title + '.jpg'] ) { - fileName = title + ' - ' + id + '.jpg'; - } else { - fileName = title + '.jpg'; - } - - return fileName; - }, - - /** -* Reserves a filename; used by mw.FlickrChecker.getFileNameFromItem() which tries to -* avoid returning a filename which is already reserved. -* This works even when the filename was reserved in a different FlickrChecker instance. -* @param {String} fileName -*/ - reserveFileName: function( fileName ) { - mw.FlickrChecker.fileNames[fileName] = true; - }, - - BRANCH (4479ac Localisation updates from https://translatewiki.net.) getPhotoset: function( albumIdMatches ) { this.getPhotos( 'photoset', { method: 'flickr.photosets.getPhotos', @@ -311,7 +309,6 @@ nojsoncallback: 1, api_key: this.apiKey, format: 'json', - HEAD (6685b5 Add support for more Flickr URLs) extras: 'license, url_sq, owner_name, original_format, date_taken, geo' } ); $.getJSON( this.apiUrl, req, function ( data ) { @@ -323,14 +320,7 @@ } if ( photoset !== undefined ) { $.each( photoset.photo, function( i, item ){ - var flickrUpload, license, licenseValue, sameTitleExists; -=== - extras:
[MediaWiki-commits] [Gerrit] Add support for more Flickr URLs - change (mediawiki...UploadWizard)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/105393 Change subject: Add support for more Flickr URLs .. Add support for more Flickr URLs Added support for: * User Collections * User Photostreams * Group pools * User Galleries * User Favorites Bug: 42964 Change-Id: I470fc57f7575e71c40cbe9d6150beffeb13a874b --- M UploadWizard.i18n.php M resources/mw.FlickrChecker.js 2 files changed, 222 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/93/105393/1 diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php index 80f14e3..3180d14 100644 --- a/UploadWizard.i18n.php +++ b/UploadWizard.i18n.php @@ -51,7 +51,7 @@ 'mwe-upwiz-add-file-flickr-n' = 'Add more images from Flickr', 'mwe-upwiz-add-flickr-or' = 'Or' , 'mwe-upwiz-add-flickr' = 'Get from Flickr', - 'mwe-upwiz-flickr-input-placeholder' = 'Flickr image/photoset URL', + 'mwe-upwiz-flickr-input-placeholder' = 'Flickr URL', 'mwe-upwiz-select-flickr' = 'Upload selected images', 'mwe-upwiz-flickr-disclaimer1' = 'This form will load content hosted by flickr.com and subject to the Flickr [https://www.flickr.com/help/terms/ terms of use] and [https://www.flickr.com/help/privacy-policy/ privacy policy].', @@ -321,7 +321,7 @@ 'mwe-upwiz-license-external' = 'The file is under the following license on the source site $1: $2.', 'mwe-upwiz-license-external-invalid' = 'The file is under the following license on the source site $1: $2. Unfortunately, this wiki does not allow that license.', 'mwe-upwiz-license-photoset-invalid' = 'Unfortunately, no image in the photoset has a license appropriate to be used on this site.', - 'mwe-upwiz-url-invalid' = 'The URL entered points to an invalid or restricted $1 image or photoset and cannot be used.', + 'mwe-upwiz-url-invalid' = 'The URL entered is unsupported or points to an invalid or restricted $1 image or photoset and cannot be used.', 'mwe-upwiz-categories' = 'Categories', 'mwe-upwiz-categories-add' = 'Add another category', 'mwe-upwiz-category-will-be-added' = 'This category is not in use yet.', diff --git a/resources/mw.FlickrChecker.js b/resources/mw.FlickrChecker.js index f8b5a35..4e2d478 100644 --- a/resources/mw.FlickrChecker.js +++ b/resources/mw.FlickrChecker.js @@ -40,19 +40,34 @@ checkFlickr: function( flickrInputUrl ) { this.url = flickrInputUrl; var photoIdMatches = this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/([0-9]+)/), - albumIdMatches = this.url.match(/flickr\.com\/photos\/[^\/]+\/sets\/([0-9]+)/); + albumIdMatches = this.url.match(/flickr\.com\/photos\/[^\/]+\/sets\/([0-9]+)/), + userCollectionMatches = this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/collections\/?([0-9]+)?/), + userPhotostreamMatches = this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/([^\/]+)/), + groupPoolMatches = this.url.match(/flickr\.com\/groups\/[^\/]+\/pool\/?([^\/]+)?/), + userGalleryMatches = this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/galleries\/([0-9]+)/), + userFavoritesMatches = this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/([^\/]+)\/favorites/); if ( photoIdMatches === null ) { // try static urls photoIdMatches = this.url.match(/static\.?flickr\.com\/[^\/]+\/([0-9]+)_/); } - if ( albumIdMatches || photoIdMatches ) { + if ( albumIdMatches || photoIdMatches || userCollectionMatches || userPhotostreamMatches || + groupPoolMatches || userGalleryMatches || userFavoritesMatches ) { $( '#mwe-upwiz-upload-add-flickr-container' ).hide(); this.imageUploads = []; if ( albumIdMatches albumIdMatches[1] 0 ) { this.getPhotoset( albumIdMatches ); - } - if ( photoIdMatches photoIdMatches[1] 0 ) { + } else if ( photoIdMatches photoIdMatches[1] 0 ) { this.getPhoto( photoIdMatches ); + } else if ( userCollectionMatches ) { + this.getCollection( userCollectionMatches ); + } else if ( userFavoritesMatches userFavoritesMatches[1] ) { + this.getPhotostream( 'favorites', userPhotostreamMatches ); + } else if ( userGalleryMatches userGalleryMatches[1] ) { + this.getGallery( userGalleryMatches ); +
[MediaWiki-commits] [Gerrit] Add an ability to change the copyright warning in editor and... - change (mediawiki...MobileFrontend)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/104906 Change subject: Add an ability to change the copyright warning in editor and uploader .. Add an ability to change the copyright warning in editor and uploader * License for editor is now taken from LocalSettings.php * There's a way to hook into both license texts from code now Bug: 56639 Change-Id: Ib8a1ce46d8b3dc5ea444cc538e48be0cb280222f --- M MobileFrontend.i18n.php M MobileFrontend.php M includes/Resources.php A includes/modules/LicenseTextModule.php 4 files changed, 88 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/06/104906/1 diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php index e72f067..0b21467 100644 --- a/MobileFrontend.i18n.php +++ b/MobileFrontend.i18n.php @@ -305,7 +305,7 @@ 'mobile-frontend-photo-upload-error-file-type' = 'Please only upload images.', 'mobile-frontend-photo-upload-error-filename' = 'Error, please provide a more descriptive summary.', 'mobile-frontend-photo-upload-success-article' = 'Success! Your image is now live on this page.', - 'mobile-frontend-photo-license' = 'By uploading this image, you agree to our [//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to release your image under the [//creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 License].', + 'mobile-frontend-photo-license' = 'By uploading this image, you agree to release it under the [//creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 License].', 'mobile-frontend-photo-submit' = 'Submit', 'mobile-frontend-photo-cancel' = 'Cancel', 'mobile-frontend-photo-upload-user-count' = '{{PLURAL:$1|span1/span upload|span$1/span uploads}}', @@ -328,7 +328,10 @@ 'mobile-frontend-editor-save' = 'Save', 'mobile-frontend-editor-cancel' = 'Cancel', 'mobile-frontend-editor-keep-editing' = 'Keep editing', - 'mobile-frontend-editor-license' = 'By saving changes, you agree to our [//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to release your text under the [//creativecommons.org/licenses/by-sa/3.0/ CC BY-SA 3.0 License] and [//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License GFDL].', + 'mobile-frontend-editor-copyright' = Please note that all contributions to {{SITENAME}} are considered to be released under the $2 (see $1 for details). +'''Do not submit copyrighted work without permission!''', + 'mobile-frontend-editor-copyright2' = Please note that all contributions to {{SITENAME}} may be edited, altered, or removed by other contributors (see $1 for details). +'''Do not submit copyrighted work without permission!''', 'mobile-frontend-editor-placeholder' = 'This section is empty. Be the first to expand it!', 'mobile-frontend-editor-summary-placeholder' = 'Tell us what you changed (optional)', 'mobile-frontend-editor-cancel-confirm' = 'Do you really want to abandon your edit?', @@ -697,6 +700,15 @@ {{Identical|Privacy}}', 'mobile-frontend-footer-sitename' = 'Name of site', 'mobile-frontend-footer-license' = 'License shown in footer', + 'mobile-frontend-editor-copyright' = Copyright warning displayed under the edit box in editor. Parameters: +* $1 - link +* $2 - license name +'''See also''' +* {{msg-mw|Copyrightwarning}}, + 'mobile-frontend-editor-copyright2' = Copyright warning displayed under the edit box in editor +*$1 - license name +'''See also''' +* {{msg-mw|Copyrightwarning2}}, 'mobile-frontend-copyright' = A short sentence explaining that the content of the page is available under a particular license. Parameters: * $1 - license name '''See also''' @@ -922,7 +934,7 @@ 'mobile-frontend-photo-upload-error-file-type' = 'Text that displays when user tries to preview something that cannot be rendered in an img tag (e.g. mp3 or video)', 'mobile-frontend-photo-upload-error-filename' = 'Text that displays when an image fails to upload due to filename', 'mobile-frontend-photo-upload-success-article' = 'Text that displays when an image has been successfully added to a page.', - 'mobile-frontend-photo-license' = 'Text notifying user of license that image will be published under. You can change the URL to a local Wikipedia URL, but you cannot make it point to the country specific CC BY-SA 3.0 license.', + 'mobile-frontend-photo-license' = 'Text notifying user of license that image will be published under. You cannot make it point to the country specific CC BY-SA 3.0 license.', 'mobile-frontend-photo-submit' = 'Caption for the submit button on the image uplaod form. {{Identical|Submit}}',
[MediaWiki-commits] [Gerrit] Add support for new MobileFrontend copyright warnings - change (mediawiki...WikimediaMessages)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/104907 Change subject: Add support for new MobileFrontend copyright warnings .. Add support for new MobileFrontend copyright warnings Bug: 56639 Change-Id: Ia9d362063de362731a6ef5b86c2e2e9f20429d0c --- M WikimediaMessages.i18n.php M WikimediaMessages.php 2 files changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages refs/changes/07/104907/1 diff --git a/WikimediaMessages.i18n.php b/WikimediaMessages.i18n.php index dce7e01..2d15eff 100644 --- a/WikimediaMessages.i18n.php +++ b/WikimediaMessages.i18n.php @@ -249,6 +249,8 @@ See a href=https://wikimediafoundation.org/wiki/Terms_of_Use; title=Wikimedia Foundation Terms of UseTerms of Use/a for details.', 'wikimedia-copyrightwarning' = 'By clicking the {{int:savearticle}} button, you agree to the [https://wikimediafoundation.org/wiki/Terms_of_Use Terms of Use], and you irrevocably agree to release your contribution under the [https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License CC BY-SA 3.0 License] and the [https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License GFDL]. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.', + 'wikimedia-mobile-copyrightwarning' = 'By clicking the {{int:savearticle}} button, you agree to the [https://wikimediafoundation.org/wiki/Terms_of_Use Terms of Use], and you irrevocably agree to release your contribution under the [https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License CC BY-SA 3.0 License] and the [https://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License GFDL].', + 'wikimedia-mobile-photo-copyrightwarning' = 'By uploading this image, you agree to our [//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to release your image under the [//creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 License].', # Wikidata-specific messages 'wikibase-sitelinks-wikivoyage' = 'Wikivoyage pages linked to this item', @@ -571,6 +573,8 @@ Refers to {{msg-mw|Savearticle}}. {{Identical/Wikimedia-licensing}}', + 'wikimedia-mobile-copyrightwarning' = 'Editor copyright warning shown on mobile devices. Shorter version of {{msg-mw|wikimedia-copyrightwarning}}.', + 'wikimedia-mobile-photo-copyrightwarning' = 'Media upload copyright warning shown on mobile devices.', 'wikibase-sitelinks-wikivoyage' = 'Section heading on Wikidata item page for Wikivoyage site links', 'wikibase-sitelinks-commons' = 'Section heading on Wikidata item page for Wikimedia Commons site links', 'wikibase-sitelinks-sitename-commonswiki' = 'Name that should be shown in the first column of the sitelink table for Wikimedia Commons links. diff --git a/WikimediaMessages.php b/WikimediaMessages.php index 16e7192..75fc2fe 100644 --- a/WikimediaMessages.php +++ b/WikimediaMessages.php @@ -37,6 +37,8 @@ // with the CC/GFDL semi-dual license fun! $wgHooks['SkinCopyrightFooter'][] = 'efWikimediaSkinCopyrightFooter'; $wgHooks['EditPageCopyrightWarning'][] = 'efWikimediaEditPageCopyrightWarning'; + $wgHooks['EditPageMobileCopyrightWarning'][] = 'efWikimediaEditPageMobileCopyrightWarning'; + $wgHooks['UploadMobileCopyrightWarning'][] = 'efWikimediaUploadMobileCopyrightWarning'; } } @@ -45,6 +47,16 @@ return true; } +function efWikimediaEditPageMobileCopyrightWarning( $title, $msg ) { + $msg = array( 'wikimedia-mobile-copyrightwarning' ); + return true; +} + +function efWikimediaUploadMobileCopyrightWarning( $title, $msg ) { + $msg = array( 'wikimedia-mobile-photo-copyrightwarning' ); + return true; +} + /** * @param $title Title * @param $type -- To view, visit https://gerrit.wikimedia.org/r/104907 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9d362063de362731a6ef5b86c2e2e9f20429d0c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMessages Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl 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 main menu animation glitches - change (mediawiki...MobileFrontend)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/104775 Change subject: Fix main menu animation glitches .. Fix main menu animation glitches Bug: 56391 Change-Id: Ic81d6f38b7933a62c04165d503a8d40bd31ce698 --- M less/common/mainmenu.less 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/75/104775/1 diff --git a/less/common/mainmenu.less b/less/common/mainmenu.less index 0d7a7cd..de8a516 100644 --- a/less/common/mainmenu.less +++ b/less/common/mainmenu.less @@ -14,6 +14,10 @@ .box-sizing(border-box); position: relative; z-index: 3; + min-height: 100%; + // We need to ensure the content has a white background - otherwise it will + // overlap the menu during the main menu reveal/hide animation + background: #fff; } #mw-mf-page-left { @@ -22,6 +26,7 @@ display: none; /* JS only */ background: @mainMenuBackgroundColor; border-left: solid @menuBorder @menuBorderColor; + width: @menuWidth; .box-sizing( border-box ); } @@ -156,8 +161,6 @@ } #mw-mf-page-center { - // Since we change the color of the body tag above we need to ensure the content has a white background - background: #fff; position: absolute; height: 100%; // set border here (#mw-mf-page-left doesn't expand height) @@ -166,7 +169,6 @@ } #mw-mf-page-left { - width: @menuWidth; display: block; } @@ -178,21 +180,21 @@ // navigation enabled on bigger screens (tablets and desktop) @media (min-width: @wgMFDeviceWidthTablet) { + #mw-mf-page-left { + width: 20%; + } + body.navigation-enabled.alpha, body.navigation-enabled.beta { background: #fff; #mw-mf-page-center { - // override position: absolute from the general .navigation-enabled rule - // so that the main content is not clipped - position: relative; width: 80%; } #mw-mf-page-left { position: absolute; - width: 20%; } .position-fixed, -- To view, visit https://gerrit.wikimedia.org/r/104775 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic81d6f38b7933a62c04165d503a8d40bd31ce698 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove use of deprecated mwEditButtons property - change (mediawiki...LiquidThreads)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/104346 Change subject: Remove use of deprecated mwEditButtons property .. Remove use of deprecated mwEditButtons property Bug: 56935 Change-Id: I263eebc8efd901be60fdd8989e5c6170be2b2afb --- M lqt.js 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/46/104346/1 diff --git a/lqt.js b/lqt.js index add73dd..c237f64 100644 --- a/lqt.js +++ b/lqt.js @@ -226,8 +226,6 @@ } ); }; - mwEditButtons = []; - mw.loader.using( ['mediawiki.action.edit'], function () { if ( isIE7 ) { -- To view, visit https://gerrit.wikimedia.org/r/104346 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I263eebc8efd901be60fdd8989e5c6170be2b2afb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiquidThreads Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add You're already logged in information to Special:UserLogin - change (mediawiki...MobileFrontend)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/104378 Change subject: Add You're already logged in information to Special:UserLogin .. Add You're already logged in information to Special:UserLogin Bug: 56359 Change-Id: Id9cfac9fd482c6bb6524779f0be35411eff23d24 --- M includes/skins/UserLoginMobileTemplate.php 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/78/104378/1 diff --git a/includes/skins/UserLoginMobileTemplate.php b/includes/skins/UserLoginMobileTemplate.php index 20adc27..0748542 100644 --- a/includes/skins/UserLoginMobileTemplate.php +++ b/includes/skins/UserLoginMobileTemplate.php @@ -51,6 +51,14 @@ $login = Html::openElement( 'div', array( 'id' = 'mw-mf-login', 'class' = 'content' ) ); + if ( MobileContext::singleton()-isBetaGroupMember() $this-data['loggedin'] ) { + $loggedinAlert = Html::openElement ( 'div', array( 'class' = 'alert warning' ) ) . + wfMessage( 'userlogin-loggedin' )-text()-params( + $this-data['loggedinuser'] + )-parse() . + Html::closeElement ( 'div' ); + } + $form = Html::openElement( 'div', array() ) . Html::openElement( 'form', array( 'name' = 'userlogin', @@ -87,6 +95,9 @@ echo $login; $this-renderGuiderMessage(); $this-renderMessageHtml(); + if ( isset ( $loggedinAlert ) ) { + echo $loggedinAlert; + } echo $form; echo Html::closeElement( 'div' ); } -- To view, visit https://gerrit.wikimedia.org/r/104378 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9cfac9fd482c6bb6524779f0be35411eff23d24 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add 'You need cookies' message to 'Switch to desktop' link - change (mediawiki...MobileFrontend)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/104209 Change subject: Add 'You need cookies' message to 'Switch to desktop' link .. Add 'You need cookies' message to 'Switch to desktop' link * When user has JavaScript enabled, an alert is shown * Otherwise, (s)he is redirected to Special:MobileEnableCookies Bug: 51277 Change-Id: I29adc92c357f0e4a5ec0df95e77a951b0c29c50a --- M MobileFrontend.i18n.php M MobileFrontend.php M includes/MobileContext.php M includes/skins/SkinMobile.php A includes/specials/SpecialMobileEnableCookies.php M javascripts/modules/mf-stop-mobile-redirect.js 6 files changed, 42 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/09/104209/1 diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php index 3154f0a..b30278d 100644 --- a/MobileFrontend.i18n.php +++ b/MobileFrontend.i18n.php @@ -398,6 +398,10 @@ 'mobile-frontend-profile-description-placeholder' = 'Why do {{GENDER:$1|you}} edit? What do {{GENDER:$1|you}} want to improve? Share {{GENDER:$1|your}} interests with others.', 'mobile-frontend-profile-edit-summary' = 'Updating user profile introduction', + // Special:MobileEnableCookies + 'mobile-frontend-enable-cookies' = 'Cookies are not enabled!', + 'mobile-frontend-enable-cookies-message' = 'You don\'t seem to have cookies enabled. Please, enable them and try again.', + // geo not a hack 'mobile-frontend-geonotahack' = 'Near this page', diff --git a/MobileFrontend.php b/MobileFrontend.php index e5b9596..a762a78 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -68,6 +68,7 @@ 'SpecialUploads' = 'specials/SpecialUploads', 'SpecialUserProfile' = 'specials/SpecialUserProfile', + 'SpecialMobileEnableCookies' = 'specials/SpecialMobileEnableCookies', 'SpecialMobileHistory' = 'specials/SpecialMobileHistory', 'SpecialMobileUserlogin' = 'specials/SpecialMobileUserlogin', 'SpecialMobileDiff' = 'specials/SpecialMobileDiff', @@ -142,6 +143,7 @@ $wgHooks['OutputPageParserOutput'][] = 'MobileFrontendHooks::onOutputPageParserOutput'; $wgSpecialPages['MobileDiff'] = 'SpecialMobileDiff'; +$wgSpecialPages['MobileEnableCookies'] = 'SpecialMobileEnableCookies'; $wgSpecialPages['MobileEditor'] = 'SpecialMobileEditor'; $wgSpecialPages['MobileOptions'] = 'SpecialMobileOptions'; $wgSpecialPages['MobileMenu'] = 'SpecialMobileMenu'; diff --git a/includes/MobileContext.php b/includes/MobileContext.php index 2427584..824ae3f 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -793,6 +793,11 @@ * and set a cookie to keep them on that view for subsequent requests. */ public function toggleView( $view, $temporary = false ) { + if ( !$this-getRequest()-getCookie( 'mf_cookies_enabled' ) ) { + $this-getOutput()-redirect( SpecialPage::getTitleFor( 'MobileEnableCookies' )-getFullURL() ); + return; + } + global $wgMobileUrlTemplate; $url = $this-getTitle()-getFullURL(); @@ -839,7 +844,7 @@ /** * Determine whether or not we need to toggle the view, and toggle it */ - public function checkToggleView() { + public function checkToggleView() { $mobileAction = $this-getMobileAction(); if ( $mobileAction == 'toggle_view_desktop' ) { $this-toggleView( 'desktop' ); diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php index dd19524..c4e558b 100644 --- a/includes/skins/SkinMobile.php +++ b/includes/skins/SkinMobile.php @@ -114,6 +114,8 @@ $desktop = wfMessage( 'mobile-frontend-view-desktop' )-escaped(); $mobile = wfMessage( 'mobile-frontend-view-mobile' )-escaped(); + setcookie('mf_cookies_enabled', 'true', time()+60*60*24*30); + $switcherHtml = HTML h2{$this-getSitename()}/h2 ul diff --git a/includes/specials/SpecialMobileEnableCookies.php b/includes/specials/SpecialMobileEnableCookies.php new file mode 100644 index 000..d85892f --- /dev/null +++ b/includes/specials/SpecialMobileEnableCookies.php @@ -0,0 +1,14 @@ +?php + +class SpecialMobileEnableCookies extends MobileSpecialPage { + public function __construct() { + parent::__construct( 'MobileEnableCookies' ); + } + + public function execute( $par = '' ) { + $this-setHeaders(); + $out = $this-getOutput(); + $out-setPageTitle( wfMessage( 'mobile-frontend-enable-cookies' )-text() ); + $out-addHTML( wfMessage( 'mobile-frontend-enable-cookies-message' )-text() ); + } +} diff --git
[MediaWiki-commits] [Gerrit] Fix section hash url lost after reloading page in alpha - change (mediawiki...MobileFrontend)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/104314 Change subject: Fix section hash url lost after reloading page in alpha .. Fix section hash url lost after reloading page in alpha Bug: 57329 Change-Id: I4ff941de8663557009fda4fe46ae4bbf82074015 --- M javascripts/common/history-alpha.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/14/104314/1 diff --git a/javascripts/common/history-alpha.js b/javascripts/common/history-alpha.js index daacd71..5f299cd 100644 --- a/javascripts/common/history-alpha.js +++ b/javascripts/common/history-alpha.js @@ -28,7 +28,7 @@ currentUrl = mw.util.getUrl( title, M.query ); // initial history state does not contain title // run before binding to avoid nasty surprises - History.replaceState( null, title, currentUrl ); + History.replaceState( null, title, currentUrl + location.hash ); // Bind to future StateChange Events History.Adapter.bind( window, 'statechange', function(){ -- To view, visit https://gerrit.wikimedia.org/r/104314 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ff941de8663557009fda4fe46ae4bbf82074015 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix insertables matching - change (mediawiki...Translate)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/103743 Change subject: Fix insertables matching .. Fix insertables matching * Variable names containig hyphen aren't truncated now * Short number-only variable names (e.g. $1, $123) aren't matched now Bug: 58746 Bug: 58445 Change-Id: I292f0ba6195bd3a49408a90284e1c507910c83e5 --- M insertables/MediaWikiInsertablesSuggester.php M insertables/TranslatablePageInsertablesSuggester.php 2 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/43/103743/1 diff --git a/insertables/MediaWikiInsertablesSuggester.php b/insertables/MediaWikiInsertablesSuggester.php index 6abe66f..db3ba77 100644 --- a/insertables/MediaWikiInsertablesSuggester.php +++ b/insertables/MediaWikiInsertablesSuggester.php @@ -15,7 +15,7 @@ $insertables = array(); $matches = array(); - preg_match_all( '/\$[0-9]+/', $text, $matches, PREG_SET_ORDER ); + preg_match_all( '/\$[0-9]{6,}/', $text, $matches, PREG_SET_ORDER ); $new = array_map( function( $match ) { return new Insertable( $match[0], $match[0] ); }, $matches ); diff --git a/insertables/TranslatablePageInsertablesSuggester.php b/insertables/TranslatablePageInsertablesSuggester.php index 9836cc2..a4ca933 100644 --- a/insertables/TranslatablePageInsertablesSuggester.php +++ b/insertables/TranslatablePageInsertablesSuggester.php @@ -17,7 +17,8 @@ // allowed in a variable name, but here we are stricter to avoid too many // false positives. $matches = array(); - preg_match_all( '/\$([a-z0-9])+/', $text, $matches, PREG_SET_ORDER ); + preg_match_all( '/\$(([a-z]+[0-9-]+[a-z0-9-]*)|([0-9]+[a-z-]+[a-z0-9-]*)' + . '|([0-9]{6,})|([a-z]+))/', $text, $matches, PREG_SET_ORDER ); $new = array_map( function ( $match ) { // Numerical ones are already handled by parent if ( ctype_digit( $match[1] ) ) { -- To view, visit https://gerrit.wikimedia.org/r/103743 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I292f0ba6195bd3a49408a90284e1c507910c83e5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl 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 extra /div output creating invalid HTML - change (mediawiki...CleanChanges)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/103746 Change subject: Fix extra /div output creating invalid HTML .. Fix extra /div output creating invalid HTML Bug: 58439 Change-Id: I88e6d092519cd4a3e30a72af3d6345ff166346cf --- M CleanChanges_body.php 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CleanChanges refs/changes/46/103746/1 diff --git a/CleanChanges_body.php b/CleanChanges_body.php index 237147a..656a4a2 100644 --- a/CleanChanges_body.php +++ b/CleanChanges_body.php @@ -80,13 +80,6 @@ } /** -* @return string -*/ - public function endRecentChangesList() { - return parent::endRecentChangesList() . '/div'; - } - - /** * @param RCCacheEntry $rc * @return int */ -- To view, visit https://gerrit.wikimedia.org/r/103746 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88e6d092519cd4a3e30a72af3d6345ff166346cf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CleanChanges Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl 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 Test images category to upload-wizard_tests.py script - change (mediawiki...UploadWizard)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/103552 Change subject: Add Test images category to upload-wizard_tests.py script .. Add Test images category to upload-wizard_tests.py script Bug: 58914 Change-Id: Ie7aa53d53ed20a3dd9ee0b5fce6f5805b1009030 --- M test/api/upload-wizard_tests.py 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard refs/changes/52/103552/1 diff --git a/test/api/upload-wizard_tests.py b/test/api/upload-wizard_tests.py index 9051332..2b3488a 100644 --- a/test/api/upload-wizard_tests.py +++ b/test/api/upload-wizard_tests.py @@ -71,6 +71,7 @@ ignorewarnings: true, filename: Test-image-rosa-mx-15x15.png, comment: Test image uploaded via python script., +text: [[Category:Test images]], } req = wikitools.api.APIRequest(wiki, params) data = req.query() -- To view, visit https://gerrit.wikimedia.org/r/103552 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7aa53d53ed20a3dd9ee0b5fce6f5805b1009030 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UploadWizard Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix user-friendlyness of block confirmation screen - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/103351 Change subject: Fix user-friendlyness of block confirmation screen .. Fix user-friendlyness of block confirmation screen * Confirm block checkbox is now highlighted * Added check the box if you're sure message to the errors at the top Bug: 58783 Change-Id: I2b496d763a14fe47d7458525cb1e8bb9fa5788f6 --- M includes/specials/SpecialBlock.php M languages/messages/MessagesEn.php M languages/messages/MessagesPl.php M resources/Resources.php A resources/mediawiki.special/mediawiki.special.block.css 5 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/51/103351/1 diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index fa5ec29..2966315 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -303,7 +303,7 @@ if ( (string)$this-target === $this-getUser()-getName() ) { $fields['Confirm']['type'] = 'check'; unset( $fields['Confirm']['default'] ); - $this-preErrors[] = 'ipb-blockingself'; + $this-preErrors[] = array( 'ipb-blockingself', 'ipb-confirmblockself' ); } } @@ -630,7 +630,7 @@ if ( $target === $performer-getName() ( $data['PreviousTarget'] !== $target || !$data['Confirm'] ) ) { - return array( 'ipb-blockingself' ); + return array( 'ipb-blockingself', 'ipb-confirmblockself' ); } } elseif ( $type == Block::TYPE_RANGE ) { $userId = 0; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f645531..0e91d12 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3300,6 +3300,7 @@ 'blockipsuccesstext' = '[[Special:Contributions/$1|$1]] has been blocked.br / See the [[Special:BlockList|block list]] to review blocks.', 'ipb-blockingself'= 'You are about to block yourself! Are you sure you want to do that?', +'ipb-confirmblockself'= 'If you are sure you want to block yourself, please check the highlighted field at the bottom.', 'ipb-confirmhideuser' = 'You are about to block a user with hide user enabled. This will suppress the user\'s name in all lists and log entries. Are you sure you want to do that?', 'ipb-edit-dropdown' = 'Edit block reasons', 'ipb-unblock-addr'= 'Unblock $1', diff --git a/languages/messages/MessagesPl.php b/languages/messages/MessagesPl.php index 5d480f5..acc319f 100644 --- a/languages/messages/MessagesPl.php +++ b/languages/messages/MessagesPl.php @@ -2749,6 +2749,7 @@ 'blockipsuccesstext' = '[[Special:Contributions/$1|$1]] {{GENDER:$1|został zablokowany|została zablokowana}}.br / Przejdź do [[Special:BlockList|listy blokad]], by przejrzeć blokady.', 'ipb-blockingself' = 'Usiłujesz zablokować siebie samego! Czy na pewno chcesz to zrobić?', +'ipb-confirmblockself' = 'Jeśli jesteś pewien, że chcesz się zablokować, zaznacz wyróżnione pole na dole.', 'ipb-confirmhideuser' = 'Zamierzasz zablokować użytkownika z włączoną opcją „ukryj użytkownika”. Spowoduje to pominięcie nazwy użytkownika we wszystkich listach i rejestrach. Czy na pewno chcesz to zrobić?', 'ipb-edit-dropdown' = 'Edytuj listę przyczyn blokady', 'ipb-unblock-addr' = 'Odblokuj $1', diff --git a/resources/Resources.php b/resources/Resources.php index d280c75..bcac838 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1010,6 +1010,7 @@ ), 'mediawiki.special.block' = array( 'scripts' = 'resources/mediawiki.special/mediawiki.special.block.js', + 'styles' = 'resources/mediawiki.special/mediawiki.special.block.css', 'dependencies' = array( 'mediawiki.util', ), diff --git a/resources/mediawiki.special/mediawiki.special.block.css b/resources/mediawiki.special/mediawiki.special.block.css new file mode 100644 index 000..36bcc8e --- /dev/null +++ b/resources/mediawiki.special/mediawiki.special.block.css @@ -0,0 +1,8 @@ +/** + * Styling for Special:Block + */ + +label[for=mw-input-wpConfirm] { + font-weight: bold; + color: #c00; +} -- To view, visit https://gerrit.wikimedia.org/r/103351 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b496d763a14fe47d7458525cb1e8bb9fa5788f6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits
[MediaWiki-commits] [Gerrit] Create additional browser test for Preferences User Profile... - change (qa/browsertests)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/103497 Change subject: Create additional browser test for Preferences User Profile tab .. Create additional browser test for Preferences User Profile tab Bug: 58898 Change-Id: Icb9b0475a87e87e25c342bc4c16879d69f6c5913 --- A features/preferences_user_profile.feature A features/step_definitions/preferences_user_profile_steps.rb A features/support/pages/preferences_user_profile.rb 3 files changed, 109 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests refs/changes/97/103497/1 diff --git a/features/preferences_user_profile.feature b/features/preferences_user_profile.feature new file mode 100644 index 000..a39779b --- /dev/null +++ b/features/preferences_user_profile.feature @@ -0,0 +1,28 @@ +# +# This file is subject to the license terms in the LICENSE file found in the +# qa-browsertests top-level directory and at +# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of +# qa-browsertests, including this file, may be copied, modified, propagated, or +# distributed except according to the terms contained in the LICENSE file. +# +# Copyright 2012-2013 by the Mediawiki developers. See the CREDITS file in the +# qa-browsertests top-level directory and at +# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS +# +@en.wikipedia.beta.wmflabs.org @login @test2.wikipedia.org +Feature: Preferences User profile + + Scenario: Preferences User profile +Given I am logged in +When I navigate to Preferences + And I click User profile +Then I have basic informations + And I can change my language + And I can change my gender + And I have more language settings + And I can see my signature + And I can change my sugnature + And I can see my email + And I can change my email options + And I can click Save + And I can restore default settings diff --git a/features/step_definitions/preferences_user_profile_steps.rb b/features/step_definitions/preferences_user_profile_steps.rb new file mode 100644 index 000..b25bdcf --- /dev/null +++ b/features/step_definitions/preferences_user_profile_steps.rb @@ -0,0 +1,43 @@ +# +# This file is subject to the license terms in the LICENSE file found in the +# qa-browsertests top-level directory and at +# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of +# qa-browsertests, including this file, may be copied, modified, propagated, or +# distributed except according to the terms contained in the LICENSE file. +# +# Copyright 2012-2013 by the Mediawiki developers. See the CREDITS file in the +# qa-browsertests top-level directory and at +# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS +# +When(/^I click Editing$/) do + visit(PreferencesPage).editing_link_element.when_present.click +end + +Then(/^I have general options checkboxes$/) do + on(PreferencesEditingPage) do |page| +page.edit_section_check_element.should exist +page.edit_section_on_right_click_check_element.should exist +page.edit_on_dbl_click_check_element.should exist + end +end + +Then(/^I can change edit area font style$/) do + pending # express the regexp above with the code you wish you had +end + +Then(/^I can set columns number$/) do + pending # express the regexp above with the code you wish you had +end + +Then(/^I can set rows number$/) do + pending # express the regexp above with the code you wish you had +end + +Then(/^I have editor checkboxes$/) do + pending # express the regexp above with the code you wish you had +end + +Then(/^I have preview checkboxes$/) do + pending # express the regexp above with the code you wish you had +end + diff --git a/features/support/pages/preferences_user_profile.rb b/features/support/pages/preferences_user_profile.rb new file mode 100644 index 000..636162f --- /dev/null +++ b/features/support/pages/preferences_user_profile.rb @@ -0,0 +1,38 @@ +# +# This file is subject to the license terms in the LICENSE file found in the +# qa-browsertests top-level directory and at +# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of +# qa-browsertests, including this file, may be copied, modified, propagated, or +# distributed except according to the terms contained in the LICENSE file. +# +# Copyright 2012-2013 by the Mediawiki developers. See the CREDITS file in the +# qa-browsertests top-level directory and at +# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS +# +class PreferencesUserProfilePage + include PageObject + + include URL + page_url URL.url(Special:Preferences#mw-prefsection-personal) + + label(:username_label, text: Username:) + label(:user_id_label, text: User ID:) + label(:group_label, text: Member of group:) + label(:connected_apps_label, text: Connected apps:) + label(:number_of_edits_label,
[MediaWiki-commits] [Gerrit] Port makecat.py to core - change (pywikibot/i18n)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/102836 Change subject: Port makecat.py to core .. Port makecat.py to core Change-Id: I6237bf38b6120e54ba669ebcac39cce561138bfc --- A makecat.py 1 file changed, 42 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/i18n refs/changes/36/102836/1 diff --git a/makecat.py b/makecat.py new file mode 100644 index 000..b27608d --- /dev/null +++ b/makecat.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +msg = { + 'ar': { + 'makecat-create': u'إنشاء أو تحديث التصنيف:', + }, + 'en': { + 'makecat-create': u'Creation or update of category:', + }, + 'es': { + 'makecat-create': u'Creación o actualiza de la categoría:', + }, + 'fa': { + 'makecat-create': u'ایجاد یا تصحیح رده:', + }, + 'fr': { + 'makecat-create': u'Création ou mise à jour de categorie:', + }, + 'he': { + 'makecat-create': u'יצירה או עדכון של קטגוריה:', + }, + 'ia': { + 'makecat-create': u'Creation o actualisation de categoria:', + }, + 'it': { + 'makecat-create': u'La creazione o laggiornamento di categoria:', + }, + 'nl': { + 'makecat-create': u'Aanmaak of uitbreiding van categorie:', + }, + 'nn': { + 'makecat-create': u'oppretting eller oppdatering av kategori:', + }, + 'no': { + 'makecat-create': u'opprettelse eller oppdatering av kategori:', + }, + 'pl': { + 'makecat-create': u'Stworzenie lub aktualizacja kategorii:', + }, + 'pt': { + 'makecat-create': u'Criando ou atualizando categoria:', + }, +}; -- To view, visit https://gerrit.wikimedia.org/r/102836 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6237bf38b6120e54ba669ebcac39cce561138bfc Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/i18n Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Port makecat.py to core - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/102837 Change subject: Port makecat.py to core .. Port makecat.py to core Change-Id: Icb7c690bf3e8625ad4a10e0f3e9f7b523f54c059 --- A scripts/makecat.py 1 file changed, 297 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/37/102837/1 diff --git a/scripts/makecat.py b/scripts/makecat.py new file mode 100644 index 000..a550025 --- /dev/null +++ b/scripts/makecat.py @@ -0,0 +1,297 @@ +# -*- coding: UTF-8 -*- + +This bot takes as its argument (or, if no argument is given, asks for it), the +name of a new or existing category. It will then try to find new articles for +this category (pages linked to and from pages already in the category), asking +the user which pages to include and which not. + +Arguments: + -nodates automatically skip all pages that are years or dates (years + only work AD, dates only for certain languages) + -forward only check pages linked from pages already in the category, + not pages linking to them. Is less precise but quite a bit + faster. + -existonly ask about pages that do actually exist; drop any + titles of non-existing pages silently. If -forward is chosen, + -exist is automatically implied. + -keepparent do not remove parent categories of the category to be + worked on. + -all work on all pages (default: only main namespace) + +When running the bot, you will get one by one a number by pages. You can +choose: +Y(es) - include the page +N(o) - do not include the page or +I(gnore) - do not include the page, but if you meet it again, ask again. +X - add the page, but do not check links to and from it +Other possiblities: +A(dd) - add another page, which may have been one that was included before +C(heck) - check links to and from the page, but do not add the page itself +R(emove) - remove a page that is already in the list +L(ist) - show current list of pages to include or to check + + +# (C) Andre Engels, 2004 +# (C) Pywikipedia bot team 2005-2010 +# +# Distributed under the terms of the MIT license. +# +__version__='$Id$' +# + +import sys, codecs, re +import pywikibot +from pywikibot import date, catlib, pagegenerators, i18n + +def rawtoclean(c): +#Given the 'raw' category, provides the 'clean' category +c2 = c.title().split('|')[0] +return pywikibot.Page(mysite,c2) + +def isdate(s): +returns true iff s is a date or year + +dict,val = date.getAutoFormat( pywikibot.getSite().language(), s ) +return dict is not None + +def needcheck(pl): +if main: +if pl.namespace() != 0: +return False +if pl in checked: +return False +if skipdates: +if isdate(pl.title()): +return False +return True + +def include(pl,checklinks=True,realinclude=True,linkterm=None): +cl = checklinks +if linkterm: +actualworkingcat = catlib.Category(mysite,workingcat.title(), + sortKey=linkterm) +else: +actualworkingcat = workingcat +if realinclude: +try: +text = pl.get() +except pywikibot.NoPage: +pass +except pywikibot.IsRedirectPage: +cl = True +pass +else: +cats = [x for x in pl.categories()] +if not workingcat in cats: +cats = [x for x in pl.categories()] +for c in cats: +if c in parentcats: +if removeparent: +catlib.change_category(pl,c,actualworkingcat) +break +else: +pl.put(pywikibot.replaceCategoryLinks( +text, cats + [actualworkingcat])) +if cl: +if checkforward: +for page2 in pl.linkedPages(): +if needcheck(page2): +tocheck.append(page2) +checked[page2] = page2 +if checkbackward: +for refPage in pl.getReferences(): + if needcheck(refPage): +tocheck.append(refPage) +checked[refPage] = refPage + +def exclude(pl,real_exclude=True): +if real_exclude: +excludefile.write('%s\n'%pl.title()) + +def asktoadd(pl): +if pl.site != mysite: +return +if pl.isRedirectPage(): +pl2 = pl.getRedirectTarget() +if needcheck(pl2): +tocheck.append(pl2) +checked[pl2]=pl2 +return +ctoshow = 500 +pywikibot.output(u'') +pywikibot.output(u==%s==%pl.title()) +while 1: +answer = raw_input(y(es)/n(o)/i(gnore)/(o)ther options? ) +if answer=='y': +include(pl) +break +if answer=='c': +
[MediaWiki-commits] [Gerrit] Port catall.py to core - change (pywikibot/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/101642 Change subject: Port catall.py to core .. Port catall.py to core Change-Id: I92e6a4adf5276c55624fa14239c79ac4d5a282e8 --- A scripts/catall.py 1 file changed, 116 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/42/101642/1 diff --git a/scripts/catall.py b/scripts/catall.py new file mode 100755 index 000..c99ac4d --- /dev/null +++ b/scripts/catall.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- + +Add or change categories on a number of pages. Usage: catall.py name - goes +through pages, starting at 'name'. Provides the categories on the page and asks +whether to change them. If no starting name is provided, the bot starts at 'A'. + +Options: +-onlynew : Only run on pages that do not yet have a category. + +# +# (C) Rob W.W. Hooft, Andre Engels, 2004 +# (C) Pywikibot team, 2004-2013 +# +# Distributed under the terms of the MIT license. +# +__version__ = '$Id$' +# + +import sys +import pywikibot +from pywikibot import i18n + + +def choosecats(pagetext): +chosen = [] +done = False +length = 1000 +print(Give the new categories, one per line. +Empty line: if the first, don't change. Otherwise: Ready. +-: I made a mistake, let me start over. +?: Give the text of the page with GUI. +??: Give the text of the page in console. +xx: if the first, remove all categories and add no new. +q: quit.) +while not done: +choice = pywikibot.input(u?) +if choice == : +done = True +elif choice == -: +chosen = choosecats(pagetext) +done = True +elif choice == ?: +from pywikibot import editor as editarticle +editor = editarticle.TextEditor() +newtext = editor.edit(pagetext) +elif choice == ??: +pywikibot.output(pagetext[0:length]) +length = length + 500 +elif choice == xx and chosen == []: +chosen = None +done = True +elif choice == q: +print quit... +sys.exit() +else: +chosen.append(choice) +return chosen + + +def make_categories(page, list, site=None): +if site is None: +site = pywikibot.getSite() +pllist = [] +for p in list: +cattitle = %s:%s % (site.category_namespace(), p) +pllist.append(pywikibot.Page(site, cattitle)) +page.put_async(pywikibot.replaceCategoryLinks(page.get(), pllist), + comment=i18n.twtranslate(site.lang, 'catall-changing')) + + +def main(): +docorrections = True +start = [] + +for arg in pywikibot.handleArgs(): +if arg == '-onlynew': +docorrections = False +else: +start.append(arg) + +if not start: +start = 'A' +else: +start = ' '.join(start) + +mysite = pywikibot.getSite() + +for p in mysite.allpages(start=start): +try: +text = p.get() +cats = p.categories() +if not cats: +pywikibot.output(u== %s == % p.title()) +print No categories +print - * 40 +newcats = choosecats(text) +if newcats != [] and newcats is not None: +make_categories(p, newcats, mysite) +elif docorrections: +pywikibot.output(u== %s == % p.title()) +for c in cats: +pywikibot.output(c.title()) +print - * 40 +newcats = choosecats(text) +if newcats is None: +make_categories(p, [], mysite) +elif newcats != []: +make_categories(p, newcats, mysite) +except pywikibot.IsRedirectPage: +pywikibot.output(u'%s is a redirect' % p.title()) + +if __name__ == __main__: +try: +main() +finally: +pywikibot.stopme() -- To view, visit https://gerrit.wikimedia.org/r/101642 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92e6a4adf5276c55624fa14239c79ac4d5a282e8 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update favicon wikinews.ico - change (operations/mediawiki-config)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/100123 Change subject: Update favicon wikinews.ico .. Update favicon wikinews.ico Added 48x48 version of the logo to the already existing 16x16 and 32x32 icons. Bug: 58143 Change-Id: I145704bcc2ded89c2991f7eafa5c547de2836201 --- M docroot/bits/favicon/wikinews.ico 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/23/100123/1 diff --git a/docroot/bits/favicon/wikinews.ico b/docroot/bits/favicon/wikinews.ico index 5ec5ee8..65fb768 100644 --- a/docroot/bits/favicon/wikinews.ico +++ b/docroot/bits/favicon/wikinews.ico Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/100123 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I145704bcc2ded89c2991f7eafa5c547de2836201 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update favicon piece.ico - change (operations/mediawiki-config)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/100161 Change subject: Update favicon piece.ico .. Update favicon piece.ico Added 48x48 version of the logo to the already existing 16x16 and 32x32 icons. Bug: 58164 Change-Id: Ia8dd3f3c91387d5e194bb62a6280faa8039a77b9 --- M docroot/bits/favicon/piece.ico 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/61/100161/1 diff --git a/docroot/bits/favicon/piece.ico b/docroot/bits/favicon/piece.ico index a834c34..bb0d87b 100644 --- a/docroot/bits/favicon/piece.ico +++ b/docroot/bits/favicon/piece.ico Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/100161 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8dd3f3c91387d5e194bb62a6280faa8039a77b9 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update favicon wikipedia.ico - change (operations/mediawiki-config)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/99768 Change subject: Update favicon wikipedia.ico .. Update favicon wikipedia.ico Added 48x48 version of the logo to the already existing 16x16 and 32x32 icons. Bug: 58125 Change-Id: I078a008f63bfbbf8ff75c8301b8d192bdcbca7e8 --- M docroot/bits/favicon/wikipedia.ico 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/68/99768/1 diff --git a/docroot/bits/favicon/wikipedia.ico b/docroot/bits/favicon/wikipedia.ico index c2ee0e9..9b89ea7 100644 --- a/docroot/bits/favicon/wikipedia.ico +++ b/docroot/bits/favicon/wikipedia.ico Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/99768 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I078a008f63bfbbf8ff75c8301b8d192bdcbca7e8 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add an SVG version of watch icon - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/99258 Change subject: Add an SVG version of watch icon .. Add an SVG version of watch icon The watch icon isn't in the sprite now, using separate image files for each state Bug: 35335 Change-Id: Iee3765e940cfd9784c55b6a87a678e41550032a7 --- M resources/mediawiki.less/mediawiki.mixins.less A skins/vector/images/watch-icon-fav-hl.png A skins/vector/images/watch-icon-fav-hl.svg A skins/vector/images/watch-icon-fav.png A skins/vector/images/watch-icon-fav.svg A skins/vector/images/watch-icon-hl.png A skins/vector/images/watch-icon-hl.svg D skins/vector/images/watch-icon-loading.gif A skins/vector/images/watch-icon-loading.png A skins/vector/images/watch-icon-loading.svg A skins/vector/images/watch-icon.png A skins/vector/images/watch-icon.svg D skins/vector/images/watch-icons.png M skins/vector/screen.less 14 files changed, 624 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/58/99258/1 diff --git a/resources/mediawiki.less/mediawiki.mixins.less b/resources/mediawiki.less/mediawiki.mixins.less index 19a715b..e455201 100644 --- a/resources/mediawiki.less/mediawiki.mixins.less +++ b/resources/mediawiki.less/mediawiki.mixins.less @@ -44,3 +44,32 @@ -o-transition: @string; transition: @string; } + +@-webkit-keyframes rotate { + from { + -webkit-transform:rotate(0deg); + } + to { + -webkit-transform:rotate(360deg); + } +} + +@keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +.rotation(@time) { + -webkit-animation-name: rotate; + -webkit-animation-duration: @time; + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; + animation-name: rotate; + animation-duration: @time; + animation-iteration-count: infinite; + animation-timing-function: linear; +} diff --git a/skins/vector/images/watch-icon-fav-hl.png b/skins/vector/images/watch-icon-fav-hl.png new file mode 100644 index 000..ad39c5e --- /dev/null +++ b/skins/vector/images/watch-icon-fav-hl.png Binary files differ diff --git a/skins/vector/images/watch-icon-fav-hl.svg b/skins/vector/images/watch-icon-fav-hl.svg new file mode 100644 index 000..f38f1b6 --- /dev/null +++ b/skins/vector/images/watch-icon-fav-hl.svg @@ -0,0 +1,117 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + xmlns:xlink=http://www.w3.org/1999/xlink; + xmlns:sodipodi=http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd; + xmlns:inkscape=http://www.inkscape.org/namespaces/inkscape; + width=16 + height=16 + id=svg2 + version=1.1 + inkscape:version=0.48.4 r9939 + sodipodi:docname=watch-icon-fav-hl.svg + defs + id=defs4 +linearGradient + id=linearGradient3788 + stop + style=stop-color:#c2edff;stop-opacity:1; + offset=0 + id=stop3790 / + stop + id=stop3796 + offset=0.5 + style=stop-color:#68bdff;stop-opacity:1; / + stop + style=stop-color:#ff;stop-opacity:1; + offset=1 + id=stop3792 / +/linearGradient +linearGradient + inkscape:collect=always + xlink:href=#linearGradient3788 + id=linearGradient3804 + x1=13.470111 + y1=14.363379 + x2=4.596477 + y2=3.3969929 + gradientUnits=userSpaceOnUse / +linearGradient + inkscape:collect=always + xlink:href=#linearGradient3788 + id=linearGradient3808 + gradientUnits=userSpaceOnUse + x1=13.470111 + y1=14.363379 + x2=4.596477 + y2=3.3969929 / + /defs + sodipodi:namedview + id=base + pagecolor=#ff + bordercolor=#66 + borderopacity=1.0 + inkscape:pageopacity=0.0 + inkscape:pageshadow=2 + inkscape:zoom=8 + inkscape:cx=-6.951911 + inkscape:cy=5.714676 + inkscape:document-units=px + inkscape:current-layer=layer1 + showgrid=false + fit-margin-top=0 + fit-margin-left=0 + fit-margin-right=0 + fit-margin-bottom=0 + inkscape:window-width=1920 + inkscape:window-height=1014 + inkscape:window-x=0 + inkscape:window-y=27 + inkscape:window-maximized=1 / + metadata + id=metadata7 +rdf:RDF + cc:Work + rdf:about= +dc:formatimage/svg+xml/dc:format +dc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; / +dc:title/dc:title +dc:creator +
[MediaWiki-commits] [Gerrit] Add an SVG version of watch icon - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/98856 Change subject: Add an SVG version of watch icon .. Add an SVG version of watch icon Bug: 35335 Change-Id: Icdd7b48cfb73325d58e13ad821d9bb711b854a6d --- M resources/mediawiki.less/mediawiki.mixins.less A skins/vector/images/watch-icon-loading.svg A skins/vector/images/watch-icons.svg M skins/vector/screen.less 4 files changed, 311 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/56/98856/1 diff --git a/resources/mediawiki.less/mediawiki.mixins.less b/resources/mediawiki.less/mediawiki.mixins.less index 19a715b..3db71a9 100644 --- a/resources/mediawiki.less/mediawiki.mixins.less +++ b/resources/mediawiki.less/mediawiki.mixins.less @@ -44,3 +44,33 @@ -o-transition: @string; transition: @string; } + +@-webkit-keyframes rotate { + from { + -webkit-transform:rotate(0deg); + } + to { + -webkit-transform:rotate(360deg); + } +} + +@keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +.rotation(@time) { + -webkit-animation-name: rotate; + -webkit-animation-duration: @time; + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; + animation-name: rotate; + animation-duration: @time; + animation-iteration-count: infinite; + animation-timing-function: linear; +} + diff --git a/skins/vector/images/watch-icon-loading.svg b/skins/vector/images/watch-icon-loading.svg new file mode 100644 index 000..5d4df88 --- /dev/null +++ b/skins/vector/images/watch-icon-loading.svg @@ -0,0 +1,112 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + xmlns:xlink=http://www.w3.org/1999/xlink; + xmlns:sodipodi=http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd; + xmlns:inkscape=http://www.inkscape.org/namespaces/inkscape; + width=16 + height=16 + id=svg2 + version=1.1 + inkscape:version=0.48.4 r9939 + sodipodi:docname=watch-icons.svg + defs + id=defs4 +linearGradient + id=linearGradient3788 + stop + style=stop-color:#c2edff;stop-opacity:1; + offset=0 + id=stop3790 / + stop + id=stop3796 + offset=0.5 + style=stop-color:#68bdff;stop-opacity:1; / + stop + style=stop-color:#ff;stop-opacity:1; + offset=1 + id=stop3792 / +/linearGradient +linearGradient + inkscape:collect=always + xlink:href=#linearGradient3788 + id=linearGradient3804 + x1=13.470111 + y1=14.363379 + x2=4.596477 + y2=3.3969929 + gradientUnits=userSpaceOnUse / +linearGradient + inkscape:collect=always + xlink:href=#linearGradient3788 + id=linearGradient3808 + gradientUnits=userSpaceOnUse + x1=13.470111 + y1=14.363379 + x2=4.596477 + y2=3.3969929 / + /defs + sodipodi:namedview + id=base + pagecolor=#ff + bordercolor=#66 + borderopacity=1.0 + inkscape:pageopacity=0.0 + inkscape:pageshadow=2 + inkscape:zoom=22.627417 + inkscape:cx=19.54 + inkscape:cy=6.4582896 + inkscape:document-units=px + inkscape:current-layer=layer1 + showgrid=false + fit-margin-top=0 + fit-margin-left=0 + fit-margin-right=0 + fit-margin-bottom=0 + inkscape:window-width=1920 + inkscape:window-height=1014 + inkscape:window-x=0 + inkscape:window-y=27 + inkscape:window-maximized=1 / + metadata + id=metadata7 +rdf:RDF + cc:Work + rdf:about= +dc:formatimage/svg+xml/dc:format +dc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; / +dc:title/dc:title + /cc:Work +/rdf:RDF + /metadata + g + inkscape:label=Layer 1 + inkscape:groupmode=layer + id=layer1 + transform=translate(-693.14288,-698.64789) +path + sodipodi:type=star + style=fill:#ff;fill-opacity:1;stroke:#d1d1d1;stroke-width:1.15975237;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none + id=path2998 + sodipodi:sides=5 + sodipodi:cx=8.3337584 + sodipodi:cy=7.6662416 + sodipodi:r1=8.587225 + sodipodi:r2=4.2936125 + sodipodi:arg1=-1.5707963 + sodipodi:arg2=-0.9424778 + inkscape:flatsided=false + inkscape:rounded=0 + inkscape:randomized=0 + d=M 8.3337586,-0.92098331 10.85748,4.1926362
[MediaWiki-commits] [Gerrit] Prevent Mark as read and title-overflow text from overlapping - change (mediawiki...Echo)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/98253 Change subject: Prevent Mark as read and title-overflow text from overlapping .. Prevent Mark as read and title-overflow text from overlapping If the echo-overlay-title-overflow text is too long, it's wrapped into multiple lines now. Bug: 55919 Change-Id: Ib1d252ab26be7d73cbf71c6fb19d84b80d8d30c8 --- M modules/overlay/ext.echo.overlay.css 1 file changed, 4 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/53/98253/1 diff --git a/modules/overlay/ext.echo.overlay.css b/modules/overlay/ext.echo.overlay.css index 8cc7e7e..e9b4b90 100644 --- a/modules/overlay/ext.echo.overlay.css +++ b/modules/overlay/ext.echo.overlay.css @@ -72,15 +72,13 @@ /*border-bottom: 1px solid #A7D7F9;*/ font-size: 13px; line-height: 15px; - height: 15px; padding: 15px 15px 15px 28px; border-bottom: 1px solid #DD; - position: relative; } #mw-echo-overlay-title-text { - display: inline-block; - *display: inline; + display: inline; zoom: 1; + white-space: normal; } #mw-echo-overlay-moreinfo-link { display: inline-block; @@ -155,9 +153,8 @@ } #mw-echo-mark-read-button { - position: absolute; - bottom: 12px; - right: 15px; + float: right; + margin: -1px 0 0 10px; padding: 1px 8px; font-size: 11px; line-height: 15px; -- To view, visit https://gerrit.wikimedia.org/r/98253 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1d252ab26be7d73cbf71c6fb19d84b80d8d30c8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl 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 SVG versions of toolbar icons - change (mediawiki...WikiEditor)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/97454 Change subject: Add SVG versions of toolbar icons .. Add SVG versions of toolbar icons Bug: 35342 Change-Id: I3661eb945f79fb59600c5d85cc259e61f115d5ab --- A modules/images/toolbar/button-sprite.svg A modules/images/toolbar/format-big.svg A modules/images/toolbar/format-bold-A.svg A modules/images/toolbar/format-bold-B.svg A modules/images/toolbar/format-bold-F.svg A modules/images/toolbar/format-bold-G.svg A modules/images/toolbar/format-bold-N.svg A modules/images/toolbar/format-bold-P.svg A modules/images/toolbar/format-bold-V.svg A modules/images/toolbar/format-bold.svg A modules/images/toolbar/format-indent.svg A modules/images/toolbar/format-italic-A.svg A modules/images/toolbar/format-italic-C.svg A modules/images/toolbar/format-italic-K.svg A modules/images/toolbar/format-italic-i.svg A modules/images/toolbar/format-italic.svg A modules/images/toolbar/format-olist.svg A modules/images/toolbar/format-small.svg A modules/images/toolbar/format-subscript.svg A modules/images/toolbar/format-superscript.svg A modules/images/toolbar/format-ulist.svg A modules/images/toolbar/insert-file.svg A modules/images/toolbar/insert-gallery.svg A modules/images/toolbar/insert-ilink.svg A modules/images/toolbar/insert-link.svg A modules/images/toolbar/insert-newline.svg A modules/images/toolbar/insert-nowiki.svg A modules/images/toolbar/insert-redirect.svg A modules/images/toolbar/insert-reference.svg A modules/images/toolbar/insert-signature.svg A modules/images/toolbar/insert-table.svg A modules/images/toolbar/insert-xlink.svg A modules/images/toolbar/search-replace.svg M modules/jquery.wikiEditor.toolbar.css 34 files changed, 7,799 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/54/97454/1 -- To view, visit https://gerrit.wikimedia.org/r/97454 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3661eb945f79fb59600c5d85cc259e61f115d5ab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl 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 SVG version of search button icon (bug 35336). - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/97307 Change subject: Added SVG version of search button icon (bug 35336). .. Added SVG version of search button icon (bug 35336). Change-Id: I471edc6c3e4667fa6572bf33e24c64496c1b7005 --- A skins/vector/images/search-ltr.svg A skins/vector/images/search-rtl.svg M skins/vector/screen.less 3 files changed, 85 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/07/97307/1 diff --git a/skins/vector/images/search-ltr.svg b/skins/vector/images/search-ltr.svg new file mode 100644 index 000..184e0ee --- /dev/null +++ b/skins/vector/images/search-ltr.svg @@ -0,0 +1,41 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + version=1.1 + width=12 + height=13 + id=svg2 + defs + id=defs4 / + metadata + id=metadata7 +rdf:RDF + cc:Work + rdf:about= +dc:formatimage/svg+xml/dc:format +dc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; / +dc:title/dc:title + /cc:Work +/rdf:RDF + /metadata + g + transform=translate(-894,-731.57648) + id=layer1 +path + d=m -0.75761414,8.9593897 a 5.177032,5.177032 0 1 1 -10.35406386,0 5.177032,5.177032 0 1 1 10.35406386,0 z + transform=matrix(0.85040896,0,0,0.83575426,904.36465,729.3551) + id=path2996 + style=fill:none;stroke:#6c6c6c;stroke-width:2.13510537;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none / +path + d=m 902.17653,740.39168 2.26569,2.6414 + id=path3766 + style=fill:none;stroke:#6c6c6c;stroke-width:2.2005;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none / + /g +/svg diff --git a/skins/vector/images/search-rtl.svg b/skins/vector/images/search-rtl.svg new file mode 100644 index 000..4fd9a47 --- /dev/null +++ b/skins/vector/images/search-rtl.svg @@ -0,0 +1,41 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + version=1.1 + width=12 + height=13 + id=svg2 + defs + id=defs4 / + metadata + id=metadata7 +rdf:RDF + cc:Work + rdf:about= +dc:formatimage/svg+xml/dc:format +dc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; / +dc:title/dc:title + /cc:Work +/rdf:RDF + /metadata + g + transform=translate(-894,-731.57648) + id=layer1 +path + d=m -0.75761414,8.9593897 a 5.177032,5.177032 0 1 1 -10.35406386,0 5.177032,5.177032 0 1 1 10.35406386,0 z + transform=matrix(-0.85040896,0,0,0.83575426,895.63918,729.3551) + id=path2996 + style=fill:none;stroke:#6c6c6c;stroke-width:2.13510537;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none / +path + d=m 897.8273,740.39168 -2.26569,2.6414 + id=path3766 + style=fill:none;stroke:#6c6c6c;stroke-width:2.2005;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none / + /g +/svg diff --git a/skins/vector/screen.less b/skins/vector/screen.less index 7220f3c..d4247a6 100644 --- a/skins/vector/screen.less +++ b/skins/vector/screen.less @@ -426,8 +426,9 @@ direction: ltr; white-space: nowrap; overflow: hidden; - /* @embed */ - background: transparent url(images/search-ltr.png) center center no-repeat; +.background-image-svg('images/search-ltr.svg', 'images/search-ltr.png'); +background-position: center center; +background-repeat: no-repeat; } div#simpleSearch #mw-searchButton { z-index: 1; -- To view, visit https://gerrit.wikimedia.org/r/97307 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I471edc6c3e4667fa6572bf33e24c64496c1b7005 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed indentation style and PNG fallbacking method. - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/97022 Change subject: Fixed indentation style and PNG fallbacking method. .. Fixed indentation style and PNG fallbacking method. Change-Id: I30ff461b9d4f96b79777ba83eedc53134bd4f478 --- M includes/libs/CSSMin.php M resources/mediawiki/mediawiki.icon.css 2 files changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/22/97022/1 diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 61388e7..8d8aa2e 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -52,7 +52,7 @@ 'tif' = 'image/tiff', 'tiff' = 'image/tiff', 'xbm' = 'image/x-xbitmap', -'svg' = 'image/svg+xml', + 'svg' = 'image/svg+xml', ); /* Static Methods */ diff --git a/resources/mediawiki/mediawiki.icon.css b/resources/mediawiki/mediawiki.icon.css index 1c4a472..2a5d3e6 100644 --- a/resources/mediawiki/mediawiki.icon.css +++ b/resources/mediawiki/mediawiki.icon.css @@ -6,18 +6,24 @@ .mw-collapsible-arrow.mw-collapsible-toggle-collapsed { /* @embed */ background: url(images/arrow-collapsed-ltr.png) no-repeat left bottom; -background: url(images/arrow-collapsed-ltr.svg), none no-repeat left bottom; -width: 12px; -height: 12px; -margin: 4px 4px 0 0; + /* @embed */ + background-image: -webkit-linear-gradient(transparent, transparent), url(images/arrow-collapsed-ltr.svg); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url(images/arrow-collapsed-ltr.svg); + width: 12px; + height: 12px; + margin: 4px 4px 0 0; } .mw-icon-arrow-expanded, .mw-collapsible-arrow.mw-collapsible-toggle-expanded { /* @embed */ background: url(images/arrow-expanded.png) no-repeat left bottom; -background: url(images/arrow-expanded.svg), none no-repeat left bottom; -width: 12px; -height: 12px; -margin: 4px 4px 0 0; +/* @embed */ +background-image: -webkit-linear-gradient(transparent, transparent), url(images/arrow-expanded.svg); +/* @embed */ +background-image: linear-gradient(transparent, transparent), url(images/arrow-expanded.svg); + width: 12px; + height: 12px; + margin: 4px 4px 0 0; } -- To view, visit https://gerrit.wikimedia.org/r/97022 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30ff461b9d4f96b79777ba83eedc53134bd4f478 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx matx-1...@o2.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed indentation style and PNG fallback method. - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/97114 Change subject: Fixed indentation style and PNG fallback method. .. Fixed indentation style and PNG fallback method. Change-Id: Ib852c16f35cd9c3520653cf1b0c4f003d0065401 --- M includes/libs/CSSMin.php M resources/mediawiki/mediawiki.icon.css 2 files changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/14/97114/1 diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 61388e7..8d8aa2e 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -52,7 +52,7 @@ 'tif' = 'image/tiff', 'tiff' = 'image/tiff', 'xbm' = 'image/x-xbitmap', -'svg' = 'image/svg+xml', + 'svg' = 'image/svg+xml', ); /* Static Methods */ diff --git a/resources/mediawiki/mediawiki.icon.css b/resources/mediawiki/mediawiki.icon.css index 1c4a472..2a5d3e6 100644 --- a/resources/mediawiki/mediawiki.icon.css +++ b/resources/mediawiki/mediawiki.icon.css @@ -6,18 +6,24 @@ .mw-collapsible-arrow.mw-collapsible-toggle-collapsed { /* @embed */ background: url(images/arrow-collapsed-ltr.png) no-repeat left bottom; -background: url(images/arrow-collapsed-ltr.svg), none no-repeat left bottom; -width: 12px; -height: 12px; -margin: 4px 4px 0 0; + /* @embed */ + background-image: -webkit-linear-gradient(transparent, transparent), url(images/arrow-collapsed-ltr.svg); + /* @embed */ + background-image: linear-gradient(transparent, transparent), url(images/arrow-collapsed-ltr.svg); + width: 12px; + height: 12px; + margin: 4px 4px 0 0; } .mw-icon-arrow-expanded, .mw-collapsible-arrow.mw-collapsible-toggle-expanded { /* @embed */ background: url(images/arrow-expanded.png) no-repeat left bottom; -background: url(images/arrow-expanded.svg), none no-repeat left bottom; -width: 12px; -height: 12px; -margin: 4px 4px 0 0; +/* @embed */ +background-image: -webkit-linear-gradient(transparent, transparent), url(images/arrow-expanded.svg); +/* @embed */ +background-image: linear-gradient(transparent, transparent), url(images/arrow-expanded.svg); + width: 12px; + height: 12px; + margin: 4px 4px 0 0; } -- To view, visit https://gerrit.wikimedia.org/r/97114 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib852c16f35cd9c3520653cf1b0c4f003d0065401 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx matx-1...@o2.pl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed low-resolution enhanced recent changes collapse/show a... - change (mediawiki/core)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/96372 Change subject: Fixed low-resolution enhanced recent changes collapse/show arrows (GCI 2013 task 5346992154738688, bug 35344) .. Fixed low-resolution enhanced recent changes collapse/show arrows (GCI 2013 task 5346992154738688, bug 35344) Change-Id: I1fcc255691048cb8929a68096e1e0e56e934f020 --- M includes/libs/CSSMin.php A resources/mediawiki/images/arrow-collapsed-ltr.svg A resources/mediawiki/images/arrow-collapsed-rtl.svg A resources/mediawiki/images/arrow-expanded.svg M resources/mediawiki/mediawiki.icon.css 5 files changed, 117 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/72/96372/1 diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index 4f142fc..61388e7 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -52,6 +52,7 @@ 'tif' = 'image/tiff', 'tiff' = 'image/tiff', 'xbm' = 'image/x-xbitmap', +'svg' = 'image/svg+xml', ); /* Static Methods */ diff --git a/resources/mediawiki/images/arrow-collapsed-ltr.svg b/resources/mediawiki/images/arrow-collapsed-ltr.svg new file mode 100644 index 000..a719cd8 --- /dev/null +++ b/resources/mediawiki/images/arrow-collapsed-ltr.svg @@ -0,0 +1,36 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + version=1.1 + width=12 + height=12 + id=svg2 + defs + id=defs4 / + metadata + id=metadata7 +rdf:RDF + cc:Work + rdf:about= +dc:formatimage/svg+xml/dc:format +dc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; / +dc:title/dc:title + /cc:Work +/rdf:RDF + /metadata + g + transform=translate(-383.20944,-563.1236) + id=layer1 +path + d=m 387.20944,564.65683 0,8.93354 4.49986,-4.49987 z + id=arrow + style=fill:#797979;fill-opacity:1;stroke:none / + /g +/svg diff --git a/resources/mediawiki/images/arrow-collapsed-rtl.svg b/resources/mediawiki/images/arrow-collapsed-rtl.svg new file mode 100644 index 000..1b442eb --- /dev/null +++ b/resources/mediawiki/images/arrow-collapsed-rtl.svg @@ -0,0 +1,36 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + version=1.1 + width=12 + height=12 + id=svg2 + defs + id=defs4 / + metadata + id=metadata7 +rdf:RDF + cc:Work + rdf:about= +dc:formatimage/svg+xml/dc:format +dc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; / +dc:title/dc:title + /cc:Work +/rdf:RDF + /metadata + g + transform=translate(-383.20944,-563.1236) + id=layer1 +path + d=m 391.7093,564.65683 0,8.93354 -4.49986,-4.49987 z + id=arrow + style=fill:#797979;fill-opacity:1;stroke:none / + /g +/svg diff --git a/resources/mediawiki/images/arrow-expanded.svg b/resources/mediawiki/images/arrow-expanded.svg new file mode 100644 index 000..f505ec1 --- /dev/null +++ b/resources/mediawiki/images/arrow-expanded.svg @@ -0,0 +1,36 @@ +?xml version=1.0 encoding=UTF-8 standalone=no? +!-- Created with Inkscape (http://www.inkscape.org/) -- + +svg + xmlns:dc=http://purl.org/dc/elements/1.1/; + xmlns:cc=http://creativecommons.org/ns#; + xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#; + xmlns:svg=http://www.w3.org/2000/svg; + xmlns=http://www.w3.org/2000/svg; + version=1.1 + width=12 + height=12 + id=svg2 + defs + id=defs4 / + metadata + id=metadata7 +rdf:RDF + cc:Work + rdf:about= +dc:formatimage/svg+xml/dc:format +dc:type + rdf:resource=http://purl.org/dc/dcmitype/StillImage; / +dc:title/dc:title + /cc:Work +/rdf:RDF + /metadata + g + transform=matrix(0,1,-1,0,575.1236,-383.45937) + id=layer1 +path + d=m 387.20944,564.65683 0,8.93354 4.49986,-4.49987 z + id=arrow + style=fill:#797979;fill-opacity:1;stroke:none / + /g +/svg diff --git a/resources/mediawiki/mediawiki.icon.css b/resources/mediawiki/mediawiki.icon.css index f61b725..1c4a472 100644 --- a/resources/mediawiki/mediawiki.icon.css +++ b/resources/mediawiki/mediawiki.icon.css @@ -6,10 +6,18 @@ .mw-collapsible-arrow.mw-collapsible-toggle-collapsed { /*