/*
* 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
' )
.addClass( 'mw-mmv-title-para' )
.appendTo( this.$titleAndCredit );
this.$title = $( '' )
.prop( 'title', mw.message( 'multimediaviewer-title-popup-text' ) )
.tipsy( {
delayIn: mw.config.get( 'wgMultimediaViewer').tooltipDelay,
gravity: this.isRTL() ? 'se' : 'sw'
} )
.addClass( 'mw-mmv-title' );
this.title = new mw.mmv.ui.TruncatableTextField( this.$titlePara, this.$title );
};
/**
* Initializes the credit elements.
*/
MPP.initializeCredit = function () {
this.$credit = $( ' ' )
.addClass( 'mw-mmv-credit empty' );
this.creditField = new mw.mmv.ui.TruncatableTextField(
this.$titleAndCredit,
this.$credit,
{ max: 200, small: 160 }
);
};
/**
* Initializes the license elements.
*/
MPP.initializeLicense = function () {
var panel = this;
this.$license = $( '' )
.addClass( 'mw-mmv-license empty' )
.prop( 'href', '#' )
.appendTo( this.$titlePara )
.on( 'click', function() {
mw.mmv.actionLogger.log( 'license-page' );
} );
this.$permissionLink = $( '' )
.addClass( 'mw-mmv-permission-link mw-mmv-label' )
.text( mw.message( 'multimediaviewer-permission-link' ).text() )
.appendTo( this.$titlePara )
.hide()
.on( 'click', function() {
panel.permission.grow();
panel.scroller.scrollIntoView( panel.permission.$box, 500 );
} );
};
MPP.initializeButtons = function () {
this.buttons = new mw.mmv.ui.StripeButtons( this.$titleDiv, this.localStorage );
};
/**
* Initializes the main body of metadata elements.
*/
MPP.initializeImageMetadata = function () {
this.$imageMetadata = $( '' )
.addClass( 'mw-mmv-image-links' )
.appendTo( this.$imageLinkDiv );
this.initializeUploader();
this.initializeDatetime();
this.initializeLocation();
this.initializeCategories();
this.initializeRepoLink();
this.fileReuse = new mw.mmv.ui.reuse.Dialog( this.$container, this.buttons.buttons.$reuse );
this.fileUsage = new mw.mmv.ui.FileUsage(
$( '