Morrigan jQuery Editor
Morrigan Editor is jQuery WYSIWYG editor with predictable behavior, persistence and consistency.
To install Morrigan Editor:
You can install Morrigan Editor manually or by gem if you are using Ruby on Rails (installation manual for RoR is available here).
- Get jQuery and jQuery UI (UI Core + Interactions)
- Get Font Awesome
- Get morrigan-jquery-editor.js, morrigan-jquery-editor.css and iframe.css
- Code:
$(function() {
editor = $('#editor').morrigan_editor( {
iframeStyles: '/iframe.css',
imageUpload:'/image/create',
width:'770px',
height:'550px'
} );
});
For Image Upload
Pass param imageUpload
to init options:
$('#editor').morrigan_editor( {
//...
imageUpload:'/image/create',
//...
} );
Params sending to server sample:
upload_img
(with image) for file uploadingupload_url
(with url) for image uploading by URL
Server response sample (for both cases):
{data: "/url/to/image.jpeg"}
How to use
To get html from editor:
editor.morrigan_editor('html');
To insert html to editor:
editor.morrigan_editor('html', '<p>Your HTML</p>');