thin_man 0.20.2 → 0.20.3
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/app/assets/javascripts/thin_man.js +997 -965
- data/lib/thin_man/ajax_helper.rb +39 -7
- data/lib/thin_man/version.rb +1 -1
- metadata +2 -2
data/lib/thin_man/ajax_helper.rb
CHANGED
@@ -3,7 +3,7 @@ module ThinMan
|
|
3
3
|
def ajax_link(name, options, html_options, target,
|
4
4
|
sub_class: nil, insert_method: nil, empty_on_success: nil, remove_on_success: nil,
|
5
5
|
http_method: nil, no_mouse_click: nil, progress_target: nil,
|
6
|
-
mask_target: nil, mask_message: nil, replacement_path: nil,
|
6
|
+
mask_target: nil, mask_message: nil, replacement_path: nil, push_path: nil,
|
7
7
|
progress_color: nil, scroll_to: nil)
|
8
8
|
ajax_options = {
|
9
9
|
'data-ajax-link' => true,
|
@@ -21,6 +21,7 @@ module ThinMan
|
|
21
21
|
ajax_options.merge!('data-mask-message' => mask_message) if mask_message.present?
|
22
22
|
ajax_options.merge!('data-scroll-to' => scroll_to) if scroll_to.present?
|
23
23
|
ajax_options.merge!('data-replacement-path' => replacement_path) if replacement_path.present?
|
24
|
+
ajax_options.merge!('data-push-path' => push_path) if push_path.present?
|
24
25
|
link_to(name,
|
25
26
|
options,
|
26
27
|
html_options.merge(ajax_options))
|
@@ -30,7 +31,7 @@ module ThinMan
|
|
30
31
|
sub_class: nil, insert_method: nil, empty_on_success: nil, remove_on_success: nil,
|
31
32
|
http_method: nil, no_mouse_click: nil, progress_target: nil,
|
32
33
|
progress_color: nil, mask_target: nil, mask_message: nil,
|
33
|
-
sequence_group: nil, sequence_number: nil, replacement_path: nil,
|
34
|
+
sequence_group: nil, sequence_number: nil, replacement_path: nil, push_path: nil,
|
34
35
|
search_path: nil, search_params: nil)
|
35
36
|
ajax_options = {
|
36
37
|
'data-ajax-link-now' => true,
|
@@ -51,6 +52,7 @@ module ThinMan
|
|
51
52
|
ajax_options.merge!('data-search-path' => search_path) if search_path.present?
|
52
53
|
ajax_options.merge!('data-search-params' => search_params) if search_params.present?
|
53
54
|
ajax_options.merge!('data-replacement-path' => replacement_path) if replacement_path.present?
|
55
|
+
ajax_options.merge!('data-push-path' => push_path) if push_path.present?
|
54
56
|
|
55
57
|
a_tag = link_to(name,
|
56
58
|
options,
|
@@ -81,7 +83,7 @@ module ThinMan
|
|
81
83
|
def ajax_form_hash(target, sub_class: nil, insert_method: nil,
|
82
84
|
error_target: nil, empty_on_success: nil, reset_on_success: nil, remove_on_success: nil,
|
83
85
|
container: nil, custom_progress: nil, no_mouse_click: nil,
|
84
|
-
mask_target: nil, mask_message: nil, scroll_to: nil, replacement_path: nil,
|
86
|
+
mask_target: nil, mask_message: nil, scroll_to: nil, replacement_path: nil, push_path: nil,
|
85
87
|
progress_target: nil, progress_color: nil)
|
86
88
|
ajax_options = {
|
87
89
|
'data-ajax-form' => true,
|
@@ -102,6 +104,7 @@ module ThinMan
|
|
102
104
|
ajax_options.merge!('data-mask-message' => mask_message) if mask_message.present?
|
103
105
|
ajax_options.merge!('data-scroll-to' => scroll_to) if scroll_to.present?
|
104
106
|
ajax_options.merge!('data-replacement-path' => replacement_path) if replacement_path.present?
|
107
|
+
ajax_options.merge!('data-push-path' => push_path) if push_path.present?
|
105
108
|
ajax_options
|
106
109
|
end
|
107
110
|
|
@@ -109,7 +112,7 @@ module ThinMan
|
|
109
112
|
insert_method: nil, error_target: nil,
|
110
113
|
empty_on_success: nil, reset_on_success: nil, remove_on_success: nil,
|
111
114
|
container: nil, custom_progress: nil,
|
112
|
-
mask_target: nil, mask_message: nil, replacement_path: nil,
|
115
|
+
mask_target: nil, mask_message: nil, replacement_path: nil, push_path: nil,
|
113
116
|
progress_target: nil, progress_color: nil)
|
114
117
|
ajax_options = {
|
115
118
|
'data-ajax-form-now' => true,
|
@@ -128,13 +131,14 @@ module ThinMan
|
|
128
131
|
ajax_options.merge!('data-mask-target' => mask_target) if mask_target.present?
|
129
132
|
ajax_options.merge!('data-mask-message' => mask_message) if mask_message.present?
|
130
133
|
ajax_options.merge!('data-replacement-path' => replacement_path) if replacement_path.present?
|
134
|
+
ajax_options.merge!('data-push-path' => push_path) if push_path.present?
|
131
135
|
ajax_options
|
132
136
|
end
|
133
137
|
|
134
138
|
def ajax_form_attrs(target, sub_class: nil,
|
135
139
|
insert_method: nil, error_target: nil, remove_on_success: nil,
|
136
140
|
empty_on_success: nil, reset_on_success: nil, no_mouse_click: nil,
|
137
|
-
progress_target: nil, progress_color: nil, scroll_to: nil, replacement_path: nil,
|
141
|
+
progress_target: nil, progress_color: nil, scroll_to: nil, replacement_path: nil, push_path: nil,
|
138
142
|
mask_target: nil, mask_message: nil )
|
139
143
|
data_attrs = "data-ajax-form=true data-ajax-target=#{target}"
|
140
144
|
data_attrs += " data-insert-method=#{insert_method}" if insert_method
|
@@ -150,13 +154,14 @@ module ThinMan
|
|
150
154
|
data_attrs += " data-mask-message=#{mask_message}" if mask_message
|
151
155
|
data_attrs += " data-scroll-to=#{scroll_to}" if scroll_to
|
152
156
|
data_attrs += " data-replacement-path=#{replacement_path}" if replacement_path
|
157
|
+
data_attrs += " data-push-path=#{push_path}" if push_path
|
153
158
|
data_attrs
|
154
159
|
end
|
155
160
|
|
156
161
|
def ajax_form_now_attrs(target, sub_class: nil,
|
157
162
|
insert_method: nil, error_target: nil,
|
158
163
|
empty_on_success: nil, reset_on_success: nil, remove_on_success: nil,
|
159
|
-
progress_target: nil, progress_color: nil, replacement_path: nil,
|
164
|
+
progress_target: nil, progress_color: nil, replacement_path: nil, push_path: nil,
|
160
165
|
mask_target: nil, mask_message: nil )
|
161
166
|
data_attrs = "data-ajax-form-now=true data-ajax-target=#{target}"
|
162
167
|
data_attrs += " data-insert-method=#{insert_method}" if insert_method
|
@@ -170,13 +175,14 @@ module ThinMan
|
|
170
175
|
data_attrs += " data-mask-target=#{mask_target}" if mask_target
|
171
176
|
data_attrs += " data-mask-message=#{mask_message}" if mask_message
|
172
177
|
data_attrs += " data-replacement-path=#{replacement_path}" if replacement_path
|
178
|
+
data_attrs += " data-push-path=#{push_path}" if push_path
|
173
179
|
data_attrs
|
174
180
|
end
|
175
181
|
|
176
182
|
def ajax_link_attrs(target,
|
177
183
|
insert_method: nil, sub_type: nil, empty_on_success: nil, remove_on_success: nil,
|
178
184
|
http_method: nil, no_mouse_click: nil, progress_target: nil,
|
179
|
-
progress_color: nil, replacement_path: nil,
|
185
|
+
progress_color: nil, replacement_path: nil, push_path: nil,
|
180
186
|
mask_target: nil, mask_message: nil,
|
181
187
|
scroll_to: nil)
|
182
188
|
data_attrs = "data-ajax-link=true data-ajax-target=#{target}"
|
@@ -192,9 +198,35 @@ module ThinMan
|
|
192
198
|
data_attrs += " data-mask-target=#{mask_target}" if mask_target
|
193
199
|
data_attrs += " data-mask-message=#{mask_message}" if mask_message
|
194
200
|
data_attrs += " data-replacement-path=#{replacement_path}" if replacement_path
|
201
|
+
data_attrs += " data-push-path=#{push_path}" if push_path
|
195
202
|
data_attrs
|
196
203
|
end
|
197
204
|
|
205
|
+
def ajax_link_hash(target,
|
206
|
+
insert_method: nil, sub_type: nil, empty_on_success: nil, remove_on_success: nil,
|
207
|
+
http_method: nil, no_mouse_click: nil, progress_target: nil,
|
208
|
+
progress_color: nil, replacement_path: nil, push_path: nil,
|
209
|
+
mask_target: nil, mask_message: nil,
|
210
|
+
scroll_to: nil)
|
211
|
+
ajax_options = {
|
212
|
+
'data-ajax-link' => true,
|
213
|
+
'data-ajax-target' => target
|
214
|
+
}
|
215
|
+
ajax_options.merge!('data-insert-method' => insert_method) if insert_method.present?
|
216
|
+
ajax_options.merge!('data-ajax-method' => http_method) if http_method.present?
|
217
|
+
ajax_options.merge!('data-empty-on-success' => empty_on_success) if empty_on_success.present?
|
218
|
+
ajax_options.merge!('data-remove-on-success' => remove_on_success) if remove_on_success.present?
|
219
|
+
ajax_options.merge!('data-no-mouse-click' => no_mouse_click) if no_mouse_click.present?
|
220
|
+
ajax_options.merge!('data-progress-target' => progress_target) if progress_target.present?
|
221
|
+
ajax_options.merge!('data-progress-color' => progress_color) if progress_color.present?
|
222
|
+
ajax_options.merge!('data-mask-target' => mask_target) if mask_target.present?
|
223
|
+
ajax_options.merge!('data-mask-message' => mask_message) if mask_message.present?
|
224
|
+
ajax_options.merge!('data-scroll-to' => scroll_to) if scroll_to.present?
|
225
|
+
ajax_options.merge!('data-replacement-path' => replacement_path) if replacement_path.present?
|
226
|
+
ajax_options.merge!('data-push-path' => push_path) if push_path.present?
|
227
|
+
ajax_options
|
228
|
+
end
|
229
|
+
|
198
230
|
def dom_target(resource, label = nil)
|
199
231
|
'#' + dom_id(resource, label)
|
200
232
|
end
|
data/lib/thin_man/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thin_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut, Adam Bialek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|