The Unsung Heros of Rich Text Editors II

HTML Javascript Rich Text Editor 2

In my last post I talked about how to make a document or element editable and mentioned about Document.execCommand. Now, I am going to continue the conversation.

The document.execCommand (https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand) allows you to have the browser apply specific commands to the document that is marked as document.designMode = “on”; and it is also very important to note that many, if not most commands, need to be tested against the browser prior to be used.

Now, if you are looking to handle Rich Text Editing (RTE) within a DIV element, then this actually doesn’t change a bit (I was actually surprised by this… the browser assumes that the insertion point is all that is needed to handle the commands and will process through it appropriately… if you look at the difference (I highlighted only the difference between this and the previous code for the next code section), the only difference is what is editable.

Anyway, this does open up a whole list of doors for me, with just a quick look at the User Agent string, and then determining which commands are available and which are not, it becomes very easy to make my own RTE editor, both as an mobile and desktop version. At some point, I am probably going to build out a full setup and walk you through that, but for now, Monty Shokeen made a simple walk through last year called Create a WYSIWYG Editor With the contentEditable Attribute, and I did like how well he designed it. The only thing I might do differently is parse through the User Agent and give more/less commands based upon what the end user is showing.

Until next time, Happy Coding and may you be blessed!

12 comments

  1. I just wanted to write down a brief word in order to thank you for these great solutions you are sharing here. My rather long internet research has at the end of the day been recognized with beneficial know-how to exchange with my companions. I ‘d mention that we readers are very blessed to be in a very good site with so many brilliant people with interesting secrets. I feel very lucky to have used your entire webpage and look forward to so many more exciting minutes reading here. Thank you once more for all the details.

  2. I wish to express my affection for your generosity for persons that absolutely need help with this particular issue. Your real commitment to passing the message along became surprisingly significant and has in every case empowered others like me to arrive at their endeavors. Your personal warm and friendly hints and tips indicates a great deal a person like me and far more to my fellow workers. Thank you; from each one of us.

  3. I must show my appreciation to you just for bailing me out of such a challenge. Right after searching throughout the internet and finding notions which are not productive, I believed my entire life was over. Being alive devoid of the approaches to the problems you have solved by means of the guide is a crucial case, and the ones that might have negatively affected my entire career if I hadn’t noticed your website. Your personal know-how and kindness in taking care of the whole lot was priceless. I am not sure what I would’ve done if I had not come upon such a stuff like this. I’m able to at this moment look forward to my future. Thanks a lot very much for the reliable and amazing help. I will not be reluctant to suggest your web site to anyone who desires direction about this subject matter.

  4. I really wanted to make a simple comment so as to express gratitude to you for all the marvelous pointers you are giving out on this website. My prolonged internet research has finally been compensated with good tips to talk about with my co-workers. I would believe that many of us visitors actually are undoubtedly endowed to live in a decent community with many perfect professionals with valuable solutions. I feel somewhat grateful to have seen your entire weblog and look forward to many more thrilling moments reading here. Thanks once again for a lot of things.

  5. I wanted to create you that bit of observation just to say thanks a lot once again on your remarkable concepts you’ve featured on this website. This is simply incredibly generous with you to deliver openly just what a few individuals could possibly have supplied for an electronic book to make some dough for themselves, most notably now that you might well have tried it if you ever considered necessary. These techniques additionally acted to be the easy way to be aware that other people have a similar desire similar to mine to realize way more concerning this matter. I am sure there are numerous more enjoyable sessions ahead for people who read through your website.

  6. I precisely needed to say thanks again. I’m not certain the things that I would have accomplished in the absence of the entire tactics provided by you over that field. Completely was a very traumatic setting in my opinion, but looking at this professional manner you handled the issue made me to cry for happiness. Now i’m happy for the information and trust you realize what a great job you have been doing training other individuals using your web page. I know that you have never got to know any of us.

  7. I am also writing to make you know of the awesome encounter my cousin’s child experienced using your webblog. She even learned many details, including how it is like to have a wonderful giving character to let the rest really easily learn chosen problematic subject areas. You undoubtedly surpassed our own expected results. I appreciate you for imparting such priceless, dependable, edifying and in addition fun tips about this topic to Ethel.

  8. Thanks a lot for providing individuals with an extremely terrific chance to check tips from this site. It’s usually very fantastic plus full of a good time for me and my office friends to search your website a minimum of three times a week to study the newest things you have. Not to mention, I’m so certainly satisfied with the great methods served by you. Some 3 ideas in this posting are unequivocally the simplest we have all ever had.

  9. I and my friends happened to be reading the best pointers located on your web page and so at once came up with an awful feeling I never thanked the website owner for those tips. Those boys had been so happy to study all of them and have without a doubt been taking advantage of them. I appreciate you for genuinely well accommodating and then for figuring out variety of magnificent subjects most people are really desperate to discover. Our own honest regret for not saying thanks to earlier.

  10. I must express my thanks to the writer just for bailing me out of such a scenario. Because of searching throughout the the web and obtaining strategies that were not productive, I was thinking my entire life was over. Being alive without the presence of answers to the issues you’ve resolved by means of your good write-up is a critical case, and the ones which may have badly damaged my career if I had not come across your web page. That skills and kindness in taking care of all the things was helpful. I am not sure what I would have done if I hadn’t come upon such a solution like this. I can at this time look ahead to my future. Thank you so much for your skilled and results-oriented help. I will not hesitate to recommend your site to anyone who wants and needs support on this issue.

  11. A lot of thanks for each of your hard work on this site. My niece take interest in making time for internet research and it’s obvious why. We learn all regarding the dynamic mode you give good suggestions via this website and in addition cause response from website visitors on this matter plus my child is in fact understanding a whole lot. Enjoy the rest of the new year. You have been carrying out a pretty cool job.

  12. I wish to express some appreciation to this writer just for bailing me out of this particular matter. After scouting throughout the world wide web and coming across ways which were not beneficial, I thought my entire life was gone. Existing without the presence of solutions to the issues you have solved all through the blog post is a serious case, and the ones that could have badly affected my entire career if I hadn’t discovered the blog. Your actual capability and kindness in maneuvering every aspect was tremendous. I don’t know what I would’ve done if I hadn’t come across such a thing like this. I’m able to now relish my future. Thanks a lot so much for your reliable and results-oriented guide. I won’t think twice to propose your web site to anybody who needs tips about this matter.

Leave a Reply

Your email address will not be published. Required fields are marked *