Forum closed. New forum available at http://community.wymeditor.org/

2 Problems: Adding Custom Classes and textarea not usable

Support forum for WYMeditor.

2 Problems: Adding Custom Classes and textarea not usable

Postby crazycat on Mon Apr 26, 2010 5:18 pm

Hello,

This is the first time i am trying wymeditor and it is pretty cool. But i am having a couple of problems:

1. The textarea i applied the wymeditor class to becomes unusuable from PHP or from the form's "reset" button. It works just fine without wymeditor class.

2. I just can't add nor modify styles.css to include my own style definitions. No matter what i do, it didnt seem to work at all. Here is my code

Code: Select all
<script type="text/javascript" src="editor/jquery.js"></script>
<script type="text/javascript" src="editor/jquery.ui.resizable.js"></script>
<script type="text/javascript" src="editor/jquery.wymeditor.min.js"></script>
<script type="text/javascript" src="editor/plugins/hovertools/jquery.wymeditor.hovertools.js"></script>
<script type="text/javascript" src="editor/plugins/resizable/jquery.wymeditor.resizable.js"></script>
<script type="text/javascript">

jQuery(function() {
    jQuery('.wymeditor').wymeditor({
   
        /*html: '<p>Hello, World!<\/p>', //set editor's value*/
        stylesheet: 'editorstyles.css',      //styles to load
        skin: 'silver',                //activate silver skin
        postInit: function(wym) {

            wym.hovertools();          //activate hovertools
            wym.resizable();           //and resizable plugins
        }
    });
});

</script>


and the textarea which is inside a form:
Code: Select all
<textarea rows="25" cols="90" name="content" class="wymeditor">{$_POST[content]}</textarea>


hope i am clear.
crazycat
 
Posts: 1
Joined: Mon Apr 26, 2010 5:02 pm

Re: 2 Problems: Adding Custom Classes and textarea not usable

Postby mr_lundis on Sun May 16, 2010 11:28 am

Hi!

1. That's because WYMeditor hides your textarea to show the editor iframe and controls, in other words the editor itself is not a form element and you'll manually need to make sure that the original textarea gets updated. You can do this by adding the class wymupdate to any elements that you want trigger an update of the original textarea when clicked, alternately you can change the updateSelector and updateEvent.

http://trac.wymeditor.org/trac/wiki/0.5 ... pdateEvent

2. Clear your cache (Ctrl+F5 in most browsers), also make sure you're editing the correct file (wymeditor/iframe/default/wymiframe.css).

Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron