
5 changed files with 114 additions and 84 deletions
-
2_data/nav.yml
-
43_includes/codepens/annotations/index.html
-
44_includes/codepens/annotations/index.js
-
0_includes/codepens/annotations/style.css
-
109advanced/annotations.md
@ -0,0 +1,43 @@ |
|||
<textarea><p style="text-align: center; font-size: 15px;"><img title="TinyMCE Logo" src="//www.tiny.cloud/images/glyph-tinymce@2x.png" alt="TinyMCE Logo" width="110" height="97" /> |
|||
</p> |
|||
<h1 style="text-align: center;">Welcome to the TinyMCE Cloud demo!</h1> |
|||
<h5 style="text-align: center;">Note, this includes some "enterprise/premium" features.<br>Visit the <a href="https://www.tiny.cloud/pricing/#demo-enterprise">pricing page</a> to learn more about our premium plugins.</h5> |
|||
<p>Please try out the features provided in this full featured example.</p> |
|||
|
|||
<h2>Got questions or need help?</h2> |
|||
<ul> |
|||
<li>Our <a href="//www.tiny.cloud/docs/">documentation</a> is a great resource for learning how to configure TinyMCE.</li> |
|||
<li>Have a specific question? Visit the <a href="https://community.tinymce.com/forum/">Community Forum</a>.</li> |
|||
<li>We also offer enterprise grade support as part of <a href="https://www.tiny.cloud/pricing">TinyMCE premium subscriptions</a>.</li> |
|||
</ul> |
|||
|
|||
<h2>A simple table to play with</h2> |
|||
<table style="text-align: center;border-collapse: collapse; width: 100%;"> |
|||
<thead> |
|||
<tr> |
|||
<th>Product</th> |
|||
<th>Cost</th> |
|||
<th>Really?</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr> |
|||
<td>TinyMCE Cloud</td> |
|||
<td>Get started for free</td> |
|||
<td>YES!</td> |
|||
</tr> |
|||
<tr> |
|||
<td>Plupload</td> |
|||
<td>Free</td> |
|||
<td>YES!</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
|
|||
<h2>Found a bug?</h2> |
|||
<p>If you think 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> |
|||
|
|||
<h2>Finally ...</h2> |
|||
<p>Don't forget to check out our other product <a href="http://www.plupload.com" target="_blank">Plupload</a>, your ultimate upload solution featuring HTML5 upload support.</p> |
|||
<p>Thanks for supporting TinyMCE! We hope it helps you and your users create great content.<br>All the best from the TinyMCE team.</p> |
|||
</textarea> |
@ -0,0 +1,44 @@ |
|||
var settings = { |
|||
selector: 'textarea', |
|||
toolbar: ['annotate-alpha'], |
|||
menubar: false, |
|||
height: '750px', |
|||
|
|||
content_style: '.mce-annotation { background-color: darkgreen; color: white; }', |
|||
|
|||
setup: function (editor) { |
|||
editor.ui.registry.addButton('annotate-alpha', { |
|||
text: 'Annotate', |
|||
onAction() { |
|||
const comment = prompt('Comment with?'); |
|||
editor.annotator.annotate('alpha', { |
|||
uid: 'custom-generated-id', |
|||
comment: comment |
|||
}); |
|||
editor.focus(); |
|||
}, |
|||
onSetup (btnApi) { |
|||
editor.annotator.annotationChanged('alpha', function (state, name, obj) { |
|||
console.log('Current selection has an annotation: ', state); |
|||
btnApi.setDisabled(state); |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
editor.on('init', function () { |
|||
editor.annotator.register('alpha', { |
|||
persistent: true, |
|||
decorate: function (uid, data) { |
|||
return { |
|||
attributes: { |
|||
'data-mce-comment': data.comment ? data.comment : '', |
|||
'data-mce-author': data.author ? data.author : 'anonymous' |
|||
} |
|||
}; |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
tinymce.init(settings); |
Write
Preview
Loading…
Cancel
Save
Reference in new issue