3 # XXX: make ScriptContentHandler base class, do highlighting stuff there?
8 class JavaScriptContentHandler
extends TextContentHandler
{
10 public function __construct( $modelId = CONTENT_MODEL_JAVASCRIPT
) {
11 parent
::__construct( $modelId, array( CONTENT_FORMAT_JAVASCRIPT
) );
14 public function unserializeContent( $text, $format = null ) {
15 $this->checkFormat( $format );
17 return new JavaScriptContent( $text );
20 public function makeEmptyContent() {
21 return new JavaScriptContent( '' );
25 * Returns the english language, because JS is english, and should be handled as such.
27 * @return Language wfGetLangObj( 'en' )
29 * @see ContentHandler::getPageLanguage()
31 public function getPageLanguage( Title
$title, Content
$content = null ) {
32 return wfGetLangObj( 'en' );
36 * Returns the english language, because CSS is english, and should be handled as such.
38 * @return Language wfGetLangObj( 'en' )
40 * @see ContentHandler::getPageViewLanguage()
42 public function getPageViewLanguage( Title
$title, Content
$content = null ) {
43 return wfGetLangObj( 'en' );