/* * 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, $, oo ) { /** * File usage interface (what wiki pages is this file used on?) * @class mw.mmv.ui.FileUsage * @extends mw.mmv.ui.Element * @constructor * @inheritdoc */ function FileUsage( $container ) { mw.mmv.ui.Element.call( this, $container ); /** * The HTML element in which the file usage shall be shown. * @property {jQuery} */ this.$box = $( '
' ) .appendTo( this.$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; } oo.inheritClass( FileUsage, mw.mmv.ui.Element ); /** @property {number} MAX_LOCAL Never show more than this many local usages */ FileUsage.prototype.MAX_LOCAL = 3; /** @property {number} MAX_GLOBAL 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 = $( '

' ).appendTo( this.$box ); this.$usageList = $( '