plugin.js 2.1 KB

1
  1. CKEDITOR.plugins.add("wsc",{requires:"dialog",lang:"af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh",icons:"spellchecker",hidpi:!0,parseApi:function(c){c.config.wsc_onFinish="function"==typeof c.config.wsc_onFinish?c.config.wsc_onFinish:function(){},c.config.wsc_onClose="function"==typeof c.config.wsc_onClose?c.config.wsc_onClose:function(){}},parseConfig:function(c){c.config.wsc_customerId=c.config.wsc_customerId||CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk",c.config.wsc_customDictionaryIds=c.config.wsc_customDictionaryIds||CKEDITOR.config.wsc_customDictionaryIds||"",c.config.wsc_userDictionaryName=c.config.wsc_userDictionaryName||CKEDITOR.config.wsc_userDictionaryName||"",c.config.wsc_customLoaderScript=c.config.wsc_customLoaderScript||CKEDITOR.config.wsc_customLoaderScript,c.config.wsc_interfaceLang=c.config.wsc_interfaceLang,CKEDITOR.config.wsc_cmd=c.config.wsc_cmd||CKEDITOR.config.wsc_cmd||"spell",CKEDITOR.config.wsc_version="v4.3.0-master-d769233",CKEDITOR.config.wsc_removeGlobalVariable=!0},onLoad:function(c){"moono-lisa"==(CKEDITOR.skinName||c.config.skin)&&CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(this.path+"skins/"+CKEDITOR.skin.name+"/wsc.css"))},init:function(c){var n=CKEDITOR.env;this.parseConfig(c),this.parseApi(c),c.addCommand("checkspell",new CKEDITOR.dialogCommand("checkspell")).modes={wysiwyg:!(CKEDITOR.env.opera||CKEDITOR.env.air||document.domain!=window.location.hostname||n.ie&&(8>n.version||n.quirks))},"undefined"==typeof c.plugins.scayt&&c.ui.addButton&&c.ui.addButton("SpellChecker",{label:c.lang.wsc.toolbar,click:function(c){var n=c.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?c.container.getText():c.document.getBody().getText();(n=n.replace(/\s/g,""))?c.execCommand("checkspell"):alert("Nothing to check!")},toolbar:"spellchecker,10"}),CKEDITOR.dialog.add("checkspell",this.path+(CKEDITOR.env.ie&&7>=CKEDITOR.env.version?"dialogs/wsc_ie.js":window.postMessage?"dialogs/wsc.js":"dialogs/wsc_ie.js"))}});