Skip to content

Commit 2bf2c71

Browse files
DOC-2534: Update the example for lazy loading a revision (#3455)
* DOC-2534: Update the example for lazy loading a revision * DOC-2534: Update example.js of full featured demo to correctly reflect the revisions being shown in the list * DOC-2534: Update demo code as suggested
1 parent 1d5345c commit 2bf2c71

File tree

3 files changed

+269
-149
lines changed

3 files changed

+269
-149
lines changed

modules/ROOT/examples/live-demos/full-featured/example.js

Lines changed: 131 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,140 @@ tinymce.init({
146146
title: 'Salutation'
147147
}
148148
],
149-
revisionhistory_fetch: () => { // Implement the fetch function for the revision history plugin
149+
// For revision history plugin
150+
revisionhistory_fetch: () => {
150151
return Promise.resolve([
151152
{
152-
revisionId: '1',
153+
revisionId: '3',
153154
createdAt: '2023-11-24T22:26:21.578Z',
154-
content: '<p>Initial content</p>'
155+
author: {
156+
id: 'husky',
157+
name: 'A Tiny Husky',
158+
avatar: '{{imagesdir}}/tiny-husky.jpg'
159+
},
160+
content: `
161+
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="Tiny Logo" src="https://www.tiny.cloud/docs/images/logos/android-chrome-256x256.png" alt="TinyMCE Logo" width="128" height="128"></p>
162+
<h2 style="text-align: center;">Welcome to the TinyMCE editor demo!</h2>
163+
<h2>A simple table to play with</h2>
164+
<table style="border-collapse: collapse; width: 100%;" border="1">
165+
<thead>
166+
<tr>
167+
<th>Product</th>
168+
<th>Cost</th>
169+
<th>Really?</th>
170+
</tr>
171+
</thead>
172+
<tbody>
173+
<tr>
174+
<td>TinyMCE</td>
175+
<td>Free</td>
176+
<td>YES!</td>
177+
</tr>
178+
<tr>
179+
<td>Plupload</td>
180+
<td>Free</td>
181+
<td>YES!</td>
182+
</tr>
183+
</tbody>
184+
</table>
185+
<h2>Found a bug?</h2>
186+
<p>If you think you have found a bug please create an issue on the <a href="https://github.com/tinymce/tinymce/issues">GitHub repo</a> to report it to the developers.</p>
187+
<h2>Finally ...</h2>
188+
<p><s>Don't forget to check out our other product <a href="http://www.plupload.com" target="_blank" rel="noopener">Plupload</a>, your ultimate upload solution featuring HTML5 upload support.</s></p>
189+
<p>Thanks for supporting TinyMCE! We hope it helps you and your users create great content.<br>All the best from the TinyMCE team.</p>
190+
`,
191+
},
192+
{
193+
revisionId: '2',
194+
createdAt: '2023-11-25T08:30:21.578Z',
195+
author: {
196+
id: 'tiny.user',
197+
name: 'A Tiny User',
198+
avatar: '{{imagesdir}}/logos/android-chrome-192x192.png'
199+
},
200+
content: `
201+
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="Tiny Logo" src="https://www.tiny.cloud/docs/images/logos/android-chrome-256x256.png" alt="TinyMCE Logo" width="128" height="128"></p>
202+
<h2 style="text-align: center;">Welcome to the TinyMCE editor demo!</h2>
203+
<h2>Got questions or need help?</span></h2>
204+
<ol>
205+
<li>Our <a href="../">documentation</a> is a great resource for learning how to configure TinyMCE.</li>
206+
<li>Have a specific question? Try the <a href="https://stackoverflow.com/questions/tagged/tinymce" target="_blank" rel="noopener"><code>tinymce</code> tag at Stack Overflow</a>.</li>
207+
<li>We also offer enterprise grade support as part of <a href="../../../../pricing">TinyMCE premium plans</a>.</li>
208+
</ol>
209+
<h2>A simple table to play with</h2>
210+
<table style="border-collapse: collapse; width: 100%;" border="1">
211+
<thead>
212+
<tr>
213+
<th>Product</th>
214+
<th>Cost</th>
215+
<th>Really?</th>
216+
</tr>
217+
</thead>
218+
<tbody>
219+
<tr>
220+
<td>TinyMCE</td>
221+
<td>Free</td>
222+
<td>YES!</td>
223+
</tr>
224+
<tr>
225+
<td>Plupload</td>
226+
<td>Free</td>
227+
<td>YES!</td>
228+
</tr>
229+
</tbody>
230+
</table>
231+
<h2>Found a bug?</h2>
232+
<p>If you think you have found a bug please create an issue on the <a href="https://github.com/tinymce/tinymce/issues">GitHub repo</a> to report it to the developers.</p>
233+
<h2>Finally ...</h2>
234+
<p>Don't forget to check out our other product <a href="http://www.plupload.com" target="_blank" rel="noopener">Plupload</a>, your ultimate upload solution featuring HTML5 upload support.</p>
235+
<p>Thanks for supporting TinyMCE! We hope it helps you and your users create great content.<br>All the best from the TinyMCE team.</p>
236+
`,
237+
},
238+
{
239+
revisionId: '1',
240+
createdAt: '2023-11-29T10:11:21.578Z',
241+
author: {
242+
id: 'tiny.user',
243+
name: 'A Tiny User',
244+
avatar: '{{imagesdir}}/logos/android-chrome-192x192.png'
245+
},
246+
content: `
247+
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="Tiny Logo" src="https://www.tiny.cloud/docs/images/logos/android-chrome-256x256.png" alt="TinyMCE Logo" width="128" height="128"></p>
248+
<h2 style="text-align: center;">Welcome to the TinyMCE editor demo!</h2>
249+
<h2>Got questions or need help?</h2>
250+
<ul>
251+
<li>Our <a href="../">documentation</a> is a great resource for learning how to configure TinyMCE.</li>
252+
<li>Have a specific question? Try the <a href="https://stackoverflow.com/questions/tagged/tinymce" target="_blank" rel="noopener"><code>tinymce</code> tag at Stack Overflow</a>.</li>
253+
<li>We also offer enterprise grade support as part of <a href="../../../../pricing">TinyMCE premium plans</a>.</li>
254+
</ul>
255+
<h2>A simple table to play with</h2>
256+
<table style="border-collapse: collapse; width: 100%;" border="1">
257+
<thead>
258+
<tr>
259+
<th>Product</th>
260+
<th>Cost</th>
261+
<th>Really?</th>
262+
</tr>
263+
</thead>
264+
<tbody>
265+
<tr>
266+
<td>TinyMCE</td>
267+
<td>Free</td>
268+
<td>YES!</td>
269+
</tr>
270+
<tr>
271+
<td>Plupload</td>
272+
<td>Free</td>
273+
<td>YES!</td>
274+
</tr>
275+
</tbody>
276+
</table>
277+
<h2>Found a bug?</h2>
278+
<p>If you think you have found a bug please create an issue on the <a href="https://github.com/tinymce/tinymce/issues">GitHub repo</a> to report it to the developers.</p>
279+
<h2>Finally ...</h2>
280+
<p>Don't forget to check out our other product <a href="http://www.plupload.com" target="_blank" rel="noopener">Plupload</a>, your ultimate upload solution featuring HTML5 upload support.</p>
281+
<p>Thanks for supporting TinyMCE! We hope it helps you and your users create great content.<br>All the best from the TinyMCE team.</p>
282+
`,
155283
},
156284
]);
157285
},

0 commit comments

Comments
 (0)