Page MenuHomePhabricator

Make hidden "usecodeeditor" preference visible, and do serve the CodeEditor on the relevant pages if switched on
Open, LowPublic

Description

Since https://git.wikimedia.org/commit/mediawiki%2Fextensions%2FCodeEditor/0c172d6359d1aaeacb0648c93932e736e02efdb2 it is no longer possible to switch on *only* CodeEditor, without switching on WikiEditor ("enhanced toolbar") on all other pages.

Related: bug 45850, bug 46779, bug 55936

There's a new hidden user preference "usecodeeditor", tied to the "enhanced toolbar" preference. The current behavior is that unless "enhanced toolbar" is enabled, the CodeEditor will not be active.

However, there's absolutely no reason for this. I have "enhanced toolbar" OFF, but I do want to use the CodeEditor. Although the MediaWiki UI (via Special:Preferences) gives me no way of doing that, I can actually get this by

  1. Switching on the hidden preference by running the following once, for instance from my browser's console:

    api.postWithToken('options', {action: 'options', optionname: 'usecodeeditor',

optionvalue: 1});

  1. Loading the CodeEditor myself in common.js through mw.loader.load('ext.codeEditor'); if I'm editing a JS/CSS/Module page

That works: I do not get the "enhanced toolbar" on normal article editing (as desired), but I do get the CodeEditor on code pages (also as desired).

This shows that there is absolutely no functional reason not to allow this.

Therefore, I ask that:

  • In Special:Preferences the now hidden preference "usecodeeditor" be made visible and settable independently from the "enhanced toolbar" preference. (Possibly default-enabled when the user enables the "enhanced toolbar".) In any case, it must be possibly to set "enhanced toolbar" to OFF and "usecodeeditor" to ON.
  • The CodeEditor JS is served automatically on relevant pages (JS/CSS/LUA modules) if that "usecodeeditor" preference is switched on.

Note that I don't care whether the CodeEditor uses the enhanced toolbar or not. It does, and for me, that's fine. "usecodeeditor" just means "use the code editor on code pages, including whatever it needs to work, including the enhanced toolbar if it needs that", while the "enhanced toolbar" pref just means "use the enhanced toolbar for normal editing".


Version: master
Severity: normal

Details

Reference
bz65575

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:10 AM
bzimport added a project: CodeEditor.
bzimport set Reference to bz65575.
bzimport added a subscriber: Unknown Object (MLST).