From e59d92d00a8fc6ae2d45acc0347970a0d93f2980 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Tue, 25 Apr 2023 17:34:30 +0300 Subject: [PATCH] add local recent files to menu file --- apps/common/main/lib/view/RecentFiles.js | 2 +- apps/common/main/resources/img/doc-formats/csv.svg | 2 +- apps/common/main/resources/img/doc-formats/djvu.svg | 2 +- apps/common/main/resources/img/doc-formats/docm.svg | 2 +- apps/common/main/resources/img/doc-formats/docx.svg | 2 +- apps/common/main/resources/img/doc-formats/docxf.svg | 2 +- apps/common/main/resources/img/doc-formats/dotx.svg | 2 +- apps/common/main/resources/img/doc-formats/epub.svg | 2 +- apps/common/main/resources/img/doc-formats/fb2.svg | 2 +- apps/common/main/resources/img/doc-formats/html.svg | 2 +- apps/common/main/resources/img/doc-formats/jpg.svg | 2 +- apps/common/main/resources/img/doc-formats/odp.svg | 2 +- apps/common/main/resources/img/doc-formats/ods.svg | 2 +- apps/common/main/resources/img/doc-formats/odt.svg | 2 +- apps/common/main/resources/img/doc-formats/oform.svg | 2 +- apps/common/main/resources/img/doc-formats/otp.svg | 2 +- apps/common/main/resources/img/doc-formats/ots.svg | 2 +- apps/common/main/resources/img/doc-formats/ott.svg | 2 +- apps/common/main/resources/img/doc-formats/oxps.svg | 2 +- apps/common/main/resources/img/doc-formats/pdf.svg | 2 +- apps/common/main/resources/img/doc-formats/pdfa.svg | 2 +- apps/common/main/resources/img/doc-formats/png.svg | 2 +- apps/common/main/resources/img/doc-formats/potx.svg | 2 +- apps/common/main/resources/img/doc-formats/ppsx.svg | 2 +- apps/common/main/resources/img/doc-formats/pptm.svg | 2 +- apps/common/main/resources/img/doc-formats/pptx.svg | 2 +- apps/common/main/resources/img/doc-formats/rtf.svg | 2 +- apps/common/main/resources/img/doc-formats/svg.svg | 2 +- apps/common/main/resources/img/doc-formats/txt.svg | 2 +- apps/common/main/resources/img/doc-formats/xlsm.svg | 2 +- apps/common/main/resources/img/doc-formats/xlsx.svg | 2 +- apps/common/main/resources/img/doc-formats/xltx.svg | 2 +- apps/common/main/resources/img/doc-formats/xps.svg | 2 +- apps/documenteditor/main/app/controller/Main.js | 8 +++++++- apps/documenteditor/main/resources/less/filemenu.less | 6 +++++- apps/presentationeditor/main/app/controller/Main.js | 8 +++++++- apps/presentationeditor/main/resources/less/leftmenu.less | 6 +++++- apps/spreadsheeteditor/main/app/controller/Main.js | 8 +++++++- apps/spreadsheeteditor/main/resources/less/leftmenu.less | 6 +++++- 39 files changed, 69 insertions(+), 39 deletions(-) diff --git a/apps/common/main/lib/view/RecentFiles.js b/apps/common/main/lib/view/RecentFiles.js index 642eb80acc..8375c4112c 100644 --- a/apps/common/main/lib/view/RecentFiles.js +++ b/apps/common/main/lib/view/RecentFiles.js @@ -73,7 +73,7 @@ define([ '
', '
', '
', - '
', + '
"svg-format-<%=format %>"<% } else {%> "svg-file-recent"<%} %>>
', '
', '
', '
<% if (typeof title !== "undefined") {%><%= Common.Utils.String.htmlEncode(title || "") %><% } %>
', diff --git a/apps/common/main/resources/img/doc-formats/csv.svg b/apps/common/main/resources/img/doc-formats/csv.svg index 713afe5d6c..471ce30340 100644 --- a/apps/common/main/resources/img/doc-formats/csv.svg +++ b/apps/common/main/resources/img/doc-formats/csv.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/djvu.svg b/apps/common/main/resources/img/doc-formats/djvu.svg index 7a0925dac1..1fd5146774 100644 --- a/apps/common/main/resources/img/doc-formats/djvu.svg +++ b/apps/common/main/resources/img/doc-formats/djvu.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/docm.svg b/apps/common/main/resources/img/doc-formats/docm.svg index b2ec812330..bac2c15520 100644 --- a/apps/common/main/resources/img/doc-formats/docm.svg +++ b/apps/common/main/resources/img/doc-formats/docm.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/docx.svg b/apps/common/main/resources/img/doc-formats/docx.svg index a0025f8924..540b3c95d8 100644 --- a/apps/common/main/resources/img/doc-formats/docx.svg +++ b/apps/common/main/resources/img/doc-formats/docx.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/docxf.svg b/apps/common/main/resources/img/doc-formats/docxf.svg index 846bc4c5b7..ece45fc320 100644 --- a/apps/common/main/resources/img/doc-formats/docxf.svg +++ b/apps/common/main/resources/img/doc-formats/docxf.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/dotx.svg b/apps/common/main/resources/img/doc-formats/dotx.svg index f006c5b5fd..17c110f31e 100644 --- a/apps/common/main/resources/img/doc-formats/dotx.svg +++ b/apps/common/main/resources/img/doc-formats/dotx.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/epub.svg b/apps/common/main/resources/img/doc-formats/epub.svg index 8f246520f4..f6c4d29326 100644 --- a/apps/common/main/resources/img/doc-formats/epub.svg +++ b/apps/common/main/resources/img/doc-formats/epub.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/fb2.svg b/apps/common/main/resources/img/doc-formats/fb2.svg index ab29230874..f9171b4b58 100644 --- a/apps/common/main/resources/img/doc-formats/fb2.svg +++ b/apps/common/main/resources/img/doc-formats/fb2.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/html.svg b/apps/common/main/resources/img/doc-formats/html.svg index 503d611aa4..8828ebea87 100644 --- a/apps/common/main/resources/img/doc-formats/html.svg +++ b/apps/common/main/resources/img/doc-formats/html.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/jpg.svg b/apps/common/main/resources/img/doc-formats/jpg.svg index 99f2bb7258..078c95655e 100644 --- a/apps/common/main/resources/img/doc-formats/jpg.svg +++ b/apps/common/main/resources/img/doc-formats/jpg.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/odp.svg b/apps/common/main/resources/img/doc-formats/odp.svg index 6ddc0761fb..0768d050cb 100644 --- a/apps/common/main/resources/img/doc-formats/odp.svg +++ b/apps/common/main/resources/img/doc-formats/odp.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/ods.svg b/apps/common/main/resources/img/doc-formats/ods.svg index 31dcfb2abd..ba52c6a497 100644 --- a/apps/common/main/resources/img/doc-formats/ods.svg +++ b/apps/common/main/resources/img/doc-formats/ods.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/odt.svg b/apps/common/main/resources/img/doc-formats/odt.svg index 0d3d00bc0a..856b01423b 100644 --- a/apps/common/main/resources/img/doc-formats/odt.svg +++ b/apps/common/main/resources/img/doc-formats/odt.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/oform.svg b/apps/common/main/resources/img/doc-formats/oform.svg index c518ac1419..dd9dc17ad7 100644 --- a/apps/common/main/resources/img/doc-formats/oform.svg +++ b/apps/common/main/resources/img/doc-formats/oform.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/otp.svg b/apps/common/main/resources/img/doc-formats/otp.svg index 26d8bc60d2..51e3eeacc9 100644 --- a/apps/common/main/resources/img/doc-formats/otp.svg +++ b/apps/common/main/resources/img/doc-formats/otp.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/ots.svg b/apps/common/main/resources/img/doc-formats/ots.svg index ca9cac28d4..31acc5ac4f 100644 --- a/apps/common/main/resources/img/doc-formats/ots.svg +++ b/apps/common/main/resources/img/doc-formats/ots.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/ott.svg b/apps/common/main/resources/img/doc-formats/ott.svg index cb2629743e..fae989b58f 100644 --- a/apps/common/main/resources/img/doc-formats/ott.svg +++ b/apps/common/main/resources/img/doc-formats/ott.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/oxps.svg b/apps/common/main/resources/img/doc-formats/oxps.svg index 931e60193f..39b51ad9de 100644 --- a/apps/common/main/resources/img/doc-formats/oxps.svg +++ b/apps/common/main/resources/img/doc-formats/oxps.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/pdf.svg b/apps/common/main/resources/img/doc-formats/pdf.svg index 0201e87ed0..77248d3df5 100644 --- a/apps/common/main/resources/img/doc-formats/pdf.svg +++ b/apps/common/main/resources/img/doc-formats/pdf.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/pdfa.svg b/apps/common/main/resources/img/doc-formats/pdfa.svg index d078338541..57f2d779e9 100644 --- a/apps/common/main/resources/img/doc-formats/pdfa.svg +++ b/apps/common/main/resources/img/doc-formats/pdfa.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/png.svg b/apps/common/main/resources/img/doc-formats/png.svg index c2db2a3b01..c5e3a44cde 100644 --- a/apps/common/main/resources/img/doc-formats/png.svg +++ b/apps/common/main/resources/img/doc-formats/png.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/potx.svg b/apps/common/main/resources/img/doc-formats/potx.svg index 7f5548bdda..970d599d9f 100644 --- a/apps/common/main/resources/img/doc-formats/potx.svg +++ b/apps/common/main/resources/img/doc-formats/potx.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/ppsx.svg b/apps/common/main/resources/img/doc-formats/ppsx.svg index 24a89babe8..95d2a280c9 100644 --- a/apps/common/main/resources/img/doc-formats/ppsx.svg +++ b/apps/common/main/resources/img/doc-formats/ppsx.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/pptm.svg b/apps/common/main/resources/img/doc-formats/pptm.svg index 62029d6fd0..8ceb7d517e 100644 --- a/apps/common/main/resources/img/doc-formats/pptm.svg +++ b/apps/common/main/resources/img/doc-formats/pptm.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/pptx.svg b/apps/common/main/resources/img/doc-formats/pptx.svg index 0d193b13ca..43176c21fc 100644 --- a/apps/common/main/resources/img/doc-formats/pptx.svg +++ b/apps/common/main/resources/img/doc-formats/pptx.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/rtf.svg b/apps/common/main/resources/img/doc-formats/rtf.svg index 686a0498f0..8337f2be20 100644 --- a/apps/common/main/resources/img/doc-formats/rtf.svg +++ b/apps/common/main/resources/img/doc-formats/rtf.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/svg.svg b/apps/common/main/resources/img/doc-formats/svg.svg index ced8b0279b..008f01f038 100644 --- a/apps/common/main/resources/img/doc-formats/svg.svg +++ b/apps/common/main/resources/img/doc-formats/svg.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/txt.svg b/apps/common/main/resources/img/doc-formats/txt.svg index 961c4e1684..ae740008f1 100644 --- a/apps/common/main/resources/img/doc-formats/txt.svg +++ b/apps/common/main/resources/img/doc-formats/txt.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/xlsm.svg b/apps/common/main/resources/img/doc-formats/xlsm.svg index 087dad7d2e..542ea905fb 100644 --- a/apps/common/main/resources/img/doc-formats/xlsm.svg +++ b/apps/common/main/resources/img/doc-formats/xlsm.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/xlsx.svg b/apps/common/main/resources/img/doc-formats/xlsx.svg index b2ac9a15c9..04fd55ebbb 100644 --- a/apps/common/main/resources/img/doc-formats/xlsx.svg +++ b/apps/common/main/resources/img/doc-formats/xlsx.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/xltx.svg b/apps/common/main/resources/img/doc-formats/xltx.svg index e550a1747d..599c1e7f4e 100644 --- a/apps/common/main/resources/img/doc-formats/xltx.svg +++ b/apps/common/main/resources/img/doc-formats/xltx.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/common/main/resources/img/doc-formats/xps.svg b/apps/common/main/resources/img/doc-formats/xps.svg index bddb3606cb..2b0feba2c6 100644 --- a/apps/common/main/resources/img/doc-formats/xps.svg +++ b/apps/common/main/resources/img/doc-formats/xps.svg @@ -1,4 +1,4 @@ - + diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 13885f4650..0b6fbfeead 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -421,8 +421,14 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); + if(this.appOptions.isDesktopApp){ + var desktoppRecent = Common.Controllers.Desktop.recentFiles(); + if (desktoppRecent && desktoppRecent.length > 0) + this.editorConfig.recent = !this.editorConfig.recent ? desktoppRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktoppRecent); + } + this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; - this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp; + this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined; this.appOptions.templates = this.editorConfig.templates; this.appOptions.recent = this.editorConfig.recent; this.appOptions.createUrl = this.editorConfig.createUrl; diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index d445f1410d..4947d2402a 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -154,7 +154,11 @@ width: 98px; height: 125px; cursor: pointer; - + div{ + background-size: 80px 100px !important; + } +} + .btn-doc-format, .recent-icon { .svg-format- { &docx { background: ~"url('@{common-image-const-path}/doc-formats/docx.svg') no-repeat center"; diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 933d5868d9..1cda461e3b 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -378,8 +378,14 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); + if(this.appOptions.isDesktopApp){ + var desktoppRecent = Common.Controllers.Desktop.recentFiles(); + if (desktoppRecent && desktoppRecent.length > 0) + this.editorConfig.recent = !this.editorConfig.recent ? desktoppRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktoppRecent); + } + this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; - this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp; + this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined; this.appOptions.templates = this.editorConfig.templates; this.appOptions.recent = this.editorConfig.recent; this.appOptions.createUrl = this.editorConfig.createUrl; diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index ac54dc2b09..c820ee6527 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -43,7 +43,11 @@ width: 98px; height: 125px; cursor: pointer; - + div{ + background-size: 80px 100px !important; + } +} +.btn-doc-format, .recent-icon { .svg-format- { &pptx { background: ~"url('@{common-image-const-path}/doc-formats/pptx.svg') no-repeat center"; diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 1f50f9fb55..3c99aac5dc 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -418,8 +418,14 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); + if(this.appOptions.isDesktopApp){ + var desktoppRecent = Common.Controllers.Desktop.recentFiles(); + if (desktoppRecent && desktoppRecent.length > 0) + this.editorConfig.recent = !this.editorConfig.recent ? desktoppRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktoppRecent); + } + this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; - this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp; + this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined; this.appOptions.templates = this.editorConfig.templates; this.appOptions.recent = this.editorConfig.recent; this.appOptions.createUrl = this.editorConfig.createUrl; diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 83fc09266f..7234f469ab 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -43,7 +43,11 @@ width: 98px; height: 125px; cursor: pointer; - + div{ + background-size: 80px 100px !important; + } +} +.btn-doc-format, .recent-icon { .svg-format- { &xlsx { background: ~"url('@{common-image-const-path}/doc-formats/xlsx.svg') no-repeat center";