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
|
|
|
|
*/
|
|
|
|
|
2013-11-05 22:21:02 +00:00
|
|
|
$moduleInfoML = array(
|
|
|
|
'localBasePath' => __DIR__ . '/resources/multilightbox',
|
|
|
|
'remoteExtPath' => 'MultimediaViewer/resources/multilightbox',
|
|
|
|
);
|
|
|
|
|
|
|
|
$moduleInfoMMV = array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'localBasePath' => __DIR__ . '/resources/mmv',
|
|
|
|
'remoteExtPath' => 'MultimediaViewer/resources/mmv',
|
2013-08-07 08:59:08 +00:00
|
|
|
);
|
|
|
|
|
2014-01-23 21:56:13 +00:00
|
|
|
$moduleInfoMMVM = array(
|
|
|
|
'localBasePath' => __DIR__ . '/resources/mmv/model',
|
|
|
|
'remoteExtPath' => 'MultimediaViewer/resources/mmv/model',
|
|
|
|
);
|
|
|
|
|
2013-10-28 12:44:00 +00:00
|
|
|
$moduleInfoMoment = array(
|
|
|
|
'localBasePath' => __DIR__ . '/resources/momentjs',
|
|
|
|
'remoteExtPath' => 'MultimediaViewer/resources/momentjs',
|
|
|
|
);
|
|
|
|
|
2014-01-14 16:15:22 +00:00
|
|
|
$moduleInfoJQScrollTo = array(
|
|
|
|
'localBasePath' => __DIR__ . '/resources/jquery.scrollTo',
|
|
|
|
'remoteExtPath' => 'MultimediaViewer/resources/jquery.scrollTo',
|
|
|
|
);
|
|
|
|
|
2013-08-07 08:59:08 +00:00
|
|
|
$wgExtensionMessagesFiles['MultimediaViewer'] = __DIR__ . '/MultimediaViewer.i18n.php';
|
|
|
|
|
|
|
|
$wgResourceModules['multilightbox.interface'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
2013-11-05 22:21:02 +00:00
|
|
|
'lightboxinterface.js',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
2013-11-05 22:21:02 +00:00
|
|
|
'multilightbox.css',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
2013-11-05 22:21:02 +00:00
|
|
|
), $moduleInfoML );
|
2013-08-07 08:59:08 +00:00
|
|
|
|
|
|
|
$wgResourceModules['multilightbox.image'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
2013-11-05 22:21:02 +00:00
|
|
|
'lightboximage.js',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
2013-11-05 22:21:02 +00:00
|
|
|
), $moduleInfoML );
|
2013-08-07 08:59:08 +00:00
|
|
|
|
|
|
|
$wgResourceModules['multilightbox'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
2013-11-05 22:21:02 +00:00
|
|
|
'multilightbox.js',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.lightboxinterface',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
2013-11-05 22:21:02 +00:00
|
|
|
), $moduleInfoML );
|
2013-08-07 08:59:08 +00:00
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv.lightboximage'] = array_merge( array(
|
2013-11-13 23:01:16 +00:00
|
|
|
'scripts' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.lightboximage.js',
|
2013-11-13 23:01:16 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2013-12-05 01:55:41 +00:00
|
|
|
'oojs',
|
2013-11-13 23:01:16 +00:00
|
|
|
'multilightbox.image',
|
|
|
|
),
|
|
|
|
), $moduleInfoMMV );
|
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv.lightboxinterface'] = array_merge( array(
|
2013-11-13 23:01:16 +00:00
|
|
|
'scripts' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.lightboxinterface.js',
|
2013-11-13 23:01:16 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2013-12-05 01:55:41 +00:00
|
|
|
'oojs',
|
2013-11-13 23:01:16 +00:00
|
|
|
'multilightbox.interface',
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.ui.description',
|
2013-11-13 23:01:16 +00:00
|
|
|
),
|
|
|
|
), $moduleInfoMMV );
|
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv.model'] = array_merge( array(
|
2014-01-10 21:11:21 +00:00
|
|
|
'scripts' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.model.js',
|
2014-01-10 21:11:21 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.base',
|
2014-01-10 21:11:21 +00:00
|
|
|
'oojs',
|
|
|
|
),
|
2014-01-23 21:56:13 +00:00
|
|
|
), $moduleInfoMMVM );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.model.FileUsage'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.FileUsage.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
),
|
|
|
|
), $moduleInfoMMVM );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.model.Image'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.Image.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
),
|
|
|
|
), $moduleInfoMMVM );
|
|
|
|
|
|
|
|
$wgResourceModules['mmv.model.Repo'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'mmv.model.Repo.js',
|
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'mmv.model',
|
|
|
|
'oojs',
|
|
|
|
),
|
|
|
|
), $moduleInfoMMVM );
|
2014-01-10 21:11:21 +00:00
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv.provider'] = array_merge( array(
|
2014-01-15 15:02:16 +00:00
|
|
|
'scripts' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.provider.js',
|
2014-01-15 15:02:16 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.model',
|
2014-01-15 15:02:16 +00:00
|
|
|
'oojs',
|
|
|
|
),
|
|
|
|
), $moduleInfoMMV );
|
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv.base'] = array_merge( array(
|
2014-01-10 21:11:21 +00:00
|
|
|
'scripts' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.base.js',
|
2014-01-10 21:11:21 +00:00
|
|
|
),
|
|
|
|
), $moduleInfoMMV );
|
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv.ui'] = array_merge( array(
|
2014-01-22 01:21:22 +00:00
|
|
|
'scripts' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.ui.js',
|
2014-01-22 01:21:22 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.base',
|
2014-01-22 01:21:22 +00:00
|
|
|
),
|
|
|
|
), $moduleInfoMMV );
|
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv.ui.description'] = array_merge( array(
|
2014-01-22 01:21:22 +00:00
|
|
|
'scripts' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.ui.description.js',
|
2014-01-22 01:21:22 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.ui',
|
2014-01-22 01:21:22 +00:00
|
|
|
'oojs',
|
|
|
|
),
|
|
|
|
), $moduleInfoMMV );
|
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv'] = array_merge( array(
|
2013-08-07 08:59:08 +00:00
|
|
|
'scripts' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.js',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'styles' => array(
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.css',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'dependencies' => array(
|
|
|
|
'multilightbox',
|
2013-10-28 12:44:00 +00:00
|
|
|
'momentjs',
|
2014-01-14 16:15:22 +00:00
|
|
|
'jquery.scrollTo',
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.lightboximage',
|
2013-09-26 01:47:59 +00:00
|
|
|
'mediawiki.Title',
|
2013-10-29 02:31:23 +00:00
|
|
|
'jquery.ui.dialog',
|
2013-11-01 15:24:16 +00:00
|
|
|
'jquery.hidpi',
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.model',
|
2014-01-23 21:56:13 +00:00
|
|
|
'mmv.model.FileUsage',
|
|
|
|
'mmv.model.Image',
|
|
|
|
'mmv.model.Repo',
|
2014-01-23 21:44:26 +00:00
|
|
|
'mmv.provider',
|
2014-01-13 21:40:22 +00:00
|
|
|
'mediawiki.language',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'messages' => array(
|
|
|
|
'multimediaviewer-file-page',
|
2013-10-08 00:54:18 +00:00
|
|
|
'multimediaviewer-repository',
|
2013-12-19 06:51:57 +00:00
|
|
|
'multimediaviewer-repository-local',
|
2013-10-15 22:34:41 +00:00
|
|
|
'multimediaviewer-datetime-created',
|
|
|
|
'multimediaviewer-datetime-uploaded',
|
2013-09-26 20:53:22 +00:00
|
|
|
'multimediaviewer-userpage-link',
|
2013-10-10 22:31:13 +00:00
|
|
|
'multimediaviewer-credit',
|
2013-10-29 02:31:23 +00:00
|
|
|
'multimediaviewer-use-file',
|
|
|
|
'multimediaviewer-use-file-owt',
|
|
|
|
'multimediaviewer-use-file-own',
|
|
|
|
'multimediaviewer-use-file-offwiki',
|
2013-10-29 20:26:07 +00:00
|
|
|
'multimediaviewer-about-mmv',
|
|
|
|
'multimediaviewer-discuss-mmv',
|
2014-01-13 21:40:22 +00:00
|
|
|
'multimediaviewer-desc-nil',
|
|
|
|
|
|
|
|
'multimediaviewer-geoloc-north',
|
|
|
|
'multimediaviewer-geoloc-east',
|
|
|
|
'multimediaviewer-geoloc-south',
|
|
|
|
'multimediaviewer-geoloc-west',
|
|
|
|
'multimediaviewer-geoloc-coord',
|
|
|
|
'multimediaviewer-geoloc-coords',
|
2014-01-22 01:32:19 +00:00
|
|
|
'multimediaviewer-geolocation',
|
2013-08-07 08:59:08 +00:00
|
|
|
),
|
2013-11-05 22:21:02 +00:00
|
|
|
), $moduleInfoMMV );
|
2013-08-07 08:59:08 +00:00
|
|
|
|
2013-10-28 12:44:00 +00:00
|
|
|
$wgResourceModules['momentjs'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'moment.js',
|
|
|
|
),
|
|
|
|
'languageScripts' => array(
|
|
|
|
'ar' => 'lang/ar.js',
|
|
|
|
'ar-ma' => 'lang/ar-ma.js',
|
|
|
|
'bg' => 'lang/bg.js',
|
|
|
|
'br' => 'lang/br.js',
|
|
|
|
'bs' => 'lang/bs.js',
|
|
|
|
'ca' => 'lang/ca.js',
|
|
|
|
'cv' => 'lang/cv.js',
|
|
|
|
'cy' => 'lang/cy.js',
|
|
|
|
'cs' => 'lang/cs.js',
|
|
|
|
'da' => 'lang/da.js',
|
|
|
|
'de' => 'lang/de.js',
|
|
|
|
'el' => 'lang/el.js',
|
|
|
|
'en-au' => 'lang/en-au.js',
|
|
|
|
'en-ca' => 'lang/en-ca.js',
|
|
|
|
'en-gb' => 'lang/en-gb.js',
|
|
|
|
'eo' => 'lang/eo.js',
|
|
|
|
'es' => 'lang/es.js',
|
|
|
|
'et' => 'lang/et.js',
|
|
|
|
'eu' => 'lang/eu.js',
|
|
|
|
'fa' => 'lang/fa.js',
|
|
|
|
'fi' => 'lang/fi.js',
|
|
|
|
'fo' => 'lang/fo.js',
|
|
|
|
'fr' => 'lang/fr.js',
|
|
|
|
'fr-ca' => 'lang/fr-ca.js',
|
|
|
|
'gl' => 'lang/gl.js',
|
|
|
|
'he' => 'lang/he.js',
|
|
|
|
'hi' => 'lang/hi.js',
|
|
|
|
'hr' => 'lang/hr.js',
|
|
|
|
'hu' => 'lang/hu.js',
|
|
|
|
'id' => 'lang/id.js',
|
|
|
|
'is' => 'lang/is.js',
|
|
|
|
'it' => 'lang/it.js',
|
|
|
|
'ja' => 'lang/ja.js',
|
|
|
|
'ka' => 'lang/ka.js',
|
|
|
|
'ko' => 'lang/ko.js',
|
|
|
|
'lt' => 'lang/lt.js',
|
|
|
|
'lv' => 'lang/lv.js',
|
|
|
|
'ml' => 'lang/ml.js',
|
|
|
|
'mr' => 'lang/mr.js',
|
|
|
|
'ms-my' => 'lang/ms-my.js',
|
|
|
|
'nb' => 'lang/nb.js',
|
|
|
|
'ne' => 'lang/ne.js',
|
|
|
|
'nl' => 'lang/nl.js',
|
|
|
|
'nn' => 'lang/nn.js',
|
|
|
|
'pl' => 'lang/pl.js',
|
|
|
|
'pt' => 'lang/pt.js',
|
|
|
|
'pt-br' => 'lang/pt-br.js',
|
|
|
|
'ro' => 'lang/ro.js',
|
|
|
|
'ru' => 'lang/ru.js',
|
|
|
|
'sk' => 'lang/sk.js',
|
|
|
|
'sl' => 'lang/sl.js',
|
|
|
|
'sq' => 'lang/sq.js',
|
|
|
|
'sv' => 'lang/sv.js',
|
|
|
|
'th' => 'lang/th.js',
|
|
|
|
'tl-ph' => 'lang/tl-ph.js',
|
|
|
|
'tr' => 'lang/tr.js',
|
|
|
|
'tzm' => 'lang/tzm.js',
|
|
|
|
'tzm-la' => 'lang/tzm-la.js',
|
|
|
|
'uk' => 'lang/uk.js',
|
|
|
|
'uz' => 'lang/uz.js',
|
|
|
|
'vn' => 'lang/vn.js',
|
|
|
|
'zh-cn' => 'lang/zh-cn.js',
|
|
|
|
'zh-tw' => 'lang/zh-tw.js',
|
|
|
|
),
|
|
|
|
), $moduleInfoMoment );
|
|
|
|
|
2014-01-14 16:15:22 +00:00
|
|
|
$wgResourceModules['jquery.scrollTo'] = array_merge( array(
|
|
|
|
'scripts' => array(
|
|
|
|
'jquery.scrollTo.js',
|
|
|
|
),
|
|
|
|
), $moduleInfoJQScrollTo );
|
|
|
|
|
2013-10-25 23:40:20 +00:00
|
|
|
$wgExtensionFunctions[] = function () {
|
|
|
|
global $wgResourceModules;
|
|
|
|
|
|
|
|
if ( isset( $wgResourceModules['ext.eventLogging'] ) ) {
|
|
|
|
$wgResourceModules['schema.MediaViewer'] = array(
|
|
|
|
'class' => 'ResourceLoaderSchemaModule',
|
|
|
|
'schema' => 'MediaViewer',
|
2013-12-06 17:10:39 +00:00
|
|
|
'revision' => 6636420,
|
|
|
|
);
|
|
|
|
|
|
|
|
$wgResourceModules['schema.MediaViewerPerf'] = array(
|
|
|
|
'class' => 'ResourceLoaderSchemaModule',
|
|
|
|
'schema' => 'MediaViewerPerf',
|
|
|
|
'revision' => 6636500,
|
2013-10-25 23:40:20 +00:00
|
|
|
);
|
|
|
|
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv']['dependencies'][] = 'ext.eventLogging';
|
|
|
|
$wgResourceModules['mmv']['dependencies'][] = 'schema.MediaViewer';
|
|
|
|
$wgResourceModules['mmv']['dependencies'][] = 'schema.MediaViewerPerf';
|
2013-10-25 23:40:20 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-10-16 23:50:51 +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',
|
2014-01-22 02:05:40 +00:00
|
|
|
'cc-by-4.0',
|
|
|
|
'cc-by-sa-4.0',
|
2013-10-16 23:50:51 +00:00
|
|
|
'cc-pd',
|
|
|
|
'cc-zero',
|
|
|
|
'default',
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach ( $licenses as $license ) {
|
2014-01-23 21:44:26 +00:00
|
|
|
$wgResourceModules['mmv']['messages'][] = 'multimediaviewer-license-' . $license;
|
2013-10-16 23:50:51 +00:00
|
|
|
}
|
2013-08-07 08:59:08 +00:00
|
|
|
|
|
|
|
$wgAutoloadClasses['MultimediaViewerHooks'] = __DIR__ . '/MultimediaViewerHooks.php';
|
|
|
|
$wgHooks['GetBetaFeaturePreferences'][] = 'MultimediaViewerHooks::getBetaPreferences';
|
2013-11-04 21:40:31 +00:00
|
|
|
$wgHooks['BeforePageDisplay'][] = 'MultimediaViewerHooks::getModulesForArticle';
|
|
|
|
$wgHooks['CategoryPageView'][] = 'MultimediaViewerHooks::getModulesForCategory';
|
2013-10-29 20:26:07 +00:00
|
|
|
$wgHooks['ResourceLoaderGetConfigVars'][] = 'MultimediaViewerHooks::resourceLoaderGetConfigVars';
|
2013-11-27 21:57:45 +00:00
|
|
|
$wgHooks['ResourceLoaderTestModules'][] = 'MultimediaViewerHooks::getTestModules';
|
2013-08-07 08:59:08 +00:00
|
|
|
|
|
|
|
$wgExtensionCredits['other'][] = array(
|
|
|
|
'path' => __FILE__,
|
|
|
|
'name' => 'MultimediaViewer',
|
2013-10-04 08:55:54 +00:00
|
|
|
'descriptionmsg' => 'multimediaviewer-desc',
|
2013-11-20 01:25:07 +00:00
|
|
|
'version' => '0.2.0',
|
2013-08-07 08:59:08 +00:00
|
|
|
'author' => array(
|
|
|
|
'MarkTraceur (Mark Holmquist)',
|
|
|
|
),
|
|
|
|
'url' => 'https://mediawiki.org/wiki/Extension:MultimediaViewer',
|
|
|
|
);
|