mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-27 17:50:44 +00:00
Only add WikiEditor for content model WikiText
Together with solving bug 29908, this makes the presence of the toolbar consistent. It is added to pages handling wikitext. Note that we provide the CodeEditor on all JS/CSS/Lua pages. Bug: 24713 Bug: 24041 Change-Id: Iaa6b9a6c511380ed1669d8b95cba4a3ddc6f9ab6
This commit is contained in:
parent
e50916e67b
commit
dbbb722210
|
@ -155,11 +155,14 @@ class WikiEditorHooks {
|
|||
*
|
||||
* Adds the modules to the edit form
|
||||
*
|
||||
* @param $toolbar array list of toolbar items
|
||||
* @param $editPage EditPage the current EditPage object.
|
||||
* @param $output OutputPage object.
|
||||
* @return bool
|
||||
*/
|
||||
public static function editPageShowEditFormInitial( &$toolbar ) {
|
||||
global $wgOut;
|
||||
public static function editPageShowEditFormInitial( $editPage, $outputPage ) {
|
||||
if ( $editPage->contentModel !== CONTENT_MODEL_WIKITEXT ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Add modules for enabled features
|
||||
foreach ( self::$features as $name => $feature ) {
|
||||
|
@ -167,10 +170,10 @@ class WikiEditorHooks {
|
|||
continue;
|
||||
}
|
||||
if ( isset( $feature['stylemodules'] ) ) {
|
||||
$wgOut->addModuleStyles( $feature['stylemodules'] );
|
||||
$outputPage->addModuleStyles( $feature['stylemodules'] );
|
||||
}
|
||||
if ( isset( $feature['modules'] ) ) {
|
||||
$wgOut->addModules( $feature['modules'] );
|
||||
$outputPage->addModules( $feature['modules'] );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue