Jaromi / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
GNU General Public License v2.0
0 stars 0 forks source link

Cannot Edit Raw HTML #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When I set html : {visible : true} and click the HTML button, a new text
box appears under the the WYSIWYG editor with the raw HTML. It's expected
that the original box would disappear and the user would be able to input
raw HTML. I see no way to save the input from the raw textbox and in
addition, you cannot input into the textbox at all in IE7.

Original issue reported on code.google.com by DawsDes...@gmail.com on 21 Apr 2008 at 9:06

GoogleCodeExporter commented 8 years ago
Never mind. Sorry. I see that is the intended behavior. If anyone is interested 
how
to do it the way I was expecting, you can use the following code:

html: {
        visible: true,
        exec: function()
        {
            if(this.viewHTML){
              this.setContent($(this.original).val());
              $(this.original).hide();
              $(this.editor).show();
            }else{
              this.saveContent();
              $(this.original).show();
              $(this.editor).hide();
            }

            this.viewHTML = !( this.viewHTML );
        }

Original comment by DawsDes...@gmail.com on 21 Apr 2008 at 9:17

GoogleCodeExporter commented 8 years ago

Original comment by joksnet on 6 Jun 2008 at 1:42

GoogleCodeExporter commented 8 years ago
Did you figure out why you cannot input into the textbox in IE7?

Original comment by loopwhol...@gmail.com on 12 Nov 2008 at 3:23

GoogleCodeExporter commented 8 years ago
That was a while back, but from what I can recall, I think using that code 
fixed the 
issue.

Original comment by DawsDes...@gmail.com on 12 Nov 2008 at 3:48

GoogleCodeExporter commented 8 years ago
So it does - thanks!

Original comment by loopwhol...@gmail.com on 12 Nov 2008 at 4:29

GoogleCodeExporter commented 8 years ago
You're welcome.

Original comment by DawsDes...@gmail.com on 12 Nov 2008 at 8:34

GoogleCodeExporter commented 8 years ago
It seems as though using the code presented here keeps the jWYSIWYG from 
running...
have things changed in the code since this was written?

Original comment by theplasticmind on 4 Feb 2009 at 4:02

GoogleCodeExporter commented 8 years ago
Big Thanks!!!  This works great!

However I did run into one little snag.  The code above is missing a } at the 
end.

Should be like this

html: {
        visible: true,
        exec: function()
        {
            if(this.viewHTML){
              this.setContent($(this.original).val());
              $(this.original).hide();
              $(this.editor).show();
            }else{
              this.saveContent();
              $(this.original).show();
              $(this.editor).hide();
            }

            this.viewHTML = !( this.viewHTML );
        }
}

Original comment by rwc...@gmail.com on 30 Aug 2009 at 1:11

GoogleCodeExporter commented 8 years ago
In my opinion, opinion only, this behavior should be default. If you style your
textarea properly the above behavior integrates perfectly into the editor.

Original comment by rwc...@gmail.com on 30 Aug 2009 at 1:14