From 9857cef8fc73466fdbba3e1b2d1f2371dbfc194b Mon Sep 17 00:00:00 2001 From: Olga Larinova Date: Mon, 21 Mar 2022 09:22:31 +0300 Subject: [PATCH 1/7] php: version history button was hidden --- web/documentserver-example/php/doceditor.php | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/web/documentserver-example/php/doceditor.php b/web/documentserver-example/php/doceditor.php index 1248053e..db08a007 100755 --- a/web/documentserver-example/php/doceditor.php +++ b/web/documentserver-example/php/doceditor.php @@ -517,24 +517,24 @@ $history = $out[0]; $historyData = $out[1]; ?> - - // the user is trying to show the document version history - config.events['onRequestHistory'] = function () { - docEditor.refreshHistory(); // show the document version history - }; - // the user is trying to click the specific document version in the document version history - config.events['onRequestHistoryData'] = function (event) { - var ver = event.data; - var histData = ; - docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history - }; - // the user is trying to go back to the document from viewing the document version history - config.events['onRequestHistoryClose'] = function () { - document.location.reload(); - }; - + + // the user is trying to show the document version history + config.events['onRequestHistory'] = function () { + docEditor.refreshHistory(); // show the document version history + }; + // the user is trying to click the specific document version in the document version history + config.events['onRequestHistoryData'] = function (event) { + var ver = event.data; + var histData = ; + docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history + }; + // the user is trying to go back to the document from viewing the document version history + config.events['onRequestHistoryClose'] = function () { + document.location.reload(); + }; + // add mentions for not anonymous users config.events['onRequestUsers'] = function () { docEditor.setUsers({ // set a list of users to mention in the comments From 23176ddf07553eac8996407d51495bcbeb2e9322 Mon Sep 17 00:00:00 2001 From: Olga Larinova Date: Mon, 21 Mar 2022 09:27:26 +0300 Subject: [PATCH 2/7] ruby: version history button was hidden --- .../ruby/app/views/home/editor.html.erb | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/web/documentserver-example/ruby/app/views/home/editor.html.erb b/web/documentserver-example/ruby/app/views/home/editor.html.erb index 31aaba12..204c0841 100644 --- a/web/documentserver-example/ruby/app/views/home/editor.html.erb +++ b/web/documentserver-example/ruby/app/views/home/editor.html.erb @@ -172,27 +172,24 @@ <% history = @file.get_history - if history %> - // the user is trying to show the document version history - config.events['onRequestHistory'] = function () { - docEditor.refreshHistory(<%= raw history[:hist].to_json %>); // show the document version history - }; - // the user is trying to click the specific document version in the document version history - config.events['onRequestHistoryData'] = function (event) { - var ver = event.data; - var histData = <%= raw history[:histData].to_json %>; - docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history - }; - // the user is trying to go back to the document from viewing the document version history - config.events['onRequestHistoryClose'] = function () { - document.location.reload(); - }; - <% end - %> - - <% usersMentions = @file.get_users_mentions if usersMentions %> + if history %> + // the user is trying to show the document version history + config.events['onRequestHistory'] = function () { + docEditor.refreshHistory(<%= raw history[:hist].to_json %>); // show the document version history + }; + // the user is trying to click the specific document version in the document version history + config.events['onRequestHistoryData'] = function (event) { + var ver = event.data; + var histData = <%= raw history[:histData].to_json %>; + docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history + }; + // the user is trying to go back to the document from viewing the document version history + config.events['onRequestHistoryClose'] = function () { + document.location.reload(); + }; + <% end %> // add mentions for not anonymous users config.events['onRequestUsers'] = function () { docEditor.setUsers({ // set a list of users to mention in the comments From 200187edce426fd1e09a6dcb8a4846c6d4d19bb8 Mon Sep 17 00:00:00 2001 From: Olga Larinova Date: Mon, 21 Mar 2022 09:29:32 +0300 Subject: [PATCH 3/7] python: version history button was hidden --- .../python/templates/editor.html | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/web/documentserver-example/python/templates/editor.html b/web/documentserver-example/python/templates/editor.html index c904403b..56787102 100644 --- a/web/documentserver-example/python/templates/editor.html +++ b/web/documentserver-example/python/templates/editor.html @@ -194,26 +194,28 @@ "onRequestRename": onRequestRename, }; - {% if history and historyData %} - - // the user is trying to show the document version history - config.events['onRequestHistory'] = function () { - docEditor.refreshHistory({{ history | safe }}); // show the document version history - }; - // the user is trying to click the specific document version in the document version history - config.events['onRequestHistoryData'] = function (event) { - var ver = event.data; - var histData = {{ historyData | safe }}; - docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history - }; - // the user is trying to go back to the document from viewing the document version history - config.events['onRequestHistoryClose'] = function () { - document.location.reload(); - }; - - {% endif %} + {% if usersForMentions %} + + {% if history and historyData %} + + // the user is trying to show the document version history + config.events['onRequestHistory'] = function () { + docEditor.refreshHistory({{ history | safe }}); // show the document version history + }; + // the user is trying to click the specific document version in the document version history + config.events['onRequestHistoryData'] = function (event) { + var ver = event.data; + var histData = {{ historyData | safe }}; + docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history + }; + // the user is trying to go back to the document from viewing the document version history + config.events['onRequestHistoryClose'] = function () { + document.location.reload(); + }; + + {% endif %} // add mentions for not anonymous users config.events['onRequestUsers'] = function () { From 9b0b30a0b0ad87ea650ed118e74ec50868afae52 Mon Sep 17 00:00:00 2001 From: Olga Larinova Date: Mon, 21 Mar 2022 09:32:27 +0300 Subject: [PATCH 4/7] nodejs: version history button was hidden --- web/documentserver-example/nodejs/views/editor.ejs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/documentserver-example/nodejs/views/editor.ejs b/web/documentserver-example/nodejs/views/editor.ejs index dfe0ad1a..ae3ce2c0 100644 --- a/web/documentserver-example/nodejs/views/editor.ejs +++ b/web/documentserver-example/nodejs/views/editor.ejs @@ -191,9 +191,6 @@ "onDocumentStateChange": onDocumentStateChange, "onRequestEditRights": onRequestEditRights, "onError": onError, - "onRequestHistory": onRequestHistory, - "onRequestHistoryData": onRequestHistoryData, - "onRequestHistoryClose": onRequestHistoryClose, "onOutdatedVersion": onOutdatedVersion, "onMakeActionLink": onMakeActionLink, "onMetaChange": onMetaChange, @@ -205,6 +202,9 @@ }; if (<%- JSON.stringify(usersForMentions) %> != null) { + config.events.onRequestHistory = onRequestHistory; + config.events.onRequestHistoryData = onRequestHistoryData; + config.events.onRequestHistoryClose = onRequestHistoryClose; config.events.onRequestUsers = onRequestUsers; config.events.onRequestSendNotify = onRequestSendNotify; } From 0673fed928caab3afd37adb5245ecc9adff6a1f8 Mon Sep 17 00:00:00 2001 From: Olga Larinova Date: Mon, 21 Mar 2022 09:35:58 +0300 Subject: [PATCH 5/7] java: java-spring: version history button was hidden --- .../src/main/resources/templates/editor.html | 33 +++++++++---------- .../java/src/main/webapp/editor.jsp | 33 +++++++++---------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/web/documentserver-example/java-spring/src/main/resources/templates/editor.html b/web/documentserver-example/java-spring/src/main/resources/templates/editor.html index 48a2c244..8d9ee8d3 100755 --- a/web/documentserver-example/java-spring/src/main/resources/templates/editor.html +++ b/web/documentserver-example/java-spring/src/main/resources/templates/editor.html @@ -180,24 +180,23 @@ var historyData = histArray[1]; var usersForMentions = [[${usersForMentions}]]; - if (hist && historyData) { - // the user is trying to show the document version history - config.events['onRequestHistory'] = function () { - docEditor.refreshHistory(JSON.parse(hist)); // show the document version history - }; - // the user is trying to click the specific document version in the document version history - config.events['onRequestHistoryData'] = function (event) { - var ver = event.data; - var histData = historyData; - docEditor.setHistoryData(JSON.parse(histData)[ver - 1]); // send the link to the document for viewing the version history - }; - // the user is trying to go back to the document from viewing the document version history - config.events['onRequestHistoryClose'] = function () { - document.location.reload(); - }; - } - if(usersForMentions){ + if (hist && historyData) { + // the user is trying to show the document version history + config.events['onRequestHistory'] = function () { + docEditor.refreshHistory(JSON.parse(hist)); // show the document version history + }; + // the user is trying to click the specific document version in the document version history + config.events['onRequestHistoryData'] = function (event) { + var ver = event.data; + var histData = historyData; + docEditor.setHistoryData(JSON.parse(histData)[ver - 1]); // send the link to the document for viewing the version history + }; + // the user is trying to go back to the document from viewing the document version history + config.events['onRequestHistoryClose'] = function () { + document.location.reload(); + }; + } // add mentions for not anonymous users config.events['onRequestUsers'] = function () { docEditor.setUsers({ // set a list of users to mention in the comments diff --git a/web/documentserver-example/java/src/main/webapp/editor.jsp b/web/documentserver-example/java/src/main/webapp/editor.jsp index 55504bb9..533835d7 100644 --- a/web/documentserver-example/java/src/main/webapp/editor.jsp +++ b/web/documentserver-example/java/src/main/webapp/editor.jsp @@ -184,24 +184,23 @@ String usersForMentions = (String) request.getAttribute("usersForMentions"); %> - <% if (!history.isEmpty() && !historyData.isEmpty()) { %> - // the user is trying to show the document version history - config.events['onRequestHistory'] = function () { - docEditor.refreshHistory(<%= history %>); // show the document version history - }; - // the user is trying to click the specific document version in the document version history - config.events['onRequestHistoryData'] = function (event) { - var ver = event.data; - var histData = <%= historyData %>; - docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history - }; - // the user is trying to go back to the document from viewing the document version history - config.events['onRequestHistoryClose'] = function () { - document.location.reload(); - }; - <% } %> - <% if (usersForMentions != null) { %> + <% if (!history.isEmpty() && !historyData.isEmpty()) { %> + // the user is trying to show the document version history + config.events['onRequestHistory'] = function () { + docEditor.refreshHistory(<%= history %>); // show the document version history + }; + // the user is trying to click the specific document version in the document version history + config.events['onRequestHistoryData'] = function (event) { + var ver = event.data; + var histData = <%= historyData %>; + docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history + }; + // the user is trying to go back to the document from viewing the document version history + config.events['onRequestHistoryClose'] = function () { + document.location.reload(); + }; + <% } %> // add mentions for not anonymous users config.events['onRequestUsers'] = function () { docEditor.setUsers({ // set a list of users to mention in the comments From cf01b5e0ae161c85e9a7e828c8557e729d68e84c Mon Sep 17 00:00:00 2001 From: Olga Larinova Date: Mon, 21 Mar 2022 09:38:48 +0300 Subject: [PATCH 6/7] csharp: csharp-mvc: version history button was hidden --- .../csharp-mvc/Views/Home/Editor.aspx | 34 +++++++++---------- .../csharp/DocEditor.aspx | 29 ++++++++-------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx b/web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx index 8d79fe82..95304f15 100644 --- a/web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx +++ b/web/documentserver-example/csharp-mvc/Views/Home/Editor.aspx @@ -198,29 +198,29 @@ <% string hist, histData; %> <% Model.GetHistory(out hist, out histData); %> - <% if (!string.IsNullOrEmpty(hist) && !string.IsNullOrEmpty(histData)) - { %> - // the user is trying to show the document version history - config.events['onRequestHistory'] = function () { - docEditor.refreshHistory(<%= hist %>); // show the document version history - }; - // the user is trying to click the specific document version in the document version history - config.events['onRequestHistoryData'] = function (event) { - var ver = event.data; - var histData = <%= histData %>; - docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history - }; - // the user is trying to go back to the document from viewing the document version history - config.events['onRequestHistoryClose '] = function () { - document.location.reload(); - }; - <% } %> <% string usersForMentions; %> <% Model.GetUsersMentions(Request, out usersForMentions); %> <% if (!string.IsNullOrEmpty(usersForMentions)) // add mentions for not anonymous users { %> + <% if (!string.IsNullOrEmpty(hist) && !string.IsNullOrEmpty(histData)) + { %> + // the user is trying to show the document version history + config.events['onRequestHistory'] = function () { + docEditor.refreshHistory(<%= hist %>); // show the document version history + }; + // the user is trying to click the specific document version in the document version history + config.events['onRequestHistoryData'] = function (event) { + var ver = event.data; + var histData = <%= histData %>; + docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history + }; + // 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['onRequestUsers'] = function () { docEditor.setUsers({ // set a list of users to mention in the comments "users": <%= usersForMentions%> diff --git a/web/documentserver-example/csharp/DocEditor.aspx b/web/documentserver-example/csharp/DocEditor.aspx index c55a6d65..2bdbdb03 100644 --- a/web/documentserver-example/csharp/DocEditor.aspx +++ b/web/documentserver-example/csharp/DocEditor.aspx @@ -208,23 +208,22 @@ "onRequestRename": onRequestRename }; - <% if (!string.IsNullOrEmpty(History) && !string.IsNullOrEmpty(HistoryData)) - { %> - config.events['onRequestHistory'] = function () { // the user is trying to show the document version history - docEditor.refreshHistory(<%= History %>); // show the document version history - }; - config.events['onRequestHistoryData'] = function (event) { // the user is trying to click the specific document version in the document version history - var ver = event.data; - var histData = <%= HistoryData %>; - docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history - }; - config.events['onRequestHistoryClose '] = function () { // the user is trying to go back to the document from viewing the document version history - document.location.reload(); - }; - <% } %> - <% if (!string.IsNullOrEmpty(UsersForMentions)) { %> + <% if (!string.IsNullOrEmpty(History) && !string.IsNullOrEmpty(HistoryData)) + { %> + config.events['onRequestHistory'] = function () { // the user is trying to show the document version history + docEditor.refreshHistory(<%= History %>); // show the document version history + }; + config.events['onRequestHistoryData'] = function (event) { // the user is trying to click the specific document version in the document version history + var ver = event.data; + var histData = <%= HistoryData %>; + docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history + }; + config.events['onRequestHistoryClose '] = function () { // the user is trying to go back to the document from viewing the document version history + document.location.reload(); + }; + <% } %> // add mentions for not anonymous users config.events['onRequestUsers'] = function () { docEditor.setUsers({ // set a list of users to mention in the comments From 8f09dadfa006f135444bca29cf193ab0a4ae72df Mon Sep 17 00:00:00 2001 From: Olga Larinova Date: Mon, 21 Mar 2022 17:10:11 +0300 Subject: [PATCH 7/7] ruby: java-spring: bugfix --- .../java-spring/src/main/resources/templates/editor.html | 2 +- web/documentserver-example/ruby/app/views/home/editor.html.erb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/documentserver-example/java-spring/src/main/resources/templates/editor.html b/web/documentserver-example/java-spring/src/main/resources/templates/editor.html index 8d9ee8d3..501e25e8 100755 --- a/web/documentserver-example/java-spring/src/main/resources/templates/editor.html +++ b/web/documentserver-example/java-spring/src/main/resources/templates/editor.html @@ -180,7 +180,7 @@ var historyData = histArray[1]; var usersForMentions = [[${usersForMentions}]]; - if(usersForMentions){ + if(usersForMentions.length > 0){ if (hist && historyData) { // the user is trying to show the document version history config.events['onRequestHistory'] = function () { diff --git a/web/documentserver-example/ruby/app/views/home/editor.html.erb b/web/documentserver-example/ruby/app/views/home/editor.html.erb index 204c0841..e8e8eb50 100644 --- a/web/documentserver-example/ruby/app/views/home/editor.html.erb +++ b/web/documentserver-example/ruby/app/views/home/editor.html.erb @@ -173,7 +173,8 @@ <% history = @file.get_history usersMentions = @file.get_users_mentions - if usersMentions %> + + if usersMentions if history %> // the user is trying to show the document version history config.events['onRequestHistory'] = function () {