From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/content/JavaScriptContentHandler.php | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 includes/content/JavaScriptContentHandler.php (limited to 'includes/content/JavaScriptContentHandler.php') diff --git a/includes/content/JavaScriptContentHandler.php b/includes/content/JavaScriptContentHandler.php new file mode 100644 index 00000000..33fa9172 --- /dev/null +++ b/includes/content/JavaScriptContentHandler.php @@ -0,0 +1,67 @@ +checkFormat( $format ); + + return new JavaScriptContent( $text ); + } + + public function makeEmptyContent() { + return new JavaScriptContent( '' ); + } + + /** + * Returns the english language, because JS is english, and should be handled as such. + * + * @return Language wfGetLangObj( 'en' ) + * + * @see ContentHandler::getPageLanguage() + */ + public function getPageLanguage( Title $title, Content $content = null ) { + return wfGetLangObj( 'en' ); + } + + /** + * Returns the english language, because JS is english, and should be handled as such. + * + * @return Language wfGetLangObj( 'en' ) + * + * @see ContentHandler::getPageViewLanguage() + */ + public function getPageViewLanguage( Title $title, Content $content = null ) { + return wfGetLangObj( 'en' ); + } +} -- cgit v1.2.3-54-g00ecf