-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (20 loc) · 1.01 KB
/
index.js
File metadata and controls
24 lines (20 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
const tinymceElement = document.querySelector('textarea#suggestededits-auto-approve');
const model = JSON.parse(tinymceElement.getAttribute('suggestededits-model'));
tinymce.init({
selector: 'textarea#suggestededits-auto-approve',
height: 500,
plugins: 'suggestededits advlist anchor autolink code charmap emoticons fullscreen help image link lists media preview searchreplace table',
toolbar: 'undo redo | suggestededits | styles fontsizeinput | bold italic | align bullist numlist | table link image | code',
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
suggestededits_model: model,
suggestededits_access: 'full',
suggestededits_content: 'html',
suggestededits_auto_approve: true,
user_id: 'kai-nakamura',
fetch_users: (userIds) => Promise.all(userIds
.map((userId) =>
fetch(`${API_URL}/${userId}`)
.then((response) => response.json())
.catch(() => ({ id: userId })))),
});