帝國CMS後臺編輯器修改:回車的<br>改為<p>
回車程式碼從<br>改為<p></p>;將插入引用功能改為插入程式碼功能<pre><code></code></pre>
一、回車<br>改為<p></p>
*/ecmseditor/infoeditor/config.js裡找到下述程式碼修改
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
二、插入引用改為插入程式碼
*/ecmseditor/infoeditor/plugins/equotetext/dialogs/equotetext.js
(function() {
CKEDITOR.dialog.add("equotetext",
function(ecmseditorv) {
return {
title: "插入程式碼",
minWidth: "600",
minHeight:"310",
contents: [{
id: "eqtinfo1",
label: "常規",
title: "常規",
expand: true,
width: "600px",
height: "310px",
padding: 0,
elements: [
{id:"lang",type:"text",label:"<strong>程式碼語言:</strong>",style:"width: 20%","default":"php"},
{id:"codetext",type:"textarea",label:"<strong>程式碼內容:</strong>",style:"width: 100%","default":""}
]
}
],
onOk: function() {
var language='';
var content='';
var ehtmlstr='';
language=this.getValueOf('eqtinfo1','lang');
content=this.getValueOf('eqtinfo1','codetext');
ehtmlstr='<pre><code class="language-'+language+'">'+content+'</code></pre>';
//點選確定按鈕後的操作
ecmseditorv.insertHtml(ehtmlstr);
}
}
})
})();