From dc14a9aa905bdc13cc5121c20941bec41096be58 Mon Sep 17 00:00:00 2001 From: sshakndr Date: Tue, 19 Dec 2023 15:41:22 +0700 Subject: [PATCH] csharp-mvc: remove historyClose and restore --- .../csharp-mvc/Helpers/Users.cs | 4 +++- .../csharp-mvc/Views/Home/Editor.aspx | 24 ++++++++++--------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/web/documentserver-example/csharp-mvc/Helpers/Users.cs b/web/documentserver-example/csharp-mvc/Helpers/Users.cs index 41f264a8..8e8513a6 100644 --- a/web/documentserver-example/csharp-mvc/Helpers/Users.cs +++ b/web/documentserver-example/csharp-mvc/Helpers/Users.cs @@ -59,7 +59,9 @@ namespace OnlineEditorsExampleMVC.Helpers "Can’t print the file", "Can create new files from the editor", "Can see the information about Group2 users", - "Can’t submit forms" + "Can’t submit forms", + "Can't close history", + "Can't restore the file version" }; static List descr_user_0 = new List() diff --git a/web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx b/web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx index 60903cee..329a1fb7 100644 --- a/web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx +++ b/web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx @@ -259,6 +259,13 @@ } } + <% string usersForMentions; %> + <% Model.GetUsersMentions(Request, out usersForMentions); %> + <% string usersInfo; %> + <% Model.GetUsersInfo(Request, out usersInfo); %> + <% string usersForProtect; %> + <% Model.GetUsersProtect(Request, out usersForProtect); %> + var onRequestUsers = function (event) { if (event && event.data){ var c = event.data.c; @@ -311,23 +318,18 @@ "onRequestSelectSpreadsheet": onRequestSelectSpreadsheet, }; - <% string usersForMentions; %> - <% Model.GetUsersMentions(Request, out usersForMentions); %> - <% string usersInfo; %> - <% Model.GetUsersInfo(Request, out usersInfo); %> - <% string usersForProtect; %> - <% Model.GetUsersProtect(Request, out usersForProtect); %> - if (config.editorConfig.user.id) { // the user is trying to show the document version history config.events['onRequestHistory'] = onRequestHistory; // the user is trying to click the specific document version in the document version history config.events['onRequestHistoryData'] = onRequestHistoryData; // the user is trying to go back to the document from viewing the document version history - config.events['onRequestHistoryClose'] = function () { - document.location.reload(); - }; - config.events['onRequestRestore'] = onRequestRestore; + if (config.editorConfig.user.id !== "uid-3") { + config.events['onRequestHistoryClose'] = function () { + document.location.reload(); + }; + config.events['onRequestRestore'] = onRequestRestore; + } // add mentions for not anonymous users <% if (!string.IsNullOrEmpty(usersForMentions))