Здраствуйте!
Помогите правильно прикрутить FCKEditor к джанго, к его админке.
Нашел вот виджет для него http://www.djangosnippets.org/snippets/576/
Как его использовать правильно, in django-way?
update для поиска: TinyMCE WYSIWYG редактор JavaScript
Ferromanполучаем дистрибутивы:
Расскажи как :)
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;
}
function myCustomSetupContent(editor_id, body, doc) {
if (body.innerHTML == "") {
body.innerHTML = "<p>xxx</p>";
}
}
tinyMCE.init({
mode : "textareas",
theme : "advanced",
//content_css : "/appmedia/blog/style.css",
file_browser_callback : "CustomFileBrowser",
advimage_update_dimensions_onchange: true,
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "fullscreen,separator,preview,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,separator,image,cleanup,help,separator,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
auto_cleanup_word : true,
plugins : "table,save,advhr,advimage,advlink,emotions,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,fullscreen",
plugin_insertdate_dateFormat : "%m/%d/%Y",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target=_blank|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
fullscreen_settings : {
theme_advanced_path_location : "top",
theme_advanced_buttons1 : "fullscreen,separator,preview,separator,cut,copy,paste,separator,undo,redo,separator,search,replace,separator,code,separator,cleanup,separator,bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,help",
theme_advanced_buttons2 : "removeformat,styleselect,formatselect,fontselect,fontsizeselect,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor",
theme_advanced_buttons3 : "sub,sup,separator,image,insertdate,inserttime,separator,tablecontrols,separator,hr,advhr,visualaid,separator,charmap,emotions,iespell,flash,separator,print"
}
});
# Filebrowser
(r'^admin/filebrowser/', include('filebrowser.urls')),
class Admin:
js = (
'filebrowser/js/AddFileBrowser.js',
'tiny_mce/tiny_mce.js',
'tiny_mce/textareas.js',
)