Вход Регистрация
Файл: public_html/admin/vendors/fullcalendar/gcal.js
Строк: 110
<?php
/*
 * FullCalendar v1.5.4 Google Calendar Plugin
 *
 * Copyright (c) 2011 Adam Shaw
 * Dual licensed under the MIT and GPL licenses, located in
 * MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
 *
 * Date: Tue Sep 4 23:38:33 2012 -0700
 *
 */
 
(function($) {


var 
fc = $.fullCalendar;
var 
formatDate fc.formatDate;
var 
parseISO8601 fc.parseISO8601;
var 
addDays fc.addDays;
var 
applyAll fc.applyAll;


fc.sourceNormalizers.push(function(sourceOptions) {
    if (
sourceOptions.dataType == 'gcal' ||
        
sourceOptions.dataType === undefined &&
        (
sourceOptions.url || '').match(/^(http|https)://www.google.com/calendar/feeds//)) {
            
sourceOptions.dataType 'gcal';
            if (
sourceOptions.editable === undefined) {
                
sourceOptions.editable false;
            }
        }
});


fc.sourceFetchers.push(function(sourceOptionsstartend) {
    if (
sourceOptions.dataType == 'gcal') {
        return 
transformOptions(sourceOptionsstartend);
    }
});


function 
transformOptions(sourceOptionsstartend) {

    var 
success sourceOptions.success;
    var 
data = $.extend({}, sourceOptions.data || {}, {
        
'start-min'formatDate(start'u'),
        
'start-max'formatDate(end'u'),
        
'singleevents'true,
        
'max-results'9999
    
});
    
    var 
ctz sourceOptions.currentTimezone;
    if (
ctz) {
        
data.ctz ctz ctz.replace(' ''_');
    }

    return $.
extend({}, sourceOptions, {
        
urlsourceOptions.url.replace(//basic$/, '/full') + '?alt=json-in-script&callback=?',
        
dataType'jsonp',
        
datadata,
        
startParamfalse,
        
endParamfalse,
        
success: function(data) {
            var 
events = [];
            if (
data.feed.entry) {
                $.
each(data.feed.entry, function(ientry) {
                    var 
startStr entry['gd$when'][0]['startTime'];
                    var 
start parseISO8601(startStrtrue);
                    var 
end parseISO8601(entry['gd$when'][0]['endTime'], true);
                    var 
allDay startStr.indexOf('T') == -1;
                    var 
url;
                    $.
each(entry.link, function(ilink) {
                        if (
link.type == 'text/html') {
                            
url link.href;
                            if (
ctz) {
                                
url += (url.indexOf('?') == -'?' '&') + 'ctz=' ctz;
                            }
                        }
                    });
                    if (
allDay) {
                        
addDays(end, -1); // make inclusive
                    
}
                    
events.push({
                        
identry['gCal$uid']['value'],
                        
titleentry['title']['$t'],
                        
urlurl,
                        
startstart,
                        
endend,
                        
allDayallDay,
                        
locationentry['gd$where'][0]['valueString'],
                        
descriptionentry['content']['$t']
                    });
                });
            }
            var 
args = [events].concat(Array.prototype.slice.call(arguments1));
            var 
res applyAll(successthisargs);
            if ($.
isArray(res)) {
                return 
res;
            }
            return 
events;
        }
    });
    
}


// legacy
fc.gcalFeed = function(urlsourceOptions) {
    return $.
extend({}, sourceOptions, { urlurldataType'gcal' });
};


})(
jQuery);
?>
Онлайн: 1
Реклама