mirror of
https://github.com/friendica/friendica
synced 2025-04-23 23:10:10 +00:00
bug #96 move libraries to library - better alignment of like rotator
This commit is contained in:
parent
60caa03494
commit
0b221e8945
397 changed files with 30 additions and 30 deletions
1
library/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js
vendored
Normal file
1
library/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js
vendored
Normal file
|
@ -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)})();
|
83
library/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js
vendored
Normal file
83
library/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(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);
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue