tinymce editor
This commit is contained in:
parent
6ddb7c49e6
commit
9cffe191ac
655 changed files with 16255 additions and 22045 deletions
63
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js
vendored
Executable file
63
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js
vendored
Executable file
|
|
@ -0,0 +1,63 @@
|
|||
/* Import theme specific language pack */
|
||||
tinyMCE.importPluginLanguagePack('insertdatetime', 'uk,se');
|
||||
|
||||
/**
|
||||
* 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, "%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, "%%", "%");
|
||||
|
||||
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;
|
||||
}
|
||||
BIN
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/images/insertdate.gif
vendored
Executable file
BIN
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/images/insertdate.gif
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 153 B |
BIN
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/images/inserttime.gif
vendored
Executable file
BIN
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/images/inserttime.gif
vendored
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 126 B |
4
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/langs/se.js
vendored
Executable file
4
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/langs/se.js
vendored
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
// SE lang variables
|
||||
|
||||
tinyMCELang['lang_insertdate_desc'] = 'Klistra in datum';
|
||||
tinyMCELang['lang_inserttime_desc'] = 'Klistra in tid';
|
||||
4
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/langs/uk.js
vendored
Executable file
4
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/langs/uk.js
vendored
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCELang['lang_insertdate_desc'] = 'Insert date';
|
||||
tinyMCELang['lang_inserttime_desc'] = 'Insert time';
|
||||
32
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/readme.txt
vendored
Executable file
32
www/extras/tinymce/jscripts/tiny_mce/plugins/insertdatetime/readme.txt
vendored
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
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
|
||||
%H - hour as a decimal number using a 24-hour clock (range 00 to 23)
|
||||
%M - minute as a decimal number (range 00-59)
|
||||
%S - second as a decimal number (range 00-59)
|
||||
%% - a literal `%' character
|
||||
|
||||
plugin_insertdate_timeFormat - Format that the time is output as. Defaults to: "%H:%M:%S".
|
||||
Loading…
Add table
Add a link
Reference in a new issue