X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=plugins%2Fscayt%2Fdialogs%2Foptions.js;h=7d52198f192ba9b192ec4bb191a2d0f318e7da53;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=31b23055acb7f75df0e05a3d9ff7c682cdc0885b;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;p=ckeditor.git diff --git a/plugins/scayt/dialogs/options.js b/plugins/scayt/dialogs/options.js index 31b2305..7d52198 100644 --- a/plugins/scayt/dialogs/options.js +++ b/plugins/scayt/dialogs/options.js @@ -1,8 +1,8 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, 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
'+'\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:o.languagesTab,elements:[{type:'html',id:'langs',html:'
'+'\t
\t'+'
'+'
'+'
'}]},{id:'dictionaries',label:o.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:o.aboutTab,elements:[{type:'html',id:'about',style:'margin: 5px 5px;',html:'
'}]}],q={title:o.title,minWidth:360,minHeight:220,onShow:function(){var z=this; +z.data=a.fire('scaytDialog',{});z.options=z.data.scayt_control.option();z.chosed_lang=z.sLang=z.data.scayt_control.sLang;if(!z.data||!z.data.scayt||!z.data.scayt_control){alert('Error loading application service');z.hide();return;}var A=0;if(b)z.data.scayt.getCaption(a.langCode||'en',function(B){if(A++>0)return;c=B;s.apply(z);t.apply(z);b=false;});else t.apply(z);z.selectPage(z.data.tab);},onOk:function(){var z=this.data.scayt_control;z.option(this.options);var A=this.chosed_lang;z.setLang(A);z.refresh();},onCancel:function(){var z=l();for(var A in z)z[A].checked=false;n(m(),'');},contents:h},r=CKEDITOR.plugins.scayt.getScayt(a);for(g=0;g'+c['button_'+B[F]]+'');}d.getById('dic_info_'+e).setHtml(c.dic_info);}if(f[0]==1)for(F in E){var G='label_'+E[F],H=G+'_'+e,I=d.getById(H);if('undefined'!=typeof I&&'undefined'!=typeof c[G]&&'undefined'!=typeof z.options[E[F]]){I.setHtml(c[G]);var J=I.getParent();J.$.style.display='block';}}var K='

'+'

'+c.version+window.scayt.getAboutInfo().version.toString()+'

'+'

'+c.about_throwt_copy+'

';d.getById('scayt_about_'+e).setHtml(K);var L=function(U,V){var W=d.createElement('label');W.setAttribute('for','cke_option'+U);W.setHtml(V[U]);if(z.sLang==U)z.chosed_lang=U;var X=d.createElement('div'),Y=CKEDITOR.dom.element.createFromHtml('');Y.on('click',function(){this.$.checked=true;z.chosed_lang=U;});X.append(Y);X.append(W);return{lang:V[U],code:U,radio:X};};if(f[1]==1){for(F in A.rtl)D[D.length]=L(F,A.ltr);for(F in A.ltr)D[D.length]=L(F,A.ltr);D.sort(function(U,V){return V.lang>U.lang?-1:1;});var M=d.getById('scayt_lcol_'+e),N=d.getById('scayt_rcol_'+e);for(F=0;F'+z+'');};function v(z){d.getById('dic_message_'+e).setHtml(''+z+'');};function w(z){z=String(z);var A=z.split(',');for(var B=0,C=A.length;B