OSDN Git Service

original file
[nucleus-jp/nucleus-plugins.git] / trunk / NP_TinyMCE2j / tinymce2j / plugins / filemanager / editor_plugin.js
1 /* Import theme specific language pack */
2 tinyMCE.importPluginLanguagePack('filemanager', 'en');
3
4 function TinyMCE_filemanager_getControlHTML(control_name) {
5     switch (control_name) {
6         case "filemanager":
7             return '<img id="{$editor_id}_filemanager" src="{$pluginurl}/images/filemanager.gif" title="{$lang_insert_filemanager}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFilemanager\');" />';
8     }
9     return "";
10 }
11
12 /**
13  * Executes the mceFilemanager command.
14  */
15 function TinyMCE_filemanager_execCommand(editor_id, element, command, user_interface, value) {
16     // Handle commands
17     switch (command) {
18         case "mceFilemanager":
19             var template = new Array();
20             template['file']   = '../../plugins/filemanager/InsertFile/insert_file.php'; // Relative to theme
21             template['width']  = 660;
22             template['height'] = 500;
23
24             tinyMCE.openWindow(template, {editor_id : editor_id});
25        return true;
26    }
27    // Pass to next handler in chain
28    return false;
29 }
30
31