首页 > 编程 > PHP > 正文

phpcms-v9.6.0复制word格式文章到文本框

2019-11-08 00:47:46
字体:
来源:转载
供稿:网友
CKEDITOR.editorConfig = function( config ){ // Define changes to default configuration here. For example: // config.language = 'fr'; config.uiColor = '#f7f5f4'; config.width = ''; config.removePlugins = 'elementspath,scayt'; config.disableNativeSpellChecker = false; config.resize_dir = 'vertical'; config.keystrokes =[[ CKEDITOR.CTRL + 13 /*Enter*/, 'maximize' ]]; config.extraPlugins = 'capture,videoforpc,Flashplayer'; config.enterMode = CKEDITOR.ENTER_BR; config.shiftEnterMode = CKEDITOR.ENTER_P; config.font_names='宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;'+ config.font_names; config.allowedContent = true; //此处为Word格式配置区可修改 ******************************************************************************************** // 这里的意思是给p标签设置class="MsoNormal" config.format_p = { element: 'p', attributes: { 'class': 'MsoNormal' } }; //config.pasteFromWordIgnoreFontFace = true; //默认为忽略格式 config.pasteFromWordRemoveFontStyles = false; config.pasteFromWordRemoveFontStyles = false; //控制是否去掉font config.pasteFromWordNumberedHeadingToList = true; //控制是否把word的列表转换成html的list config.pasteFromWordRemoveStyles = false; //控制是否去掉styles //是否强制复制来的内容去除格式plugins/pastetext/plugin.js config.forcePasteasplainText =false//不去除 //对DIV标签自动进行格式化 plugins/format/plugin.js config.format_div = { element : 'div', attributes : { class :'normalDiv' } }; //对H1标签自动进行格式化 plugins/format/plugin.js config.format_h1 = { element : 'h1', attributes : { class :'contentTitle1' } }; //对H2标签自动进行格式化 plugins/format/plugin.js config.format_h2 = { element : 'h2', attributes : { class :'contentTitle2' } }; //对H3标签自动进行格式化 plugins/format/plugin.js //config.format_h1 = { element : 'h3', attributes : { class :'contentTitle3' } }; //对H4标签自动进行格式化 plugins/format/plugin.js //config.format_h1 = { element : 'h4', attributes : { class :'contentTitle4' } }; //对H5标签自动进行格式化 plugins/format/plugin.js //config.format_h1 = { element : 'h5', attributes : { class :'contentTitle5' } }; //对H6标签自动进行格式化 plugins/format/plugin.js //config.format_h1 = { element : 'h6', attributes : { class :'contentTitle6' } }; //对P标签自动进行格式化 plugins/format/plugin.js config.format_p = { element : 'p', attributes : { class : 'normalPara' }}; //对PRE标签自动进行格式化 plugins/format/plugin.js config.format_pre = { element : 'pre', attributes : { class : 'code'} }; //用分号分隔的标签名字 在工具栏上显示plugins/format/plugin.js config.format_tags ='p;h1;h2;h3;h4;h5;h6;pre;address;div'; //是否使用完整的html编辑模式如使用,其源码将包含:<html><body></body></html>等标签 config.fullPage = false; //是否忽略段落中的空字符 若不忽略 则字符将以“”表示plugins/wysiwygarea/plugin.js config.ignoreEmptyParagraph = true; //在清除图片属性框中的链接属性时 是否同时清除两边的<a>标签plugins/image/plugin.js config.image_removeLinkByEmptyURL = true;********************************************************************************************//结束配置};CKEDITOR.on( 'instanceReady', function( ev ){ with (ev.editor.dataProcessor.writer) { setRules("p", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("h1", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("h2", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("h3", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("h4", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("h5", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("div", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("table", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("tr", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("td", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("iframe", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("li", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("ul", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); setRules("ol", {indent : false, breakAfterOpen : false, breakBeforeClose : false} ); } }); //CKEDITOR.plugins.load('pgrfilemanager');function insert_page(editorid){ var editor = CKEDITOR.instances[editorid]; editor.insertHtml('[page]'); if($('#paginationtype').val()) { $('#paginationtype').val(2); $('#paginationtype').CSS("color","red"); }}function insert_page_title(editorid,insertdata){ if(insertdata) { var editor = CKEDITOR.instances[editorid]; var data = editor.getData(); var page_title_value = $("#page_title_value").val(); if(page_title_value=='') { $("#msg_page_title_value").html("<font color='red'>请输入子标题</font>"); return false; } page_title_value = '[page]'+page_title_value+'[/page]'; editor.insertHtml(page_title_value); $("#page_title_value").val(''); $("#msg_page_title_value").html(''); if($('#paginationtype').val()) { $('#paginationtype').val(2); $('#paginationtype').css("color","red"); } } else { $("#page_title_div").slideDown("fast"); }}var objid = MM_objid = key = 0;function file_list(fn,url,obj) { $('#MM_file_list_editor1').append('<div id="MM_file_list_'+fn+'">'+url+' <a href=/'#/' onMouSEOver=/'javascript:FilePreview("'+url+'", 1);/' onMouseout=/'Javascript:FilePreview("", 0);/'>查看</a> | <a href="javascript:insertHTMLToEditor(/'<img src='+url+'>/',/''+fn+'/')">插入</A> | <a href="javascript:del_file(/''+fn+'/',/''+url+'/','+fn+')">删除</a><br>');}

注意保存原文件.


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表