flash-messenger 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3322aa3844977effb648a83b8d05757580efe8d3
|
4
|
+
data.tar.gz: c7628d4fcbff0884934fc16056a74cd04e420957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db99bdafc581f45428098ec2e1bb782bbaa985662bd748f9d4d221fd0e3bb82a5c8d45044d78d693c43ce78b0f3a29a0195471c1b53c68d7052d6d3964a03967
|
7
|
+
data.tar.gz: a0fc2f4cf57d123f12466b9fa6dda19ab910cfe7c66dd442cad62d7fff5838bfb8382e2157c77637f94fc62aff0ab4009bb4803275c007e0521e278bd54eb5da
|
@@ -2,17 +2,28 @@
|
|
2
2
|
(function ($) {
|
3
3
|
'use strict';
|
4
4
|
|
5
|
+
function showErrors(errors) {
|
6
|
+
errors.forEach(function (error) {
|
7
|
+
flash.error(error);
|
8
|
+
});
|
9
|
+
}
|
10
|
+
|
5
11
|
$(document).on('turboboost:error', function (e, errors) {
|
12
|
+
var json;
|
6
13
|
try {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
+
json = JSON.parse(errors);
|
15
|
+
} catch (e2) {
|
16
|
+
}
|
17
|
+
if ($.isArray(json)) {
|
18
|
+
showErrors(json);
|
19
|
+
} else if (typeof json == 'object') {
|
20
|
+
if ($.isArray(json.error)) {
|
21
|
+
showErrors(json.error);
|
22
|
+
} else {
|
23
|
+
flash.error(errors);
|
14
24
|
}
|
15
|
-
}
|
25
|
+
} else if (typeof json === 'string') {
|
26
|
+
flash.error(errors);
|
16
27
|
}
|
17
28
|
});
|
18
29
|
})(jQuery);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flash-messenger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chen, Yi-Cyuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: request_store
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
version: '0'
|
200
200
|
requirements: []
|
201
201
|
rubyforge_project:
|
202
|
-
rubygems_version: 2.6.
|
202
|
+
rubygems_version: 2.6.14
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Integrate with flash-messenger to provide a simple flash messages.
|