feat(csharp): close editor. Fix Bug 69915

This commit is contained in:
sshakndr
2024-10-09 15:11:39 +07:00
parent eba8bce11b
commit ea5f2efe46
4 changed files with 38 additions and 4 deletions

View File

@ -1,6 +1,7 @@
# Change Log
- filename in editor page title
- csharp: close editor
- he-IL skin language
- ConvertService.ashx address replaced with converter
- coauthoring/CommandService.ashx address replaced with command

View File

@ -124,6 +124,11 @@
docEditor.setActionLink(replaceActionLink(location.href, linkParam)); // set the link to the document which contains a bookmark
};
var onRequestClose = function () { // close editor
docEditor.destroyEditor();
innerAlert("Document editor closed successfully");
};
// the meta information of the document is changed via the meta command
var onMetaChange = function (event) {
if (event.data.favorite !== undefined) {
@ -287,6 +292,7 @@
if (config.editorConfig.user.id) {
config.events['onRequestClose'] = onRequestClose;
config.events['onRequestHistory'] = function (event) { // the user is trying to show the document version history
let xhr = new XMLHttpRequest();

View File

@ -288,6 +288,13 @@ namespace OnlineEditorsExample
{ "text", user.goback.text },
{ "blank", user.goback.blank }
} : new Dictionary<string, object>{}
},
{
"close", user.close != null ? new Dictionary<string, object>
{
{ "visible", user.close.visible },
{ "text", user.close.text }
} : new Dictionary<string, object>{}
}
}
}

View File

@ -94,7 +94,8 @@ namespace OnlineEditorsExample
descr_user_1,
true,
true,
new Goback(null, false)
new Goback(null, false),
new Close(null, false)
),
new User(
"uid-2",
@ -114,7 +115,8 @@ namespace OnlineEditorsExample
descr_user_2,
false,
true,
new Goback("Go to Documents",null)
new Goback("Go to Documents",null),
new Close(null, true)
),
new User(
"uid-3",
@ -134,7 +136,8 @@ namespace OnlineEditorsExample
descr_user_3,
false,
false,
null
null,
new Close(null, true)
),
new User(
"uid-0",
@ -149,6 +152,7 @@ namespace OnlineEditorsExample
descr_user_0,
false,
false,
null,
null
)
};
@ -242,8 +246,9 @@ namespace OnlineEditorsExample
public List<string> userInfoGroups;
public bool avatar;
public Goback goback;
public Close close;
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback)
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates, bool avatar, Goback goback, Close close)
{
this.id = id;
this.name = name;
@ -258,6 +263,7 @@ namespace OnlineEditorsExample
this.userInfoGroups = userInfoGroups;
this.avatar = avatar;
this.goback = goback;
this.close = close;
}
}
@ -274,4 +280,18 @@ namespace OnlineEditorsExample
this.blank = blank;
}
}
public class Close
{
public string text;
public bool visible;
public Close(){}
public Close(string text, bool visible)
{
this.text = text;
this.visible = visible;
}
}
}