The test for $title->isCssJsSubpage() seems to have gotten lost in
the refactoring in r110794, so enabling CodeEditor for core only
affects the MediaWiki namespace. This restores that test, so user css/js
subpages also get CodeEditor when $wgCodeEditorEnableCore is true.
Change-Id: Id02825f922a1ed0aace7c9ffd940fe8d29bb5d79
LivePreview takes the text from the textarea and sends it to the server
via an Ajax call to handle preview and diff. But CodeEditor hides that
textarea, and only updates it when the form is submitted or the "disable
CodeEditor" button is used.
Fortunately, LivePreview already provides a custom JavaScript event to
indicate when it is about to pull the textarea contents. So all we have
to do is listen for that and update it.
Bug: 47235
Change-Id: Iba1b727c55aabcd31afc06cec99618fcdce207d8
Ace uses JavaScript Web Workers for linting code. Ace's attempt to load workers
in JS and JSON modes runs into the mismatch between its require()
implementation and ResourceLoader, resulting in a request for
/worker_<lang>.js, which 404s.
Change-Id: Ia60ef2122c015635ef0ad963a956b4f77cd6f7e8
MZMcBride suggested CodeEditor should be deployed to Meta, citing the
need for a JSON-aware interface for editing articles in the new
Schema: namespace, which are JSON-encoded. The bundled distribution of
ACE supports JSON, but the extension does not include it as one of the
file formats it supports.
Change-Id: Ice63dece67c732b76c23abc617782332435427cf
Scribunto requires that the CodeEditor extension be installed, but I
haven't reviewed CodeEditor for its primary use case, i.e. CSS and
JS. The automatic brace close feature in JS mode might be annoying for
some. I'm ready to deploy Scribunto but the CodeEditor core
functionality will need to be deployed separately.
Change-Id: I0d423563cc13f9f8ec00590c8e16273d10f1dbce
Presumably the unbind was meant to refer to the event which was bound in
setupCodeEditor(), not a nonexistent function. It appeared to work because
passing an undefined value as the second argument to unbind() causes all
event handlers to be unbound.
Change-Id: I51b8e7de5e95cb17b595a6b8022a6216048cdb41
Updated Ace to the latest version of my fork on Github, i.e.
approximately 0.2.0 plus some improvements to the Lua indenting module.
I have submitted a pull request, so hopefully the next update will be
from upstream.
The suffixed file names (*-uncompressed, *-noconflict) have disappeared
from upstream, replaced by conditional compilation in separate build
directories. There's not much point in maintaining two unused copies of
the entire source tree, so I deleted them. To avoid migration issues, I
re-added symlinks in place of the suffixed files which were previously
referenced from MediaWiki.
Change-Id: Ic9d2450528769539dfea59bdde7620dbec903604
Remove the "using CodeEditor" automatic edit summary. Maybe this makes
sense for a gadget, but it certainly doesn't make sense as an extension
enabled by default for all JS, CSS and Lua pages.
Change-Id: If3b29d3878f5b8b43727ae34e4b5e3a2f4137a6f
Depend on ext.wikiEditor.toolbar instead of just ext.wikiEditor since
both are needed, and under certain circumstances the module would try to
initialise before the toolbar component was loaded.
Change-Id: Ie6a725513399815670ff0d24fa394c0b3b3a2a7e