SrBuj 0.8.3 → 0.8.4
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 +8 -8
- data/lib/SrBuj/version.rb +1 -1
- data/lib/assets/javascripts/SrBuj.js +38 -30
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWMwNTZiODhjMGE2M2UyYTBmM2E5OTU0OTM2NGRjZGMyNDdhZGIyMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGM1YWEyODFiZWRjN2I5NDA1MGM0NzgxZWI4ZDgzYzA3YTM3ODU4Zg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzNkMzIwNmMyYzFmNmJjMmJjNzU2YjcyMjcwNjdhNjljODUzMWMzMTlmZTRh
|
10
|
+
ZTdkNDRjNzA2MzljYzE2ZGVkZDZhZDAzZWRjM2QzYWQxNWVlN2QzZTVkN2Jk
|
11
|
+
ZDUxYTA3MjFhNDZjYzNkNzc0YmYwNmFjOTliNjkzOTNmYjBkNDM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzlhYjJkMTdkZTQ1YTVlMjQ4NzJjYWUyMTI1MTllYzI1ZWExOWYzYzQ4ODY4
|
14
|
+
YmFhNDY2OTRiMGRjYzlkODNmNmRiMWQyYjJhOWY5MTFjMzM5MjBjMTA5MzNh
|
15
|
+
ZWQyMTAwN2Y3NzU3YjY5ZjI4ZDYxZjRkYWFjZmUyZmM5NDdjYmQ=
|
data/lib/SrBuj/version.rb
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
};
|
20
20
|
var SrBuj;
|
21
21
|
$.SrBuj = SrBuj = {
|
22
|
-
version: '0.8.
|
22
|
+
version: '0.8.4',
|
23
23
|
selector: '[data-remote][data-target]',
|
24
24
|
defaults: {
|
25
25
|
'$el': undefined,
|
@@ -120,51 +120,59 @@
|
|
120
120
|
}
|
121
121
|
return options;
|
122
122
|
},
|
123
|
-
success: function (e, data, status, user_options) {
|
123
|
+
success: function (e, data, status, xhr, user_options) {
|
124
|
+
if ( xhr && (/javascript/).test( xhr.getResponseHeader('Content-Type') ) ){
|
125
|
+
return true;
|
126
|
+
}else{
|
124
127
|
var options = $.SrBuj.getOptions(e.target, user_options),
|
125
128
|
$target = options.jqueryselector ? $(options.target).present() : $(document.getElementById(options.target)),
|
126
129
|
$wrapper = options.jqueryselector ? $(options.wrapper) : $(document.getElementById(options.wrapper));
|
127
130
|
if ($target.present()) {
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
}
|
133
|
-
if (options.modal) {
|
134
|
-
if (options.wrapper) {
|
135
|
-
$wrapper.modal('toggle');
|
136
|
-
} else {
|
137
|
-
$target.modal('toggle');
|
138
|
-
}
|
139
|
-
}
|
131
|
+
e.stopPropagation();
|
132
|
+
if (!options.custom) {
|
133
|
+
if (options.change) {
|
134
|
+
$.SrBuj.changeDom(options.method, $target, data);
|
140
135
|
}
|
141
|
-
if
|
142
|
-
|
136
|
+
if (options.modal) {
|
137
|
+
if (options.wrapper) {
|
138
|
+
$wrapper.modal('toggle');
|
139
|
+
} else {
|
140
|
+
$target.modal('toggle');
|
141
|
+
}
|
143
142
|
}
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
if (
|
151
|
-
|
143
|
+
}
|
144
|
+
if(options.url && options.push && $.SrBuj.needToChangeUrl(options.url) && $.SrBuj.browserSupportsPushState() ){
|
145
|
+
window.history.pushState({ SrBuj: true }, '', options.url)
|
146
|
+
}
|
147
|
+
if (options.callback) {
|
148
|
+
var callback = $.SrBuj.kindOfCallback(options.callback);
|
149
|
+
if (callback) {
|
150
|
+
callback.apply(this, [e, data, status]);
|
152
151
|
}
|
152
|
+
}
|
153
|
+
if (options.remove){
|
154
|
+
this.remove();
|
155
|
+
}
|
153
156
|
|
154
157
|
}
|
158
|
+
}
|
155
159
|
},
|
156
|
-
fail: function (e, data, status, user_options) {
|
160
|
+
fail: function (e, data, status, xhr, user_options) {
|
161
|
+
if ( xhr && (/javascript/).test( xhr.getResponseHeader('Content-Type') ) ){
|
162
|
+
return true;
|
163
|
+
}else{
|
157
164
|
e.stopPropagation();
|
158
165
|
var $el = $(e.target).present(),
|
159
|
-
|
160
|
-
|
161
|
-
|
166
|
+
error = $el.data('error'),
|
167
|
+
jqueryselector = $el.data('jqueryselector'),
|
168
|
+
$error = jqueryselector ? $(error) : $(document.getElementById(error));
|
162
169
|
if (error) {
|
163
|
-
|
170
|
+
$.SrBuj.changeDom('ERROR', $error, data.responseText);
|
164
171
|
} else {
|
165
|
-
|
172
|
+
throw 'cant find data-error on element ' + e.target + ' maybe content_type missing on response?';
|
166
173
|
}
|
167
174
|
|
175
|
+
}
|
168
176
|
},
|
169
177
|
bind: function (selector) {
|
170
178
|
selector = selector || this.selector;
|
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.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gagoar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|