Last modified: 2014-05-06 23:30:56 UTC
CodeEditor's cookie toggle mechanism is not implemented correctly and causes massive problems with other editors (such as missing edit areas with wikEd). CodeEditor sets a cookie to signal that it is active on an edit page (wikiEditor-0-codeEditor-enabled = 1). This cookie is also used to toggle the editor's activation state. Problem: CodeEditor is active by default, even if the the cookie is absent. However, CodeEditor does not recreate the missing cookie. CodeEditor is then active without the cookie and without an easy mechanism for other editors to detect its active presence. For wikEd, this leads to edit pages without any editing area (see https://en.wikipedia.org/wiki/User_talk:Cacycle/wikEd#WikEd_conflicts_with_code_editor). Solution: Either CodeEditor has to recreate the cookie when it activates itself in the absence of the cookie or CodeEditor should stay inactive in the absence of the cookie.
(Another wikEd bug report about this: https://en.wikipedia.org/wiki/User_talk:Cacycle/wikEd#wikEd_bug_report:_Edit_box_doesn.27t_appear_on_CSS_pages)
@Cacycle, do you prefer using a cookie for this ? I was considering adding a mw.hook event instead.. (and i actually have a patch that changes the cookie name, so it's good to know that you rely on that thing right now)
Anything that wikEd can read when the script runs and installs itself would be fine. wikEd runs very late during the page loading process, possibly as the last script on the page. Therefore, a hook might not be the best solution for that.
Change 130068 had a related patch set uploaded by TheDJ: Persistent disabling of CodeEditor https://gerrit.wikimedia.org/r/130068
Change 130068 merged by jenkins-bot: Persistent disabling of CodeEditor https://gerrit.wikimedia.org/r/130068
Next version has this persisted as a useroption, using: mw.user.options.get( 'usebetatoolbar' ) + mw.user.options.get( 'usecodeeditor' ) usecodeeditor also defaults to enabled (0 and 1 are used as values). To be deployed in the next 1,5 weeks.