upgraded to tinymce 2.0.1

This commit is contained in:
JT Smith 2005-12-05 05:28:30 +00:00
parent 586e1a00fa
commit 75acc465b0
891 changed files with 16251 additions and 18835 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'] = 300;
template['height'] = 200;
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;
}

View file

@ -0,0 +1,132 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('template', 'en,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl'); // <- 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.
*
****/
/**
* Information about the plugin.
*/
function TinyMCE_template_getInfo() {
return {
longname : 'Template plugin',
author : 'Your name',
authorurl : 'http://www.yoursite.com',
infourl : 'http://www.yoursite.com/docs/template.html',
version : "1.0"
};
};
/**
* 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":
var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceTemplate\', true);return false;';
return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><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\');" /></a>';
}
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'] = 300;
template['height'] = 200;
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: 87 B

View file

@ -0,0 +1,8 @@
// DK lang variables contributed by Jan Moelgaard
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'Dette er bare en pop-up-skabelon',
template_desc : 'Dette er bare en testknap'
});

View file

@ -0,0 +1,9 @@
// DE lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
/* Sprachparameter müssen als lang_<Eigenes Plugin>_<Eigener Name> definiert werden */
tinyMCE.addToLang('',{
template_title : 'Dies ist nur ein Beispiel-Popup',
template_desc : 'Dies ist nur ein Beispiel-Button'
});

View file

@ -0,0 +1,8 @@
// UK lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'This is just a template popup',
template_desc : 'This is just a template button'
});

View file

@ -0,0 +1,14 @@
/**
* ES lang variables
*
* Authors : Alvaro Velasco,
* Adolfo Sanz De Diego (asanzdiego) <asanzdiego@yahoo.es>,
* Carlos C Soto (eclipxe) <csoto@sia-solutions.com>
* Last Updated : October 17, 2005
* TinyMCE Version : 2.0RC3
*/
tinyMCE.addToLang('',{
template_title : 'Esto es solo la plantilla de un popup',
template_desc : 'Esto es solo la plantilla de un botón'
});

View file

@ -0,0 +1,9 @@
// Canadian French lang variables by Virtuelcom last modification: 2005-06-15
// Modifié par Normand Lamoureux le 2005-11-12
/* N'oubliez pas d'identifer les paramètres de langue ainsi: <votre plugin>_<un nom> */
tinyMCE.addToLang('',{
template_title : 'Texte qui apparaîtra sous forme de titre dans la fenêtre pop-up de votre plugin',
template_desc : 'Texte qui apparaîtra sous forme d\'info-bulle au survol du bouton de votre plugin'
});

View file

@ -0,0 +1,8 @@
// Canadian French lang variables by Virtuelcom last modification: 2005-06-15
/* Remember to namespace the language parameters <your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'Ceci est un exmple pour le gabarit de popup',
template_desc : 'Ceci est un exmple pour le gabarit d\'un bouton'
});

View file

@ -0,0 +1,8 @@
// HE lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'æä ñúí çìåï ÷åôõ ùì äúáðéú',
template_desc : 'æä ñúí ëôúåø ùì äúáðéú'
});

View file

@ -0,0 +1,8 @@
// HU lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'Ez csak egy példa popup',
template_desc : 'Ez csak egy példa gomb'
});

View file

@ -0,0 +1,8 @@
// Iceland lang variables by Johannes Birgir Jensson
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : '&THORN;etta er sni&eth;m&aacute;tsgluggi',
template_desc : '&THORN;etta er sni&eth;m&aacute;tstakki'
});

View file

@ -0,0 +1,8 @@
// nb = Norwegian (bokm&aring;l) lang variables by Knut B. Jacobsen
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'Dette er bare en template popup',
template_desc : 'Dette er bare en template knapp'
});

View file

@ -0,0 +1,8 @@
// NL lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'Dit is slechts een voorbeeldpopup',
template_desc : 'Dit is slechts een voorbeeldknop'
});

View file

@ -0,0 +1,8 @@
// nn = Norwegian (nynorsk) lang variables by Knut B. Jacobsen
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'Dette er berre ein template popup',
template_desc : 'Dette er berre ein template knapp'
});

View file

@ -0,0 +1,8 @@
// PL lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'To jest szablon okna popup',
template_desc : 'To jest szablon przycisku'
});

View file

@ -0,0 +1,13 @@
/**
* pt_br lang variables
* Brazilian Portuguese
*
* Authors :
* Marcio Barbosa (mpg) <mpg@mpg.com.br>
* Last Updated : November 26, 2005
* TinyMCE Version : 2.0RC4
*/
tinyMCE.addToLang('',{
template_title : 'Este é só um modêlo de popup',
template_desc : 'Este é só um modêlo de botão'
});

View file

@ -0,0 +1,8 @@
// RU cp1251 lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'Ýòî øàáëîí äëÿ popup',
template_desc : 'Ýòî øàáëîí äëÿ êíîïêè'
});

View file

@ -0,0 +1,8 @@
// RU KOI8-R lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'üÔÏ ÛÁÂÌÏÎ ÄÌÑ popup',
template_desc : 'üÔÏ ÛÁÂÌÏÎ ÄÌÑ ËÎÏÐËÉ'
});

View file

@ -0,0 +1,8 @@
// RU UTF-8 lang variables
/* Remember to namespace the language parameters lang_<your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : 'Это шаблон для popup',
template_desc : 'Это шаблон для кнопки'
});

View file

@ -0,0 +1,8 @@
// Simplified Chinese lang variables contributed by tom_cat (thomaswangyang@gmail.com)
/* Remember to namespace the language parameters <your plugin>_<some name> */
tinyMCE.addToLang('',{
template_title : '这是一个模板弹出窗口',
template_desc : '这是一个模板按钮'
});

View file

@ -0,0 +1,7 @@
// Traditional Chinese BIG-5; Twapweb Site translated; twapweb_AT_gmail_DOT_com
// 繁體中文 BIG-5 ;數位應用坊製作; twapweb_AT_gmail_DOT_com
tinyMCE.addToLang('',{
template_title : '樣式跳現視窗',
template_desc : '樣式按鈕'
});

View file

@ -0,0 +1,7 @@
// Traditional Chinese UTF-8; Twapweb Site translated; twapweb_AT_gmail_DOT_com
// 繁體中文 UTF-8 ;數位應用坊製作; twapweb_AT_gmail_DOT_com
tinyMCE.addToLang('',{
template_title : '樣式跳現視窗',
template_desc : '樣式按鈕'
});

View file

@ -0,0 +1,48 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<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() {
var inst = tinyMCE.selectedInstance;
var elm = inst.getFocusElement();
alert("Got a window argument from plugin: " + tinyMCE.getWindowArg('some_custom_arg'));
// Set the form item value to the selected node element name
document.forms[0].nodename.value = elm.nodeName;
}
function insertSomething() {
// Execute the mceTemplate command without UI this time
tinyMCEPopup.execCommand('mceTemplate');
// Close the dialog
tinyMCEPopup.close();
}
//-->
</script>
<base target="_self" />
</head>
<body onload="tinyMCEPopup.executeOnLoad('init();');">
<form onsubmit="insert();return false;">
<h3>{$lang_template_title}</h3>
<!-- Gets filled with the selected elements name -->
<div style="margin-top: 10px; margin-bottom: 10px">
The selected element name: <input type="text" name="nodename" />
</div>
<div class="mceActionPanel">
<div style="float: left">
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertSomething();" />
</div>
<div style="float: right">
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</form>
</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.