如何从word中复制内容到网站后台编辑器中
版权所有 2009-2019 荆门泽优软件有限公司
保留所有权利
官方网站:http://www.ncmem.com/index.aspx
产品首页:http://www.ncmem.com/webapp/wordpaster/index.aspx
开发文档:http://www.ncmem.com/doc/view.aspx?id=29adc89a08ed489498160458cddfa51b
控件下载:http://www.ncmem.com/webapp/wordpaster/pack.aspx
示例下载:http://www.ncmem.com/webapp/wordpaster/versions.aspx
联系信箱:1085617561@qq.com
联系QQ:1085617561
1.1. 集成到TinyMCE3.x
1.上传WordPaster文件夹
2.上传wordpaster插件目录
3.在工具栏中增加wordpaster按钮
引用页面代码:
<html xmlns=”[url]http://www.w3.org/1999/xhtml”[/url] >
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<link type=”text/css” rel=”Stylesheet” href=”WordPaster/css/WordPaster.css”/>
<link type=”text/css” rel=”Stylesheet” href=”WordPaster/js/skygqbox.css” />
<script type=”text/javascript” src=”WordPaster/js/json2.min.js” charset=”utf-8″></script>
<script type=”text/javascript” src=”WordPaster/js/jquery-1.4.min.js” charset=”utf-8″></script>
<script type=”text/javascript” src=”WordPaster/js/w.edge.js” charset=”utf-8″></script>
<script type=”text/javascript” src=”WordPaster/js/w.app.js” charset=”utf-8″></script>
<script type=”text/javascript” src=”WordPaster/js/w.file.js” charset=”utf-8″></script>
<script type=”text/javascript” src=”WordPaster/js/WordPaster.js” charset=”utf-8″></script>
<script type=”text/javascript” src=”WordPaster/js/skygqbox.js” charset=”utf-8″></script>
<script type=”text/javascript” src=”tiny_mce/tiny_mce.js”></script>
</head>
<body>
<textarea>WordPaster与tinymce 3.x整合示例。</textarea>
<script language=”javascript” type=”text/javascript”>
var pasterMgr = new WordPasterManager();
pasterMgr.Fields[“UserName”] = “test”;
pasterMgr.Config[“PostUrl“] = “http://localhost:54530/upload.aspx”;
pasterMgr.Load();//加载控件
tinyMCE.init({
// General options
mode : “textareas”,
theme : “advanced”,
plugins :“wordpaster,netpaster,autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template”,
// Theme options
theme_advanced_buttons1 : “save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect”,
theme_advanced_buttons2 : “cut,copy,paste,pastetext,pasteword,wordpaster,netpaster,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor”,
theme_advanced_buttons3 : “tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen”,
theme_advanced_buttons4 : “insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage”,
theme_advanced_toolbar_location : “top”,
theme_advanced_toolbar_align : “left”,
theme_advanced_statusbar_location : “bottom”,
theme_advanced_resizing : true,
// Skin options
skin : “o2k7”,
skin_variant : “silver”,
// Example content CSS (should be your site CSS)
content_css : “css/example.css”,
// Drop lists for link/image/media/template dialogs
template_external_list_url : “js/template_list.js”,
external_link_list_url : “js/link_list.js”,
external_image_list_url : “js/image_list.js”,
media_external_list_url : “js/media_list.js”,
// Replace values for the template plugin
template_replace_values : {
username : “Some User”,
staffid : “991234”
}
});
pasterMgr.SetEditor(tinymce.activeEditor);
</script>
</body>
</html>
说明:
WordPasterManager必须申明成全局变量
常见问题:
1.为什么整合到项目中图片无法上传?
可能原因:可能上传页面有登陆验证,上传时没有添加SESSION信息,导致上传失败。可在上传页面增加SESSION参数。