Jump to content

[SOLVED] php based, AJAX/JavaScript rich text editor ( CMS etc)


PC Nerd

Recommended Posts

Hi,

 

Im looking if anyone knows an y fantastic tutorial o how to build a rich text editor, similar to those found in CMS's such as joomla, modx(specifically this one), and of course - this one here.  Im reasonably good at JavaScript, and pretty good at AJAX sort of stuff - so im wanting to mix them together to build myself a  rich text editor, to build my backends for websites etc.

 

Im specifically looking for font size, text align, links, and image support at the moment, so not too complex.  I thought about building a HTML page where elements are dynamically created - and then their top,left values saved into a database but i think it would work much better to use a rich text editor that appears similar to office programs.

 

Any suggestions on tutorials would be great.  I dont want to use a pre built one, but build one myself from scratch - all hand coded etc.

 

Thanks :)

Link to comment
Share on other sites

Ok

 

BBCode is visable to the user - just like in these forums.  I want to build more of a rich text editor where the text is updated live.  So im assuming that this requires actually working intently with the DOM to create <b> etc for the text.... but i dont really know how to approach the task.  does anyone else know of any tutorials?  Ive looked around and the only one ive found i had to pay for.

Link to comment
Share on other sites

um - yes....

 

so if i was to eg: highlight text, and click the bold button a) the text would appear that way in the text field, and b) it woudl be applied to be saved to the database.

 

how would i achive this using a textarea?

Thanks

 

Essentially id like to have the phpfreaks new post/reply area redone so that text is live etc..

Link to comment
Share on other sites

You can't technically produce stylized text INSIDE of a textarea.  CSS on textarea's don't work particularly well in most browsers either because quite frankly, that's not what textareas are meant for.  The only way is to use the Windows RichEdit control.

Link to comment
Share on other sites

ahhh - ok...so:

 

[preview area.... maybe <div id = 'contentPreview'> ]

 

image toolbar etc, with smaller text area to create text.... text is added live to the contentPreview area, and buttones on selected text in either window ( most likely the page)  will have hte live html added to it.  then on submit:  Javascript will seach the content of contentPreview, and send it as a text value to the php page?

 

I like it :)

 

thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.