Allow configuring TinyMCE license key

This commit is contained in:
Cédric Krier
2024-06-25 09:37:31 +02:00
parent 23d3ce2edf
commit a080a11b3e
3 changed files with 13 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Allow configuring TinyMCE license key
* Add tools to apply types to SQLite select queries
* Compress RPC responses
* Change _changed_values and _save_values properties to method
+9
View File
@@ -828,6 +828,15 @@ The URL pointing to `TinyMCE <https://www.tiny.cloud/>`_ editor.
Default: ``https://cloud.tinymce.com/stable/tinymce.min.js``
.. _config-html.license_key:
license_key
~~~~~~~~~~~
The license key for TinyMCE.
Default: ``gpl``
.. _config-html.plugins:
plugins
+3
View File
@@ -18,6 +18,7 @@ from trytond.wsgi import app
SOURCE = config.get(
'html', 'src',
default='https://cdn.tiny.cloud/1/no-api-key/tinymce/7/tinymce.min.js')
LICENSE_KEY = config.get('html', 'license_key', default='gpl')
AVATAR_TIMEOUT = config.getint(
'web', 'avatar_timeout', default=7 * 24 * 60 * 60)
_request_timeout = config.getint('request', 'timeout', default=0)
@@ -86,6 +87,7 @@ def html_editor(request, pool, model, record, field):
return Response(TEMPLATE % {
'source': SOURCE,
'license_key': LICENSE_KEY,
'plugins': get_config(
['plugins', model, field.name], default=''),
'css': get_config(
@@ -108,6 +110,7 @@ TEMPLATE = '''<!DOCTYPE html>
<script>
tinymce.init({
selector: '#text',
license_key: '%(license_key)s',
language: '%(language)s',
plugins: 'autosave code %(plugins)s',
removed_menuitems: 'newdocument',