CKEDITOR.plugins.add('spell', { init: function (editor) { editor.addCommand('spellCheck', { exec: function (editor) { rapidSpell.ayt_aytEnabled = false; spell('cke_contents_Model_NoteText', 'dialog'); } }); editor.ui.addButton('Spell', { label: 'Dialog Spell Check', command: 'spellCheck', icon: this.path + 'icons/spell.png' }); } }); function spell(id, mode) { var ifr = document.getElementsByClassName('cke_wysiwyg_frame cke_reset')[0]; ifr.setAttribute('id', id + '_ifr'); ifr.id = id + '_ifr'; if (mode == 'dialog') rapidSpell.dialog_spellCheck(true, ifr.id); else rapidSpell.ayt_spellCheck(ifr.id); } //- Called when spell checking is finished function NotifyDone(src, tb, complete) { var ifrString = /_ifr$/; var id = tb.id.replace(ifrString, ""); if (id == "cke_contents_Model_NoteText") { if (!complete) { if (!confirm("You didn't finish spell checking, are you sure you want to cancel the spell check?")) { //restart the spell checker - see userguide for this function's pattern setTimeout("rapidSpell.dialog_spellCheck(true, '" + tb.id + "')", 1); //Let the window close before reopening it } } } }