o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1368660018.6991267: @value"O{I" class:EFI"ProcessedAsset;FI"logical_path;F"*inkwell_timelines/inkwell_timeline.jsI" pathname;F"}/media/workspace/repo/public_projects/inkwell_timelines/app/assets/javascripts/inkwell_timelines/inkwell_timeline.js.erbI"content_type;FI"application/javascript;FI" mtime;FI"2013-05-16T03:16:48+04:00;FI" length;Fi½I" digest;F"%58a7d6926c8ee45e084592fbc2d4f997I" source;FI"½var inkwell_timelines = { config : { data_loading : false, no_more_data : false, current_timestamp : null }, formatDate : function (dateTime) { var date = dateTime.getDate(); var month = dateTime.getMonth() + 1; var hour = dateTime.getHours(); var mins = dateTime.getMinutes(); return (date < 10 ? ('0' + date) : date) + '.' + (month < 10 ? ('0' + month) : month) + '.' + dateTime.getFullYear() + ' ' + (hour < 10 ? ('0' + hour) : hour) + ':' + (mins < 10 ? ('0' + mins) : mins); }, activeTimelineName : function () { return inkwell_timelines.timelineName($('.inkwell_timelines .tab-menu .active')); }, timelineName: function (timeline_obj) { var timeline_name = null; var classes = timeline_obj.attr('class').split(/\s+/); $(classes).each(function () { if (this.indexOf('timeline_') == 0) timeline_name = this.replace('timeline_', ''); }); return timeline_name; }, timelineBlockName : function () { return $('.inkwell_timelines').attr('id'); }, lastItemId : function () { var id = $('.inkwell_timelines .wall_item').last().attr('id'); if (id) { var splitted_id = id.split('_'); return splitted_id[splitted_id.length - 1] } return null; }, transferredParams : function (timeline) { return $('.inkwell_timelines input.transferred_params.' + timeline).attr('value'); }, selectorsValues : function () { var selectors = $('.inkwell_timelines .inkwell_multi_selector'); var result = []; selectors.each(function () { if (!inkwell_multi_selector.is_all_checked($('.inkwell_timelines .inkwell_multi_selector'))) { var data = {}; data['name'] = inkwell_multi_selector.get_selector_name($(this)); data['data'] = inkwell_multi_selector.top_checked_checkboxes_ids($(this)); result.push(data); } }); return (result.length > 0 ? result : null); }, getData : function (current_timeline, include_selectors) { var timestamp = $.now(); inkwell_timelines.config.current_timestamp = timestamp; $.ajax({ url: 'timeline/get/', type: 'POST', dataType: 'html', data: JSON.stringify({ block_name: inkwell_timelines.timelineBlockName(), timeline: current_timeline, last_item_id: inkwell_timelines.lastItemId(), transferred_params: inkwell_timelines.transferredParams(current_timeline), selectors_values: inkwell_timelines.selectorsValues(), include_selectors: include_selectors }), success: function (data) { if (timestamp == inkwell_timelines.config.current_timestamp) inkwell_timelines.buildTimeline(data); }, complete: function () { inkwell_timelines.config.data_loading = false; } }); }, buildTimeline : function (data) { if (data == "") { inkwell_timelines.config.no_more_data = true; return; } $('.inkwell_timelines').append(data); inkwell_timelines.formDate(); }, formDate : function () { $('.inkwell_timelines .date:hidden').each(function () { $(this).text(inkwell_timelines.formatDate(new Date(parseInt($(this).text())))); $(this).removeAttr('style'); }); }, removeTimelineData: function (include_selectors) { inkwell_timelines.config.no_more_data = false; if (include_selectors) $('.inkwell_timelines .inkwell_multi_selector').remove(); $('.inkwell_timelines .wall_item').remove(); }, timelineClickHandler: function (timeline_obj) { inkwell_timelines.config.data_loading = true; inkwell_timelines.removeTimelineData(true); if (!timeline_obj.hasClass('active')) { $('.inkwell_timelines .tab-menu .active').removeClass('active'); timeline_obj.addClass('active'); } inkwell_timelines.getData(inkwell_timelines.timelineName(timeline_obj), true); }, selectorChangedHandler: function (selector) { inkwell_timelines.config.data_loading = true; inkwell_timelines.removeTimelineData(false); var timeline_obj = $('.inkwell_timelines .tab-menu .active')[0]; inkwell_timelines.getData(inkwell_timelines.timelineName($(timeline_obj)), false); } }; $(document).ready(function () { inkwell_timelines.formDate(); $(window).on('scroll', function(e) { inkwell_multi_selector.hide_popup(); var scrHP = $(".inkwell_timelines").height() + $('.inkwell_timelines').offset().top; var scrH2 = $(this).height() + $(this).scrollTop(); if (scrHP - scrH2 < 150) { if (!(inkwell_timelines.config.data_loading || inkwell_timelines.config.no_more_data)) { inkwell_timelines.config.data_loading = true; inkwell_timelines.getData(inkwell_timelines.activeTimelineName(), false); } } }); $('.inkwell_timelines .tab-menu').on('click', 'span', function () { inkwell_timelines.timelineClickHandler($(this)); }); $(document).on('state_changed', '.inkwell_multi_selector', function () { inkwell_timelines.selectorChangedHandler($(this)); }); }); ;FI"dependency_digest;F"%b9b81f2bf1491f38b8c7d5a8e7032d46I"required_paths;F["}/media/workspace/repo/public_projects/inkwell_timelines/app/assets/javascripts/inkwell_timelines/inkwell_timeline.js.erbI"dependency_paths;F[{I" path;F"}/media/workspace/repo/public_projects/inkwell_timelines/app/assets/javascripts/inkwell_timelines/inkwell_timeline.js.erbI" mtime;FI"2013-05-16T03:16:48+04:00;FI" digest;F"%fe1676db553e594730ec4d6cd22d53a1I" _version;F"%6776f581a4329e299531e1d52aa59832