tb_events 1.1.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +13 -1
- data/Rakefile +2 -2
- data/app/assets/javascripts/admin/events/application.js +16 -0
- data/app/assets/javascripts/{calendar_events.js → admin/events/calendar_events.js} +0 -0
- data/app/assets/javascripts/{spud/admin → admin/events}/calendars.js +0 -0
- data/app/assets/stylesheets/admin/events/application.css +4 -0
- data/app/assets/{javascripts/spud/events.js → stylesheets/admin/events/calendar_events.css} +0 -0
- data/app/assets/stylesheets/{spud → admin/events}/calendars.css +23 -28
- data/app/controllers/admin/calendar_events_controller.rb +13 -15
- data/app/controllers/admin/calendars_controller.rb +9 -11
- data/app/controllers/calendar_events_controller.rb +12 -6
- data/app/controllers/calendars_controller.rb +18 -18
- data/app/helpers/admin/calendars_helper.rb +6 -8
- data/app/helpers/calendars_helper.rb +66 -35
- data/app/models/spud_calendar.rb +30 -2
- data/app/models/spud_calendar_event.rb +1 -18
- data/app/models/spud_events/calendar_event_model.rb +31 -0
- data/app/views/admin/calendar_events/_calendar.html.erb +16 -11
- data/app/views/admin/calendar_events/_form.html.erb +16 -98
- data/app/views/admin/calendar_events/index.html.erb +24 -16
- data/app/views/admin/calendars/_calendar_legend.html.erb +5 -4
- data/app/views/admin/calendars/_form.html.erb +4 -19
- data/app/views/calendar_events/index.html.erb +22 -0
- data/app/views/calendar_events/show.html.erb +3 -1
- data/app/views/calendars/show.html.erb +18 -15
- data/config/locales/en.yml +9 -0
- data/config/routes.rb +7 -10
- data/db/migrate/20120216191833_create_spud_calendars.rb +3 -3
- data/db/migrate/20120216192531_create_spud_calendar_events.rb +1 -1
- data/db/migrate/20130214131628_add_location_to_spud_calendar_event.rb +1 -1
- data/db/migrate/20140723203144_add_identifier_to_spud_calendars.rb +6 -0
- data/db/migrate/20140730182213_remove_color_from_spud_calendars.rb +9 -0
- data/lib/spud_events/calendar_builder.rb +53 -0
- data/lib/spud_events/configuration.rb +6 -0
- data/lib/spud_events/engine.rb +25 -0
- data/lib/spud_events/version.rb +3 -0
- data/lib/tb_events.rb +4 -4
- metadata +62 -110
- data/app/assets/javascripts/calendars.js +0 -2
- data/app/assets/javascripts/spud/admin/calendar_events.js +0 -2
- data/app/assets/javascripts/spud/admin/events.js +0 -51
- data/app/assets/lib/colorpicker/colorpicker.css +0 -164
- data/app/assets/lib/colorpicker/colorpicker.js +0 -484
- data/app/assets/lib/colorpicker/images/blank.gif +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_background.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_hex.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_hsb_b.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_hsb_h.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_hsb_s.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_indic.gif +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_overlay.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_rgb_b.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_rgb_g.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_rgb_r.png +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_select.gif +0 -0
- data/app/assets/lib/colorpicker/images/colorpicker_submit.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_background.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_hex.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_hsb_b.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_hsb_h.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_hsb_s.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_indic.gif +0 -0
- data/app/assets/lib/colorpicker/images/custom_rgb_b.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_rgb_g.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_rgb_r.png +0 -0
- data/app/assets/lib/colorpicker/images/custom_submit.png +0 -0
- data/app/assets/lib/colorpicker/images/select.png +0 -0
- data/app/assets/lib/colorpicker/images/select2.png +0 -0
- data/app/assets/lib/colorpicker/images/slider.png +0 -0
- data/app/assets/stylesheets/spud/admin/events.css +0 -16
- data/app/assets/stylesheets/spud/calendar_events.css +0 -18
- data/app/assets/stylesheets/spud/events.css +0 -4
- data/app/views/calendars/_calendar.html.erb +0 -26
- data/app/views/calendars/_calendar_options.html.erb +0 -4
- data/config/application.rb +0 -50
- data/config/boot.rb +0 -6
- data/lib/spud/events/calendar.rb +0 -85
- data/lib/spud/events/calendar_builder.rb +0 -58
- data/lib/spud/events/configuration.rb +0 -8
- data/lib/spud/events/engine.rb +0 -26
- data/lib/spud/events/table_builder.rb +0 -88
- data/lib/spud/events/version.rb +0 -5
@@ -0,0 +1,53 @@
|
|
1
|
+
class SpudEvents::CalendarBuilder
|
2
|
+
DEFAULT_HEADERS = %w(Sunday Monday Tuesday Wednesday Thursday Friday Saturday)
|
3
|
+
START_DAY = :sunday
|
4
|
+
|
5
|
+
delegate :content_tag, to: :view
|
6
|
+
attr_accessor :view, :date, :callback
|
7
|
+
|
8
|
+
def initialize(view, date, opts)
|
9
|
+
@view = view
|
10
|
+
@date = date
|
11
|
+
@headers = opts.delete(:headers) || DEFAULT_HEADERS
|
12
|
+
end
|
13
|
+
|
14
|
+
def table(&block)
|
15
|
+
@callback = block
|
16
|
+
content_tag :table, class: 'calendar' do
|
17
|
+
header + week_rows
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def header
|
24
|
+
content_tag :tr do
|
25
|
+
@headers.map { |day| content_tag :th, day, class: 'day-header' }.join.html_safe
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def week_rows
|
30
|
+
weeks.map do |week|
|
31
|
+
content_tag :tr do
|
32
|
+
week.map { |day| day_cell(day) }.join.html_safe
|
33
|
+
end
|
34
|
+
end.join.html_safe
|
35
|
+
end
|
36
|
+
|
37
|
+
def day_cell(day)
|
38
|
+
content_tag :td, view.capture(day, &callback), :class => day_classes(day), 'data-date' => day.strftime('%F')
|
39
|
+
end
|
40
|
+
|
41
|
+
def day_classes(day)
|
42
|
+
classes = ['day-cell']
|
43
|
+
classes << 'today' if day == Date.today
|
44
|
+
classes << 'not-month' if day.month != date.month
|
45
|
+
classes.empty? ? nil : classes.join(' ')
|
46
|
+
end
|
47
|
+
|
48
|
+
def weeks
|
49
|
+
first = date.beginning_of_month.beginning_of_week(START_DAY)
|
50
|
+
last = date.end_of_month.end_of_week(START_DAY)
|
51
|
+
(first..last).to_a.in_groups_of(7)
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'tb_core'
|
2
|
+
|
3
|
+
module SpudEvents
|
4
|
+
class Engine < Rails::Engine
|
5
|
+
require "#{root}/lib/spud_events/calendar_builder"
|
6
|
+
|
7
|
+
engine_name :tb_events
|
8
|
+
config.autoload_paths << "#{root}/lib"
|
9
|
+
|
10
|
+
initializer :admin do
|
11
|
+
TbCore.configure do |config|
|
12
|
+
config.admin_applications += [{ name: 'Events', thumbnail: 'spud/admin/events_thumb.png', url: '/admin/events', order: 10 }]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
initializer :assets do |_config|
|
17
|
+
TbCore.append_admin_stylesheets('admin/events/application')
|
18
|
+
TbCore.append_admin_javascripts('admin/events/application')
|
19
|
+
end
|
20
|
+
|
21
|
+
initializer 'tb_events.assets' do
|
22
|
+
Rails.application.config.assets.precompile += ['spud/admin/events_thumb.png']
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/tb_events.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tb_events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- Moser Consulting
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.0.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 5.0.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tb_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mysql2
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,107 +52,93 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - '='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 2.8.0
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - '='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 2.8.0
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rspec-rails
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- -
|
59
|
+
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
61
|
+
version: '0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- -
|
66
|
+
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
68
|
+
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
70
|
+
name: rails-controller-testing
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - "
|
73
|
+
- - ">="
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
75
|
+
version: '0'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - "
|
80
|
+
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
82
|
+
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
84
|
+
name: factory_bot_rails
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
|
-
- -
|
87
|
+
- - ">="
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
89
|
+
version: '0'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- -
|
94
|
+
- - ">="
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
96
|
+
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
98
|
+
name: database_cleaner
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0
|
103
|
+
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
|
-
- -
|
108
|
+
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0
|
110
|
+
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
112
|
+
name: simplecov
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
|
-
- -
|
115
|
+
- - ">="
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
117
|
+
version: '0'
|
132
118
|
type: :development
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
|
-
- -
|
122
|
+
- - ">="
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
124
|
+
version: '0'
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
126
|
+
name: rubocop
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
|
-
- - "
|
129
|
+
- - ">="
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0
|
131
|
+
version: '0'
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
|
-
- - "
|
136
|
+
- - ">="
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0
|
153
|
-
description:
|
138
|
+
version: '0'
|
139
|
+
description:
|
154
140
|
email:
|
155
|
-
- greg@
|
141
|
+
- greg.woods@moserit.com
|
156
142
|
executables: []
|
157
143
|
extensions: []
|
158
144
|
extra_rdoc_files: []
|
@@ -160,44 +146,12 @@ files:
|
|
160
146
|
- README.md
|
161
147
|
- Rakefile
|
162
148
|
- app/assets/images/spud/admin/events_thumb.png
|
163
|
-
- app/assets/javascripts/
|
164
|
-
- app/assets/javascripts/
|
165
|
-
- app/assets/javascripts/
|
166
|
-
- app/assets/
|
167
|
-
- app/assets/
|
168
|
-
- app/assets/
|
169
|
-
- app/assets/lib/colorpicker/colorpicker.css
|
170
|
-
- app/assets/lib/colorpicker/colorpicker.js
|
171
|
-
- app/assets/lib/colorpicker/images/blank.gif
|
172
|
-
- app/assets/lib/colorpicker/images/colorpicker_background.png
|
173
|
-
- app/assets/lib/colorpicker/images/colorpicker_hex.png
|
174
|
-
- app/assets/lib/colorpicker/images/colorpicker_hsb_b.png
|
175
|
-
- app/assets/lib/colorpicker/images/colorpicker_hsb_h.png
|
176
|
-
- app/assets/lib/colorpicker/images/colorpicker_hsb_s.png
|
177
|
-
- app/assets/lib/colorpicker/images/colorpicker_indic.gif
|
178
|
-
- app/assets/lib/colorpicker/images/colorpicker_overlay.png
|
179
|
-
- app/assets/lib/colorpicker/images/colorpicker_rgb_b.png
|
180
|
-
- app/assets/lib/colorpicker/images/colorpicker_rgb_g.png
|
181
|
-
- app/assets/lib/colorpicker/images/colorpicker_rgb_r.png
|
182
|
-
- app/assets/lib/colorpicker/images/colorpicker_select.gif
|
183
|
-
- app/assets/lib/colorpicker/images/colorpicker_submit.png
|
184
|
-
- app/assets/lib/colorpicker/images/custom_background.png
|
185
|
-
- app/assets/lib/colorpicker/images/custom_hex.png
|
186
|
-
- app/assets/lib/colorpicker/images/custom_hsb_b.png
|
187
|
-
- app/assets/lib/colorpicker/images/custom_hsb_h.png
|
188
|
-
- app/assets/lib/colorpicker/images/custom_hsb_s.png
|
189
|
-
- app/assets/lib/colorpicker/images/custom_indic.gif
|
190
|
-
- app/assets/lib/colorpicker/images/custom_rgb_b.png
|
191
|
-
- app/assets/lib/colorpicker/images/custom_rgb_g.png
|
192
|
-
- app/assets/lib/colorpicker/images/custom_rgb_r.png
|
193
|
-
- app/assets/lib/colorpicker/images/custom_submit.png
|
194
|
-
- app/assets/lib/colorpicker/images/select.png
|
195
|
-
- app/assets/lib/colorpicker/images/select2.png
|
196
|
-
- app/assets/lib/colorpicker/images/slider.png
|
197
|
-
- app/assets/stylesheets/spud/admin/events.css
|
198
|
-
- app/assets/stylesheets/spud/calendar_events.css
|
199
|
-
- app/assets/stylesheets/spud/calendars.css
|
200
|
-
- app/assets/stylesheets/spud/events.css
|
149
|
+
- app/assets/javascripts/admin/events/application.js
|
150
|
+
- app/assets/javascripts/admin/events/calendar_events.js
|
151
|
+
- app/assets/javascripts/admin/events/calendars.js
|
152
|
+
- app/assets/stylesheets/admin/events/application.css
|
153
|
+
- app/assets/stylesheets/admin/events/calendar_events.css
|
154
|
+
- app/assets/stylesheets/admin/events/calendars.css
|
201
155
|
- app/controllers/admin/calendar_events_controller.rb
|
202
156
|
- app/controllers/admin/calendars_controller.rb
|
203
157
|
- app/controllers/calendar_events_controller.rb
|
@@ -207,6 +161,7 @@ files:
|
|
207
161
|
- app/helpers/calendars_helper.rb
|
208
162
|
- app/models/spud_calendar.rb
|
209
163
|
- app/models/spud_calendar_event.rb
|
164
|
+
- app/models/spud_events/calendar_event_model.rb
|
210
165
|
- app/views/admin/calendar_events/_calendar.html.erb
|
211
166
|
- app/views/admin/calendar_events/_form.html.erb
|
212
167
|
- app/views/admin/calendar_events/edit.html.erb
|
@@ -216,27 +171,25 @@ files:
|
|
216
171
|
- app/views/admin/calendars/_form.html.erb
|
217
172
|
- app/views/admin/calendars/edit.html.erb
|
218
173
|
- app/views/admin/calendars/new.html.erb
|
174
|
+
- app/views/calendar_events/index.html.erb
|
219
175
|
- app/views/calendar_events/show.html.erb
|
220
|
-
- app/views/calendars/_calendar.html.erb
|
221
|
-
- app/views/calendars/_calendar_options.html.erb
|
222
176
|
- app/views/calendars/show.html.erb
|
223
|
-
- config/
|
224
|
-
- config/boot.rb
|
177
|
+
- config/locales/en.yml
|
225
178
|
- config/routes.rb
|
226
179
|
- db/migrate/20120216191833_create_spud_calendars.rb
|
227
180
|
- db/migrate/20120216192531_create_spud_calendar_events.rb
|
228
181
|
- db/migrate/20130214131628_add_location_to_spud_calendar_event.rb
|
229
|
-
-
|
230
|
-
-
|
231
|
-
- lib/
|
232
|
-
- lib/
|
233
|
-
- lib/
|
234
|
-
- lib/
|
182
|
+
- db/migrate/20140723203144_add_identifier_to_spud_calendars.rb
|
183
|
+
- db/migrate/20140730182213_remove_color_from_spud_calendars.rb
|
184
|
+
- lib/spud_events/calendar_builder.rb
|
185
|
+
- lib/spud_events/configuration.rb
|
186
|
+
- lib/spud_events/engine.rb
|
187
|
+
- lib/spud_events/version.rb
|
235
188
|
- lib/tb_events.rb
|
236
|
-
homepage:
|
189
|
+
homepage:
|
237
190
|
licenses: []
|
238
191
|
metadata: {}
|
239
|
-
post_install_message:
|
192
|
+
post_install_message:
|
240
193
|
rdoc_options: []
|
241
194
|
require_paths:
|
242
195
|
- lib
|
@@ -251,9 +204,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
204
|
- !ruby/object:Gem::Version
|
252
205
|
version: '0'
|
253
206
|
requirements: []
|
254
|
-
|
255
|
-
|
256
|
-
signing_key:
|
207
|
+
rubygems_version: 3.0.8
|
208
|
+
signing_key:
|
257
209
|
specification_version: 4
|
258
210
|
summary: Twice Baked Events engine
|
259
211
|
test_files: []
|
@@ -1,51 +0,0 @@
|
|
1
|
-
//= require colorpicker/colorpicker
|
2
|
-
//= require_self
|
3
|
-
|
4
|
-
var Spud = Spud || {};
|
5
|
-
Spud.Admin = Spud.Admin || {};
|
6
|
-
|
7
|
-
Spud.Admin.Events = new function(){
|
8
|
-
var self = this;
|
9
|
-
|
10
|
-
self.init = function(){
|
11
|
-
// Wd.Admin.tinyMce();
|
12
|
-
self.configureColorPicker();
|
13
|
-
self.attachCalendarDeleteFX();
|
14
|
-
};
|
15
|
-
|
16
|
-
self.configureColorPicker = function(){
|
17
|
-
var $colorPickers = $('.spud_events_admin_color_picker'),
|
18
|
-
$calendarColor = $('#spud_calendar_color');
|
19
|
-
|
20
|
-
if($colorPickers.size() > 0) {
|
21
|
-
$colorPickers.css('backgroundColor', '#' + $calendarColor.val());
|
22
|
-
$colorPickers.ColorPicker({
|
23
|
-
color: $calendarColor.val(),
|
24
|
-
onShow: function (colpkr) {
|
25
|
-
$(colpkr).fadeIn(500);
|
26
|
-
return false;
|
27
|
-
},
|
28
|
-
onHide: function (colpkr) {
|
29
|
-
$(colpkr).fadeOut(500);
|
30
|
-
return false;
|
31
|
-
},
|
32
|
-
onChange: function (hsb, hex, rgb) {
|
33
|
-
|
34
|
-
$colorPickers.css('backgroundColor', '#' + hex);
|
35
|
-
$calendarColor.attr('value', hex);
|
36
|
-
}
|
37
|
-
});
|
38
|
-
}
|
39
|
-
};
|
40
|
-
|
41
|
-
self.attachCalendarDeleteFX = function() {
|
42
|
-
$(document).on('ajax:succes','.js-spud-calendar-delete-action', function() {
|
43
|
-
$(this).closest('.spud_events_admin_calendar_legend_item').fadeOut(500, function(){ $(this).remove(); });
|
44
|
-
});
|
45
|
-
};
|
46
|
-
};
|
47
|
-
|
48
|
-
$(function() {
|
49
|
-
Spud.Admin.Events.init();
|
50
|
-
});
|
51
|
-
|