TinyMCE in Ruby Application File Manager needed -
i have ruby on rails application integrated tinymce (js not gem used)
now want integrate filemanager, 1 can use this? upload not required, want browse trough picture galary.
written own file manager.
to access filemanager tinymce need set button correctly
in tinymce options have add this:
file_browser_callback: function (field_name, url, type, win) { tinymce.activeeditor.windowmanager.open({ title: "my file browser", url: "/uploads/filechooser/", width: 850, height: 600 }, { oninsert: function (url) { win.document.getelementbyid(field_name).value = url; } }); }
in url have specify path own filechooser.
and in filechooser need this:
$(".filechooser").click(function () { top.tinymce.activeeditor.windowmanager.getparams().oninsert($(this).parent().prev().val()); top.tinymce.activeeditor.windowmanager.close(); });
to return selected image or file tinymce
Comments
Post a Comment