에디터가 선택한 굵은 코드는 무엇인가요?

WBOY
풀어 주다: 2016-10-23 00:12:48
원래의
1857명이 탐색했습니다.

다음 코드는 에디터에서 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( '!![输入内容](' + this.getValue() + ')' );
                                }
                            }
                        },
                        {
                            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( '!![输入内容](' + this.getValue() + ')' );
                                }
                            }
                        },
                        {
                            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]

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!