Merge "Remove $wgCodeMirrorEnableFrontend"

This commit is contained in:
jenkins-bot 2017-08-25 18:31:19 +00:00 committed by Gerrit Code Review
commit 13a4780879
2 changed files with 5 additions and 8 deletions

View file

@ -6,21 +6,19 @@ class CodeMirrorHooks {
* Checks, if CodeMirror should be loaded on this page or not.
*
* @param IContextSource $context The current ContextSource object
* @global bool $wgCodeMirrorEnableFrontend Should CodeMirror be loaded on this page
* @staticvar null|boolean $isEnabled Saves, if CodeMirror should be loaded on this page or not
* @return bool
*/
private static function isCodeMirrorEnabled( IContextSource $context ) {
global $wgCodeMirrorEnableFrontend, $wgCodeMirrorBetaFeature;
global $wgCodeMirrorBetaFeature;
static $isEnabled = null;
// Check, if we already checked, if page action is editing, if not, do it now
if ( $isEnabled === null ) {
if ( $wgCodeMirrorEnableFrontend && !$wgCodeMirrorBetaFeature ) {
if ( !$wgCodeMirrorBetaFeature ) {
$isEnabled = in_array( Action::getActionName( $context ), [ 'edit', 'submit' ] );
} else {
$isEnabled = $wgCodeMirrorEnableFrontend &&
in_array( Action::getActionName( $context ), [ 'edit', 'submit' ] ) &&
$isEnabled = in_array( Action::getActionName( $context ), [ 'edit', 'submit' ] ) &&
$wgCodeMirrorBetaFeature &&
ExtensionRegistry::getInstance()->isLoaded( 'BetaFeatures' ) &&
BetaFeatures::isFeatureEnabled(
@ -69,8 +67,8 @@ class CodeMirrorHooks {
* @param array $preferences
*/
public static function onGetBetaFeaturePreferences( User $user, &$preferences ) {
global $wgCodeMirrorEnableFrontend, $wgCodeMirrorBetaFeature, $wgExtensionAssetsPath;
if ( $wgCodeMirrorEnableFrontend && $wgCodeMirrorBetaFeature ) {
global $wgCodeMirrorBetaFeature, $wgExtensionAssetsPath;
if ( $wgCodeMirrorBetaFeature ) {
$preferences['codemirror-syntax-highlight'] = [
'label-message' => 'codemirror-beta-title',
'desc-message' => 'codemirror-beta-desc',

View file

@ -163,7 +163,6 @@
"ext.CodeMirror.visualEditor"
],
"config": {
"CodeMirrorEnableFrontend": true,
"CodeMirrorBetaFeature": false
},
"CodeMirrorTagModes": {