summaryrefslogtreecommitdiff
path: root/site_media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2011-04-25 16:55:24 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2011-04-25 16:55:24 (GMT)
commit0b98cf4e0db404804aa1cd7d44f03348f327e9e7 (patch)
tree24095a99ff4ef0b4d4605475f803c286022af6d0 /site_media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js
parent7183d444b2bddc23c46d1b11599a4e43a60002d1 (diff)
added TinyMCE 3.3.9.4.
Diffstat (limited to 'site_media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js')
-rw-r--r--site_media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/site_media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js b/site_media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js
new file mode 100644
index 0000000..938ce6b
--- /dev/null
+++ b/site_media/js/tiny_mce/plugins/insertdatetime/editor_plugin.js
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.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(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})(); \ No newline at end of file