Skip to content

Commit a2ad1d0

Browse files
authored
Merge pull request gregschmit#166 from glaszig/modernization
Modernization
2 parents 87796bc + 8e75d46 commit a2ad1d0

29 files changed

+777
-594
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: test
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
name: ${{matrix.ruby}}, ${{matrix.gemfile}}
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
ruby: [ '3.0', '3.1', '3.2', '3.3' ]
13+
gemfile:
14+
- Gemfile
15+
- spec/gemfiles/rails-6.1
16+
- spec/gemfiles/rails-7.0
17+
18+
env:
19+
BUNDLE_GEMFILE: ${{matrix.gemfile}}
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ${{matrix.ruby}}
26+
bundler-cache: true # 'bundle install' and cache
27+
- run: bundle exec rspec --format documentation

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*.gem
2-
spec/gemfiles/Gemfile*.lock
3-
Gemfile.lock
2+
spec/gemfiles/*.lock
3+
*Gemfile.lock
44
*.gem
55

66
.bundle/

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.7
1+
3.0.6

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 4.0.0 / upcoming
2+
3+
* [BREAKING-CHANGE] Drop support for Rails < 6.1
4+
* [BREAKING-CHANGE] Drop support for Ruby < 3.0
5+
* [BREAKING-CHANGE] Convert to vanilla js, remove coffeescript dependency
6+
* [BREAKING-CHANGE] Remove jquery dependency
7+
* [FIX] Fix event handling when switching between frequencies
8+
* remove databse dependency from dummy app
9+
* move CI from Travis to GitHub
10+
111
# 2.0.0 / 2015-09-24
212

313
* [BREAKING-CHANGE] Dropping support for rails 3.X - Upgrade to sass-rails 4

Gemfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
source "https://rubygems.org"
22
gemspec
33

4-
gem "pg"
5-
6-
gem "jquery-rails"
7-
8-
gem "rails", "~> 5.2"
9-
gem "sass-rails", "~> 5.0"
4+
gem "thin"
5+
gem "rails", "~> 7.1.1"

README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ gem 'recurring_select'
2626
- application.css: `//= require recurring_select`
2727

2828
#### jQuery Mobile Interface:
29+
- application.js: `//= require jquery`
2930
- application.js: `//= require jquery-mobile-rs`
3031
- application.css: `//= require jquery-mobile-rs`
3132

@@ -99,8 +100,8 @@ You have to translate JavaScript texts too by including the locale file in your
99100

100101
For other languages include a JavaScript file like this:
101102

102-
```coffeescript
103-
$.fn.recurring_select.texts = {
103+
```js
104+
RecurringSelectDialog.config.texts = {
104105
locale_iso_code: "fr"
105106
repeat: "Repeat"
106107
frequency: "Frequency"
@@ -125,8 +126,8 @@ $.fn.recurring_select.texts = {
125126

126127
Options include:
127128

128-
```coffeescript
129-
$.fn.recurring_select.options = {
129+
```js
130+
RecurringSelectDialog.config.options = {
130131
monthly: {
131132
show_week: [true, true, true, true, false, false] //display week 1, 2 .... Last
132133
}
@@ -135,13 +136,6 @@ $.fn.recurring_select.options = {
135136

136137
## Testing and Development
137138

138-
The dummy app uses a [Postgres](http://postgresapp.com/) database `recurring_select_development`. To get setup:
139-
140-
```console
141-
bundle
142-
rake db:create
143-
```
144-
145139
Start the dummy server for clicking around the interface:
146140

147141
```console
@@ -151,8 +145,8 @@ rails s
151145
Tests can be ran against different versions of Rails like so:
152146

153147
```
154-
BUNDLE_GEMFILE=spec/gemfiles/Gemfile.rails-4.0.x bundle install
155-
BUNDLE_GEMFILE=spec/gemfiles/Gemfile.rails-4.0.x bundle exec rspec spec
148+
BUNDLE_GEMFILE=spec/gemfiles/rails-7 bundle install
149+
BUNDLE_GEMFILE=spec/gemfiles/rails-7 bundle exec rspec spec
156150
```
157151

158152
Feel free to open issues or send pull requests.

app/assets/javascripts/defaults.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const defaultConfig = {
2+
options: {
3+
monthly: {
4+
show_week: [true, true, true, true, false, false]
5+
}
6+
},
7+
texts: {
8+
locale_iso_code: "en",
9+
repeat: "Repeat",
10+
last_day: "Last Day",
11+
frequency: "Frequency",
12+
daily: "Daily",
13+
weekly: "Weekly",
14+
monthly: "Monthly",
15+
yearly: "Yearly",
16+
every: "Every",
17+
days: "day(s)",
18+
weeks_on: "week(s) on",
19+
months: "month(s)",
20+
years: "year(s)",
21+
day_of_month: "Day of month",
22+
day_of_week: "Day of week",
23+
cancel: "Cancel",
24+
ok: "OK",
25+
summary: "Summary",
26+
first_day_of_week: 0,
27+
days_first_letter: ["S", "M", "T", "W", "T", "F", "S" ],
28+
order: ["1st", "2nd", "3rd", "4th", "5th", "Last"],
29+
show_week: [true, true, true, true, false, false]
30+
}
31+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//= require recurring_select
2+
//= require_self
3+
4+
const $ = jQuery
5+
6+
$(function() {
7+
$(document).on("recurring_select:cancel recurring_select:save", ".recurring_select", function() {
8+
$(this).selectmenu('refresh');
9+
});
10+
11+
$(document).on("recurring_select:dialog_opened", ".rs_dialog_holder", function() {
12+
$(this).find("select").attr("data-theme", $('.recurring_select').data("theme")).attr("data-mini", true).selectmenu();
13+
$(this).find("input[type=text]").textinput();
14+
15+
$(this).on("recurring_select:dialog_positioned", ".rs_dialog", function() {
16+
$(this).css({
17+
"top" : $(window).scrollTop()+"px"});
18+
});
19+
});
20+
});

app/assets/javascripts/jquery-mobile-rs.js.coffee

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)