1+ <!doctype html>
2+ < html lang ="en ">
3+ < head >
4+ < title > Exercise 1 - instantiating TinyMCE</ title >
5+
6+ <!--
7+ Instantiating TinyMCE is one of the first things TinyMCE users need to do, so it makes sense for this to be
8+ our first exercise.
9+
10+ TODO Head over to https://www.tiny.cloud/ and sign up for an API key. Replace the 'no-api-key' with your api key in the below script tag.
11+ -->
12+ < script src ="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js " referrerpolicy ="origin "> </ script >
13+ </ head >
14+ < body >
15+
16+ <!--
17+ This project has webpack configured. Run `yarn webpack-dev-server` and navigate to
18+ http://localhost:8080/src/main/html/Part1Exercise1.html to view this page.
19+
20+ tinymce.init is the most important API function of TinyMCE. In its most basic form, you specify a CSS selector for an
21+ element, and a TinyMCE editor appears where the element was:
22+ -->
23+ < textarea id ="editor1 "> </ textarea >
24+ < script > tinymce . init ( { selector : '#editor1' } ) ; </ script >
25+
26+ <!--
27+ If you inspect the DOM in your browser, you'll notice that the textarea has been hidden, and editor dom elements created
28+ beside the textarea.
29+
30+ Since a selector can match multiple elements, you can use tinymce.init to create multiple editors.
31+ TODO In the below script tag, instantiate TinyMCE editors in the below
32+ -->
33+ < textarea class ="editorSet "> </ textarea >
34+ < textarea class ="editorSet "> </ textarea >
35+ < script > </ script >
36+
37+
38+ <!--
39+ TinyMCE is very customizable. Let's customize it. I'll throw you in the deep end a bit, with just some requirements and
40+ documentation, as this is what our customers start with.
41+
42+ Docs can be found here:
43+ https://www.tiny.cloud/docs
44+
45+ List of toolbars items can be found here:
46+ https://www.tiny.cloud/docs/advanced/editor-control-identifiers/#toolbarcontrols
47+
48+
49+ TODO Instantiate a TinyMCE editor with no menu bar, no status bar, and toolbar buttons to do the following:
50+ - make text bold
51+ - insert a table
52+ - make the editor full screen
53+ - view/edit source code
54+
55+ Note: you'll need to add some plugins for these to work.
56+ -->
57+
58+
59+ </ body >
60+
61+ </ html >
0 commit comments