SrBuj 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/lib/SrBuj/version.rb +1 -1
- data/lib/assets/javascripts/SrBuj.js +13 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWNjYjYwMjIxNzIzMDk5Y2I2NWU3ZDBkN2RmYjdkM2IyZmYwYWZiNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWY2YWYxMTQxN2YyYWNhODY0NWEzMThlN2ZkZmM5NGM5ZWY2YjM1NA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWI2NWRlMTJmNWFmZGRiZTIxMWJmNjNmYWVjY2Y1NzJmNGViYWRhYTYyZTE3
|
10
|
+
ZTQxNjhkYjdkZDk4ZDNlNGI3MDQ3ODk3OTg2MDhhZjllOTlmZDUxNzc5MWRm
|
11
|
+
MTM1NjljMjRkN2IzNjM1NGNhMTdkZTgzMzhmZTc0OWQxYjQwMjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTVlMWY1YWMzODM4YTA4NzllZGU1MWVlNjA1OTM5Njg1M2VmY2FhNmEwMmY2
|
14
|
+
MmZlYjFmMzBjN2NiYTQ2ZmQwMjgyOTMyMjQ5MDI0YjM5ZGRlMmQ2ODJmNjBj
|
15
|
+
NGMzZWZlYTk3NzM2NzJmMTBkOTUxOTNkNDJkNWMwMGIxOThmNzE=
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
SrBuj
|
2
2
|
=
|
3
3
|
|
4
|
-
Better Unobtrusive JavaScript
|
4
|
+
Better Unobtrusive JavaScript Respond (for Rails and jquery_ujs, twitter/bootstrap modal.js)
|
5
5
|
|
6
6
|
SrBuj comes to cure a common illness in a life of every Rails developer (maybe other kind too):
|
7
7
|
- write the same code to rise up a modal
|
data/lib/SrBuj/version.rb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
};
|
14
14
|
var SrBuj;
|
15
15
|
$.SrBuj = SrBuj = {
|
16
|
-
version: '0.6.
|
16
|
+
version: '0.6.1',
|
17
17
|
selector: '[data-remote][data-target]',
|
18
18
|
defaults: {
|
19
19
|
'$el': undefined,
|
@@ -46,6 +46,13 @@
|
|
46
46
|
}
|
47
47
|
|
48
48
|
},
|
49
|
+
kindOfCallback: function(callback){
|
50
|
+
if(typeof callback == 'function'){
|
51
|
+
return callback
|
52
|
+
}else{
|
53
|
+
return window[callback] || new Function(callback);
|
54
|
+
}
|
55
|
+
},
|
49
56
|
getVerb: function($el){
|
50
57
|
var respond_as = $el.data('respond-as'),
|
51
58
|
dataVerb = $el.data('method'),
|
@@ -94,11 +101,13 @@
|
|
94
101
|
if(options['modal'])
|
95
102
|
options['wrapper'] ? $wrapper.modal('toggle') : $target.modal('toggle');
|
96
103
|
}
|
97
|
-
if(options['callback'])
|
98
|
-
callback = (
|
99
|
-
|
104
|
+
if(options['callback']){
|
105
|
+
callback = $.SrBuj.kindOfCallback(options['callback']);
|
106
|
+
if(callback) callback.apply(this,[e, data, status]);
|
107
|
+
}
|
100
108
|
}
|
101
109
|
},
|
110
|
+
|
102
111
|
fail: function(e, data, status, user_options){
|
103
112
|
e.stopPropagation();
|
104
113
|
var $el = $(e.target).present(),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: SrBuj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gagoar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description: Better Unobtrusive JavaScript
|
69
|
+
description: Better Unobtrusive JavaScript Respond
|
70
70
|
email:
|
71
71
|
- xeroice@gmail.com
|
72
72
|
executables: []
|