/*
* 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 .
*/
( function ( mw, $ ) {
/**
* File usage interface (what wiki pages is this file used on?)
* @class mw.mmv.interface.FileUsage
* @constructor
* @param {jQuery} $container
*/
function FileUsage( $container ) {
/**
* The HTML element in which the file usage shall be shown.
* @property {jQuery}
*/
this.$container = $container;
/**
* The title of the file usage block.
* @property {jQuery}
*/
this.$title = null;
/**
* The list which contains the wiki pages using the file (and also some miscellaneous
* stuff like 'view more' links).
* @property {jQuery}
*/
this.$usageList = null;
}
/** Never show more than this many local usages */
FileUsage.prototype.MAX_LOCAL = 3;
/** Never show more than this many global usages */
FileUsage.prototype.MAX_GLOBAL = 3;
/**
* Sets up the interface. Must be called before any other methods.
*/
FileUsage.prototype.init = function() {
this.$title = $( '