HTML editor Cocoa control - html

I am looking for a Cocoa HTML editor control.
Do you know if something like this already exists?

Here's CKEditor4ObjC, an open-source Cocoa HTML editor using CKEditor and WebView that I just created.

The only thing that I've seen that relates to what you're looking for is this simple example of how to use the TinyMCE JavaScript-based HTML editor in a Cocoa WebView.
Alternatively, I would take a look at this similar question and the corresponding link to helpful information that resides within it.

It's not hard to use document.execCommand(...) either, because WebKit is pretty compatible with it.

Related

VB.NET: WYSIWYG page maker tutorial

I have a course work for which I have to make a (as advanced as possible) WYSIWYG web page editor in VB.NET (2010). It should have a visual editor with drag-drop support for several elements such as anchors, images, tables etc., and it should generate HTML based on that structure.
I don't know where to begin though.. I have some experience with vb.net, I made a tabbed notepad vaguely following a tutorial, but I don't know how to make this drag-drop thingy in a richtextbox.
I've searched for a tutorial, but most of them are just too simple - a text editor with browser control rendering the HTML.. I found one really nice and advanced, but it's in german :-|
So, if anyone knows any resources / tutorials I could use to start things I'll appreciate it.
I won't start with a richtextbox. Do you want to realize it in WPF or Forms (I would recommend WPF)?
In WPF there is relative simple a Drag-And-Drop behavior for elements (see http://msdn.microsoft.com/en-en/library/ms742859.aspx).
I would start with some simple elements (e.g. TextBoxes) and drag-drop them from some sort of toolbox onto a grid with fixed columns and rows (and later use a canvas). And then generate the HTML-Code from that.
In general, most of the WYSIWYG browser based editors are written in Javascript using an editable DIV.
A good example is tinymce:
http://www.tinymce.com/
Download, including full source code, is available here:
http://www.tinymce.com/download/download.php
You can use CKEditor. Its one of the best WYSIWYG editor i have worked with. Its highly customizable and opensource.
Given below is the URL for the website:
http://ckeditor.com/

What is the javascript text editor used at Quora?

I like this inline text editor used at Quora:
http://www.quora.com/Brogramming/How-does-a-programmer-become-a-brogrammer
However, I was unable to identify this one. Does anybody recognize this editor?
http://www.quora.com/Quora-Rich-Text-Editor?q=quora+text+editor
You could pull off something like that using CodeMirror It's very flexible and does wonderful code highlighting. I've implemented it as a template editor built into a CMS I work on. It was even pretty easy getting it to handle some of the special syntax specific to our CMS.
It's most likely proprietary.
Perhaps TinyMCE would be a better solution for you?

How to render basic HTML markup inside a JPanel in Java Swing?

I want to do something really simple like this:
JPanel htmlPanel = new HtmlPanel("<html><body><h1>hello world</h1></body></html>");
I think I had seen code somewhere that did exactly this. What about CSS and JS? Can the JPanel be made to support this easily? Are there libraries somewhere that do what I am asking for?
Check here to see how to add CSS support to your JEditorPane. You will need an HTMLEditorKit.
I do not see why you would need JavaScript support for a JEditorPane. The basic use of it is to render Help pages written in HTML and CSS.
If you need to have the real McCoy embedded into your application, try the Lobo Java Web Browser. Lobo does JavaScript and CSS and is open source 100% Java.
November 2015: The latest fork of the Lobo Browser is Lobo Evolution.
Sounds like you were thinking of the JEditorPane. It can display html from e.g. an URL.
Swing tutorial, Editor panes.
The support for javascript is nonexistent.
You can try out third party components such as flying-saucer, which is a XML/XHTML and CSS 2.1 renderer in pure Java.
In case anyone is still looking for an easy solution to just enable display of HTML-Markup: Use a JLabel and enclose the text in '<html>' and '</html>' (body tag isn't needed).
Have a look at How to Use HTML in Swing Components. I just came across this when looking for an easy way to display data in tables, and it works like a charm.
There was JWebPane, a Java component based on WebKit, but that project seems to have died a long time ago and/or has just gone quiet. Some people are still hoping it will be released, The other one I know of is WebKit for SWT, but it appears to be for Win32 only. :(

WYSIWYG HTML editor for grails gsp files

Does anyone know about a good HTML editor which can be configured in such a way that it is gsp aware?
What I mean is that at least tags such as <g:link> and <g:input> should be displayed as their html equivalent.
Yes I know: a perfect editor is hard to write and it is easier to edit the HTML sources (that's what I do), but there are people who prefer an HTML editor...
Update: yes, I am looking for a WYSIWYG HTML editor with which I can drag'n'drop some html elements to a page without changing the <g:...> tags which might already be contained in the page. In addition, this editor should have some gsp awareness, so that <g:...> tags are displayed in an appropriate way.
Update: still looking for something, so I started a bounty. What I need is something like this plugin: http://code.google.com/p/grails-form-builder-plugin/ but more evolved...
Bounty: not easy to select the right answer for the bounty. None of the answers is a solution to my problem, but I have decided that rschlachter points me in the right direction: a wysiwyg form editor is not the right solution for a developer...
I think there may be a flaw in the process here. You could build the page first in HTML and make any changes there before putting in any gsp elements. While the page is in HTML format people can continue to use WYSIWYG editors and then developers can add in the grails functionality.
It just seems like if you need/want to use a WYSIWYG editor, you shouldn't be modifying a gsp.
The iterations I prefer to use after I have gathered requirements are:
wireframe
mockup
html
gsp
If the gsps are already there (ie you inherited the project or something) you could go back a step and create an html only version of the page by pulling the gsp elements out and putting in images of them or replacing them with their html equivalents.
the IBM Maqetta Project seems to be going in the right direction:
http://maqetta.org/
Mercury editor might be worth looking at too.
http://jejacks0n.github.com/mercury/
There is one more editor that you might want to look at:
Aloha Editor - http://www.aloha-editor.org/
Orbeon can be an option
http://www.orbeon.com/orbeon/home/
Might be able to do this with TinyMCE by configuring the valid_elements or the extended_valid_elements (docs). For example, if you want to replace <g:link> and <g:input> you would do something like:
tinyMCE.init({
valid_elements : "a/g:link,input/g:input"
});
OR If you want to simply enable the additional elements, then you could do something like:
tinyMCE.init({
extended_valid_elements : "g:link,g:input"
});

Display a custom tag within the TinyMce WYSIWYG view

I have a suite of custom tags in my application that abstract some of the common system tasks.
I am using TinyMCE as my HTML editor, and want to be able to render my custom tag as an image in the editor when in the WYSIWYG view. Similar to TinyMCE's built-in behaviour for SWF files.
Is there an easy way to do this in TinyMCE?
UPDATE:
It seems that custom tags barely work in TinyMCE at all.
Some of the problem seems to be that face that my tags are namespaced:
<o:some_tag />
Which is causing all sorts of issues.
Is there a editor that supports this kind of functionality better?
I found a method that meets my needs and turned out to be a little easier than constructing a plugin.
Full details here: How-To: Custom tags with TinyMCE.
Unfortunately there is no easy way. Tinymce supports "extended_valid_elements" property . However as you want to render this custom tag as an image, all you can do is to create a custom plugin for your task
Try same code like media plugin (it is not build-in behaviour, it is a plugin). Or yoy can check page break plugin.