| 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).
I can use HTML, JavaScript, and CSS to implement this "web dialog" interface to the application's Ruby API. (There will also be at least one Ruby file for the application to load at start-up to make the application aware of this extension/plug-in.) 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'): etc. 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. Thank you. |
|
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 '.' - Abc.def. |
|
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 Quote: 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 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group