Embedding TinyMCE editor
Posted: Fri Apr 29, 2016 8:52 am
Hello
I try to embed TinyMCE to SB application, but there is something what I missed as I'm not JavaScript specialist.
Here is example code which almost works (opens TinyMCE in the Debug window!).
Could anybody fix and extend this code? I need to open TinyMCE in specific window and load/save HTML content from SB code.
Thank you.
I try to embed TinyMCE to SB application, but there is something what I missed as I'm not JavaScript specialist.
Here is example code which almost works (opens TinyMCE in the Debug window!).
Could anybody fix and extend this code? I need to open TinyMCE in specific window and load/save HTML content from SB code.
Thank you.
Code: Select all
Procedure LoadScriptTinyMCE(Script.s, *OnLoadFunction)
!$.getScript(v_script,p_onloadfunction);
EndProcedure
Procedure ScriptLoaded(script.s, status.s, jqxhr)
If status<>"success" : ProcedureReturn : EndIf
!tinymce.init({selector:'textarea',plugins:["textcolor colorpicker print"],toolbar:'forecolor backcolor print'});
; content.s
; !v_content = tinyMCE.activeEditor.getContent();
;Debug content
;!tinyMCE.activeEditor.setContent('<span>some</span> html');
EndProcedure
;!$('textarea').appendTo('body');
win = OpenWindow(0, 100, 100, 320, 200, "test", #PB_Window_SizeGadget)
!$('textarea').appendTo('spiderbody');
LoadScriptTinyMCE("https://cdn.tinymce.com/4/tinymce.min.js",@ScriptLoaded())