$(window).load(function(){ if($('.color-picker').length > 0){ $('.color-picker').miniColors(); // just in category view } var view_url = 'http://localhost:3000/panel/calendar/back_end/cals/'; // below calendar start $.get(view_url+'month_view', function(data) { $('#view_holder').html(data); month_fn(); }); $.get(view_url+'new', function(data) { $('#create .modal-body').html(data); }); // view switch (for view test) $('.mode_switch').click(function(){ var target = $(this).text(); $.get(view_url+target+'_view', function(data) { $('#view_holder').html(data); switch(target){ case 'month': month_fn(); break; case 'week': week_fn(); break; case 'day': day_fn(); break; case 'agenda': agenda_fn(); break; } }); }); // month fn var month_fn = function(){ $('.current_day_title').text('September 2012'); // month view if($('#calendar_month').length > 0){ var $c_table = $('#calendar_month'); var sum_h = 0; var context_h = $('#main-sidebar').outerHeight(); $('#main-wrap > *').not('#orbit_calendar, .modal').each(function(){ sum_h += $(this).outerHeight(); }); $c_table // .height(context_h-sum_h-64) .find('.month_row') .not('.month_row.header') .height((context_h-sum_h-92) / 6); $(window).resize(function(){ $c_table .find('.month_row') .not('.month_row.header') .height(($('#main-sidebar').outerHeight()-sum_h-92) / 6); }); } }; // week fn var week_fn = function(){ $('.current_day_title').text('September 2 - 8, 2012'); } // day fn var day_fn = function(){ $('.current_day_title').text('September 2, 2012'); } // agenda fn var agenda_fn = function(){ $('.current_day_title').text('September 2, 2012'); } });