[英]Javascript error when integrating django-tinymce and django-filebrowser
我已经在我的应用程序中设置了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文件即可
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.