MediaWiki  master
JavaScriptContentHandler Class Reference

Content handler for JavaScript pages. More...

Inheritance diagram for JavaScriptContentHandler:
Collaboration diagram for JavaScriptContentHandler:

Public Member Functions

 __construct ($modelId=CONTENT_MODEL_JAVASCRIPT)
 
 makeRedirectContent (Title $destination, $text= '')
 Create a redirect that is also valid JavaScript. More...
 
 supportsRedirects ()
 
- Public Member Functions inherited from CodeContentHandler
 getFieldsForSearchIndex (SearchEngine $engine)
 
 getPageLanguage (Title $title, Content $content=null)
 Returns the english language, because code is english, and should be handled as such. More...
 
 getPageViewLanguage (Title $title, Content $content=null)
 Returns the english language, because code is english, and should be handled as such. More...
 
- Public Member Functions inherited from TextContentHandler
 __construct ($modelId=CONTENT_MODEL_TEXT, $formats=[CONTENT_FORMAT_TEXT])
 
 getFieldsForSearchIndex (SearchEngine $engine)
 
 makeEmptyContent ()
 Creates an empty TextContent object. More...
 
 merge3 (Content $oldContent, Content $myContent, Content $yourContent)
 Attempts to merge differences between three versions. More...
 
 serializeContent (Content $content, $format=null)
 Returns the content's text as-is. More...
 
 supportsDirectEditing ()
 
 unserializeContent ($text, $format=null)
 Unserializes a Content object of the type supported by this ContentHandler. More...
 

Protected Member Functions

 getContentClass ()
 
- Protected Member Functions inherited from CodeContentHandler
 getContentClass ()
 
- Protected Member Functions inherited from TextContentHandler
 getContentClass ()
 Returns the name of the associated Content class, to be used when creating new objects. More...
 

Detailed Description

Content handler for JavaScript pages.

Todo:
Create a ScriptContentHandler base class, do highlighting stuff there?
Since
1.21

Definition at line 29 of file JavaScriptContentHandler.php.

Constructor & Destructor Documentation

JavaScriptContentHandler::__construct (   $modelId = CONTENT_MODEL_JAVASCRIPT)
Parameters
string$modelId

Definition at line 34 of file JavaScriptContentHandler.php.

References CONTENT_FORMAT_JAVASCRIPT.

Member Function Documentation

JavaScriptContentHandler::getContentClass ( )
protected
Returns
string

Definition at line 41 of file JavaScriptContentHandler.php.

Referenced by makeRedirectContent().

JavaScriptContentHandler::makeRedirectContent ( Title  $destination,
  $text = '' 
)

Create a redirect that is also valid JavaScript.

Parameters
Title$destination
string$textignored
Returns
JavaScriptContent

Definition at line 56 of file JavaScriptContentHandler.php.

References Xml\encodeJsCall(), getContentClass(), Title\getFullURL(), and PROTO_RELATIVE.

JavaScriptContentHandler::supportsRedirects ( )

Definition at line 45 of file JavaScriptContentHandler.php.


The documentation for this class was generated from the following file: