X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fscayt%2Fdialogs%2Foptions.js;h=82bf80b0af5f24099abbbeace2382f2ce9b1d8af;hp=31b23055acb7f75df0e05a3d9ff7c682cdc0885b;hb=3ae1f974ffdf269f96455a39d8d6947e4d590b1b;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d diff --git a/plugins/scayt/dialogs/options.js b/plugins/scayt/dialogs/options.js index 31b2305..82bf80b 100644 --- a/plugins/scayt/dialogs/options.js +++ b/plugins/scayt/dialogs/options.js @@ -1,8 +1,20 @@ -/* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -CKEDITOR.dialog.add('scaytcheck',function(a){var b=true,c,d=CKEDITOR.document,e=[],f,g=[],h=false,i=['dic_create,dic_restore','dic_rename,dic_delete'],j=[{id:'options',label:a.lang.scayt.optionsTab,elements:[{type:'html',id:'options',html:'
\t
\t
\t\t\t\t\t
\t
\t\t\t\t\t
\t
\t\t\t\t
\t
\t\t\t\t\t
'}]},{id:'langs',label:a.lang.scayt.languagesTab,elements:[{type:'html',id:'langs',html:'
\t
\t
'}]},{id:'dictionaries',label:a.lang.scayt.dictionariesTab,elements:[{type:'html',style:'',id:'dic',html:'
\t
\t
Dictionary name
\t\t\t\t\t
\t\t\t\t\t\t
\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t
'}]},{id:'about',label:a.lang.scayt.aboutTab,elements:[{type:'html',id:'about',style:'margin: 10px 40px;',html:'
'}]}],k={title:a.lang.scayt.title,minWidth:340,minHeight:200,onShow:function(){var u=this; -u.data=a.fire('scaytDialog',{});u.options=u.data.scayt_control.option();u.sLang=u.data.scayt_control.sLang;if(!u.data||!u.data.scayt||!u.data.scayt_control){alert('Error loading application service');u.hide();return;}var v=0;if(b)u.data.scayt.getCaption('en',function(w){if(v++>0)return;c=w;n.apply(u);o.apply(u);b=false;});else o.apply(u);u.selectPage(u.data.tab);},onOk:function(){var z=this;var u=z.data.scayt_control,v=u.option(),w=0;for(var x in z.options){if(v[x]!=z.options[x]&&w===0){u.option(z.options);w++;}}var y=z.chosed_lang;if(y&&z.data.sLang!=y){u.setLang(y);w++;}if(w>0)u.refresh();},contents:g},l=CKEDITOR.plugins.scayt.getScayt(a);if(l)e=l.uiTags;for(f in e){if(e[f]==1)g[g.length]=j[f];}if(e[2]==1)h=true;function m(){var u=d.getById('dic_name').getValue();if(!u){p(' Dictionary name should not be empty. ');return false;}window.dic[this.getId()].apply(null,[this,u,i]);return true;};var n=function(){var u=this,v=u.data.scayt.getLangList(),w=['dic_create','dic_delete','dic_rename','dic_restore'],x=['mixedCase','mixedWithDigits','allCaps','ignoreDomainNames'],y;if(h){for(y in w){var z=w[y];d.getById(z).setHtml(''+c['button_'+z]+'');}d.getById('dic_info').setHtml(c.dic_info);}for(y in x){var A='label_'+x[y],B=d.getById(A);if('undefined'!=typeof B&&'undefined'!=typeof c[A]&&'undefined'!=typeof u.options[x[y]]){B.setHtml(c[A]);var C=B.getParent();C.$.style.display='block';}}var D='

'+c.about_throwt_image+'

'+'

'+c.version+u.data.scayt.version.toString()+'

'+'

'+c.about_throwt_copy+'

';d.getById('scayt_about').setHtml(D);var E=function(N,O){var P=d.createElement('label');P.setAttribute('for','cke_option'+N);P.setHtml(O[N]);if(u.sLang==N)u.chosed_lang=N;var Q=d.createElement('div'),R=CKEDITOR.dom.element.createFromHtml('');R.on('click',function(){this.$.checked=true;u.chosed_lang=N;});Q.append(R);Q.append(P);return{lang:O[N],code:N,radio:Q};},F=[];for(y in v.rtl)F[F.length]=E(y,v.ltr);for(y in v.ltr)F[F.length]=E(y,v.ltr);F.sort(function(N,O){return O.lang>N.lang?-1:1;});var G=d.getById('scayt_lcol'),H=d.getById('scayt_rcol');for(y=0;y'+u+'');};function q(u){d.getById('dic_message').setHtml(''+u+'');};function r(u){u=String(u);var v=u.split(',');for(var w=0,x=v.length;w'+b+"")}function o(b){f.getById("dic_message_"+a).setHtml(''+b+"")} +function p(b){for(var b=(""+b).split(","),a=0,e=b.length;a
\t
\t
\t\t\t\t\t
\t
\t\t\t\t\t
\t
\t\t\t\t
\t
\t\t\t\t\t
'}]},{id:"langs",label:g.languagesTab,elements:[{type:"html",id:"langs", +html:'
\t
\t
'}]},{id:"dictionaries",label:g.dictionariesTab,elements:[{type:"html",style:"",id:"dictionaries",html:'
\t
\t
Dictionary name
\t\t\t\t\t
\t\t\t\t\t\t
\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t
'}]},{id:"about", +label:g.aboutTab,elements:[{type:"html",id:"about",style:"margin: 5px 5px;",html:'
'}]}],B={title:g.title,minWidth:360,minHeight:220,onShow:function(){var b=this;b.data=j.fire("scaytDialog",{});b.options=b.data.scayt_control.option();b.chosed_lang=b.sLang=b.data.scayt_control.sLang;if(!b.data||!b.data.scayt||!b.data.scayt_control)alert("Error loading application service"),b.hide();else{var a=0;s?b.data.scayt.getCaption(j.langCode||"en",function(e){0'+h["button_"+d[c]]+"");f.getById("dic_info_"+a).setHtml(h.dic_info)}if(1== +l[0])for(c in v)d="label_"+v[c],g=f.getById(d+"_"+a),"undefined"!=typeof g&&("undefined"!=typeof h[d]&&"undefined"!=typeof k.options[v[c]])&&(g.setHtml(h[d]),g.getParent().$.style.display="block");d='

'+h.version+window.scayt.getAboutInfo().version.toString()+"

"+h.about_throwt_copy+"

";f.getById("scayt_about_"+a).setHtml(d);d=function(a,b){var c=f.createElement("label");c.setAttribute("for","cke_option"+a);c.setStyle("display", +"inline");c.setHtml(b[a]);k.sLang==a&&(k.chosed_lang=a);var d=f.createElement("div"),e=CKEDITOR.dom.element.createFromHtml('');e.on("click",function(){this.$.checked=true;k.chosed_lang=a});d.append(e);d.append(c);return{lang:b[a],code:a,radio:d}};if(1==l[1]){for(c in e.rtl)i[i.length]=d(c,e.ltr);for(c in e.ltr)i[i.length]=d(c,e.ltr);i.sort(function(a, +b){return b.lang>a.lang?-1:1});e=f.getById("scayt_lcol_"+a);d=f.getById("scayt_rcol_"+a);for(c=0;c