Don't try to inline load ext.scribunto on mobile

This module doesn't exist on mobile, so don't try to load it there
(which will produce an exception).

Bug: 59808
Change-Id: Ifad7edb508c1f740a109e8f5c1656e4c7841ab13
This commit is contained in:
Marius Hoch 2014-03-16 03:48:41 +01:00
parent 6ce04f919b
commit 08de37719d

View file

@ -364,10 +364,17 @@ WIKI;
* @param $parserOutput ParserOutput
*/
public static function parserOutputHook( $outputPage, $parserOutput ) {
// Only run the following if we're not on mobile as ext.scribunto doesn't work on mobile. Bug 59808
if ( $outputPage->getTarget() === 'mobile' ) {
return;
}
$outputPage->addModules( 'ext.scribunto' );
$outputPage->addInlineScript( 'mw.loader.using("ext.scribunto", function() {' .
Xml::encodeJsCall( 'mw.scribunto.setErrors', array( $parserOutput->scribunto_errors ) )
. '});' );
$outputPage->addInlineScript(
'mw.loader.using("ext.scribunto", function() {' .
Xml::encodeJsCall( 'mw.scribunto.setErrors', array( $parserOutput->scribunto_errors ) )
. '});'
);
}
/**