modalist 2.3.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -21
- data/README.md +216 -216
- data/app/helpers/modalist/modal_helper.rb +9 -9
- data/app/helpers/modalist/render_helper.rb +9 -9
- data/app/views/layouts/modalist.html.erb +19 -19
- data/app/views/mozaic/_modalist.html.erb +5 -5
- data/app/views/mozaic/modalist/_closer.html.erb +8 -8
- data/app/views/mozaic/modalist/_overlay.html.erb +5 -5
- data/app/views/mozaic/modalist/_wrapper.html.erb +5 -5
- data/lib/modalist/ajax.rb +9 -9
- data/lib/modalist/engine.rb +8 -6
- data/lib/modalist/railtie.rb +22 -22
- data/lib/modalist/version.rb +5 -5
- data/lib/modalist.rb +11 -11
- metadata +39 -26
- data/CHANGELOG.md +0 -57
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d15713483f772cfae5452bfca58529b5cf71244ca3de0696c648e4c809ed9e3
|
4
|
+
data.tar.gz: b23398977d53a7d710eb2136792833883d1f980b9415ed43924d0556332acf0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ef7cf58ffdedbbf028ce5c192658c1b480d441cb2cb8e1a24deb22467e8f34debc519de8ea60864feb667718776e6f3a357abde1c302cc314c2ae0231f1df07
|
7
|
+
data.tar.gz: f29ddc1133d47f176a809d8a9280866f73435d7914e41af915a4136a968056c7df29c6040216cf3e4d74c545b13a43d3670c3e0df52f17541883484238c1d597
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2018 Jonas Hübotter
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Jonas Hübotter
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,216 +1,216 @@
|
|
1
|
-
# Modalist
|
2
|
-
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/modalist.svg)](https://badge.fury.io/rb/modalist) <img src="https://travis-ci.org/jonhue/modalist.svg?branch=master" />
|
4
|
-
|
5
|
-
Modalist is a powerful & lightweight (not necessarily but primarily ajaxified) modal plugin. Here is how it works:
|
6
|
-
|
7
|
-
1) You create a distinct Modalist object for every modal style.
|
8
|
-
2) You trigger a modal from your frontend code passing custom parameters
|
9
|
-
3) Modalist fetches the modal contents with AJAX while showing a loader (skippable if not desired)
|
10
|
-
4) The modal opens
|
11
|
-
|
12
|
-
Learn more about **[Modalist.js](https://github.com/jonhue/modalist.js)**.
|
13
|
-
|
14
|
-
---
|
15
|
-
|
16
|
-
## Table of Contents
|
17
|
-
|
18
|
-
* [Installation](#installation)
|
19
|
-
* [Usage](#usage)
|
20
|
-
* [Controllers](#controllers)
|
21
|
-
* [Views](#views)
|
22
|
-
* [Styles](#styles)
|
23
|
-
* [Synchronous modals](#synchronous-modals)
|
24
|
-
* [Modalist.js](#modalistjs)
|
25
|
-
* [To Do](#to-do)
|
26
|
-
* [Contributing](#contributing)
|
27
|
-
* [Contributors](#contributors)
|
28
|
-
* [Semantic versioning](#semantic-versioning)
|
29
|
-
* [License](#license)
|
30
|
-
|
31
|
-
---
|
32
|
-
|
33
|
-
## Installation
|
34
|
-
|
35
|
-
Modalist works with Rails 5 onwards. You can add it to your `Gemfile` with:
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
gem 'modalist'
|
39
|
-
```
|
40
|
-
|
41
|
-
And then execute:
|
42
|
-
|
43
|
-
$ bundle
|
44
|
-
|
45
|
-
Or install it yourself as:
|
46
|
-
|
47
|
-
$ gem install modalist
|
48
|
-
|
49
|
-
If you always want to be up to date fetch the latest from GitHub in your `Gemfile`:
|
50
|
-
|
51
|
-
```ruby
|
52
|
-
gem 'modalist', github: 'jonhue/modalist'
|
53
|
-
```
|
54
|
-
|
55
|
-
## Usage
|
56
|
-
|
57
|
-
First let's import the necessary assets:
|
58
|
-
|
59
|
-
```javascript
|
60
|
-
import Modalist from 'modalist';
|
61
|
-
Modalist.init();
|
62
|
-
let modalist = new Modalist;
|
63
|
-
```
|
64
|
-
|
65
|
-
```sass
|
66
|
-
@import "animate.css"
|
67
|
-
@import "modalist/src/modalist"
|
68
|
-
@import "modalist/src/modalist-theme"
|
69
|
-
```
|
70
|
-
|
71
|
-
Specify where modals should be located in your view:
|
72
|
-
|
73
|
-
```haml
|
74
|
-
!!!
|
75
|
-
%html
|
76
|
-
%head
|
77
|
-
...
|
78
|
-
%body
|
79
|
-
= component 'modalist/overlay'
|
80
|
-
= component 'modalist/wrapper'
|
81
|
-
= yield
|
82
|
-
```
|
83
|
-
|
84
|
-
### Controllers
|
85
|
-
|
86
|
-
Modalist simulates Rails' MVC structure. To add a new modal to your app, you have to create a new controller action, route and view:
|
87
|
-
|
88
|
-
```ruby
|
89
|
-
class SettingsController < ApplicationController
|
90
|
-
|
91
|
-
def index
|
92
|
-
# a regular controller action
|
93
|
-
end
|
94
|
-
|
95
|
-
def modal
|
96
|
-
modalist
|
97
|
-
# a modalist controller action
|
98
|
-
end
|
99
|
-
|
100
|
-
end
|
101
|
-
```
|
102
|
-
|
103
|
-
```ruby
|
104
|
-
Rails.application.routes.draw do
|
105
|
-
|
106
|
-
get 'settings', to: 'settings#index'
|
107
|
-
scope :settings, as: :settings do
|
108
|
-
get 'modal', to: 'settings#modal'
|
109
|
-
end
|
110
|
-
|
111
|
-
end
|
112
|
-
```
|
113
|
-
|
114
|
-
In most cases you only want to allow AJAX requests to be able to reach your modal-controller-actions:
|
115
|
-
|
116
|
-
```ruby
|
117
|
-
get 'modal', to: 'settings#modal', constraints: Modalist::Ajax.new
|
118
|
-
```
|
119
|
-
|
120
|
-
### Views
|
121
|
-
|
122
|
-
In your Modalist view you are able to use the `'modalist'` component to customize the modal:
|
123
|
-
|
124
|
-
* `title` This will specify a title for your modal. If you omit this, your modal will not have a header. Takes a string.
|
125
|
-
* `subtitle` Add a subtitle to your modal header. Takes a string.
|
126
|
-
* `&block` Specify actions (preferably icons wrapped in links) which will be displayed on the right side of your modal header.
|
127
|
-
|
128
|
-
```haml
|
129
|
-
= component 'modalist', title: 'Modal', subtitle: 'Subtitle' do
|
130
|
-
= component 'modalist/closer'
|
131
|
-
|
132
|
-
Content ...
|
133
|
-
```
|
134
|
-
|
135
|
-
**Note:** The `'modalist/closer'` component renders a default modal close action.
|
136
|
-
|
137
|
-
### Styles
|
138
|
-
|
139
|
-
It is often useful to be able to provide view-specific styles. Modalist therefore adds classes for controller and action to the `.modalist--content-body` element which wraps your modals content. Here is how you can utilize it:
|
140
|
-
|
141
|
-
```css
|
142
|
-
/* settings#modal */
|
143
|
-
.modalist--content-body.settings.modal {
|
144
|
-
/* ... */
|
145
|
-
}
|
146
|
-
/* nested/settings#modal */
|
147
|
-
.modalist--content-body.nested.settings.modal {
|
148
|
-
/* ... */
|
149
|
-
}
|
150
|
-
```
|
151
|
-
|
152
|
-
### Synchronous modals
|
153
|
-
|
154
|
-
You can also setup synchronous modals wherever you like:
|
155
|
-
|
156
|
-
```haml
|
157
|
-
= component 'modalist/wrapper', id: 'signup' do
|
158
|
-
%h1 Signup
|
159
|
-
...
|
160
|
-
```
|
161
|
-
|
162
|
-
[Learn more](https://github.com/jonhue/modalist.js#synchronous) about handling synchronous modals with Modalist.js.
|
163
|
-
|
164
|
-
### Modalist.js
|
165
|
-
|
166
|
-
Continue reading [here](https://github.com/jonhue/modalist.js) to learn how to use Modalist.js to open modals and fetch content via AJAX.
|
167
|
-
|
168
|
-
---
|
169
|
-
|
170
|
-
## To Do
|
171
|
-
|
172
|
-
[Here](https://github.com/jonhue/modalist/projects/1) is the full list of current projects.
|
173
|
-
|
174
|
-
To propose your ideas, initiate the discussion by adding a [new issue](https://github.com/jonhue/modalist/issues/new).
|
175
|
-
|
176
|
-
---
|
177
|
-
|
178
|
-
## Contributing
|
179
|
-
|
180
|
-
We hope that you will consider contributing to Modalist. Please read this short overview for some information about how to get started:
|
181
|
-
|
182
|
-
[Learn more about contributing to this repository](CONTRIBUTING.md), [Code of Conduct](CODE_OF_CONDUCT.md)
|
183
|
-
|
184
|
-
### Contributors
|
185
|
-
|
186
|
-
Give the people some :heart: who are working on this project. See them all at:
|
187
|
-
|
188
|
-
https://github.com/jonhue/modalist/graphs/contributors
|
189
|
-
|
190
|
-
### Semantic Versioning
|
191
|
-
|
192
|
-
Modalist follows Semantic Versioning 2.0 as defined at http://semver.org.
|
193
|
-
|
194
|
-
## License
|
195
|
-
|
196
|
-
MIT License
|
197
|
-
|
198
|
-
Copyright (c) 2017 Jonas Hübotter
|
199
|
-
|
200
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
201
|
-
of this software and associated documentation files (the "Software"), to deal
|
202
|
-
in the Software without restriction, including without limitation the rights
|
203
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
204
|
-
copies of the Software, and to permit persons to whom the Software is
|
205
|
-
furnished to do so, subject to the following conditions:
|
206
|
-
|
207
|
-
The above copyright notice and this permission notice shall be included in all
|
208
|
-
copies or substantial portions of the Software.
|
209
|
-
|
210
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
211
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
212
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
213
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
214
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
215
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
216
|
-
SOFTWARE.
|
1
|
+
# Modalist
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/modalist.svg)](https://badge.fury.io/rb/modalist) <img src="https://travis-ci.org/jonhue/modalist.svg?branch=master" />
|
4
|
+
|
5
|
+
Modalist is a powerful & lightweight (not necessarily but primarily ajaxified) modal plugin. Here is how it works:
|
6
|
+
|
7
|
+
1) You create a distinct Modalist object for every modal style.
|
8
|
+
2) You trigger a modal from your frontend code passing custom parameters
|
9
|
+
3) Modalist fetches the modal contents with AJAX while showing a loader (skippable if not desired)
|
10
|
+
4) The modal opens
|
11
|
+
|
12
|
+
Learn more about **[Modalist.js](https://github.com/jonhue/modalist.js)**.
|
13
|
+
|
14
|
+
---
|
15
|
+
|
16
|
+
## Table of Contents
|
17
|
+
|
18
|
+
* [Installation](#installation)
|
19
|
+
* [Usage](#usage)
|
20
|
+
* [Controllers](#controllers)
|
21
|
+
* [Views](#views)
|
22
|
+
* [Styles](#styles)
|
23
|
+
* [Synchronous modals](#synchronous-modals)
|
24
|
+
* [Modalist.js](#modalistjs)
|
25
|
+
* [To Do](#to-do)
|
26
|
+
* [Contributing](#contributing)
|
27
|
+
* [Contributors](#contributors)
|
28
|
+
* [Semantic versioning](#semantic-versioning)
|
29
|
+
* [License](#license)
|
30
|
+
|
31
|
+
---
|
32
|
+
|
33
|
+
## Installation
|
34
|
+
|
35
|
+
Modalist works with Rails 5 onwards. You can add it to your `Gemfile` with:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
gem 'modalist'
|
39
|
+
```
|
40
|
+
|
41
|
+
And then execute:
|
42
|
+
|
43
|
+
$ bundle
|
44
|
+
|
45
|
+
Or install it yourself as:
|
46
|
+
|
47
|
+
$ gem install modalist
|
48
|
+
|
49
|
+
If you always want to be up to date fetch the latest from GitHub in your `Gemfile`:
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
gem 'modalist', github: 'jonhue/modalist'
|
53
|
+
```
|
54
|
+
|
55
|
+
## Usage
|
56
|
+
|
57
|
+
First let's import the necessary assets:
|
58
|
+
|
59
|
+
```javascript
|
60
|
+
import Modalist from 'modalist';
|
61
|
+
Modalist.init();
|
62
|
+
let modalist = new Modalist;
|
63
|
+
```
|
64
|
+
|
65
|
+
```sass
|
66
|
+
@import "animate.css"
|
67
|
+
@import "modalist/src/modalist"
|
68
|
+
@import "modalist/src/modalist-theme"
|
69
|
+
```
|
70
|
+
|
71
|
+
Specify where modals should be located in your view:
|
72
|
+
|
73
|
+
```haml
|
74
|
+
!!!
|
75
|
+
%html
|
76
|
+
%head
|
77
|
+
...
|
78
|
+
%body
|
79
|
+
= component 'modalist/overlay'
|
80
|
+
= component 'modalist/wrapper'
|
81
|
+
= yield
|
82
|
+
```
|
83
|
+
|
84
|
+
### Controllers
|
85
|
+
|
86
|
+
Modalist simulates Rails' MVC structure. To add a new modal to your app, you have to create a new controller action, route and view:
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
class SettingsController < ApplicationController
|
90
|
+
|
91
|
+
def index
|
92
|
+
# a regular controller action
|
93
|
+
end
|
94
|
+
|
95
|
+
def modal
|
96
|
+
modalist
|
97
|
+
# a modalist controller action
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
```
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
Rails.application.routes.draw do
|
105
|
+
|
106
|
+
get 'settings', to: 'settings#index'
|
107
|
+
scope :settings, as: :settings do
|
108
|
+
get 'modal', to: 'settings#modal'
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
```
|
113
|
+
|
114
|
+
In most cases you only want to allow AJAX requests to be able to reach your modal-controller-actions:
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
get 'modal', to: 'settings#modal', constraints: Modalist::Ajax.new
|
118
|
+
```
|
119
|
+
|
120
|
+
### Views
|
121
|
+
|
122
|
+
In your Modalist view you are able to use the `'modalist'` component to customize the modal:
|
123
|
+
|
124
|
+
* `title` This will specify a title for your modal. If you omit this, your modal will not have a header. Takes a string.
|
125
|
+
* `subtitle` Add a subtitle to your modal header. Takes a string.
|
126
|
+
* `&block` Specify actions (preferably icons wrapped in links) which will be displayed on the right side of your modal header.
|
127
|
+
|
128
|
+
```haml
|
129
|
+
= component 'modalist', title: 'Modal', subtitle: 'Subtitle' do
|
130
|
+
= component 'modalist/closer'
|
131
|
+
|
132
|
+
Content ...
|
133
|
+
```
|
134
|
+
|
135
|
+
**Note:** The `'modalist/closer'` component renders a default modal close action.
|
136
|
+
|
137
|
+
### Styles
|
138
|
+
|
139
|
+
It is often useful to be able to provide view-specific styles. Modalist therefore adds classes for controller and action to the `.modalist--content-body` element which wraps your modals content. Here is how you can utilize it:
|
140
|
+
|
141
|
+
```css
|
142
|
+
/* settings#modal */
|
143
|
+
.modalist--content-body.settings.modal {
|
144
|
+
/* ... */
|
145
|
+
}
|
146
|
+
/* nested/settings#modal */
|
147
|
+
.modalist--content-body.nested.settings.modal {
|
148
|
+
/* ... */
|
149
|
+
}
|
150
|
+
```
|
151
|
+
|
152
|
+
### Synchronous modals
|
153
|
+
|
154
|
+
You can also setup synchronous modals wherever you like:
|
155
|
+
|
156
|
+
```haml
|
157
|
+
= component 'modalist/wrapper', id: 'signup' do
|
158
|
+
%h1 Signup
|
159
|
+
...
|
160
|
+
```
|
161
|
+
|
162
|
+
[Learn more](https://github.com/jonhue/modalist.js#synchronous) about handling synchronous modals with Modalist.js.
|
163
|
+
|
164
|
+
### Modalist.js
|
165
|
+
|
166
|
+
Continue reading [here](https://github.com/jonhue/modalist.js) to learn how to use Modalist.js to open modals and fetch content via AJAX.
|
167
|
+
|
168
|
+
---
|
169
|
+
|
170
|
+
## To Do
|
171
|
+
|
172
|
+
[Here](https://github.com/jonhue/modalist/projects/1) is the full list of current projects.
|
173
|
+
|
174
|
+
To propose your ideas, initiate the discussion by adding a [new issue](https://github.com/jonhue/modalist/issues/new).
|
175
|
+
|
176
|
+
---
|
177
|
+
|
178
|
+
## Contributing
|
179
|
+
|
180
|
+
We hope that you will consider contributing to Modalist. Please read this short overview for some information about how to get started:
|
181
|
+
|
182
|
+
[Learn more about contributing to this repository](CONTRIBUTING.md), [Code of Conduct](CODE_OF_CONDUCT.md)
|
183
|
+
|
184
|
+
### Contributors
|
185
|
+
|
186
|
+
Give the people some :heart: who are working on this project. See them all at:
|
187
|
+
|
188
|
+
https://github.com/jonhue/modalist/graphs/contributors
|
189
|
+
|
190
|
+
### Semantic Versioning
|
191
|
+
|
192
|
+
Modalist follows Semantic Versioning 2.0 as defined at http://semver.org.
|
193
|
+
|
194
|
+
## License
|
195
|
+
|
196
|
+
MIT License
|
197
|
+
|
198
|
+
Copyright (c) 2017 Jonas Hübotter
|
199
|
+
|
200
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
201
|
+
of this software and associated documentation files (the "Software"), to deal
|
202
|
+
in the Software without restriction, including without limitation the rights
|
203
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
204
|
+
copies of the Software, and to permit persons to whom the Software is
|
205
|
+
furnished to do so, subject to the following conditions:
|
206
|
+
|
207
|
+
The above copyright notice and this permission notice shall be included in all
|
208
|
+
copies or substantial portions of the Software.
|
209
|
+
|
210
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
211
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
212
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
213
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
214
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
215
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
216
|
+
SOFTWARE.
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Modalist
|
4
|
+
module ModalHelper
|
5
|
+
def modalist_class_hierarchy(options = [], delimiter = ' ')
|
6
|
+
options.map(&:inspect).join(delimiter).delete('",[]', '')
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Modalist
|
4
|
+
module RenderHelper
|
5
|
+
def modalist
|
6
|
+
render layout: 'modalist'
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
<% if area(:modalist_title).length > 0 %>
|
2
|
-
<div class="modalist--content-header">
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
</div>
|
15
|
-
<% end %>
|
16
|
-
|
17
|
-
<div class="modalist--content-body <%= modalist_class_hierarchy [params[:controller].split('/').each { |n| n }, action_name] %>">
|
18
|
-
|
19
|
-
</div>
|
1
|
+
<% if area(:modalist_title).length > 0 %>
|
2
|
+
<div class="modalist--content-header">
|
3
|
+
<div class="wrapper">
|
4
|
+
<h4><%= area :modalist_title %></h4>
|
5
|
+
<% if area(:modalist_subtitle).length > 0 %>
|
6
|
+
<p>
|
7
|
+
<%= area :modalist_subtitle %>
|
8
|
+
</p>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
<div class="wrapper">
|
12
|
+
<%= area :modalist_actions %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<div class="modalist--content-body <%= modalist_class_hierarchy [params[:controller].split('/').each { |n| n }, action_name] %>">
|
18
|
+
<%= yield %>
|
19
|
+
</div>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% area :modalist_title, options[:title] %>
|
2
|
-
<% area :modalist_subtitle, options[:subtitle] %>
|
3
|
-
<% area :modalist_actions do %>
|
4
|
-
|
5
|
-
<% end %>
|
1
|
+
<% area :modalist_title, options[:title] %>
|
2
|
+
<% area :modalist_subtitle, options[:subtitle] %>
|
3
|
+
<% area :modalist_actions do %>
|
4
|
+
<%= block %>
|
5
|
+
<% end %>
|
@@ -1,8 +1,8 @@
|
|
1
|
-
<%= link_to 'javascript:void(0)', class: 'modalist--closer' do %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<% end %>
|
1
|
+
<%= link_to 'javascript:void(0)', class: 'modalist--closer' do %>
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24">
|
3
|
+
<g stroke-width="2" transform="translate(0, 0)">
|
4
|
+
<line fill="none" stroke="#657786" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" x1="16" y1="8" x2="8" y2="16" stroke-linejoin="miter"></line>
|
5
|
+
<line fill="none" stroke="#657786" stroke-width="2" stroke-linecap="square" stroke-miterlimit="10" x1="16" y1="16" x2="8" y2="8" stroke-linejoin="miter"></line>
|
6
|
+
</g>
|
7
|
+
</svg>
|
8
|
+
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<div
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
</div>
|
1
|
+
<div class="modalist--overlay">
|
2
|
+
<div class="modalist--loader">
|
3
|
+
<% if block %><%= block %><% else %><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24"><g transform="translate(0, 0)"><g class="nc-loop_bars-rotate-24" transform="rotate(270 12 12)"> <rect x="11" fill="#444444" width="2" height="6"></rect> <rect x="17.3639603" y="2.636039" transform="matrix(0.7071068 0.7071068 -0.7071068 0.7071068 9.3639612 -11.3345242)" fill="#444444" width="2" height="6" style="opacity: 0.4;"></rect> <rect x="18" y="11" fill="#444444" width="6" height="2" style="opacity: 0.4;"></rect> <rect x="17.3639603" y="15.3639612" transform="matrix(-0.7071068 0.7071068 -0.7071068 -0.7071068 44.3345222 18.3639603)" fill="#444444" width="2" height="6" style="opacity: 0.4;"></rect> <rect x="11" y="18" fill="#444444" width="2" height="6" style="opacity: 0.4;"></rect> <rect x="4.6360388" y="15.3639612" transform="matrix(-0.7071068 -0.7071068 0.7071068 -0.7071068 -3.363961 35.3345222)" fill="#444444" width="2" height="6" style="opacity: 0.4;"></rect> <rect x="0" y="11" fill="#444444" width="6" height="2" style="opacity: 0.5;"></rect> <rect x="4.6360388" y="2.636039" transform="matrix(0.7071068 -0.7071068 0.7071068 0.7071068 -2.3345237 5.6360388)" fill="#444444" width="2" height="6" style="opacity: 0.8;"></rect> </g> <script>!function(){function t(t){this.element=t,this.animationId,this.start=null,this.init()}if(!window.requestAnimationFrame){var i=null;window.requestAnimationFrame=function(t,n){var e=(new Date).getTime();i||(i=e);var a=Math.max(0,16-(e-i)),o=window.setTimeout(function(){t(e+a)},a);return i=e+a,o}}t.prototype.init=function(){var t=this;this.animationId=window.requestAnimationFrame(t.triggerAnimation.bind(t))},t.prototype.reset=function(){var t=this;window.cancelAnimationFrame(t.animationId)},t.prototype.triggerAnimation=function(t){var i=this;this.start||(this.start=t);var n=t-this.start;800>n||(this.start=this.start+800),this.element.setAttribute("transform","rotate("+parseInt(Math.min(n/100,8))%8*45+" 12 12)");if(document.documentElement.contains(this.element))window.requestAnimationFrame(i.triggerAnimation.bind(i))};var n=document.getElementsByClassName("nc-loop_bars-rotate-24"),e=[];if(n)for(var a=0;n.length>a;a++)!function(i){e.push(new t(n[i]))}(a);document.addEventListener("visibilitychange",function(){"hidden"==document.visibilityState?e.forEach(function(t){t.reset()}):e.forEach(function(t){t.init()})})}();</script></g></svg><% end %>
|
4
|
+
</div>
|
5
|
+
</div>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<div class="modalist <%= options[:class] %>" id="<%= options[:id] %>">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
</div>
|
1
|
+
<div class="modalist <%= options[:class] %>" id="<%= options[:id] %>">
|
2
|
+
<div class="modalist--content">
|
3
|
+
<%= block %>
|
4
|
+
</div>
|
5
|
+
</div>
|
data/lib/modalist/ajax.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Modalist
|
4
|
+
class Ajax
|
5
|
+
def matches?(request)
|
6
|
+
request.xhr?
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
data/lib/modalist/engine.rb
CHANGED
data/lib/modalist/railtie.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/railtie'
|
4
|
+
|
5
|
+
module Modalist
|
6
|
+
class Railtie < Rails::Railtie
|
7
|
+
initializer 'modalist.mozaic' do
|
8
|
+
Mozaic.configure do |config|
|
9
|
+
config.define_component 'modalist'
|
10
|
+
config.define_component 'modalist/overlay'
|
11
|
+
config.define_component 'modalist/wrapper'
|
12
|
+
config.define_component 'modalist/closer'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
initializer 'modalist.action_controller' do
|
17
|
+
ActiveSupport.on_load :action_controller do
|
18
|
+
include Modalist::RenderHelper
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/modalist/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Modalist
|
4
|
+
VERSION = '2.3.3'
|
5
|
+
end
|
data/lib/modalist.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'mozaic'
|
4
|
+
require 'modalist/version'
|
5
|
+
|
6
|
+
module Modalist
|
7
|
+
autoload :Ajax, 'modalist/ajax'
|
8
|
+
|
9
|
+
require 'modalist/engine'
|
10
|
+
require 'modalist/railtie'
|
11
|
+
end
|
metadata
CHANGED
@@ -1,85 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modalist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: actionpack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '5.
|
19
|
+
version: '5.2'
|
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: '5.
|
26
|
+
version: '5.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: mozaic
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.0'
|
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: '
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: railties
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2
|
47
|
+
version: '5.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '2
|
54
|
+
version: '5.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
96
|
+
version: '0'
|
83
97
|
description: Modalist is a powerful & lightweight (not necessarily but primarily ajaxified)
|
84
98
|
modal plugin.
|
85
99
|
email:
|
@@ -88,7 +102,6 @@ executables: []
|
|
88
102
|
extensions: []
|
89
103
|
extra_rdoc_files: []
|
90
104
|
files:
|
91
|
-
- CHANGELOG.md
|
92
105
|
- LICENSE
|
93
106
|
- README.md
|
94
107
|
- app/helpers/modalist/modal_helper.rb
|
@@ -103,7 +116,7 @@ files:
|
|
103
116
|
- lib/modalist/engine.rb
|
104
117
|
- lib/modalist/railtie.rb
|
105
118
|
- lib/modalist/version.rb
|
106
|
-
homepage: https://github.com/jonhue/modalist
|
119
|
+
homepage: https://github.com/jonhue/modalist-ruby
|
107
120
|
licenses:
|
108
121
|
- MIT
|
109
122
|
metadata: {}
|
@@ -123,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
136
|
version: '0'
|
124
137
|
requirements: []
|
125
138
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.7.
|
139
|
+
rubygems_version: 2.7.6
|
127
140
|
signing_key:
|
128
141
|
specification_version: 4
|
129
142
|
summary: A powerful & (really) lightweight ajaxified modal solution for Rails apps
|
data/CHANGELOG.md
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# Changelog
|
2
|
-
|
3
|
-
### master
|
4
|
-
|
5
|
-
* nothing yet
|
6
|
-
|
7
|
-
### 2.3.1 - 2018/03/06
|
8
|
-
|
9
|
-
* bugfixes
|
10
|
-
* remove loader of `modalist/wrapper` component
|
11
|
-
|
12
|
-
### 2.3.2 - 2018/03/28
|
13
|
-
|
14
|
-
* enhancements
|
15
|
-
* allow custom loaders to be passed as a block to the `modalist/overlay` component
|
16
|
-
|
17
|
-
### 2.3.0 - 2018/02/11
|
18
|
-
|
19
|
-
* features
|
20
|
-
* add `modalist/overlay` component
|
21
|
-
* enhancements
|
22
|
-
* add `id` option to `modalist/wrapper` component
|
23
|
-
|
24
|
-
### 2.2.0 - 2018/02/11
|
25
|
-
|
26
|
-
* features
|
27
|
-
* added support for synchronous modals
|
28
|
-
|
29
|
-
### 2.1.0 - 2018/02/09
|
30
|
-
|
31
|
-
* enhancements
|
32
|
-
* improved modalist view helpers
|
33
|
-
|
34
|
-
### 2.0.0 - 2018/02/09
|
35
|
-
|
36
|
-
* features
|
37
|
-
* updated Modalist.js to 2.0.0
|
38
|
-
|
39
|
-
### 1.0.3 - 2018/01/07
|
40
|
-
|
41
|
-
* bugfixes
|
42
|
-
* fixed assets included with gem
|
43
|
-
* updated Modalist.js to 1.0.3
|
44
|
-
|
45
|
-
### 1.0.2 - 2018/01/06
|
46
|
-
|
47
|
-
* bugfixes
|
48
|
-
* fixed error in `Modalist::ModalHelper` `modalist_class_hierarchy` helper method
|
49
|
-
|
50
|
-
### 1.0.1 - 2018/01/06
|
51
|
-
|
52
|
-
* bugfixes
|
53
|
-
* fixed Modalist::ModalHelper render methods
|
54
|
-
|
55
|
-
### 1.0.0 - 2018/01/06
|
56
|
-
|
57
|
-
* initial release
|