diff options
author | Brion Vibber <brion@status.net> | 2010-08-12 12:54:20 -0700 |
---|---|---|
committer | Brion Vibber <brion@status.net> | 2010-08-12 12:54:20 -0700 |
commit | 4cf58c4bc79bc2809435c9af0f60b746b898dd58 (patch) | |
tree | 5485d97130fe971864348bf5bafe3628269b1a0c /plugins/TinyMCE/js/plugins/insertdatetime/editor_plugin.js | |
parent | 111fc33e1aa521e8ad33fa333654d09f45a1a24e (diff) | |
parent | 34995df879457f03ad6f78e617294dc2dd040b7d (diff) |
Merge branch 'tinymce' into 0.9.x
Diffstat (limited to 'plugins/TinyMCE/js/plugins/insertdatetime/editor_plugin.js')
-rw-r--r-- | plugins/TinyMCE/js/plugins/insertdatetime/editor_plugin.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/TinyMCE/js/plugins/insertdatetime/editor_plugin.js b/plugins/TinyMCE/js/plugins/insertdatetime/editor_plugin.js new file mode 100644 index 000000000..938ce6b17 --- /dev/null +++ b/plugins/TinyMCE/js/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 |