Updated TinyMCE to 3.2.1.1

This commit is contained in:
abacab
2009-01-01 11:44:00 -05:00
parent a7a76e9aee
commit 5c0ed5db40
1344 changed files with 74627 additions and 12975 deletions

View File

@@ -1,2 +1 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('insertdatetime','cs,el,en,fr_ca,it,ko,sv,zh_cn,fa,fr,de');function TinyMCE_insertdatetime_getControlHTML(control_name){switch(control_name){case "insertdate":return '<img id="{$editor_id}_insertdate" src="{$pluginurl}/images/insertdate.gif" title="{$lang_insertdate_desc}" 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}\',\'mceInsertDate\');">';case "inserttime":return '<img id="{$editor_id}_inserttime" src="{$pluginurl}/images/inserttime.gif" title="{$lang_inserttime_desc}" 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}\',\'mceInsertTime\');">';}return "";}function TinyMCE_insertdatetime_execCommand(editor_id,element,command,user_interface,value){function addZeros(value,len){value=""+value;if(value.length<len){for(var i=0;i<(len-value.length);i++)value="0"+value;}return value;}function getDateTime(date,format){format=tinyMCE.regexpReplace(format,"%D","%m/%d/%y");format=tinyMCE.regexpReplace(format,"%r","%I:%M:%S %p");format=tinyMCE.regexpReplace(format,"%Y",""+date.getFullYear());format=tinyMCE.regexpReplace(format,"%y",""+date.getYear());format=tinyMCE.regexpReplace(format,"%m",addZeros(date.getMonth()+1,2));format=tinyMCE.regexpReplace(format,"%d",addZeros(date.getDate(),2));format=tinyMCE.regexpReplace(format,"%H",""+addZeros(date.getHours(),2));format=tinyMCE.regexpReplace(format,"%M",""+addZeros(date.getMinutes(),2));format=tinyMCE.regexpReplace(format,"%S",""+addZeros(date.getSeconds(),2));format=tinyMCE.regexpReplace(format,"%I",""+(date.getHours()<12?(date.getHours()+1):24-date.getHours()));format=tinyMCE.regexpReplace(format,"%p",""+(date.getHours()<12?"AM":"PM"));format=tinyMCE.regexpReplace(format,"%%","%");return format;}switch(command){case "mceInsertDate":tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,getDateTime(new Date(),tinyMCE.getParam("plugin_insertdate_dateFormat","%Y-%m-%d")));return true;case "mceInsertTime":tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,getDateTime(new Date(),tinyMCE.getParam("plugin_insertdate_timeFormat","%H:%M:%S")));return true;}return false;}
(function(){tinymce.create('tinymce.plugins.InsertDateTime',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertDate',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_dateFormat",ed.getLang('insertdatetime.date_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addCommand('mceInsertTime',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_timeFormat",ed.getLang('insertdatetime.time_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addButton('insertdate',{title:'insertdatetime.insertdate_desc',cmd:'mceInsertDate'});ed.addButton('inserttime',{title:'insertdatetime.inserttime_desc',cmd:'mceInsertTime'});},getInfo:function(){return{longname:'Insert date/time',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getDateTime:function(d,fmt){var ed=this.editor;function addZeros(value,len){value=""+value;if(value.length<len){for(var i=0;i<(len-value.length);i++)value="0"+value;}return value;};fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);fmt=fmt.replace("%b",""+ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);fmt=fmt.replace("%A",""+ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);fmt=fmt.replace("%a",""+ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);fmt=fmt.replace("%%","%");return fmt;}});tinymce.PluginManager.add('insertdatetime',tinymce.plugins.InsertDateTime);})();

View File

@@ -1,66 +1,80 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('insertdatetime', 'cs,el,en,fr_ca,it,ko,sv,zh_cn,fa,fr,de');
/**
* Returns the HTML contents of the insertdate, inserttime controls.
*/
function TinyMCE_insertdatetime_getControlHTML(control_name) {
switch (control_name) {
case "insertdate":
return '<img id="{$editor_id}_insertdate" src="{$pluginurl}/images/insertdate.gif" title="{$lang_insertdate_desc}" 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}\',\'mceInsertDate\');">';
case "inserttime":
return '<img id="{$editor_id}_inserttime" src="{$pluginurl}/images/inserttime.gif" title="{$lang_inserttime_desc}" 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}\',\'mceInsertTime\');">';
}
return "";
}
/**
* Executes the mceInsertDate command.
*/
function TinyMCE_insertdatetime_execCommand(editor_id, element, command, user_interface, value) {
/* Adds zeros infront of value */
function addZeros(value, len) {
value = "" + value;
if (value.length < len) {
for (var i=0; i<(len-value.length); i++)
value = "0" + value;
}
return value;
}
/* Returns the date object in the specified format */
function getDateTime(date, format) {
format = tinyMCE.regexpReplace(format, "%D", "%m/%d/%y");
format = tinyMCE.regexpReplace(format, "%r", "%I:%M:%S %p");
format = tinyMCE.regexpReplace(format, "%Y", "" + date.getFullYear());
format = tinyMCE.regexpReplace(format, "%y", "" + date.getYear());
format = tinyMCE.regexpReplace(format, "%m", addZeros(date.getMonth()+1, 2));
format = tinyMCE.regexpReplace(format, "%d", addZeros(date.getDate(), 2));
format = tinyMCE.regexpReplace(format, "%H", "" + addZeros(date.getHours(), 2));
format = tinyMCE.regexpReplace(format, "%M", "" + addZeros(date.getMinutes(), 2));
format = tinyMCE.regexpReplace(format, "%S", "" + addZeros(date.getSeconds(), 2));
format = tinyMCE.regexpReplace(format, "%I", "" + (date.getHours() < 12 ? (date.getHours()+1) : 24-date.getHours()));
format = tinyMCE.regexpReplace(format, "%p", "" + (date.getHours() < 12 ? "AM" : "PM"));
format = tinyMCE.regexpReplace(format, "%%", "%");
return format;
}
// Handle commands
switch (command) {
case "mceInsertDate":
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_dateFormat", "%Y-%m-%d")));
return true;
case "mceInsertTime":
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_timeFormat", "%H:%M:%S")));
return true;
}
// Pass to next handler in chain
return false;
}
/**
* $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
*
* @author Moxiecode
* @copyright Copyright <20> 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function() {
tinymce.create('tinymce.plugins.InsertDateTime', {
init : function(ed, url) {
var t = this;
t.editor = ed;
ed.addCommand('mceInsertDate', function() {
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));
ed.execCommand('mceInsertContent', false, str);
});
ed.addCommand('mceInsertTime', function() {
var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));
ed.execCommand('mceInsertContent', false, str);
});
ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});
ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});
},
getInfo : function() {
return {
longname : 'Insert date/time',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Private methods
_getDateTime : function(d, fmt) {
var ed = this.editor;
function addZeros(value, len) {
value = "" + value;
if (value.length < len) {
for (var i=0; i<(len-value.length); i++)
value = "0" + value;
}
return value;
};
fmt = fmt.replace("%D", "%m/%d/%y");
fmt = fmt.replace("%r", "%I:%M:%S %p");
fmt = fmt.replace("%Y", "" + d.getFullYear());
fmt = fmt.replace("%y", "" + d.getYear());
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);
fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);
fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);
fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);
fmt = fmt.replace("%%", "%");
return fmt;
}
});
// Register plugin
tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 958 B

View File

@@ -1,4 +0,0 @@
// UK lang variables
tinyMCELang['lang_insertdate_desc'] = 'Vlo<6C>it datum';
tinyMCELang['lang_inserttime_desc'] = 'Vlo<6C>it <20>as';

View File

@@ -1,4 +0,0 @@
// DE lang variables
tinyMCELang['lang_insertdate_desc'] = 'Datum einf&uuml;gen';
tinyMCELang['lang_inserttime_desc'] = 'Zeit einf&uuml;gen';

View File

@@ -1,4 +0,0 @@
// Greek lang variables by Jacaranda Bill
tinyMCELang['lang_insertdate_desc'] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
tinyMCELang['lang_inserttime_desc'] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>';

View File

@@ -1,4 +0,0 @@
// UK lang variables
tinyMCELang['lang_insertdate_desc'] = 'Insert date';
tinyMCELang['lang_inserttime_desc'] = 'Insert time';

View File

@@ -1,9 +0,0 @@
// IR lang variables
// Persian (Farsi) language pack (for IRAN)
// By: Morteza Zafari
// Lost@LostLord.com
// http://www.LostLord.com
tinyMCELang['lang_dir'] = 'rtl';
tinyMCELang['lang_insertdate_desc'] = 'افزودن تاریخ';
tinyMCELang['lang_inserttime_desc'] = 'افزودن زمان';

View File

@@ -1,4 +0,0 @@
// French lang variables by Laurent Dran
tinyMCELang['lang_insertdate_desc'] = 'Ins&egrave;rer la date';
tinyMCELang['lang_inserttime_desc'] = 'Ins&egrave;rer l\'heure';

View File

@@ -1,4 +0,0 @@
// CAN_FR lang variables
tinyMCELang['lang_insertdate_desc'] = 'Ins<6E>rer la date';
tinyMCELang['lang_inserttime_desc'] = 'Ins<6E>rer l\'heure';

View File

@@ -1,4 +0,0 @@
// IT lang variables
tinyMCELang['lang_insertdate_desc'] = 'Inserisci data';
tinyMCELang['lang_inserttime_desc'] = 'Inserisci ora';

View File

@@ -1,4 +0,0 @@
// KO lang variables
tinyMCELang['lang_insertdate_desc'] = '<27><>¥ <20>ֱ<EFBFBD>';
tinyMCELang['lang_inserttime_desc'] = '<27>ð<EFBFBD> <20>ֱ<EFBFBD>';

View File

@@ -1,4 +0,0 @@
// SE lang variables
tinyMCELang['lang_insertdate_desc'] = 'Klistra in datum';
tinyMCELang['lang_inserttime_desc'] = 'Klistra in tid';

View File

@@ -1,4 +0,0 @@
// Simplified Chinese lang variables contributed by cube316 (cube316@etang.com)
tinyMCELang['lang_insertdate_desc'] = '<27><><EFBFBD>뵱ǰ<EBB5B1><C7B0><EFBFBD><EFBFBD>';
tinyMCELang['lang_inserttime_desc'] = '<27><><EFBFBD>뵱ǰʱ<C7B0><CAB1>';

View File

@@ -1,35 +0,0 @@
InsertDateTime plugin for TinyMCE
-----------------------------------
Installation instructions:
* Copy the insertdatetime directory to the plugins directory of TinyMCE (/jscripts/tiny_mce/plugins).
* Add plugin to TinyMCE plugin option list example: plugins : "insertdatetime".
* Add the insertdate or inserttime button name to button list, example: theme_advanced_buttons3_add : "insertdate,inserttime".
Initialization example:
tinyMCE.init({
theme : "advanced",
mode : "textareas",
plugins : "insertdatetime",
theme_advanced_buttons3_add : "insertdate,inserttime",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S"
});
Configuration:
plugin_insertdate_dateFormat - Format that the date is output as. Defaults to: "%Y-%m-%d".
Replacement variables:
%y - year as a decimal number without a century (range 00 to 99)
%Y - year as a decimal number including the century
%d - day of the month as a decimal number (range 01 to 31)
%m - month as a decimal number (range 01 to 12)
%D - same as %m/%d/%y
%r - time in a.m. and p.m. notation
%H - hour as a decimal number using a 24-hour clock (range 00 to 23)
%I - hour as a decimal number using a 12-hour clock (range 01 to 12)
%M - minute as a decimal number (range 00-59)
%S - second as a decimal number (range 00-59)
%p - either `am' or `pm' according to the given time value
%% - a literal `%' character
plugin_insertdate_timeFormat - Format that the time is output as. Defaults to: "%H:%M:%S".