📄 fck.js
字号:
Ext.onReady(function(){
var fckeditorFormPanel = new Ext.FormPanel({
labelWidth: 75,
url:'',
frame:true,
title: 'fckeditor Form',
bodyStyle:'padding:5px 5px 0',
width: 950,
height:450,
defaultType: 'textfield',
items: [{
xtype:'textarea',
fieldLabel:'编辑',
labelSeparator:':',
id:'code',
name:'code',
height:200,
width:300
}
],
buttons: [{
text: 'Save',
type:'submit',
handler: function() {
Ext.get('code').dom.value=editorInstance.GetXHTML( true );//获取fckeditor内容赋给textarea
alert(Ext.get('code').dom.value);
if(fckeditorFormPanel.form.isValid()){//验证通过
fckeditorFormPanel.form.doAction('submit',{
url:'submit.do',
method:'post',
waitMsg:'正在提交,请稍等...',
success:function(form,action){//成功返回
},
failure:function(form,action){//失败返回
}
});
}
}
},{
text: 'Cancel'
}]
});
fckeditorFormPanel.render(document.body);
/**
* 以下创建在线编辑器
*/
var oFCKeditor = new FCKeditor( 'code',810,350 ) ;
var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('/'))+'/FCKeditor/';
oFCKeditor.BasePath = sBasePath;
oFCKeditor.ToolbarSet = 'Default';
oFCKeditor.ReplaceTextarea() ;
});
var editorInstance;
/**
* FCKEditor初始化完成将调用此方法
* @param {Object} editorInstance
*/
function FCKeditor_OnComplete( instance ) {
editorInstance=instance;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -