mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
53e9258280
This should make it much simpler to keep MediaWiki specifics out of VisualEditor, which will in turn make it easier to integrate VisualEditor into another platform. Change-Id: I073e9737b37c28af889f2457d10b082cefd0d63b
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Resource loader module for certain VisualEditor messages.
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Module for user preference customizations
|
|
*/
|
|
class VisualEditorMessagesModule extends ResourceLoaderModule {
|
|
|
|
/* Protected Members */
|
|
|
|
protected $modifiedTime = array();
|
|
|
|
protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
|
|
|
|
/* Methods */
|
|
|
|
public function getScript( ResourceLoaderContext $context ) {
|
|
$messages = array(
|
|
'summary' => wfMessage( 'summary' )->parse(),
|
|
'minoredit' => wfMessage( 'minoredit' )->parse(),
|
|
'watchthis' => wfMessage( 'watchthis' )->parse(),
|
|
);
|
|
return 've.init.platform.addMessages(' . FormatJson::encode( $messages ) . ');';
|
|
}
|
|
|
|
public function getMessages() {
|
|
// We don't actually use the i18n on the client-side, but registering the messages
|
|
// is needed to make cache invalidation work
|
|
return array( 'summary', 'minoredit', 'watchthis' );
|
|
}
|
|
|
|
public function getDependencies() {
|
|
return array( 'ext.visualEditor.base' );
|
|
}
|
|
}
|