flash-messenger 0.1.5 → 0.2.0
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: 60ca4b88c9412aa2a5bb8bc310b7ed0b79bc4820
|
4
|
+
data.tar.gz: 4d6fa4ffe1aa49d39b7f8b62698e25c4601dc913
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26e6eb07e55cf17ef5a8b74042754c6a456df790aa2a6cf99f85338c1d6845c65f15037f7e17edb37b893f2698ed685ee93bb4a28429998250cf4ce7ceeddad9
|
7
|
+
data.tar.gz: d205d4c07174c8337d6a602231c411e4ce4bf8860903db71d88a12eb5bdbd1535609cd22b7396568350f34f6f56c5623c63f0f9108ea1c694b23c58e73430b11
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
/*!
|
2
2
|
* [flash-messenger]{@link https://github.com/emn178/flash-messenger}
|
3
3
|
*
|
4
|
-
* @version 0.
|
4
|
+
* @version 0.3.0
|
5
5
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
6
|
-
* @copyright Chen, Yi-Cyuan 2016
|
6
|
+
* @copyright Chen, Yi-Cyuan 2016-2019
|
7
7
|
* @license MIT
|
8
8
|
*/
|
9
9
|
(function ($) {
|
10
10
|
'use strict';
|
11
11
|
|
12
|
-
var OPTIONS = ['type', 'time', 'sticky', 'fadeOut', 'closable', 'scrollTo'];
|
12
|
+
var OPTIONS = ['type', 'time', 'sticky', 'fadeOut', 'closable', 'scrollTo', 'html'];
|
13
13
|
var TYPES = ['error', 'danger', 'info', 'notice', 'success', 'warning', 'alert'];
|
14
14
|
|
15
15
|
var setting = {
|
@@ -23,7 +23,8 @@
|
|
23
23
|
sticky: false,
|
24
24
|
fadeOut: 1000,
|
25
25
|
closable: true,
|
26
|
-
scrollTo: true
|
26
|
+
scrollTo: true,
|
27
|
+
html: false
|
27
28
|
},
|
28
29
|
typesDefault: {
|
29
30
|
error: {
|
@@ -57,7 +58,10 @@
|
|
57
58
|
function show(message, options) {
|
58
59
|
options = options || {};
|
59
60
|
formatOptions(options);
|
60
|
-
|
61
|
+
if (!options.html) {
|
62
|
+
message = htmlEncode(message);
|
63
|
+
}
|
64
|
+
var div = $(setting.message.replace('{message}', message).replace('{type}', options.type)).appendTo(container);
|
61
65
|
var close = function () {
|
62
66
|
div.remove();
|
63
67
|
};
|
@@ -100,7 +104,7 @@
|
|
100
104
|
|
101
105
|
$(window).resize(resize);
|
102
106
|
|
103
|
-
|
107
|
+
function load() {
|
104
108
|
if (!container) {
|
105
109
|
container = $(setting.container);
|
106
110
|
}
|
@@ -108,5 +112,7 @@
|
|
108
112
|
if (setting.window) {
|
109
113
|
window.flash = setting.window.flash;
|
110
114
|
}
|
111
|
-
}
|
115
|
+
}
|
116
|
+
|
117
|
+
$(document).ready(resize).ready(load).bind('page:load turbolinks:load', load);
|
112
118
|
})(jQuery);
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/*!
|
2
2
|
* [flash-messenger]{@link https://github.com/emn178/flash-messenger}
|
3
3
|
*
|
4
|
-
* @version 0.
|
4
|
+
* @version 0.3.0
|
5
5
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
6
|
-
* @copyright Chen, Yi-Cyuan 2016
|
6
|
+
* @copyright Chen, Yi-Cyuan 2016-2019
|
7
7
|
* @license MIT
|
8
8
|
*/
|
9
9
|
.flash-messages {
|
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.
|
4
|
+
version: 0.2.0
|
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:
|
11
|
+
date: 2019-05-06 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.
|
202
|
+
rubygems_version: 2.6.12
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Integrate with flash-messenger to provide a simple flash messages.
|