Fantastic Jquery wysiwyg Editor with more features – Redactor

Contents

Redactor – Fantastic WYSIWYG-editor on jQuery

Redactor is written using the library jQuery . Tested on Mac OS and Windows, web browsers:

  • Firefox 3 +
  • Safari 4 +
  • Chrome 4 +
  • Opera 10 +
  • IE 7 +

How does the editor

Redactor replaces the <textarea> edited by <iframe> , thus creating a toolbar with a set of control buttons.

License

Redactor is free to the MIT License, or GPL, your choice.

jquery code

&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Redactor&amp;lt;/title&amp;gt;
&amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;

&amp;lt;script src=&amp;quot;/js/jquery-1.7.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;/js/redactor/css/redactor.css&amp;quot; /&amp;gt;
&amp;lt;script src=&amp;quot;/js/redactor/redactor.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
$(document).ready(
function()
{
$('#redactor_content').redactor();
}
);
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;textarea id=&amp;quot;redactor_content&amp;quot; name=&amp;quot;content&amp;quot; style=&amp;quot;height: 560px;&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

Settings

  • lang
  • toolbar
  • load
  • path
  • css
  • focus
  • resize
  • autoresize
  • fixed
  • autoformat
  • cleanUp
  • convertDivs
  • removeClasses
  • removeStyles
  • convertLinks
  • autosave
  • interval
  • imageGetJson
  • imageUpload
  • linkFileUpload
  • fileUpload
  • overlay

Toolbar Option

The editor comes with two toolbars: normal and minimal. All toolbars are stored as separate files in the Editor Toolbars .

You can create multiple sets of toolbars on different occasions. To do so, by analogy with existing sets of buttons to edit toolbars.

After this, when you call Redactor, you must specify exactly which toolbar will be displayed like this:

&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
$(document).ready(
function()
{ $('#redactor_content').redactor({ toolbar: 'custom' });
}
);
&amp;lt;/script&amp;gt;

Images upload

Javascript not allows for downloading of images, so this feature is implemented using server-side programming languages, for example, PHP.

First of all, make sure that the editor is set the path to boot, it can be done by changing the setting imageUpload redactor.js editor in the file, or setting when you start like this:

&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
$(document).ready(
function()
{ $('#redactor_content').redactor({ imageUpload: '/modules/upload.php' });
}
);&amp;lt;/script&amp;gt;

Files upload

Javascript not allows for file uploads, so this feature is implemented using server-side programming languages, for example, PHP.

First of all, make sure that the editor is set the path to boot, it can be done by changing the setting fileUpload redactor.js editor in the file, or setting when you start like this:

&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
$(document).ready(
function()
{ $('#redactor_content').redactor({ fileUpload: '/file_upload.php' });
}
);&amp;lt;/script&amp;gt;

Autosave

If you want the text editor is automatically maintained, for example, every two minutes. To do this, specify the address to a script that will handle the incoming data.

&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
$(function()
{ $('#redactor_content').redactor({ autosave: '/save.php', interval: 120 });
});
&amp;lt;/script&amp;gt;

Please don’t forget to share and subscribe to latest updates of the blog. Also any comments and feedback are all welcome!

Thanks!

View Demo Download

You May Also Like

Never Miss Any Web Tutorials, Guides, Tips and Free eBooks

Join Our Community Of 50,000+ Web Lovers and get a weekly newsletter in your inbox

 

I hate spam too. Unsubscribe at any time.

1 thought on “Fantastic Jquery wysiwyg Editor with more features – Redactor”

  1. Can i call a client side method on redactor fielUpload instaead of calling a server side method? I am using redactor and want to upload some files to the http://www.smartfile.com. For this i need to pass my apikey, password and the location files need to be stored. so tell me how can i pass these extra arguments on redactor imageUpload? or better to call a client side javascript method.

    Reply

Leave a Comment