2013-08-07 08:59:08 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup extensions
|
|
|
|
* @author Mark Holmquist <mtraceur@member.fsf.org>
|
|
|
|
* @copyright Copyright © 2013, Mark Holmquist
|
|
|
|
*/
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
// do not pollute global namespace
|
|
|
|
call_user_func( function() {
|
2014-03-07 01:56:56 +00:00
|
|
|
global $wgExtensionMessagesFiles, $wgResourceModules, $wgExtensionFunctions, $wgMediaViewerIsInBeta,
|
|
|
|
$wgAutoloadClasses, $wgHooks, $wgExtensionCredits, $wgNetworkPerformanceSamplingFactor,
|
2014-03-14 00:25:33 +00:00
|
|
|
$wgEnableMediaViewerForLoggedInUsersOnly, $wgDefaultUserOptions;
|
2014-02-06 16:17:38 +00:00
|
|
|
|
2014-03-27 21:42:22 +00:00
|
|
|
if ( !isset( $wgNetworkPerformanceSamplingFactor ) ) {
|
|
|
|
/** @var int|bool: If set, records image load network performance once per this many requests. False if unset. **/
|
|
|
|
$wgNetworkPerformanceSamplingFactor = false;
|
|
|
|
}
|
2014-01-31 00:06:33 +00:00
|
|
|
|
2014-03-27 21:42:22 +00:00
|
|
|
if ( !isset( $wgMediaViewerIsInBeta ) ) {
|
|
|
|
/** @var bool: If set, Media Viewer will try to use BetaFeatures. False if unset. **/
|
|
|
|
$wgMediaViewerIsInBeta = false;
|
|
|
|
}
|
2014-03-07 01:56:56 +00:00
|
|
|
|
2014-03-27 21:42:22 +00:00
|
|
|
if ( !isset( $wgEnableMediaViewerForLoggedInUsersOnly ) ) {
|
|
|
|
/**
|
|
|
|
* @var bool: If set, and $wgMediaViewerIsInBeta is unset, Media Viewer will be turned on for
|
|
|
|
* all logged-in users. False if unset.
|
|
|
|
*/
|
|
|
|
$wgEnableMediaViewerForLoggedInUsersOnly = false;
|
|
|
|
}
|
2014-03-07 01:56:56 +00:00
|
|
|
|
2014-03-28 09:52:39 +00:00
|
|
|
$wgMessagesDirs['MultimediaViewer'] = __DIR__ . '/i18n';
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgExtensionMessagesFiles['MultimediaViewer'] = __DIR__ . '/MultimediaViewer.i18n.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $path
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
$moduleInfo = function( $path ) {
|
|
|
|
return array(
|
|
|
|
'localBasePath' => __DIR__ . "/resources/$path",
|
|
|
|
'remoteExtPath' => "MultimediaViewer/resources/$path",
|
2013-12-06 17:10:39 +00:00
|
|
|
);
|
2014-01-31 00:06:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.lightboximage'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.lightboximage.js',
|
|
|
|
),
|
2014-02-25 02:28:49 +00:00
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.base',
|
|
|
|
),
|
2014-01-31 00:06:33 +00:00
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.lightboxinterface'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.lightboxinterface.js',
|
|
|
|
),
|
|
|
|
|
2014-03-05 02:24:18 +00:00
|
|
|
'styles' => array(
|
|
|
|
'mmv.lightboxinterface.less',
|
|
|
|
),
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
'dependencies' => array(
|
2014-02-25 02:28:49 +00:00
|
|
|
'mmv.base',
|
2014-03-04 12:52:08 +00:00
|
|
|
'mmv.ui',
|
2014-02-26 20:09:37 +00:00
|
|
|
'mmv.ui.canvas',
|
2014-03-28 00:10:04 +00:00
|
|
|
'mmv.ui.canvasButtons',
|
2014-02-03 11:13:37 +00:00
|
|
|
'mmv.ui.categories',
|
2014-01-31 00:06:33 +00:00
|
|
|
'mmv.ui.description',
|
|
|
|
'mmv.ui.fileUsage',
|
2014-02-07 14:47:00 +00:00
|
|
|
'mmv.ui.metadataPanel',
|
2014-02-06 23:18:47 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.ThumbnailWidthCalculator'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ThumbnailWidthCalculator.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.hidpi',
|
|
|
|
'mmv.base',
|
|
|
|
'mmv.model.ThumbnailWidth',
|
2014-01-31 00:06:33 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-03-26 23:59:04 +00:00
|
|
|
$wgResourceModules['mmv.HtmlUtils'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.HtmlUtils.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.base',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgResourceModules['mmv.model'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.base',
|
|
|
|
'oojs',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
2014-03-19 02:00:26 +00:00
|
|
|
$wgResourceModules['mmv.model.EmbedFileInfo'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.EmbedFileInfo.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
2014-03-20 01:19:54 +00:00
|
|
|
$wgResourceModules['mmv.model.License'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.License.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
2014-03-26 23:59:04 +00:00
|
|
|
'mmv.HtmlUtils',
|
2014-03-20 01:19:54 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgResourceModules['mmv.model.FileUsage'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.FileUsage.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.model.Image'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.Image.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
2014-03-20 01:19:54 +00:00
|
|
|
'mmv.model.License',
|
2014-01-31 00:06:33 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.model.Repo'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.Repo.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
'oojs',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
2014-02-05 01:06:10 +00:00
|
|
|
$wgResourceModules['mmv.model.Thumbnail'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.Thumbnail.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
2014-02-06 23:18:47 +00:00
|
|
|
$wgResourceModules['mmv.model.ThumbnailWidth'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.ThumbnailWidth.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
2014-02-13 09:52:40 +00:00
|
|
|
$wgResourceModules['mmv.model.User'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.User.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
2014-02-10 21:24:19 +00:00
|
|
|
$wgResourceModules['mmv.model.TaskQueue'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.TaskQueue.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/model' ) );
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgResourceModules['mmv.provider'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.provider.Api.js',
|
|
|
|
'mmv.provider.ImageUsage.js',
|
|
|
|
'mmv.provider.GlobalUsage.js',
|
2014-01-31 02:03:08 +00:00
|
|
|
'mmv.provider.ImageInfo.js',
|
|
|
|
'mmv.provider.FileRepoInfo.js',
|
|
|
|
'mmv.provider.ThumbnailInfo.js',
|
2014-02-06 00:12:50 +00:00
|
|
|
'mmv.provider.UserInfo.js',
|
2014-02-04 04:37:22 +00:00
|
|
|
'mmv.provider.Image.js',
|
2014-01-31 00:06:33 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mediawiki.Title',
|
|
|
|
'mmv.model',
|
2014-03-07 23:53:23 +00:00
|
|
|
'mmv.model.FileUsage',
|
|
|
|
'mmv.model.Image',
|
|
|
|
'mmv.model.Repo',
|
|
|
|
'mmv.model.Thumbnail',
|
|
|
|
'mmv.model.User',
|
2014-02-15 02:15:54 +00:00
|
|
|
'mmv.performance',
|
2014-03-07 23:53:23 +00:00
|
|
|
'oojs',
|
2014-01-31 00:06:33 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/provider' ) );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.base'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.base.js',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.ui'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.js',
|
|
|
|
),
|
|
|
|
|
2014-02-14 00:36:10 +00:00
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.less',
|
|
|
|
),
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.base',
|
|
|
|
),
|
2014-02-03 22:46:04 +00:00
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
2014-01-31 00:06:33 +00:00
|
|
|
|
2014-02-26 20:09:37 +00:00
|
|
|
$wgResourceModules['mmv.ui.canvas'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.canvas.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.canvas.less',
|
|
|
|
),
|
|
|
|
|
2014-03-01 01:10:51 +00:00
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-thumbnail-error',
|
|
|
|
),
|
|
|
|
|
2014-02-26 20:09:37 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui',
|
|
|
|
'mmv.ThumbnailWidthCalculator',
|
|
|
|
'oojs',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-02-03 11:13:37 +00:00
|
|
|
$wgResourceModules['mmv.ui.categories'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.categories.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.categories.less',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui',
|
|
|
|
'oojs',
|
|
|
|
),
|
2014-03-07 23:53:23 +00:00
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'comma-separator',
|
|
|
|
),
|
2014-02-03 22:46:04 +00:00
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
2014-02-03 11:13:37 +00:00
|
|
|
|
2014-04-01 01:41:57 +00:00
|
|
|
$wgResourceModules['mmv.ui.stripeButtons'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.stripeButtons.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.stripeButtons.less',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui',
|
|
|
|
'oojs',
|
2014-04-02 00:39:54 +00:00
|
|
|
'jquery.tipsy',
|
2014-04-01 01:41:57 +00:00
|
|
|
),
|
2014-04-01 19:02:33 +00:00
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-feedback-button-text',
|
|
|
|
'multimediaviewer-feedback-popup-text',
|
2014-04-02 00:07:51 +00:00
|
|
|
'multimediaviewer-description-page-button-text',
|
|
|
|
'multimediaviewer-description-page-popup-text',
|
|
|
|
'multimediaviewer-description-page-popup-text-local',
|
2014-04-02 01:58:41 +00:00
|
|
|
'multimediaviewer-reuse-link',
|
2014-04-01 19:02:33 +00:00
|
|
|
),
|
2014-04-01 01:41:57 +00:00
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgResourceModules['mmv.ui.description'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.description.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui',
|
2014-03-26 23:59:04 +00:00
|
|
|
'mmv.HtmlUtils',
|
2014-01-31 00:06:33 +00:00
|
|
|
'oojs',
|
|
|
|
),
|
2014-02-03 22:46:04 +00:00
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
2014-01-31 00:06:33 +00:00
|
|
|
|
|
|
|
$wgResourceModules['mmv.ui.fileUsage'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.fileUsage.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.fileUsage.less',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-03-07 23:53:23 +00:00
|
|
|
'mediawiki.language',
|
2014-01-31 00:06:33 +00:00
|
|
|
'mediawiki.Uri',
|
|
|
|
'mediawiki.jqueryMsg',
|
|
|
|
'mmv.ui',
|
|
|
|
'oojs',
|
|
|
|
),
|
2014-03-07 23:53:23 +00:00
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-fileusage-count',
|
|
|
|
'multimediaviewer-fileusage-count-more',
|
|
|
|
'multimediaviewer-fileusage-link',
|
|
|
|
'multimediaviewer-fileusage-local-section',
|
|
|
|
'multimediaviewer-fileusage-global-section',
|
|
|
|
),
|
2014-02-03 22:46:04 +00:00
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
2014-01-31 00:06:33 +00:00
|
|
|
|
2014-02-14 00:36:10 +00:00
|
|
|
$wgResourceModules['mmv.ui.permission'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.permission.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.permission.less',
|
|
|
|
),
|
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-permission-title',
|
2014-02-26 02:47:24 +00:00
|
|
|
'multimediaviewer-permission-viewmore',
|
2014-02-14 00:36:10 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.color',
|
|
|
|
'mediawiki.jqueryMsg',
|
|
|
|
'mmv.ui',
|
2014-03-26 23:59:04 +00:00
|
|
|
'mmv.HtmlUtils',
|
2014-02-14 00:36:10 +00:00
|
|
|
'oojs',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-02-07 14:47:00 +00:00
|
|
|
$wgResourceModules['mmv.ui.metadataPanel'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.metadataPanel.js',
|
|
|
|
),
|
2014-02-14 00:36:10 +00:00
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.metadataPanel.less',
|
|
|
|
),
|
2014-02-07 14:47:00 +00:00
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui',
|
2014-04-01 01:41:57 +00:00
|
|
|
'mmv.ui.stripeButtons',
|
2014-03-07 23:53:23 +00:00
|
|
|
'mmv.ui.categories',
|
|
|
|
'mmv.ui.description',
|
2014-02-14 00:36:10 +00:00
|
|
|
'mmv.ui.fileUsage',
|
|
|
|
'mmv.ui.permission',
|
2014-03-17 08:07:53 +00:00
|
|
|
'mmv.ui.reuse.dialog',
|
2014-03-26 23:59:04 +00:00
|
|
|
'mmv.HtmlUtils',
|
2014-02-18 08:19:10 +00:00
|
|
|
'moment',
|
2014-03-07 23:53:23 +00:00
|
|
|
'oojs',
|
2014-02-07 14:47:00 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-repository',
|
|
|
|
'multimediaviewer-repository-local',
|
|
|
|
|
|
|
|
'multimediaviewer-credit',
|
|
|
|
|
|
|
|
'multimediaviewer-userpage-link',
|
|
|
|
|
|
|
|
'multimediaviewer-datetime-created',
|
|
|
|
'multimediaviewer-datetime-uploaded',
|
|
|
|
|
2014-02-14 00:36:10 +00:00
|
|
|
// for license messages see end of file
|
|
|
|
'multimediaviewer-permission-link',
|
|
|
|
|
2014-02-07 14:47:00 +00:00
|
|
|
'multimediaviewer-geoloc-north',
|
|
|
|
'multimediaviewer-geoloc-east',
|
|
|
|
'multimediaviewer-geoloc-south',
|
|
|
|
'multimediaviewer-geoloc-west',
|
|
|
|
'multimediaviewer-geoloc-coord',
|
|
|
|
'multimediaviewer-geoloc-coords',
|
|
|
|
'multimediaviewer-geolocation',
|
|
|
|
|
|
|
|
'multimediaviewer-about-mmv',
|
|
|
|
'multimediaviewer-discuss-mmv',
|
2014-03-24 13:35:34 +00:00
|
|
|
'multimediaviewer-help-mmv',
|
2014-03-01 01:10:51 +00:00
|
|
|
|
|
|
|
'multimediaviewer-metadata-error',
|
2014-02-07 14:47:00 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-03-19 02:00:26 +00:00
|
|
|
$wgResourceModules['mmv.embedFileFormatter'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.EmbedFileFormatter.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.base',
|
|
|
|
'oojs',
|
2014-03-26 23:59:04 +00:00
|
|
|
'mmv.HtmlUtils',
|
2014-03-19 02:00:26 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-credit',
|
|
|
|
|
|
|
|
'multimediaviewer-html-embed-credit-text-tbls',
|
|
|
|
'multimediaviewer-html-embed-credit-text-tls',
|
|
|
|
'multimediaviewer-html-embed-credit-text-tbs',
|
|
|
|
'multimediaviewer-html-embed-credit-text-tbl',
|
|
|
|
'multimediaviewer-html-embed-credit-text-tb',
|
|
|
|
'multimediaviewer-html-embed-credit-text-ts',
|
|
|
|
'multimediaviewer-html-embed-credit-text-tl',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-03-17 08:07:53 +00:00
|
|
|
$wgResourceModules['mmv.ui.reuse.dialog'] = array_merge( array(
|
2014-02-07 14:47:00 +00:00
|
|
|
'scripts' => array(
|
2014-03-17 08:07:53 +00:00
|
|
|
'mmv.ui.reuse.dialog.js',
|
2014-02-07 14:47:00 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
2014-03-17 08:07:53 +00:00
|
|
|
'mmv.ui.reuse.dialog.less',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui',
|
|
|
|
'oojs',
|
|
|
|
'oojs-ui',
|
|
|
|
'mmv.ui.reuse.share',
|
2014-03-19 02:00:26 +00:00
|
|
|
'mmv.ui.reuse.embed',
|
2014-03-31 16:08:02 +00:00
|
|
|
'mmv.ui.reuse.download',
|
2014-03-17 08:07:53 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-03-31 16:08:02 +00:00
|
|
|
$wgResourceModules['mmv.ui.reuse.utils'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.reuse.utils.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.HtmlUtils',
|
|
|
|
'mmv.ui',
|
|
|
|
'oojs',
|
|
|
|
'oojs-ui',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-03-17 08:07:53 +00:00
|
|
|
$wgResourceModules['mmv.ui.reuse.tab'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.reuse.tab.js',
|
2014-02-07 14:47:00 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui',
|
|
|
|
'oojs',
|
|
|
|
),
|
2014-03-17 08:07:53 +00:00
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.ui.reuse.share'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.reuse.share.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.reuse.share.less',
|
2014-03-26 13:34:44 +00:00
|
|
|
'mmv.ui.reuse.shareembed.less',
|
2014-03-17 08:07:53 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui.reuse.tab',
|
2014-03-31 16:08:02 +00:00
|
|
|
'mmv.ui.reuse.utils',
|
2014-03-17 08:07:53 +00:00
|
|
|
'oojs',
|
|
|
|
'oojs-ui',
|
|
|
|
),
|
|
|
|
|
|
|
|
'messages' => array(
|
2014-03-19 22:35:55 +00:00
|
|
|
'multimediaviewer-reuse-loading-placeholder',
|
2014-03-17 08:07:53 +00:00
|
|
|
'multimediaviewer-share-tab',
|
2014-03-26 13:34:44 +00:00
|
|
|
'multimediaviewer-share-explanation',
|
2014-03-17 08:07:53 +00:00
|
|
|
|
|
|
|
'multimediaviewer-link-to-file',
|
|
|
|
'multimediaviewer-link-to-page',
|
|
|
|
),
|
2014-02-07 14:47:00 +00:00
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-03-19 02:00:26 +00:00
|
|
|
$wgResourceModules['mmv.ui.reuse.embed'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.reuse.embed.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.reuse.embed.less',
|
2014-03-26 13:34:44 +00:00
|
|
|
'mmv.ui.reuse.shareembed.less',
|
2014-03-19 02:00:26 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui.reuse.tab',
|
2014-03-31 16:08:02 +00:00
|
|
|
'mmv.ui.reuse.utils',
|
2014-03-19 02:00:26 +00:00
|
|
|
'oojs',
|
|
|
|
'oojs-ui',
|
|
|
|
'mmv.model.EmbedFileInfo',
|
|
|
|
'mmv.embedFileFormatter',
|
|
|
|
),
|
|
|
|
|
|
|
|
'messages' => array(
|
2014-03-19 22:35:55 +00:00
|
|
|
'multimediaviewer-reuse-loading-placeholder',
|
2014-03-19 02:00:26 +00:00
|
|
|
'multimediaviewer-embed-tab',
|
|
|
|
'multimediaviewer-embed-html',
|
|
|
|
'multimediaviewer-embed-wt',
|
2014-03-26 13:34:44 +00:00
|
|
|
'multimediaviewer-embed-explanation',
|
2014-03-19 02:00:26 +00:00
|
|
|
|
|
|
|
'multimediaviewer-embed-byline',
|
|
|
|
'multimediaviewer-embed-license',
|
|
|
|
'multimediaviewer-embed-via',
|
|
|
|
|
2014-03-24 14:44:41 +00:00
|
|
|
'multimediaviewer-default-embed-dimensions',
|
|
|
|
'multimediaviewer-original-embed-dimensions',
|
|
|
|
'multimediaviewer-large-embed-dimensions',
|
|
|
|
'multimediaviewer-medium-embed-dimensions',
|
|
|
|
'multimediaviewer-small-embed-dimensions',
|
|
|
|
'multimediaviewer-embed-dimensions',
|
2014-03-31 16:08:02 +00:00
|
|
|
'multimediaviewer-embed-dimensions-separated',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.ui.reuse.download'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.ui.reuse.download.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
|
|
|
'mmv.ui.reuse.download.less',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mediawiki.ui',
|
|
|
|
'mediawiki.ui.button',
|
|
|
|
'mmv.ui.reuse.tab',
|
|
|
|
'mmv.ui.reuse.utils',
|
|
|
|
),
|
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-download-tab',
|
|
|
|
'multimediaviewer-download-preview-link-title',
|
|
|
|
'multimediaviewer-download-original-button-name',
|
|
|
|
'multimediaviewer-download-small-button-name',
|
|
|
|
'multimediaviewer-download-medium-button-name',
|
|
|
|
'multimediaviewer-download-large-button-name',
|
|
|
|
'multimediaviewer-embed-dimensions',
|
|
|
|
'multimediaviewer-embed-dimensions-with-file-format',
|
2014-03-19 02:00:26 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-03-28 00:10:04 +00:00
|
|
|
$wgResourceModules['mmv.ui.canvasButtons'] = array_merge( array(
|
2014-02-04 23:44:36 +00:00
|
|
|
'scripts' => array(
|
2014-03-28 00:10:04 +00:00
|
|
|
'mmv.ui.canvasButtons.js',
|
2014-02-04 23:44:36 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
2014-03-28 00:10:04 +00:00
|
|
|
'mmv.ui.canvasButtons.less',
|
2014-02-04 23:44:36 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.ui',
|
|
|
|
'oojs',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv/ui' ) );
|
|
|
|
|
2014-02-07 14:47:00 +00:00
|
|
|
$wgResourceModules['mmv.logger'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.logger.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-02-17 15:09:23 +00:00
|
|
|
'mmv.base',
|
2014-02-07 14:47:00 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-02-06 16:17:38 +00:00
|
|
|
$wgResourceModules['mmv.performance'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.performance.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-02-11 13:25:39 +00:00
|
|
|
'mmv.base',
|
2014-02-06 16:17:38 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-02-15 02:15:54 +00:00
|
|
|
$wgResourceModules['mmv.api'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.api.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mediawiki.api',
|
|
|
|
'mmv.base',
|
2014-02-19 14:41:40 +00:00
|
|
|
'oojs',
|
2014-02-15 02:15:54 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgResourceModules['mmv'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
2014-02-03 04:04:20 +00:00
|
|
|
'mmv.less',
|
2014-02-24 17:06:11 +00:00
|
|
|
// Always make this one the last of the list (Bug 61852)
|
|
|
|
'mmv.loaded.css',
|
2014-01-31 00:06:33 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-03-07 23:53:23 +00:00
|
|
|
'mmv.api',
|
2014-02-25 02:28:49 +00:00
|
|
|
'mmv.base',
|
2014-01-31 00:06:33 +00:00
|
|
|
'mmv.lightboximage',
|
2014-03-07 23:53:23 +00:00
|
|
|
'mmv.model.TaskQueue',
|
|
|
|
'mmv.lightboxinterface',
|
|
|
|
'mmv.provider',
|
2014-01-31 00:06:33 +00:00
|
|
|
'jquery.fullscreen',
|
2014-03-07 23:53:23 +00:00
|
|
|
'jquery.hidpi',
|
|
|
|
'jquery.scrollTo',
|
2014-02-12 21:30:18 +00:00
|
|
|
'jquery.throttle-debounce',
|
2014-03-17 08:07:53 +00:00
|
|
|
'jquery.hidpi',
|
2014-01-31 00:06:33 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-file-page',
|
|
|
|
'multimediaviewer-desc-nil',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-02-17 15:09:23 +00:00
|
|
|
$wgResourceModules['mmv.bootstrap'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.bootstrap.js',
|
|
|
|
),
|
|
|
|
|
2014-03-28 08:06:53 +00:00
|
|
|
'styles' => array(
|
|
|
|
'mmv.bootstrap.less',
|
|
|
|
),
|
|
|
|
|
2014-02-17 15:09:23 +00:00
|
|
|
'dependencies' => array(
|
2014-03-07 23:53:23 +00:00
|
|
|
'jquery.hashchange',
|
2014-02-17 15:09:23 +00:00
|
|
|
'mediawiki.Title',
|
|
|
|
'mmv.logger',
|
2014-03-26 23:59:04 +00:00
|
|
|
'mmv.HtmlUtils',
|
2014-02-17 15:09:23 +00:00
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-03-04 11:53:53 +00:00
|
|
|
$wgResourceModules['mmv.bootstrap.autostart'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.bootstrap.autostart.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.base',
|
|
|
|
'mmv.bootstrap',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-03-28 22:39:36 +00:00
|
|
|
$wgResourceModules['mmv.head'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.head.js',
|
|
|
|
),
|
|
|
|
|
2014-03-31 15:04:53 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.base',
|
|
|
|
),
|
|
|
|
|
2014-03-28 22:39:36 +00:00
|
|
|
'position' => 'top',
|
|
|
|
), $moduleInfo( 'mmv' ) );
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgResourceModules['jquery.scrollTo'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'jquery.scrollTo.js',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'jquery.scrollTo' ) );
|
|
|
|
|
2014-02-24 09:29:14 +00:00
|
|
|
$wgResourceModules['jquery.hashchange'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'jquery.hashchange.js',
|
|
|
|
),
|
|
|
|
), $moduleInfo( 'jquery.hashchange' ) );
|
|
|
|
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgExtensionFunctions[] = function () {
|
|
|
|
global $wgResourceModules;
|
|
|
|
|
|
|
|
if ( isset( $wgResourceModules['ext.eventLogging'] ) ) {
|
|
|
|
$wgResourceModules['schema.MediaViewer'] = array(
|
|
|
|
'class' => 'ResourceLoaderSchemaModule',
|
|
|
|
'schema' => 'MediaViewer',
|
2014-02-28 10:44:26 +00:00
|
|
|
'revision' => 7670440,
|
2014-01-31 00:06:33 +00:00
|
|
|
);
|
|
|
|
|
2014-02-06 16:17:38 +00:00
|
|
|
$wgResourceModules['schema.MultimediaViewerNetworkPerformance'] = array(
|
2014-01-31 00:06:33 +00:00
|
|
|
'class' => 'ResourceLoaderSchemaModule',
|
2014-02-06 16:17:38 +00:00
|
|
|
'schema' => 'MultimediaViewerNetworkPerformance',
|
2014-03-23 02:15:54 +00:00
|
|
|
'revision' => 7917896,
|
2014-01-31 00:06:33 +00:00
|
|
|
);
|
|
|
|
|
2014-03-07 23:53:23 +00:00
|
|
|
$wgResourceModules['mmv.logger']['dependencies'][] = 'ext.eventLogging';
|
|
|
|
$wgResourceModules['mmv.logger']['dependencies'][] = 'schema.MediaViewer';
|
2014-02-27 07:56:53 +00:00
|
|
|
|
2014-03-07 23:53:23 +00:00
|
|
|
$wgResourceModules['mmv.performance']['dependencies'][] = 'ext.eventLogging';
|
|
|
|
$wgResourceModules['mmv.performance']['dependencies'][] = 'schema.MultimediaViewerNetworkPerformance';
|
2014-01-31 00:06:33 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
$licenses = array(
|
|
|
|
'cc-by-1.0',
|
|
|
|
'cc-sa-1.0',
|
|
|
|
'cc-by-sa-1.0',
|
|
|
|
'cc-by-2.0',
|
|
|
|
'cc-by-sa-2.0',
|
|
|
|
'cc-by-2.1',
|
|
|
|
'cc-by-sa-2.1',
|
|
|
|
'cc-by-2.5',
|
|
|
|
'cc-by-sa-2.5',
|
|
|
|
'cc-by-3.0',
|
|
|
|
'cc-by-sa-3.0',
|
|
|
|
'cc-by-sa-3.0-migrated',
|
|
|
|
'cc-by-4.0',
|
|
|
|
'cc-by-sa-4.0',
|
|
|
|
'cc-pd',
|
|
|
|
'cc-zero',
|
|
|
|
'pd',
|
|
|
|
'default',
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach ( $licenses as $license ) {
|
|
|
|
$wgResourceModules['mmv']['messages'][] = 'multimediaviewer-license-' . $license;
|
2013-10-25 23:40:20 +00:00
|
|
|
}
|
2014-01-31 00:06:33 +00:00
|
|
|
|
|
|
|
$wgAutoloadClasses['MultimediaViewerHooks'] = __DIR__ . '/MultimediaViewerHooks.php';
|
2014-03-07 01:56:56 +00:00
|
|
|
|
2014-03-14 00:25:33 +00:00
|
|
|
$wgDefaultUserOptions['multimediaviewer-enable'] = true;
|
|
|
|
|
|
|
|
$wgHooks['GetPreferences'][] = 'MultimediaViewerHooks::getPreferences';
|
2014-03-27 21:01:56 +00:00
|
|
|
$wgHooks['GetBetaFeaturePreferences'][] = 'MultimediaViewerHooks::getBetaPreferences';
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgHooks['BeforePageDisplay'][] = 'MultimediaViewerHooks::getModulesForArticle';
|
|
|
|
$wgHooks['CategoryPageView'][] = 'MultimediaViewerHooks::getModulesForCategory';
|
|
|
|
$wgHooks['ResourceLoaderGetConfigVars'][] = 'MultimediaViewerHooks::resourceLoaderGetConfigVars';
|
2014-03-27 22:46:51 +00:00
|
|
|
$wgHooks['MakeGlobalVariablesScript'][] = 'MultimediaViewerHooks::makeGlobalVariablesScript';
|
2014-01-31 00:06:33 +00:00
|
|
|
$wgHooks['ResourceLoaderTestModules'][] = 'MultimediaViewerHooks::getTestModules';
|
2014-03-28 10:06:17 +00:00
|
|
|
$wgHooks['ThumbnailBeforeProduceHTML'][] = 'MultimediaViewerHooks::thumbnailBeforeProduceHTML';
|
2014-01-31 00:06:33 +00:00
|
|
|
|
2014-03-07 01:56:56 +00:00
|
|
|
$section = 'other';
|
|
|
|
|
|
|
|
if ( $wgMediaViewerIsInBeta ) {
|
|
|
|
$section = 'betafeatures';
|
|
|
|
}
|
|
|
|
|
|
|
|
$wgExtensionCredits[$section][] = array(
|
2014-01-31 00:06:33 +00:00
|
|
|
'path' => __FILE__,
|
|
|
|
'name' => 'MultimediaViewer',
|
|
|
|
'descriptionmsg' => 'multimediaviewer-desc',
|
2014-03-28 09:52:39 +00:00
|
|
|
'version' => '0.3.0',
|
2014-01-31 00:06:33 +00:00
|
|
|
'author' => array(
|
|
|
|
'MarkTraceur (Mark Holmquist)',
|
2014-02-13 21:38:19 +00:00
|
|
|
'Gilles Dubuc',
|
|
|
|
'Gergő Tisza',
|
|
|
|
'Aaron Arcos',
|
|
|
|
'Zeljko Filipin',
|
|
|
|
'Pau Giner',
|
|
|
|
'theopolisme',
|
|
|
|
'MatmaRex',
|
|
|
|
'apsdehal',
|
|
|
|
'vldandrew',
|
|
|
|
'Ebrahim Byagowi',
|
|
|
|
'Dereckson',
|
|
|
|
'Brion VIBBER',
|
|
|
|
'Yuki Shira',
|
|
|
|
'Yaroslav Melnychuk',
|
|
|
|
'tonythomas01',
|
|
|
|
'Raimond Spekking',
|
|
|
|
'Kunal Mehta',
|
|
|
|
'Jeff Hall',
|
|
|
|
'Christian Aistleitner',
|
|
|
|
'Amir E. Aharoni',
|
2014-01-31 00:06:33 +00:00
|
|
|
),
|
|
|
|
'url' => 'https://mediawiki.org/wiki/Extension:MultimediaViewer',
|
|
|
|
);
|
|
|
|
} );
|