Sha256: 5b8302b4610576e06733290b48e1729375131e1eb36f5b24af4df20935d7ea40

Contents?: true

Size: 1.29 KB

Versions: 41

Compression:

Stored size: 1.29 KB

Contents

//= require social_stream.timeline

SocialStream.Event = (function(SS, $, undefined) {
	var indexCallbacks = [];

	var addIndexCallback = function(callback){
		indexCallbacks.push(callback);
	}

	var index = function(){
		$.each(indexCallbacks, function(i, callback){ callback(); });
	}

	var color = function(){
		SocialStream.Events.current.eventColor;
	}

        var fixDates = function(){
          $(".event").each(function(){
            dateString = $(this).find("time").attr("datetime");

            date = new Date(dateString);

            var dayEl = $(this).find(".event_day");
	    if (dayEl.length) {
		    dayEl.text($.datepicker.formatDate('d', date));
	    }

            var monthEl = $(this).find(".event_month");
	    if (monthEl.length) {
            	monthEl.text($.datepicker.formatDate('M', date));
	    }

            var hourEl = $(this).find(".event_hour");
            if(hourEl.length) {
              var minutes = date.getMinutes();
              if (minutes<10) minutes = "0" + minutes;
              hourEl.text(date.getHours() + ':' + minutes);
            }

          });

        }

	addIndexCallback(fixDates);

        SocialStream.Timeline.addInitCallback(index);

	return {
		addIndexCallback: addIndexCallback,
		color: color,
		index: index
	}

})(SocialStream, jQuery);

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
social_stream-1.1.12 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.11 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.10 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.9 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.8 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.7 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.6 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.5 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.4 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.3 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.2 events/app/assets/javascripts/social_stream.event.js
social_stream-1.1.1 events/app/assets/javascripts/social_stream.event.js
social_stream-events-1.1.1 app/assets/javascripts/social_stream.event.js
social_stream-1.1.0 events/app/assets/javascripts/social_stream.event.js
social_stream-events-1.1.0 app/assets/javascripts/social_stream.event.js
social_stream-1.0.1 events/app/assets/javascripts/social_stream.event.js
social_stream-events-1.0.0 app/assets/javascripts/social_stream.event.js
social_stream-0.30.2 events/app/assets/javascripts/social_stream.event.js
social_stream-events-0.16.2 app/assets/javascripts/social_stream.event.js
social_stream-0.30.1 events/app/assets/javascripts/social_stream.event.js