php的加粗函数是什么,编辑器选中加粗的代码是什么

以下代码是在编辑器中通过点击H2按钮,弹窗输入信息输出这个结果:[h2]弹窗输入的内容[/h2]

(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( '!![输入内容](' + this.getValue() + ')' );

}

}

},

{

type: 'html',

html : '

我们目前支持: h2 !'

}

]

}

],

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);

});

})();

现在我不想让他通过弹窗的方式输入,怎么修改可以通过编辑器中【B】也就是加粗的方式直接,选中文章中某些内容(比如选中文章中的:弹窗输入的内容,然后按下编辑器的H2)后直接输出:[h2]弹窗输入的内容[/h2]

回复内容:

以下代码是在编辑器中通过点击H2按钮,弹窗输入信息输出这个结果:[h2]弹窗输入的内容[/h2]

(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( '!![输入内容](' + this.getValue() + ')' );

}

}

},

{

type: 'html',

html : '

我们目前支持: h2 !'

}

]

}

],

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);

});

})();

现在我不想让他通过弹窗的方式输入,怎么修改可以通过编辑器中【B】也就是加粗的方式直接,选中文章中某些内容(比如选中文章中的:弹窗输入的内容,然后按下编辑器的H2)后直接输出:[h2]弹窗输入的内容[/h2]

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值