2014-02-06 10:21:39 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* This file is part of the MediaWiki extension Popups.
|
|
|
|
*
|
|
|
|
* Popups 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.
|
|
|
|
*
|
|
|
|
* Popups 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 Popups. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
2014-02-07 06:08:59 +00:00
|
|
|
* This extension requires that the PageImages and TextExtracts
|
|
|
|
* extensions have also been installed.
|
|
|
|
*
|
2014-03-29 06:20:06 +00:00
|
|
|
* Install BetaFeatures if you don't want Popups to load for all users.
|
|
|
|
*
|
2014-02-06 10:21:39 +00:00
|
|
|
* @file
|
|
|
|
* @ingroup extensions
|
|
|
|
*/
|
|
|
|
|
2014-02-13 21:14:06 +00:00
|
|
|
$wgExtensionCredits['betafeatures'][] = array(
|
2014-02-06 10:21:39 +00:00
|
|
|
'author' => array( 'Prateek Saxena', 'Yair Rand' ),
|
|
|
|
'descriptionmsg' => 'popups-desc',
|
|
|
|
'name' => 'Popups',
|
|
|
|
'path' => __FILE__,
|
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:Popups',
|
|
|
|
);
|
|
|
|
|
2014-02-27 08:09:34 +00:00
|
|
|
$wgAutoloadClasses['PopupsHooks'] = __DIR__ . '/Popups.hooks.php';
|
2014-03-28 20:40:17 +00:00
|
|
|
$wgMessagesDirs['Popups'] = __DIR__ . '/i18n';
|
2014-02-27 08:09:34 +00:00
|
|
|
$wgExtensionMessagesFiles['Popups'] = __DIR__ . '/Popups.i18n.php';
|
|
|
|
|
|
|
|
$wgHooks['GetBetaFeaturePreferences'][] = 'PopupsHooks::getPreferences';
|
|
|
|
$wgHooks['BeforePageDisplay'][] = 'PopupsHooks::onBeforePageDisplay';
|
2014-06-11 04:34:49 +00:00
|
|
|
$wgHooks['ResourceLoaderTestModules'][] = 'PopupsHooks::onResourceLoaderTestModules';
|
2014-02-27 08:09:34 +00:00
|
|
|
$wgHooks[ 'ResourceLoaderRegisterModules' ][] = function ( ResourceLoader &$resourceLoader ) {
|
|
|
|
|
|
|
|
$moduleDependencies = array(
|
|
|
|
'mediawiki.api',
|
|
|
|
'mediawiki.jqueryMsg',
|
|
|
|
'moment',
|
2014-06-17 11:08:05 +00:00
|
|
|
'jquery.jStorage',
|
2014-06-26 09:30:18 +00:00
|
|
|
'jquery.client',
|
2014-02-27 08:09:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// If EventLogging is present, declare the schema module
|
|
|
|
// and add it to the array of dependencies.
|
|
|
|
if ( class_exists( 'ResourceLoaderSchemaModule' ) ) {
|
|
|
|
$resourceLoader->register( "schema.Popups", array(
|
|
|
|
'class' => 'ResourceLoaderSchemaModule',
|
|
|
|
'schema' => 'Popups',
|
|
|
|
'revision' => 7536956,
|
|
|
|
) );
|
|
|
|
|
|
|
|
$moduleDependencies[] = "schema.Popups";
|
|
|
|
}
|
|
|
|
|
|
|
|
$resourceLoader->register( "ext.popups", array(
|
2014-02-07 07:35:34 +00:00
|
|
|
'scripts' => array(
|
|
|
|
'resources/ext.popups.core.js',
|
2014-04-25 11:43:42 +00:00
|
|
|
'resources/ext.popups.eventlogging.js',
|
|
|
|
'resources/ext.popups.renderer.js',
|
|
|
|
'resources/ext.popups.renderer.article.js',
|
2014-03-22 04:38:01 +00:00
|
|
|
'resources/ext.popups.disablenavpop.js',
|
2014-06-17 11:08:05 +00:00
|
|
|
'resources/ext.popups.settings.js',
|
2014-02-07 07:35:34 +00:00
|
|
|
),
|
2014-02-06 11:11:29 +00:00
|
|
|
'styles' => array(
|
|
|
|
'resources/ext.popups.core.less',
|
|
|
|
'resources/ext.popups.animation.less',
|
2014-06-17 11:08:05 +00:00
|
|
|
'resources/ext.popups.settings.less',
|
2014-02-06 11:11:29 +00:00
|
|
|
),
|
2014-04-22 11:40:21 +00:00
|
|
|
'dependencies' => $moduleDependencies,
|
2014-02-07 07:35:34 +00:00
|
|
|
'messages' => array(
|
2014-02-27 06:07:14 +00:00
|
|
|
'popups-last-edited',
|
2014-06-17 11:08:05 +00:00
|
|
|
"popups-settings-title",
|
|
|
|
"popups-settings-description",
|
2014-08-19 15:52:18 +00:00
|
|
|
"popups-settings-option-simple",
|
|
|
|
"popups-settings-option-simple-description",
|
|
|
|
"popups-settings-option-advanced",
|
|
|
|
"popups-settings-option-advanced-description",
|
2014-06-17 11:08:05 +00:00
|
|
|
"popups-settings-option-off",
|
|
|
|
"popups-settings-option-off-description",
|
|
|
|
"popups-settings-save",
|
|
|
|
"popups-settings-cancel",
|
|
|
|
"popups-settings-enable",
|
2014-02-07 07:35:34 +00:00
|
|
|
),
|
2014-02-27 08:09:34 +00:00
|
|
|
'remoteExtPath' => 'Popups',
|
|
|
|
'localBasePath' => dirname( __DIR__ ) . '/Popups',
|
|
|
|
) );
|
|
|
|
return true;
|
|
|
|
};
|