From 8ec3af85003df8539a4bf8d94e325479622b2300 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 15 Feb 2022 13:49:03 +0300 Subject: [PATCH] Add title for editor frame --- apps/api/documents/api.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index f7b3f9f71..f7e0189e8 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -971,6 +971,25 @@ return params; } + function getFrameTitle(config) { + var title = 'Powerful online editor for text documents, spreadsheets, and presentations'; + var appMap = { + 'text': 'text documents', + 'spreadsheet': 'spreadsheets', + 'presentation': 'presentations', + 'word': 'text documents', + 'cell': 'spreadsheets', + 'slide': 'presentations' + }; + + if (typeof config.documentType === 'string') { + var app = appMap[config.documentType.toLowerCase()]; + if (app) + title = 'Powerful online editor for ' + app; + } + return title; + } + function createIframe(config) { var iframe = document.createElement("iframe"); @@ -980,6 +999,7 @@ iframe.align = "top"; iframe.frameBorder = 0; iframe.name = "frameEditor"; + iframe.title = getFrameTitle(config); iframe.allowFullscreen = true; iframe.setAttribute("allowfullscreen",""); // for IE11 iframe.setAttribute("onmousewheel",""); // for Safari on Mac