如何限制ckeditor中的行号?

时间:2016-06-08 07:37:31

标签: jquery ckeditor

我想在ckeditor / plugins / linenumbers / plugin.js中的linenumbers文件夹中添加plugin.js无法正常工作

var myEditor = $('#ctl00_ctl00_cntBody_cntBody_ShowZoneContentDetails1_editor1');

        myEditor.ckeditor({
            height: 200,
            extraPlugins: 'charcount',
            maxLength: 100,
            toolbar: 'TinyBare',
            toolbar_TinyBare: [
                 ['Bold', 'Italic', 'Underline'],
                 ['Undo', 'Redo'], ['Cut', 'Copy', 'Paste'],
                 ['NumberedList', 'BulletedList', 'Table'], ['CharCount']
            ]
        }).ckeditor().editor.on('key', function (obj) {

            if (obj.data.keyCode === 8 || obj.data.keyCode === 46) {
                return true;
            }
            if (myEditor.ckeditor().editor.document.getBody().getText().length >= 10) {
                alert('No more characters possible');
                return false;
            }

        });

0 个答案:

没有答案