- addButtonCommand( editor, 'button_' + commandName, items_suggestion[i],\r
- commandName, exec, 'scayt_suggest', i + 1 );\r
- _r[ commandName ] = CKEDITOR.TRISTATE_OFF;\r
- mainSuggestions[ commandName ] = CKEDITOR.TRISTATE_OFF;\r
+ var commandName = 'scayt_suggestion_' + items_suggestion[i].replace( ' ', '_' );\r
+ var exec = ( function( el, s )\r
+ {\r
+ return {\r
+ exec: function()\r
+ {\r
+ scayt_control.replace(el, s);\r
+ }\r
+ };\r
+ })( node, items_suggestion[i] );\r
+\r
+ if ( i < maxSuggestions )\r
+ {\r
+ addButtonCommand( editor, 'button_' + commandName, items_suggestion[i],\r
+ commandName, exec, 'scayt_suggest', i + 1 );\r
+ mainSuggestions[ commandName ] = CKEDITOR.TRISTATE_OFF;\r
+ }\r
+ else if ( moreSuggestionsUnable == 'on' )\r
+ {\r
+ addButtonCommand( editor, 'button_' + commandName, items_suggestion[i],\r
+ commandName, exec, 'scayt_moresuggest', i + 1 );\r
+ moreSuggestions[ commandName ] = CKEDITOR.TRISTATE_OFF;\r
+ moreSuggestionsUnableAdded = true;\r
+ }\r