PC Nerd Posted July 25, 2008 Share Posted July 25, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/ Share on other sites More sharing options...
DeanWhitehouse Posted July 25, 2008 Share Posted July 25, 2008 I have never seen a tutorial for this, and if you are as good as you say with Javascript and ajax this should be easy Here is a link to one i started, with little javascript knowledge http://americangangsters.org/bbcode.php Also this is the wrong forum, it has nothing to with php Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599404 Share on other sites More sharing options...
PC Nerd Posted July 25, 2008 Author Share Posted July 25, 2008 hmm thanks. how woudl all thsi sort of stuff be stored in a php database - and displayed back again???, im mainly at a loss as to how to setup storage etc. thanks Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599465 Share on other sites More sharing options...
DeanWhitehouse Posted July 25, 2008 Share Posted July 25, 2008 what do you mean all this stuff, you will need to set up bbcode in PHP then just save the data in the textarea in the db Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599481 Share on other sites More sharing options...
PC Nerd Posted July 25, 2008 Author Share Posted July 25, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599832 Share on other sites More sharing options...
DeanWhitehouse Posted July 26, 2008 Share Posted July 26, 2008 do you mean where the bbcode is applied instantly? Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599840 Share on other sites More sharing options...
PC Nerd Posted July 26, 2008 Author Share Posted July 26, 2008 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.. Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599858 Share on other sites More sharing options...
DarkWater Posted July 26, 2008 Share Posted July 26, 2008 Can you actually bold text inside of a textarea? I wasn't aware that you could. Maybe some Javascript magic, but I'm not sure. I'll look it up and post back. Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599860 Share on other sites More sharing options...
DeanWhitehouse Posted July 26, 2008 Share Posted July 26, 2008 yer, u would have to make the bbcode regex in javascript Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599861 Share on other sites More sharing options...
PC Nerd Posted July 26, 2008 Author Share Posted July 26, 2008 ok......... but im assuming that that wont appear within the text area - i woudl have to figure out another way to have that text appear like that wouldnt i? thanks Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599862 Share on other sites More sharing options...
DarkWater Posted July 26, 2008 Share Posted July 26, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599865 Share on other sites More sharing options...
DeanWhitehouse Posted July 26, 2008 Share Posted July 26, 2008 yer, u could have a preview below the textarea Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599866 Share on other sites More sharing options...
PC Nerd Posted July 26, 2008 Author Share Posted July 26, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599868 Share on other sites More sharing options...
DeanWhitehouse Posted July 26, 2008 Share Posted July 26, 2008 yer Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599892 Share on other sites More sharing options...
PC Nerd Posted July 26, 2008 Author Share Posted July 26, 2008 well ive got it working in a sense - ive got it copying from teh textfield into the preview area...... im just working on adding the bold buttons etc etc. Thanks Topic solved. Quote Link to comment https://forums.phpfreaks.com/topic/116568-solved-php-based-ajaxjavascript-rich-text-editor-cms-etc/#findComment-599894 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.