|Page 1 of 1||[ 6 posts ]|
I'd like to inquire about the feasibility of using YUI 2 RTE along with Auto-Complete (and possibly other components) to implement a Ruby editor with application-specific extensions (abut 100 classes and 1,000 methods).
The application (which I prefer not to publicly identify) ships with a bare-bones, one-line-at-a-time "web dialog" interface with history recall (via up- and down-arrow on keyboard). There is no syntax highlighting, no auto-suggest, no auto-completion, etc. features. So I want to replace it with one that does these things (at least).
I've already looked at an existing 3rd party's product, which was based on jquery. Unfortunately this product falls well short of my standards, so I'd like to write my own. (The jquery files used were: ui.core.js; widget,js; 1.7.2.min.js; console-extensions.js; and fieldselection.js)
I've also looked at Dav's YUI: Editor: Code Editor w/Syntax Highlighting and CodePress--so it seems I'm on the right track in terms of being able to do this with YUI 2.
However, what about the feasibility to include such features as auto-suggest and auto-complete? That is, as one is typing in Ruby code, the following happens:
Type 'A' -> immediately causes a pop-up to appear containing Ruby modules starting with 'A'; user then presses the tab key to select the first item in the list (let's say it's 'Abc'):
Abc -> type '.d' -> causes all methods assigned to module 'Abc' to appear in a pop-up; then press the tab key/arrow keys to select one ('def'):
Then once the user has entered all the code, it has to be stripped-of-HTML so the "plain text" can be sent to the application's Ruby interpreter.
While I'm not desirous of implementing Notepad++ or CodeWright 7.5 (remember this?), I do want to produce a polished product.
So I'm looking for some guidance, suggestions, examples, and some measure for how difficult an undertaking this will be.
Implementing AutoComplete on top of the YUI 2 Editor is not a trivial task
How about this instead?
User types 'Abc.', then clicks a dynamically-configured button named "Methods"--which in this case since the user typed 'Abc' plus '.', all the methods of Abc would appear in a list when the user clicks the button; from this list the user could select a method, which would then automatically be inserted after the '.' -
Yeah, if you had some way of triggering the list without judging the typing it would be way easier.
For the record, the issue is that the Editor's content is an iframe so a standard AutoComplete won't like to attach to it. Also, the Editor's content is HTML and not plain text, so some processing needs to happen on the content before it can be matched.
Thank you, Dav.
For the benefit of others interested in this, you may want to consider this:
Highlight.js highlights syntax in code examples on blogs, forums and in fact on any web pages. It's very easy to use because it works automatically: finds blocks of code, detects a language, highlights it.
The library knows 52 languages and is bundled with 26 style themes.
|Page 1 of 1||[ 6 posts ]|
|You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum