benchpresser
asked on
embedding tinymce into javafx and webengine, webview
hi
i need to embed tinymce into the browser component of javafx (webview, webenbgine)
i use example in
http://docs.oracle.com/jav afx/2/swin g/SimpleSw ingBrowser .java.htm
but i need to add tinymce as editor. and it has problems in loading resources as stated in:
http://stackoverflow.com/q uestions/9 607023/how -to-load-t inymce-edi tor-throug h-webview- within-jar
and
https://forums.oracle.com/ forums/thr ead.jspa?t hreadID=23 30194
so in my example, i load with
and my tinymce.html contains:
it loads the tinymce.js becasue the variable tinyMCE is defined, i check by
so i do not get the message because the tinymce.js has been loaded, BUT resources called by tinymce.js are not loaded. (they are many js and css files called by tinymce.js)
becasue inline resources are not loaded, the tinymce is not working.
another browser example dj browser has done that using http requests, where resources are requested from a local webserver 127.0.0.1
http://djproject.sourcefor ge.net/ns/ index.html
any solutions? how can i call all resources needed by tinymce into the javafx webview?
do i need to write custom protocol handler? using file protocol will not be useful because of deployment issues. jar protocols fail when loading all of the resources.
i think i have to use http protocols as in djbrowser when requesting resources.
Note:
the editor works ok when i load it by
of couse i can not deploy that.
i need to embed tinymce into the browser component of javafx (webview, webenbgine)
i use example in
http://docs.oracle.com/jav
but i need to add tinymce as editor. and it has problems in loading resources as stated in:
http://stackoverflow.com/q
and
https://forums.oracle.com/
so in my example, i load with
URL url = getClass().getResource("/tinymce.html");
iWebEngine.load(url.toString());
and my tinymce.html contains:
<script type="text/javascript" src="tinymce/tiny_mce.js">
it loads the tinymce.js becasue the variable tinyMCE is defined, i check by
if (typeof tinyMCE === 'undefined') {
alert("tinymce.js is missing");
}
so i do not get the message because the tinymce.js has been loaded, BUT resources called by tinymce.js are not loaded. (they are many js and css files called by tinymce.js)
becasue inline resources are not loaded, the tinymce is not working.
another browser example dj browser has done that using http requests, where resources are requested from a local webserver 127.0.0.1
http://djproject.sourcefor
any solutions? how can i call all resources needed by tinymce into the javafx webview?
do i need to write custom protocol handler? using file protocol will not be useful because of deployment issues. jar protocols fail when loading all of the resources.
i think i have to use http protocols as in djbrowser when requesting resources.
Note:
the editor works ok when i load it by
iWebEngine.load("file://c://test//TinyMCE_3.4.3._2//tinymce.html");
of couse i can not deploy that.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.