MediaWiki  1.23.2
JavaScriptContent Class Reference

Content for JavaScript pages. More...

Inheritance diagram for JavaScriptContent:
Collaboration diagram for JavaScriptContent:

Public Member Functions

 __construct ( $text)
 
 preSaveTransform (Title $title, User $user, ParserOptions $popts)
 Returns a Content object with pre-save transformations applied using Parser::preSaveTransform(). More...
 
- Public Member Functions inherited from TextContent
 __construct ( $text, $model_id=CONTENT_MODEL_TEXT)
 
 convert ( $toModel, $lossy='')
 This implementation provides lossless conversion between content models based on TextContent. More...
 
 copy ()
 
 diff (Content $that, Language $lang=null)
 Diff this content object with another content object. More...
 
 getNativeData ()
 Returns the text represented by this Content object, as a string. More...
 
 getParserOutput (Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
 Returns a generic ParserOutput object, wrapping the HTML returned by getHtml(). More...
 
 getSize ()
 returns the text's size in bytes. More...
 
 getTextForSearchIndex ()
 Returns the text represented by this Content object, as a string. More...
 
 getTextForSummary ( $maxlength=250)
 Returns a textual representation of the content suitable for use in edit summaries and log messages. More...
 
 getWikitextForTransclusion ()
 Returns attempts to convert this content object to wikitext, and then returns the text string. More...
 
 isCountable ( $hasLinks=null)
 Returns true if this content is not a redirect, and $wgArticleCountMethod is "any". More...
 
- Public Member Functions inherited from AbstractContent
 addSectionHeader ( $header)
 
 equals (Content $that=null)
 
 getContentHandler ()
 
 getDefaultFormat ()
 
 getDeletionUpdates (WikiPage $page, ParserOutput $parserOutput=null)
 
 getModel ()
 
 getRedirectChain ()
 
 getRedirectTarget ()
 Subclasses that implement redirects should override this. More...
 
 getSecondaryDataUpdates (Title $title, Content $old=null, $recursive=true, ParserOutput $parserOutput=null)
 Returns a list of DataUpdate objects for recording information about this Content in some secondary data store. More...
 
 getSection ( $sectionId)
 
 getSupportedFormats ()
 
 getUltimateRedirectTarget ()
 
 isEmpty ()
 
 isRedirect ()
 
 isSupportedFormat ( $format)
 
 isValid ()
 Subclasses may override this to implement (light weight) validation. More...
 
 matchMagicWord (MagicWord $word)
 This default implementation always returns false. More...
 
 preloadTransform (Title $title, ParserOptions $popts, $params=array())
 
 prepareSave (WikiPage $page, $flags, $baseRevId, User $user)
 
 replaceSection ( $section, Content $with, $sectionTitle='')
 
 serialize ( $format=null)
 
 updateRedirect (Title $target)
 This default implementation always returns $this. More...
 

Protected Member Functions

 getHtml ()
 
- Protected Member Functions inherited from TextContent
 getHighlightHtml ()
 Generates a syntax-highlighted version of the content, as HTML. More...
 
- Protected Member Functions inherited from AbstractContent
 checkFormat ( $format)
 
 checkModelID ( $modelId)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractContent
string $model_id
 Name of the content model this Content object represents. More...
 

Detailed Description

Content for JavaScript pages.

Definition at line 33 of file JavaScriptContent.php.

Constructor & Destructor Documentation

◆ __construct()

JavaScriptContent::__construct (   $text)
Parameters
string$textJavaScript code.

Reimplemented from AbstractContent.

Definition at line 38 of file JavaScriptContent.php.

References CONTENT_MODEL_JAVASCRIPT.

Member Function Documentation

◆ getHtml()

JavaScriptContent::getHtml ( )
protected
Returns
string JavaScript wrapped in a
 tag.

Reimplemented from TextContent.

Definition at line 66 of file JavaScriptContent.php.

References $html, and TextContent\getHighlightHtml().

◆ preSaveTransform()

JavaScriptContent::preSaveTransform ( Title  $title,
User  $user,
ParserOptions  $popts 
)

Returns a Content object with pre-save transformations applied using Parser::preSaveTransform().

Parameters
Title$title
User$user
ParserOptions$popts
Returns
JavaScriptContent

Reimplemented from TextContent.

Definition at line 52 of file JavaScriptContent.php.

References $title, $user, $wgParser, TextContent\getNativeData(), and global.


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