Skip to content

Commit c4680c9

Browse files
author
Sorita Heng
committed
Fix demo for Review Permissions
1 parent 99870e9 commit c4680c9

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

modules/ROOT/examples/live-demos/suggestededits-access/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<textarea id="trackchanges">
1+
<textarea id="trackchanges_access">
22
{{logofordemoshtml}}
33

44
<h2 style="text-align: center;">Welcome to the TinyMCE Suggested Edits demo with review permissions!</h2>
Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
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+
128
tinymce.init({
2-
selector: 'textarea#trackchanges',
29+
selector: 'textarea#trackchanges_access',
330
height: 500,
431
plugins: 'trackchanges',
532
toolbar: 'trackchanges',
633
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
734
trackchanges_uid: 'adamhenderson',
835
trackchanges_access: 'read', //change this value to set permission to the Suggested Edits view
9-
readonly: false //set to true to restrict a user's editing permission
36+
readonly: false, //set to true to restrict a user's editing permission
37+
trackchanges_user_lookup
1038
});

0 commit comments

Comments
 (0)