recurring_select 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/assets/javascripts/recurring_select.js.coffee +1 -0
- data/app/assets/javascripts/recurring_select/fr.js.coffee +1 -0
- data/app/assets/javascripts/recurring_select_dialog.js.coffee.erb +22 -17
- data/app/assets/stylesheets/{jquery-mobile-rs.css.scss.erb → jquery-mobile-rs.css.scss} +14 -0
- data/app/assets/stylesheets/{recurring_select.css.scss.erb → recurring_select.css.scss} +2 -2
- data/app/middleware/recurring_select_middleware.rb +3 -1
- data/config/locales/nl.yml +8 -0
- data/lib/recurring_select/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc482d13ab32f189694906493fd840e7103b7835
|
4
|
+
data.tar.gz: d1505a2aa60a4154d113c4a22a34e118d766896a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 455f685e568c3c85da4564288afcac56e02739e54d7cbf4e694e1065933e799c068cef57649a9f4233cc16f27c7875cbe9ec0069960951638438bdafd1e0ba41
|
7
|
+
data.tar.gz: 6d27206e64ce6a28713ac0de734b85036c5895e05b2ed6fb7d7b27d5bacba130c0cce6595319f255b6f4ecf67a5c7c3e39d017c7f00692d1bcb490a7d3a2af42
|
data/README.md
CHANGED
@@ -43,7 +43,6 @@ window.RecurringSelectDialog =
|
|
43
43
|
@inner_holder.css new_style_hash
|
44
44
|
@inner_holder.trigger "recurring_select:dialog_positioned"
|
45
45
|
else
|
46
|
-
@content.css {"width": @content.width()+"px"}
|
47
46
|
@inner_holder.addClass "animated"
|
48
47
|
@inner_holder.animate new_style_hash, 200, =>
|
49
48
|
@inner_holder.removeClass "animated"
|
@@ -103,10 +102,15 @@ window.RecurringSelectDialog =
|
|
103
102
|
interval_input.val(@current_rule.hash.interval)
|
104
103
|
interval_input.on "change keyup", @intervalChanged
|
105
104
|
|
105
|
+
# clear selected days
|
106
|
+
section.find(".day_holder a").each (index, element) ->
|
107
|
+
$(element).removeClass("selected")
|
108
|
+
|
106
109
|
# connect the day fields
|
107
110
|
if @current_rule.hash.validations? && @current_rule.hash.validations.day?
|
108
111
|
$(@current_rule.hash.validations.day).each (index, val) ->
|
109
112
|
section.find(".day_holder a[data-value='"+val+"']").addClass("selected")
|
113
|
+
|
110
114
|
section.off('click', '.day_holder a').on "click", ".day_holder a", @daysChanged
|
111
115
|
|
112
116
|
section.show()
|
@@ -161,9 +165,9 @@ window.RecurringSelectDialog =
|
|
161
165
|
|
162
166
|
summaryFetch: ->
|
163
167
|
return if !(@current_rule.hash? && (rule_type = @current_rule.hash.rule_type)?)
|
164
|
-
@
|
168
|
+
@current_rule.hash['week_start'] = $.fn.recurring_select.texts["first_day_of_week"]
|
165
169
|
$.ajax
|
166
|
-
url: "
|
170
|
+
url: "<%= Rails.application.config.action_controller.relative_url_root %>/recurring_select/translate/#{$.fn.recurring_select.texts["locale_iso_code"]}",
|
167
171
|
type: "POST",
|
168
172
|
data: @current_rule.hash
|
169
173
|
success: @summaryFetchSuccess
|
@@ -198,12 +202,14 @@ window.RecurringSelectDialog =
|
|
198
202
|
|
199
203
|
for num, index in [1, 2, 3, 4, 5, -1]
|
200
204
|
if show_row[index]
|
201
|
-
monthly_calendar.append "<span>#{row_labels[
|
202
|
-
for day_of_week in [
|
203
|
-
|
205
|
+
monthly_calendar.append "<span>#{row_labels[num - 1]}</span>"
|
206
|
+
for day_of_week in [$.fn.recurring_select.texts["first_day_of_week"]...(7 + $.fn.recurring_select.texts["first_day_of_week"])]
|
207
|
+
day_of_week = day_of_week % 7
|
208
|
+
day_link = $("<a>", {text: cell_str[day_of_week] })
|
204
209
|
day_link.attr("day", day_of_week)
|
205
210
|
day_link.attr("instance", num)
|
206
211
|
monthly_calendar.append day_link
|
212
|
+
|
207
213
|
$.each @current_rule.hash.validations.day_of_week, (key, value) ->
|
208
214
|
$.each value, (index, instance) ->
|
209
215
|
section.find("a[day='#{key}'][instance='#{instance}']").addClass("selected")
|
@@ -252,7 +258,6 @@ window.RecurringSelectDialog =
|
|
252
258
|
@current_rule.hash.interval = parseInt($(event.currentTarget).val())
|
253
259
|
if @current_rule.hash.interval < 1 || isNaN(@current_rule.hash.interval)
|
254
260
|
@current_rule.hash.interval = 1
|
255
|
-
# $(event.currentTarget).val(@current_rule.hash.interval)
|
256
261
|
@summaryUpdate()
|
257
262
|
|
258
263
|
daysChanged: (event) =>
|
@@ -301,9 +306,9 @@ window.RecurringSelectDialog =
|
|
301
306
|
<div class='rs_dialog'>
|
302
307
|
<div class='rs_dialog_content'>
|
303
308
|
<h1>#{$.fn.recurring_select.texts["repeat"]} <a href='#' title='#{$.fn.recurring_select.texts["cancel"]}' Alt='#{$.fn.recurring_select.texts["cancel"]}'></a> </h1>
|
304
|
-
<p>
|
309
|
+
<p class='frequency-select-wrapper'>
|
305
310
|
<label for='rs_frequency'>#{$.fn.recurring_select.texts["frequency"]}:</label>
|
306
|
-
<select id='rs_frequency' class='rs_frequency' name='rs_frequency'>
|
311
|
+
<select data-wrapper-class='ui-recurring-select' id='rs_frequency' class='rs_frequency' name='rs_frequency'>
|
307
312
|
<option value='Daily'>#{$.fn.recurring_select.texts["daily"]}</option>
|
308
313
|
<option value='Weekly'>#{$.fn.recurring_select.texts["weekly"]}</option>
|
309
314
|
<option value='Monthly'>#{$.fn.recurring_select.texts["monthly"]}</option>
|
@@ -314,14 +319,14 @@ window.RecurringSelectDialog =
|
|
314
319
|
<div class='daily_options freq_option_section'>
|
315
320
|
<p>
|
316
321
|
#{$.fn.recurring_select.texts["every"]}
|
317
|
-
<input type='text' name='rs_daily_interval' class='rs_daily_interval rs_interval' value='1' size='2' />
|
322
|
+
<input type='text' data-wrapper-class='ui-recurring-select' name='rs_daily_interval' class='rs_daily_interval rs_interval' value='1' size='2' />
|
318
323
|
#{$.fn.recurring_select.texts["days"]}
|
319
324
|
</p>
|
320
325
|
</div>
|
321
326
|
<div class='weekly_options freq_option_section'>
|
322
327
|
<p>
|
323
328
|
#{$.fn.recurring_select.texts["every"]}
|
324
|
-
<input type='text' name='rs_weekly_interval' class='rs_weekly_interval rs_interval' value='1' size='2' />
|
329
|
+
<input type='text' data-wrapper-class='ui-recurring-select' name='rs_weekly_interval' class='rs_weekly_interval rs_interval' value='1' size='2' />
|
325
330
|
#{$.fn.recurring_select.texts["weeks_on"]}:
|
326
331
|
</p>
|
327
332
|
<div class='day_holder'>
|
@@ -337,12 +342,12 @@ window.RecurringSelectDialog =
|
|
337
342
|
<div class='monthly_options freq_option_section'>
|
338
343
|
<p>
|
339
344
|
#{$.fn.recurring_select.texts["every"]}
|
340
|
-
<input type='text' name='rs_monthly_interval' class='rs_monthly_interval rs_interval' value='1' size='2' />
|
345
|
+
<input type='text' data-wrapper-class='ui-recurring-select' name='rs_monthly_interval' class='rs_monthly_interval rs_interval' value='1' size='2' />
|
341
346
|
#{$.fn.recurring_select.texts["months"]}:
|
342
347
|
</p>
|
343
348
|
<p class='monthly_rule_type'>
|
344
|
-
<span>#{$.fn.recurring_select.texts["day_of_month"]}
|
345
|
-
<span>#{$.fn.recurring_select.texts["day_of_week"]}
|
349
|
+
<span><label for='monthly_rule_type_day'>#{$.fn.recurring_select.texts["day_of_month"]}</label><input type='radio' class='monthly_rule_type_day' name='monthly_rule_type' id='monthly_rule_type_day' value='true' /></span>
|
350
|
+
<span><label for='monthly_rule_type_week'>#{$.fn.recurring_select.texts["day_of_week"]}</label><input type='radio' class='monthly_rule_type_week' name='monthly_rule_type' id='monthly_rule_type_week' value='true' /></span>
|
346
351
|
</p>
|
347
352
|
<p class='rs_calendar_day'></p>
|
348
353
|
<p class='rs_calendar_week'></p>
|
@@ -350,7 +355,7 @@ window.RecurringSelectDialog =
|
|
350
355
|
<div class='yearly_options freq_option_section'>
|
351
356
|
<p>
|
352
357
|
#{$.fn.recurring_select.texts["every"]}
|
353
|
-
<input type='text' name='rs_yearly_interval' class='rs_yearly_interval rs_interval' value='1' size='2' />
|
358
|
+
<input type='text' data-wrapper-class='ui-recurring-select' name='rs_yearly_interval' class='rs_yearly_interval rs_interval' value='1' size='2' />
|
354
359
|
#{$.fn.recurring_select.texts["years"]}
|
355
360
|
</p>
|
356
361
|
</div>
|
@@ -358,8 +363,8 @@ window.RecurringSelectDialog =
|
|
358
363
|
<span></span>
|
359
364
|
</p>
|
360
365
|
<div class='controls'>
|
361
|
-
<input type='button' class='rs_save' value='#{$.fn.recurring_select.texts["ok"]}' />
|
362
|
-
<input type='button' class='rs_cancel' value='#{$.fn.recurring_select.texts["cancel"]}' />
|
366
|
+
<input type='button' data-wrapper-class='ui-recurring-select' class='rs_save' value='#{$.fn.recurring_select.texts["ok"]}' />
|
367
|
+
<input type='button' data-wrapper-class='ui-recurring-select' class='rs_cancel' value='#{$.fn.recurring_select.texts["cancel"]}' />
|
363
368
|
</div>
|
364
369
|
</div>
|
365
370
|
</div>
|
@@ -3,6 +3,20 @@
|
|
3
3
|
*= require_self
|
4
4
|
*/
|
5
5
|
|
6
|
+
/* Make the jQuery mobile wrapped input elements inline */
|
7
|
+
div.ui-recurring-select {
|
8
|
+
display:inline-block;
|
9
|
+
}
|
10
|
+
|
11
|
+
.frequency-select-wrapper label{
|
12
|
+
display:inline;
|
13
|
+
}
|
14
|
+
|
15
|
+
/* Make the jQuery mobile wrapped labels and radios remain inline elements inline */
|
16
|
+
p.monthly_rule_type label {
|
17
|
+
display:inline;
|
18
|
+
}
|
19
|
+
|
6
20
|
.rs_dialog_holder {padding-left:0px; background-color:#333; background-color:rgba(30,30,30,0.3); font-size:1em; position:absolute;
|
7
21
|
.rs_dialog { position:absolute; left:10px; right:10px; margin:0px; display:block; z-index:51;
|
8
22
|
|
@@ -33,7 +33,7 @@ select {
|
|
33
33
|
display:inline-block; min-width:200px; margin-left:-125px; overflow:hidden; position:relative;
|
34
34
|
.rs_dialog_content { padding:10px;
|
35
35
|
h1 { font-size:16px; padding:0px; margin:0 0 10px 0;
|
36
|
-
a {float:right; display:inline-block; height:16px; width:16px; background-image:url(
|
36
|
+
a {float:right; display:inline-block; height:16px; width:16px; background-image:image-url("recurring_select/cancel.png"); background-position:center; background-repeat:no-repeat;}
|
37
37
|
}
|
38
38
|
|
39
39
|
p { padding:5px 0; margin:0; line-height: 14px;
|
@@ -80,7 +80,7 @@ select {
|
|
80
80
|
.rs_summary { padding:0px; margin-top:15px; border-top:1px solid #ccc;
|
81
81
|
span {font-weight:bold; border-top:1px solid #fff; display:block; padding:10px 0 5px 0;}
|
82
82
|
&.fetching {color:#999;
|
83
|
-
span {background-image:url(
|
83
|
+
span {background-image:image-url("recurring_select/throbber_13x13.gif"); background-position:center; background-repeat:no-repeat; display:inline-block; height:13px; width:13px; margin-top:-4px; padding-right:5px;}
|
84
84
|
}
|
85
85
|
label {font-weight:normal;}
|
86
86
|
}
|
@@ -7,7 +7,9 @@ class RecurringSelectMiddleware
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def call(env)
|
10
|
-
|
10
|
+
regexp = /^\/recurring_select\/translate\/(.*)/
|
11
|
+
if env["PATH_INFO"] =~ regexp
|
12
|
+
I18n.locale = env["PATH_INFO"].scan(regexp).first.first
|
11
13
|
request = Rack::Request.new(env)
|
12
14
|
params = request.params
|
13
15
|
params.symbolize_keys!
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recurring_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jobber
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-12-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -155,13 +155,14 @@ files:
|
|
155
155
|
- app/assets/javascripts/recurring_select.js.coffee
|
156
156
|
- app/assets/javascripts/recurring_select/fr.js.coffee
|
157
157
|
- app/assets/javascripts/recurring_select_dialog.js.coffee.erb
|
158
|
-
- app/assets/stylesheets/jquery-mobile-rs.css.scss
|
159
|
-
- app/assets/stylesheets/recurring_select.css.scss
|
158
|
+
- app/assets/stylesheets/jquery-mobile-rs.css.scss
|
159
|
+
- app/assets/stylesheets/recurring_select.css.scss
|
160
160
|
- app/assets/stylesheets/utilities.scss
|
161
161
|
- app/helpers/recurring_select_helper.rb
|
162
162
|
- app/middleware/recurring_select_middleware.rb
|
163
163
|
- config/locales/en.yml
|
164
164
|
- config/locales/fr.yml
|
165
|
+
- config/locales/nl.yml
|
165
166
|
- config/routes.rb
|
166
167
|
- lib/recurring_select.rb
|
167
168
|
- lib/recurring_select/engine.rb
|