Link to home
Create AccountLog in
Avatar of benchpresser
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/javafx/2/swing/SimpleSwingBrowser.java.htm

but i need to add tinymce as editor. and it has problems in loading resources as stated in:

http://stackoverflow.com/questions/9607023/how-to-load-tinymce-editor-through-webview-within-jar

and

https://forums.oracle.com/forums/thread.jspa?threadID=2330194

so in my example, i load with
URL url = getClass().getResource("/tinymce.html");
iWebEngine.load(url.toString());

Open in new window


and my tinymce.html contains:
<script type="text/javascript" src="tinymce/tiny_mce.js">

Open in new window


it loads the tinymce.js becasue the variable tinyMCE is defined, i check by

if (typeof tinyMCE === 'undefined') {
alert("tinymce.js is missing");
}

Open in new window


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.sourceforge.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
iWebEngine.load("file://c://test//TinyMCE_3.4.3._2//tinymce.html");

Open in new window


of couse i can not deploy that.
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer