Opensource Rich Text Editor Widget for Web application

That’s my point. Don’t steal the namespace from another control if you’re going to distribute as your own. Register a namespace and use that.

As far as the Shown event goes, the documentation is correct up to the point of “everything from our framework has been pushed to the browser.” The problem with a control like this is that there are libraries from other sources and there is no way to know when they are going to complete. If you use the LoadLibraries command, you can set a callback there that will tell you when everything has been loaded.

Antonis, you can email webnamespace@xojo.com with a namespace that you would like to register.

Regarding that… please read the WebSDK docs, specifically the Namespace section first. There are some rules about what you may and may not register and it may save you some time.

Greg, where is more safe to execute the LoadLibraries command , on Open or Shown Event ?
BR/Antonis

Use SetupJavascriptFramework.

Hi,

I want to integrate this Editor into my Project.

If I run the example-Project, the control works fine.

If I drag the control, or the mainpage into my project, it is broken:
https://dl.dropboxusercontent.com/u/92235674/EditorIssue.png

it seems that the style-informations of the toolbar are lost…

[quote=68973:@Lars Lehmann]Hi,

I want to integrate this Editor into my Project.

If I run the example-Project, the control works fine.

If I drag the control, or the mainpage into my project, it is broken:
https://dl.dropboxusercontent.com/u/92235674/EditorIssue.png

it seems that the style-informations of the toolbar are lost…[/quote]
App HTMLHeader:

<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/assets/skins/sam/skin.css">

@Antonis Vakondios Very nicely done.

Hi Antonis,
there is a way to store css file on a constant and load it too ?

Yes, you can do it as following :

  mWfJS = new WebFile
  mWfJS.MIMEType = "text/css"
  mWfJS.Filename = "xxxxx.css"
  mWfJS.Data = CssData // Constant of css data
  mWfJS.Session = Nil

and then :

control.ExecuteJavaScript( "XojoCustom.telesoft.tsLoadJsCssFile(window.location.href + """ + mWfJS.URL + """, ""css"");"  )

The XojoCustom.telesoft.tsLoadJsCssFile Javascript function is the following :

XojoCustom.telesoft.Forms.tsLoadJsCssFile = function(filename, filetype){

	var req = new XMLHttpRequest();
	req.open("GET", filename, false);
	req.send(null);
			
	var headElement = document.getElementsByTagName("head")[0];
	var newScriptElement;
			
	if (filetype=="js"){ 
		newScriptElement = document.createElement("script");
		newScriptElement.type = "text/javascript";
		newScriptElement.text = req.responseText;						
	}
	else if (filetype=="css"){
		newScriptElement = document.createElement("link");
		newScriptElement.rel  = 'stylesheet';
		newScriptElement.type = "text/css";
		newScriptElement.text = req.responseText;
		newScriptElement.href = filename;
		newScriptElement.media = 'all';					
	}			
	headElement.appendChild(newScriptElement);								
};

which it is needed to load on control before to execute it.

When I have some time, I will update this control. Give me a week

Great !!! Thanks a lot, I’ll waiting …

Luciano

Then we can encapsulate all css and js of own controls and just keep a unique jquery library references in app.HTMLHeader property.