You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Track Changes plugin monitors edits made to a document by comparing its current state to the original version. Each change is attributed to its respective author and can be approved or rejected before being applied to the document.
25
+
26
+
[NOTE]
27
+
Since the comparison is made against the original version of the document, if there are unresolved changes by multiple authors affecting the same part, the most recent change will be used for comparison. The `hasChanges` API can be used to implement a safeguard that prevents further edits on a document with unresolved changes.
28
+
29
+
The plugin includes a dedicated view for reviewing current changes, accessible via the `{plugincode} toolbar button or the menu option under the `View` menu. The key components are:
30
+
31
+
. **Read-only Diff View**:
32
+
+
33
+
Highlights the current changes made to the document, using the following color codes:
34
+
+
35
+
* Green: New content.
36
+
* Blue: Modified content. Modifications to HTML content implies attributes or formatting (e.g. bold, italic, etc.).
37
+
* Red: Removed content.
38
+
39
+
. **Sidebar**:
40
+
+
41
+
Contains a header with the following buttons:
42
+
+
43
+
* Show Changes: A toggle button which hides/unhides the change annotations.
44
+
* Complete: Ends the review applies the resolved changes.
45
+
* Cancel: Ends the review without any further action.
46
+
47
+
+
48
+
The sidebar also displays all tracked changes that need to be resolved. Each change can be handled in the following ways:
49
+
* Accept: Applies the change to the document.
50
+
* Reject: Removes the change from the document.
51
+
* Revert: Undoes a previously accepted or rejected change.
52
+
24
53
== Basic setup
25
54
26
55
To setup the {pluginname} plugin in the editor:
27
56
28
57
* add `{plugincode}` to the `plugins` option in the editor configuration;
29
58
* add `{plugincode}` to the `toolbar` option in the editor configuration;
59
+
* add `{plugincode}_model` to the editor configuration.
60
+
* add `{plugincode}_uid` to the editor configuration.
30
61
31
62
For example:
32
63
@@ -36,45 +67,22 @@ tinymce.init({
36
67
selector: 'textarea', // change this value according to your HTML
37
68
plugins: 'trackchanges',
38
69
toolbar: 'trackchanges',
39
-
// track changes options
70
+
trackchanges_model: {
71
+
version: 1,
72
+
maxId: 0,
73
+
contents: [
74
+
{
75
+
type: 'p',
76
+
children: [
77
+
{ text: 'Hello, World!' }
78
+
]
79
+
}
80
+
]
81
+
}
82
+
trackchanges_uid: 'unique-identifier' // replace this with a unique string to identify the user
40
83
});
41
84
----
42
85
43
-
== Data structure
44
-
45
-
=== TrackedDocument
46
-
47
-
`TrackedDocument` is an `+Object+` that contains the following fields:
0 commit comments