thin_man 0.8.7 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/thin_man.js +6 -1
- data/lib/thin_man/ajax_helper.rb +14 -0
- data/lib/thin_man/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +5 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5296abc19548bc146b687a86cfd690bc20f537d3
|
4
|
+
data.tar.gz: 5286e6dc5d68995810594dbfc0d492f6b3007f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a2c37dc34568ab96a8df53f9286ee40e870ddc1dfd3f530b47e55a4183802ae85d4127f6ac7490c540c2eb437e8039542675c43779cc807deebc646e97fea27
|
7
|
+
data.tar.gz: b5933614977dc173fa1c69792ec01bf3132a907f914992b6c0cf1acf43f8be9ebbbf371bec742d604081921f6ec0660b908e1aaf69c53e780cb00583e1c390d2
|
@@ -467,7 +467,12 @@ var initThinMan = function(){
|
|
467
467
|
var this_class = eval('thin_man.' + thin_man.getSubClass($(this).data('sub-type'),'DeleteLink'));
|
468
468
|
var deletion = new this_class($(this));
|
469
469
|
});
|
470
|
-
|
470
|
+
$(document).ready(function(){
|
471
|
+
$('[data-ajax-link-now]').each(function(){
|
472
|
+
var this_class = eval('thin_man.' + thin_man.getSubClass($(this).data('sub-type'),'AjaxLinkSubmission'));
|
473
|
+
var submission = new this_class($(this));
|
474
|
+
})
|
475
|
+
})
|
471
476
|
$(document).on('click', '[data-change-url]',function(e){
|
472
477
|
e.preventDefault();
|
473
478
|
new thin_man.AjaxPushState($(this))
|
data/lib/thin_man/ajax_helper.rb
CHANGED
@@ -14,6 +14,20 @@ module ThinMan
|
|
14
14
|
html_options.merge(ajax_options))
|
15
15
|
end
|
16
16
|
|
17
|
+
def ajax_link_now(name, options, html_options, target, sub_class: nil, insert_method: nil, empty_on_success: nil, http_method: nil)
|
18
|
+
ajax_options = {
|
19
|
+
'data-ajax-link-now' => true,
|
20
|
+
'data-ajax-target' => target
|
21
|
+
}
|
22
|
+
ajax_options.merge!('data-sub-type' => sub_class) if sub_class.present?
|
23
|
+
ajax_options.merge!('data-insert-method' => insert_method) if insert_method.present?
|
24
|
+
ajax_options.merge!('data-ajax-method' => http_method) if http_method.present?
|
25
|
+
ajax_options.merge!('data-empty-on-success' => empty_on_success) if empty_on_success.present?
|
26
|
+
link_to(name,
|
27
|
+
options,
|
28
|
+
html_options.merge(ajax_options))
|
29
|
+
end
|
30
|
+
|
17
31
|
def ajax_delete(name, options, html_options, target, sub_class: nil)
|
18
32
|
ajax_options = {
|
19
33
|
'data-ajax-delete' => true,
|
data/lib/thin_man/version.rb
CHANGED
File without changes
|
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.
|
4
|
+
version: 0.9.0
|
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: 2015-06-
|
11
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -84,6 +84,8 @@ files:
|
|
84
84
|
- test/dummy/config/locales/en.yml
|
85
85
|
- test/dummy/config/routes.rb
|
86
86
|
- test/dummy/config/secrets.yml
|
87
|
+
- test/dummy/db/test.sqlite3
|
88
|
+
- test/dummy/log/test.log
|
87
89
|
- test/dummy/public/404.html
|
88
90
|
- test/dummy/public/422.html
|
89
91
|
- test/dummy/public/500.html
|
@@ -143,6 +145,8 @@ test_files:
|
|
143
145
|
- test/dummy/config/routes.rb
|
144
146
|
- test/dummy/config/secrets.yml
|
145
147
|
- test/dummy/config.ru
|
148
|
+
- test/dummy/db/test.sqlite3
|
149
|
+
- test/dummy/log/test.log
|
146
150
|
- test/dummy/public/404.html
|
147
151
|
- test/dummy/public/422.html
|
148
152
|
- test/dummy/public/500.html
|