[3019] | 1 | /*
|
---|
| 2 | Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
|
---|
| 3 | For licensing, see LICENSE.html or http://ckeditor.com/license
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | CKEDITOR.dialog.add( 'scaytcheck', function( editor )
|
---|
| 7 | {
|
---|
| 8 | var firstLoad = true,
|
---|
| 9 | captions,
|
---|
| 10 | doc = CKEDITOR.document,
|
---|
| 11 | tags = [],
|
---|
| 12 | i,
|
---|
| 13 | contents = [],
|
---|
| 14 | userDicActive = false;
|
---|
| 15 | var dic_buttons = [
|
---|
| 16 | // [0] contains buttons for creating
|
---|
| 17 | "dic_create,dic_restore",
|
---|
| 18 | // [1] contains buton for manipulation
|
---|
| 19 | "dic_rename,dic_delete"
|
---|
| 20 | ];
|
---|
| 21 | var tags_contents = [
|
---|
| 22 | {
|
---|
| 23 | id : 'options',
|
---|
| 24 | label : editor.lang.scayt.optionsTab,
|
---|
| 25 | elements : [
|
---|
| 26 | {
|
---|
| 27 | type : 'html',
|
---|
| 28 | id : 'options',
|
---|
| 29 | html : '<div class="inner_options">' +
|
---|
| 30 | ' <div class="messagebox"></div>' +
|
---|
| 31 | ' <div style="display:none;">' +
|
---|
| 32 | ' <input type="checkbox" value="0" id="allCaps" />' +
|
---|
| 33 | ' <label for="allCaps" id="label_allCaps"></label>' +
|
---|
| 34 | ' </div>' +
|
---|
| 35 | ' <div style="display:none;">' +
|
---|
| 36 | ' <input type="checkbox" value="0" id="ignoreDomainNames" />' +
|
---|
| 37 | ' <label for="ignoreDomainNames" id="label_ignoreDomainNames"></label>' +
|
---|
| 38 | ' </div>' +
|
---|
| 39 | ' <div style="display:none;">' +
|
---|
| 40 | ' <input type="checkbox" value="0" id="mixedCase" />' +
|
---|
| 41 | ' <label for="mixedCase" id="label_mixedCase"></label>' +
|
---|
| 42 | ' </div>' +
|
---|
| 43 | ' <div style="display:none;">' +
|
---|
| 44 | ' <input type="checkbox" value="0" id="mixedWithDigits" />' +
|
---|
| 45 | ' <label for="mixedWithDigits" id="label_mixedWithDigits"></label>' +
|
---|
| 46 | ' </div>' +
|
---|
| 47 | '</div>'
|
---|
| 48 | }
|
---|
| 49 | ]
|
---|
| 50 | },
|
---|
| 51 | {
|
---|
| 52 | id : 'langs',
|
---|
| 53 | label : editor.lang.scayt.languagesTab,
|
---|
| 54 | elements : [
|
---|
| 55 | {
|
---|
| 56 | type : 'html',
|
---|
| 57 | id : 'langs',
|
---|
| 58 | html : '<div class="inner_langs">' +
|
---|
| 59 | ' <div class="messagebox"></div> ' +
|
---|
| 60 | ' <div style="float:left;width:47%;margin-left:5px;" id="scayt_lcol" ></div>' +
|
---|
| 61 | ' <div style="float:left;width:47%;margin-left:15px;" id="scayt_rcol"></div>' +
|
---|
| 62 | '</div>'
|
---|
| 63 | }
|
---|
| 64 | ]
|
---|
| 65 | },
|
---|
| 66 | {
|
---|
| 67 | id : 'dictionaries',
|
---|
| 68 | label : editor.lang.scayt.dictionariesTab,
|
---|
| 69 | elements : [
|
---|
| 70 | {
|
---|
| 71 | type : 'html',
|
---|
| 72 | style: '',
|
---|
| 73 | id : 'dic',
|
---|
| 74 | html : '<div class="inner_dictionary" style="text-align:left; white-space:normal;">' +
|
---|
| 75 | ' <div style="margin:5px auto; width:80%;white-space:normal; overflow:hidden;" id="dic_message"> </div>' +
|
---|
| 76 | ' <div style="margin:5px auto; width:80%;white-space:normal;"> ' +
|
---|
| 77 | ' <span class="cke_dialog_ui_labeled_label" >Dictionary name</span><br>'+
|
---|
| 78 | ' <span class="cke_dialog_ui_labeled_content" >'+
|
---|
| 79 | ' <div class="cke_dialog_ui_input_text">'+
|
---|
| 80 | ' <input id="dic_name" type="text" class="cke_dialog_ui_input_text"/>'+
|
---|
| 81 | ' </div></span></div>'+
|
---|
| 82 | ' <div style="margin:5px auto; width:80%;white-space:normal;">'+
|
---|
| 83 | ' <a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_create">'+
|
---|
| 84 | ' </a>' +
|
---|
| 85 | ' <a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_delete">'+
|
---|
| 86 | ' </a>' +
|
---|
| 87 | ' <a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_rename">'+
|
---|
| 88 | ' </a>' +
|
---|
| 89 | ' <a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_restore">'+
|
---|
| 90 | ' </a>' +
|
---|
| 91 | ' </div>' +
|
---|
| 92 | ' <div style="margin:5px auto; width:95%;white-space:normal;" id="dic_info"></div>' +
|
---|
| 93 | '</div>'
|
---|
| 94 | }
|
---|
| 95 | ]
|
---|
| 96 | },
|
---|
| 97 | {
|
---|
| 98 | id : 'about',
|
---|
| 99 | label : editor.lang.scayt.aboutTab,
|
---|
| 100 | elements : [
|
---|
| 101 | {
|
---|
| 102 | type : 'html',
|
---|
| 103 | id : 'about',
|
---|
| 104 | style : 'margin: 10px 40px;',
|
---|
| 105 | html : '<div id="scayt_about"></div>'
|
---|
| 106 | }
|
---|
| 107 | ]
|
---|
| 108 | }
|
---|
| 109 | ];
|
---|
| 110 | var dialogDefiniton = {
|
---|
| 111 | title : editor.lang.scayt.title,
|
---|
| 112 | minWidth : 340,
|
---|
| 113 | minHeight : 200,
|
---|
| 114 | onShow : function()
|
---|
| 115 | {
|
---|
| 116 | var dialog = this;
|
---|
| 117 | dialog.data = editor.fire( 'scaytDialog', {} );
|
---|
| 118 | dialog.options = dialog.data.scayt_control.option();
|
---|
| 119 | dialog.sLang = dialog.data.scayt_control.sLang;
|
---|
| 120 |
|
---|
| 121 | if ( !dialog.data || !dialog.data.scayt || !dialog.data.scayt_control )
|
---|
| 122 | {
|
---|
| 123 | alert( 'Error loading application service' );
|
---|
| 124 | dialog.hide();
|
---|
| 125 | return;
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | var stop = 0;
|
---|
| 129 | if ( firstLoad )
|
---|
| 130 | {
|
---|
| 131 | dialog.data.scayt.getCaption( 'en', function( caps )
|
---|
| 132 | {
|
---|
| 133 | if ( stop++ > 0 ) // Once only
|
---|
| 134 | return;
|
---|
| 135 | captions = caps;
|
---|
| 136 | init_with_captions.apply( dialog );
|
---|
| 137 | reload.apply( dialog );
|
---|
| 138 | firstLoad = false;
|
---|
| 139 | });
|
---|
| 140 | }
|
---|
| 141 | else
|
---|
| 142 | reload.apply( dialog );
|
---|
| 143 |
|
---|
| 144 | dialog.selectPage( dialog.data.tab );
|
---|
| 145 | },
|
---|
| 146 | onOk : function()
|
---|
| 147 | {
|
---|
| 148 | var scayt_control = this.data.scayt_control,
|
---|
| 149 | o = scayt_control.option(),
|
---|
| 150 | c = 0;
|
---|
| 151 |
|
---|
| 152 | // Set up options if any was set.
|
---|
| 153 | for ( var i in this.options )
|
---|
| 154 | {
|
---|
| 155 | if (o[i] != this.options[ i ] && c === 0 )
|
---|
| 156 | {
|
---|
| 157 | scayt_control.option( this.options );
|
---|
| 158 | c++;
|
---|
| 159 | }
|
---|
| 160 | }
|
---|
| 161 |
|
---|
| 162 | // Setup languge if it was changed.
|
---|
| 163 | var csLang = this.chosed_lang;
|
---|
| 164 | if ( csLang && this.data.sLang != csLang )
|
---|
| 165 | {
|
---|
| 166 | scayt_control.setLang( csLang );
|
---|
| 167 | c++;
|
---|
| 168 | }
|
---|
| 169 | if ( c > 0 )
|
---|
| 170 | scayt_control.refresh();
|
---|
| 171 | },
|
---|
| 172 | contents : contents
|
---|
| 173 | };
|
---|
| 174 |
|
---|
| 175 | var scayt_control = CKEDITOR.plugins.scayt.getScayt( editor );
|
---|
| 176 | if ( scayt_control )
|
---|
| 177 | {
|
---|
| 178 | tags = scayt_control.uiTags;
|
---|
| 179 | }
|
---|
| 180 |
|
---|
| 181 | for ( i in tags ) {
|
---|
| 182 | if ( tags[ i ] == 1 )
|
---|
| 183 | contents[ contents.length ] = tags_contents[ i ];
|
---|
| 184 | }
|
---|
| 185 | if ( tags[2] == 1 )
|
---|
| 186 | userDicActive = true;
|
---|
| 187 |
|
---|
| 188 | function onDicButtonClick()
|
---|
| 189 | {
|
---|
| 190 | var dic_name = doc.getById('dic_name').getValue();
|
---|
| 191 | if ( !dic_name )
|
---|
| 192 | {
|
---|
| 193 | dic_error_message(" Dictionary name should not be empty. ");
|
---|
| 194 | return false;
|
---|
| 195 | }
|
---|
| 196 | //apply handler
|
---|
| 197 | window.dic[ this.getId() ].apply( null, [ this, dic_name, dic_buttons ] );
|
---|
| 198 |
|
---|
| 199 | return true;
|
---|
| 200 | }
|
---|
| 201 | var init_with_captions = function()
|
---|
| 202 | {
|
---|
| 203 | var dialog = this,
|
---|
| 204 | lang_list = dialog.data.scayt.getLangList(),
|
---|
| 205 | buttons = [ 'dic_create','dic_delete','dic_rename','dic_restore' ],
|
---|
| 206 | labels = [ 'mixedCase','mixedWithDigits','allCaps','ignoreDomainNames' ],
|
---|
| 207 | i;
|
---|
| 208 |
|
---|
| 209 | // Add buttons titles
|
---|
| 210 | if (userDicActive)
|
---|
| 211 | {
|
---|
| 212 | for ( i in buttons )
|
---|
| 213 | {
|
---|
| 214 | var button = buttons[ i ];
|
---|
| 215 | doc.getById( button ).setHtml( '<span class="cke_dialog_ui_button">' + captions[ 'button_' + button] +'</span>' );
|
---|
| 216 | }
|
---|
| 217 | doc.getById( 'dic_info' ).setHtml( captions[ 'dic_info' ] );
|
---|
| 218 | }
|
---|
| 219 |
|
---|
| 220 |
|
---|
| 221 | // Fill options and dictionary labels.
|
---|
| 222 | for ( i in labels )
|
---|
| 223 | {
|
---|
| 224 | var label = 'label_' + labels[ i ],
|
---|
| 225 | labelElement = doc.getById( label );
|
---|
| 226 |
|
---|
| 227 | if ( 'undefined' != typeof labelElement
|
---|
| 228 | && 'undefined' != typeof captions[ label ]
|
---|
| 229 | && 'undefined' != typeof dialog.options[labels[ i ]] )
|
---|
| 230 | {
|
---|
| 231 | labelElement.setHtml( captions[ label ] );
|
---|
| 232 | var labelParent = labelElement.getParent();
|
---|
| 233 | labelParent.$.style.display = "block";
|
---|
| 234 | }
|
---|
| 235 | }
|
---|
| 236 |
|
---|
| 237 | var about = '<p>' + captions[ 'about_throwt_image' ] + '</p>'+
|
---|
| 238 | '<p>' + captions[ 'version' ] + dialog.data.scayt.version.toString() + '</p>' +
|
---|
| 239 | '<p>' + captions[ 'about_throwt_copy' ] + '</p>';
|
---|
| 240 |
|
---|
| 241 | doc.getById( 'scayt_about' ).setHtml( about );
|
---|
| 242 |
|
---|
| 243 | // Create languages tab.
|
---|
| 244 | var createOption = function( option, list )
|
---|
| 245 | {
|
---|
| 246 | var label = doc.createElement( 'label' );
|
---|
| 247 | label.setAttribute( 'for', 'cke_option' + option );
|
---|
| 248 | label.setHtml( list[ option ] );
|
---|
| 249 |
|
---|
| 250 | if ( dialog.sLang == option ) // Current.
|
---|
| 251 | dialog.chosed_lang = option;
|
---|
| 252 |
|
---|
| 253 | var div = doc.createElement( 'div' );
|
---|
| 254 | var radio = CKEDITOR.dom.element.createFromHtml( '<input id="cke_option' +
|
---|
| 255 | option + '" type="radio" ' +
|
---|
| 256 | ( dialog.sLang == option ? 'checked="checked"' : '' ) +
|
---|
| 257 | ' value="' + option + '" name="scayt_lang" />' );
|
---|
| 258 |
|
---|
| 259 | radio.on( 'click', function()
|
---|
| 260 | {
|
---|
| 261 | this.$.checked = true;
|
---|
| 262 | dialog.chosed_lang = option;
|
---|
| 263 | });
|
---|
| 264 |
|
---|
| 265 | div.append( radio );
|
---|
| 266 | div.append( label );
|
---|
| 267 |
|
---|
| 268 | return {
|
---|
| 269 | lang : list[ option ],
|
---|
| 270 | code : option,
|
---|
| 271 | radio : div
|
---|
| 272 | };
|
---|
| 273 | };
|
---|
| 274 |
|
---|
| 275 | var langList = [];
|
---|
| 276 | for ( i in lang_list.rtl )
|
---|
| 277 | langList[ langList.length ] = createOption( i, lang_list.ltr );
|
---|
| 278 |
|
---|
| 279 | for ( i in lang_list.ltr )
|
---|
| 280 | langList[ langList.length ] = createOption( i, lang_list.ltr );
|
---|
| 281 |
|
---|
| 282 | langList.sort( function( lang1, lang2 )
|
---|
| 283 | {
|
---|
| 284 | return ( lang2.lang > lang1.lang ) ? -1 : 1 ;
|
---|
| 285 | });
|
---|
| 286 |
|
---|
| 287 | var fieldL = doc.getById( 'scayt_lcol' ),
|
---|
| 288 | fieldR = doc.getById( 'scayt_rcol' );
|
---|
| 289 | for ( i=0; i < langList.length; i++ )
|
---|
| 290 | {
|
---|
| 291 | var field = ( i < langList.length / 2 ) ? fieldL : fieldR;
|
---|
| 292 | field.append( langList[ i ].radio );
|
---|
| 293 | }
|
---|
| 294 |
|
---|
| 295 | // user dictionary handlers
|
---|
| 296 | var dic = {};
|
---|
| 297 | dic.dic_create = function( el, dic_name , dic_buttons )
|
---|
| 298 | {
|
---|
| 299 | // comma separated button's ids include repeats if exists
|
---|
| 300 | var all_buttons = dic_buttons[0] + ',' + dic_buttons[1];
|
---|
| 301 |
|
---|
| 302 | var err_massage = captions["err_dic_create"];
|
---|
| 303 | var suc_massage = captions["succ_dic_create"];
|
---|
| 304 | //console.info("--plugin ");
|
---|
| 305 |
|
---|
| 306 | window.scayt.createUserDictionary(dic_name,
|
---|
| 307 | function(arg)
|
---|
| 308 | {
|
---|
| 309 | //console.info( "dic_create callback called with args" , arg );
|
---|
| 310 | hide_dic_buttons ( all_buttons );
|
---|
| 311 | display_dic_buttons ( dic_buttons[1] );
|
---|
| 312 | suc_massage = suc_massage.replace("%s" , arg.dname );
|
---|
| 313 | dic_success_message (suc_massage);
|
---|
| 314 | },
|
---|
| 315 | function(arg)
|
---|
| 316 | {
|
---|
| 317 | //console.info( "dic_create errorback called with args" , arg )
|
---|
| 318 | err_massage = err_massage.replace("%s" ,arg.dname );
|
---|
| 319 | dic_error_message ( err_massage + "( "+ (arg.message || "") +")");
|
---|
| 320 | });
|
---|
| 321 |
|
---|
| 322 | };
|
---|
| 323 |
|
---|
| 324 | dic.dic_rename = function( el, dic_name )
|
---|
| 325 | {
|
---|
| 326 | //
|
---|
| 327 | // try to rename dictionary
|
---|
| 328 | // @TODO: rename dict
|
---|
| 329 | //console.info ( captions["err_dic_rename"] )
|
---|
| 330 | var err_massage = captions["err_dic_rename"] || "";
|
---|
| 331 | var suc_massage = captions["succ_dic_rename"] || "";
|
---|
| 332 | window.scayt.renameUserDictionary(dic_name,
|
---|
| 333 | function(arg)
|
---|
| 334 | {
|
---|
| 335 | //console.info( "dic_rename callback called with args" , arg );
|
---|
| 336 | suc_massage = suc_massage.replace("%s" , arg.dname );
|
---|
| 337 | set_dic_name( dic_name );
|
---|
| 338 | dic_success_message ( suc_massage );
|
---|
| 339 | },
|
---|
| 340 | function(arg)
|
---|
| 341 | {
|
---|
| 342 | //console.info( "dic_rename errorback called with args" , arg )
|
---|
| 343 | err_massage = err_massage.replace("%s" , arg.dname );
|
---|
| 344 | set_dic_name( dic_name );
|
---|
| 345 | dic_error_message( err_massage + "( " + ( arg.message || "" ) + " )" );
|
---|
| 346 | });
|
---|
| 347 | };
|
---|
| 348 |
|
---|
| 349 | dic.dic_delete = function ( el, dic_name , dic_buttons )
|
---|
| 350 | {
|
---|
| 351 | var all_buttons = dic_buttons[0] + ',' + dic_buttons[1];
|
---|
| 352 | var err_massage = captions["err_dic_delete"];
|
---|
| 353 | var suc_massage = captions["succ_dic_delete"];
|
---|
| 354 |
|
---|
| 355 | // try to delete dictionary
|
---|
| 356 | // @TODO: delete dict
|
---|
| 357 | window.scayt.deleteUserDictionary(
|
---|
| 358 | function(arg)
|
---|
| 359 | {
|
---|
| 360 | //console.info( "dic_delete callback " , dic_name ,arg );
|
---|
| 361 | suc_massage = suc_massage.replace("%s" , arg.dname );
|
---|
| 362 | hide_dic_buttons ( all_buttons );
|
---|
| 363 | display_dic_buttons ( dic_buttons[0] );
|
---|
| 364 | set_dic_name( "" ); // empty input field
|
---|
| 365 | dic_success_message( suc_massage );
|
---|
| 366 | },
|
---|
| 367 | function(arg)
|
---|
| 368 | {
|
---|
| 369 | //console.info( " dic_delete errorback called with args" , arg )
|
---|
| 370 | err_massage = err_massage.replace("%s" , arg.dname );
|
---|
| 371 | dic_error_message(err_massage);
|
---|
| 372 | });
|
---|
| 373 | };
|
---|
| 374 |
|
---|
| 375 | dic.dic_restore = dialog.dic_restore || function ( el, dic_name , dic_buttons )
|
---|
| 376 | {
|
---|
| 377 | // try to restore existing dictionary
|
---|
| 378 | var all_buttons = dic_buttons[0] + ',' + dic_buttons[1];
|
---|
| 379 | var err_massage = captions["err_dic_restore"];
|
---|
| 380 | var suc_massage = captions["succ_dic_restore"];
|
---|
| 381 |
|
---|
| 382 | window.scayt.restoreUserDictionary(dic_name,
|
---|
| 383 | function(arg)
|
---|
| 384 | {
|
---|
| 385 | //console.info( "dic_restore callback called with args" , arg );
|
---|
| 386 | suc_massage = suc_massage.replace("%s" , arg.dname );
|
---|
| 387 | hide_dic_buttons ( all_buttons );
|
---|
| 388 | display_dic_buttons(dic_buttons[1]);
|
---|
| 389 | dic_success_message( suc_massage );
|
---|
| 390 | },
|
---|
| 391 | function(arg)
|
---|
| 392 | {
|
---|
| 393 | //console.info( " dic_restore errorback called with args" , arg )
|
---|
| 394 | err_massage = err_massage.replace("%s" , arg.dname );
|
---|
| 395 | dic_error_message( err_massage );
|
---|
| 396 | });
|
---|
| 397 | };
|
---|
| 398 |
|
---|
| 399 | // ** bind event listeners
|
---|
| 400 | var arr_buttons = ( dic_buttons[0] + ',' + dic_buttons[1] ).split( ',' ),
|
---|
| 401 | l;
|
---|
| 402 |
|
---|
| 403 | for ( i = 0, l = arr_buttons.length ; i < l ; i += 1 )
|
---|
| 404 | {
|
---|
| 405 | var dic_button = doc.getById(arr_buttons[i]);
|
---|
| 406 | if ( dic_button )
|
---|
| 407 | dic_button.on( 'click', onDicButtonClick, this );
|
---|
| 408 | }
|
---|
| 409 | };
|
---|
| 410 |
|
---|
| 411 | var reload = function()
|
---|
| 412 | {
|
---|
| 413 | var dialog = this;
|
---|
| 414 |
|
---|
| 415 | // Animate options.
|
---|
| 416 | for ( var i in dialog.options )
|
---|
| 417 | {
|
---|
| 418 | var checkbox = doc.getById( i );
|
---|
| 419 | if ( checkbox )
|
---|
| 420 | {
|
---|
| 421 | checkbox.removeAttribute( 'checked' );
|
---|
| 422 | if ( dialog.options[ i ] == 1 )
|
---|
| 423 | checkbox.setAttribute( 'checked', 'checked' );
|
---|
| 424 |
|
---|
| 425 | // Bind events. Do it only once.
|
---|
| 426 | if ( firstLoad )
|
---|
| 427 | {
|
---|
| 428 | checkbox.on( 'click', function()
|
---|
| 429 | {
|
---|
| 430 | dialog.options[ this.getId() ] = this.$.checked ? 1 : 0 ;
|
---|
| 431 | } );
|
---|
| 432 | }
|
---|
| 433 | }
|
---|
| 434 | }
|
---|
| 435 |
|
---|
| 436 | // * user dictionary
|
---|
| 437 | if ( userDicActive ){
|
---|
| 438 | window.scayt.getNameUserDictionary(
|
---|
| 439 | function( o )
|
---|
| 440 | {
|
---|
| 441 | var dic_name = o.dname;
|
---|
| 442 | if ( dic_name )
|
---|
| 443 | {
|
---|
| 444 | doc.getById( 'dic_name' ).setValue(dic_name);
|
---|
| 445 | display_dic_buttons( dic_buttons[1] );
|
---|
| 446 | }
|
---|
| 447 | else
|
---|
| 448 | display_dic_buttons( dic_buttons[0] );
|
---|
| 449 |
|
---|
| 450 | },
|
---|
| 451 | function ()
|
---|
| 452 | {
|
---|
| 453 | doc.getById( 'dic_name' ).setValue("");
|
---|
| 454 | });
|
---|
| 455 | dic_success_message("");
|
---|
| 456 | }
|
---|
| 457 |
|
---|
| 458 | };
|
---|
| 459 |
|
---|
| 460 | function dic_error_message ( m )
|
---|
| 461 | {
|
---|
| 462 | doc.getById('dic_message').setHtml('<span style="color:red;">' + m + '</span>' );
|
---|
| 463 | }
|
---|
| 464 | function dic_success_message ( m )
|
---|
| 465 | {
|
---|
| 466 | doc.getById('dic_message').setHtml('<span style="color:blue;">' + m + '</span>') ;
|
---|
| 467 | }
|
---|
| 468 | function display_dic_buttons ( sIds )
|
---|
| 469 | {
|
---|
| 470 |
|
---|
| 471 | sIds = String( sIds );
|
---|
| 472 | var aIds = sIds.split(',');
|
---|
| 473 | for ( var i=0, l = aIds.length; i < l ; i+=1)
|
---|
| 474 | {
|
---|
| 475 | doc.getById( aIds[i] ).$.style.display = "inline";
|
---|
| 476 | }
|
---|
| 477 |
|
---|
| 478 | }
|
---|
| 479 | function hide_dic_buttons ( sIds )
|
---|
| 480 | {
|
---|
| 481 | sIds = String( sIds );
|
---|
| 482 | var aIds = sIds.split(',');
|
---|
| 483 | for ( var i = 0, l = aIds.length; i < l ; i += 1 )
|
---|
| 484 | {
|
---|
| 485 | doc.getById( aIds[i] ).$.style.display = "none";
|
---|
| 486 | }
|
---|
| 487 | }
|
---|
| 488 | function set_dic_name ( dic_name )
|
---|
| 489 | {
|
---|
| 490 | doc.getById('dic_name').$.value= dic_name;
|
---|
| 491 | }
|
---|
| 492 |
|
---|
| 493 | return dialogDefiniton;
|
---|
| 494 | });
|
---|