mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 00:05:00 +00:00
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:
parent
6ce04f919b
commit
08de37719d
|
@ -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 ) )
|
||||
. '});'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue