Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

933810:Added the enableTrackChanges feature document-level settings Content information in Core and MVC #3846

Open
wants to merge 6 commits into
base: hotfix/hotfix-v28.2.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public ActionResult Default()
{
return View();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public ActionResult Default()
{
return View();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div>
@Html.EJS().DocumentEditorContainer("container").documentChange("onDocChange").EnableToolbar(true).Render()
</div>

<ejs-documenteditorcontainer id="container" documentChange="onDocumentChange" enableToolbar=true serviceUrl="/api/DocumentEditor/" height="590px"></ejs-documenteditorcontainer>
<script>
function onDocumentChange() {
var container = document.getElementById("container").ej2_instances[0];
if(container !== null){
container.documentEditor.enableTrackChanges= true;
}
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<ejs-documenteditorcontainer id="container" documentChange="onDocumentChange" enableToolbar=true serviceUrl="/api/DocumentEditor/" height="590px"></ejs-documenteditorcontainer>
<script>
function onDocumentChange() {
var container = document.getElementById("container").ej2_instances[0];
if(container !== null){
container.documentEditor.enableTrackChanges= true;
}
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public ActionResult Default()
{
return View();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public ActionResult Default()
{
return View();
}

48 changes: 42 additions & 6 deletions ej2-asp-core-mvc/document-editor/track-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ The following example demonstrates how to enable track changes.
{% include code-snippet/document-editor-container/track-changes/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="Track-changes-only.cs" %}
{% endhighlight %}{% endtabs %}
{% include code-snippet/document-editor-container/track-changes/document-editor.cs %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

Expand All @@ -32,9 +34,35 @@ The following example demonstrates how to enable track changes.
{% include code-snippet/document-editor-container/track-changes/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Track-changes-only.cs" %}
{% endhighlight %}{% endtabs %}
{% include code-snippet/document-editor-container/track-changes/document-editor.cs %}
{% endhighlight %}
{% endtabs %}
{% endif %}

>Track changes are document level settings. When opening a document, if the document does not have track changes enabled, then enableTrackChanges will be disabled even if we set enableTrackChanges = true in the initial rendering. If you want to enable track changes for all the documents, then we recommend enabling track changes during the document change event. The following example demonstrates how to enable Track changes for the all the Document while Opening.

{% if page.publishingplatform == "aspnet-core" %}

{% tabs %}
{% highlight cshtml tabtitle="CSHTML" %}
{% include code-snippet/document-editor-container/track-changes-default/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="Track-changes-default.cs" %}
{% include code-snippet/document-editor-container/track-changes-default/document-editor.cs %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/document-editor-container/track-changes-default/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Track-changes-default.cs" %}
{% include code-snippet/document-editor-container/track-changes-default/document-editor.cs %}
{% endhighlight %}
{% endtabs %}
{% endif %}
## Show/Hide Revisions Pane

The Show/Hide Revisions Pane feature in the Document Editor allows users to toggle the visibility of the revisions pane, providing flexibility in managing tracked changes within the document.
Expand All @@ -48,7 +76,9 @@ The following example code illustrates how to show/hide the revisions pane.
{% include code-snippet/document-editor-container/toggle-track-pane/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="Track-changes-only.cs" %}
{% endhighlight %}{% endtabs %}
{% include code-snippet/document-editor-container/toggle-track-pane/document-editor.cs %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

Expand All @@ -57,7 +87,9 @@ The following example code illustrates how to show/hide the revisions pane.
{% include code-snippet/document-editor-container/toggle-track-pane/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Track-changes-only.cs" %}
{% endhighlight %}{% endtabs %}
{% include code-snippet/document-editor-container/toggle-track-pane/document-editor.cs %}
{% endhighlight %}
{% endtabs %}
{% endif %}

## Get all tracked revisions
Expand Down Expand Up @@ -148,7 +180,9 @@ The following example code illustrates how to enforce and stop protection in Doc
{% include code-snippet/document-editor-container/track-changes-only-protect/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="Track-changes-only.cs" %}
{% endhighlight %}{% endtabs %}
{% include code-snippet/document-editor-container/track-changes-only-protect/document-editor.cs %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

Expand All @@ -157,7 +191,9 @@ The following example code illustrates how to enforce and stop protection in Doc
{% include code-snippet/document-editor-container/track-changes-only-protect/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Track-changes-only.cs" %}
{% endhighlight %}{% endtabs %}
{% include code-snippet/document-editor-container/track-changes-only-protect/document-editor.cs %}
{% endhighlight %}
{% endtabs %}
{% endif %}

Tracked changes only protection can be enabled in UI by using [Restrict Editing pane](../document-editor/document-management#restrict-editing-pane/)
Expand Down