2

I want to provide javascript editing with highlighting in my web page. I am looking around for a good text area and I found dijit.Editor, however, I also need to have tabbed browsing for different files (a.js , b.js , c.js , ... , z.js). dijit.Editor seems to have tabs along the top (see here) but I can't tell if those are built in, or if they can be assigned.

Can someone please either answer my question, or recommend a different editor to use. Cheers

4
  • Which tabs do you mean? If you're referring to the "Demo, Copy&Paste, Javascript" tabs in the demo windows, those are not part of dijit.Editor. They're merely part of the demonstration engine Dojo uses for its widgets. The Editor widget is just the toolbar of buttons and textarea beneath it. Commented Jul 10, 2011 at 16:50
  • 1
    The tabs in those demos are most likely a dijit.layout.TabContainer tab widget. If this is what you needed to know, I can copy the info down as an answer below. Commented Jul 10, 2011 at 16:54
  • Michael, thanx. That's exactly what I meant. I couldn't figure out how those worked. I didn't want to beat my head against the wall learning how the Editor worked if it only had "Demom Copy&Past, Javascript" as tabs.
    – puk
    Commented Jul 10, 2011 at 17:27
  • Great. I put this info down as an answer. Accept if you wish. Cheers. Commented Jul 10, 2011 at 17:31

2 Answers 2

3

If you're referring to the "Demo, Copy&Paste, Javascript" tabs in the demo windows, those are not part of dijit.Editor. They're merely part of the demonstration engine Dojo uses for its widgets. The Editor widget is just the toolbar of buttons and textarea beneath it.

The tabs in those demos are most likely a dijit.layout.TabContainer tab widget.

I've used dijit.Editor in a few projects and find it to be extremely flexible. The other major benefit is its close integration to the rest of the Dojo toolkit and Dijit widgets. The API is very consistent and well-organized across the Dojo platform, and you won't muchfind yourself searching for plugins of varying quality as with jQuery.

2
  • Michael, what I need is the javascript highlight capabilities (as in the 'javascript' tab) but in the text area. Is this possible?
    – puk
    Commented Jul 10, 2011 at 17:37
  • @puk The syntax highlighting most likely done with dojox.highlight It's probably possible apply it inside of dijit.Editor, but I have no idea how. docs.dojocampus.org/dojox/highlight. Commented Jul 11, 2011 at 18:55
1

see discussion here

dijit.Editor is based on contentEditable and while that's great for rich text editing and short snippets of text, it is not the ideal text editor for code. The underlying browser mechanism for contentEditable doesn't scale particularly well for long files, and there's unnecessary wiring for rich text, variable spacing and such. I have seen a couple of people build an editor out of dijit.Editor and dojox.highlight and you may find that sufficient (sorry, I don't remember exactly where ATM)

2
  • The Orion editor looks the nicest but ultimitely I went with Ace as it caters the most to programmers. CODE POWER!
    – puk
    Commented Jul 18, 2011 at 18:37
  • 1
    Peller, upon further inspection I thought I should let you, and anyone else reading this know that, although Ace is a very nice editor, the code is very poorly written. There are hardly any comments, there are numerous bad practices (like using if without curly brackets) and the code is spread across multiple scripts, but they still reference the same variables/functions.
    – puk
    Commented Jul 18, 2011 at 22:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.