| | 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 _return = { |
| | 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; |
| | 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 oN in this.options ) |
| | 154 | { |
| | 155 | if (o[oN] != this.options[ oN ] && 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 ( var i in tags) { |
| | 182 | if (tags[i] == 1) |
| | 183 | contents[contents.length] = tags_contents[i]; |
| | 184 | } |
| | 185 | if (tags.length > 0 && typeof tags[2] != 'undefined' && tags[2] == 1) |
| | 186 | userDicActive = true; |
| | 187 | |
| 316 | | return { |
| 317 | | title : editor.lang.scayt.title, |
| 318 | | minWidth : 340, |
| 319 | | minHeight : 200, |
| 320 | | onShow : function() |
| 321 | | { |
| 322 | | var dialog = this; |
| 323 | | dialog.data = editor.fire( 'scaytDialog', {} ); |
| 324 | | dialog.options = dialog.data.scayt_control.option(); |
| 325 | | dialog.sLang = dialog.data.scayt_control.sLang; |
| 326 | | |
| 327 | | if ( !dialog.data || !dialog.data.scayt || !dialog.data.scayt_control ) |
| 328 | | { |
| 329 | | alert( 'Error loading application service' ); |
| 330 | | dialog.hide(); |
| 331 | | return; |
| 332 | | } |
| 333 | | |
| 334 | | var stop = 0; |
| 335 | | if ( firstLoad ) |
| 336 | | { |
| 337 | | dialog.data.scayt.getCaption( 'en', function( caps ) |
| 338 | | { |
| 339 | | if ( stop++ > 0 ) // Once only |
| 340 | | return; |
| 341 | | captions = caps; |
| 342 | | init_with_captions.apply( dialog ); |
| 343 | | reload.apply( dialog ); |
| 344 | | firstLoad = false; |
| 345 | | }); |
| 346 | | } |
| 347 | | else |
| 348 | | reload.apply( dialog ); |
| 349 | | |
| 350 | | dialog.selectPage( dialog.data.tab ); |
| 351 | | }, |
| 352 | | onOk : function() |
| 353 | | { |
| 354 | | var scayt_control = this.data.scayt_control, |
| 355 | | o = scayt_control.option(), |
| 356 | | c = 0; |
| 357 | | |
| 358 | | // Set up options if any was set. |
| 359 | | for ( var oN in this.options ) |
| 360 | | { |
| 361 | | if (o[oN] != this.options[ oN ] && c === 0 ) |
| 362 | | { |
| 363 | | scayt_control.option( this.options ); |
| 364 | | c++; |
| 365 | | } |
| 366 | | } |
| 367 | | |
| 368 | | // Setup languge if it was changed. |
| 369 | | var csLang = this.chosed_lang; |
| 370 | | if ( csLang && this.data.sLang != csLang ) |
| 371 | | { |
| 372 | | scayt_control.setLang( csLang ); |
| 373 | | c++; |
| 374 | | } |
| 375 | | if ( c > 0 ) |
| 376 | | scayt_control.refresh(); |
| 377 | | }, |
| 378 | | contents : [ |
| 379 | | { |
| 380 | | id : 'options', |
| 381 | | label : editor.lang.scayt.optionsTab, |
| 382 | | elements : [ |
| 383 | | { |
| 384 | | type : 'html', |
| 385 | | id : 'options', |
| 386 | | html : '<div class="inner_options">' + |
| 387 | | ' <div class="messagebox"></div>' + |
| 388 | | ' <div style="display:none;">' + |
| 389 | | ' <input type="checkbox" value="0" id="allCaps" />' + |
| 390 | | ' <label for="allCaps" id="label_allCaps"></label>' + |
| 391 | | ' </div>' + |
| 392 | | ' <div style="display:none;">' + |
| 393 | | ' <input type="checkbox" value="0" id="ignoreDomainNames" />' + |
| 394 | | ' <label for="ignoreDomainNames" id="label_ignoreDomainNames"></label>' + |
| 395 | | ' </div>' + |
| 396 | | ' <div style="display:none;">' + |
| 397 | | ' <input type="checkbox" value="0" id="mixedCase" />' + |
| 398 | | ' <label for="mixedCase" id="label_mixedCase"></label>' + |
| 399 | | ' </div>' + |
| 400 | | ' <div style="display:none;">' + |
| 401 | | ' <input type="checkbox" value="0" id="mixedWithDigits" />' + |
| 402 | | ' <label for="mixedWithDigits" id="label_mixedWithDigits"></label>' + |
| 403 | | ' </div>' + |
| 404 | | '</div>' |
| 405 | | } |
| 406 | | ] |
| 407 | | }, |
| 408 | | { |
| 409 | | id : 'langs', |
| 410 | | label : editor.lang.scayt.languagesTab, |
| 411 | | elements : [ |
| 412 | | { |
| 413 | | type : 'html', |
| 414 | | id : 'langs', |
| 415 | | html : '<div class="inner_langs">' + |
| 416 | | ' <div class="messagebox"></div> ' + |
| 417 | | ' <div style="float:left;width:47%;margin-left:5px;" id="scayt_lcol" ></div>' + |
| 418 | | ' <div style="float:left;width:47%;margin-left:15px;" id="scayt_rcol"></div>' + |
| 419 | | '</div>' |
| 420 | | } |
| 421 | | ] |
| 422 | | }, |
| 423 | | { |
| 424 | | id : 'dictionaries', |
| 425 | | label : editor.lang.scayt.dictionariesTab, |
| 426 | | elements : [ |
| 427 | | { |
| 428 | | type : 'html', |
| 429 | | style: '', |
| 430 | | id : 'dic', |
| 431 | | html : '<div class="inner_dictionary" style="text-align:left; white-space:normal;">' + |
| 432 | | ' <div style="margin:5px auto; width:80%;white-space:normal; overflow:hidden;" id="dic_message"> </div>' + |
| 433 | | ' <div style="margin:5px auto; width:80%;white-space:normal;"> ' + |
| 434 | | ' <span class="cke_dialog_ui_labeled_label" >Dictionary name</span><br>'+ |
| 435 | | ' <span class="cke_dialog_ui_labeled_content" >'+ |
| 436 | | ' <div class="cke_dialog_ui_input_text">'+ |
| 437 | | ' <input id="dic_name" type="text" class="cke_dialog_ui_input_text"/>'+ |
| 438 | | ' </div></span></div>'+ |
| 439 | | ' <div style="margin:5px auto; width:80%;white-space:normal;">'+ |
| 440 | | ' <a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_create">'+ |
| 441 | | ' </a>' + |
| 442 | | ' <a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_delete">'+ |
| 443 | | ' </a>' + |
| 444 | | ' <a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_rename">'+ |
| 445 | | ' </a>' + |
| 446 | | ' <a style="display:none;" class="cke_dialog_ui_button" href="javascript:void(0)" id="dic_restore">'+ |
| 447 | | ' </a>' + |
| 448 | | ' </div>' + |
| 449 | | ' <div style="margin:5px auto; width:95%;white-space:normal;" id="dic_info"></div>' + |
| 450 | | '</div>' |
| 451 | | } |
| 452 | | ] |
| 453 | | }, |
| 454 | | { |
| 455 | | id : 'about', |
| 456 | | label : editor.lang.scayt.aboutTab, |
| 457 | | elements : [ |
| 458 | | { |
| 459 | | type : 'html', |
| 460 | | id : 'about', |
| 461 | | style : 'margin: 10px 40px;', |
| 462 | | html : '<div id="scayt_about"></div>' |
| 463 | | } |
| 464 | | ] |
| 465 | | } |
| 466 | | ] |
| 467 | | }; |
| | 491 | return _return; |