Skip to content

Commit 8e00a64

Browse files
1052601: Added UG content for the Comment Highlights features for ASP.NET Core, MVC and Blazor platforms.
1 parent cb164dc commit 8e00a64

9 files changed

Lines changed: 111 additions & 0 deletions

File tree

Document-Processing/Word/Word-Processor/asp-net-core/comments.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,21 @@ The following example illustrates how to enable mention support in DOCX Editor
157157
{% endhighlight %}
158158
{% endtabs %}
159159

160+
## Highlight comments by author
161+
162+
When `highlightCommentsByAuthor' is enabled, each comment marker and pane border is displayed in the author’s avatar color.
163+
Selecting a comment highlights the corresponding text in that color. If multiple comments appear on the same line, the marker retains the first author’s avatar color.
164+
165+
The following example illustrates how to enable comment highlights in the DOCX Editor
166+
167+
{% tabs %}
168+
{% highlight cshtml tabtitle="CSHTML" %}
169+
{% include code-snippet/document-editor/asp-net-core/document-editor-container/comment-highlights/tagHelper %}
170+
{% endhighlight %}
171+
{% highlight c# tabtitle="comment-highlights.cs" %}
172+
{% include code-snippet/document-editor/asp-net-core/document-editor-container/comment-highlights/document-editor.cs %}
173+
{% endhighlight %}
174+
{% endtabs %}
160175

161176
## Events
162177

Document-Processing/Word/Word-Processor/asp-net-mvc/comments.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,21 @@ The following example illustrates how to enable mention support in the DOCX Edit
159159
{% endhighlight %}
160160
{% endtabs %}
161161

162+
## Highlight comments by author
163+
164+
When `highlightCommentsByAuthor' is enabled, each comment marker and pane border is displayed in the author’s avatar color.
165+
Selecting a comment highlights the corresponding text in that color. If multiple comments appear on the same line, the marker retains the first author’s avatar color.
166+
167+
The following example illustrates how to enable comment highlights in the DOCX Editor
168+
169+
{% tabs %}
170+
{% highlight razor tabtitle="CSHTML" %}
171+
{% include code-snippet/document-editor/asp-net-mvc/document-editor-container/comment-highlights/razor %}
172+
{% endhighlight %}
173+
{% highlight c# tabtitle="comment-highlights.cs" %}
174+
{% include code-snippet/document-editor/asp-net-mvc/document-editor-container/comment-highlights/document-editor.cs %}
175+
{% endhighlight %}
176+
{% endtabs %}
162177

163178
## Events
164179

Document-Processing/Word/Word-Processor/blazor/comments.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ You can delete all the comments in the document using [`DeleteAllCommentsAsync`]
4747
await container.DocumentEditor.Editor.DeleteAllCommentsAsync();
4848
```
4949

50+
## Highlight comments by author
51+
52+
When `HighlightCommentsByAuthor' is enabled, each comment marker and pane border is displayed in the author’s avatar color.
53+
Selecting a comment highlights the corresponding text in that color. If multiple comments appear on the same line, the marker retains the first author’s avatar color.
54+
55+
The following example illustrates how to enable comment highlights in the DOCX Editor
56+
57+
58+
```csharp
59+
60+
@using Syncfusion.Blazor.DocumentEditor;
61+
62+
<SfDocumentEditorContainer @ref="container" EnableToolbar=true DocumentEditorSettings="settings">
63+
</SfDocumentEditorContainer>
64+
65+
@code {
66+
SfDocumentEditorContainer container;
67+
DocumentEditorSettingsModel settings = new DocumentEditorSettingsModel() { HighlightCommentsByAuthor : true };
68+
}
69+
```
70+
5071
## Protect the document in comments-only mode
5172

5273
The DOCX Editor supports a special protection mode that restricts user actions to adding or editing comments only. When `CommentsOnly` protection is active, users cannot change the document content.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public ActionResult Default()
2+
{
3+
return View();
4+
}
5+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@Html.EJS().DocumentEditorContainer("container").Created("onCreated").EnableToolbar(true).Render()
2+
3+
<script>
4+
var documenteditor;
5+
var container;
6+
function onCreated() {
7+
var documenteditorElement = document.getElementById('container');
8+
container = documenteditorElement.ej2_instances[0];
9+
documenteditor = container.documentEditor;
10+
container.documentEditorSettings = { highlightCommentsByAuthor : true };
11+
}
12+
</script>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
<ejs-documenteditorcontainer id="container" serviceUrl="/api/DocumentEditor/" enableToolbar=true created="onCreated" height="590px"></ejs-documenteditorcontainer>
3+
4+
<script>
5+
var documenteditor;
6+
var container;
7+
function onCreated() {
8+
var documenteditorElement = document.getElementById('container');
9+
container = documenteditorElement.ej2_instances[0];
10+
documenteditor = container.documentEditor;
11+
container.documentEditorSettings = { highlightCommentsByAuthor : true };
12+
}
13+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public ActionResult Default()
2+
{
3+
return View();
4+
}
5+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@Html.EJS().DocumentEditorContainer("container").Created("onCreated").EnableToolbar(true).Render()
2+
3+
<script>
4+
var documenteditor;
5+
var container;
6+
function onCreated() {
7+
var documenteditorElement = document.getElementById('container');
8+
container = documenteditorElement.ej2_instances[0];
9+
documenteditor = container.documentEditor;
10+
container.documentEditorSettings = { highlightCommentsByAuthor : true };
11+
}
12+
</script>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
<ejs-documenteditorcontainer id="container" serviceUrl="/api/DocumentEditor/" enableToolbar=true created="onCreated" height="590px"></ejs-documenteditorcontainer>
3+
4+
<script>
5+
var documenteditor;
6+
var container;
7+
function onCreated() {
8+
var documenteditorElement = document.getElementById('container');
9+
container = documenteditorElement.ej2_instances[0];
10+
documenteditor = container.documentEditor;
11+
container.documentEditorSettings = { highlightCommentsByAuthor : true };
12+
}
13+
</script>

0 commit comments

Comments
 (0)