mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-09 12:00:38 +08:00
[2.0] source file changes
This commit is contained in:
+13
-32
@@ -2,25 +2,14 @@
|
||||
fc.applyAll = applyAll;
|
||||
|
||||
|
||||
/* Event Date Math
|
||||
-----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
function exclEndDay(event) {
|
||||
if (event.end) {
|
||||
return _exclEndDay(event.end, event.allDay);
|
||||
}else{
|
||||
return addDays(cloneDate(event.start), 1);
|
||||
}
|
||||
function createObject(proto) { // like Object.create
|
||||
var f = function() {};
|
||||
f.prototype = proto;
|
||||
return new f();
|
||||
}
|
||||
|
||||
|
||||
function _exclEndDay(end, allDay) {
|
||||
end = cloneDate(end);
|
||||
return allDay || end.getHours() || end.getMinutes() ? addDays(end, 1) : clearTime(end);
|
||||
// why don't we check for seconds/ms too?
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Event Element Binding
|
||||
@@ -125,7 +114,7 @@ function vborders(element) {
|
||||
function noop() { }
|
||||
|
||||
|
||||
function dateCompare(a, b) {
|
||||
function dateCompare(a, b) { // works with moments too
|
||||
return a - b;
|
||||
}
|
||||
|
||||
@@ -135,11 +124,6 @@ function arrayMax(a) {
|
||||
}
|
||||
|
||||
|
||||
function zeroPad(n) {
|
||||
return (n < 10 ? '0' : '') + n;
|
||||
}
|
||||
|
||||
|
||||
function smartProperty(obj, name) { // get a camel-cased/namespaced property of an object
|
||||
if (obj[name] !== undefined) {
|
||||
return obj[name];
|
||||
@@ -152,12 +136,12 @@ function smartProperty(obj, name) { // get a camel-cased/namespaced property of
|
||||
return res;
|
||||
}
|
||||
}
|
||||
return obj[''];
|
||||
return obj['default'];
|
||||
}
|
||||
|
||||
|
||||
function htmlEscape(s) {
|
||||
return s.replace(/&/g, '&')
|
||||
return (s + '').replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/'/g, ''')
|
||||
@@ -166,6 +150,11 @@ function htmlEscape(s) {
|
||||
}
|
||||
|
||||
|
||||
function stripHTMLEntities(text) {
|
||||
return text.replace(/&.*?;/g, '');
|
||||
}
|
||||
|
||||
|
||||
function disableTextSelection(element) {
|
||||
element
|
||||
.attr('unselectable', 'on')
|
||||
@@ -184,7 +173,7 @@ function enableTextSelection(element) {
|
||||
*/
|
||||
|
||||
|
||||
function markFirstLast(e) {
|
||||
function markFirstLast(e) { // TODO: use CSS selectors instead
|
||||
e.children()
|
||||
.removeClass('fc-first fc-last')
|
||||
.filter(':first-child')
|
||||
@@ -195,14 +184,6 @@ function markFirstLast(e) {
|
||||
}
|
||||
|
||||
|
||||
function setDayID(cell, date) {
|
||||
cell.each(function(i, _cell) {
|
||||
_cell.className = _cell.className.replace(/^fc-\w*/, 'fc-' + dayIDs[date.getDay()]);
|
||||
// TODO: make a way that doesn't rely on order of classes
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getSkinCss(event, opt) {
|
||||
var source = event.source || {};
|
||||
var eventColor = event.color;
|
||||
|
||||
Reference in New Issue
Block a user