2014-07-25 20:19:15 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* MediaWiki Extension: Echo
|
|
|
|
* http://www.mediawiki.org/wiki/Extension:Echo
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* This program is distributed WITHOUT ANY WARRANTY.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
* @author Andrew Garrett, Benny Situ, Ryan Kaldari, Erik Bernhardson
|
|
|
|
* @licence MIT License
|
|
|
|
*/
|
|
|
|
|
|
|
|
$echoResourceTemplate = array(
|
|
|
|
'localBasePath' => __DIR__ . '/modules',
|
|
|
|
'remoteExtPath' => 'Echo/modules',
|
|
|
|
);
|
|
|
|
|
|
|
|
$wgResourceModules += array(
|
2015-08-13 00:54:16 +00:00
|
|
|
'ext.echo.ui' => $echoResourceTemplate + array(
|
2014-07-25 20:19:15 +00:00
|
|
|
'scripts' => array(
|
2015-08-13 00:54:16 +00:00
|
|
|
'ooui/mw.echo.ui.js',
|
2015-09-17 21:14:49 +00:00
|
|
|
'ooui/mw.echo.ui.PlaceholderOptionWidget.js',
|
2015-08-13 00:54:16 +00:00
|
|
|
'ooui/mw.echo.ui.NotificationsWidget.js',
|
|
|
|
'ooui/mw.echo.ui.NotificationOptionWidget.js',
|
2015-09-17 00:05:52 +00:00
|
|
|
'ooui/mw.echo.ui.BadgeLinkWidget.js',
|
2015-08-13 00:54:16 +00:00
|
|
|
'ooui/mw.echo.ui.NotificationBadgeWidget.js'
|
|
|
|
),
|
|
|
|
'styles' => array(
|
|
|
|
'ooui/styles/mw.echo.ui.NotificationsWidget.less',
|
|
|
|
'ooui/styles/mw.echo.ui.NotificationOptionWidget.less',
|
|
|
|
'ooui/styles/mw.echo.ui.NotificationBadgeWidget.less'
|
2014-07-25 20:19:15 +00:00
|
|
|
),
|
|
|
|
'skinStyles' => array(
|
2015-08-13 00:54:16 +00:00
|
|
|
'monobook' => array(
|
|
|
|
'ooui/styles/mw.echo.ui.NotificationsWidget.monobook.less',
|
|
|
|
'ooui/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less'
|
|
|
|
),
|
|
|
|
'modern' => array(
|
|
|
|
'ooui/styles/mw.echo.ui.NotificationOptionWidget.modern.less',
|
|
|
|
'ooui/styles/mw.echo.ui.NotificationBadgeWidget.modern.less'
|
|
|
|
)
|
2014-07-25 20:19:15 +00:00
|
|
|
),
|
|
|
|
'dependencies' => array(
|
2015-09-16 19:48:56 +00:00
|
|
|
'ext.echo.styles.badge',
|
|
|
|
'ext.echo.styles.notifications',
|
2015-08-13 00:54:16 +00:00
|
|
|
'ext.echo.dm',
|
|
|
|
'oojs-ui',
|
|
|
|
'ext.echo.logger',
|
2014-08-12 15:09:09 +00:00
|
|
|
'mediawiki.api',
|
2015-09-11 04:29:56 +00:00
|
|
|
'mediawiki.jqueryMsg',
|
|
|
|
'mediawiki.language',
|
2014-07-25 20:19:15 +00:00
|
|
|
),
|
|
|
|
'messages' => array(
|
|
|
|
'echo-overlay-link',
|
|
|
|
'echo-mark-all-as-read',
|
|
|
|
'echo-more-info',
|
|
|
|
'echo-feedback',
|
2014-08-06 19:29:17 +00:00
|
|
|
'echo-notification-alert',
|
|
|
|
'echo-notification-message',
|
2014-09-09 00:10:33 +00:00
|
|
|
'echo-notification-alert-text-only',
|
|
|
|
'echo-notification-message-text-only',
|
2015-08-13 00:54:16 +00:00
|
|
|
'echo-email-batch-bullet',
|
2015-09-16 20:42:17 +00:00
|
|
|
'echo-api-failure',
|
2015-09-17 21:14:49 +00:00
|
|
|
'echo-notification-placeholder',
|
2015-09-07 23:54:47 +00:00
|
|
|
'tooltip-pt-notifications-alert',
|
|
|
|
'tooltip-pt-notifications-message',
|
2015-09-22 22:36:14 +00:00
|
|
|
'mytalk',
|
2015-08-13 00:54:16 +00:00
|
|
|
'mypreferences'
|
2014-07-25 20:19:15 +00:00
|
|
|
),
|
2015-09-14 21:12:59 +00:00
|
|
|
'targets' => array( 'desktop' ),
|
2014-07-25 20:19:15 +00:00
|
|
|
),
|
2015-08-13 00:54:16 +00:00
|
|
|
'ext.echo.dm' => $echoResourceTemplate + array(
|
|
|
|
'scripts' => array(
|
|
|
|
'viewmodel/mw.echo.dm.js',
|
|
|
|
'viewmodel/mw.echo.dm.NotificationItem.js',
|
|
|
|
'viewmodel/mw.echo.dm.List.js',
|
|
|
|
'viewmodel/mw.echo.dm.NotificationList.js',
|
|
|
|
'viewmodel/mw.echo.dm.NotificationsModel.js',
|
2014-08-12 15:09:09 +00:00
|
|
|
),
|
2014-08-05 23:48:07 +00:00
|
|
|
'dependencies' => array(
|
2015-08-13 00:54:16 +00:00
|
|
|
'oojs'
|
2014-08-05 23:48:07 +00:00
|
|
|
),
|
2015-08-13 00:54:16 +00:00
|
|
|
'targets' => array( 'desktop', 'mobile' ),
|
|
|
|
),
|
|
|
|
'ext.echo.base' => array(
|
|
|
|
// This is a dummy module for backwards compatibility.
|
|
|
|
// Most extensions that require ext.echo.base actually need
|
|
|
|
// the logger. They will have to be adjusted to use the new
|
|
|
|
// logger functionality, however.
|
|
|
|
// This module is mainly here to make sure other extensions
|
|
|
|
// that rely on ext.echo.base don't explode, and that CI lets
|
|
|
|
// us merge this while fixing the main extensions that require
|
|
|
|
// to be changed due to the new structure.
|
|
|
|
'targets' => array( 'desktop', 'mobile' ),
|
|
|
|
'dependencies' => array( 'ext.echo.logger' )
|
|
|
|
),
|
|
|
|
// ext.echo.logger is registered in EchoHooks::onResourceLoaderRegisterModules
|
|
|
|
'ext.echo.init' => $echoResourceTemplate + array(
|
2014-08-05 23:48:07 +00:00
|
|
|
'scripts' => array(
|
2015-08-13 00:54:16 +00:00
|
|
|
'ext.echo.init.js',
|
|
|
|
),
|
2015-09-14 21:12:59 +00:00
|
|
|
'targets' => array( 'desktop' ),
|
2015-08-13 00:54:16 +00:00
|
|
|
),
|
|
|
|
// Base no-js styles
|
2015-09-16 19:48:56 +00:00
|
|
|
'ext.echo.styles.badge' => $echoResourceTemplate + array(
|
2015-08-13 00:54:16 +00:00
|
|
|
'position' => 'top',
|
|
|
|
'styles' => array(
|
|
|
|
'nojs/mw.echo.badge.less',
|
2015-09-16 19:48:56 +00:00
|
|
|
),
|
|
|
|
'targets' => array( 'desktop', 'mobile' ),
|
|
|
|
),
|
|
|
|
// Styles for individual notification entries in flyout and Special:Notifications
|
|
|
|
'ext.echo.styles.notifications' => $echoResourceTemplate + array(
|
|
|
|
'position' => 'top',
|
|
|
|
'styles' => array(
|
2015-08-13 00:54:16 +00:00
|
|
|
'nojs/mw.echo.notifications.less'
|
|
|
|
),
|
2015-09-14 18:12:12 +00:00
|
|
|
'targets' => array( 'desktop', 'mobile' ),
|
|
|
|
),
|
2015-09-16 19:48:56 +00:00
|
|
|
'ext.echo.styles.alert' => $echoResourceTemplate + array(
|
2015-09-14 18:12:12 +00:00
|
|
|
'position' => 'top',
|
|
|
|
'styles' => array(
|
|
|
|
'nojs/mw.echo.alert.less',
|
|
|
|
),
|
2015-09-04 23:36:01 +00:00
|
|
|
'skinStyles' => array(
|
|
|
|
'monobook' => array(
|
|
|
|
'nojs/mw.echo.alert.monobook.less',
|
|
|
|
),
|
|
|
|
'modern' => array(
|
|
|
|
'nojs/mw.echo.alert.modern.less',
|
2015-09-14 18:12:12 +00:00
|
|
|
),
|
2015-09-04 23:36:01 +00:00
|
|
|
),
|
2015-08-13 00:54:16 +00:00
|
|
|
'targets' => array( 'desktop', 'mobile' ),
|
2014-08-05 23:48:07 +00:00
|
|
|
),
|
2015-09-16 19:48:56 +00:00
|
|
|
'ext.echo.styles.special' => $echoResourceTemplate + array(
|
2015-09-13 04:20:22 +00:00
|
|
|
'position' => 'top',
|
|
|
|
'styles' => array(
|
|
|
|
'nojs/mw.echo.special.less',
|
|
|
|
),
|
|
|
|
'targets' => array( 'desktop', 'mobile' ),
|
|
|
|
),
|
2014-07-25 20:19:15 +00:00
|
|
|
'ext.echo.special' => $echoResourceTemplate + array(
|
|
|
|
'scripts' => array(
|
|
|
|
'special/ext.echo.special.js',
|
|
|
|
),
|
|
|
|
'dependencies' => array(
|
|
|
|
'mediawiki.ui.button',
|
2015-06-08 00:26:07 +00:00
|
|
|
'mediawiki.api',
|
2015-08-13 00:54:16 +00:00
|
|
|
'ext.echo.ui',
|
2014-07-25 20:19:15 +00:00
|
|
|
),
|
|
|
|
'messages' => array(
|
|
|
|
'echo-load-more-error',
|
|
|
|
'echo-more-info',
|
|
|
|
'echo-feedback',
|
|
|
|
),
|
|
|
|
),
|
2015-09-14 19:52:01 +00:00
|
|
|
|
|
|
|
// HACK: OOUI has an icon pack for these, but it's unhelpfully large and we don't
|
|
|
|
// want to load more as render-blocking CSS than we have to (T112401)
|
|
|
|
'ext.echo.badgeicons' => $echoResourceTemplate + array(
|
|
|
|
'class' => 'ResourceLoaderOOUIImageModule',
|
|
|
|
'position' => 'top',
|
|
|
|
'name' => 'badgeicons',
|
|
|
|
'rootPath' => 'icons',
|
|
|
|
'selectorWithoutVariant' => '.oo-ui-icon-{name}',
|
|
|
|
'selectorWithVariant' => '.oo-ui-image-{variant}.oo-ui-icon-{name}',
|
|
|
|
),
|
2014-07-25 20:19:15 +00:00
|
|
|
);
|
2015-06-02 00:26:09 +00:00
|
|
|
|
|
|
|
unset( $echoResourceTemplate );
|