From 9b1aa597c4c357151070d4bd02f9033ad4ab77cf Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 30 Apr 2020 18:35:30 +0300 Subject: [PATCH] Change api for new and recent files --- apps/api/documents/api.js | 7 ++++--- .../main/app/view/FileMenuPanels.js | 16 ++++++++++------ .../main/resources/less/filemenu.less | 1 + .../main/app/view/FileMenuPanels.js | 16 ++++++++++------ .../main/resources/less/leftmenu.less | 3 ++- .../main/app/view/FileMenuPanels.js | 16 ++++++++++------ .../main/resources/less/leftmenu.less | 1 + 7 files changed, 38 insertions(+), 22 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 1dcf5eada..0f8d84ec8 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -74,15 +74,16 @@ recent: [ { title: 'document title', + image: 'recent icon url', url: 'document url', - folder: 'path to document' + folder: 'path to document', }, ... ], templates: [ { - name: 'template name', - icon: 'template icon url', + title: 'template name', // name - is deprecated + image: 'template icon url', url: 'http://...' }, ... diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 2967be441..2a897293e 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -601,9 +601,13 @@ define([ store: new Common.UI.DataViewStore(this.recent), itemTemplate: _.template([ '
', - '
', - '
<%= Common.Utils.String.htmlEncode(title) %>
', - '
<%= Common.Utils.String.htmlEncode(folder) %>
', + '
', + ' style="background-image: url(<%= image %>);background-position: center;"', + '<% } %>', + '>
', + '
<% if (typeof title !== "undefined") {%><%= Common.Utils.String.htmlEncode(title || "") %><% } %>
', + '
<% if (typeof folder !== "undefined") {%><%= Common.Utils.String.htmlEncode(folder || "") %><% } %>
', '
' ].join('')) }); @@ -655,13 +659,13 @@ define([ '<% _.each(docs, function(item) { %>', '
', '
', - ' style="background-image: url(<%= item.icon %>);">', + '<% if (!_.isEmpty(item.image)) { %> ', + ' style="background-image: url(<%= item.image %>);">', '<% } else { ' + 'print(\">\")' + ' } %>', '
', - '
<%= item.name %>
', + '
<%= Common.Utils.String.htmlEncode(item.name || item.title || "") %>
', '
', '<% }) %>', '' diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index fbf3a4730..8cf1d774f 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -197,6 +197,7 @@ width: 102px; height: 128px; background-repeat: no-repeat; + background-position: center; } .title { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 5cfb38c5f..f228680c3 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -510,9 +510,13 @@ define([ store: new Common.UI.DataViewStore(this.recent), itemTemplate: _.template([ '
', - '
', - '
<%= Common.Utils.String.htmlEncode(title) %>
', - '
<%= Common.Utils.String.htmlEncode(folder) %>
', + '
', + ' style="background-image: url(<%= image %>);background-position: center;"', + '<% } %>', + '>
', + '
<% if (typeof title !== "undefined") {%><%= Common.Utils.String.htmlEncode(title || "") %><% } %>
', + '
<% if (typeof folder !== "undefined") {%><%= Common.Utils.String.htmlEncode(folder || "") %><% } %>
', '
' ].join('')) }); @@ -564,13 +568,13 @@ define([ '<% _.each(docs, function(item) { %>', '
', '
', - ' style="background-image: url(<%= item.icon %>);">', + '<% if (!_.isEmpty(item.image)) { %> ', + ' style="background-image: url(<%= item.image %>);">', '<% } else { ' + 'print(\">\")' + ' } %>', '
', - '
<%= item.name %>
', + '
<%= Common.Utils.String.htmlEncode(item.name || item.title || "") %>
', '
', '<% }) %>', '' diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 5b7afd026..82edc9190 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -263,7 +263,8 @@ width: 102px; height: 128px; background-repeat: no-repeat; - } + background-position: center; + } .title { padding-top: 20px; diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 6a8dd83de..74563f6bf 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1324,9 +1324,13 @@ define([ store: new Common.UI.DataViewStore(this.recent), itemTemplate: _.template([ '
', - '
', - '
<%= Common.Utils.String.htmlEncode(title) %>
', - '
<%= Common.Utils.String.htmlEncode(folder) %>
', + '
', + ' style="background-image: url(<%= image %>);background-position: center;"', + '<% } %>', + '>
', + '
<% if (typeof title !== "undefined") {%><%= Common.Utils.String.htmlEncode(title || "") %><% } %>
', + '
<% if (typeof folder !== "undefined") {%><%= Common.Utils.String.htmlEncode(folder || "") %><% } %>
', '
' ].join('')) }); @@ -1378,13 +1382,13 @@ define([ '<% _.each(docs, function(item) { %>', '
', '
', - ' style="background-image: url(<%= item.icon %>);">', + '<% if (!_.isEmpty(item.image)) { %> ', + ' style="background-image: url(<%= item.image %>);">', '<% } else { ' + 'print(\">\")' + ' } %>', '
', - '
<%= item.name %>
', + '
<%= Common.Utils.String.htmlEncode(item.name || item.title || "") %>
', '
', '<% }) %>', '' diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index ef9af3ae0..4ca403a1d 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -316,6 +316,7 @@ width: 102px; height: 128px; background-repeat: no-repeat; + background-position: center; } .title {