From a626ca471d54b82f1292b00f7fea0c551118fc01 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Tue, 26 May 2020 22:28:35 +0300 Subject: [PATCH 1/6] [mobile] Fix bug 45445 --- .../mobile/lib/controller/Collaboration.js | 14 ++++----- apps/common/mobile/lib/view/Collaboration.js | 28 +++++++++--------- .../resources/less/ios/_collaboration.less | 8 ++--- .../less/material/_collaboration.less | 7 ++--- .../mobile/app/controller/add/AddOther.js | 2 +- .../mobile/resources/css/app-ios.css | 29 ++++++++++++------- .../mobile/resources/css/app-material.css | 29 ++++++++++++------- .../mobile/app/controller/add/AddOther.js | 2 +- .../mobile/resources/css/app-ios.css | 29 ++++++++++++------- .../mobile/resources/css/app-material.css | 29 ++++++++++++------- .../mobile/app/controller/add/AddOther.js | 2 +- .../mobile/resources/css/app-ios.css | 29 ++++++++++++------- .../mobile/resources/css/app-material.css | 29 ++++++++++++------- 13 files changed, 139 insertions(+), 98 deletions(-) diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index b46a244209..38b3d352bf 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -1046,7 +1046,7 @@ define([ onDoneAddNewReply: function(uid) { var phone = Common.SharedSettings.get('phone'); - var reply = $('.reply-textarea')[0].value; + var reply = $('.reply-textarea')[0].value.trim(); if ($('.container-view-comment').length > 0) { var $viewComment = $('.container-view-comment'); if (reply && reply.length > 0) { @@ -1282,8 +1282,8 @@ define([ me.disabledViewComments(true); if ($('.comment-textarea').length === 0) { var $viewComment = $('.container-view-comment'); - var oldComment = $viewComment.find('.comment-text span').text(); - $viewComment.find('.comment-text span').css('display', 'none'); + var oldComment = $viewComment.find('.comment-text pre').text(); + $viewComment.find('.comment-text pre').css('display', 'none'); var template = _.template(''); $viewComment.find('.comment-text').append(template); $viewComment.find('a.prev-comment, a.next-comment, a.add-reply').css('display', 'none'); @@ -1308,7 +1308,7 @@ define([ }, onEditComment: function(comment) { - var value = $('#comment-text')[0].value; + var value = $('#comment-text')[0].value.trim(); if (value && value.length > 0) { if (!_.isUndefined(this.onChangeComment)) { comment.comment = value; @@ -1323,7 +1323,7 @@ define([ $viewComment.find('a.prev-comment, a.next-comment, a.add-reply').css('display', 'flex'); if ($viewComment.find('.comment-textarea').length > 0) { $viewComment.find('.comment-textarea').remove(); - $viewComment.find('.comment-text span').css('display', 'block'); + $viewComment.find('.comment-text pre').css('display', 'block'); } } this.disabledViewComments(false); @@ -1336,7 +1336,7 @@ define([ onCancelEditComment: function() { var $viewComment = $('.container-view-comment'); $viewComment.find('a.done-edit-comment, a.cancel-edit-comment, .comment-textarea').remove(); - $viewComment.find('.comment-text span').css('display', 'block'); + $viewComment.find('.comment-text pre').css('display', 'block'); $viewComment.find('a.prev-comment, a.next-comment, a.add-reply').css('display', 'flex'); this.disabledViewComments(false); }, @@ -1388,7 +1388,7 @@ define([ }, onEditReply: function(comment, indReply) { - var value = $('.edit-reply-textarea')[0].value; + var value = $('.edit-reply-textarea')[0].value.trim(); if (value && value.length > 0) { if ($('.container-view-comment').length > 0) { if (!_.isUndefined(this.onChangeComment)) { diff --git a/apps/common/mobile/lib/view/Collaboration.js b/apps/common/mobile/lib/view/Collaboration.js index aa9ebb472c..9a90b9cc44 100644 --- a/apps/common/mobile/lib/view/Collaboration.js +++ b/apps/common/mobile/lib/view/Collaboration.js @@ -177,8 +177,8 @@ define([ if (isAndroid) { template += '
' + comment.userInitials + '
'; } - template += '

' + comment.username + '

' + - '

' + comment.date + '

'; + template += '
' + comment.username + '
' + + '
' + comment.date + '
'; if (isAndroid) { template += '
'; } @@ -191,8 +191,8 @@ define([ } template += ''; - if (comment.quote) template += '

' + me.sliceQuote(comment.quote) + '

'; - template += '
' + comment.comment + '
'; + if (comment.quote) template += '
' + me.sliceQuote(comment.quote) + '
'; + template += '
' + comment.comment + '
'; if (comment.replys.length > 0) { template += '' @@ -249,8 +249,8 @@ define([ '
', '
', '<% if (android) { %>
<%= item.userInitials %>
<% } %>', - '

<%= item.username %>

', - '

<%= item.date %>

', + '
<%= item.username %>
', + '
<%= item.date %>
', '<% if (android) { %>
<% } %>', '
', '<% if (item.editable && !viewmode) { %>', @@ -261,9 +261,9 @@ define([ '<% } %>', '
', '<% if(item.quote) {%>', - '

<%= quote %>

', + '
<%= quote %>
', '<% } %>', - '

<%= item.comment %>

', + '
<%= item.comment %>
', '<% if(replys > 0) {%>', '', diff --git a/apps/common/mobile/resources/less/ios/_collaboration.less b/apps/common/mobile/resources/less/ios/_collaboration.less index 919c94f6a5..d958e12f4b 100644 --- a/apps/common/mobile/resources/less/ios/_collaboration.less +++ b/apps/common/mobile/resources/less/ios/_collaboration.less @@ -145,10 +145,7 @@ padding: 16px 0; word-wrap: break-word; } - p { - margin: 0; - word-break: break-word; - } + .list-reply { padding-left: 26px; } @@ -176,6 +173,9 @@ margin: 0; max-width: 100%; padding-right: 15px; + pre { + white-space: pre-wrap; + } } .reply-item { margin-top: 15px; diff --git a/apps/common/mobile/resources/less/material/_collaboration.less b/apps/common/mobile/resources/less/material/_collaboration.less index a7439c97f7..6889d18065 100644 --- a/apps/common/mobile/resources/less/material/_collaboration.less +++ b/apps/common/mobile/resources/less/material/_collaboration.less @@ -143,10 +143,6 @@ } } } - p { - margin: 0; - word-break: break-word; - } .list-reply { padding-left: 26px; } @@ -173,6 +169,9 @@ margin: 0; max-width: 100%; padding-right: 15px; + pre { + white-space: pre-wrap; + } } .reply-item { padding-right: 16px; diff --git a/apps/documenteditor/mobile/app/controller/add/AddOther.js b/apps/documenteditor/mobile/app/controller/add/AddOther.js index 24f9b2553f..2ad031f272 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddOther.js +++ b/apps/documenteditor/mobile/app/controller/add/AddOther.js @@ -194,7 +194,7 @@ define([ }, onDoneComment: function(documentFlag) { - var value = $('#comment-text').val(); + var value = $('#comment-text').val().trim(); if (value.length > 0) { DE.getController('Common.Controllers.Collaboration').onAddNewComment(value, documentFlag); DE.getController('AddContainer').hideModal(); diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index fbc571974b..74096f9972 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -6559,17 +6559,6 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after padding: 16px 0; word-wrap: break-word; } -.page-comments p, -.add-comment p, -.page-view-comments p, -.container-edit-comment p, -.container-add-reply p, -.page-edit-comment p, -.page-add-reply p, -.page-edit-reply p { - margin: 0; - word-break: break-word; -} .page-comments .list-reply, .add-comment .list-reply, .page-view-comments .list-reply, @@ -6665,6 +6654,24 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after max-width: 100%; padding-right: 15px; } +.page-comments .comment-text pre, +.add-comment .comment-text pre, +.page-view-comments .comment-text pre, +.container-edit-comment .comment-text pre, +.container-add-reply .comment-text pre, +.page-edit-comment .comment-text pre, +.page-add-reply .comment-text pre, +.page-edit-reply .comment-text pre, +.page-comments .reply-text pre, +.add-comment .reply-text pre, +.page-view-comments .reply-text pre, +.container-edit-comment .reply-text pre, +.container-add-reply .reply-text pre, +.page-edit-comment .reply-text pre, +.page-add-reply .reply-text pre, +.page-edit-reply .reply-text pre { + white-space: pre-wrap; +} .page-comments .reply-item, .add-comment .reply-item, .page-view-comments .reply-item, diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index 65118842b7..41bc3be456 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -6129,17 +6129,6 @@ html.phone .document-menu .list-block .item-link { .page-edit-reply .list-block .item-inner:after { content: none; } -.page-comments p, -.page-add-comment p, -.page-view-comments p, -.container-edit-comment p, -.container-add-reply p, -.page-edit-comment p, -.page-add-reply p, -.page-edit-reply p { - margin: 0; - word-break: break-word; -} .page-comments .list-reply, .page-add-comment .list-reply, .page-view-comments .list-reply, @@ -6234,6 +6223,24 @@ html.phone .document-menu .list-block .item-link { max-width: 100%; padding-right: 15px; } +.page-comments .comment-text pre, +.page-add-comment .comment-text pre, +.page-view-comments .comment-text pre, +.container-edit-comment .comment-text pre, +.container-add-reply .comment-text pre, +.page-edit-comment .comment-text pre, +.page-add-reply .comment-text pre, +.page-edit-reply .comment-text pre, +.page-comments .reply-text pre, +.page-add-comment .reply-text pre, +.page-view-comments .reply-text pre, +.container-edit-comment .reply-text pre, +.container-add-reply .reply-text pre, +.page-edit-comment .reply-text pre, +.page-add-reply .reply-text pre, +.page-edit-reply .reply-text pre { + white-space: pre-wrap; +} .page-comments .reply-item, .page-add-comment .reply-item, .page-view-comments .reply-item, diff --git a/apps/presentationeditor/mobile/app/controller/add/AddOther.js b/apps/presentationeditor/mobile/app/controller/add/AddOther.js index 77308a714f..675a89dd00 100644 --- a/apps/presentationeditor/mobile/app/controller/add/AddOther.js +++ b/apps/presentationeditor/mobile/app/controller/add/AddOther.js @@ -168,7 +168,7 @@ define([ }, onDoneComment: function(documentFlag) { - var value = $('#comment-text').val(); + var value = $('#comment-text').val().trim(); if (value.length > 0) { PE.getController('Common.Controllers.Collaboration').onAddNewComment(value, documentFlag); PE.getController('AddContainer').hideModal(); diff --git a/apps/presentationeditor/mobile/resources/css/app-ios.css b/apps/presentationeditor/mobile/resources/css/app-ios.css index dc61648107..e4edbc1a52 100644 --- a/apps/presentationeditor/mobile/resources/css/app-ios.css +++ b/apps/presentationeditor/mobile/resources/css/app-ios.css @@ -6559,17 +6559,6 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after padding: 16px 0; word-wrap: break-word; } -.page-comments p, -.add-comment p, -.page-view-comments p, -.container-edit-comment p, -.container-add-reply p, -.page-edit-comment p, -.page-add-reply p, -.page-edit-reply p { - margin: 0; - word-break: break-word; -} .page-comments .list-reply, .add-comment .list-reply, .page-view-comments .list-reply, @@ -6665,6 +6654,24 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after max-width: 100%; padding-right: 15px; } +.page-comments .comment-text pre, +.add-comment .comment-text pre, +.page-view-comments .comment-text pre, +.container-edit-comment .comment-text pre, +.container-add-reply .comment-text pre, +.page-edit-comment .comment-text pre, +.page-add-reply .comment-text pre, +.page-edit-reply .comment-text pre, +.page-comments .reply-text pre, +.add-comment .reply-text pre, +.page-view-comments .reply-text pre, +.container-edit-comment .reply-text pre, +.container-add-reply .reply-text pre, +.page-edit-comment .reply-text pre, +.page-add-reply .reply-text pre, +.page-edit-reply .reply-text pre { + white-space: pre-wrap; +} .page-comments .reply-item, .add-comment .reply-item, .page-view-comments .reply-item, diff --git a/apps/presentationeditor/mobile/resources/css/app-material.css b/apps/presentationeditor/mobile/resources/css/app-material.css index 74a21da49d..da0736adc2 100644 --- a/apps/presentationeditor/mobile/resources/css/app-material.css +++ b/apps/presentationeditor/mobile/resources/css/app-material.css @@ -6129,17 +6129,6 @@ html.phone .document-menu .list-block .item-link { .page-edit-reply .list-block .item-inner:after { content: none; } -.page-comments p, -.page-add-comment p, -.page-view-comments p, -.container-edit-comment p, -.container-add-reply p, -.page-edit-comment p, -.page-add-reply p, -.page-edit-reply p { - margin: 0; - word-break: break-word; -} .page-comments .list-reply, .page-add-comment .list-reply, .page-view-comments .list-reply, @@ -6234,6 +6223,24 @@ html.phone .document-menu .list-block .item-link { max-width: 100%; padding-right: 15px; } +.page-comments .comment-text pre, +.page-add-comment .comment-text pre, +.page-view-comments .comment-text pre, +.container-edit-comment .comment-text pre, +.container-add-reply .comment-text pre, +.page-edit-comment .comment-text pre, +.page-add-reply .comment-text pre, +.page-edit-reply .comment-text pre, +.page-comments .reply-text pre, +.page-add-comment .reply-text pre, +.page-view-comments .reply-text pre, +.container-edit-comment .reply-text pre, +.container-add-reply .reply-text pre, +.page-edit-comment .reply-text pre, +.page-add-reply .reply-text pre, +.page-edit-reply .reply-text pre { + white-space: pre-wrap; +} .page-comments .reply-item, .page-add-comment .reply-item, .page-view-comments .reply-item, diff --git a/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js b/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js index bde23be463..869ebaed6c 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js +++ b/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js @@ -157,7 +157,7 @@ define([ }, onDoneComment: function(documentFlag) { - var value = $('#comment-text').val(); + var value = $('#comment-text').val().trim(); if (value.length > 0) { if (SSE.getController('Common.Controllers.Collaboration').onAddNewComment(value, documentFlag)) { this.view.isComments = true; diff --git a/apps/spreadsheeteditor/mobile/resources/css/app-ios.css b/apps/spreadsheeteditor/mobile/resources/css/app-ios.css index bdf003a6fa..e4d34930ea 100644 --- a/apps/spreadsheeteditor/mobile/resources/css/app-ios.css +++ b/apps/spreadsheeteditor/mobile/resources/css/app-ios.css @@ -6552,17 +6552,6 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after padding: 16px 0; word-wrap: break-word; } -.page-comments p, -.add-comment p, -.page-view-comments p, -.container-edit-comment p, -.container-add-reply p, -.page-edit-comment p, -.page-add-reply p, -.page-edit-reply p { - margin: 0; - word-break: break-word; -} .page-comments .list-reply, .add-comment .list-reply, .page-view-comments .list-reply, @@ -6658,6 +6647,24 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after max-width: 100%; padding-right: 15px; } +.page-comments .comment-text pre, +.add-comment .comment-text pre, +.page-view-comments .comment-text pre, +.container-edit-comment .comment-text pre, +.container-add-reply .comment-text pre, +.page-edit-comment .comment-text pre, +.page-add-reply .comment-text pre, +.page-edit-reply .comment-text pre, +.page-comments .reply-text pre, +.add-comment .reply-text pre, +.page-view-comments .reply-text pre, +.container-edit-comment .reply-text pre, +.container-add-reply .reply-text pre, +.page-edit-comment .reply-text pre, +.page-add-reply .reply-text pre, +.page-edit-reply .reply-text pre { + white-space: pre-wrap; +} .page-comments .reply-item, .add-comment .reply-item, .page-view-comments .reply-item, diff --git a/apps/spreadsheeteditor/mobile/resources/css/app-material.css b/apps/spreadsheeteditor/mobile/resources/css/app-material.css index 47dd60a127..2a7422b47a 100644 --- a/apps/spreadsheeteditor/mobile/resources/css/app-material.css +++ b/apps/spreadsheeteditor/mobile/resources/css/app-material.css @@ -6139,17 +6139,6 @@ html.phone .document-menu .list-block .item-link { .page-edit-reply .list-block .item-inner:after { content: none; } -.page-comments p, -.page-add-comment p, -.page-view-comments p, -.container-edit-comment p, -.container-add-reply p, -.page-edit-comment p, -.page-add-reply p, -.page-edit-reply p { - margin: 0; - word-break: break-word; -} .page-comments .list-reply, .page-add-comment .list-reply, .page-view-comments .list-reply, @@ -6244,6 +6233,24 @@ html.phone .document-menu .list-block .item-link { max-width: 100%; padding-right: 15px; } +.page-comments .comment-text pre, +.page-add-comment .comment-text pre, +.page-view-comments .comment-text pre, +.container-edit-comment .comment-text pre, +.container-add-reply .comment-text pre, +.page-edit-comment .comment-text pre, +.page-add-reply .comment-text pre, +.page-edit-reply .comment-text pre, +.page-comments .reply-text pre, +.page-add-comment .reply-text pre, +.page-view-comments .reply-text pre, +.container-edit-comment .reply-text pre, +.container-add-reply .reply-text pre, +.page-edit-comment .reply-text pre, +.page-add-reply .reply-text pre, +.page-edit-reply .reply-text pre { + white-space: pre-wrap; +} .page-comments .reply-item, .page-add-comment .reply-item, .page-view-comments .reply-item, From 485c31bc80da49614f9aeee82b4c52fad4c4f60a Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Wed, 27 May 2020 17:03:14 +0300 Subject: [PATCH 2/6] [DE mobile] Fix bug 45472 --- .../mobile/app/controller/add/AddOther.js | 16 +++++++++++---- .../mobile/app/template/AddOther.template | 4 ++-- .../mobile/app/view/add/AddOther.js | 20 ++++++++++++++----- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/add/AddOther.js b/apps/documenteditor/mobile/app/controller/add/AddOther.js index 2ad031f272..1eaa9c01dc 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddOther.js +++ b/apps/documenteditor/mobile/app/controller/add/AddOther.js @@ -91,10 +91,13 @@ define([ }, initEvents: function () { - this.view.hideInsertComments = this.isHideInsertComment(); + this.setDisableMenuItem(); }, - isHideInsertComment: function() { + setDisableMenuItem: function() { + var isDisableComment = true, + isDisableBreak = false, + isDisableFootnote = false; var stack = this.api.getSelectedElements(); var isText = false, isTable = false, @@ -133,9 +136,14 @@ define([ }); if (stack.length > 0) { var isObject = isShape || isChart || isImage || isTable; - return (this.api.can_AddQuotedComment() === false || lockedText || lockedTable || lockedImage || lockedHeader || (!isText && isObject)); + isDisableComment = (this.api.can_AddQuotedComment() === false || lockedText || lockedTable || lockedImage || lockedHeader || (!isText && isObject)); + if (isShape && isText) { + isDisableBreak = isDisableFootnote = true; + } } - return true; + this.view.isDisableComment = isDisableComment; + this.view.isDisableBreak = isDisableBreak; + this.view.isDisableFootnote = isDisableFootnote; }, onPageShow: function (view, pageId) { diff --git a/apps/documenteditor/mobile/app/template/AddOther.template b/apps/documenteditor/mobile/app/template/AddOther.template index b67fdcf51e..773bdfd58c 100644 --- a/apps/documenteditor/mobile/app/template/AddOther.template +++ b/apps/documenteditor/mobile/app/template/AddOther.template @@ -38,7 +38,7 @@
-
  • +
  • -
  • +
  • diff --git a/apps/documenteditor/mobile/app/view/add/AddOther.js b/apps/documenteditor/mobile/app/view/add/AddOther.js index 61947bff8d..28547d3c99 100644 --- a/apps/documenteditor/mobile/app/view/add/AddOther.js +++ b/apps/documenteditor/mobile/app/view/add/AddOther.js @@ -68,14 +68,24 @@ define([ $('#add-other-link').single('click', _.bind(me.showLink, me)); $('#add-other-pagenumber').single('click', _.bind(me.showPagePosition, me)); - $('#add-other-footnote').single('click', _.bind(me.showPageFootnote, me)); - $('#add-other-break').single('click', _.bind(me.showPageBreak, me)); - if (this.hideInsertComments) { - $('#item-comment').hide(); + if (this.isDisableComment) { + $('#item-comment').addClass('disabled'); } else { - $('#item-comment').show(); + $('#item-comment').removeClass('disabled'); $('#add-other-comment').single('click', _.bind(me.showPageComment, me)); } + if (this.isDisableBreak) { + $('#item-break').addClass('disabled'); + } else { + $('#item-break').removeClass('disabled'); + $('#add-other-break').single('click', _.bind(me.showPageBreak, me)); + } + if (this.isDisableFootnote) { + $('#item-footnote').addClass('disabled'); + } else { + $('#item-footnote').removeClass('disabled'); + $('#add-other-footnote').single('click', _.bind(me.showPageFootnote, me)); + } me.initControls(); }, From 51d6daa70298e0ae7da23f441a99db8818d9cfc6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 27 May 2020 22:39:10 +0300 Subject: [PATCH 3/6] [PE] Add icons for Bug 40447 --- apps/common/main/resources/img/doc-formats/jpg.svg | 14 ++++++++++++++ apps/common/main/resources/img/doc-formats/png.svg | 14 ++++++++++++++ apps/common/main/resources/img/doc-formats/svg.svg | 14 ++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 apps/common/main/resources/img/doc-formats/jpg.svg create mode 100644 apps/common/main/resources/img/doc-formats/png.svg create mode 100644 apps/common/main/resources/img/doc-formats/svg.svg diff --git a/apps/common/main/resources/img/doc-formats/jpg.svg b/apps/common/main/resources/img/doc-formats/jpg.svg new file mode 100644 index 0000000000..b04feaf760 --- /dev/null +++ b/apps/common/main/resources/img/doc-formats/jpg.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/png.svg b/apps/common/main/resources/img/doc-formats/png.svg new file mode 100644 index 0000000000..58aef71e3e --- /dev/null +++ b/apps/common/main/resources/img/doc-formats/png.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/svg.svg b/apps/common/main/resources/img/doc-formats/svg.svg new file mode 100644 index 0000000000..3f2562f15a --- /dev/null +++ b/apps/common/main/resources/img/doc-formats/svg.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + From 5c3b2638f53fed967b2956614edc4b0b31f4bf84 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 28 May 2020 13:17:21 +0300 Subject: [PATCH 4/6] [SSE] Set vertical text for cell --- .../main/app/controller/Toolbar.js | 7 +++++-- apps/spreadsheeteditor/main/app/view/Toolbar.js | 11 ++++++++++- apps/spreadsheeteditor/main/locale/en.json | 1 + .../img/toolbar/1.25x/text-orient-vertical.png | Bin 0 -> 335 bytes .../img/toolbar/1.5x/text-orient-vertical.png | Bin 0 -> 411 bytes .../img/toolbar/1.75x/text-orient-vertical.png | Bin 0 -> 467 bytes .../img/toolbar/1x/text-orient-vertical.png | Bin 0 -> 268 bytes .../img/toolbar/2x/text-orient-vertical.png | Bin 0 -> 526 bytes 8 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/text-orient-vertical.png create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/text-orient-vertical.png create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/text-orient-vertical.png create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/1x/text-orient-vertical.png create mode 100644 apps/spreadsheeteditor/main/resources/img/toolbar/2x/text-orient-vertical.png diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index eaf086b4fa..dfaddf1ea1 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -801,6 +801,7 @@ define([ switch (item.value) { case 'countcw': angle = 45; break; case 'clockwise': angle = -45; break; + case 'vertical': angle = 255; break; case 'rotateup': angle = 90; break; case 'rotatedown': angle = -90; break; } @@ -2289,6 +2290,7 @@ define([ need_disable = (fontparam == AscCommon.align_Justify || selectionType == Asc.c_oAscSelectionType.RangeShapeText || selectionType == Asc.c_oAscSelectionType.RangeShape); toolbar.btnTextOrient.menu.items[1].setDisabled(need_disable); toolbar.btnTextOrient.menu.items[2].setDisabled(need_disable); + toolbar.btnTextOrient.menu.items[3].setDisabled(need_disable); /* read cell vertical align */ fontparam = xfs.asc_getVertAlign(); @@ -2391,8 +2393,9 @@ define([ switch(val) { case 45: toolbar.btnTextOrient.menu.items[1].setChecked(true, true); break; case -45: toolbar.btnTextOrient.menu.items[2].setChecked(true, true); break; - case 90: toolbar.btnTextOrient.menu.items[3].setChecked(true, true); break; - case -90: toolbar.btnTextOrient.menu.items[4].setChecked(true, true); break; + case 255: toolbar.btnTextOrient.menu.items[3].setChecked(true, true); break; + case 90: toolbar.btnTextOrient.menu.items[4].setChecked(true, true); break; + case -90: toolbar.btnTextOrient.menu.items[5].setChecked(true, true); break; case 0: toolbar.btnTextOrient.menu.items[0].setChecked(true, true); break; } this._state.angle = val; diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index e2ff01a99e..dcbb1666c4 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -630,6 +630,14 @@ define([ toggleGroup : 'textorientgroup', value : 'clockwise' }, + { + caption : me.textVertical, + iconCls : 'menu__icon text-orient-vertical', + checkable : true, + checkmark : false, + toggleGroup : 'textorientgroup', + value : 'vertical' + }, { caption : me.textRotateUp, iconCls : 'menu__icon text-orient-rup', @@ -2398,6 +2406,7 @@ define([ tipInsertSymbol: 'Insert symbol', txtAutosumTip: 'Summation', capBtnPrintTitles: 'Print Titles', - tipPrintTitles: 'Print titles' + tipPrintTitles: 'Print titles', + textVertical: 'Vertical Text' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 4249877433..a9d5cd25ce 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2662,6 +2662,7 @@ "SSE.Views.Toolbar.txtTime": "Time", "SSE.Views.Toolbar.txtUnmerge": "Unmerge Cells", "SSE.Views.Toolbar.txtYen": "¥ Yen", + "SSE.Views.Toolbar.textVertical": "Vertical Text", "SSE.Views.Top10FilterDialog.textType": "Show", "SSE.Views.Top10FilterDialog.txtBottom": "Bottom", "SSE.Views.Top10FilterDialog.txtItems": "Item", diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/text-orient-vertical.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/text-orient-vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..d000dc4329d01b65e263119cab90326ca3f1e185 GIT binary patch literal 335 zcmV-V0kHmwP)X1ONa4*JNE*~NYqnys5*ctZnL?~Y?5W=(B07C8e}z2x77<}OD1UohHKBQ8dtDet^3V6R zDgG5dxUWA*6wz680}@4;$t}pD*@}KOAPbqo{zU9v$fbWHV;c0aUp(Clp?@PI1CQO} zFTHvSMheMew_4X#eTV3A0uXSz)w-_u{!fCskvxWV@mB1%`;&mLi~cRXaQm>|81zk4 h9&k9kr88&#F+U1y)0Tv9Q1Ji&002ovPDHLkV1lvEimLzs literal 0 HcmV?d00001 diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/text-orient-vertical.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/text-orient-vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..bd523533e325f8ac65c692753f6147ebca38091d GIT binary patch literal 411 zcmV;M0c8G(P)x-i5Rnox- zz9{IC46yBOSJis8J_Fp-QFFy7gHOgrb?VgFxJR%h7(>M2aKv4LEx}biYo$(`L~uQ8 zg`-IX>nLV=lTt$>c;r4yNk{~zh7V@ntww`}Drz{HWVs*^hy+Xq_-=Q%$Ln|S{n_pE z`gibm^8vWo08fRPP;+?{>#et52U)$YsW202E)U@Gc!rIu)}ZYKw&&SlMMXu$4%)7Q z1MLLnJUa{sf-umopV-)_tzyqM&gYx2T8!RS!G=f+oQaPb@%VS!*pV0;l_z!~*Tu$- z{Td=Xu?z5pxT%L24a;pl>m=o-TIRJli#l!29y#*g^8+K21A>)v*Zlwh002ovPDHLk FV1lC&xg`Jq literal 0 HcmV?d00001 diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/text-orient-vertical.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/text-orient-vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..36e5a9a64462c0bef27602f5b279eedf0563407f GIT binary patch literal 467 zcmV;^0WAKBP)&3<1aK8Zr5nhSb|fBj(0H&qpi9 zb2PQmh;brHX~LLV6%nywdLDyPMMNlQ1162xtysyP`UcF1Qz$t7X^eI@<)}e}Mw|AR zc#EN9A`%EhrUND3V)88wU%!<7C4R!(_?kjFP~t7d>e7@WC4R!xr74F>{L|4p9)4xY z_iZA3cAKoG;cRC_0LPiA45vFIVrUQ%(O}g+8!$mcgh1u986%R%rOanBB8&_T7*h=z z{=HkBS*I{cAn;D*^^_cQTrl&Kh+)-=6{~4@dpU+kTrl&K2v8{$D#H$p#^gCZFga$| z`23nu|9Z8FIPrm*KR>;ue%ES0IL4Z?#+dF|`v(Emlnq9AuD!?0$>GvT-R+ip3 zuoDjWeF&f^HhLD`N@Rtvw`QgP0G$E~UvK^T+aSZ&H_X~z8DD|V3uk-fKj#DBKAM)M S%-H7u0000-*q=3WYhhC13zv6*nEIrLa56I_ys_h3Gix!^9l;~BL^S` z@B{)MSpe(1a8LIX`pg1&2cA5E&pd!$SR*UyAq$`f3>FwN0LlstRaI3A=|R~8zQ71S z2+AIC3dp>=(|}_@W_2e4uSN*<(;_t}TR;o|{j^99$`-J`3;kKX_NhVH0p5Ydk3Kml zTR;uM{a%jymKu~D-~cRs+>(QGJg9%J<3W8w|0Uom!@;%ZLNf173bZFfGVi(8wXSns zsLuk}($e99J`3RZW-p@lIRK}(3*a*Xx<`nl$6W|*s~o5LPN!J0_41~bE8 zXbyW20&#wNh}w_;jjO4>(BqpPjG9|K06+aV3?6uV(}Qty&>H7O?Zx4PY z(U@r&61s3k+~RFQ(%Vb4-H7P70B<4bN${(x%9_~vL?dSPD=I1~D*8wC7j*DWKoImz Q1poj507*qoM6N<$f*Kj+SO5S3 literal 0 HcmV?d00001 From 8e3e359c89edb5fb7367bad25a693160eda97a45 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 28 May 2020 14:55:56 +0300 Subject: [PATCH 5/6] [SSE] Fix vertical text in the cell --- apps/spreadsheeteditor/main/app/view/CellSettings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/CellSettings.js b/apps/spreadsheeteditor/main/app/view/CellSettings.js index 4e32a0ee9c..dd34f37347 100644 --- a/apps/spreadsheeteditor/main/app/view/CellSettings.js +++ b/apps/spreadsheeteditor/main/app/view/CellSettings.js @@ -449,7 +449,7 @@ define([ var xfs = props.asc_getXfs(), value = xfs.asc_getAngle(); if (Math.abs(this._state.CellAngle - value) > 0.1 || (this._state.CellAngle === undefined) && (this._state.CellAngle !== value)) { - this.spnAngle.setValue((value !== null) ? value : '', true); + this.spnAngle.setValue((value !== null) ? (value==255 ? 0 : value) : '', true); this._state.CellAngle = value; } this.fill = xfs.asc_getFill(); From d9af2ca0e9c268a9b0c0b584fc7ce50dc6b3ce73 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 29 May 2020 15:14:16 +0300 Subject: [PATCH 6/6] [SSE] Add cell settings (wrap text and shrink to fit) to the right panel --- .../main/app/template/CellSettings.template | 17 ++++++- .../main/app/view/CellSettings.js | 49 ++++++++++++++++++- apps/spreadsheeteditor/main/locale/en.json | 3 ++ 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/template/CellSettings.template b/apps/spreadsheeteditor/main/app/template/CellSettings.template index c9bbb14b09..0168b2dec2 100644 --- a/apps/spreadsheeteditor/main/app/template/CellSettings.template +++ b/apps/spreadsheeteditor/main/app/template/CellSettings.template @@ -100,10 +100,25 @@ - +
    + + + + + + + +
    + + + + +
    + + \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/CellSettings.js b/apps/spreadsheeteditor/main/app/view/CellSettings.js index dd34f37347..d23b4cc0d6 100644 --- a/apps/spreadsheeteditor/main/app/view/CellSettings.js +++ b/apps/spreadsheeteditor/main/app/view/CellSettings.js @@ -429,6 +429,22 @@ define([ this.lockedControls.push(this.spnAngle); this.spnAngle.on('change', _.bind(this.onAngleChange, this)); this.spnAngle.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); + + this.chWrap = new Common.UI.CheckBox({ + el: $('#cell-checkbox-wrap'), + labelText: this.strWrap, + disabled: this._locked + }); + this.lockedControls.push(this.chWrap); + this.chWrap.on('change', this.onWrapChange.bind(this)); + + this.chShrink = new Common.UI.CheckBox({ + el: $('#cell-checkbox-shrink'), + labelText: this.strShrink, + disabled: this._locked + }); + this.lockedControls.push(this.chShrink); + this.chShrink.on('change', this.onShrinkChange.bind(this)); }, createDelayedElements: function() { @@ -452,6 +468,21 @@ define([ this.spnAngle.setValue((value !== null) ? (value==255 ? 0 : value) : '', true); this._state.CellAngle = value; } + + value = xfs.asc_getWrapText(); + if ( this._state.Wrap!==value ) { + this.chWrap.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true); + this._state.Wrap=value; + } + this.chWrap.setDisabled(xfs.asc_getHorAlign() == AscCommon.align_Justify || this._locked); + + value = xfs.asc_getShrinkToFit(); + if ( this._state.Shrink!==value ) { + this.chShrink.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true); + this._state.Shrink=value; + } + this.chShrink.setDisabled((this.chWrap.getValue()=='checked') || this._locked); + this.fill = xfs.asc_getFill(); if (this.fill) { this.pattern = this.fill.asc_getPatternFill(); @@ -1127,6 +1158,19 @@ define([ Common.NotificationCenter.trigger('edit:complete', this); }, + onWrapChange: function(field, newValue, oldValue, eOpts){ + if (this.api && !this._noApply) + this.api.asc_setCellTextWrap((field.getValue()=='checked')); + this.chShrink.setDisabled((field.getValue()=='checked') || this._locked); + Common.NotificationCenter.trigger('edit:complete', this); + }, + + onShrinkChange: function(field, newValue, oldValue, eOpts){ + if (this.api && !this._noApply) + this.api.asc_setCellTextShrink((field.getValue()=='checked')); + Common.NotificationCenter.trigger('edit:complete', this); + }, + textBorders: 'Border\'s Style', textBorderColor: 'Color', textBackColor: 'Background color', @@ -1156,7 +1200,10 @@ define([ textPattern: 'Pattern', textForeground: 'Foreground color', textBackground: 'Background color', - textGradient: 'Gradient' + textGradient: 'Gradient', + textControl: 'Text Control', + strWrap: 'Wrap text', + strShrink: 'Shrink to fit' }, SSE.Views.CellSettings || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index a9d5cd25ce..4ad0e13a52 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1255,6 +1255,9 @@ "SSE.Views.CellSettings.tipOuter": "Set outer border only", "SSE.Views.CellSettings.tipRight": "Set outer right border only", "SSE.Views.CellSettings.tipTop": "Set outer top border only", + "SSE.Views.CellSettings.textControl": "Text Control", + "SSE.Views.CellSettings.strWrap": "Wrap text", + "SSE.Views.CellSettings.strShrink": "Shrink to fit", "SSE.Views.ChartSettings.strLineWeight": "Line Weight", "SSE.Views.ChartSettings.strSparkColor": "Color", "SSE.Views.ChartSettings.strTemplate": "Template",