[2.0] source file changes

This commit is contained in:
Adam Shaw
2014-01-24 23:10:00 -08:00
parent 7bd4e08bd0
commit d0d0a97c64
25 changed files with 1883 additions and 1151 deletions
+13 -32
View File
@@ -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, '&amp;')
return (s + '').replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/'/g, '&#039;')
@@ -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;