Allow configuring TinyMCE license key
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user