From 10b85656d5a4ff1dd69ef2cac461e77c84a47517 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 15 Jun 2018 10:43:44 +0200 Subject: [PATCH 1/8] Add fake argument to TinyMCE languages download URL to force .zip extension --- jsdeps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsdeps.json b/jsdeps.json index bf8770b5c..6b62c4a66 100644 --- a/jsdeps.json +++ b/jsdeps.json @@ -57,7 +57,7 @@ { "lib": "tinymce-langs", "version": "4.7.13", - "url": "https://tinymce-services.azurewebsites.net/1/i18n/download?langs=ar,hy,az,eu,be,bs,bg_BG,ca,zh_CN,zh_TW,hr,cs,cs_CZ,da,nl,en_CA,en_GB,eo,et,fo,fi,fr_FR,fr_CH,gd,gl,ka_GE,de,de_AT,el,he_IL,hi_IN,hu_HU,is_IS,id,ga,it,ja,kab,km_KH,ko_KR,ku,ku_IQ,lv,lt,lb,mk_MK,ml_IN,nb_NO,oc,fa,fa_IR,pl,pt_BR,pt_PT,ro,ru,sk,sl_SI,es,es_MX,sv_SE,tg,ta,ta_IN,tt,th_TH,tr,tr_TR,ug,uk,uk_UA,vi,vi_VN,cy", + "url": "https://tinymce-services.azurewebsites.net/1/i18n/download?langs=ar,hy,az,eu,be,bs,bg_BG,ca,zh_CN,zh_TW,hr,cs,cs_CZ,da,nl,en_CA,en_GB,eo,et,fo,fi,fr_FR,fr_CH,gd,gl,ka_GE,de,de_AT,el,he_IL,hi_IN,hu_HU,is_IS,id,ga,it,ja,kab,km_KH,ko_KR,ku,ku_IQ,lv,lt,lb,mk_MK,ml_IN,nb_NO,oc,fa,fa_IR,pl,pt_BR,pt_PT,ro,ru,sk,sl_SI,es,es_MX,sv_SE,tg,ta,ta_IN,tt,th_TH,tr,tr_TR,ug,uk,uk_UA,vi,vi_VN,cy&extension=.zip", "dest": "program/js/tinymce" }, { From 338486348e79c828864390a763fff42508bbfd13 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 18 Jun 2018 09:31:23 +0200 Subject: [PATCH 2/8] Fix adding uploaded images to image selector list --- program/js/editor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/program/js/editor.js b/program/js/editor.js index ba01ba5f3..41316ba8f 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -671,6 +671,8 @@ function rcube_text_editor(config, id) if (!form.length) form = this.file_upload_form(rcmail.gui_objects.uploadform); + else + form.find('button,a.button').slice(1).remove(); // need only the first button button = dialog.prepend(form).find('button,a.button') .text(rcmail.get_label('add' + type)) @@ -745,8 +747,8 @@ function rcube_text_editor(config, id) } // register handler for successful file upload - if (!rcmail.env.file_dialog_event) { - rcmail.env.file_dialog_event = true; + if (!rcmail.env['file_dialog_event_' + type]) { + rcmail.env['file_dialog_event+' + type] = true; rcmail.addEventListener('fileuploaded', function(attr) { var elem; if (elem = ref.file_browser_entry(attr.name, attr.attachment)) { From c826fd502df73cb3effa85a339b9facc6a0b68ae Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 18 Jun 2018 13:38:09 +0200 Subject: [PATCH 3/8] Fix focus on the editor when switching modes --- program/js/editor.js | 86 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/program/js/editor.js b/program/js/editor.js index 41316ba8f..09b3de1d5 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -169,47 +169,46 @@ function rcube_text_editor(config, id) rcmail.triggerEvent('editor-load', {config: conf, ref: ref}); - if (rcmail.env.action != 'compose') { - return; - } - - var area = $('#' + this.id), - height = $('div.mce-toolbar-grp:first', area.parent()).height(); - - // the editor might be still not fully loaded, making the editing area - // inaccessible, wait and try again (#1490310) - if (height > 200 || height > area.height()) { - return setTimeout(function () { ref.init_callback(event); }, 300); - } + if (rcmail.env.action == 'compose') { + var area = $('#' + this.id), + height = $('div.mce-toolbar-grp:first', area.parent()).height(); + + // the editor might be still not fully loaded, making the editing area + // inaccessible, wait and try again (#1490310) + if (height > 200 || height > area.height()) { + return setTimeout(function () { ref.init_callback(event); }, 300); + } - var css = {}, - elem = rcube_find_object('_from'), - fe = rcmail.env.compose_focus_elem; + var css = {}, + elem = rcube_find_object('_from'), + fe = rcmail.env.compose_focus_elem; - if (rcmail.env.default_font) - css['font-family'] = rcmail.env.default_font; + if (rcmail.env.default_font) + css['font-family'] = rcmail.env.default_font; - if (rcmail.env.default_font_size) - css['font-size'] = rcmail.env.default_font_size; + if (rcmail.env.default_font_size) + css['font-size'] = rcmail.env.default_font_size; - if (css['font-family'] || css['font-size']) - $(this.editor.getBody()).css(css); + if (css['font-family'] || css['font-size']) + $(this.editor.getBody()).css(css); - if (elem && elem.type == 'select-one') { - // insert signature (only for the first time) - if (!rcmail.env.identities_initialized) - rcmail.change_identity(elem); + if (elem && elem.type == 'select-one') { + // insert signature (only for the first time) + if (!rcmail.env.identities_initialized) + rcmail.change_identity(elem); - // Focus previously focused element - if (fe && fe.id != this.id && fe.nodeName != 'BODY') { - window.focus(); // for WebKit (#1486674) - fe.focus(); - rcmail.env.compose_focus_elem = null; + // Focus previously focused element + if (fe && fe.id != this.id && fe.nodeName != 'BODY') { + window.focus(); // for WebKit (#1486674) + fe.focus(); + rcmail.env.compose_focus_elem = null; + } } } // set tabIndex and set focus to element that was focused before - ref.tabindex(fe && fe.id == ref.id); + ref.tabindex(ref.force_focus || (fe && fe.id == ref.id)); + // Trigger resize (needed for proper editor resizing in some browsers) $(window).resize(); }; @@ -219,7 +218,6 @@ function rcube_text_editor(config, id) { if (rcmail.env.task == 'mail' && this.editor) { var textarea = this.editor.getElement(), - body = this.editor.getBody(), node = this.editor.getContentAreaContainer().childNodes[0]; if (textarea && node) @@ -245,11 +243,18 @@ function rcube_text_editor(config, id) // ContentEditable reset fixes invisible cursor issue in Firefox < 25 if (bw.mz && bw.vendver < 25) - $(body).prop('contenteditable', false).prop('contenteditable', true); - - if (focus) - body.focus(); + $(this.editor.getBody()).prop('contenteditable', false).prop('contenteditable', true); } + + if (focus) + this.focus(); + }; + + // focus the editor + this.focus = function() + { + $(this.editor || ('#' + this.id)).focus(); + this.force_focus = false; }; // switch html/plain mode @@ -280,16 +285,9 @@ function rcube_text_editor(config, id) if (is_sig) data = data.replace(sig_mark, '
' + signature.html + '
'); + ref.force_focus = true; input.val(data); tinymce.execCommand('mceAddEditor', false, ref.id); - - if (ref.editor) { - var body = $(ref.editor.getBody()); - // #1486593 - ref.tabindex(true); - // put cursor on start of the compose body - ref.editor.selection.setCursorLocation(body.children().first().get(0)); - } }; // convert to html From 4224ccdaa99679ae95033f67daa10debaec1ed05 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 18 Jun 2018 13:47:16 +0200 Subject: [PATCH 4/8] Elastic: Add some .keylist style --- skins/elastic/styles/widgets/lists.less | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/skins/elastic/styles/widgets/lists.less b/skins/elastic/styles/widgets/lists.less index 3f3ae0719..fda3724d9 100644 --- a/skins/elastic/styles/widgets/lists.less +++ b/skins/elastic/styles/widgets/lists.less @@ -925,6 +925,21 @@ html.touch { } } +.keylist { + padding: 0; + list-style: none; + + li { + line-height: 2; + + &:before { + &:extend(.font-icon-class); + content: @fa-var-key; + line-height: 1.5; + } + } +} + #identities-table { td.mail:before { &:extend(.font-icon-class); From 4ea790ba37ee556db383a7ee48bfac182b2487a7 Mon Sep 17 00:00:00 2001 From: johndoh Date: Tue, 19 Jun 2018 10:26:57 +0100 Subject: [PATCH 5/8] Extend skin_logo allowing per skin logos (#6273) --- config/defaults.inc.php | 10 ++- program/include/rcmail_output_html.php | 85 +++++++++++++++++--- skins/classic/includes/links.html | 2 +- skins/classic/templates/contactprint.html | 4 +- skins/classic/templates/messageprint.html | 4 +- skins/elastic/styles/widgets/taskmenu.less | 2 +- skins/elastic/templates/contactprint.html | 2 + skins/elastic/templates/includes/layout.html | 2 +- skins/elastic/templates/includes/menu.html | 2 +- skins/elastic/templates/messageprint.html | 2 + skins/elastic/ui.js | 16 ++++ skins/larry/includes/links.html | 2 +- skins/larry/templates/contactprint.html | 4 +- skins/larry/templates/messageprint.html | 4 +- 14 files changed, 115 insertions(+), 26 deletions(-) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index 76d87cb74..aa337615c 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -379,8 +379,14 @@ $config['support_url'] = ''; // replace Roundcube logo with this image // specify an URL relative to the document root of this Roundcube installation -// an array can be used to specify different logos for specific template files, '*' for default logo -// for example array("*" => "/images/roundcube_logo.png", "messageprint" => "/images/roundcube_logo_print.png") +// an array can be used to specify different logos for specific template files +// '*' for default logo +// ':favicon' for favicon +// ':print' for logo on all print templates (e.g. messageprint, contactprint) +// ':small' for small screen logo in Elastic +// different logos can be specified for different skins by prefixing the skin name to the array key +// config applied in order: :