mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 00:03:56 +00:00
Deep-link to the license section of a file page
The necessary anchor link depends on the language used on Wikimedia Commons: * https://commons.wikimedia.org/wiki/File:GATEWAY_(Moon_Space_Station).png?uselang=en#Licensing * https://commons.wikimedia.org/wiki/File:GATEWAY_(Moon_Space_Station).png?uselang=de#Lizenz * Ref: https://commons.wikimedia.org/wiki/Template:License-header Remove jsduck due to lacking support for ES6 string templates. Bug: T336708 Change-Id: Ib71e647682835baa71bd375ae3098966ae01f26c
This commit is contained in:
parent
e91cddba2b
commit
d0066039ac
|
@ -107,6 +107,7 @@
|
|||
"mmv.head"
|
||||
],
|
||||
"messages": [
|
||||
"license-header",
|
||||
"multimediaviewer-file-page",
|
||||
"multimediaviewer-options-learn-more",
|
||||
"multimediaviewer-options-dialog-header",
|
||||
|
|
12
jsduck.json
12
jsduck.json
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"--title": "MultimediaViewer - Documentation",
|
||||
"--categories": "jsduck.categories.json",
|
||||
"--builtin-classes": true,
|
||||
"--processes": "0",
|
||||
"--warnings-exit-nonzero": true,
|
||||
"--output": "docs",
|
||||
"--": [
|
||||
"jsduck.external.js",
|
||||
"resources/"
|
||||
]
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
"build": "npm -s run minify-svg",
|
||||
"test": "grunt test",
|
||||
"minify-svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/",
|
||||
"doc": "jsduck"
|
||||
"doc": ""
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-config-wikimedia": "0.25.0",
|
||||
|
|
|
@ -540,6 +540,8 @@
|
|||
MPP.setLicense = function ( license, filePageUrl ) {
|
||||
var shortName, url, isCc, isPd;
|
||||
|
||||
filePageUrl += `?uselang=${mw.config.get( 'wgUserLanguage' )}#${mw.message( 'license-header' ).text()}`;
|
||||
|
||||
if ( license ) {
|
||||
shortName = license.getShortName();
|
||||
url = license.deedUrl || filePageUrl;
|
||||
|
|
|
@ -123,7 +123,8 @@ QUnit.test( '.setImageInfo()', function ( assert ) {
|
|||
|
||||
assert.strictEqual( panel.$title.text(), title, 'Title is correctly set' );
|
||||
assert.notStrictEqual( panel.$credit.text(), '', 'Default credit is shown' );
|
||||
assert.strictEqual( panel.$license.prop( 'href' ), imageData.descriptionUrl,
|
||||
assert.strictEqual( panel.$license.prop( 'href' ),
|
||||
imageData.descriptionUrl + '?uselang=qqx#(license-header)',
|
||||
'User is directed to file page for license information' );
|
||||
assert.strictEqual( panel.$license.prop( 'target' ), '', 'License information opens in same window' );
|
||||
assert.true( panel.$datetimeLi.hasClass( 'empty' ), 'Date/Time is empty' );
|
||||
|
|
Loading…
Reference in a new issue