JadeMaveric has uploaded a new change for review. https://gerrit.wikimedia.org/r/260931
Change subject: Remove uploader's name from MediaViewer ...................................................................... Remove uploader's name from MediaViewer Only last uploader's name is shows, this turns out to be more confusing than useful. Bug: T59308 Change-Id: I7d06b72c581fe8738bffc64b5e36be9983b01ccf --- M extension.json M i18n/en.json M i18n/qqq.json M resources/mmv/logging/mmv.logging.ActionLogger.js M resources/mmv/mmv.js M resources/mmv/model/mmv.model.Image.js D resources/mmv/model/mmv.model.User.js M resources/mmv/provider/mmv.provider.ImageInfo.js D resources/mmv/provider/mmv.provider.UserInfo.js D resources/mmv/ui/img/uploader-ltr.svg D resources/mmv/ui/img/uploader-rtl.svg M resources/mmv/ui/mmv.ui.metadataPanel.js M resources/mmv/ui/mmv.ui.metadataPanel.less 13 files changed, 9 insertions(+), 415 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/31/260931/1 diff --git a/extension.json b/extension.json index c89d023..946dbbb 100644 --- a/extension.json +++ b/extension.json @@ -59,7 +59,6 @@ "mmv/model/mmv.model.Image.js", "mmv/model/mmv.model.Repo.js", "mmv/model/mmv.model.Thumbnail.js", - "mmv/model/mmv.model.User.js", "mmv/model/mmv.model.TaskQueue.js", "mmv/model/mmv.model.ThumbnailWidth.js", "mmv/mmv.lightboximage.js", @@ -68,7 +67,6 @@ "mmv/provider/mmv.provider.FileRepoInfo.js", "mmv/provider/mmv.provider.ThumbnailInfo.js", "mmv/provider/mmv.provider.GuessedThumbnailInfo.js", - "mmv/provider/mmv.provider.UserInfo.js", "mmv/provider/mmv.provider.Image.js", "mmv/mmv.ThumbnailWidthCalculator.js", "mmv/ui/mmv.ui.js", @@ -109,7 +107,6 @@ "mediawiki.Title", "mediawiki.Uri", "mediawiki.jqueryMsg", - "mediawiki.user", "oojs", "jquery.fullscreen", "jquery.hidpi", @@ -121,7 +118,6 @@ ], "messages": [ "multimediaviewer-file-page", - "multimediaviewer-userpage-link", "multimediaviewer-options-learn-more", "multimediaviewer-options-dialog-header", "multimediaviewer-option-header-viewer", @@ -157,7 +153,6 @@ "multimediaviewer-credit-fallback", "multimediaviewer-multiple-authors", "multimediaviewer-multiple-authors-combine", - "multimediaviewer-userpage-link", "multimediaviewer-datetime-created", "multimediaviewer-datetime-uploaded", "multimediaviewer-permission-link", diff --git a/i18n/en.json b/i18n/en.json index bed042c..516a0a5 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -12,7 +12,6 @@ "multimediaviewer-repository-local": "More details", "multimediaviewer-datetime-created": "Created: $1", "multimediaviewer-datetime-uploaded": "Uploaded: $1", - "multimediaviewer-userpage-link": "{{GENDER:$2|Uploaded}} by $1", "multimediaviewer-credit": "$1 - $2", "multimediaviewer-credit-fallback": "View author information", "multimediaviewer-multiple-authors": "{{PLURAL:$1|one more author|$1 more authors}}", diff --git a/i18n/qqq.json b/i18n/qqq.json index 7584099..441fdd1 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -21,7 +21,6 @@ "multimediaviewer-repository-local": "Link to repository where the image is locally hosted.\nSee also:\n* {{msg-mw|multimediaviewer-repository}}", "multimediaviewer-datetime-created": "Used in JavaScript code. Parameters:\n* $1 - time and date\nSee also:\n* {{msg-mw|Multimediaviewer-datetime-uploaded}}\n\nNote that the date comes from the description page and can have various forms (e.g. \"2000-01-01\", \"1st January 2000\", \"1492\", \"16th century\"...)\n\nAlso, this might refer to the date when the picture was taken, or the date when the depcited work was made - the usage is not consistent. You should choose a translation that works in all cases.\n{{Identical|Created}}", "multimediaviewer-datetime-uploaded": "Used in JavaScript code. Parameters:\n* $1 - time and date (formatted)\nSee also:\n* {{msg-mw|Multimediaviewer-datetime-created}}\n{{Identical|Uploaded}}", - "multimediaviewer-userpage-link": "Link to the user page for the uploader of the image.\n\nUsed in JavaScript code.\n\nParameters:\n* $1 - the username of the uploader\n* $2 - their gender", "multimediaviewer-credit": "Credit line for images. Parameters:\n* $1 - HTML describing the author\n* $2 - HTML describing the source\n\nNeither parameters are usernames, so GENDER is useless. Both come directly from the API, the extended metadata imageinfo prop in particular.\n\nThey will usually be derived from the HTML output from wikitext on a file description page - however, no complicated HTML, only links, will be allowed.\n\nSee also {{msg-mw|multimediaviewer-credit-fallback}}", "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.", diff --git a/resources/mmv/logging/mmv.logging.ActionLogger.js b/resources/mmv/logging/mmv.logging.ActionLogger.js index 6bfb13d..171a51a 100644 --- a/resources/mmv/logging/mmv.logging.ActionLogger.js +++ b/resources/mmv/logging/mmv.logging.ActionLogger.js @@ -88,7 +88,6 @@ 'discuss-page': 'User opened the discuss page.', 'help-page': 'User opened the help page.', 'location-page': 'User opened the location page.', - 'uploader-page': 'User opened the uploader page.', 'download-select-menu-original': 'User selected the original size in the download dropdown menu.', 'download-select-menu-small': 'User selected the small size in the download dropdown menu.', 'download-select-menu-medium': 'User selected the medium size in the download dropdown menu.', diff --git a/resources/mmv/mmv.js b/resources/mmv/mmv.js index 08624cd..2669dcc 100644 --- a/resources/mmv/mmv.js +++ b/resources/mmv/mmv.js @@ -71,15 +71,6 @@ this.guessedThumbnailInfoProvider = new mw.mmv.provider.GuessedThumbnailInfo(); /** - * @property {mw.mmv.provider.UserInfo} - * @private - */ - this.userInfoProvider = new mw.mmv.provider.UserInfo( new mw.mmv.logging.Api( 'userinfo' ), { - useApi: this.needGender(), - maxage: apiCacheMaxAge - } ); - - /** * Image index on page. * @property {number} */ @@ -119,22 +110,6 @@ } MMVP = MultimediaViewer.prototype; - - /** - * Check if we need to fetch gender information. This relies on the fact that - * multimediaviewer-userpage-link is the only message which takes a gender parameter. - * @return {boolean} - * FIXME there has to be a better way than this - */ - MMVP.needGender = function () { - var male, female, unknown; - - male = mw.message( 'multimediaviewer-userpage-link', '_', 'male' ).text(); - female = mw.message( 'multimediaviewer-userpage-link', '_', 'female' ).text(); - unknown = mw.message( 'multimediaviewer-userpage-link', '_', 'unknown' ).text(); - - return male !== female || male !== unknown || female !== unknown; - }; /** * Initialize the lightbox interface given an array of thumbnail @@ -325,7 +300,7 @@ viewer.ui.canvas.showError( error ); } ); - metadataPromise.done( function ( imageInfo, repoInfo, userInfo ) { + metadataPromise.done( function ( imageInfo, repoInfo ) { extraStatsDeferred.resolve( { uploadTimestamp: imageInfo.anonymizedUploadDateTime } ); if ( viewer.currentIndex !== image.index ) { @@ -336,7 +311,7 @@ mw.mmv.durationLogger.stop( 'click-to-first-metadata' ).record( 'click-to-first-metadata' ); } - viewer.ui.panel.setImageInfo( image, imageInfo, repoInfo, userInfo ); + viewer.ui.panel.setImageInfo( image, imageInfo, repoInfo ); // File reuse steals a bunch of information from the DOM, so do it last viewer.ui.setFileReuseData( imageInfo, repoInfo, image.caption, image.alt ); @@ -706,30 +681,19 @@ /** * Loads all the size-independent information needed by the lightbox (image metadata, repo - * information, uploader data). + * information). * @param {mw.Title} fileTitle Title of the file page for the image. - * @returns {jQuery.Promise.<mw.mmv.model.Image, mw.mmv.model.Repo, mw.mmv.model.User>} + * @returns {jQuery.Promise.<mw.mmv.model.Image, mw.mmv.model.Repo>} */ MMVP.fetchSizeIndependentLightboxInfo = function ( fileTitle ) { var viewer = this, imageInfoPromise = this.imageInfoProvider.get( fileTitle ), - repoInfoPromise = this.fileRepoInfoProvider.get( fileTitle ), - userInfoPromise; - - userInfoPromise = $.when( - imageInfoPromise, repoInfoPromise - ).then( function ( imageInfo, repoInfoHash ) { - if ( imageInfo.lastUploader ) { - return viewer.userInfoProvider.get( imageInfo.lastUploader, repoInfoHash[imageInfo.repo] ); - } else { - return null; - } - } ); + repoInfoPromise = this.fileRepoInfoProvider.get( fileTitle ); return $.when( - imageInfoPromise, repoInfoPromise, userInfoPromise - ).then( function ( imageInfo, repoInfoHash, userInfo ) { - return $.Deferred().resolve( imageInfo, repoInfoHash[imageInfo.repo], userInfo ); + imageInfoPromise, repoInfoPromise + ).then( function ( imageInfo, repoInfoHash ) { + return $.Deferred().resolve( imageInfo, repoInfoHash[imageInfo.repo] ); } ); }; diff --git a/resources/mmv/model/mmv.model.Image.js b/resources/mmv/model/mmv.model.Image.js index 293ac01..c4214ba 100644 --- a/resources/mmv/model/mmv.model.Image.js +++ b/resources/mmv/model/mmv.model.Image.js @@ -31,7 +31,6 @@ * @param {string} url URL to the image itself (original version) * @param {string} descriptionUrl URL to the image description page * @param {string} repo The repository this image belongs to - * @param {string} lastUploader The last person to upload a version of this image. * @param {string} uploadDateTime The time and date the last upload occurred * @param {string} anonymizedUploadDateTime Anonymized and EL-friendly version of uploadDateTime * @param {string} creationDateTime The time and date the original upload occurred @@ -56,7 +55,6 @@ url, descriptionUrl, repo, - lastUploader, uploadDateTime, anonymizedUploadDateTime, creationDateTime, @@ -97,9 +95,6 @@ /** @property {string} repo The name of the repository where this image is stored */ this.repo = repo; - - /** @property {string} lastUploader The person who uploaded the last version of the file */ - this.lastUploader = lastUploader; /** @property {string} uploadDateTime The date and time of the last upload */ this.uploadDateTime = uploadDateTime; @@ -208,7 +203,6 @@ innerInfo.url, innerInfo.descriptionurl, imageInfo.imagerepository, - innerInfo.user, uploadDateTime, anonymizedUploadDateTime, creationDateTime, diff --git a/resources/mmv/model/mmv.model.User.js b/resources/mmv/model/mmv.model.User.js deleted file mode 100644 index 12e0a35..0000000 --- a/resources/mmv/model/mmv.model.User.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * This file is part of the MediaWiki extension MultimediaViewer. - * - * MultimediaViewer is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * MultimediaViewer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with MultimediaViewer. If not, see <http://www.gnu.org/licenses/>. - */ - -( function ( mw ) { - /** - * Represents information about a MediaWiki user. - * @class mw.mmv.model.User - * @constructor - * @param {string} username - * @param {mw.mmv.model.User.Gender} [gender='unknown'] - */ - function User( - username, - gender - ) { - var key, - genderIsValid = false; - - if ( !username || !gender ) { - throw 'All parameters are required and cannot be empty'; - } - - for ( key in User.Gender ) { - if ( User.Gender.hasOwnProperty( key ) && User.Gender[key] === gender ) { - genderIsValid = true; - } - } - if ( !genderIsValid ) { - throw 'invalid gender: ' + gender; - } - - /** - * The user's name, without namespace prefix, in human-readable format - * ("John Doe", not "John_Doe") - * @property {string} - */ - this.username = username; - - /** - * Gender of the user. - * @type {mw.mmv.model.User.Gender} - */ - this.gender = gender; - } - - /** - * Gender of the user (can be set at preferences, UNKNOWN means they did not set it). - * This is mainly used for translations, so in wikis where there are no grammatic genders - * it is not used much (or misused for weird things like showing online status). - * (This should really belong to a model, but there is no point in having a user model if we - * only need a single property.) - * @enum {string} mw.mmv.model.User.Gender - */ - User.Gender = { - /** User choose 'male' in preferences */ - MALE: 'male', - /** User choose 'female' in preferences */ - FEMALE: 'female', - /** User did not choose any gender in preferences */ - UNKNOWN: 'unknown' - }; - - mw.mmv.model.User = User; -}( mediaWiki ) ); diff --git a/resources/mmv/provider/mmv.provider.ImageInfo.js b/resources/mmv/provider/mmv.provider.ImageInfo.js index 57721af..ef48aea 100644 --- a/resources/mmv/provider/mmv.provider.ImageInfo.js +++ b/resources/mmv/provider/mmv.provider.ImageInfo.js @@ -44,7 +44,6 @@ */ ImageInfo.prototype.iiprop = [ 'timestamp', - 'user', 'url', 'size', 'mime', diff --git a/resources/mmv/provider/mmv.provider.UserInfo.js b/resources/mmv/provider/mmv.provider.UserInfo.js deleted file mode 100644 index e850323..0000000 --- a/resources/mmv/provider/mmv.provider.UserInfo.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - * This file is part of the MediaWiki extension MultimediaViewer. - * - * MultimediaViewer is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * MultimediaViewer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with MultimediaViewer. If not, see <http://www.gnu.org/licenses/>. - */ - -( function ( mw, $, oo ) { - - /** - * Gets user information (currently just the gender). - * See https://www.mediawiki.org/wiki/API:Users - * @class mw.mmv.provider.UserInfo - * @extends mw.mmv.provider.Api - * @constructor - * @param {mw.Api} api - * @param {Object} [options] - * @cfg {boolean} [useApi=true] If false, always returns an empty result immediately, - * without doing an actual API call. Used when the current language does not have genders. - * @cfg {number} [maxage] cache expiration time, in seconds - * Will be used for both client-side cache (maxage) and reverse proxies (s-maxage) - */ - function UserInfo( api, options ) { - options = $.extend( { useApi: true }, options ); - - mw.mmv.provider.Api.call( this, api, options ); - } - oo.inheritClass( UserInfo, mw.mmv.provider.Api ); - - /** - * Runs an API GET request to get the user info. - * @param {string} username - * @param {mw.mmv.model.Repo} repoInfo - * @return {jQuery.Promise.<mw.mmv.model.User>} user - */ - UserInfo.prototype.get = function ( username, repoInfo ) { - var user, - provider = this, - ajaxOptions = {}, - cacheKey = username; - - if ( !this.options.useApi ) { - // Create a user object with unknown gender without doing an API request. - // This is used when the language does not use genders, so it would be a waste of time. - // (This might maybe result in incorrect text if the message does not have a translation - // and the fallback language does have genders, but that's an extremely rare edge case - // we can just ignore.) - user = new mw.mmv.model.User( username, mw.mmv.model.User.Gender.UNKNOWN ); - user.fake = true; - return $.Deferred().resolve( user ); - } - - // For local/shared db images the user should be visible via a local API request, - // maybe. (In practice we have Wikimedia users who haven't completed the SUL - // merge process yet, and other sites might even use a shared DB for images - // without CentralAuth. Too bad for them.) - // For InstantCommons images we need to get user data directly from the repo's API. - if ( repoInfo.apiUrl ) { - ajaxOptions.url = repoInfo.apiUrl; - ajaxOptions.dataType = 'jsonp'; - ajaxOptions.cache = true; // do not append `_=<timestamp>` to the URL - ajaxOptions.jsonpCallback = this.getCallbackName( username ); - cacheKey = cacheKey + '|' + repoInfo.apiUrl; // local and remote user names could conflict - } - - return this.getCachedPromise( cacheKey, function () { - return provider.apiGetWithMaxAge( { - action: 'query', - list: 'users', - ususers: username, - usprop: 'gender' - }, ajaxOptions ).then( function ( data ) { - return provider.getQueryField( 'users', data ); - } ).then( function ( users ) { - if ( users[0] && users[0].name && users[0].gender ) { - return new mw.mmv.model.User( users[0].name, users[0].gender ); - } else { - mw.log( 'user info not found for ' + username + ' at ' + repoInfo.name ); - return new mw.mmv.model.User( username, mw.mmv.model.User.Gender.UNKNOWN ); - } - } ); - } ); - }; - - /**, - * Generate JSONP callback function name. - * jQuery uses a random string by default, which would break caching. - * On the other hand the callback needs to be unique to avoid surprises when multiple - * requests run in parallel. And of course needs to be a valid JS variable name. - * @param username - */ - UserInfo.prototype.getCallbackName = function ( username ) { - // Javascript variable name charset rules are fairly lax but better safe then sorry, - // so let's encode every non-alphanumeric character. - // Per http://stackoverflow.com/questions/1809153/maximum-length-of-variable-name-in-javascript - // length should not be an issue (might add a few hundred bytes to the request & response size - // for very long usernames, but we can live with that). - return 'mmv_userinfo_' + mw.util.rawurlencode( username )// encodes all characters except -.~_ - .replace( /-/g, '%2D' ).replace( /\./g, '%2E' ).replace( /~/g, '%7E' ).replace( /_/g, '%5F' ) - .replace( /%/g, '_' ); - }; - - mw.mmv.provider.UserInfo = UserInfo; -}( mediaWiki, jQuery, OO ) ); diff --git a/resources/mmv/ui/img/uploader-ltr.svg b/resources/mmv/ui/img/uploader-ltr.svg deleted file mode 100644 index 48ea6bb..0000000 --- a/resources/mmv/ui/img/uploader-ltr.svg +++ /dev/null @@ -1,55 +0,0 @@ -<?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="85" - height="80" - id="svg2"> - <metadata - id="metadata16"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs14" /> - <g - transform="matrix(1.6614596,0,0,1.6614596,-73.590709,-26.97237)" - id="g3008"> - <path - d="m 77.735565,53.958696 0,-11.374448 H 70.228429 L 80.692921,32.574733 V 22.110241 H 48.616978 c -4.54978,0 -4.322291,3.867312 -4.322291,4.094801 v 32.303433 h 31.165988 c 4.54978,0 4.777268,-4.549779 4.777268,-4.549779 h -2.502378 z" - id="path3" - style="fill:#8e9093" /> - <path - d="m 57.034069,32.119755 c 1.364934,0 2.729868,1.137445 2.729868,2.729868 0,1.364934 -1.137445,2.729867 -2.729868,2.729867 -1.364934,0 -2.729867,-1.137444 -2.729867,-2.729867 0.227489,-1.592423 1.364933,-2.729868 2.729867,-2.729868 z" - id="path5" - style="fill:#ffffff" /> - <circle - cx="444.5" - cy="379.5" - r="1.2" - transform="matrix(2.2748896,0,0,2.2748896,-943.0074,-828.69849)" - id="circle7" - style="fill:#ffffff" /> - <path - d="m 62.493804,49.863894 c -4.094801,0 -7.962113,-1.364933 -10.237003,-3.639823 -0.682467,-0.682467 -0.682467,-1.592423 0,-2.047401 0.682467,-0.682467 1.592423,-0.682467 2.047401,0 1.819911,1.819912 5.004757,2.729868 8.189602,2.729868 3.184846,0 6.369691,-1.137445 8.189603,-2.729868 0.682467,-0.682467 1.592423,-0.454978 2.047401,0 0.682467,0.682467 0.454978,1.592423 0,2.047401 -2.27489,2.502379 -6.142202,3.639823 -10.237004,3.639823 z" - id="path9" - style="fill:#ffffff" /> - <path - d="m 81.661879,51.699079 8.619227,0 0,-11.46882 5.171538,0 -9.193844,-8.810768 -9.768459,8.810768 5.171538,0 z" - id="Shape_6_" - style="fill:#8e9093" /> - </g> -</svg> diff --git a/resources/mmv/ui/img/uploader-rtl.svg b/resources/mmv/ui/img/uploader-rtl.svg deleted file mode 100644 index 357d9e3..0000000 --- a/resources/mmv/ui/img/uploader-rtl.svg +++ /dev/null @@ -1,55 +0,0 @@ -<?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="80" - height="80" - id="svg2"> - <metadata - id="metadata16"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <defs - id="defs14" /> - <g - transform="matrix(1.5559847,0,0,1.5559847,-68.918929,-22.720744)" - id="g3008"> - <path - d="m 62.009885,53.958696 0,-11.374448 h 7.507136 L 59.052529,32.574733 V 22.110241 h 32.075943 c 4.54978,0 4.322291,3.867312 4.322291,4.094801 V 58.508475 H 64.284775 c -4.54978,0 -4.777268,-4.549779 -4.777268,-4.549779 h 2.502378 z" - id="path3" - style="fill:#8e9093" /> - <path - d="m 82.711381,32.119755 c -1.364934,0 -2.729868,1.137445 -2.729868,2.729868 0,1.364934 1.137445,2.729867 2.729868,2.729867 1.364934,0 2.729867,-1.137444 2.729867,-2.729867 -0.227489,-1.592423 -1.364933,-2.729868 -2.729867,-2.729868 z" - id="path5" - style="fill:#ffffff" /> - <circle - cx="444.5" - cy="379.5" - r="1.2" - transform="matrix(-2.2748896,0,0,2.2748896,1082.7528,-828.69849)" - id="circle7" - style="fill:#ffffff" /> - <path - d="m 77.251646,49.863894 c 4.094801,0 7.962113,-1.364933 10.237003,-3.639823 0.682467,-0.682467 0.682467,-1.592423 0,-2.047401 -0.682467,-0.682467 -1.592423,-0.682467 -2.047401,0 -1.819911,1.819912 -5.004757,2.729868 -8.189602,2.729868 -3.184846,0 -6.369691,-1.137445 -8.189603,-2.729868 -0.682467,-0.682467 -1.592423,-0.454978 -2.047401,0 -0.682467,0.682467 -0.454978,1.592423 0,2.047401 2.27489,2.502379 6.142202,3.639823 10.237004,3.639823 z" - id="path9" - style="fill:#ffffff" /> - <path - d="m 58.083571,51.699079 -8.619227,0 0,-11.46882 -5.171538,0 9.193844,-8.810768 9.768459,8.810768 -5.171538,0 z" - id="Shape_6_" - style="fill:#8e9093" /> - </g> -</svg> diff --git a/resources/mmv/ui/mmv.ui.metadataPanel.js b/resources/mmv/ui/mmv.ui.metadataPanel.js index 919ff9d..b8cf571 100644 --- a/resources/mmv/ui/mmv.ui.metadataPanel.js +++ b/resources/mmv/ui/mmv.ui.metadataPanel.js @@ -165,9 +165,6 @@ this.$filenamePrefix.empty(); this.$filenameLi.addClass( 'empty' ); - this.$username.empty(); - this.$usernameLi.addClass( 'empty' ); - this.$datetime.empty(); this.$datetimeLi.addClass( 'empty' ); @@ -309,7 +306,6 @@ this.initializeLicense(); this.initializeFilename(); - this.initializeUploader(); this.initializeDatetime(); this.initializeLocation(); }; @@ -383,21 +379,6 @@ }; /** - * Initializes the link to the uploader's file page. - */ - MPP.initializeUploader = function () { - this.$usernameLi = $( '<li>' ) - .addClass( 'mw-mmv-username-li empty' ) - .appendTo( this.$imageLinks ); - - this.$username = $( '<a>' ) - .addClass( 'mw-mmv-username' ) - .prop( 'href', '#' ) - .appendTo( this.$usernameLi ) - .click( function () { mw.mmv.actionLogger.log( 'uploader-page' ); } ); - }; - - /** * Initializes the geolocation element. */ MPP.initializeLocation = function () { @@ -450,28 +431,6 @@ // ********************************* // ******** Setting methods ******** // ********************************* - - /** - * Sets the link to the user page where possible - * @param {mw.mmv.model.Repo} repoData - * @param {string} username - * @param {string} gender - */ - MPP.setUserPageLink = function ( repoData, username, gender ) { - var userpage = 'User:' + username, - articlePath = repoData.getArticlePath(), - // articlePath is null when the imageinfo API query fails - userlink = ( typeof articlePath === 'string' ) - ? articlePath.replace( '$1', userpage ) : undefined; - - this.$username - .text( - mw.message( 'multimediaviewer-userpage-link', username, gender ).text() - ) - .prop( 'href', userlink ); - - this.$usernameLi.toggleClass( 'empty', !username ); - }; /** * Sets the image title at the top of the metadata panel. @@ -784,9 +743,8 @@ * @param {mw.mmv.LightboxImage} image * @param {mw.mmv.model.Image} imageData * @param {mw.mmv.model.Repo} repoData - * @param {mw.mmv.model.User} user */ - MPP.setImageInfo = function ( image, imageData, repoData, user ) { + MPP.setImageInfo = function ( image, imageData, repoData ) { var panel = this; mw.mmv.attributionLogger.logAttribution( imageData ); @@ -828,10 +786,6 @@ } this.setLocationData( imageData ); - - if ( user ) { - this.setUserPageLink( repoData, imageData.lastUploader, user.gender ); - } this.resetTruncatedText(); this.scroller.unfreezeHeight(); diff --git a/resources/mmv/ui/mmv.ui.metadataPanel.less b/resources/mmv/ui/mmv.ui.metadataPanel.less index 4fe7834..08bc0a4 100644 --- a/resources/mmv/ui/mmv.ui.metadataPanel.less +++ b/resources/mmv/ui/mmv.ui.metadataPanel.less @@ -218,13 +218,6 @@ background-image: url(img/time.svg); } - &.mw-mmv-username-li:before { - /* @embed */ - background-image: url(img/uploader-ltr.svg); - width: 18px; - margin-right: 5px; - } - &.mw-mmv-location-li:before { /* @embed */ background-image: url(img/location.svg); -- To view, visit https://gerrit.wikimedia.org/r/260931 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7d06b72c581fe8738bffc64b5e36be9983b01ccf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: master Gerrit-Owner: JadeMaveric <juliusalphonso...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits