Skip to content

Commit 56f01d9

Browse files
author
Sorita Heng
committed
add live demo template
1 parent ced4230 commit 56f01d9

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
3+
This file is not normally required.
4+
5+
Sometimes, however, a plugin, or a particular feature of a plugin,
6+
requires a back-end service.
7+
8+
In these cases, creating a working demo requires setting up an
9+
emulated version of this service.
10+
11+
And `example.js` is part of this emulation.
12+
13+
`index.js` still runs the live demo.
14+
15+
But `example.js` is what is displayed in the *js* tab of the
16+
live-demo interface on the built docs site.
17+
18+
So `example.js` has to be a working equivalent to `index.js` *if*
19+
`index.js` was wired up in a standard way, to its required back-end
20+
service.
21+
22+
NB: there is one UX consequence of setting up demos to work in
23+
these cases. The *Edit on CodePen* tab does not — and cannot —
24+
present in the documentation.
25+
26+
The initial setup of these ‘includes-an-emulated-back-end’ examples
27+
will almost certainly include significant initial input from the
28+
plugin’s developer.
29+
30+
*/
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<textarea id="<plugincode>">
2+
{{logofordemoshtml}}
3+
4+
<!-- example html here -->
5+
6+
<h2>Found a bug?</h2>
7+
8+
<p>If you believe you have found a bug please create an issue on the <a href="https://github.com/tinymce/tinymce/issues">GitHub repo</a> to report it to the developers.</p>
9+
10+
<h2>Finally…</h2>
11+
12+
<p>Don’t forget to check out <a href="http://www.plupload.com" target="_blank">Plupload</a>, the upload solution featuring HTML5 upload support.</p>
13+
<p>Thanks for supporting TinyMCE. We hope it helps you and your users create great content.</p>
14+
<p>All the best from the TinyMCE team.</p>
15+
</textarea>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
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.
5+
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 }'
16+
});

modules/ROOT/pages/trackchanges.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The Track Changes plugin allows users to easily review and manage changes made t
1515

1616
== Interactive example
1717

18+
liveDemo::{plugincode}[]
19+
20+
include::partial$misc/admon-iframe-only.adoc[]
21+
1822
== How it works
1923

2024
== Basic setup

0 commit comments

Comments
 (0)