Inline HTML Editor for new html 5 box.

Author: i.sharp@pcisystems.co.uk (Iain Sharp)

Has anyone implemented a solution where the new HTML5 widget contains an inline editor for text (similar to the richtext widget) allowing us to write formatted text in HTML into the database, and thus print it 'pretty'? If so, what script did you use, and does it require an online connection to the java source?  We'd like to update our C* mutliline editboxes to formatted text, and think that HTML text will be more compatible going forwards than RTf, but several of our customers run with no internet connection to the clients so the code must be locally sourced. Iain

11 Comments

  1. Hi Iain, what about using "markdown" to format the text. It's quite popular on the open source front because at first it's only plain text and it requires only little knowhow to do basic formatting.   So it's very easy to provide reports etc. for multiple occurences in one go.   One example is https://support.zendesk.com/hc/en-us/articles/203691016-Formatting-text-with-Markdown. And there are a couple of converters available as well (especially PANDOC looks promising). You may even use the htmlwidget to provide a complete WYSIWYG javascript based editor as in https://code.google.com/p/pagedown/   Greetings from Frankfurt/Germany, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. It will be non technical users using it, so what I am looking for is a WYSIWYG editor which will output the HTML I can then display in the HTML widget with or without the editor depending on circumstance. 


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  3. Hi Iain, I haven't tried exactly what you're looking for. However, I've used a lot of different JavaScript libraries inside the Uniface HTML widget and it works really well. You don't need any web access, so long as the JavaScript files are accessibly locally you can simply access them on the file:// protocol instead of http://. The only issue you occasionally run into is the same origin security policy where the HTML widget thinks you're trying to access JavaScript from another server and blocks it. Generally speaking though it's fine and there's usually a work around for that. James


    Author: James Rodger (james.r.rodger@gmail.com)
  4. Thanks for that, I've not used the widget much at all (except to display some basic html text). What I was looking for was a recommendation of some java(script?) based inline editor I could download the source for and localise to prevent a requirement to go to the web for the css or whatever, so as to turn the html widget into an editor for content to be displayed in (the same or a different) html widget...  We want to give the user bold, underline, etc capability in our text box fields, but the rich text editor is not entirely compatible with the rich text print functions in crystal, and we feel that html is both more universal and more future proof.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  5. Interestingly I was about to look into potentially using Markdown and had come across Pandoc, not that I've used it yet. But back to HTML, you will have to be careful about script injection and cross-site scripting.


    Author: Andy Heydon (andy@heydon.org)
  6. Searched at Google "html editor control" and found TinyMCE! ( http://www.tinymce.com/tryit/full.php )   And what surprise if you check the code of uniface.info???   tinyMCEPreInit = { baseURL: "http://unifaceinfo.com/wp-includes/js/tinymce", ... Surprised


    Author: Lauterbach (norbert.lauterbach@infraserv.com)
  7. Lauterbach said Searched at Google "html editor control" and found TinyMCE! ( http://www.tinymce.com/tryit/full.php )   And what surprise if you check the code of uniface.info???   tinyMCEPreInit = { baseURL: "http://unifaceinfo.com/wp-includes/js/tinymce", ... Surprised

    My colleague Mike actually has created a little sample that demonstrates how to run TinyMCE with the Uniface HTML widget. All required files are hereby located locally on disc. I'll ask him if he could upload his example to the Community Samples here on uniface.info. Will keep you posted. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  8. CKEditor is another one that I've been asked about in the past (http://ckeditor.com/). I've only had a quick look but it might do the trick.


    Author: James Rodger (james.r.rodger@gmail.com)
  9. Okay, I've added now the mentioned sample form to the Community Samples (see HTML editor). Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  10. Hi Iain, if you are into javascript, you may have a look at: http://trix-editor.org/ It's open-source and at first glace provides a lot of useful features like

    Populating With Stored Content

      Greetings from Frankfurt/Germany, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)
  11. Hi Daniel,  Yes, that looks like exactly what I am looking for, now all I need is the time to implement it. Cool Iain


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)