Skip to content

Commit

Permalink
tinymce
Browse files Browse the repository at this point in the history
  • Loading branch information
John Connor committed Aug 19, 2024
1 parent 60f465e commit 1f4914e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
3 changes: 1 addition & 2 deletions voyages/apps/blog/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class AdvancedEditorManager(forms.Textarea):

class Media:
js = (
'//cdn.tiny.cloud/1/evau54786a4pxb62mp84sjc26h72hrpdu9b5'
'ht3zzn8oisd5/tinymce/5/tinymce.min.js',
'//cdn.tiny.cloud/1/s12zokrfdqicajy5cxdauxuczwq653y00bx98ae9qhwklhh3/tinymce/7/tinymce.min.js',
'scripts/filebrowser/TinyMCEv5Admin.js')

def __init__(self, language=None, attrs=None):
Expand Down
2 changes: 1 addition & 1 deletion voyages/apps/contribute/templates/contribute/interim.html
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ <h4 class="modal-title" id="create_cargo_dialog_label">{% trans "Add cargo to vo
<script type="text/javascript" src="{{ STATIC_URL }}scripts/library/[email protected]"></script>
<script type="text/javascript" src="{{ STATIC_URL }}scripts/contribute/common.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}scripts/legacy/utils.js"></script>
<script type="text/javascript" src="//cdn.tiny.cloud/1/evau54786a4pxb62mp84sjc26h72hrpdu9b5ht3zzn8oisd5/tinymce/5/tinymce.min.js"></script>
<script type="text/javascript" src="//cdn.tiny.cloud/1/s12zokrfdqicajy5cxdauxuczwq653y00bx98ae9qhwklhh3/tinymce/7/tinymce.min.js"></script>
<!-- I18n of javascript text -->
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
<!-- Use a global JS constant to specify the root of static urls -->
Expand Down
3 changes: 1 addition & 2 deletions voyages/apps/voyage/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class FlatPageAdmin(FlatPageAdmin):

class Media:
js = (
'//cdn.tiny.cloud/1/evau54786a4pxb62mp84sjc26h72hrpdu9b5'
'ht3zzn8oisd5/tinymce/5/tinymce.min.js',
'//cdn.tiny.cloud/1/s12zokrfdqicajy5cxdauxuczwq653y00bx98ae9qhwklhh3/tinymce/7/tinymce.min.js',
'scripts/tiny_mce/textareas.js',
)

Expand Down
3 changes: 1 addition & 2 deletions voyages/extratools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class AdvancedEditor(forms.Textarea):

class Media:
js = (
'//cdn.tiny.cloud/1/evau54786a4pxb62mp84sjc26h72hrpdu9b5'
'ht3zzn8oisd5/tinymce/5/tinymce.min.js',
'//cdn.tiny.cloud/1/s12zokrfdqicajy5cxdauxuczwq653y00bx98ae9qhwklhh3/tinymce/7/tinymce.min.js',
'scripts/tiny_mce/textareas_small.js')

def __init__(self, language=None, attrs=None):
Expand Down
23 changes: 23 additions & 0 deletions voyages/sitemedia/scripts/tiny_mce/textareas_small.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,26 @@ tinymce.init({
{title: 'Test template 2', content: 'Test 2'}
],
});


<!-- Place the first <script> tag in your HTML's <head> -->
<script src="https://cdn.tiny.cloud/1/s12zokrfdqicajy5cxdauxuczwq653y00bx98ae9qhwklhh3/tinymce/7/tinymce.min.js" referrerpolicy="origin"></script>

<!-- Place the following <script> and <textarea> tags your HTML's <body> -->
<script>
tinymce.init({
selector: 'textarea',
plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount checklist mediaembed casechange export formatpainter pageembed linkchecker a11ychecker tinymcespellchecker permanentpen powerpaste advtable advcode editimage advtemplate ai mentions tinycomments tableofcontents footnotes mergetags autocorrect typography inlinecss markdown',
toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | addcomment showcomments | spellcheckdialog a11ycheck typography | align lineheight | checklist numlist bullist indent outdent | emoticons charmap | removeformat',
tinycomments_mode: 'embedded',
tinycomments_author: 'Author name',
mergetags_list: [
{ value: 'First.Name', title: 'First Name' },
{ value: 'Email', title: 'Email' },
],
ai_request: (request, respondWith) => respondWith.string(() => Promise.reject("See docs to implement AI Assistant")),
});
</script>
<textarea>
Welcome to TinyMCE!
</textarea>

0 comments on commit 1f4914e

Please sign in to comment.