以下代码是在编辑器中通过点击h2按钮,弹窗输入信息输出这个结果:[h2]弹窗输入的内容[/h2]
<code>(function () {
function Wecenterh2Dialog(editor) {
return {
title: 'H2',
minWidth: 470,
minHeight: 110,
buttons: [
CKEDITOR.dialog.okButton,
CKEDITOR.dialog.cancelButton
],
contents:
[
{
elements:
[
{
id: 'text',
type: 'text',
required: true,
commit: function () {
if (this.getValue()) {
editor.insertHtml('[h2]' + this.getValue() + '[/h2]');
//editor.insertText( '! + ')' );
}
}
},
{
type: 'html',
html : '<p style="font-size:14px;color:#999;">我们目前支持: h2 !</p>'
}
]
}
],
onLoad: function () {
//alert('onLoad');
},
onShow: function () {
//alert('onShow');
},
onHide: function () {
//alert('onHide');
},
onOk: function () {
this.commitContent();
},
onCancel: function () {
//alert('onCancel');
},
resizable: false
};
}
CKEDITOR.dialog.add('Wecenterh2', function (editor) {
return Wecenterh2Dialog(editor);
});
})();</code>现在我不想让他通过弹窗的方式输入,怎么修改可以通过编辑器中【B】也就是加粗的方式直接,选中文章中某些内容(比如选中文章中的:弹窗输入的内容,然后按下编辑器的H2)后直接输出:[h2]弹窗输入的内容[/h2]
以下代码是在编辑器中通过点击h2按钮,弹窗输入信息输出这个结果:[h2]弹窗输入的内容[/h2]
<code>(function () {
function Wecenterh2Dialog(editor) {
return {
title: 'H2',
minWidth: 470,
minHeight: 110,
buttons: [
CKEDITOR.dialog.okButton,
CKEDITOR.dialog.cancelButton
],
contents:
[
{
elements:
[
{
id: 'text',
type: 'text',
required: true,
commit: function () {
if (this.getValue()) {
editor.insertHtml('[h2]' + this.getValue() + '[/h2]');
//editor.insertText( '! + ')' );
}
}
},
{
type: 'html',
html : '<p style="font-size:14px;color:#999;">我们目前支持: h2 !</p>'
}
]
}
],
onLoad: function () {
//alert('onLoad');
},
onShow: function () {
//alert('onShow');
},
onHide: function () {
//alert('onHide');
},
onOk: function () {
this.commitContent();
},
onCancel: function () {
//alert('onCancel');
},
resizable: false
};
}
CKEDITOR.dialog.add('Wecenterh2', function (editor) {
return Wecenterh2Dialog(editor);
});
})();</code>现在我不想让他通过弹窗的方式输入,怎么修改可以通过编辑器中【B】也就是加粗的方式直接,选中文章中某些内容(比如选中文章中的:弹窗输入的内容,然后按下编辑器的H2)后直接输出:[h2]弹窗输入的内容[/h2]
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号