• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need advice: Simple rich text markup with javascript WYSIWYG editor

 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,

First of all, I'm not sure which forum this question belongs because my code is a servlet but not my question. So if there's a better place, please move it.


I'm building a web site that accesses a huge ( > 5PB) store of scientific data and makes pretty pictures out of tiny pieces of it. In several places I would like to allow users to attach and/or edit rich text. For example to discuss an image, or create/edit help text to options or displays.

I don't think html is a good markup language for this as mistakes could render a page unusable. We don't need very fancy features but I would like to implement something similar to editor the Ranch uses for posts.

So what (I think) I need is:

  • A javascript WYSIWIG editor to create or edit the markup text
  • A java class library to turn the markup into html that can be added to a page or contained in a popup dialog


  • Googling has not produced any good options, yet.

    I'd appreciate any advice or suggestions. It's not an emergency, this has not moved from my wish list to my todo list yet.

    Thanks,
    Joe
     
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    The first requirement can be solved with a search for javascript rich text editor. There are a fair number to choose from.

    Depending on what the output of the editor you choose is, the latter sounds like a fairly simple exercise.
     
    Joe Areeda
    Ranch Hand
    Posts: 334
    2
    Netbeans IDE Tomcat Server Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bear Bibeault wrote:The first requirement can be solved with a search for javascript rich text editor. There are a fair number to choose from.

    Depending on what the output of the editor you choose is, the latter sounds like a fairly simple exercise.



    Thanks Bear. I have found a few js editors.

    It seems like a problem that has been solved before so I'm really looking for a plug and play package to avoid writing another one.

    If I can't find what I want, I guess I'll have to.

    Joe
     
    Bear Bibeault
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I would be surprised if there wasn't one that already spit out HTML as its output -- but it's not something I've ever had a need for so I'm not sure about that. I just know that if I were creating one, I'd emit the rich output as HTML markup.
     
    Joe Areeda
    Ranch Hand
    Posts: 334
    2
    Netbeans IDE Tomcat Server Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bear Bibeault wrote:I would be surprised if there wasn't one that already spit out HTML as its output -- but it's not something I've ever had a need for so I'm not sure about that. I just know that if I were creating one, I'd emit the rich output as HTML markup.



    Not that I have a lot of experience but I'm leery of the users editing html (these editors seem to let you drop down into the resulting mark up language), and some of our our users will do that.

    The issue is that this text will be intermixed with the page content and mistakes could affect the rendering of the rest of the page.

    I don't know how big a problem that is , but I'm hoping to avoid it all together.

    If I can't avoid it, I'll use html and perhaps validate it with some DOM tool and pack it into a <div> attempting to limit possible damage.

    Thanks again, I do appreciate the discussion. I have ideas and opinions but am not adamant about anything.

    Joe
     
    Bear Bibeault
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Joe Areeda wrote:Not that I have a lot of experience but I'm leery of the users editing html (these editors seem to let you drop down into the resulting mark up language)


    I'm with you -- I'd disable that ability (or limit it to bold and italics). Or you could validate the HTML.

    If you are going to allow them to use a markup language, something like a Wiki format or Markdown might be better than HTML (less opportunity to do it wrong).

    In any case, I hope you find what you seek. Please post back with what you decide.
     
    author
    Posts: 297
    5
    Android Firefox Browser Fedora
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    In my book HTML5 in Action chapter 3 includes building a WYSIWYG editor using the HTML5 editing API, there's also a slightly simpler introduction in chapter of my other book, Hello! HTML5 and CSS3.
     
    Joe Areeda
    Ranch Hand
    Posts: 334
    2
    Netbeans IDE Tomcat Server Java
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    To follow up on this thread, I think I found something that may meet my needs.

    TinyMCE is a javascript editor (http://www.tinymce.com) that can be configured to output BBcode.

    kefirBB (http://kefir-bb.sourceforge.net/) is a class library that converts BBcoce to either XML or HTML.

    I've used TinyMCE in another project but it put out HTML in that one. that worked OK because only a couple people edited the text and we were responsible to make sure everything displayed properly.

    I haven't implemented anything yet but at least I have a path that looks reasonable.

    If anyone has comments on KefirBB or knows of a better BB to HTML converter written in Java, I'd sure like to hear about it.

    Joe
     
    Bear Bibeault
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks for posting back with your findings!
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic