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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fab37d1e22d29ea0e11bf7cd8fa8029c0d82ffae
4
- data.tar.gz: 91ffdeb1a1501631d6c59a722e8716921b15c980
3
+ metadata.gz: dc482d13ab32f189694906493fd840e7103b7835
4
+ data.tar.gz: d1505a2aa60a4154d113c4a22a34e118d766896a
5
5
  SHA512:
6
- metadata.gz: a4a0c849ab6538a1b6ca9f23170b9796b73b7cfeca34b7d1785a417d536cf457d35752c716e81ea720d8e63a9e7946acff14494bf40c78efc084ac184d878f29
7
- data.tar.gz: 810ed71fa996b7c149e0f3842daa4cda8c2f7ac5d055224ea862bb5f755a4d083107084131a75afb849ada57fa6a03b94dc746cf39922b4d7ab57145d8690a69
6
+ metadata.gz: 455f685e568c3c85da4564288afcac56e02739e54d7cbf4e694e1065933e799c068cef57649a9f4233cc16f27c7875cbe9ec0069960951638438bdafd1e0ba41
7
+ data.tar.gz: 6d27206e64ce6a28713ac0de734b85036c5895e05b2ed6fb7d7b27d5bacba130c0cce6595319f255b6f4ecf67a5c7c3e39d017c7f00692d1bcb490a7d3a2af42
data/README.md CHANGED
@@ -101,6 +101,7 @@ For other languages include a JavaScript file like this:
101
101
 
102
102
  ```coffeescript
103
103
  $.fn.recurring_select.texts = {
104
+ locale_iso_code: "fr"
104
105
  repeat: "Repeat"
105
106
  frequency: "Frequency"
106
107
  daily: "Daily"
@@ -80,6 +80,7 @@ $.fn.recurring_select.options = {
80
80
  }
81
81
 
82
82
  $.fn.recurring_select.texts = {
83
+ locale_iso_code: "en"
83
84
  repeat: "Repeat"
84
85
  last_day: "Last Day"
85
86
  frequency: "Frequency"
@@ -1,4 +1,5 @@
1
1
  $.fn.recurring_select.texts = {
2
+ locale_iso_code: "fr"
2
3
  repeat: "Récurrence"
3
4
  last_day: "Dernier jour"
4
5
  frequency: "Fréquence"
@@ -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
- @content.css {"width": @content.width()+"px"}
168
+ @current_rule.hash['week_start'] = $.fn.recurring_select.texts["first_day_of_week"]
165
169
  $.ajax
166
- url: "/recurring_select/translate",
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[index]}</span>"
202
- for day_of_week in [0..6]
203
- day_link = $("<a>", {text: cell_str[day_of_week]})
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"]} <input type='radio' class='monthly_rule_type_day' name='monthly_rule_type' value='true' /></span>
345
- <span>#{$.fn.recurring_select.texts["day_of_week"]} <input type='radio' class='monthly_rule_type_week' name='monthly_rule_type' value='true' /></span>
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(<%=asset_path "recurring_select/cancel.png"%>); background-position:center; background-repeat:no-repeat;}
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(<%=asset_path "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;}
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
- if env["PATH_INFO"] =~ /^\/recurring_select\/translate/
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!
@@ -0,0 +1,8 @@
1
+ nl:
2
+ recurring_select:
3
+ not_recurring: "- niet herhalen -"
4
+ change_schedule: "Rooster aanpassen..."
5
+ set_schedule: "Rooster instellen..."
6
+ new_custom_schedule: "Nieuw aangepast rooster..."
7
+ custom_schedule: "Aangepast rooster..."
8
+ or: of
@@ -1,3 +1,3 @@
1
1
  module RecurringSelect
2
- VERSION = "1.2.4"
2
+ VERSION = "1.3.0"
3
3
  end
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.2.4
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-10-17 00:00:00.000000000 Z
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.erb
159
- - app/assets/stylesheets/recurring_select.css.scss.erb
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