diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js index 3e160a629..e5e2a0074 100644 --- a/apps/common/main/lib/view/Protection.js +++ b/apps/common/main/lib/view/Protection.js @@ -239,8 +239,7 @@ define([ var me = this; if ( type == 'signature' ) { var button = new Common.UI.Button({ - cls: 'btn-text-default', - style: 'width: 100%;', + cls: 'btn-text-default auto', caption: this.txtInvisibleSignature, disabled: this._state.invisibleSignDisabled, dataHint: '2', @@ -256,8 +255,7 @@ define([ return button; } else if ( type == 'add-password' ) { var button = new Common.UI.Button({ - cls: 'btn-text-default', - style: 'width: 100%;', + cls: 'btn-text-default auto', caption: this.txtAddPwd, disabled: this._state.disabled || this._state.disabledPassword, visible: !this._state.hasPassword, @@ -274,8 +272,7 @@ define([ return button; } else if ( type == 'del-password' ) { var button = new Common.UI.Button({ - cls: 'btn-text-default', - style: 'width: 100%;', + cls: 'btn-text-default auto', caption: this.txtDeletePwd, disabled: this._state.disabled || this._state.disabledPassword, visible: this._state.hasPassword, @@ -292,8 +289,7 @@ define([ return button; } else if ( type == 'change-password' ) { var button = new Common.UI.Button({ - cls: 'btn-text-default', - style: 'width: 100%;', + cls: 'btn-text-default auto', caption: this.txtChangePwd, disabled: this._state.disabled || this._state.disabledPassword, visible: this._state.hasPassword, diff --git a/apps/common/main/resources/img/doc-formats/csv.svg b/apps/common/main/resources/img/doc-formats/csv.svg index 3a42ac3ad..713afe5d6 100644 --- a/apps/common/main/resources/img/doc-formats/csv.svg +++ b/apps/common/main/resources/img/doc-formats/csv.svg @@ -1,32 +1,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/djvu.svg b/apps/common/main/resources/img/doc-formats/djvu.svg index 7cd4e08d6..7a0925dac 100644 --- a/apps/common/main/resources/img/doc-formats/djvu.svg +++ b/apps/common/main/resources/img/doc-formats/djvu.svg @@ -1,16 +1,13 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/docm.svg b/apps/common/main/resources/img/doc-formats/docm.svg index 86e7c54dd..b2ec81233 100644 --- a/apps/common/main/resources/img/doc-formats/docm.svg +++ b/apps/common/main/resources/img/doc-formats/docm.svg @@ -1,10 +1,14 @@ - - - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/docx.svg b/apps/common/main/resources/img/doc-formats/docx.svg index 9be827736..a0025f892 100644 --- a/apps/common/main/resources/img/doc-formats/docx.svg +++ b/apps/common/main/resources/img/doc-formats/docx.svg @@ -1,6 +1,13 @@ - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/docxf.svg b/apps/common/main/resources/img/doc-formats/docxf.svg index f0d0421b4..846bc4c5b 100644 --- a/apps/common/main/resources/img/doc-formats/docxf.svg +++ b/apps/common/main/resources/img/doc-formats/docxf.svg @@ -1,14 +1,14 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/dotx.svg b/apps/common/main/resources/img/doc-formats/dotx.svg index ea27f0523..f006c5b5f 100644 --- a/apps/common/main/resources/img/doc-formats/dotx.svg +++ b/apps/common/main/resources/img/doc-formats/dotx.svg @@ -1,8 +1,14 @@ - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/epub.svg b/apps/common/main/resources/img/doc-formats/epub.svg index df41f52e5..8f246520f 100644 --- a/apps/common/main/resources/img/doc-formats/epub.svg +++ b/apps/common/main/resources/img/doc-formats/epub.svg @@ -1,8 +1,13 @@ - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/fb2.svg b/apps/common/main/resources/img/doc-formats/fb2.svg index 4239a775a..ab2923087 100644 --- a/apps/common/main/resources/img/doc-formats/fb2.svg +++ b/apps/common/main/resources/img/doc-formats/fb2.svg @@ -1,8 +1,13 @@ - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/html.svg b/apps/common/main/resources/img/doc-formats/html.svg index edc138f37..503d611aa 100644 --- a/apps/common/main/resources/img/doc-formats/html.svg +++ b/apps/common/main/resources/img/doc-formats/html.svg @@ -1,8 +1,15 @@ - - - - - - - + + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/jpg.svg b/apps/common/main/resources/img/doc-formats/jpg.svg index cf0c2207a..99f2bb725 100644 --- a/apps/common/main/resources/img/doc-formats/jpg.svg +++ b/apps/common/main/resources/img/doc-formats/jpg.svg @@ -1,12 +1,17 @@ - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/odp.svg b/apps/common/main/resources/img/doc-formats/odp.svg index 3d48f79ca..6ddc0761f 100644 --- a/apps/common/main/resources/img/doc-formats/odp.svg +++ b/apps/common/main/resources/img/doc-formats/odp.svg @@ -1,7 +1,13 @@ - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/ods.svg b/apps/common/main/resources/img/doc-formats/ods.svg index b69df0429..31dcfb2ab 100644 --- a/apps/common/main/resources/img/doc-formats/ods.svg +++ b/apps/common/main/resources/img/doc-formats/ods.svg @@ -1,7 +1,13 @@ - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/odt.svg b/apps/common/main/resources/img/doc-formats/odt.svg index a73086c13..0d3d00bc0 100644 --- a/apps/common/main/resources/img/doc-formats/odt.svg +++ b/apps/common/main/resources/img/doc-formats/odt.svg @@ -1,7 +1,13 @@ - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/oform.svg b/apps/common/main/resources/img/doc-formats/oform.svg index 1b5a0706f..c518ac141 100644 --- a/apps/common/main/resources/img/doc-formats/oform.svg +++ b/apps/common/main/resources/img/doc-formats/oform.svg @@ -1,16 +1,18 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/otp.svg b/apps/common/main/resources/img/doc-formats/otp.svg index d2af2e7ab..26d8bc60d 100644 --- a/apps/common/main/resources/img/doc-formats/otp.svg +++ b/apps/common/main/resources/img/doc-formats/otp.svg @@ -1,9 +1,14 @@ - - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/ots.svg b/apps/common/main/resources/img/doc-formats/ots.svg index ed7b7aea3..ca9cac28d 100644 --- a/apps/common/main/resources/img/doc-formats/ots.svg +++ b/apps/common/main/resources/img/doc-formats/ots.svg @@ -1,9 +1,14 @@ - - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/ott.svg b/apps/common/main/resources/img/doc-formats/ott.svg index d37c3487b..cb2629743 100644 --- a/apps/common/main/resources/img/doc-formats/ott.svg +++ b/apps/common/main/resources/img/doc-formats/ott.svg @@ -1,9 +1,14 @@ - - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/oxps.svg b/apps/common/main/resources/img/doc-formats/oxps.svg index 98a42b7d7..931e60193 100644 --- a/apps/common/main/resources/img/doc-formats/oxps.svg +++ b/apps/common/main/resources/img/doc-formats/oxps.svg @@ -1,9 +1,13 @@ - - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/pdf.svg b/apps/common/main/resources/img/doc-formats/pdf.svg index 581669209..0201e87ed 100644 --- a/apps/common/main/resources/img/doc-formats/pdf.svg +++ b/apps/common/main/resources/img/doc-formats/pdf.svg @@ -1,6 +1,13 @@ - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/pdfa.svg b/apps/common/main/resources/img/doc-formats/pdfa.svg index 26608740e..d07833854 100644 --- a/apps/common/main/resources/img/doc-formats/pdfa.svg +++ b/apps/common/main/resources/img/doc-formats/pdfa.svg @@ -1,8 +1,14 @@ - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/png.svg b/apps/common/main/resources/img/doc-formats/png.svg index d680b74a9..c2db2a3b0 100644 --- a/apps/common/main/resources/img/doc-formats/png.svg +++ b/apps/common/main/resources/img/doc-formats/png.svg @@ -1,12 +1,17 @@ - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/potx.svg b/apps/common/main/resources/img/doc-formats/potx.svg index 17b0daaf6..7f5548bdd 100644 --- a/apps/common/main/resources/img/doc-formats/potx.svg +++ b/apps/common/main/resources/img/doc-formats/potx.svg @@ -1,12 +1,14 @@ - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/ppsx.svg b/apps/common/main/resources/img/doc-formats/ppsx.svg index 87f1c2264..24a89babe 100644 --- a/apps/common/main/resources/img/doc-formats/ppsx.svg +++ b/apps/common/main/resources/img/doc-formats/ppsx.svg @@ -1,17 +1,13 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/pptm.svg b/apps/common/main/resources/img/doc-formats/pptm.svg index e30a2d954..62029d6fd 100644 --- a/apps/common/main/resources/img/doc-formats/pptm.svg +++ b/apps/common/main/resources/img/doc-formats/pptm.svg @@ -1,12 +1,14 @@ - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/pptx.svg b/apps/common/main/resources/img/doc-formats/pptx.svg index b8a4470fc..0d193b13c 100644 --- a/apps/common/main/resources/img/doc-formats/pptx.svg +++ b/apps/common/main/resources/img/doc-formats/pptx.svg @@ -1,10 +1,13 @@ - - - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/rtf.svg b/apps/common/main/resources/img/doc-formats/rtf.svg index 69b16f641..686a0498f 100644 --- a/apps/common/main/resources/img/doc-formats/rtf.svg +++ b/apps/common/main/resources/img/doc-formats/rtf.svg @@ -1,15 +1,13 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/svg.svg b/apps/common/main/resources/img/doc-formats/svg.svg index 3f2562f15..ced8b0279 100644 --- a/apps/common/main/resources/img/doc-formats/svg.svg +++ b/apps/common/main/resources/img/doc-formats/svg.svg @@ -1,14 +1,13 @@ - - - - - - - - + + + + + + - - - - + + + + + diff --git a/apps/common/main/resources/img/doc-formats/txt.svg b/apps/common/main/resources/img/doc-formats/txt.svg index 8d78ae585..961c4e168 100644 --- a/apps/common/main/resources/img/doc-formats/txt.svg +++ b/apps/common/main/resources/img/doc-formats/txt.svg @@ -1,14 +1,13 @@ - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/xlsm.svg b/apps/common/main/resources/img/doc-formats/xlsm.svg index b0d860961..087dad7d2 100644 --- a/apps/common/main/resources/img/doc-formats/xlsm.svg +++ b/apps/common/main/resources/img/doc-formats/xlsm.svg @@ -1,8 +1,14 @@ - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/xlsx.svg b/apps/common/main/resources/img/doc-formats/xlsx.svg index 9fd0ac99b..b2ac9a15c 100644 --- a/apps/common/main/resources/img/doc-formats/xlsx.svg +++ b/apps/common/main/resources/img/doc-formats/xlsx.svg @@ -1,6 +1,13 @@ - - - - - + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/xltx.svg b/apps/common/main/resources/img/doc-formats/xltx.svg index 92bb7a1d6..e550a1747 100644 --- a/apps/common/main/resources/img/doc-formats/xltx.svg +++ b/apps/common/main/resources/img/doc-formats/xltx.svg @@ -1,8 +1,14 @@ - - - - - - - + + + + + + + + + + + + + diff --git a/apps/common/main/resources/img/doc-formats/xps.svg b/apps/common/main/resources/img/doc-formats/xps.svg index d69b7e945..bddb3606c 100644 --- a/apps/common/main/resources/img/doc-formats/xps.svg +++ b/apps/common/main/resources/img/doc-formats/xps.svg @@ -1,9 +1,13 @@ - - - - - - - - + + + + + + + + + + + + diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index fde5f54ef..98c49b8ed 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -56,37 +56,40 @@ define([ {name: 'DOCX', imgCls: 'docx', type: Asc.c_oAscFileType.DOCX}, {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, {name: 'ODT', imgCls: 'odt', type: Asc.c_oAscFileType.ODT}, - {name: 'TXT', imgCls: 'txt', type: Asc.c_oAscFileType.TXT} - ],[ - {name: 'DOTX', imgCls: 'dotx', type: Asc.c_oAscFileType.DOTX}, - {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, - {name: 'OTT', imgCls: 'ott', type: Asc.c_oAscFileType.OTT}, - {name: 'RTF', imgCls: 'rtf', type: Asc.c_oAscFileType.RTF} - ],[ - {name: 'DOCM', imgCls: 'docm', type: Asc.c_oAscFileType.DOCM}, {name: 'DOCXF', imgCls: 'docxf', type: Asc.c_oAscFileType.DOCXF}, {name: 'OFORM', imgCls: 'oform', type: Asc.c_oAscFileType.OFORM} ],[ - {name: 'HTML (Zipped)', imgCls: 'html', type: Asc.c_oAscFileType.HTML}, + {name: 'DOTX', imgCls: 'dotx', type: Asc.c_oAscFileType.DOTX}, + {name: 'DOCM', imgCls: 'docm', type: Asc.c_oAscFileType.DOCM}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, + {name: 'OTT', imgCls: 'ott', type: Asc.c_oAscFileType.OTT} + ],[ + {name: 'RTF', imgCls: 'rtf', type: Asc.c_oAscFileType.RTF}, + {name: 'TXT', imgCls: 'txt', type: Asc.c_oAscFileType.TXT}, {name: 'FB2', imgCls: 'fb2', type: Asc.c_oAscFileType.FB2}, - {name: 'EPUB', imgCls: 'epub', type: Asc.c_oAscFileType.EPUB} + {name: 'EPUB', imgCls: 'epub', type: Asc.c_oAscFileType.EPUB}, + {name: 'HTML (Zipped)', imgCls: 'html', type: Asc.c_oAscFileType.HTML} + ], [ + {name: 'JPG', imgCls: 'jpg', type: Asc.c_oAscFileType.JPG}, + {name: 'PNG', imgCls: 'png', type: Asc.c_oAscFileType.PNG} ]], - template: _.template([ - '', - '<% _.each(rows, function(row) { %>', - '', - '<% _.each(row, function(item) { %>', - '<% if (item.type!==Asc.c_oAscFileType.DOCM || fileType=="docm") { %>', - '', - '<% } %>', - '<% }) %>', - '', - '<% }) %>', - '
', - '
', - '
' + '
', + '
<%= header %>
', + '
', + '<% _.each(rows, function(row) { %>', + '<% _.each(row, function(item) { %>', + '<% if (item.type!==Asc.c_oAscFileType.DOCM || fileType=="docm") { %>', + '
', + '
', + '
', + '<% } %>', + '<% }) %>', + '
', + '<% }) %>', + '
', + '
' ].join('')), initialize: function(options) { @@ -95,15 +98,24 @@ define([ this.menu = options.menu; this.fileType = options.fileType; this.mode = options.mode; + + Common.NotificationCenter.on({ + 'window:resize': _.bind(function() { + var divided = Common.Utils.innerWidth() >= this.maxWidth; + if (this.isDivided !== divided) { + this.$el.find('.divider').css('width', divided ? '100%' : '0'); + this.isDivided = divided; + } + }, this) + }); }, render: function() { if (/^pdf$/.test(this.fileType)) { - this.formats[0].splice(1, 1); // remove pdf - this.formats[1].splice(1, 1); // remove pdfa - this.formats[3].push({name: 'PDF', imgCls: 'pdf', type: ''}); // original pdf + this.formats[0].splice(1, 1, {name: 'PDF', imgCls: 'pdf', type: ''}); // remove pdf + this.formats[1].splice(2, 1); // remove pdfa } else if (/^xps|oxps$/.test(this.fileType)) { - this.formats[3].push({name: this.fileType.toUpperCase(), imgCls: this.fileType, type: ''}); // original xps/oxps + this.formats[0].push({name: this.fileType.toUpperCase(), imgCls: this.fileType, type: ''}); // original xps/oxps } else if (/^djvu$/.test(this.fileType)) { this.formats = [[ {name: 'DJVU', imgCls: 'djvu', type: ''}, // original djvu @@ -112,12 +124,10 @@ define([ } if (this.mode && !this.mode.canFeatureForms && this.formats.length>2) { - this.formats[2].splice(1, 2); - this.formats[2] = this.formats[2].concat(this.formats[3]); - this.formats[3] = undefined; + this.formats[0].splice(3, 2); // remove docxf and oform } - this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'docx').toLowerCase()})); + this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'docx').toLowerCase(), header: this.textDownloadAs})); $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); if (_.isUndefined(this.scroller)) { @@ -128,6 +138,21 @@ define([ }); } + var itemWidth = 70 + 24, // width + margin + maxCount = 0; + this.formats.forEach(_.bind(function (item, index) { + var count = item.length; + if (count > maxCount) { + maxCount = count; + } + }, this)); + this.maxWidth = $('#file-menu-panel .panel-menu').outerWidth() + 20 + 10 + itemWidth * maxCount; // menu + left padding + margin + + if (Common.Utils.innerWidth() >= this.maxWidth) { + this.$el.find('.divider').css('width', '100%'); + this.isDivided = true; + } + return this; }, @@ -141,7 +166,9 @@ define([ if (!_.isUndefined(type) && this.menu) { this.menu.fireEvent('saveas:format', [this.menu, type.value ? parseInt(type.value) : undefined]); } - } + }, + + textDownloadAs: "Download as" }); DE.Views.FileMenuPanels.ViewSaveCopy = Common.UI.BaseView.extend({ @@ -149,40 +176,44 @@ define([ menu: undefined, formats: [[ - {name: 'DOCX', imgCls: 'docx', type: Asc.c_oAscFileType.DOCX, ext: '.docx'}, - {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF, ext: '.pdf'}, - {name: 'ODT', imgCls: 'odt', type: Asc.c_oAscFileType.ODT, ext: '.odt'}, - {name: 'TXT', imgCls: 'txt', type: Asc.c_oAscFileType.TXT, ext: '.txt'} + {name: 'DOCX', imgCls: 'docx', type: Asc.c_oAscFileType.DOCX}, + {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, + {name: 'ODT', imgCls: 'odt', type: Asc.c_oAscFileType.ODT}, + {name: 'DOCXF', imgCls: 'docxf', type: Asc.c_oAscFileType.DOCXF}, + {name: 'OFORM', imgCls: 'oform', type: Asc.c_oAscFileType.OFORM} ],[ - {name: 'DOTX', imgCls: 'dotx', type: Asc.c_oAscFileType.DOTX, ext: '.dotx'}, - {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA, ext: '.pdf'}, - {name: 'OTT', imgCls: 'ott', type: Asc.c_oAscFileType.OTT, ext: '.ott'}, - {name: 'RTF', imgCls: 'rtf', type: Asc.c_oAscFileType.RTF, ext: '.rtf'} + {name: 'DOTX', imgCls: 'dotx', type: Asc.c_oAscFileType.DOTX}, + {name: 'DOCM', imgCls: 'docm', type: Asc.c_oAscFileType.DOCM}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, + {name: 'OTT', imgCls: 'ott', type: Asc.c_oAscFileType.OTT} ],[ - {name: 'DOCM', imgCls: 'docm', type: Asc.c_oAscFileType.DOCM, ext: '.docm'}, - {name: 'DOCXF', imgCls: 'docxf', type: Asc.c_oAscFileType.DOCXF, ext: '.docxf'}, - {name: 'OFORM', imgCls: 'oform', type: Asc.c_oAscFileType.OFORM, ext: '.oform'} - ],[ - {name: 'HTML (Zipped)', imgCls: 'html', type: Asc.c_oAscFileType.HTML, ext: '.html'}, - {name: 'FB2', imgCls: 'fb2', type: Asc.c_oAscFileType.FB2, ext: '.fb2'}, - {name: 'EPUB', imgCls: 'epub', type: Asc.c_oAscFileType.EPUB, ext: '.epub'} + {name: 'RTF', imgCls: 'rtf', type: Asc.c_oAscFileType.RTF}, + {name: 'TXT', imgCls: 'txt', type: Asc.c_oAscFileType.TXT}, + {name: 'FB2', imgCls: 'fb2', type: Asc.c_oAscFileType.FB2}, + {name: 'EPUB', imgCls: 'epub', type: Asc.c_oAscFileType.EPUB}, + {name: 'HTML (Zipped)', imgCls: 'html', type: Asc.c_oAscFileType.HTML} + ], [ + {name: 'JPG', imgCls: 'jpg', type: Asc.c_oAscFileType.JPG}, + {name: 'PNG', imgCls: 'png', type: Asc.c_oAscFileType.PNG} ]], template: _.template([ - '', - '<% _.each(rows, function(row) { %>', - '', + '
', + '
<%= header %>
', + '
', + '<% _.each(rows, function(row) { %>', '<% _.each(row, function(item) { %>', '<% if (item.type!==Asc.c_oAscFileType.DOCM || fileType=="docm") { %>', - '
', + '
', + '
', + '
', '<% } %>', '<% }) %>', - '', - '<% }) %>', - '
', - '
', - '
' + '
', + '<% }) %>', + '', + '' ].join('')), initialize: function(options) { @@ -191,15 +222,24 @@ define([ this.menu = options.menu; this.fileType = options.fileType; this.mode = options.mode; + + Common.NotificationCenter.on({ + 'window:resize': _.bind(function() { + var divided = Common.Utils.innerWidth() >= this.maxWidth; + if (this.isDivided !== divided) { + this.$el.find('.divider').css('width', divided ? '100%' : '0'); + this.isDivided = divided; + } + }, this) + }); }, render: function() { if (/^pdf$/.test(this.fileType)) { - this.formats[0].splice(1, 1); // remove pdf - this.formats[1].splice(1, 1); // remove pdfa - this.formats[3].push({name: 'PDF', imgCls: 'pdf', type: '', ext: true}); // original pdf + this.formats[0].splice(1, 1, {name: 'PDF', imgCls: 'pdf', type: '', ext: true}); // remove pdf + this.formats[1].splice(2, 1); // remove pdfa } else if (/^xps|oxps$/.test(this.fileType)) { - this.formats[3].push({name: this.fileType.toUpperCase(), imgCls: this.fileType, type: '', ext: true}); // original xps/oxps + this.formats[0].push({name: this.fileType.toUpperCase(), imgCls: this.fileType, type: '', ext: true}); // original xps/oxps } else if (/^djvu$/.test(this.fileType)) { this.formats = [[ {name: 'DJVU', imgCls: 'djvu', type: '', ext: true}, // original djvu @@ -208,12 +248,10 @@ define([ } if (this.mode && !this.mode.canFeatureForms && this.formats.length>2) { - this.formats[2].splice(1, 2); - this.formats[2] = this.formats[2].concat(this.formats[3]); - this.formats[3] = undefined; + this.formats[0].splice(3, 2); // remove docxf and oform } - this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'docx').toLowerCase()})); + this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'docx').toLowerCase(), header: this.textSaveCopyAs})); $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); if (_.isUndefined(this.scroller)) { @@ -224,6 +262,21 @@ define([ }); } + var itemWidth = 70 + 24, // width + margin + maxCount = 0; + this.formats.forEach(_.bind(function (item, index) { + var count = item.length; + if (count > maxCount) { + maxCount = count; + } + }, this)); + this.maxWidth = $('#file-menu-panel .panel-menu').outerWidth() + 20 + 10 + itemWidth * maxCount; // menu + left padding + margin + + if (Common.Utils.innerWidth() >= this.maxWidth) { + this.$el.find('.divider').css('width', '100%'); + this.isDivided = true; + } + return this; }, @@ -238,7 +291,9 @@ define([ if (!_.isUndefined(type) && !_.isUndefined(ext) && this.menu) { this.menu.fireEvent('saveas:format', [this.menu, type.value ? parseInt(type.value) : undefined, ext.value]); } - } + }, + + textSaveCopyAs: "Save Copy as" }); DE.Views.FileMenuPanels.Settings = Common.UI.BaseView.extend(_.extend({ @@ -247,7 +302,8 @@ define([ template: _.template([ '
', - '', + '
<%= scope.txtAdvancedSettings %>
', + '
', '', '', '', @@ -1002,7 +1058,8 @@ define([ txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE', strIgnoreWordsWithNumbers: 'Ignore words with numbers', - strShowOthersChanges: 'Show changes from other users' + strShowOthersChanges: 'Show changes from other users', + txtAdvancedSettings: 'Advanced Settings' }, DE.Views.FileMenuPanels.Settings || {})); DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ @@ -1010,7 +1067,8 @@ define([ menu: undefined, template: _.template([ - '
' + '
<%= scope.txtOpenRecent %>
', + '
' ].join('')), initialize: function(options) { @@ -1021,7 +1079,7 @@ define([ }, render: function() { - this.$el.html(this.template()); + this.$el.html(this.template({scope: this})); this.viewRecentPicker = new Common.UI.DataView({ el: $('#id-recent-view'), @@ -1060,7 +1118,9 @@ define([ onRecentFileClick: function(view, itemview, record){ if ( this.menu ) this.menu.fireEvent('recent:open', [this.menu, record.get('url')]); - } + }, + + txtOpenRecent: 'Open Recent' }); DE.Views.FileMenuPanels.CreateNew = Common.UI.BaseView.extend(_.extend({ @@ -1075,7 +1135,7 @@ define([ }, template: _.template([ - '

<%= scope.txtCreateNew %>

', + '
<%= scope.txtCreateNew %>
', '
', '<% if (blank) { %> ', '
', @@ -1163,7 +1223,8 @@ define([ this.template = _.template([ '
', - '
', + '
' + this.txtDocumentInfo + '
', + '
', '', '', '', @@ -1289,7 +1350,7 @@ define([ '
', '
', '
', - '', + '
', '', '', '', @@ -1871,7 +1932,8 @@ define([ txtFastWV: 'Fast Web View', txtYes: 'Yes', txtNo: 'No', - txtPdfProducer: 'PDF Producer' + txtPdfProducer: 'PDF Producer', + txtDocumentInfo: 'Document Info' }, DE.Views.FileMenuPanels.DocumentInfo || {})); @@ -1884,7 +1946,8 @@ define([ this.rendered = false; this.template = _.template([ - '
', + '
' + this.txtAccessRights + '
', + '
', '', '', '', @@ -1999,7 +2062,8 @@ define([ }, txtRights: 'Persons who have rights', - txtBtnAccessRights: 'Change access rights' + txtBtnAccessRights: 'Change access rights', + txtAccessRights: 'Access Rights' }, DE.Views.FileMenuPanels.DocumentRights || {})); DE.Views.FileMenuPanels.Help = Common.UI.BaseView.extend({ @@ -2212,23 +2276,30 @@ define([ menu: undefined, template: _.template([ - '', + '', '
', '', - '
', - '
', - '', - '', - '', - '', - '', - '', - '', - '
', + '
', + '
<%= scope.txtProtectDocument %>
', + '
', + '
', + '
', + '
<%= scope.txtEncrypted %>
', + '
', + '
', + '
', + '
', + '
', '
', '
', '', - '
', + '
', + '
<%= scope.txtAddSignature %>
', + '
', + '
', + '
', + '
<%= scope.txtAddedSignature %>
', + '
', '
', '
' ].join('')), @@ -2240,15 +2311,13 @@ define([ var me = this; this.templateSignature = _.template([ - '', - '', - '', + '
', + '
<%= tipText %>
', + '
', + '', + '', '
', - '', - '', - '', - '', - '
' + '' ].join('')); }, @@ -2270,7 +2339,8 @@ define([ this.btnDeletePwd.on('click', _.bind(this.closeMenu, this)); this.cntPassword = $('#id-fms-password'); - this.cntPasswordView = $('#id-fms-view-pwd'); + this.cntEncryptBlock = this.$el.find('.encrypt-block'); + this.cntEncryptedBlock = this.$el.find('.encrypted-block'); this.btnAddInvisibleSign = protection.getButton('signature'); this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign')); @@ -2278,6 +2348,10 @@ define([ this.cntSignature = $('#id-fms-signature'); this.cntSignatureView = $('#id-fms-signature-view'); + + this.cntAddSignature = this.$el.find('.add-signature-block'); + this.cntAddedSignature = this.$el.find('.added-signature-block'); + if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ el: this.$el, @@ -2360,10 +2434,16 @@ define([ tipText = this.txtRequestedSignatures + (tipText!="" ? "

" : "")+ tipText; this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid), hasRequested: hasRequested})); + + var isAddedSignature = this.btnAddInvisibleSign.$el.find('button').hasClass('hidden'); + this.cntAddSignature.toggleClass('hidden', isAddedSignature); + this.cntAddedSignature.toggleClass('hidden', !isAddedSignature); }, updateEncrypt: function() { - this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible()); + var isProtected = this.btnAddPwd.$el.find('button').hasClass('hidden'); + this.cntEncryptBlock.toggleClass('hidden', isProtected); + this.cntEncryptedBlock.toggleClass('hidden', !isProtected); }, strProtect: 'Protect Document', @@ -2376,7 +2456,10 @@ define([ notcriticalErrorTitle: 'Warning', txtEditWarning: 'Editing will remove the signatures from the document.
Are you sure you want to continue?', strEncrypt: 'With Password', - txtEncrypted: 'This document has been protected by password' + txtProtectDocument: 'Encrypt this document with a password', + txtEncrypted: 'A password is required to open this document', + txtAddSignature: 'Ensure the integrity of the document by adding an
invisible digital signature', + txtAddedSignature: 'Valid signatures have been added to the document.
The document is protected from editing.' }, DE.Views.FileMenuPanels.ProtectDoc || {})); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index dc960c35f..8feadb630 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1966,19 +1966,24 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded", "DE.Views.FileMenuPanels.DocumentInfo.txtWords": "Words", "DE.Views.FileMenuPanels.DocumentInfo.txtYes": "Yes", + "DE.Views.FileMenuPanels.DocumentInfo.txtDocumentInfo": "Document Info", "DE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "DE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", + "DE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access Rights", "DE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Warning", "DE.Views.FileMenuPanels.ProtectDoc.strEncrypt": "With password", "DE.Views.FileMenuPanels.ProtectDoc.strProtect": "Protect Document", "DE.Views.FileMenuPanels.ProtectDoc.strSignature": "With signature", "DE.Views.FileMenuPanels.ProtectDoc.txtEdit": "Edit document", "DE.Views.FileMenuPanels.ProtectDoc.txtEditWarning": "Editing will remove signatures from the document.
Continue?", - "DE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "This document has been protected with password", + "DE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "A password is required to open this document", "DE.Views.FileMenuPanels.ProtectDoc.txtRequestedSignatures": "This document needs to be signed.", "DE.Views.FileMenuPanels.ProtectDoc.txtSigned": "Valid signatures have been added to the document. The document is protected from editing.", "DE.Views.FileMenuPanels.ProtectDoc.txtSignedInvalid": "Some of the digital signatures in the document are invalid or could not be verified. The document is protected from editing.", "DE.Views.FileMenuPanels.ProtectDoc.txtView": "View signatures", + "DE.Views.FileMenuPanels.ProtectDoc.txtProtectDocument": "Encrypt this document with a password", + "DE.Views.FileMenuPanels.ProtectDoc.txtAddSignature": "Ensure the integrity of the document by adding an
invisible digital signature", + "DE.Views.FileMenuPanels.ProtectDoc.txtAddedSignature": "Valid signatures have been added to the document.
The document is protected from editing.", "DE.Views.FileMenuPanels.Settings.okButtonText": "Apply", "DE.Views.FileMenuPanels.Settings.strCoAuthMode": "Co-editing Mode", "DE.Views.FileMenuPanels.Settings.strFast": "Fast", @@ -2039,6 +2044,10 @@ "DE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification", "DE.Views.FileMenuPanels.Settings.txtWin": "as Windows", "DE.Views.FileMenuPanels.Settings.txtWorkspace": "Workspace", + "DE.Views.FileMenuPanels.Settings.txtAdvancedSettings": "Advanced Settings", + "DE.Views.FileMenuPanels.ViewSaveAs.textDownloadAs": "Download as", + "DE.Views.FileMenuPanels.ViewSaveCopy.textSaveCopyAs": "Save Copy as", + "DE.Views.FileMenuPanels.RecentFiles.txtOpenRecent": "Open Recent", "DE.Views.FormSettings.textAlways": "Always", "DE.Views.FormSettings.textAspect": "Lock aspect ratio", "DE.Views.FormSettings.textAtLeast": "At least", diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index eab2e5353..105b6ccf8 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -82,14 +82,38 @@ } } -#panel-saveas, #panel-savecopy { - table { - margin-left: auto; - margin-right: auto; - margin-bottom: 24px; +#file-menu-panel .panel-context { + #panel-saveas, #panel-savecopy { + &.content-box { + padding: 0 0 0 20px; + } - .btn-doc-format { - margin: 24px 12px 0px; + .content-container { + margin: 30px 0 0 10px; + + .header { + font-size: 16px; + margin-bottom: 20px; + } + + .format-items { + .format-item { + float: left; + margin: 0 24px 34px 0; + + .btn-doc-format { + width: 70px; + height: 90px; + } + } + + .divider { + float: left; + width: 0; + height: 0; + } + + } } } } @@ -152,6 +176,12 @@ &djvu { background: ~"url('@{common-image-const-path}/doc-formats/djvu.svg') no-repeat center"; } + &png { + background: ~"url('@{common-image-const-path}/doc-formats/png.svg') no-repeat center"; + } + &jpg { + background: ~"url('@{common-image-const-path}/doc-formats/jpg.svg') no-repeat center"; + } } div { @@ -196,6 +226,11 @@ } #panel-settings { + .header { + margin: 30px 0 16px 30px; + font-size: 16px; + } + table { width: auto !important; tr { @@ -243,31 +278,14 @@ } #panel-createnew { - h3 { - margin: 0; - font-size: 10pt; - color: @text-normal-ie; - color: @text-normal; - .font-weight-bold(); - padding: 0 0 10px 10px; + .header { + font-size: 16px; + padding: 0 0 0 10px; white-space: nowrap; + margin-top: 30px; + margin-bottom: 20px; } - - - .blank-document-info { - vertical-align: top; - width: 445px; - display: inline-block; - - h3 { - padding-left: 0; - padding-top: 40px; - white-space: nowrap; - } - } - - hr { margin: 0; border-bottom: none; @@ -324,6 +342,15 @@ } #panel-recentfiles { + #id-recent-view { + margin: 0 0 20px 10px; + } + + .header { + margin: 30px 0 20px 10px; + font-size: 16px; + } + .item { border: none; width: 100%; @@ -425,6 +452,18 @@ #file-menu-panel & { padding: 0 30px; } + + .header { + margin: 30px 0 20px 0; + font-size: 16px; + } +} + +#panel-info { + .header { + margin: 30px 0 20px 30px; + font-size: 16px; + } } #panel-info, @@ -437,7 +476,7 @@ &.left { padding: 5px 10px; text-align: right; - width: 30%; + width: 200px; label { .font-weight-bold(); @@ -446,7 +485,7 @@ &.right { padding: 5px 10px; - width: 70%; + width: calc(100% - 200px); } } @@ -515,22 +554,51 @@ } #panel-protect { -label { - font-size: 12px; -} - -#file-menu-panel & { - padding: 30px 30px; -} - -.header { - .font-weight-bold(); - margin: 30px 0 10px; -} - -table { - td { - padding: 5px 0; + label { + font-size: 12px; + } + + #file-menu-panel & { + padding: 30px 30px; + } + + .header { + .font-weight-bold(); + margin: 20px 0 4px 0; + } + + .description { + color: @text-secondary-ie; + color: @text-secondary; + margin-bottom: 12px; + } + + .buttons { + display: flex; + } + + #fms-btn-delete-pwd { + margin-left: 16px; + } + + .signature-view-link { + margin-right: 20px; + } + + .signature-tip { + margin-bottom: 6px; + } + + #fms-btn-invisible-sign { + margin-bottom: 20px; + } + + #id-fms-lbl-protect-header { + font-size: 16px; + } + + .btn-text-default.auto { + padding-left: 12px; + padding-right: 12px; } -} } \ No newline at end of file diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 7e0e0ba5b..a9cbee1e8 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -55,35 +55,36 @@ define([ formats: [[ {name: 'PPTX', imgCls: 'pptx', type: Asc.c_oAscFileType.PPTX}, + {name: 'PPSX', imgCls: 'ppsx', type: Asc.c_oAscFileType.PPSX}, {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, {name: 'ODP', imgCls: 'odp', type: Asc.c_oAscFileType.ODP} ],[ {name: 'POTX', imgCls: 'potx', type: Asc.c_oAscFileType.POTX}, + {name: 'PPTM', imgCls: 'pptm', type: Asc.c_oAscFileType.PPTM}, {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, {name: 'OTP', imgCls: 'otp', type: Asc.c_oAscFileType.OTP} ], [ - {name: 'PPSX', imgCls: 'ppsx', type: Asc.c_oAscFileType.PPSX}, - {name: 'PNG', imgCls: 'png', type: Asc.c_oAscFileType.PNG}, - {name: 'JPG', imgCls: 'jpg', type: Asc.c_oAscFileType.JPG} - ], [ - {name: 'PPTM', imgCls: 'pptm', type: Asc.c_oAscFileType.PPTM} + {name: 'JPG', imgCls: 'jpg', type: Asc.c_oAscFileType.JPG}, + {name: 'PNG', imgCls: 'png', type: Asc.c_oAscFileType.PNG} ]], template: _.template([ - '', - '<% _.each(rows, function(row) { %>', - '', + '
', + '
<%= header %>
', + '
', + '<% _.each(rows, function(row) { %>', '<% _.each(row, function(item) { %>', - '<% if (item.type!==Asc.c_oAscFileType.PPTM || fileType=="pptm") { %>', - '
', + '<% if (item.type!==Asc.c_oAscFileType.DOCM || fileType=="docm") { %>', + '
', + '
', + '
', '<% } %>', '<% }) %>', - '', - '<% }) %>', - '
', - '
', - '
' + '
', + '<% }) %>', + '', + '' ].join('')), initialize: function(options) { @@ -91,10 +92,20 @@ define([ this.menu = options.menu; this.fileType = options.fileType; + + Common.NotificationCenter.on({ + 'window:resize': _.bind(function() { + var divided = Common.Utils.innerWidth() >= this.maxWidth; + if (this.isDivided !== divided) { + this.$el.find('.divider').css('width', divided ? '100%' : '0'); + this.isDivided = divided; + } + }, this) + }); }, render: function() { - this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'pptx').toLowerCase()})); + this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'pptx').toLowerCase(), header: this.textDownloadAs})); $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); if (_.isUndefined(this.scroller)) { @@ -105,6 +116,21 @@ define([ }); } + var itemWidth = 70 + 24, // width + margin + maxCount = 0; + this.formats.forEach(_.bind(function (item, index) { + var count = item.length; + if (count > maxCount) { + maxCount = count; + } + }, this)); + this.maxWidth = $('#file-menu-panel .panel-menu').outerWidth() + 20 + 10 + itemWidth * maxCount; // menu + left padding + margin + + if (Common.Utils.innerWidth() >= this.maxWidth) { + this.$el.find('.divider').css('width', '100%'); + this.isDivided = true; + } + return this; }, @@ -118,7 +144,9 @@ define([ if (!_.isUndefined(type) && this.menu) { this.menu.fireEvent('saveas:format', [this.menu, parseInt(type.value)]); } - } + }, + + textDownloadAs: "Download as" }); PE.Views.FileMenuPanels.ViewSaveCopy = Common.UI.BaseView.extend({ @@ -126,35 +154,36 @@ define([ menu: undefined, formats: [[ - {name: 'PPTX', imgCls: 'pptx', type: Asc.c_oAscFileType.PPTX, ext: '.pptx'}, - {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF, ext: '.pdf'}, - {name: 'ODP', imgCls: 'odp', type: Asc.c_oAscFileType.ODP, ext: '.odp'} + {name: 'PPTX', imgCls: 'pptx', type: Asc.c_oAscFileType.PPTX}, + {name: 'PPSX', imgCls: 'ppsx', type: Asc.c_oAscFileType.PPSX}, + {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, + {name: 'ODP', imgCls: 'odp', type: Asc.c_oAscFileType.ODP} ],[ - {name: 'POTX', imgCls: 'potx', type: Asc.c_oAscFileType.POTX, ext: '.potx'}, - {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA, ext: '.pdf'}, - {name: 'OTP', imgCls: 'otp', type: Asc.c_oAscFileType.OTP, ext: '.otp'} + {name: 'POTX', imgCls: 'potx', type: Asc.c_oAscFileType.POTX}, + {name: 'PPTM', imgCls: 'pptm', type: Asc.c_oAscFileType.PPTM}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, + {name: 'OTP', imgCls: 'otp', type: Asc.c_oAscFileType.OTP} ], [ - {name: 'PPSX', imgCls: 'ppsx', type: Asc.c_oAscFileType.PPSX, ext: '.ppsx'}, - {name: 'PNG', imgCls: 'png', type: Asc.c_oAscFileType.PNG, ext: '.zip'}, - {name: 'JPG', imgCls: 'jpg', type: Asc.c_oAscFileType.JPG, ext: '.zip'} - ], [ - {name: 'PPTM', imgCls: 'pptm', type: Asc.c_oAscFileType.PPTM, ext: '.pptm'} + {name: 'JPG', imgCls: 'jpg', type: Asc.c_oAscFileType.JPG}, + {name: 'PNG', imgCls: 'png', type: Asc.c_oAscFileType.PNG} ]], template: _.template([ - '', - '<% _.each(rows, function(row) { %>', - '', + '
', + '
<%= header %>
', + '
', + '<% _.each(rows, function(row) { %>', '<% _.each(row, function(item) { %>', - '<% if (item.type!==Asc.c_oAscFileType.PPTM || fileType=="pptm") { %>', - '
', + '<% if (item.type!==Asc.c_oAscFileType.DOCM || fileType=="docm") { %>', + '
', + '
', + '
', '<% } %>', '<% }) %>', - '', - '<% }) %>', - '
', - '
', - '
' + '
', + '<% }) %>', + '', + '' ].join('')), initialize: function(options) { @@ -162,10 +191,20 @@ define([ this.menu = options.menu; this.fileType = options.fileType; + + Common.NotificationCenter.on({ + 'window:resize': _.bind(function() { + var divided = Common.Utils.innerWidth() >= this.maxWidth; + if (this.isDivided !== divided) { + this.$el.find('.divider').css('width', divided ? '100%' : '0'); + this.isDivided = divided; + } + }, this) + }); }, render: function() { - this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'pptx').toLowerCase()})); + this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'pptx').toLowerCase(), header: this.textSaveCopyAs})); $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); if (_.isUndefined(this.scroller)) { @@ -176,6 +215,21 @@ define([ }); } + var itemWidth = 70 + 24, // width + margin + maxCount = 0; + this.formats.forEach(_.bind(function (item, index) { + var count = item.length; + if (count > maxCount) { + maxCount = count; + } + }, this)); + this.maxWidth = $('#file-menu-panel .panel-menu').outerWidth() + 20 + 10 + itemWidth * maxCount; // menu + left padding + margin + + if (Common.Utils.innerWidth() >= this.maxWidth) { + this.$el.find('.divider').css('width', '100%'); + this.isDivided = true; + } + return this; }, @@ -190,7 +244,9 @@ define([ if (!_.isUndefined(type) && !_.isUndefined(ext) && this.menu) { this.menu.fireEvent('savecopy:format', [this.menu, parseInt(type.value), ext.value]); } - } + }, + + textSaveCopyAs: "Save Copy as" }); PE.Views.FileMenuPanels.Settings = Common.UI.BaseView.extend(_.extend({ @@ -199,7 +255,8 @@ define([ template: _.template([ '
', - '', + '
<%= scope.txtAdvancedSettings %>
', + '
', '', '', '', @@ -779,7 +836,8 @@ define([ txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE', strIgnoreWordsWithNumbers: 'Ignore words with numbers', - strShowOthersChanges: 'Show changes from other users' + strShowOthersChanges: 'Show changes from other users', + txtAdvancedSettings: 'Advanced Settings' }, PE.Views.FileMenuPanels.Settings || {})); PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ @@ -787,7 +845,8 @@ define([ menu: undefined, template: _.template([ - '
' + '
<%= scope.txtOpenRecent %>
', + '
' ].join('')), initialize: function(options) { @@ -798,7 +857,7 @@ define([ }, render: function() { - this.$el.html(this.template()); + this.$el.html(this.template({scope: this})); this.viewRecentPicker = new Common.UI.DataView({ el: $('#id-recent-view'), @@ -837,7 +896,9 @@ define([ onRecentFileClick: function(view, itemview, record){ if ( this.menu ) this.menu.fireEvent('recent:open', [this.menu, record.get('url')]); - } + }, + + txtOpenRecent: 'Open Recent' }); PE.Views.FileMenuPanels.CreateNew = Common.UI.BaseView.extend(_.extend({ @@ -852,7 +913,7 @@ define([ }, template: _.template([ - '

<%= scope.txtCreateNew %>

', + '
<%= scope.txtCreateNew %>
', '
', '<% if (blank) { %> ', '
', @@ -940,7 +1001,8 @@ define([ this.template = _.template([ '
', - '
', + '
' + this.txtPresentationInfo + '
', + '
', '', '', '', @@ -1368,7 +1430,8 @@ define([ txtAddAuthor: 'Add Author', txtAddText: 'Add Text', txtMinutes: 'min', - okButtonText: 'Apply' + okButtonText: 'Apply', + txtPresentationInfo: 'Presentation Info' }, PE.Views.FileMenuPanels.DocumentInfo || {})); PE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({ @@ -1380,7 +1443,8 @@ define([ this.rendered = false; this.template = _.template([ - '
', + '
' + this.txtAccessRights + '
', + '
', '', '', '', @@ -1492,7 +1556,8 @@ define([ }, txtRights: 'Persons who have rights', - txtBtnAccessRights: 'Change access rights' + txtBtnAccessRights: 'Change access rights', + txtAccessRights: 'Access Rights' }, PE.Views.FileMenuPanels.DocumentRights || {})); PE.Views.FileMenuPanels.Help = Common.UI.BaseView.extend({ @@ -1688,23 +1753,30 @@ define([ menu: undefined, template: _.template([ - '', + '', '
', '', - '
', - '
', - '', - '', - '', - '', - '', - '', - '', - '
', + '
', + '
<%= scope.txtProtectPresentation %>
', + '
', + '
', + '
', + '
<%= scope.txtEncrypted %>
', + '
', + '
', + '
', + '
', + '
', '
', '
', '', - '
', + '
', + '
<%= scope.txtAddSignature %>
', + '
', + '
', + '
', + '
<%= scope.txtAddedSignature %>
', + '
', '
', '
' ].join('')), @@ -1716,15 +1788,13 @@ define([ var me = this; this.templateSignature = _.template([ - '', - '', - '', - '', - '', - '', - '', - '', - '
' + '
', + '
<%= tipText %>
', + '
', + '', + '', + '
', + '
' ].join('')); }, @@ -1746,7 +1816,8 @@ define([ this.btnDeletePwd.on('click', _.bind(this.closeMenu, this)); this.cntPassword = $('#id-fms-password'); - this.cntPasswordView = $('#id-fms-view-pwd'); + this.cntEncryptBlock = this.$el.find('.encrypt-block'); + this.cntEncryptedBlock = this.$el.find('.encrypted-block'); this.btnAddInvisibleSign = protection.getButton('signature'); this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign')); @@ -1754,6 +1825,10 @@ define([ this.cntSignature = $('#id-fms-signature'); this.cntSignatureView = $('#id-fms-signature-view'); + + this.cntAddSignature = this.$el.find('.add-signature-block'); + this.cntAddedSignature = this.$el.find('.added-signature-block'); + if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ el: this.$el, @@ -1830,10 +1905,16 @@ define([ var tipText = (hasInvalid) ? this.txtSignedInvalid : (hasValid ? this.txtSigned : ""); this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid)})); + + var isAddedSignature = this.btnAddInvisibleSign.$el.find('button').hasClass('hidden'); + this.cntAddSignature.toggleClass('hidden', isAddedSignature); + this.cntAddedSignature.toggleClass('hidden', !isAddedSignature); }, updateEncrypt: function() { - this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible()); + var isProtected = this.btnAddPwd.$el.find('button').hasClass('hidden'); + this.cntEncryptBlock.toggleClass('hidden', isProtected); + this.cntEncryptedBlock.toggleClass('hidden', !isProtected); }, strProtect: 'Protect Presentation', @@ -1845,7 +1926,10 @@ define([ notcriticalErrorTitle: 'Warning', txtEditWarning: 'Editing will remove the signatures from the presentation.
Are you sure you want to continue?', strEncrypt: 'With Password', - txtEncrypted: 'This presentation has been protected by password' + txtProtectPresentation: 'Encrypt this presentation with a password', + txtEncrypted: 'A password is required to open this presentation', + txtAddSignature: 'Ensure the integrity of the presentation by adding an
invisible digital signature', + txtAddedSignature: 'Valid signatures have been added to the presentation.
The presentation is protected from editing.' }, PE.Views.FileMenuPanels.ProtectDoc || {})); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 3dc282f53..2393b3e70 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1858,18 +1858,23 @@ "PE.Views.FileMenuPanels.DocumentInfo.txtTags": "Tags", "PE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Title", "PE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded", + "PE.Views.FileMenuPanels.DocumentInfo.txtPresentationInfo": "Presentation Info", "PE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights", "PE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights", + "PE.Views.FileMenuPanels.DocumentRights.txtAccessRights": "Access Rights", "PE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Warning", "PE.Views.FileMenuPanels.ProtectDoc.strEncrypt": "With password", "PE.Views.FileMenuPanels.ProtectDoc.strProtect": "Protect Presentation", "PE.Views.FileMenuPanels.ProtectDoc.strSignature": "With signature", "PE.Views.FileMenuPanels.ProtectDoc.txtEdit": "Edit presentation", "PE.Views.FileMenuPanels.ProtectDoc.txtEditWarning": "Editing will remove signatures from the presentation.
Continue?", - "PE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "This presentation has been protected by password", + "PE.Views.FileMenuPanels.ProtectDoc.txtEncrypted": "A password is required to open this presentation", "PE.Views.FileMenuPanels.ProtectDoc.txtSigned": "Valid signatures have been added to the presentation. The presentation is protected from editing.", "PE.Views.FileMenuPanels.ProtectDoc.txtSignedInvalid": "Some of the digital signatures in presentation are invalid or could not be verified. The presentation is protected from editing.", "PE.Views.FileMenuPanels.ProtectDoc.txtView": "View signatures", + "PE.Views.FileMenuPanels.ProtectDoc.txtProtectPresentation": "Encrypt this presentation with a password", + "PE.Views.FileMenuPanels.ProtectDoc.txtAddSignature": "Ensure the integrity of the presentation by adding an
invisible digital signature", + "PE.Views.FileMenuPanels.ProtectDoc.txtAddedSignature": "Valid signatures have been added to the presentation.
The presentation is protected from editing.", "PE.Views.FileMenuPanels.Settings.okButtonText": "Apply", "PE.Views.FileMenuPanels.Settings.strCoAuthMode": "Co-editing Mode", "PE.Views.FileMenuPanels.Settings.strFast": "Fast", @@ -1921,6 +1926,10 @@ "PE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with a notification", "PE.Views.FileMenuPanels.Settings.txtWin": "as Windows", "PE.Views.FileMenuPanels.Settings.txtWorkspace": "Workspace", + "PE.Views.FileMenuPanels.Settings.txtAdvancedSettings": "Advanced Settings", + "PE.Views.FileMenuPanels.ViewSaveAs.textDownloadAs": "Download as", + "PE.Views.FileMenuPanels.ViewSaveCopy.textSaveCopyAs": "Save Copy as", + "PE.Views.FileMenuPanels.RecentFiles.txtOpenRecent": "Open Recent", "PE.Views.GridSettings.textCm": "cm", "PE.Views.GridSettings.textCustom": "Custom", "PE.Views.GridSettings.textSpacing": "Spacing", diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 15f97642c..7add78757 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -192,13 +192,35 @@ } #panel-saveas, #panel-savecopy { - table { - margin-left: auto; - margin-right: auto; - margin-bottom: 24px; + &.content-box { + padding: 0 0 0 20px; + } + + .content-container { + margin: 30px 0 0 10px; + + .header { + font-size: 16px; + margin-bottom: 20px; + } + + .format-items { + .format-item { + float: left; + margin: 0 24px 34px 0; + + .btn-doc-format { + width: 70px; + height: 90px; + } + } + + .divider { + float: left; + width: 0; + height: 0; + } - .btn-doc-format { - margin: 24px 12px 0px; } } } @@ -211,6 +233,11 @@ } #panel-settings { + .header { + margin: 30px 0 16px 30px; + font-size: 16px; + } + table { width: auto !important; @@ -257,26 +284,12 @@ } #panel-createnew { - h3 { - margin: 0; - font-size: 10pt; - color: @text-normal-ie; - color: @text-normal; - .font-weight-bold(); - padding: 0 0 10px 10px; + .header { + font-size: 16px; + padding: 0 0 0 10px; white-space: nowrap; - } - - .blank-document-info { - vertical-align: top; - width: 445px; - display: inline-block; - - h3 { - padding-left: 0; - padding-top: 45px; - white-space: nowrap; - } + margin-top: 30px; + margin-bottom: 20px; } hr { @@ -334,6 +347,15 @@ } #panel-recentfiles { + #id-recent-view { + margin: 0 0 20px 10px; + } + + .header { + margin: 30px 0 20px 10px; + font-size: 16px; + } + .dataview { & > div:not([class^=ps-scrollbar]) { border: none; @@ -434,6 +456,18 @@ #panel-rights { padding: 0 30px; + + .header { + margin: 30px 0 20px 0; + font-size: 16px; + } + } + + #panel-info { + .header { + margin: 30px 0 20px 30px; + font-size: 16px; + } } #panel-info, @@ -446,7 +480,7 @@ &.left { padding: 5px 10px; text-align: right; - width: 30%; + width: 200px; label { .font-weight-bold(); @@ -455,7 +489,7 @@ &.right { padding: 5px 10px; - width: 70%; + width: calc(100% - 200px); } } @@ -503,21 +537,50 @@ } #panel-protect { + padding: 30px 30px; + label { font-size: 12px; } - padding: 30px 30px; - .header { .font-weight-bold(); - margin: 30px 0 10px; + margin: 20px 0 4px 0; } - table { - td { - padding: 5px 0; - } + .description { + color: @text-secondary-ie; + color: @text-secondary; + margin-bottom: 12px; + } + + .buttons { + display: flex; + } + + #fms-btn-delete-pwd { + margin-left: 16px; + } + + .signature-view-link { + margin-right: 20px; + } + + .signature-tip { + margin-bottom: 6px; + } + + #fms-btn-invisible-sign { + margin-bottom: 20px; + } + + #id-fms-lbl-protect-header { + font-size: 16px; + } + + .btn-text-default.auto { + padding-left: 12px; + padding-right: 12px; } } } diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 5dfb68a03..58fd82a0b 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -44,35 +44,36 @@ define([ formats: [[ {name: 'XLSX', imgCls: 'xlsx', type: Asc.c_oAscFileType.XLSX}, - {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, {name: 'ODS', imgCls: 'ods', type: Asc.c_oAscFileType.ODS}, - {name: 'CSV', imgCls: 'csv', type: Asc.c_oAscFileType.CSV} + {name: 'CSV', imgCls: 'csv', type: Asc.c_oAscFileType.CSV}, + {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF} ],[ {name: 'XLTX', imgCls: 'xltx', type: Asc.c_oAscFileType.XLTX}, - {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, {name: 'OTS', imgCls: 'ots', type: Asc.c_oAscFileType.OTS}, - {name: 'XLSM', imgCls: 'xlsm', type: Asc.c_oAscFileType.XLSM} - ] -// ,[ -// {name: 'HTML', imgCls: 'html', type: Asc.c_oAscFileType.HTML} -// ] - ], + {name: 'XLSM', imgCls: 'xlsm', type: Asc.c_oAscFileType.XLSM}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA} + ], [ + {name: 'JPG', imgCls: 'jpg', type: Asc.c_oAscFileType.JPG}, + {name: 'PNG', imgCls: 'png', type: Asc.c_oAscFileType.PNG} + ]], template: _.template([ - '', - '<% _.each(rows, function(row) { %>', - '', + '
', + '
<%= header %>
', + '
', + '<% _.each(rows, function(row) { %>', '<% _.each(row, function(item) { %>', - '<% if (item.type!==Asc.c_oAscFileType.XLSM || fileType=="xlsm") { %>', - '
', + '<% if (item.type!==Asc.c_oAscFileType.DOCM || fileType=="docm") { %>', + '
', + '
', + '
', '<% } %>', '<% }) %>', - '', - '<% }) %>', - '
', - '
', - '
' + '
', + '<% }) %>', + '', + '' ].join('')), initialize: function(options) { @@ -80,10 +81,20 @@ define([ this.menu = options.menu; this.fileType = options.fileType; + + Common.NotificationCenter.on({ + 'window:resize': _.bind(function() { + var divided = Common.Utils.innerWidth() >= this.maxWidth; + if (this.isDivided !== divided) { + this.$el.find('.divider').css('width', divided ? '100%' : '0'); + this.isDivided = divided; + } + }, this) + }); }, render: function() { - this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'xlsx').toLowerCase()})); + this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'xlsx').toLowerCase(), header: this.textDownloadAs})); $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); if (_.isUndefined(this.scroller)) { @@ -94,6 +105,21 @@ define([ }); } + var itemWidth = 70 + 24, // width + margin + maxCount = 0; + this.formats.forEach(_.bind(function (item, index) { + var count = item.length; + if (count > maxCount) { + maxCount = count; + } + }, this)); + this.maxWidth = $('#file-menu-panel .panel-menu').outerWidth() + 20 + 10 + itemWidth * maxCount; // menu + left padding + margin + + if (Common.Utils.innerWidth() >= this.maxWidth) { + this.$el.find('.divider').css('width', '100%'); + this.isDivided = true; + } + return this; }, @@ -107,7 +133,9 @@ define([ if (!_.isUndefined(type) && this.menu) { this.menu.fireEvent('saveas:format', [this.menu, parseInt(type.value)]); } - } + }, + + textDownloadAs: "Download as" }); SSE.Views.FileMenuPanels.ViewSaveCopy = Common.UI.BaseView.extend({ @@ -115,35 +143,36 @@ define([ menu: undefined, formats: [[ - {name: 'XLSX', imgCls: 'xlsx', type: Asc.c_oAscFileType.XLSX, ext: '.xlsx'}, - {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF, ext: '.pdf'}, - {name: 'ODS', imgCls: 'ods', type: Asc.c_oAscFileType.ODS, ext: '.ods'}, - {name: 'CSV', imgCls: 'csv', type: Asc.c_oAscFileType.CSV, ext: '.csv'} + {name: 'XLSX', imgCls: 'xlsx', type: Asc.c_oAscFileType.XLSX}, + {name: 'ODS', imgCls: 'ods', type: Asc.c_oAscFileType.ODS}, + {name: 'CSV', imgCls: 'csv', type: Asc.c_oAscFileType.CSV}, + {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF} ],[ - {name: 'XLTX', imgCls: 'xltx', type: Asc.c_oAscFileType.XLTX, ext: '.xltx'}, - {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA, ext: '.pdf'}, - {name: 'OTS', imgCls: 'ots', type: Asc.c_oAscFileType.OTS, ext: '.ots'}, - {name: 'XLSM', imgCls: 'xlsm', type: Asc.c_oAscFileType.XLSM, ext: '.xlsm'} - ] -// ,[ -// {name: 'HTML', imgCls: 'html', type: Asc.c_oAscFileType.HTML, ext: '.html'} -// ] - ], + {name: 'XLTX', imgCls: 'xltx', type: Asc.c_oAscFileType.XLTX}, + {name: 'OTS', imgCls: 'ots', type: Asc.c_oAscFileType.OTS}, + {name: 'XLSM', imgCls: 'xlsm', type: Asc.c_oAscFileType.XLSM}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA} + ], [ + {name: 'JPG', imgCls: 'jpg', type: Asc.c_oAscFileType.JPG}, + {name: 'PNG', imgCls: 'png', type: Asc.c_oAscFileType.PNG} + ]], template: _.template([ - '', - '<% _.each(rows, function(row) { %>', - '', + '
', + '
<%= header %>
', + '
', + '<% _.each(rows, function(row) { %>', '<% _.each(row, function(item) { %>', - '<% if (item.type!==Asc.c_oAscFileType.XLSM || fileType=="xlsm") { %>', - '
', + '<% if (item.type!==Asc.c_oAscFileType.DOCM || fileType=="docm") { %>', + '
', + '
', + '
', '<% } %>', '<% }) %>', - '', - '<% }) %>', - '
', - '
', - '
' + '
', + '<% }) %>', + '', + '' ].join('')), initialize: function(options) { @@ -151,10 +180,20 @@ define([ this.menu = options.menu; this.fileType = options.fileType; + + Common.NotificationCenter.on({ + 'window:resize': _.bind(function() { + var divided = Common.Utils.innerWidth() >= this.maxWidth; + if (this.isDivided !== divided) { + this.$el.find('.divider').css('width', divided ? '100%' : '0'); + this.isDivided = divided; + } + }, this) + }); }, render: function() { - this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'xlsx').toLowerCase()})); + this.$el.html(this.template({rows:this.formats, fileType: (this.fileType || 'xlsx').toLowerCase(), header: this.textSaveCopyAs})); $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); if (_.isUndefined(this.scroller)) { @@ -165,6 +204,21 @@ define([ }); } + var itemWidth = 70 + 24, // width + margin + maxCount = 0; + this.formats.forEach(_.bind(function (item, index) { + var count = item.length; + if (count > maxCount) { + maxCount = count; + } + }, this)); + this.maxWidth = $('#file-menu-panel .panel-menu').outerWidth() + 20 + 10 + itemWidth * maxCount; // menu + left padding + margin + + if (Common.Utils.innerWidth() >= this.maxWidth) { + this.$el.find('.divider').css('width', '100%'); + this.isDivided = true; + } + return this; }, @@ -179,7 +233,9 @@ define([ if (!_.isUndefined(type) && !_.isUndefined(ext) && this.menu) { this.menu.fireEvent('savecopy:format', [this.menu, parseInt(type.value), ext.value]); } - } + }, + + textSaveCopyAs: "Save Copy as" }); SSE.Views.FileMenuPanels.MainSettingsGeneral = Common.UI.BaseView.extend(_.extend({ @@ -188,7 +244,8 @@ define([ template: _.template([ '
', - '', + '
<%= scope.txtAdvancedSettings %>
', + '
', '', '', '', @@ -1173,7 +1230,8 @@ define([ txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', strShowOthersChanges: 'Show changes from other users', txtCalculating: 'Calculating', - strDateFormat1904: 'Use 1904 date system' + strDateFormat1904: 'Use 1904 date system', + txtAdvancedSettings: 'Advanced Settings' }, SSE.Views.FileMenuPanels.MainSettingsGeneral || {})); @@ -1182,7 +1240,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ menu: undefined, template: _.template([ - '
' + '
<%= scope.txtOpenRecent %>
', + '
' ].join('')), initialize: function(options) { @@ -1193,7 +1252,7 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ }, render: function() { - this.$el.html(this.template()); + this.$el.html(this.template({scope: this})); this.viewRecentPicker = new Common.UI.DataView({ el: $('#id-recent-view'), @@ -1232,7 +1291,9 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ onRecentFileClick: function(view, itemview, record){ if ( this.menu ) this.menu.fireEvent('recent:open', [this.menu, record.get('url')]); - } + }, + + txtOpenRecent: 'Open Recent' }); SSE.Views.FileMenuPanels.CreateNew = Common.UI.BaseView.extend(_.extend({ @@ -1247,7 +1308,7 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ }, template: _.template([ - '

<%= scope.txtCreateNew %>

', + '
<%= scope.txtCreateNew %>
', '
', '<% if (blank) { %> ', '
', @@ -1335,7 +1396,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ this.template = _.template([ '
', - '
', + '
' + this.txtSpreadsheetInfo + '
', + '
', '', '', '', @@ -1758,7 +1820,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ txtAddAuthor: 'Add Author', txtAddText: 'Add Text', txtMinutes: 'min', - okButtonText: 'Apply' + okButtonText: 'Apply', + txtSpreadsheetInfo: 'Spreadsheet Info' }, SSE.Views.FileMenuPanels.DocumentInfo || {})); SSE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({ @@ -1770,7 +1833,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ this.rendered = false; this.template = _.template([ - '
', + '
' + this.txtAccessRights + '
', + '
', '', '', '', @@ -1880,7 +1944,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ }, txtRights: 'Persons who have rights', - txtBtnAccessRights: 'Change access rights' + txtBtnAccessRights: 'Change access rights', + txtAccessRights: 'Access Rights' }, SSE.Views.FileMenuPanels.DocumentRights || {})); SSE.Views.FileMenuPanels.Help = Common.UI.BaseView.extend({ @@ -2078,23 +2143,30 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ menu: undefined, template: _.template([ - '', + '', '
', '', - '
', - '
', - '', - '', - '', - '', - '', - '', - '', - '
', + '
', + '
<%= scope.txtProtectSpreadsheet %>
', + '
', + '
', + '
', + '
<%= scope.txtEncrypted %>
', + '
', + '
', + '
', + '
', + '
', '
', '
', '', - '
', + '
', + '
<%= scope.txtAddSignature %>
', + '
', + '
', + '
', + '
<%= scope.txtAddedSignature %>
', + '
', '
', '
' ].join('')), @@ -2106,15 +2178,13 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ var me = this; this.templateSignature = _.template([ - '', - '', - '', - '', - '', - '', - '', - '', - '
' + '
', + '
<%= tipText %>
', + '
', + '', + '', + '
', + '
' ].join('')); }, @@ -2136,7 +2206,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ this.btnDeletePwd.on('click', _.bind(this.closeMenu, this)); this.cntPassword = $('#id-fms-password'); - this.cntPasswordView = $('#id-fms-view-pwd'); + this.cntEncryptBlock = this.$el.find('.encrypt-block'); + this.cntEncryptedBlock = this.$el.find('.encrypted-block'); this.btnAddInvisibleSign = protection.getButton('signature'); this.btnAddInvisibleSign.render(this.$el.find('#fms-btn-invisible-sign')); @@ -2144,6 +2215,10 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ this.cntSignature = $('#id-fms-signature'); this.cntSignatureView = $('#id-fms-signature-view'); + + this.cntAddSignature = this.$el.find('.add-signature-block'); + this.cntAddedSignature = this.$el.find('.added-signature-block'); + if (_.isUndefined(this.scroller)) { this.scroller = new Common.UI.Scroller({ el: this.$el, @@ -2226,10 +2301,16 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ tipText = this.txtRequestedSignatures + (tipText!="" ? "

" : "")+ tipText; this.cntSignatureView.html(this.templateSignature({tipText: tipText, hasSigned: (hasValid || hasInvalid), hasRequested: hasRequested})); + + var isAddedSignature = this.btnAddInvisibleSign.$el.find('button').hasClass('hidden'); + this.cntAddSignature.toggleClass('hidden', isAddedSignature); + this.cntAddedSignature.toggleClass('hidden', !isAddedSignature); }, updateEncrypt: function() { - this.cntPasswordView.toggleClass('hidden', this.btnAddPwd.isVisible()); + var isProtected = this.btnAddPwd.$el.find('button').hasClass('hidden'); + this.cntEncryptBlock.toggleClass('hidden', isProtected); + this.cntEncryptedBlock.toggleClass('hidden', !isProtected); }, strProtect: 'Protect Workbook', @@ -2242,7 +2323,10 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ notcriticalErrorTitle: 'Warning', txtEditWarning: 'Editing will remove the signatures from the workbook.
Are you sure you want to continue?', strEncrypt: 'With Password', - txtEncrypted: 'This workbook has been protected by password' + txtProtectSpreadsheet: 'Encrypt this spreadsheet with a password', + txtEncrypted: 'A password is required to open this spreadsheet', + txtAddSignature: 'Ensure the integrity of the spreadsheet by adding an
invisible digital signature', + txtAddedSignature: 'Valid signatures have been added to the spreadsheet.
The spreadsheet is protected from editing.' }, SSE.Views.FileMenuPanels.ProtectDoc || {})); @@ -2255,6 +2339,7 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ '
', '