init import from old mailr project (http://svn.littlegreen.org/mailr/trunk)

This commit is contained in:
Eugene Korbut 2009-01-08 05:27:12 +10:00
commit 51b79e7298
640 changed files with 34651 additions and 0 deletions

View file

@ -0,0 +1,118 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('template', 'en'); // <- Add a comma separated list of all supported languages
/****
* Steps for creating a plugin from this template:
*
* 1. Change all "template" to the name of your plugin.
* 2. Remove all the callbacks in this file that you don't need.
* 3. Remove the popup.htm file if you don't need any popups.
* 4. Add your custom logic to the callbacks you needed.
* 5. Write documentation in a readme.txt file on how to use the plugin.
* 6. Upload it under the "Plugins" section at sourceforge.
*
****/
/**
* Gets executed when a editor instance is initialized
*/
function TinyMCE_template_initInstance(inst) {
// You can take out plugin specific parameters
alert("Initialization parameter:" + tinyMCE.getParam("template_someparam", false));
}
/**
* Gets executed when a editor needs to generate a button.
*/
function TinyMCE_template_getControlHTML(control_name) {
switch (control_name) {
case "template":
return '<img id="{$editor_id}_template" src="{$pluginurl}/images/template.gif" title="{$lang_template_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceTemplate\', true);" />';
}
return "";
}
/**
* Gets executed when a command is called.
*/
function TinyMCE_template_execCommand(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
// Remember to have the "mce" prefix for commands so they don't intersect with built in ones in the browser.
case "mceTemplate":
// Show UI/Popup
if (user_interface) {
// Open a popup window and send in some custom data in a window argument
var template = new Array();
template['file'] = '../../plugins/template/popup.htm'; // Relative to theme
template['width'] = 150;
template['height'] = 180;
tinyMCE.openWindow(template, {editor_id : editor_id, some_custom_arg : "somecustomdata"});
// Let TinyMCE know that something was modified
tinyMCE.triggerNodeChange(false);
} else {
// Do a command this gets called from the template popup
alert("execCommand: mceTemplate gets called from popup.");
}
return true;
}
// Pass to next handler in chain
return false;
}
/**
* Gets executed when the selection/cursor position was changed.
*/
function TinyMCE_template_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
// Deselect template button
tinyMCE.switchClassSticky(editor_id + '_template', 'mceButtonNormal');
// Select template button if parent node is a strong or b
if (node.parentNode.nodeName == "STRONG" || node.parentNode.nodeName == "B")
tinyMCE.switchClassSticky(editor_id + '_template', 'mceButtonSelected');
return true;
}
/**
* Gets executed when contents is inserted / retrived.
*/
function TinyMCE_template_cleanup(type, content) {
switch (type) {
case "get_from_editor":
alert("[FROM] Value HTML string: " + content);
// Do custom cleanup code here
break;
case "insert_to_editor":
alert("[TO] Value HTML string: " + content);
// Do custom cleanup code here
break;
case "get_from_editor_dom":
alert("[FROM] Value DOM Element " + content.innerHTML);
// Do custom cleanup code here
break;
case "insert_to_editor_dom":
alert("[TO] Value DOM Element: " + content.innerHTML);
// Do custom cleanup code here
break;
}
return content;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

View file

@ -0,0 +1,6 @@
// UK lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCELang['lang_template_title'] = 'This is just a template popup';
tinyMCELang['lang_template_desc'] = 'This is just a template button';

View file

@ -0,0 +1,7 @@
// Simplified Chinese lang variables contributed by cube316 (cube316@gmail.com)
//请访问 http://www.cube316.net/ 以获取TinyMCE的中文支持
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCELang['lang_template_title'] = '这仅是模板的弹出窗口';
tinyMCELang['lang_template_desc'] = '这仅是模板的按钮';

View file

@ -0,0 +1,31 @@
<html>
<head>
<title>{$lang_template_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript">
<!--
function init() {
alert("Got a window argument from plugin: " + tinyMCE.getWindowArg('some_custom_arg'));
}
function insertSomething() {
// Execute the mceTemplate command without UI this time
tinyMCE.execInstanceCommand(tinyMCE.getWindowArg('editor_id'), 'mceTemplate');
// Close the dialog
tinyMCE.closeDialog();
}
//-->
</script>
</head>
<body onload="init();">
<h3>{$lang_template_title}</h3>
<form onsubmit="insert();return false;">
<!-- Just a simple insert button -->
<input type="button" name="insert" value="{$lang_insert}" onclick="insertSomething();" id="insert" />
</form>
<br />
</body>
</html>

View file

@ -0,0 +1 @@
This is a template/tutorial plugin that where created to help you in the development of own plugins for TinyMCE.