/* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){var a='scaytcheck',b='scayt_enabled',c='scayt_disabled',d='',e=function(){var i=this;dojo.requireLocalization('scayt','caption','','ROOT');var j=function(){var m=CKEDITOR.config.scaytParams||{};m.srcNodeRef=i.document.getWindow().$.frameElement;m.assocApp='CKEDITOR.'+CKEDITOR.version+'@'+CKEDITOR.revision;var n=new scayt(m),o=f.instances[i.name];if(o){n.sLang=o.sLang;n.option(o.option());n.paused=o.paused;}f.instances[i.name]=n;try{n.setDisabled(n.paused===false);}catch(p){}i.fire('showScaytState');};i.on('contentDom',j);i.on('contentDomUnload',function(){var m=CKEDITOR.document.getElementsByTag('script'),n=/^dojoIoScript(\d+)$/i,o=/^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var p=0;p=0){this.setState(CKEDITOR.TRISTATE_DISABLED);i.on('showScaytState',function(){this.removeListener();this.setState(f.isScaytEnabled(i)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF);},this);f.loadEngine(i);}}};CKEDITOR.plugins.add('scayt',{requires:['menubutton'],beforeInit:function(i){i.config.menu_groups='scayt_suggest,scayt_moresuggest,scayt_control,'+i.config.menu_groups;},init:function(i){var j={},k={},l=i.addCommand(a,h);CKEDITOR.dialog.add(a,CKEDITOR.getUrl(this.path+'dialogs/options.js'));var m='scaytButton';i.addMenuGroup(m);i.addMenuItems({scaytToggle:{label:i.lang.scayt.enable,command:a,group:m},scaytOptions:{label:i.lang.scayt.options,group:m,onClick:function(){d='options';i.openDialog(a);}},scaytLangs:{label:i.lang.scayt.langs,group:m,onClick:function(){d='langs';i.openDialog(a);}},scaytAbout:{label:i.lang.scayt.about,group:m,onClick:function(){d='about';i.openDialog(a);}}});if(!CKEDITOR.env.ie)i.ui.add('Scayt',CKEDITOR.UI_MENUBUTTON,{label:i.lang.scayt.title,title:i.lang.scayt.title,className:'cke_button_scayt',onRender:function(){l.on('state',function(){this.setState(l.state);},this);},onMenu:function(){var o=f.isScaytEnabled(i);i.getMenuItem('scaytToggle').label=i.lang.scayt[o?'disable':'enable'];return{scaytToggle:CKEDITOR.TRISTATE_OFF,scaytOptions:o?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytLangs:o?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytAbout:o?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED};}});if(i.contextMenu&&i.addMenuItems)i.contextMenu.addListener(function(o,p){var q=f.getScayt(i);if(!f.isScaytEnabled(i)||!o||!o.$)return null;var r=q.getWord(o.$);if(!r)return null;var s=q.getLang(),t={},u=scayt.getSuggestion(r,s);if(!u||!u.length)return null;for(i in j){delete i._.menuItems[i];delete i._.commands[i];}for(i in k){delete i._.menuItems[i];delete i._.commands[i];}j={};k={};var v=false;for(var w=0,x=u.length;w