From 4c652e8343226e63eca03dd233056ed41939415c Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Wed, 16 Apr 2025 14:56:53 +0300 Subject: [PATCH] Add button "As review" in chat only in documents --- sdkjs-plugins/content/ai/scripts/chat.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sdkjs-plugins/content/ai/scripts/chat.js b/sdkjs-plugins/content/ai/scripts/chat.js index aaa135bc..3fc42bd6 100644 --- a/sdkjs-plugins/content/ai/scripts/chat.js +++ b/sdkjs-plugins/content/ai/scripts/chat.js @@ -261,7 +261,7 @@ align: 'left' }, handler: function(message, content, htmlContent) { insertEngine('review', htmlContent);} - }, + } ]; let welcomeButtons = [ { text: 'Blog post', prompt: 'Blog post about' }, @@ -635,6 +635,16 @@ document.getElementById('input_message').setAttribute('placeholder', window.Asc.plugin.tr('Ask AI anything')); //Action buttons + // In this method info object must be exist + if (this.info && this.info.editorType !== "word") { + for (let i = actionButtons.length - 1; i >= 0; --i) { + if (actionButtons[i].tipOptions.text == "As review") { + actionButtons.splice(i, 1); + break; + } + } + } + actionButtons.forEach(function(button) { button.tipOptions.text = window.Asc.plugin.tr(button.tipOptions.text); });