ChenHaibin Posted May 12, 2013 Posted May 12, 2013 How to use more advanced htmlEditor, such as http://extjs.org.cn/extjs/plugins/HTMLEditor/image/index.html Thank you! Quote
gerhard.kimmeringer Posted May 13, 2013 Posted May 13, 2013 Look here http://forums.unigui.com/index.php?/topic/1851-tinymce-in-unigui-applications/ Hope it help you. Quote
ChenHaibin Posted May 14, 2013 Author Posted May 14, 2013 Look here http://forums.unigui.com/index.php?/topic/1851-tinymce-in-unigui-applications/ Hope it help you. However, this control can not upload pictures. Quote
ChenHaibin Posted May 16, 2013 Author Posted May 16, 2013 How to add a picture upload function? Quote
Oliver Morsch Posted May 16, 2013 Posted May 16, 2013 How to add a picture upload function? You can buy a file manager (file browser and uploader) on http://www.tinymce.com/index.php (but i think it needs PHP on server) or you can make your custom file browser (with UniGui): http://www.tinymce.com/wiki.php/Configuration3x:file_browser_callback http://www.tinymce.com/wiki.php/TinyMCE3x:How-to_implement_a_custom_file_browser There you can upload (TUniFileUpload) and/or browse your files to/on the server. I have added this to my script/init for including TinyMCE (adds a button to file/image dialog for calling my file browser): <script type="text/javascript"> function myCustomFileBrowser(field_name, url, type, win) { //z-Order of tinyMCE popup dialog must be less than uniGui modal dialog: document.getElementById('mceModalBlocker').style.zIndex = 7001; document.getElementById('mceModalBlocker').previousSibling.style.zIndex = 7002; //"save" fieldname for later update: TinyMceFileSrcFld = win.document.forms[0].elements[field_name]; //Start my UniGui FileBrowser: ajaxRequest(MainForm.form, 'FileBrowser', [ 'URL=' + url, 'Typ=' + type ]); } ... tinyMCE.init({ ... file_browser_callback : "myCustomFileBrowser", ... }); </script> on MainForm i have this (on AjaxRequest start file browser form): procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if EventName = 'FileBrowser' then begin frmFileBrowser.URL := Params.Values['URL']; frmFileBrowser.Typ := Params.Values['Typ']; frmFileBrowser.ShowModal; end; end; on closing the file browser form i do this: procedure TfrmFileBrowser.UniFormClose(Sender: TObject; var Action: TCloseAction); begin if ModalResult = mrOK then begin UniSession.AddJS('TinyMceFileSrcFld.value = ' + QuotedStr(FileURL) + ';'); end; end; In the future i plan to use Data URI scheme to include the image in the HTML itself. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.