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
<h2style="text-align: center;">Welcome to the TinyMCE Suggested Edits demo with review permissions!</h2>
5
+
6
+
<pstyle="text-align: center;">In this demo, the user has a 'read' access to the Suggested Edits view. Try typing in the editor and then clicking the Review Changes button in the toolbar to see how it works!</p>
7
+
8
+
<pstyle="text-align: center;">Try setting the editor read-only mode to true to restrict editing permission.</p>
Copy file name to clipboardExpand all lines: modules/ROOT/partials/configuration/suggestededits-options.adoc
+64-15Lines changed: 64 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,31 @@
1
+
[[suggestededits_uid]]
2
+
== `suggestededits_uid`
3
+
4
+
The `{plugincode}_uid` is a _required_ option that takes as input a unique string to identify the current user. This is used to attribute changes made by the user.
5
+
6
+
*Type:* `+String+`
7
+
8
+
=== Example: using `{plugincode}_uid`
9
+
10
+
// Add a working and tested configuration.
11
+
[source,js]
12
+
----
13
+
tinymce.init({
14
+
selector: 'textarea', // Change this value according to your HTML
15
+
plugins: 'suggestededits',
16
+
toolbar: 'suggestededits',
17
+
suggestededits_uid: 'unique-identifier' // replace this with a unique string to identify the user
18
+
});
19
+
----
20
+
1
21
[[suggestededits_model]]
2
22
== `suggestededits_model`
3
23
4
-
The `suggestededits_model` option sets the initial model of the document to begin tracking changes. It takes as input an object representing the document. If no value is set, the plugin will generate the model by default.
24
+
The `{plugincode}_model` option sets the initial model of the document to begin tracking changes. It takes as input an object representing the document. If no value is set, the plugin will generate the model by default.
selector: 'textarea', // Change this value according to your HTML
15
35
plugins: 'suggestededits',
16
36
toolbar: 'suggestededits',
37
+
suggestededits_uid: 'unique-identifier', // replace this with a unique string to identify the user
17
38
suggestededits_model: {
18
39
version: 1,
19
40
maxId: 0,
@@ -29,36 +50,64 @@ tinymce.init({
29
50
});
30
51
----
31
52
32
-
[[suggestededits_uid]]
33
-
== `suggestededits_uid`
53
+
[[suggestededits_access]]
54
+
== `suggestededits_access`
34
55
35
-
The `suggestededits_uid` is a _required_ option that takes as input a unique string to identify the current user. This is used to attribute changes made by the user.
56
+
To configure a user's permission to edit the document and review changes, the `{plugincode}_access` option can be set alongside the editor mode.
The possible values set the access level of the review permissions as follows:
65
+
66
+
[cols="20%,80%"]
67
+
|===
68
+
|Value | Review Permission
69
+
70
+
|`+'full'+`
71
+
|Access to the {pluginname} view, with permission to accept, reject, or add suggestions to changes.
72
+
73
+
|`+'suggest'+`
74
+
|Access to the {pluginname} view, with permission to add suggestions to changes.
75
+
76
+
|`+'read'+`
77
+
|Readonly access to the {pluginname} view.
78
+
79
+
|`+'none'+`
80
+
|No access to the {pluginname} view.
81
+
|===
82
+
83
+
[NOTE]
84
+
The `{plugincode}_access` option can be used in combination with the editor's read-only mode to restrict a user’s editing permission.
85
+
86
+
.Example
87
+
[source,javascript]
43
88
----
44
89
tinymce.init({
45
90
selector: 'textarea', // Change this value according to your HTML
46
91
plugins: 'suggestededits',
47
92
toolbar: 'suggestededits',
48
-
suggestededits_uid: 'unique-identifier' // replace this with a unique string to identify the user
93
+
suggestededits_uid: 'unique-identifier', // replace this with a unique string to identify the user
94
+
suggestededits_access: 'full' //change this value to set permission to the Suggested Edits view
95
+
readonly: false //set to true to restrict a user's editing permission
49
96
});
50
97
----
51
98
99
+
liveDemo::suggestededits-access[]
100
+
52
101
[[suggestededits_css_url]]
53
102
== `suggestededits_css_url`
54
103
55
-
The `suggestededits_css_url` option sets the location where a CSS file containing change annotations in the {pluginname} view should be loaded from. To override the default CSS classes, use this option alongside `suggestededits_diff_classes`.
104
+
The `{plugincode}_css_url` option sets the location where a CSS file containing change annotations in the {pluginname} view should be loaded from. To override the default CSS classes, use this option alongside `{plugincode}_diff_classes`.
The `suggestededits_diff_classes` option configures the CSS classes applied to the change annotations in the {pluginname} view. This is useful to set custom styles and must be used in combination with the `suggestededits_css_url` option.
124
+
The `{plugincode}_diff_classes` option configures the CSS classes applied to the change annotations in the {pluginname} view. This is useful to set custom styles and must be used in combination with the `{plugincode}_css_url` option.
76
125
77
126
[NOTE]
78
-
The CSS class names must exist in the xref:suggestededits_css_url[`+suggestededits_css_url+`].
127
+
The CSS class names must exist in the xref:{plugincode}_css_url[`+{plugincode}_css_url+`].
79
128
80
129
*Type:* `+Object+`
81
130
@@ -92,7 +141,7 @@ Below are the default CSS classes:
0 commit comments