social_stream-events 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/social_stream.calendar.js.erb +15 -9
- data/app/assets/javascripts/social_stream.events.action.js +31 -0
- data/db/migrate/20111218203314_create_events.rb +33 -0
- data/db/migrate/20120330131859_create_social_stream_events.rb +10 -0
- data/lib/social_stream/events/version.rb +1 -1
- data/social_stream-events.gemspec +1 -1
- metadata +14 -15
- data/db/migrate/20111101193523_create_events.rb +0 -13
- data/db/migrate/20111120104349_create_rooms.rb +0 -26
- data/db/migrate/20111204155637_add_scheduler.rb +0 -33
- data/db/migrate/20111218203314_change_scheduler.rb +0 -11
@@ -1,15 +1,19 @@
|
|
1
1
|
//= require jquery.tipsy
|
2
2
|
|
3
3
|
SocialStream.Calendar = (function(SS, $, undefined){
|
4
|
-
var elementRegExp = new RegExp('sidebar_day_(..?)_(..?)_(..?.?.?)');
|
5
4
|
var eventsPath;
|
6
5
|
|
7
|
-
var
|
8
|
-
return
|
6
|
+
var element = function(){
|
7
|
+
return $("#sidebar_calendar");
|
9
8
|
}
|
9
|
+
var eventElementRegExp = new RegExp('sidebar_day_(..?)_(..?)_(..?.?.?)');
|
10
10
|
|
11
|
-
var
|
12
|
-
|
11
|
+
var eventElementMatch = function(el){
|
12
|
+
return eventElementRegExp.exec(el.id);
|
13
|
+
}
|
14
|
+
|
15
|
+
var eventElementDate = function(el) {
|
16
|
+
var m = eventElementMatch(el);
|
13
17
|
|
14
18
|
if(m == null) return;
|
15
19
|
|
@@ -29,7 +33,7 @@ SocialStream.Calendar = (function(SS, $, undefined){
|
|
29
33
|
|
30
34
|
|
31
35
|
$('#sidebar_calendar td').each(function(index, domEl){
|
32
|
-
var d =
|
36
|
+
var d = eventElementDate(domEl)
|
33
37
|
|
34
38
|
if(d < now) $(domEl).addClass('past');
|
35
39
|
if(d.getMonth() != now.getMonth() && d > now) $(domEl).addClass('next_month');
|
@@ -71,11 +75,11 @@ SocialStream.Calendar = (function(SS, $, undefined){
|
|
71
75
|
}
|
72
76
|
|
73
77
|
var busyTipsy = function(){
|
74
|
-
var startDate =
|
78
|
+
var startDate = eventElementDate(this)
|
75
79
|
startDate.setHours(0);
|
76
80
|
startDate.setMinutes(0);
|
77
81
|
startDate.setSeconds(0);
|
78
|
-
var endDate =
|
82
|
+
var endDate = eventElementDate(this)
|
79
83
|
|
80
84
|
$.ajax({
|
81
85
|
dataType: "script",
|
@@ -92,7 +96,9 @@ SocialStream.Calendar = (function(SS, $, undefined){
|
|
92
96
|
}
|
93
97
|
|
94
98
|
return {
|
95
|
-
init: init
|
99
|
+
init: init,
|
100
|
+
element: element,
|
101
|
+
eventElement: eventElement
|
96
102
|
}
|
97
103
|
|
98
104
|
})(SocialStream, jQuery);
|
@@ -0,0 +1,31 @@
|
|
1
|
+
//= require social_stream.action
|
2
|
+
|
3
|
+
SocialStream.Events.Action = (function(SS, $, undefined){
|
4
|
+
var animateCalendar = function(action) {
|
5
|
+
if (action.activity_object.type != "Event") {
|
6
|
+
return;
|
7
|
+
}
|
8
|
+
|
9
|
+
if (!action.follow) {
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
|
13
|
+
var fromEl = SS.Action.followForms(action).closest(".event").find("time");
|
14
|
+
var fromDate = new Date(fromEl.attr('datetime'));
|
15
|
+
|
16
|
+
var toEl = SS.Calendar.eventElement(fromDate) || SS.Calendar.element;
|
17
|
+
|
18
|
+
if (action.follow.following) {
|
19
|
+
fromEl.effect("transfer", {to: toEl}, 1000);
|
20
|
+
toEl.addClass("busy");
|
21
|
+
} else {
|
22
|
+
toEl.effect("pulsate");
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
// SocialStream.Action.addUpdateCallback(animateCalendar);
|
27
|
+
|
28
|
+
return {
|
29
|
+
}
|
30
|
+
|
31
|
+
})(SocialStream, jQuery);
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class CreateEvents < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table "events", :force => true do |t|
|
4
|
+
t.integer "activity_object_id"
|
5
|
+
t.string "title"
|
6
|
+
t.datetime "start_at"
|
7
|
+
t.datetime "end_at"
|
8
|
+
t.boolean "all_day"
|
9
|
+
t.datetime "created_at", :null => false
|
10
|
+
t.datetime "updated_at", :null => false
|
11
|
+
t.integer "room_id"
|
12
|
+
t.date "start_date"
|
13
|
+
t.date "end_date"
|
14
|
+
t.integer "frequency", :default => 0
|
15
|
+
t.integer "interval"
|
16
|
+
t.integer "days", :default => 0
|
17
|
+
t.integer "interval_flag", :default => 0
|
18
|
+
end
|
19
|
+
|
20
|
+
add_index "events", ["room_id"], :name => "index_events_on_room_id"
|
21
|
+
|
22
|
+
create_table "rooms", :force => true do |t|
|
23
|
+
t.integer "actor_id"
|
24
|
+
t.string "name"
|
25
|
+
t.datetime "created_at", :null => false
|
26
|
+
t.datetime "updated_at", :null => false
|
27
|
+
end
|
28
|
+
|
29
|
+
add_index "rooms", ["actor_id"], :name => "index_rooms_on_actor_id"
|
30
|
+
|
31
|
+
add_foreign_key "events", "rooms", :name => "index_events_on_room_id"
|
32
|
+
end
|
33
|
+
end
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.19.0')
|
16
16
|
s.add_runtime_dependency('rails-scheduler', '~> 0.0.8')
|
17
17
|
s.add_runtime_dependency('coffee-rails', '>= 3.1.0')
|
18
18
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,22 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-04-02 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: social_stream-base
|
17
|
-
requirement: &
|
17
|
+
requirement: &80493450 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.19.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *80493450
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rails-scheduler
|
28
|
-
requirement: &
|
28
|
+
requirement: &80491870 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 0.0.8
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *80491870
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: coffee-rails
|
39
|
-
requirement: &
|
39
|
+
requirement: &80491310 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 3.1.0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *80491310
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: sqlite3-ruby
|
50
|
-
requirement: &
|
50
|
+
requirement: &80490670 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *80490670
|
59
59
|
description: ! 'Social Stream is a Ruby on Rails engine providing your application
|
60
60
|
with social networking features and activity streams.
|
61
61
|
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- app/assets/javascripts/social_stream-events.js
|
76
76
|
- app/assets/javascripts/social_stream.calendar.js.erb
|
77
77
|
- app/assets/javascripts/social_stream.event.js
|
78
|
+
- app/assets/javascripts/social_stream.events.action.js
|
78
79
|
- app/assets/javascripts/social_stream.events.poster.js
|
79
80
|
- app/assets/javascripts/social_stream.events.tools.js.coffee
|
80
81
|
- app/assets/stylesheets/events.css.scss
|
@@ -108,12 +109,10 @@ files:
|
|
108
109
|
- config/locales/en.yml
|
109
110
|
- config/locales/es.yml
|
110
111
|
- config/routes.rb
|
111
|
-
- db/migrate/
|
112
|
-
- db/migrate/20111120104349_create_rooms.rb
|
113
|
-
- db/migrate/20111204155637_add_scheduler.rb
|
114
|
-
- db/migrate/20111218203314_change_scheduler.rb
|
112
|
+
- db/migrate/20111218203314_create_events.rb
|
115
113
|
- db/migrate/20120208143756_events_group_title_and_description_in_activity_object.rb
|
116
114
|
- db/migrate/20120208144948_add_events_foreign_key.rb
|
115
|
+
- db/migrate/20120330131859_create_social_stream_events.rb
|
117
116
|
- lib/generators/social_stream/events/install_generator.rb
|
118
117
|
- lib/social_stream-events.rb
|
119
118
|
- lib/social_stream/events/ability.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
class CreateRooms < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
create_table :rooms do |t|
|
4
|
-
t.references :actor
|
5
|
-
t.string :name
|
6
|
-
|
7
|
-
t.timestamps
|
8
|
-
end
|
9
|
-
|
10
|
-
change_table :events do |t|
|
11
|
-
t.references :room
|
12
|
-
end
|
13
|
-
|
14
|
-
add_index :rooms, :actor_id
|
15
|
-
add_index :events, :room_id
|
16
|
-
add_foreign_key :rooms, :actors, :name => "index_rooms_on_actor_id"
|
17
|
-
add_foreign_key :events, :rooms, :name => "index_events_on_room_id"
|
18
|
-
end
|
19
|
-
|
20
|
-
def down
|
21
|
-
remove_foreign_key :rooms, :name => "index_rooms_on_actor_id"
|
22
|
-
remove_foreign_key :events, :name => "index_events_on_room_id"
|
23
|
-
|
24
|
-
drop_table :rooms
|
25
|
-
end
|
26
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
class AddScheduler < ActiveRecord::Migration
|
2
|
-
|
3
|
-
class EventSchedulerMigration < ActiveRecord::Base
|
4
|
-
self.record_timestamps = false
|
5
|
-
set_table_name "events"
|
6
|
-
end
|
7
|
-
|
8
|
-
def up
|
9
|
-
change_table :events do |t|
|
10
|
-
t.date :start_date
|
11
|
-
t.date :end_date
|
12
|
-
t.integer :frequency, :default => 0
|
13
|
-
t.integer :interval
|
14
|
-
t.integer :interval_flag, :default => 0
|
15
|
-
end
|
16
|
-
|
17
|
-
EventSchedulerMigration.all.each do |e|
|
18
|
-
e.start_date = e.start_at
|
19
|
-
e.end_date = e.end_at
|
20
|
-
e.save!
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def down
|
25
|
-
change_table :events do |t|
|
26
|
-
t.remove :start_date
|
27
|
-
t.remove :end_date
|
28
|
-
t.remove :frequency
|
29
|
-
t.remove :interval
|
30
|
-
t.remove :interval_flag
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class ChangeScheduler < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
rename_column :events, :interval_flag, :days
|
4
|
-
add_column :events, :interval_flag, :integer, :default => 0
|
5
|
-
end
|
6
|
-
|
7
|
-
def down
|
8
|
-
rename_column :events, :days, :interval_flag
|
9
|
-
remove_column :events, :interval_flag
|
10
|
-
end
|
11
|
-
end
|