images in ckeditor
This commit is contained in:
SDE
2023-09-22 14:58:06 +03:00
parent 4888fc7211
commit 4ec85b85cb
6 changed files with 304 additions and 79 deletions

View File

@@ -226,6 +226,15 @@ CKEDITOR_CONFIGS = {
# 'filebrowserWindowWidth': "100%",
'toolbar': 'Custom',
'forcePasteAsPlainText': True,
# 'allowedContent': True,
'disallowedContent': 'img{width,height};img[width,height]',
# 'extraPlugins': 'image2',
'enterMode': 2,
'basicEntities' : False,
'entities_additional': '',
'entities' : False,
'htmlEncodeOutput' : False,
# 'toolbar_Custom': [
# ['Bold', 'Italic', 'Underline'],
# ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
@@ -254,74 +263,74 @@ CKEDITOR_CONFIGS = {
}
CKEDITOR_OPTIONS = {
'height': 291,
'width': '95%',
'filebrowserWindowHeight': 600,
'filebrowserWindowWidth': "100%",
'toolbar': 'YourCustomToolbarConfig',
'allowedContent': True,
'enterMode': 2,
'basicEntities' : False,
'entities_additional': '',
'entities' : False,
'htmlEncodeOutput' : False,
'toolbar_Basic': [
['Source', '-', 'Bold', 'Italic']
],
'toolbar_YourCustomToolbarConfig': [
{'name': 'document', 'items': ['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates']},
{'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
{'name': 'editing', 'items': ['Find', 'Replace', '-', 'SelectAll']},
{'name': 'forms',
'items': ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
'HiddenField']},
'/',
{'name': 'basicstyles',
'items': ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
{'name': 'paragraph',
'items': ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-',
'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl',
'Language']},
{'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']},
{'name': 'insert',
'items': ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']},
'/',
{'name': 'styles', 'items': ['FontSize']},
{'name': 'colors', 'items': ['TextColor', 'BGColor']},
{'name': 'tools', 'items': ['Maximize', 'ShowBlocks']},
# {'name': 'about', 'items': ['About']},
'/', # put this to force next toolbar on new line
# {'name': 'yourcustomtools', 'items': [
# # put the name of your editor.ui.addButton here
# 'Preview',
# 'Maximize',
#
# ]},
],
'tabSpaces': 4,
'removePlugins': 'stylesheetparser',
# 'extraPlugins': ','.join([
# 'uploadimage', # the upload image feature
# # your extra plugins here
# 'div',
# 'autolink',
# 'autoembed',
# 'embedsemantic',
# 'autogrow',
# # 'devtools',
# 'widget',
# 'lineutils',
# 'clipboard',
# 'dialog',
# 'dialogui',
# 'elementspath'
# ]),
}
# CKEDITOR_OPTIONS = {
# 'height': 291,
# 'width': '95%',
# 'filebrowserWindowHeight': 600,
# 'filebrowserWindowWidth': "100%",
# 'toolbar': 'YourCustomToolbarConfig',
#
# 'allowedContent': True,
#
# 'enterMode': 2,
# 'basicEntities' : False,
# 'entities_additional': '',
# 'entities' : False,
# 'htmlEncodeOutput' : False,
# 'toolbar_Basic': [
# ['Source', '-', 'Bold', 'Italic']
# ],
# 'toolbar_YourCustomToolbarConfig': [
# {'name': 'document', 'items': ['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates']},
# {'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
# {'name': 'editing', 'items': ['Find', 'Replace', '-', 'SelectAll']},
# {'name': 'forms',
# 'items': ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
# 'HiddenField']},
# '/',
# {'name': 'basicstyles',
# 'items': ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
# {'name': 'paragraph',
# 'items': ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-',
# 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl',
# 'Language']},
# {'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']},
# {'name': 'insert',
# 'items': ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']},
# '/',
# {'name': 'styles', 'items': ['FontSize']},
# {'name': 'colors', 'items': ['TextColor', 'BGColor']},
# {'name': 'tools', 'items': ['Maximize', 'ShowBlocks']},
# # {'name': 'about', 'items': ['About']},
# '/', # put this to force next toolbar on new line
# # {'name': 'yourcustomtools', 'items': [
# # # put the name of your editor.ui.addButton here
# # 'Preview',
# # 'Maximize',
# #
# # ]},
# ],
#
# 'tabSpaces': 4,
# 'removePlugins': 'stylesheetparser',
# # 'extraPlugins': ','.join([
# # 'uploadimage', # the upload image feature
# # # your extra plugins here
# # 'div',
# # 'autolink',
# # 'autoembed',
# # 'embedsemantic',
# # 'autogrow',
# # # 'devtools',
# # 'widget',
# # 'lineutils',
# # 'clipboard',
# # 'dialog',
# # 'dialogui',
# # 'elementspath'
# # ]),
#
# }
try: