6 class JavaScriptContent
extends TextContent
{
7 public function __construct( $text ) {
8 parent
::__construct( $text, CONTENT_MODEL_JAVASCRIPT
);
12 * Returns a Content object with pre-save transformations applied using
13 * Parser::preSaveTransform().
17 * @param ParserOptions $popts
20 public function preSaveTransform( Title
$title, User
$user, ParserOptions
$popts ) {
22 // @todo: make pre-save transformation optional for script pages
25 $text = $this->getNativeData();
26 $pst = $wgParser->preSaveTransform( $text, $title, $user, $popts );
28 return new JavaScriptContent( $pst );
32 protected function getHtml( ) {
34 $html .= "<pre class=\"mw-code mw-js\" dir=\"ltr\">\n";
35 $html .= $this->getHighlightHtml( );
36 $html .= "\n</pre>\n";