Changeset 4be86f3 in github
- Timestamp:
- Mar 9, 2012 8:23:24 AM (15 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
- Children:
- 8d67c7b
- Parents:
- 84d6e27
- Files:
-
- 14 edited
-
CHANGELOG (modified) (1 diff)
-
program/js/app.js (modified) (8 diffs)
-
program/js/editor.js (modified) (2 diffs)
-
program/steps/mail/compose.inc (modified) (2 diffs)
-
skins/default/common.css (modified) (3 diffs)
-
skins/default/functions.js (modified) (2 diffs)
-
skins/default/images/messageicons.gif (modified) (previous)
-
skins/default/images/messageicons.png (modified) (previous)
-
skins/default/mail.css (modified) (1 diff)
-
skins/default/templates/compose.html (modified) (4 diffs)
-
skins/larry/mail.css (modified) (2 diffs)
-
skins/larry/styles.css (modified) (2 diffs)
-
skins/larry/templates/compose.html (modified) (4 diffs)
-
skins/larry/ui.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rfe3a1d6 r4be86f3 2 2 =========================== 3 3 4 - Unified (single) spellchecker button 4 5 - Fix encoding of attachment with comma in name (#1488389) 5 6 - Scroll long lists on drag&drop (#1485946) -
program/js/app.js
r54dfd15 r4be86f3 262 262 263 263 if (this.env.spellcheck) { 264 this.env.spellcheck.spelling_state_observer = function(s) { ref.set_spellcheck_state(s); };264 this.env.spellcheck.spelling_state_observer = function(s) { ref.spellcheck_state(); }; 265 265 this.env.compose_commands.push('spellcheck') 266 this.set_spellcheck_state('ready'); 267 if ($("input[name='_is_html']").val() == '1') 268 this.display_spellcheck_controls(false); 266 this.enable_command('spellcheck', true); 269 267 } 270 268 … … 899 897 900 898 case 'spellcheck': 901 if (window.tinyMCE && tinyMCE.get(this.env.composebody)) { 902 tinyMCE.execCommand('mceSpellCheck', true); 903 } 904 else if (this.env.spellcheck && this.env.spellcheck.spellCheck && this.spellcheck_ready) { 905 this.env.spellcheck.spellCheck(); 906 this.set_spellcheck_state('checking'); 907 } 899 if (this.spellcheck_state()) { 900 this.stop_spellchecking(); 901 } 902 else { 903 if (window.tinyMCE && tinyMCE.get(this.env.composebody)) { 904 tinyMCE.execCommand('mceSpellCheck', true); 905 } 906 else if (this.env.spellcheck && this.env.spellcheck.spellCheck) { 907 this.env.spellcheck.spellCheck(); 908 } 909 } 910 this.spellcheck_state(); 908 911 break; 909 912 … … 3117 3120 this.toggle_editor = function(props) 3118 3121 { 3122 this.stop_spellchecking(); 3123 3119 3124 if (props.mode == 'html') { 3120 this.display_spellcheck_controls(false);3121 3125 this.plain2html($('#'+props.id).val(), props.id); 3122 3126 tinyMCE.execCommand('mceAddControl', false, props.id); … … 3129 3133 else { 3130 3134 var thisMCE = tinyMCE.get(props.id), existingHtml; 3131 if (thisMCE.plugins.spellchecker && thisMCE.plugins.spellchecker.active)3132 thisMCE.execCommand('mceSpellCheck', false);3133 3135 3134 3136 if (existingHtml = thisMCE.getContent()) { … … 3139 3141 } 3140 3142 tinyMCE.execCommand('mceRemoveControl', false, props.id); 3141 this.display_spellcheck_controls(true);3142 3143 } 3143 3144 … … 3148 3149 { 3149 3150 var ed; 3151 3150 3152 if (window.tinyMCE && (ed = tinyMCE.get(this.env.composebody))) { 3151 3153 if (ed.plugins.spellchecker && ed.plugins.spellchecker.active) 3152 3154 ed.execCommand('mceSpellCheck'); 3153 3155 } 3154 else if ((ed = this.env.spellcheck) && !this.spellcheck_ready) { 3155 $(ed.spell_span).trigger('click'); 3156 this.set_spellcheck_state('ready'); 3157 } 3158 }; 3159 3160 this.display_spellcheck_controls = function(vis) 3161 { 3162 if (this.env.spellcheck) { 3163 // stop spellchecking process 3164 if (!vis) 3165 this.stop_spellchecking(); 3166 3167 $(this.env.spellcheck.spell_container)[vis ? 'show' : 'hide'](); 3168 } 3169 }; 3170 3171 this.set_spellcheck_state = function(s) 3172 { 3173 this.spellcheck_ready = (s == 'ready' || s == 'no_error_found'); 3174 this.enable_command('spellcheck', this.spellcheck_ready); 3156 else if (ed = this.env.spellcheck) { 3157 if (ed.state && ed.state != 'ready' && ed.state != 'no_error_found') 3158 $(ed.spell_span).trigger('click'); 3159 } 3160 3161 this.spellcheck_state(); 3162 }; 3163 3164 this.spellcheck_state = function() 3165 { 3166 var ed, active; 3167 3168 if (window.tinyMCE && (ed = tinyMCE.get(this.env.composebody)) && ed.plugins.spellchecker) 3169 active = ed.plugins.spellchecker.active; 3170 else if ((ed = this.env.spellcheck) && ed.state) 3171 active = ed.state != 'ready' && ed.state != 'no_error_found'; 3172 3173 $('#'+rcmail.buttons.spellcheck[0].id)[active ? 'addClass' : 'removeClass']('selected'); 3174 3175 return active; 3175 3176 }; 3176 3177 … … 3179 3180 { 3180 3181 var ed; 3181 if (window.tinyMCE && (ed = tinyMCE.get(this.env.composebody)) && ed.plugins.spellchecker) { 3182 3183 if (window.tinyMCE && (ed = tinyMCE.get(this.env.composebody)) && ed.plugins.spellchecker) 3182 3184 return ed.plugins.spellchecker.selectedLang; 3183 } 3184 else if (this.env.spellcheck) { 3185 else if (this.env.spellcheck) 3185 3186 return GOOGIE_CUR_LANG; 3186 } 3187 }; 3188 3189 this.spellcheck_lang_set = function(lang) 3190 { 3191 var editor; 3192 3193 if (window.tinyMCE && (editor = tinyMCE.get(this.env.composebody))) 3194 editor.plugins.spellchecker.selectedLang = lang; 3195 else if (this.env.spellcheck) 3196 this.env.spellcheck.setCurrentLanguage(lang); 3187 3197 }; 3188 3198 … … 3203 3213 sp.processData(data); 3204 3214 } 3215 3216 this.spellcheck_state(); 3205 3217 } 3206 3218 -
program/js/editor.js
r7fe3811 r4be86f3 45 45 theme_advanced_buttons2: ',fontselect,fontsizeselect' 46 46 }); 47 else // mail compose47 else { // mail compose 48 48 $.extend(conf, { 49 49 plugins: 'paste,emotions,media,nonbreaking,table,searchreplace,visualchars,directionality,tabfocus' + (config.spellcheck ? ',spellchecker' : ''), 50 50 theme_advanced_buttons1: 'bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,outdent,indent,ltr,rtl,blockquote,|,forecolor,backcolor,fontselect,fontsizeselect', 51 theme_advanced_buttons2: 'link,unlink,table,|,emotions,charmap,image,media,|,code,search ' + (config.spellcheck ? ',spellchecker' : '') + ',undo,redo',51 theme_advanced_buttons2: 'link,unlink,table,|,emotions,charmap,image,media,|,code,search,undo,redo', 52 52 spellchecker_languages: (rcmail.env.spellcheck_langs ? rcmail.env.spellcheck_langs : 'Dansk=da,Deutsch=de,+English=en,Espanol=es,Francais=fr,Italiano=it,Nederlands=nl,Polski=pl,Portugues=pt,Suomi=fi,Svenska=sv'), 53 53 spellchecker_rpc_url: '?_task=utils&_action=spell_html', … … 56 56 oninit: 'rcmail_editor_callback' 57 57 }); 58 59 // add handler for spellcheck button state update 60 conf.setup = function(ed) { 61 ed.onSetProgressState.add(function(ed, active) { 62 if (!active) 63 rcmail.spellcheck_state(); 64 }); 65 } 66 } 58 67 59 68 // support external configuration settings e.g. from skin -
program/steps/mail/compose.inc
r6357223 r4be86f3 814 814 $lang = 'en'; 815 815 816 $OUTPUT->set_env('spell_langs', $spellcheck_langs); 817 $OUTPUT->set_env('spell_lang', $lang); 818 816 819 $editor_lang_set = array(); 817 820 foreach ($spellcheck_langs as $key => $name) { … … 831 834 "googie.setLanguages(%s);\n". 832 835 "googie.setCurrentLanguage('%s');\n". 833 "googie.set SpellContainer('spellcheck-control');\n".836 "googie.setDecoration(false);\n". 834 837 "googie.decorateTextarea('%s');\n". 835 838 "%s.set_env('spellcheck', googie);", -
skins/default/common.css
r3cbdbd9 r4be86f3 496 496 text-decoration: none; 497 497 min-height: 14px; 498 background: transparent; 498 499 } 499 500 … … 505 506 } 506 507 507 .popupmenu li a.active:hover 508 .popupmenu li a.active:hover, 509 .popupmenu.selectable li a.selected:hover 508 510 { 509 511 color: #fff; … … 514 516 { 515 517 float: left; 518 } 519 520 .popupmenu.selectable li a.selected 521 { 522 background: url(images/messageicons.png) 2px -372px no-repeat; 523 } 524 525 .popupmenu.selectable li a 526 { 527 padding-left: 20px; 516 528 } 517 529 -
skins/default/functions.js
re97f010 r4be86f3 103 103 mailboxmenu: {id:'mailboxoptionsmenu', above:1}, 104 104 composemenu: {id:'composeoptionsmenu', editable:1, overlap:1}, 105 spellmenu: {id:'spellmenu'}, 105 106 // toggle: #1486823, #1486930 106 107 uploadmenu: {id:'attachment-form', editable:1, above:1, toggle:!bw.ie&&!bw.linux }, … … 352 353 }, 353 354 355 spellmenu: function(show) 356 { 357 var link, li, 358 lang = rcmail.spellcheck_lang(), 359 menu = this.popups.spellmenu.obj, 360 ul = $('ul', menu); 361 362 if (!ul.length) { 363 ul = $('<ul>'); 364 365 for (i in rcmail.env.spell_langs) { 366 li = $('<li>'); 367 link = $('<a href="#">').text(rcmail.env.spell_langs[i]) 368 .addClass('active').data('lang', i) 369 .click(function() { 370 rcmail.spellcheck_lang_set($(this).data('lang')); 371 }); 372 373 link.appendTo(li); 374 li.appendTo(ul); 375 } 376 377 ul.appendTo(menu); 378 } 379 380 // select current language 381 $('li', ul).each(function() { 382 var el = $('a', this); 383 if (el.data('lang') == lang) 384 el.addClass('selected'); 385 else if (el.hasClass('selected')) 386 el.removeClass('selected'); 387 }); 388 389 this.show_popupmenu('spellmenu', show); 390 }, 391 354 392 body_mouseup: function(evt, p) 355 393 { -
skins/default/mail.css
raa2013b r4be86f3 37 37 #messagetoolbar a.buttonPas { 38 38 opacity: 0.35; 39 } 40 41 #messagetoolbar a.button.selected { 42 background-color: #ddd; 43 margin-left: 4px; 44 margin-right: 4px; 45 margin-top: -1px; 46 border: 1px solid #ccc; 47 border-radius: 3px; 48 -moz-border-radius: 3px; 49 -webkit-border-radius: 3px; 39 50 } 40 51 -
skins/default/templates/compose.html
r1de8f4e r4be86f3 4 4 <title><roundcube:object name="productname" /> :: <roundcube:label name="compose" /></title> 5 5 <roundcube:include file="/includes/links.html" /> 6 <roundcube:if condition="config:enable_spellcheck" /> 6 7 <link rel="stylesheet" type="text/css" href="/googiespell.css" /> 8 <roundcube:endif /> 7 9 <script type="text/javascript" src="/functions.js"></script> 8 10 <script type="text/javascript" src="/splitter.js"></script> … … 24 26 <roundcube:button command="list" type="link" class="button back" classAct="button back" classSel="button backSel" title="backtolist" content=" " /> 25 27 <roundcube:button command="send" type="link" class="buttonPas send" classAct="button send" classSel="button sendSel" title="sendmessage" content=" " /> 26 <roundcube:button command="spellcheck" type="link" class="buttonPas spellcheck" classAct="button spellcheck" classSel="button spellcheckSel" title="checkspelling" content=" " /> 28 <roundcube:if condition="config:enable_spellcheck" /> 29 <span class="dropbutton"> 30 <roundcube:button command="spellcheck" type="link" class="buttonPas spellcheck" classAct="button spellcheck" classSel="button spellcheckSel" title="checkspelling" content=" " /> 31 <span id="spellmenulink" onclick="rcmail_ui.show_popup('spellmenu');return false"></span> 32 </span> 33 <roundcube:endif /> 27 34 <roundcube:button name="addattachment" type="link" class="button attach" classAct="button attach" classSel="button attachSel" title="addattachment" onclick="rcmail_ui.show_popup('uploadmenu', true);return false" content=" " /> 28 35 <roundcube:button command="insert-sig" type="link" class="buttonPas insertsig" classAct="button insertsig" classSel="button insertsigSel" title="insertsignature" content=" " /> … … 112 119 </div> 113 120 <div id="compose-editorfooter"> 114 <span id="spellcheck-control" style="margin-right:10px"></span>115 121 <roundcube:if condition="!in_array('htmleditor', (array)config:dont_override)" /> 116 122 <span> … … 144 150 </div> 145 151 152 <div id="spellmenu" class="popupmenu selectable"></div> 153 146 154 </form> 147 155 -
skins/larry/mail.css
refaf2e0 r4be86f3 1167 1167 #composebody { 1168 1168 position: absolute; 1169 top: 24px;1169 top: 1px; 1170 1170 left: 0; 1171 1171 bottom: 0; 1172 1172 width: 99%; 1173 1173 border: 0; 1174 border-radius: 0; 1174 1175 padding: 8px 0 8px 8px; 1175 1176 box-shadow: none; … … 1196 1197 } 1197 1198 1198 #spellcheck-control {1199 margin: 6px 8px;1200 text-align: right;1201 }1202 1203 1199 .defaultSkin table.mceLayout, 1204 1200 .defaultSkin table.mceLayout tr.mceLast td { -
skins/larry/styles.css
ra1f855e r4be86f3 1391 1391 1392 1392 .toolbar a.button.spellcheck { 1393 background-position: center -930px; 1393 min-width: 64px; 1394 background-position: left -930px; 1394 1395 } 1395 1396 … … 1575 1576 } 1576 1577 1577 ul.toolbarmenu.iconized li a { 1578 ul.toolbarmenu.iconized li a, 1579 ul.toolbarmenu.selectable li a { 1578 1580 padding-left: 30px; 1581 } 1582 1583 ul.toolbarmenu.selectable li a.selected { 1584 background: url(images/messages.png) 4px -27px no-repeat; 1579 1585 } 1580 1586 -
skins/larry/templates/compose.html
r6357223 r4be86f3 4 4 <title><roundcube:object name="pagetitle" /></title> 5 5 <roundcube:include file="/includes/links.html" /> 6 <roundcube:if condition="config:enable_spellcheck" /> 6 7 <link rel="stylesheet" type="text/css" href="/googiespell.css" /> 8 <roundcube:endif /> 7 9 </head> 8 10 <body class="noscroll"> … … 39 41 <div id="messagetoolbar" class="fullwidth"> 40 42 <div id="mailtoolbar" class="toolbar"> 41 <roundcube:button command="spellcheck" type="link" class="button spellcheck disabled" classAct="button spellcheck" classSel="button spellcheck pressed" label="spellcheck" title="checkspelling" /> 43 <roundcube:if condition="config:enable_spellcheck" /> 44 <span class="dropbutton"> 45 <roundcube:button command="spellcheck" type="link" class="button spellcheck disabled" classAct="button spellcheck" classSel="button spellcheck pressed" label="spellcheck" title="checkspelling" /> 46 <span class="dropbuttontip" id="spellmenulink" onclick="UI.show_popup('spellmenu');return false"></span> 47 </span> 48 <roundcube:endif /> 42 49 <roundcube:button name="addattachment" type="link" class="button attach" classAct="button attach" classSel="button attach pressed" label="attach" title="addattachment" onclick="UI.show_uploadform();return false" /> 43 50 <roundcube:button command="insert-sig" type="link" class="button insertsig disabled" classAct="button insertsig" classSel="button insertsig pressed" label="signature" title="insertsignature" /> … … 143 150 <div id="composeview-bottom"> 144 151 <div id="composebodycontainer"> 145 <div id="spellcheck-control"></div>146 152 <roundcube:object name="composeBody" id="composebody" form="form" cols="70" rows="20" tabindex="9" /> 147 153 </div> … … 172 178 </div> 173 179 180 <div id="spellmenu" class="popupmenu"></div> 181 174 182 <roundcube:include file="/includes/footer.html" /> 175 183 -
skins/larry/ui.js
refaf2e0 r4be86f3 25 25 mailboxmenu: { above:1 }, 26 26 composeoptionsmenu: { editable:1, overlap:1 }, 27 spellmenu: { callback: spellmenu }, 27 28 // toggle: #1486823, #1486930 28 29 'attachment-form': { editable:1, above:1, toggle:!bw.ie&&!bw.linux }, … … 339 340 bottom.css('height', (form.height() - bottom.position().top) + 'px'); 340 341 341 w = body.parent().width() - 6;342 h = body.parent().height() - 36;342 w = body.parent().width() - 5; 343 h = body.parent().height() - 16; 343 344 body.width(w).height(h); 344 345 345 346 if (window.tinyMCE && tinyMCE.get('composebody')) { 346 $('#composebody_tbl').width((w+ 10)+'px').height('').css('margin-top', '1px');347 $('#composebody_ifr').width((w+ 10)+'px').height((h-22)+'px');347 $('#composebody_tbl').width((w+8)+'px').height('').css('margin-top', '1px'); 348 $('#composebody_ifr').width((w+8)+'px').height((h-40)+'px'); 348 349 } 349 350 else { … … 426 427 $('select', obj).css('visibility', 'inherit'); 427 428 } 428 429 429 430 return show; 430 431 } … … 552 553 } 553 554 } 555 } 556 557 558 function spellmenu(show) 559 { 560 var link, li, 561 lang = rcmail.spellcheck_lang(), 562 menu = popups.spellmenu, 563 ul = $('ul', menu); 564 565 if (!ul.length) { 566 ul = $('<ul class="toolbarmenu selectable">'); 567 568 for (i in rcmail.env.spell_langs) { 569 li = $('<li>'); 570 link = $('<a href="#">').text(rcmail.env.spell_langs[i]) 571 .addClass('active').data('lang', i) 572 .click(function() { 573 rcmail.spellcheck_lang_set($(this).data('lang')); 574 }); 575 576 link.appendTo(li); 577 li.appendTo(ul); 578 } 579 580 ul.appendTo(menu); 581 } 582 583 // select current language 584 $('li', ul).each(function() { 585 var el = $('a', this); 586 if (el.data('lang') == lang) 587 el.addClass('selected'); 588 else if (el.hasClass('selected')) 589 el.removeClass('selected'); 590 }); 554 591 } 555 592
Note: See TracChangeset
for help on using the changeset viewer.
