jenkins-bot has submitted this change and it was merged.
Change subject: Add description to the DOM
......................................................................
Add description to the DOM
This is all getting really real, really fast!
Depends on:
* core
:* I77303d8e535fc1c42e14cfb853814e5c434a81ec
* CommonsMetadata
:* I5e6bc45f9751641e16426231dabcc8277b86fee0
Change-Id: I203852358fc6f7592832e48c562b24c5d9f046f5
---
M css/ext.multimediaViewer.css
M js/ext.multimediaViewer.js
2 files changed, 21 insertions(+), 2 deletions(-)
Approvals:
Gergő Tisza: Looks good to me, approved
jenkins-bot: Verified
diff --git a/css/ext.multimediaViewer.css b/css/ext.multimediaViewer.css
index 730109f..f981da6 100644
--- a/css/ext.multimediaViewer.css
+++ b/css/ext.multimediaViewer.css
@@ -91,7 +91,8 @@
.mw-mlb-image-metadata {
margin-top: 30px;
- width: 100%;
+ width: 64%;
+ margin: 30px auto;
position: relative;
}
@@ -106,6 +107,10 @@
left: 0px;
}
+.mw-mlb-image-desc {
+ color: #6f7073;
+}
+
.mw-mlb-image-links-div {
right: 0px;
}
diff --git a/js/ext.multimediaViewer.js b/js/ext.multimediaViewer.js
index ddd7a50..9a77fa9 100644
--- a/js/ext.multimediaViewer.js
+++ b/js/ext.multimediaViewer.js
@@ -117,6 +117,7 @@
var extmeta,
repoInfo, articlePath,
+ desc,
ui = viewer.lightbox.iface,
innerInfo =
imageInfo.imageinfo[0] || {};
@@ -153,6 +154,17 @@
ui.$repoLi.toggleClass( 'empty',
!Boolean( repoInfo ) );
extmeta = innerInfo.extmetadata;
+
+ if ( extmeta ) {
+ desc = extmeta.ImageDescription;
+
+ if ( desc ) {
+ desc = desc.value;
+ ui.$imageDesc.html(
+ whitelistHtml(
$( desc ) )
+ );
+ }
+ }
} );
return false;
@@ -316,7 +328,9 @@
format: 'json',
titles: filename,
prop: 'imageinfo',
- iiprop: iiprops.join( '|' )
+ iiprop: iiprops.join( '|' ),
+ // Short-circuit, don't fallback, to save some
tiny amount of time
+ iiextmetadatalanguage: mw.config.get(
'wgUserLanguage', false ) || mw.config.get( 'wgContentLanguage', 'en' )
},
viewer = this;
--
To view, visit https://gerrit.wikimedia.org/r/89242
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I203852358fc6f7592832e48c562b24c5d9f046f5
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits