Skip to content

Commit facd970

Browse files
author
Sorita Heng
committed
Update API sections
1 parent 56f01d9 commit facd970

File tree

5 files changed

+326
-50
lines changed

5 files changed

+326
-50
lines changed

modules/ROOT/pages/trackchanges.adoc

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,44 @@ tinymce.init({
4242

4343
== Data structure
4444

45+
=== TrackedDocument
46+
47+
`TrackedDocument` is an `+Object+` that contains the following fields:
48+
49+
[cols="1,1,1,3",options="header"]
50+
|===
51+
| Field | Type | Required? | Description
52+
| `+version+` | `+Number+` | required | <description>
53+
| `+maxId+` | `+Number+` | required | <description>
54+
| `+contents+` | xref:#trackednode[TrackedNode] `+Object+` `+Array+` | required | <description>
55+
|===
56+
57+
=== TrackedNode
58+
59+
`TrackedNode` is an `+Object+` that contains the following fields:
60+
61+
[cols="1,1,1,3",options="header"]
62+
|===
63+
| Field | Type | Required? | Description
64+
| `+type+` | `+String+` | required | <description>
65+
| `+attrs+` | `` | optional | <description>
66+
| `+oldAttrs+` | `` | optional | <description>
67+
| `+text+` | `+String+` | required | <description>
68+
| `+_opData+` | xref:#trackedData[TrackedData] `+Object+` `+Array+` | optional | <description>
69+
| `+format+` | xref:#textformat[TextFormat] `+Object+` | optional | <description>
70+
| `+oldFormat+` | xref:#textformat[TextFormat] `+Object+` | optional | <description>
71+
| `+children+` | xref:#trackednode[TrackedNode] `+Object+` `+Array+` | optional | <description>
72+
|===
73+
74+
=== TrackedData
75+
76+
=== TextFormat
77+
4578
== Options
4679

4780
The following configuration options affect the behavior of the {pluginname} plugin.
4881

49-
include::partial$configuration/trackchanges-options.adoc[]
82+
include::partial$configuration/trackchanges-options.adoc[leveloffset=+1]
5083

5184
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]
5285

@@ -66,6 +99,6 @@ include::partial$events/{plugincode}-events.adoc[]
6699

67100
== APIs
68101

69-
The {pluginname} plugin provide the following APIs.
102+
The {pluginname} plugin provides the following APIs.
70103

71104
include::partial$plugin-apis/{plugincode}-apis.adoc[]

modules/ROOT/partials/commands/trackchanges-cmds.adoc

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,11 @@
22
|===
33
|Command |Description
44

5-
|<mceCommandOne> |<Description one.>
6-
// Boilerplate for commands that require further documentation
7-
|<mceCommandTwo> |Description two. For details, see xref:using-<mcecommandtwo>[Using `+<mceCommandTwo>+`].
5+
|trackchanges |Toggle the Track Changes view
86
|===
97

108
.Examples
119
[source,js]
1210
----
13-
tinymce.activeEditor.execCommand('<mceCommandOne>');
14-
tinymce.activeEditor.execCommand('<mceCommandTwo>', <true|false>, { <key1>: '<value1>', <key2>: '<number>' });
11+
tinymce.activeEditor.execCommand('trackchanges');
1512
----
16-
17-
// Boilerplate for further documentation of commands that require it.
18-
[[using-<mcecommandtwo>]]
19-
== Using `+<mceCommandTwo>+`
20-
21-
`+<mceCommandTwo>+` accepts an object with the following key-value pairs:
22-
23-
[cols="1,,1,2",options="header"]
24-
|===
25-
|Name |Value |Requirement |Description
26-
27-
|<key1> |`+'<value1>'+` or `+'<value2>'+` |<Not r|R>equired |<Key-value description one.>
28-
|<key2> |`+<number>+` |<Not r|R>equired |<Key-value description two.>
29-
|===
30-
31-
// Further notes as required. Delete this comment once notes are added or if they are not required.
32-
33-
// Remove all comment lines and comment blocks before publishing.

modules/ROOT/partials/configuration/trackchanges-options.adoc

Lines changed: 276 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[[<configuration_option>]]
2-
== `<configuration_option>`
1+
[[trackchanges_model]]
2+
== `trackchanges_model`
33

44
////
55
What does the option do?
@@ -13,12 +13,282 @@ Are there risks?
1313
- For longer or more complicated scenarios, use the limitations section below.
1414
////
1515

16-
*Type:* `+String+`, `+Boolean+`, `+Number+`, `+Function+`, `+Object+`, `+Array+`, or `+Regexp+`
16+
*Type:* xref:#trackeddocument[TrackedDocument] `+Object+`
1717

18-
// Remove the *Possible values* line if there is no discrete set of possible values.
19-
*Possible values:* `'string1'`, `'string2'`, `false`
18+
=== Example: using `trackchanges_model`
2019

21-
*Default value:* `false`, `1`, `'string1'`
20+
// Add a working and tested configuration.
21+
[source,js]
22+
----
23+
tinymce.init({
24+
selector: 'textarea', // Change this value according to your HTML
25+
<configuration_option>: '<value>'
26+
});
27+
----
28+
29+
// Add a working and tested configuration (edit as required)
30+
// or remove if not applicable.
31+
=== Example: disabling the <feature>
32+
33+
To disable <feature>, set `<configuration_option>` to `false`.
34+
35+
[source,js]
36+
----
37+
tinymce.init({
38+
selector: 'textarea', // Change this value according to your HTML
39+
<configuration_option>: 'false'
40+
});
41+
----
42+
43+
// Remove if not applicable.
44+
=== Limitation<s> of the `<configuration_option>` option
45+
46+
The `<configuration_option>` option has the following limitations.
47+
48+
////
49+
Known limitations.
50+
Complicated scenarios.
51+
Anything that warrants a CAUTION or WARNING admonition.
52+
////
53+
54+
[[trackchanges_uid]]
55+
== `trackchanges_uid`
56+
57+
*Type:* `+String+`
58+
59+
60+
////
61+
What does the option do?
62+
Why use it?
63+
When use it?
64+
What values can it use?
65+
What do these values do?
66+
Are there risks?
67+
- Explain without using ‘risk’ or similar words.
68+
- Use NOTE or IMPORTANT admonitions if helpful.
69+
- For longer or more complicated scenarios, use the limitations section below.
70+
////
71+
72+
=== Example: using `<configuration_option>`
73+
74+
// Add a working and tested configuration.
75+
[source,js]
76+
----
77+
tinymce.init({
78+
selector: 'textarea', // Change this value according to your HTML
79+
<configuration_option>: '<value>'
80+
});
81+
----
82+
83+
// Add a working and tested configuration (edit as required)
84+
// or remove if not applicable.
85+
=== Example: disabling the <feature>
86+
87+
To disable <feature>, set `<configuration_option>` to `false`.
88+
89+
[source,js]
90+
----
91+
tinymce.init({
92+
selector: 'textarea', // Change this value according to your HTML
93+
<configuration_option>: 'false'
94+
});
95+
----
96+
97+
// Remove if not applicable.
98+
=== Limitation<s> of the `<configuration_option>` option
99+
100+
The `<configuration_option>` option has the following limitations.
101+
102+
////
103+
Known limitations.
104+
Complicated scenarios.
105+
Anything that warrants a CAUTION or WARNING admonition.
106+
////
107+
108+
[[trackchanges_role]]
109+
== `trackchanges_role`
110+
111+
*Type:* `+String+`
112+
113+
*Possible values:* `'admin'`, `'reviewer'`, `'contributor'`, `'viewer'`, `'none'`,
114+
115+
*Default value:* `'admin'`
116+
117+
118+
////
119+
What does the option do?
120+
Why use it?
121+
When use it?
122+
What values can it use?
123+
What do these values do?
124+
Are there risks?
125+
- Explain without using ‘risk’ or similar words.
126+
- Use NOTE or IMPORTANT admonitions if helpful.
127+
- For longer or more complicated scenarios, use the limitations section below.
128+
////
129+
130+
=== Example: using `<configuration_option>`
131+
132+
// Add a working and tested configuration.
133+
[source,js]
134+
----
135+
tinymce.init({
136+
selector: 'textarea', // Change this value according to your HTML
137+
<configuration_option>: '<value>'
138+
});
139+
----
140+
141+
// Add a working and tested configuration (edit as required)
142+
// or remove if not applicable.
143+
=== Example: disabling the <feature>
144+
145+
To disable <feature>, set `<configuration_option>` to `false`.
146+
147+
[source,js]
148+
----
149+
tinymce.init({
150+
selector: 'textarea', // Change this value according to your HTML
151+
<configuration_option>: 'false'
152+
});
153+
----
154+
155+
// Remove if not applicable.
156+
=== Limitation<s> of the `<configuration_option>` option
157+
158+
The `<configuration_option>` option has the following limitations.
159+
160+
////
161+
Known limitations.
162+
Complicated scenarios.
163+
Anything that warrants a CAUTION or WARNING admonition.
164+
////
165+
166+
[[trackchanges_user_lookup]]
167+
== `trackchanges_user_lookup`
168+
169+
*Type:* `+Function+`
170+
171+
172+
////
173+
What does the option do?
174+
Why use it?
175+
When use it?
176+
What values can it use?
177+
What do these values do?
178+
Are there risks?
179+
- Explain without using ‘risk’ or similar words.
180+
- Use NOTE or IMPORTANT admonitions if helpful.
181+
- For longer or more complicated scenarios, use the limitations section below.
182+
////
183+
184+
=== Example: using `<configuration_option>`
185+
186+
// Add a working and tested configuration.
187+
[source,js]
188+
----
189+
tinymce.init({
190+
selector: 'textarea', // Change this value according to your HTML
191+
<configuration_option>: '<value>'
192+
});
193+
----
194+
195+
// Add a working and tested configuration (edit as required)
196+
// or remove if not applicable.
197+
=== Example: disabling the <feature>
198+
199+
To disable <feature>, set `<configuration_option>` to `false`.
200+
201+
[source,js]
202+
----
203+
tinymce.init({
204+
selector: 'textarea', // Change this value according to your HTML
205+
<configuration_option>: 'false'
206+
});
207+
----
208+
209+
// Remove if not applicable.
210+
=== Limitation<s> of the `<configuration_option>` option
211+
212+
The `<configuration_option>` option has the following limitations.
213+
214+
////
215+
Known limitations.
216+
Complicated scenarios.
217+
Anything that warrants a CAUTION or WARNING admonition.
218+
////
219+
220+
[[trackchanges_css_url]]
221+
== `trackchanges_css_url`
222+
223+
*Type:* `+String+`
224+
225+
*Default value:* `'${pluginUrl}/css/trackchanges.css'`
226+
227+
228+
////
229+
What does the option do?
230+
Why use it?
231+
When use it?
232+
What values can it use?
233+
What do these values do?
234+
Are there risks?
235+
- Explain without using ‘risk’ or similar words.
236+
- Use NOTE or IMPORTANT admonitions if helpful.
237+
- For longer or more complicated scenarios, use the limitations section below.
238+
////
239+
240+
=== Example: using `<configuration_option>`
241+
242+
// Add a working and tested configuration.
243+
[source,js]
244+
----
245+
tinymce.init({
246+
selector: 'textarea', // Change this value according to your HTML
247+
<configuration_option>: '<value>'
248+
});
249+
----
250+
251+
// Add a working and tested configuration (edit as required)
252+
// or remove if not applicable.
253+
=== Example: disabling the <feature>
254+
255+
To disable <feature>, set `<configuration_option>` to `false`.
256+
257+
[source,js]
258+
----
259+
tinymce.init({
260+
selector: 'textarea', // Change this value according to your HTML
261+
<configuration_option>: 'false'
262+
});
263+
----
264+
265+
// Remove if not applicable.
266+
=== Limitation<s> of the `<configuration_option>` option
267+
268+
The `<configuration_option>` option has the following limitations.
269+
270+
////
271+
Known limitations.
272+
Complicated scenarios.
273+
Anything that warrants a CAUTION or WARNING admonition.
274+
////
275+
276+
[[trackchanges_diff_classes]]
277+
== `trackchanges_diff_classes`
278+
279+
*Type:* `+Object+`
280+
281+
////
282+
What does the option do?
283+
Why use it?
284+
When use it?
285+
What values can it use?
286+
What do these values do?
287+
Are there risks?
288+
- Explain without using ‘risk’ or similar words.
289+
- Use NOTE or IMPORTANT admonitions if helpful.
290+
- For longer or more complicated scenarios, use the limitations section below.
291+
////
22292

23293
=== Example: using `<configuration_option>`
24294

0 commit comments

Comments
 (0)