File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed
modules/ROOT/examples/live-demos/suggestededits-access Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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+
128tinymce . 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} ) ;
You can’t perform that action at this time.
0 commit comments