2

I want to create a component on ExtJS like the editor that have stackoverflow for ask question (only Bold and Emphasis buttons). I think that should be an extension of textarea but i dont know how to select text selected and how to replace with tags+text. Please give me some ideas.

Thanks

richardhell
  • 969
  • 2
  • 10
  • 22

2 Answers2

1

If you're talking about the ability to use asterisks for bullets and such, in that mode StackOverflow's editor uses something called "Markdown".

Here's one example of someone trying to make a markdown-based textarea with preview in Extjs:

http://www.sencha.com/learn/Extension:Ext.ux.MarkdownEditor

If you look around for other Markdown-related editors, you might find some ideas. If you're instead looking for just an "Online Rich-Text Editor" there's plenty of those.


UPDATE 29-APR-2014: There's actually a project you should take a look at. It's called "StackEdit":

https://stackedit.io

It's an open source initiative to supply a markdown editing component. Not ExtJS based, but those who find this question may be interested in what they are doing it.

(I discovered it through one of SO's open-source-recruiting sidebar campaigns; advertising can be useful, apparently.)

  • Ok. Markdown sounds good. But i don't know how download that extension. – richardhell Jun 02 '11 at 17:24
  • Hm, it does seem to be missing. But it probably wasn't a whole lot of code to begin with. There are some client-side and server-side options for processing Markdown, see this question: http://stackoverflow.com/questions/134235/is-there-any-good-markdown-javascript-library-or-control – HostileFork says dont trust SE Jun 02 '11 at 17:41
1

Markdown by John Gruber can be obtained from his site. You could use his documentation as a basis for creating your own plugin for the HtmlEditor.

pierre
  • 1,235
  • 1
  • 13
  • 30