gpt4 book ai didi

集成 django-tinymce 和 django-filebrowser 时出现 Javascript 错误

转载 作者:行者123 更新时间:2023-11-28 10:32:10 24 4
gpt4 key购买 nike

我已经在我的应用程序中设置了 django-filebrowser,没有任何错误,我已经设置了 django-tinymce 并且它在管理表单中加载编辑器。我现在想将 django-filebrowser 与 django-tinymce 一起使用,但是当我单击图像弹出窗口中的“图像 URL”时,我不断收到奇怪的 javascript 错误:

r is undefined

错误是js/tiny_mce/tiny_mce.js

我的settings.py 文件具有以下配置:

TINYMCE_JS_URL=MEDIA_URL + 'js/tiny_mce/tiny_mce.js'
TINYMCE_DEFAULT_CONFIG = {
'mode': "textareas",
'theme': "advanced",
'language': "en",
'skin': "o2k7",
'dialog_type': "modal",
'object_resizing': True,
'cleanup_on_startup': True,
'forced_root_block': "p",
'remove_trailing_nbsp': True,
'theme_advanced_toolbar_location': "top",
'theme_advanced_toolbar_align': "left",
'theme_advanced_statusbar_location': "none",
'theme_advanced_buttons1':
"formatselect,styleselect,bold,italic,underline,bullist,numlist,undo,redo,link,unlink,image,code,template,visualchars,fullscreen,pasteword,media,search,replace,charmap",
'theme_advanced_buttons2': "",
'theme_advanced_buttons3': "",
'theme_advanced_path': False,
'theme_advanced_blockformats': "p,h2,h3,h4,div,code,pre",
'width': '700',
'height': '300',
'plugins':
"advimage,advlink,fullscreen,visualchars,paste,media,template,searchreplace",
'advimage_update_dimensions_onchange': True,
'file_browser_callback': "CustomFileBrowser",
'relative_urls': False,
'valid_elements' : "" +
"-p," +
"a[href|target=_blank|class]," +
"-strong/-b," +
"-em/-i," +
"-u," +
"-ol," +
"-ul," +
"-li," +
"br," +
"img[class|src|alt=|width|height]," +
"-h2,-h3,-h4," +
"-pre," +
"-code," +
"-div",
'extended_valid_elements': "" +
"a[name|class|href|target|title|onclick]," +
"img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],"
+
"br[clearfix]," +
"-p[class<clearfix?summary?code]," +
"h2[class<clearfix],h3[class<clearfix],h4[class<clearfix]," +
"ul[class<clearfix],ol[class<clearfix]," +
"div[class],"
}

TINYMCE_FILEBROWSER = False
TINYMCE_COMPRESSOR = False

我尝试切换回旧版本的tinyMCE Javascript,但似乎没有任何效果。希望得到一些帮助

最佳答案

弄清楚了这一点,我只需将自定义文件浏览器的 javascript 代码放在正确的位置,并调整 django-tinymce 的views.py 文件

关于集成 django-tinymce 和 django-filebrowser 时出现 Javascript 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2739331/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com