Skip to content
Snippets Groups Projects
option_insertimage_callback.html 2.34 KiB
Newer Older
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Option: insertimage_callback</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="header">
	<h1><span class="marked">(deprecated)</span> Option: insertimage_callback</h1>
</div>

<div class="content">
	<p>
		This callback was removed in 2.0.3, use <a href="option_execcommand_callback.html">execcommand_callback</a> instead this also enables you to override other things than the image and link dialogs.
	</p>
	<p>
		This option enables you to override the built in functionality for inserting images. This option should contain a function name to be executed when a new image is inserted into TinyMCE. The format of this callback function is: insertImage(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action). Where most of these options are self explained the action can be &quot;update&quot; or &quot;insert&quot; depending on what operation type. This function should return an array with the same values as the incomming parameters, the example below describes how this is done. This option is set to a internal TinyMCE function by default.
	</p>

	<div class="separator"></div>

	<h3>Example of usage of the insertimage_callback option:</h3>
	<div class="example">
<pre>
function <strong>myCustomInsertImage</strong>(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action) {
	var result = new Array();

	// Do some custom logic
	result['src'] = "logo.jpg";
	result['alt'] = "test description";
	result['border'] = "2";
	result['hspace'] = "5";
	result['vspace'] = "5";
	result['width'] = width;
	result['height'] = height;
	result['align'] = "right";
	result['title'] = "Some title";
	result['onmouseover'] = "";
	result['onmouseout'] = "";

	return data;
}

tinyMCE.init({
	...
	<strong>insertimage_callback : "myCustomInsertImage"</strong>
});
</pre>
	</div>
</div>

<div class="footer">
	<div class="helpindexlink"><a href="index.html">Index</a></div>
	<div class="copyright">Copyright &copy; 2003-2006 <a href="http://www.moxiecode.com">Moxiecode Systems AB</a></div>
	<br style="clear: both" />
</div>

</body>
</html>