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
This example demonstrates how to submit the current document and model to a server, to ensure they are saved synchronously. The current model is retrieved using the `getModel` API.
26
31
27
-
.Example
28
32
[source,js]
29
33
----
30
-
const documentId = '<YOUR_DOCUMENT_ID>'; // Replace with your document ID
31
-
32
34
tinymce.init({
33
35
selector: 'textarea#suggestededits', // change this value according to your HTML
This example demonstrates how to set the model and the document in the editor, after fetching them from a server. The `setModel` method sets the current model of the document and the editor content, as generated from that model.
78
82
79
-
.Example
80
83
[source,js]
81
84
----
82
-
const documentIds = ['doc1', 'doc2', 'doc3']; // Example document IDs
83
-
84
85
tinymce.init({
85
86
selector: 'textarea#suggestededits', // change this value according to your HTML
This example demonstrates how to reset the model to the current content of the editor, clearing all suggestions. The `resetModel` method generates a new model from the current content and sets it as the current model.
107
+
108
+
[source,js]
109
+
----
110
+
tinymce.init({
111
+
selector: 'textarea#suggestededits', // change this value according to your HTML
// Reset the model to the current content, clearing all suggestions
119
+
editor.plugins.suggestededits.resetModel();
120
+
121
+
editor.notificationManager.open({
122
+
text: 'All suggestions have been cleared.',
123
+
type: 'info',
124
+
timeout: 5000,
125
+
});
126
+
}
127
+
});
116
128
}
117
129
});
118
130
----
119
131
120
132
[[has_changes]]
121
-
==`hasChanges`
133
+
== `hasChanges` Example
134
+
135
+
This example demonstrates how to check if there are any changes in the document that need to be reviewed before saving. The `hasChanges` method is used to determine if there are any unreviewed edits.
0 commit comments