JavaScript options reference

This document is the index/reference page for all JavaScript initialization options available for the MCFileManager.

JavaScript options

These options are available when the JavaScript for MCFileManager is initialized or with a mcFileManager.open function call. These options are most useful for integration purposes or when using MCFileManager in standalone mode or as a TinyMCE plugin, but remember to add the "filemanager_" prefix infront of each option when it's used as a plugin.


Setting page level options

Setting options for all open calls on a page is done using the init javascript call, much like the init call in TinyMCE. Notice that this call is normally not needed unless you have specific requirements for the integration with TinyMCE or using the application in standalone mode.

Example of init call:

<html>
<head>
<title>Example</title>
<script language="javascript" type="text/javascript" src="jscripts/mcfilemanager.js"></script>
<script language="javascript" type="text/javascript">
mcFileManager.init({
	document_base_url : "/",
	relative_urls : true,
	remove_script_host : true
});
</script>
</head>
<body>

<h3>Simple example:</h3>
<form name="example1">
Some URL field: <input type="text" name="url" value="Select file">
<a href="javascript:mcFileManager.open('example1','url','','',{document_base_url : "/somedir/somedoc.html"});">[Browse]</a>
</form>

<h3>Iframe example:</h3>
<form name="example2">
<div><iframe id="myiframe" src="about:blank" style="width: 600px; height: 450px"></iframe></div>
Some URL field: <input type="text" name="url" value="Select file">
<a href="javascript:mcFileManager.openInIframe('myiframe','example2','url');">[Browse]</a>
</form>

</body>
</html>

Remember to remove the last "," in the config list.

MCFileManager as TinyMCE plugin

The MCFileManager can be loaded as a TinyMCE plugin, this is a easy and flexible way of using it together with TinyMCE. Simply place the filemanager directory within the plugins directory of TinyMCE and add it to the plugins option. The above options should simply be prefixed with the "filemanager" prefix.

Example of init call for two separate TinyMCE instances with diffrent MCFileManager config settings:

tinyMCE.init({
	mode : "exact",
	elements : "elm1",
	theme : "advanced",
	plugins : "advimage,advlink,filemanager",
	filemanager_path : "testcases/multiple_rootpath_files/root1/somedir"
});

tinyMCE.init({
	mode : "exact",
	elements : "elm2",
	theme : "advanced",
	plugins : "advimage,advlink,filemanager",
	filemanager_path : "testcases/multiple_rootpath_files/root2/somedir2",
	filemanager_rootpath : "testcases/multiple_rootpath_files/root2"
});