' +
- '
' +
+ html : '
'
}
]
@@ -134,7 +139,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
type : 'html',
id : 'about',
style : 'margin: 5px 5px;',
- html : '
'
+ html : '
'
}
]
}
@@ -149,7 +154,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
var dialog = this;
dialog.data = editor.fire( 'scaytDialog', {} );
dialog.options = dialog.data.scayt_control.option();
- dialog.sLang = dialog.data.scayt_control.sLang;
+ dialog.chosed_lang = dialog.sLang = dialog.data.scayt_control.sLang;
if ( !dialog.data || !dialog.data.scayt || !dialog.data.scayt_control )
{
@@ -180,7 +185,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
{
var scayt_control = this.data.scayt_control;
scayt_control.option( this.options );
- // Setup languge if it was changed.
+ // Setup language if it was changed.
var csLang = this.chosed_lang;
scayt_control.setLang( csLang );
scayt_control.refresh();
@@ -198,9 +203,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
var scayt_control = CKEDITOR.plugins.scayt.getScayt( editor );
- tags = CKEDITOR.plugins.scayt.uiTabs;
-
- for ( i in tags )
+ for ( i = 0; i < tags.length; i++ )
{
if ( tags[ i ] == 1 )
contents[ contents.length ] = tags_contents[ i ];
@@ -208,40 +211,41 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
if ( tags[2] == 1 )
userDicActive = 1;
-
var init_with_captions = function()
{
var dialog = this,
lang_list = dialog.data.scayt.getLangList(),
- buttons = [ 'dic_create', 'dic_delete', 'dic_rename', 'dic_restore' ],
+ buttonCaptions = [ 'dic_create', 'dic_delete', 'dic_rename', 'dic_restore' ],
+ buttonIds = [],
+ langList = [],
labels = optionsIds,
i;
// Add buttons titles
if ( userDicActive )
{
- for ( i = 0; i < buttons.length; i++ )
+ for ( i = 0; i < buttonCaptions.length; i++ )
{
- var button = buttons[ i ];
- doc.getById( button ).setHtml( '
' + captions[ 'button_' + button] +'' );
+ buttonIds[ i ] = buttonCaptions[ i ] + "_" + editorName;
+ doc.getById( buttonIds[ i ] ).setHtml( '
' + captions[ 'button_' + buttonCaptions[ i ]] +'' );
}
- doc.getById( 'dic_info' ).setHtml( captions[ 'dic_info' ] );
+ doc.getById( 'dic_info_' + editorName ).setHtml( captions[ 'dic_info' ] );
}
-
// Fill options and dictionary labels.
if ( tags[0] == 1 )
{
for ( i in labels )
{
- var label = 'label_' + labels[ i ],
- labelElement = doc.getById( label );
+ var labelCaption = 'label_' + labels[ i ],
+ labelId = labelCaption + '_' + editorName,
+ labelElement = doc.getById( labelId );
if ( 'undefined' != typeof labelElement
- && 'undefined' != typeof captions[ label ]
+ && 'undefined' != typeof captions[ labelCaption ]
&& 'undefined' != typeof dialog.options[labels[ i ]] )
{
- labelElement.setHtml( captions[ label ] );
+ labelElement.setHtml( captions[ labelCaption ] );
var labelParent = labelElement.getParent();
labelParent.$.style.display = "block";
}
@@ -252,7 +256,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
'
' + captions[ 'version' ] + window.scayt.getAboutInfo().version.toString() + '
' +
'
' + captions[ 'about_throwt_copy' ] + '
';
- doc.getById( 'scayt_about' ).setHtml( about );
+ doc.getById( 'scayt_about_' + editorName ).setHtml( about );
// Create languages tab.
var createOption = function( option, list )
@@ -286,7 +290,6 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
};
};
- var langList = [];
if ( tags[1] ==1 )
{
for ( i in lang_list.rtl )
@@ -300,8 +303,8 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
return ( lang2.lang > lang1.lang ) ? -1 : 1 ;
});
- var fieldL = doc.getById( 'scayt_lcol' ),
- fieldR = doc.getById( 'scayt_rcol' );
+ var fieldL = doc.getById( 'scayt_lcol_' + editorName ),
+ fieldR = doc.getById( 'scayt_rcol_' + editorName );
for ( i=0; i < langList.length; i++ )
{
var field = ( i < langList.length / 2 ) ? fieldL : fieldR;
@@ -403,15 +406,15 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
function onDicButtonClick( ev )
{
- var dic_name = doc.getById('dic_name').getValue();
+ var dic_name = doc.getById('dic_name_' + editorName).getValue();
if ( !dic_name )
{
dic_error_message(" Dictionary name should not be empty. ");
return false;
}
try{
- var el = id = ev.data.getTarget().getParent();
- var id = el.getId();
+ var el = ev.data.getTarget().getParent();
+ var id = /(dic_\w+)_[\w\d]+/.exec(el.getId())[1];
dic[ id ].apply( null, [ el, dic_name, dic_buttons ] );
}
catch(err)
@@ -452,7 +455,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
{
opto[k].checked = false;
//alert (opto[k].removeAttribute)
- if ( dialog.options[ i ] == 1 )
+ if ( dialog.options[ i.split("_")[0] ] == 1 )
{
opto[k].checked = true;
}
@@ -463,7 +466,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
{
checkbox.on( 'click', function()
{
- dialog.options[ this.getId() ] = this.$.checked ? 1 : 0 ;
+ dialog.options[ this.getId().split("_")[0] ] = this.$.checked ? 1 : 0 ;
});
}
}
@@ -487,7 +490,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
hide_dic_buttons( dic_buttons[0] + ',' + dic_buttons[1] );
if ( dic_name )
{
- doc.getById( 'dic_name' ).setValue(dic_name);
+ doc.getById( 'dic_name_' + editorName ).setValue(dic_name);
display_dic_buttons( dic_buttons[1] );
}
else
@@ -496,7 +499,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
},
function()
{
- doc.getById( 'dic_name' ).setValue("");
+ doc.getById( 'dic_name_' + editorName ).setValue("");
});
dic_success_message("");
}
@@ -505,11 +508,11 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
function dic_error_message( m )
{
- doc.getById('dic_message').setHtml('
' + m + '' );
+ doc.getById('dic_message_' + editorName).setHtml('
' + m + '' );
}
function dic_success_message( m )
{
- doc.getById('dic_message').setHtml('
' + m + '') ;
+ doc.getById('dic_message_' + editorName).setHtml('
' + m + '') ;
}
function display_dic_buttons( sIds )
{
@@ -527,7 +530,7 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor )
}
function set_dic_name( dic_name )
{
- doc.getById('dic_name').$.value= dic_name;
+ doc.getById('dic_name_' + editorName).$.value= dic_name;
}
return dialogDefiniton;