TineMCE refactoring

Unified all tinyMCE instances used across AAC, now they are initiated in one single file
+ added option to upload images within editor (CTRL-C CTRL-V)
+ there is new folder: user/, which will be used for all user generated data, like image uploads, guild images, etc.
This commit is contained in:
slawkens
2023-02-02 15:41:33 +01:00
parent 77460b0832
commit 9de8145f82
7 changed files with 133 additions and 85 deletions

View File

@@ -1,34 +1,28 @@
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
{{ include('tinymce.html.twig') }}
<script type="text/javascript">
tinymce.init({
selector: "textarea",
theme: "modern",
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
image_advtab: true,
relative_urls: false,
remove_script_host: false,
document_base_url: "{{ constant('BASE_URL') }}"
});
tinymceInit();
</script>
<div align="center" class="text-center"><p class="note">Sending mails may take some time if there are many users in db.</p></div>
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Mailer</h5>
</div>
<form method="post">
<form id="form" method="post">
<div class="card-body">
<div class="form-group row">
<label for="mail_to">To: (enter email, or leave empty to all)</label>
<input class="form-control" type="text" id="mail_to" name="mail_to" value="{{ mail_to }}"/>
</div>
<div class="form-group row">
<label for="mail_subject">Subject:</label>
<input class="form-control" type="text" id="mail_subject" name="mail_subject" value="{{ mail_subject }}" maxlength="30"/>
</div>
<label for="editor" class="control-label">Content:</label>
<div class="form-group row">
<label for="mail_content" class="control-label">Content:</label>
<textarea id="mail_content" name="mail_content" style="width: 100%" class="tinymce">{{ mail_content }}</textarea>
<textarea id="editor" name="mail_content" style="width: 100%" class="tinymce">{{ mail_content }}</textarea>
</div>
</div>
<div class="card-footer">