|
| 1 | +/** Fake user database */ |
| 2 | +const userinfos = { |
| 3 | + adamhenderson: { |
| 4 | + uid: 'adamhenderson', |
| 5 | + name: 'Adam Henderson', |
| 6 | + avatar: `https://randomuser.me/api/portraits/men/1.jpg`, |
| 7 | + }, |
| 8 | + michaelcook: { |
| 9 | + uid: 'michaelcook', |
| 10 | + name: 'Michael Cook', |
| 11 | + avatar: `https://randomuser.me/api/portraits/men/2.jpg`, |
| 12 | + }, |
| 13 | + kalebwilson: { |
| 14 | + uid: 'kalebwilson', |
| 15 | + name: 'Kaleb Wilson', |
| 16 | + avatar: `https://randomuser.me/api/portraits/men/3.jpg`, |
| 17 | + }, |
| 18 | + kyleeinstein: { |
| 19 | + uid: 'kyleeinstein', |
| 20 | + name: 'Kyle Einstein', |
| 21 | + avatar: `https://randomuser.me/api/portraits/men/4.jpg`, |
| 22 | + }, |
| 23 | +}; |
| 24 | + |
| 25 | +const trackchanges_user_lookup = (uid) => new Promise((resolve, reject) => |
| 26 | + setTimeout(() => userinfos[uid] ? resolve(userinfos[uid]) : reject(), 1000)); |
| 27 | + |
| 28 | + |
1 | 29 | tinymce.init({ |
2 | | - selector: 'textarea#<plugincode>', |
3 | | -// below is a basic 6.x working configuration. |
4 | | -// Do not assume it is suitable for demonstrating the plugin to be documented. |
| 30 | + selector: 'textarea#trackchanges', |
5 | 31 | height: 500, |
6 | | - plugins: [ |
7 | | - 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview', |
8 | | - 'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen', |
9 | | - 'insertdatetime', 'media', 'table', 'help', 'wordcount' |
10 | | - ], |
11 | | - toolbar: 'undo redo | blocks | ' + |
12 | | - 'bold italic backcolor | alignleft aligncenter ' + |
13 | | - 'alignright alignjustify | bullist numlist outdent indent | ' + |
14 | | - 'removeformat | help', |
15 | | - content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }' |
| 32 | + plugins: 'trackchanges', |
| 33 | + toolbar: 'trackchanges', |
| 34 | + content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }', |
| 35 | + trackchanges_uid: 'adamhenderson', |
| 36 | + trackchanges_user_lookup, |
16 | 37 | }); |
0 commit comments