Commit graph

77 commits

Author SHA1 Message Date
Amir E. Aharoni 54c5b35bc3 Explicit dir="ltr" for code
Change-Id: Ia7d6958a10481c39abb1406b67210cac998818e7
2013-08-24 11:19:30 +03:00
MatmaRex d841459c2e Adjust after changes in core
I6a6c12a9, Id27555c6.

Change-Id: I2e93cfffd7b31b090c93f7911e1e45f2a6619371
2013-05-17 22:04:51 +02:00
Brad Jorsch b802deafbf Make CodeEditor cooperate with the experimental live preview
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
2013-05-07 11:08:47 -04:00
Ori Livneh 8ee19004b3 Disable background linting using WebWorkers
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
2013-02-14 19:05:45 -08:00
Ori Livneh 4ae61874af (Bug 42561) Enable Ace's JSON mode
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
2012-12-01 01:09:55 -08:00
Tim Starling 4fb277c607 Fix unbind call in disableCodeEditor
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
2012-07-13 16:31:23 +10:00
Tim Starling 4bb8a4c984 Updated Ace
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
2012-07-09 02:13:50 +00:00
Tim Starling 84cdb4f4bf Remove automatic edit summary
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
2012-07-03 13:19:56 +10:00
Tim Starling 8fe95e1469 Fixed a couple of minor issues in r115010:
* Scroll up a few lines so that the user can see the error context
* Defer processing of the fragment until the load event, otherwise the code editor is not fully initialised and does not properly respond to the navigateTo() call.
2012-04-23 11:40:43 +00:00
Tim Starling 7fc4552a8d Allow links to specific lines of code using a special fragment syntax 2012-04-23 04:09:47 +00:00
vvv 0ac1a47dbb * Update the list of the languages
* Make the language to be used determined on server side
* Allow extension to enable code editor for certain pages
2012-02-06 21:59:13 +00:00
vvv ea66677b66 * Update Ace
* Fix JS code in order to make Ace work with new updates
2012-02-06 20:59:17 +00:00
Sam Reed 2d686fcbb5 Swap
/*
 *

for

/**
 *
2011-10-26 03:49:06 +00:00
Brion Vibber bf67581924 CodeEditor ext: Add an experimental demo (off by default) mode to edit SyntaxHighlight_GeSHi sections inline using Ace editor
Not ready for prime-time. :) Doesn't actually save pages (just updates the live view), and seems to have problems when invoked multiple times.
Not all GeSHi languages are supported.

Colors of course are different.

Set $wgCodeEditorGeshiIntegration = true to enable; adds a 'section edit link' on source bits.
2011-08-04 22:33:59 +00:00
Brion Vibber 67cc93c468 CodeEditor ext: Update Ace editor to upstream 237c2243734b7968e39bf3c97fa5bb3b26a920c4
Fixes issues with control keys: https://github.com/ajaxorg/ace/issues/294
2011-08-02 14:37:03 +00:00
Brion Vibber 852e1ee551 Fix for CodeEditor's form submit handler; unbind the handler when we disable the editor, and rebind it when we enabled it. Prevents sometimes failing to copy in updates properly or failing during save because an obj is unavailable. 2011-06-17 20:56:34 +00:00
Brion Vibber e31035d86f CodeEditor: compat fix for use as gadget on MediaWiki 1.17
$.map doesn't handle objects in jQuery before 1.6, so roll our own helper internally
2011-06-16 23:24:32 +00:00
Brion Vibber c09fc16d54 Followup to r90240: clean up some stray code, check for an error condition 2011-06-16 23:04:26 +00:00
Brion Vibber c981d97061 CodeEditor: add an interface for gadget loader to override the local $wgExtensionAssetsPath for CodeEditor's usage (to load its icons) 2011-06-16 22:51:39 +00:00
Brion Vibber 81ba498314 CodeEditor ext: basic ability to toggle the syntax-highlighting editor on/off.
When off, we restore the regular textarea and its behavior.
State is saved as a cookie, like other WikiEditor settings.
2011-06-16 22:30:01 +00:00
Brion Vibber 9578a2322f CodeEditor: attempt at disabling some annoying keyboard shortcuts in Ace, but it's not working.
Issue filed upstream at https://github.com/ajaxorg/ace/issues/294 & asked about on mailing list.
2011-06-11 00:08:54 +00:00
Brion Vibber 5d42ce5f24 CodeEditor: fix to avoid selecting when inserting non-samples such as character insertions
Logging some stub func calls
2011-06-10 23:09:52 +00:00
Brion Vibber 3603c6acae CodeEditor: now integrates with WikiEditor's search-replace 2011-06-10 20:04:17 +00:00
Brion Vibber 2b4a12cadf CodeEditor: fix for encapsulateSelection; now handles replacements & selection for standard cases (bold/italic/link insertion, quote pairs, etc) 2011-06-10 19:32:53 +00:00
Brion Vibber 18af202a72 Partway through integrating CodeEditor more closely with WikiEditor. Special character insertions now work! Bold, link etc will insert their sample text, which is less useful but hey. 2011-06-10 01:11:18 +00:00
Brion Vibber e3f5ab3f2e Update CodeEditor extension to load Ace editor via RL instead of manually 2011-06-09 22:17:00 +00:00
Brion Vibber ec233e4297 Add stub extension version of CodeEditor embedding Ace (ace.ajax.org) for editing JS and CSS pages.
Simply using the existing gadget version modified to load Ace from the extension directory for now, will integrate better into WikiEditor and use ResourceLoader to load Ace itself in upcoming commits.
2011-06-09 21:50:45 +00:00