mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-27 16:40:07 +00:00
CodeEditor should fail if WikiEditor is not available
Instead of quietly failing, code should prompt the user to install WikiEditor. Bug: T67072 Change-Id: I5ce1d436fe1d79abfd2dda5ad7cdd09bbe1ca914
This commit is contained in:
parent
be65f2fe94
commit
db76c1b19a
|
@ -57,6 +57,8 @@ class CodeEditorHooks {
|
|||
if ( $lang && $output->getUser()->getOption( 'usebetatoolbar' ) ) {
|
||||
$output->addModules( 'ext.codeEditor' );
|
||||
$output->addJsConfigVars( 'wgCodeEditorCurrentLanguage', $lang );
|
||||
} elseif ( !ExtensionRegistry::getInstance()->isLoaded( "WikiEditor" ) ) {
|
||||
throw new ErrorPageError( "codeeditor-error-title", "codeeditor-error-message" );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -16,5 +16,7 @@
|
|||
"codeeditor-gotoline-placeholder": "line[:column]",
|
||||
"codeeditor-gotoline-prompt": "Enter a line number",
|
||||
"codeeditor-indent": "Indent",
|
||||
"codeeditor-outdent": "Outdent"
|
||||
"codeeditor-outdent": "Outdent",
|
||||
"codeeditor-error-title": "Dependency failed",
|
||||
"codeeditor-error-message": "CodeEditor needs WikiEditor to be loaded."
|
||||
}
|
||||
|
|
|
@ -19,5 +19,7 @@
|
|||
"codeeditor-gotoline-placeholder": "Placeholder for goto line prompt's input",
|
||||
"codeeditor-gotoline-prompt": "Label for goto line prompt",
|
||||
"codeeditor-indent": "Used as a label for toolbar button to indent text in the editor",
|
||||
"codeeditor-outdent": "Used as a label for toolbar button to outdent text in the editor"
|
||||
"codeeditor-outdent": "Used as a label for toolbar button to outdent text in the editor",
|
||||
"codeeditor-error-title": "Used as a title when there is a missing dependency",
|
||||
"codeeditor-error-message": "Explains the dependency on WikiEditor"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue