Hi,

I'm trying to get TinyMCE working with django-filebrowser.

I started to make Tiny working :

# === settings.py :
INSTALLED_APPS = (
    #...
    'tinymce',
    'filebrowser',
    #...
)
TINYMCE_JS_URL = MEDIA_URL + 'js/tiny_mce/tiny_mce_src.js'
URL_TINYMCE = TINYMCE_JS_URL
TINYMCE_DEFAULT_CONFIG = {
    'plugins': "table,paste,advimage,advlink",
    'extended_valid_elements' : "a[name|href|target|title|onclick|
rel]",
    'theme':'advanced',
    'theme_advanced_toolbar_location' : "top",
    'file_browser_callback' : "CustomFileBrowser",
    'theme_advanced_buttons1' :
"code,separator,forecolor,backcolor,separator,bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,link,unlink,advimage,image,hr",
    'theme_advanced_buttons2' :
"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator",
    'theme_advanced_buttons3' :
"table,row_props,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,row_after,row_before,split_cells,merge_cells",
}
TINYMCE_FILEBROWSER = True


# === forms.py
# -*- coding: utf-8 -*-
from django import forms
from app.models import Article
from tinymce.widgets import TinyMCE

class BaseArticleForm(forms.ModelForm):
    introtext = forms.CharField(widget=TinyMCE(attrs={'cols': 80,
'rows': 20}))
    class Meta:
        model = Article


# === template
{{ form.media }}
<form><table>{{ form.as_table }}</table></form>


# === template for integration (/tinymce/filebrowser.js )
function CustomFileBrowser(field_name, url, type, win) {

    var cmsURL = "/admin/filebrowser/?pop=2";
    cmsURL = cmsURL + "&type=" + type;

    tinyMCE.activeEditor.windowManager.open({
        file: cmsURL,
        width: 820,  // Your dimensions may differ - toy around with
them!
        height: 500,
        resizable: "yes",
        scrollbars: "yes",
        inline: "no",  // This parameter only has an effect if you use
the inlinepopups plugin!
        close_previous: "no",
    }, {
        window: win,
        input: field_name,
        editor_id: tinyMCE.selectedInstance.editorId,
    });
    return false;
}

tinyMCE.init({
        file_browser_callback : "CustomFileBrowser"
});



When I click on the icon which open the filebrowser, I have nothing
except that error :
Erreur : f has no properties
Fichier source : http://127.0.0.1:8000/medias/js/tiny_mce/tiny_mce_src.js
Ligne : 7516

I don't understand, in the doc it seems so easy, I spent my entire
morning on that.
Thanks a lot for helping me
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to