jWYSIWYG

WYSIWYG jQuery Plugin

Download
jWYSIWYG v0.3 (76kb, Compressed)
Requires
jQuery 1.2.3+ Homepage
Author
Juan M Martínez, joksnet@gmail.com, Company
Updated
April 01, 2008
Sites
@jQuery, @Google Code, Support Forum, Bug Tracker

Description

This plugin is an inline content editor to allow editing rich HTML content on the fly. It's an alternative to WYMeditor with much less features. With a small file size less than 17Kb 26Kb total and only 9Kb 18Kb of code and 7Kb packed, the main concept is to keep it simple, not all users need font coloring or create tables, just the basic.

I need to change the description becouse this plugin has so much grow in the past few months, and that's for your support.

If you like jWYSIWYG, plase make a donation today. Donate Now if you have a major credit card. Just click the button below to get started:

Example

Code Example

$(function()
{
    $('#wysiwyg').wysiwyg();
});

Add custom controls

<style type="text/css">
    .alert { background: url('img/error.gif') no-repeat !important; }
</style>
$('#wysiwyg').wysiwyg({
    controls : {
        alertSep : { separator : true },
        alert : {
            visible   : true,
            exec      : function() { alert('Hello World'); },
            className : 'alert'
        }
    }
});

Insert an image

$('a[href="#insertImage"]').click(function()
{
    $('#wysiwyg').wysiwyg('insertImage', 'img/hourglass.gif');
});

Activate hidden controls

$('#wysiwyg').wysiwyg({
    controls : {
        separator04 : { visible : true },

        insertOrderedList : { visible : true },
        insertUnorderedList : { visible : true }
    }
});

Clear the editor

$('#wysiwyg').wysiwyg('clear');

Support

If you've got any questions about jWYSIWYG you can jump over to the support forum and I'll do my best to help you out. If you come across something that isn't quite right post the bug and I'll look into it.

License

jWYSIWYG uses a dual MIT/GPL license.

MIT License

Copyright © 2008 Juan M Martínez

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

GPL License

Copyright © 2008 Juan M Martínez

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Version History

2008.04.01 10:51
NEW: prevent IE from adding a new paragraph when <enter> is pressed.
2008.03.31 18:12
Fixed Issue 14.
2008.03.31 17:58
Fixed Issue 19. The new syntax for clear the editor is:
$('#wysiwyg').wysiwyg('clear');
2008.03.31 16:54
Fixed Issue 20.
2008.03.21 22:49
Issue 15 fixed.
2008.03.21 22:31
BUG: When a hidden you have textarea, and try to insertImage before focus the editor. Throw an error becouse designMode was off.
BUG: Problem when adding new controls that was not defined on TOOLBAR.
NEW: Change the self param of the exec functions with this.
2008.03.12 11:20
FIX: Issue 8.
NEW: If you try to add a link without selecting text, it raise and alert. Messages can be changed in options.
BUG: No border in IE.
2008.03.04 15:36
BUG: You can active controls from options without passing all parameters, just visible.
2008.03.03 14:49
ADD: [CSS] Nice active buttons.
FIX: [CSS] Background Color.
2008.02.22 17:58
New feature:
$('#wysiwyg').wysiwyg({
  css : { fontSize : '12px', color : 'red' }
});
2008.02.22 14:35
Issue 13 Fixed. Controls moved to Wysiwyg.TOOLBAR. New methods:
$('#wysiwyg').wysiwyg(); // Create the editor
$('#wysiwyg').wysiwyg('insertImage', 'http://www.google.com.ar/intl/en_com/images/logo_plain.png'); // Insert a Google Logo
$('#wysiwyg').wysiwyg('createLink', 'http://www.google.com'); // Create a new Google link
2008.02.18 18:10
Little fix about user controls not replace the defaults ones.
2008.02.18 17:52
Added support to create custom controls.
2008.02.17 17:11
New autoSave option.
2008.02.12 18:14
Issue 11 fixed. Now the textarea is auto-updated on keydown, mousedown and forms.submit actions.
2008.02.12 17:14
Issue 6 Fixed: Now when click on a bold text, bold button get active.
2008.02.11 17:32
Fixed Issue 1 and Added support for saveing on forms submits.
2008.01.14 17:10
Initial import.