summaryrefslogtreecommitdiff
path: root/includes/content/JavaScriptContentHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/content/JavaScriptContentHandler.php')
-rw-r--r--includes/content/JavaScriptContentHandler.php37
1 files changed, 6 insertions, 31 deletions
diff --git a/includes/content/JavaScriptContentHandler.php b/includes/content/JavaScriptContentHandler.php
index 33fa9172..457b83d7 100644
--- a/includes/content/JavaScriptContentHandler.php
+++ b/includes/content/JavaScriptContentHandler.php
@@ -27,41 +27,16 @@
* @ingroup Content
* @todo make ScriptContentHandler base class, do highlighting stuff there?
*/
-class JavaScriptContentHandler extends TextContentHandler {
-
- public function __construct( $modelId = CONTENT_MODEL_JAVASCRIPT ) {
- parent::__construct( $modelId, array( CONTENT_FORMAT_JAVASCRIPT ) );
- }
-
- public function unserializeContent( $text, $format = null ) {
- $this->checkFormat( $format );
-
- return new JavaScriptContent( $text );
- }
-
- public function makeEmptyContent() {
- return new JavaScriptContent( '' );
- }
+class JavaScriptContentHandler extends CodeContentHandler {
/**
- * Returns the english language, because JS is english, and should be handled as such.
- *
- * @return Language wfGetLangObj( 'en' )
- *
- * @see ContentHandler::getPageLanguage()
+ * @param string $modelId
*/
- public function getPageLanguage( Title $title, Content $content = null ) {
- return wfGetLangObj( 'en' );
+ public function __construct( $modelId = CONTENT_MODEL_JAVASCRIPT ) {
+ parent::__construct( $modelId, array( CONTENT_FORMAT_JAVASCRIPT ) );
}
- /**
- * 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' );
+ protected function getContentClass() {
+ return 'JavaScriptContent';
}
}