在ThinkPHP整合各种在线编辑器2014-04-06今天一个客户要求在编辑器里增加可以拖动图片的方法,研究了很久,发现这几种编辑器只有在ie下才可以拖动图片大小,包括网易用的编辑器,QQ空间的编辑器,先提前声明一下。下面进入重点1.百度编辑器ueditor先新建项目,生成以后在目录下新建一个plugins文件夹

然后下载ueditor,地址:http://ueditor.baidu.com/website/download.html,注意编码。下载以后解压将整合文件夹放到plugins里,并且改名为ueditor将项目名/Lib/Action/IndexAction.clas.php添加
class IndexAction extends Action {function index(){$this->display();}}然后在对应的模版里添加,在<head></head>中间添加
<script type="text/javascript" src="/edit/plugins/ueditor/ueditor.config.js"></script><script type="text/javascript" src="/edit/plugins/ueditor/ueditor.all.js"></script>
在需要的地方添加
<textarea id="myEditor" name="content" style="width:700px;height:300px;"></textarea><script type="text/javascript">UE.getEditor("myEditor")</script>
这是textera的方式,也可以用div,p都可以,官方推荐的是
<script type="text/plain" id="myEditor">//从数据库中取出文章内容打印到此处</script>
toolbars:[["fullscreen", "source", "|", "undo", "redo", "|","bold", "italic", "underline", "fontborder", "strikethrough", "superscript", "subscript", "removeformat", "formatmatch", "autotypeset", "blockquote", "pasteplain", "|", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist", "selectall", "cleardoc", "|","rowspacingtop", "rowspacingbottom", "lineheight", "|","customstyle", "paragraph", "fontfamily", "fontsize", "|","directionalityltr", "directionalityrtl", "indent", "|","justifyleft", "justifycenter", "justifyright", "justifyjustify", "|", "touppercase", "tolowercase", "|","link", "unlink", "anchor", "|", "imagenone", "imageleft", "imageright", "imagecenter", "|","insertimage", "emotion", "scrawl", "insertvideo", "music", "attachment", "map", "gmap", "insertframe","insertcode", "webapp", "pagebreak", "template", "background", "|","horizontal", "date", "time", "spechars", "snapscreen", "wordimage", "|","inserttable", "deletetable", "insertparagraphbeforetable", "insertrow", "deleterow", "insertcol", "deletecol", "mergecells", "mergeright", "mergedown", "splittocells", "splittorows", "splittocols", "|","print", "preview", "searchreplace", "help"]]
看需要删除即可。最近百度网盘有个活动,如果有兴趣的朋友可以参加一下,还有个人收集的一些书籍http://pan.baidu.com/share/link?shareid=3950160737&uk=3826886292