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: b0307c0c664bd5a1edfba35ab4ec713f9fb74ec6
4
- data.tar.gz: daed41d9787cd6ef1a090998ccfb0b6282908c01
3
+ metadata.gz: 60ca4b88c9412aa2a5bb8bc310b7ed0b79bc4820
4
+ data.tar.gz: 4d6fa4ffe1aa49d39b7f8b62698e25c4601dc913
5
5
  SHA512:
6
- metadata.gz: 42b340da102be9cfeef40ff839727fa45b253089e937483ec7bea21226ceca5a0779c4964258c2de3550b255b934b789f6add7fb0da4e834ce94dffa0e69e9f7
7
- data.tar.gz: 7d6524d2ecb52409d15f8eabedc5096481ad18eb5156fdcd69212f666a7ca0b7f0ecf720c1fb1c5eb4d1e45c4497da4f818c5e5825f83f8b86315dfb0b96dbaf
6
+ metadata.gz: 26e6eb07e55cf17ef5a8b74042754c6a456df790aa2a6cf99f85338c1d6845c65f15037f7e17edb37b893f2698ed685ee93bb4a28429998250cf4ce7ceeddad9
7
+ data.tar.gz: d205d4c07174c8337d6a602231c411e4ce4bf8860903db71d88a12eb5bdbd1535609cd22b7396568350f34f6f56c5623c63f0f9108ea1c694b23c58e73430b11
@@ -1,3 +1,7 @@
1
+ # v0.2.0 / 2019-05-06
2
+
3
+ Upgrade to support turbolinks 5+.
4
+
1
5
  # v0.1.5 / 2016-05-07
2
6
 
3
7
  Specified show_flash types.
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Chen, Yi-Cyuan
3
+ Copyright (c) 2016-2019 Chen, Yi-Cyuan
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,15 +1,15 @@
1
1
  /*!
2
2
  * [flash-messenger]{@link https://github.com/emn178/flash-messenger}
3
3
  *
4
- * @version 0.1.1
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
- var div = $(setting.message.replace('{message}', htmlEncode(message)).replace('{type}', options.type)).appendTo(container);
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
- $(document).ready(resize).bind('ready page:load', function () {
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.1.1
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 {
@@ -1,3 +1,3 @@
1
1
  module FlashMessenger
2
- VERSION = "0.1.5"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.5
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: 2016-05-07 00:00:00.000000000 Z
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.5.1
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.