/*
* This file is part of the MediaWiki extension MediaViewer.
*
* MediaViewer 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.
*
* MediaViewer 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 MediaViewer. If not, see .
*/
const { HtmlUtils } = require( 'mmv.bootstrap' );
const UiElement = require( './mmv.ui.js' );
const MetadataPanelScroller = require( './mmv.ui.metadataPanelScroller.js' );
( function () {
/**
* A box to display additional terms or remarks from the image author.
* (Typically comes from the Permission field of the {{Information}} template.)
* It has two states: when closed, it just shows some text, when open, it shows the HTML
* block supplied by the author in its full beauty.
*/
class Permission extends UiElement {
/**
* @param {jQuery} $container
* @param {MetadataPanelScroller} scroller
*/
constructor( $container, scroller ) {
super( $container );
/** @property {HtmlUtils} htmlUtils - */
this.htmlUtils = new HtmlUtils();
/**
* Contains everything else.
*
* @property {jQuery}
*/
this.$box = $( '
' )
.addClass( 'mw-mmv-permission-box mw-mmv-info-box empty' )
.appendTo( this.$container );
/**
* Box title
*
* @property {jQuery}
*/
this.$title = $( '