Jump to content

Tinymce Always Convert '<' To '&lt', '>' To '&gt'


aquahuang

Recommended Posts

And i also want to share this topic

In TinyMCE how to save html code after designed your block page...

* Create a plugin function can get source code and setContent back to editor area, refer to here   http://archive.tinymce.com/wiki.php/Tutorials:Creating_a_plugin

* example code as below

tinymce.PluginManager.add("savehtml",function(t){t.addButton("savehtml",{text:"Save HTML",icon:"save",onclick:function(){t.windowManager.open({title:"Save HTML",body:[{type:"textbox",name:"savehtml",label:"Save HTML",multiline:!0,minWidth:600,minHeight:480,value:t.getContent().replace(/</g,'<').replace(/>/g,'>'),spellcheck:!1,style:"direction: ltr; text-align: left"}],onsubmit:function(e){t.setContent(e.data.savehtml)[spam-filter])[spam-filter]),t.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){t.windowManager.open({title:"TinyMCE site",url:"http://www.tinymce.com",width:800,height:600,buttons:[{text:"Close",onclick:"close"}]})[spam-filter])});

ps. tab button can work , but submenu not modified yet

hope make a help someone need... 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...