开发者

Javascript error when integrating django-tinymce and django-filebrowser

I've set up django-filebrowser in my app without any bugs, I already had django-tinymce set up and it loads the editor in the admin forms. I now want to use django-filebrowser with django-tinymce, but I keep getting a weird javascript error when I click on "Image URL" in the Image popup:

r is undefined

the error is js/tiny_mce/tiny_mce.js

My settings.py file has the following configuration:

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=|widt开发者_StackOverflowh|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

i've tried switching back to older versions of tinyMCE Javascript but nothing seems to work. Would appreciate some help


Figured this out, I just had to place the javascript code for the Custom File Browser in the right place and tweak the views.py file for django-tinymce

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜