rails-timeago 2.18.0 → 2.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -19
- data/CHANGELOG.md +6 -1
- data/Gemfile +1 -0
- data/README.md +12 -13
- data/Rakefile +1 -1
- data/lib/assets/javascripts/rails-timeago-all.js +2 -0
- data/lib/assets/javascripts/rails-timeago.js +1 -1
- data/lib/rails-timeago/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.timeago.js +1 -1
- data/vendor/assets/javascripts/locales/jquery.timeago.eo.js +30 -0
- data/vendor/assets/javascripts/locales/jquery.timeago.fa-short.js +1 -1
- data/vendor/assets/javascripts/locales/jquery.timeago.ka.js +30 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5653983cf12f0fdc7e6a9652e32a0b416c7df3467e10c94e7cffb4a89d7bd46b
|
4
|
+
data.tar.gz: 48da15e4a1f7b9d6a9ddbc05574927d560f92eea17b9e578139f9ed17c142f59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9240a67ff85cf0d11264efcfed29846f988a164a45fca5a576e52d94eba0a6d67fe1ce6c63b0bd1d9ea42d856818573036ccfb6fdca0e0bb5c8ed63aaf35e1d5
|
7
|
+
data.tar.gz: 7103a15660b81043bdd7a1e1b0aeda93c94ae5c43098b3376794dd86dea26ec96aaf9201091b15d662baa394eee792e4a0ad29f37c7134acdf9f882809d8dfb7
|
data/.travis.yml
CHANGED
@@ -1,22 +1,9 @@
|
|
1
|
+
---
|
1
2
|
dist: xenial
|
2
3
|
language: ruby
|
3
4
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
|
9
|
-
- gem install bundler
|
10
|
-
jobs:
|
11
|
-
include:
|
12
|
-
- stage: Release
|
13
|
-
script: skip
|
14
|
-
install: skip
|
15
|
-
deploy:
|
16
|
-
provider: rubygems
|
17
|
-
api_key:
|
18
|
-
secure: XYbT9MB6DNzKu95OqrA5qIV2rD1L6RLpfCb9s/3YnhKY8tTP1NcitvmXLHtNLAoHldYrb9AmSfNh5wFgFnfoqFkpz4B94SBrkQtGZ9wzIj4otxMgntGsrGd6qLBfnXGG8rctngeJlo0eVKkE/3fJtiXb5mEx72fvxd2+/fYfubY=
|
19
|
-
gem: rails-timeago
|
20
|
-
on:
|
21
|
-
tags: true
|
22
|
-
repo: jgraichen/rails-timeago
|
5
|
+
- 2.7.1
|
6
|
+
- 2.6.6
|
7
|
+
- 2.5.8
|
8
|
+
- 2.4.10
|
9
|
+
- 2.3.8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.19.0
|
4
|
+
|
5
|
+
* Update jquery-timeago and locales from upstream
|
6
|
+
* Reinitialize on ajaxSuccess event too (#34)
|
7
|
+
|
3
8
|
## 2.18.0
|
4
9
|
|
5
10
|
* Update jquery-timeago and locales from upstream
|
@@ -19,7 +24,7 @@
|
|
19
24
|
## 2.15.0
|
20
25
|
|
21
26
|
* Update jquery-timeago and locales from upstream
|
22
|
-
* Remove an use of
|
27
|
+
* Remove an use of deprecated "ready" event (compatible with jQuery 3.0) (#40)
|
23
28
|
|
24
29
|
## 2.14.0
|
25
30
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# rails-timeago
|
2
2
|
|
3
|
-
[![Gem Version](https://
|
4
|
-
[![Build Status](https://
|
5
|
-
[![Code Climate](https://codeclimate.com/github/jgraichen/rails-timeago.svg)](https://codeclimate.com/github/jgraichen/rails-timeago)
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/rails-timeago?logo=ruby)](https://rubygems.org/gems/rails-timeago)
|
4
|
+
[![Build Status](https://img.shields.io/travis/jgraichen/rails-timeago/master?logo=travis)](https://travis-ci.org/jgraichen/rails-timeago)
|
6
5
|
|
7
6
|
**rails-timeago** provides a timeago_tag helper to create time tags usable for
|
8
7
|
[jQuery Timeago](https://github.com/rmm5t/jquery-timeago) plugin.
|
@@ -33,21 +32,23 @@ Use the following to also include all available locale files:
|
|
33
32
|
|
34
33
|
//= require rails-timeago-all
|
35
34
|
|
35
|
+
If using a recent Rails with `rails-ujs`, jQuery might not be present anymore. You need to add `jquery-rails` to your `Gemfile` and load it, e.g.:
|
36
|
+
|
37
|
+
//= require jquery
|
38
|
+
//= require rails-timeago
|
39
|
+
//= require rails-timeago-all
|
40
|
+
|
36
41
|
## Usage
|
37
42
|
|
38
43
|
Use the timeago_tag helper like any other regular tag helper:
|
39
44
|
|
40
45
|
```erb
|
41
|
-
<%= timeago_tag Time.zone.now
|
46
|
+
<%= timeago_tag Time.zone.now limit: 10.days.ago %>
|
42
47
|
```
|
43
48
|
|
44
49
|
|
45
50
|
### Available options:
|
46
51
|
|
47
|
-
**nojs**
|
48
|
-
Add time ago in words as time tag content instead of absolute time.
|
49
|
-
(default: `false`)
|
50
|
-
|
51
52
|
**date_only**
|
52
53
|
Only print date as tag content instead of full time.
|
53
54
|
(default: `true`)
|
@@ -70,13 +71,13 @@ String that will be returned if time is `nil`.
|
|
70
71
|
|
71
72
|
**title**
|
72
73
|
A string or block that will be used to create a title attribute for timeago tags. It set to nil or false no title attribute will be set.
|
73
|
-
(default: `proc { |time, options| I18n.l time, :
|
74
|
+
(default: `proc { |time, options| I18n.l time, format: options[:format] }`)
|
74
75
|
|
75
76
|
All other options will be given as options to the time tag helper.
|
76
77
|
The above options can be assigned globally as defaults using
|
77
78
|
|
78
79
|
```ruby
|
79
|
-
Rails::Timeago.default_options :
|
80
|
+
Rails::Timeago.default_options limit: proc { 20.days.ago }
|
80
81
|
```
|
81
82
|
|
82
83
|
A global limit should always be given as a block that will be evaluated each time the rails `timeago_tag` helper is called. That avoids the limit becoming smaller the longer the application runs.
|
@@ -86,7 +87,7 @@ A global limit should always be given as a block that will be evaluated each tim
|
|
86
87
|
**rails-timeago 2** ships with a modified version of jQuery timeago that allows to include all locale files at once and set the locale via an option or per element via the `lang` attribute:
|
87
88
|
|
88
89
|
```erb
|
89
|
-
<%= timeago_tag Time.zone.now, :
|
90
|
+
<%= timeago_tag Time.zone.now, lang: :de %>
|
90
91
|
```
|
91
92
|
|
92
93
|
The following snippet will print a script tag that set the jQuery timeago locale according to your `I18n.locale`:
|
@@ -112,8 +113,6 @@ Do not forget to require the needed locale files by either require `rails-timeag
|
|
112
113
|
|
113
114
|
**rails-timeago** includes locale files for the following locales taken from [jQuery Timeago](https://github.com/rmm5t/jquery-timeago).
|
114
115
|
|
115
|
-
> de cy pl mk zh-CN bs en-short it fi es uk lt zh-TW sk hy ca pt el sv ar no fa fr pt-br tr he bg ko uz cz sl hu id hr ru nl fr-short da ja ro th
|
116
|
-
|
117
116
|
Your customized jQuery locale files must be changed to work with **rails-timeago 2**. Instead of defining your locale strings as `jQuery.timeago.settings.strings` you need to define them like this:
|
118
117
|
|
119
118
|
```js
|
data/Rakefile
CHANGED
@@ -17,6 +17,7 @@
|
|
17
17
|
//= require locales/jquery.timeago.dv.js
|
18
18
|
//= require locales/jquery.timeago.el.js
|
19
19
|
//= require locales/jquery.timeago.en-short.js
|
20
|
+
//= require locales/jquery.timeago.eo.js
|
20
21
|
//= require locales/jquery.timeago.es-short.js
|
21
22
|
//= require locales/jquery.timeago.es.js
|
22
23
|
//= require locales/jquery.timeago.et.js
|
@@ -37,6 +38,7 @@
|
|
37
38
|
//= require locales/jquery.timeago.it.js
|
38
39
|
//= require locales/jquery.timeago.ja.js
|
39
40
|
//= require locales/jquery.timeago.jv.js
|
41
|
+
//= require locales/jquery.timeago.ka.js
|
40
42
|
//= require locales/jquery.timeago.ko.js
|
41
43
|
//= require locales/jquery.timeago.ky.js
|
42
44
|
//= require locales/jquery.timeago.lt.js
|
@@ -0,0 +1,30 @@
|
|
1
|
+
(function (factory) {
|
2
|
+
if (typeof define === 'function' && define.amd) {
|
3
|
+
define(['jquery'], factory);
|
4
|
+
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
5
|
+
factory(require('jquery'));
|
6
|
+
} else {
|
7
|
+
factory(jQuery);
|
8
|
+
}
|
9
|
+
}(function (jQuery) {
|
10
|
+
// English (Template) -> Esperanto
|
11
|
+
jQuery.timeago.settings.strings["eo"] = {
|
12
|
+
prefixAgo: "antaŭ",
|
13
|
+
prefixFromNow: null,
|
14
|
+
suffixAgo: null,
|
15
|
+
suffixFromNow: "de nun",
|
16
|
+
seconds: "malpli ol minuto",
|
17
|
+
minute: "ĉirkaŭ uno minuto",
|
18
|
+
minutes: "%d minutoj",
|
19
|
+
hour: "ĉirkaŭ uno horo",
|
20
|
+
hours: "ĉirkaŭ %d horojn",
|
21
|
+
day: "ĉirkaŭ tago",
|
22
|
+
days: "%d tagoj",
|
23
|
+
month: "ĉirkaŭ unu monato",
|
24
|
+
months: "%d monatoj",
|
25
|
+
year: "ĉirkaŭ unu jaro",
|
26
|
+
years: "%d jaroj",
|
27
|
+
wordSeparator: " ",
|
28
|
+
numbers: []
|
29
|
+
};
|
30
|
+
}));
|
@@ -0,0 +1,30 @@
|
|
1
|
+
(function (factory) {
|
2
|
+
if (typeof define === 'function' && define.amd) {
|
3
|
+
define(['jquery'], factory);
|
4
|
+
} else if (typeof module === 'object' && typeof module.exports === 'object') {
|
5
|
+
factory(require('jquery'));
|
6
|
+
} else {
|
7
|
+
factory(jQuery);
|
8
|
+
}
|
9
|
+
}(function (jQuery) {
|
10
|
+
// English (Template)
|
11
|
+
jQuery.timeago.settings.strings["ka"] = {
|
12
|
+
prefixAgo: null,
|
13
|
+
prefixFromNow: null,
|
14
|
+
suffixAgo: "ის წინ",
|
15
|
+
suffixFromNow: null,
|
16
|
+
seconds: "რამდენიმე წამ",
|
17
|
+
minute: "1 წუთ",
|
18
|
+
minutes: "%d წუთ",
|
19
|
+
hour: "1 საათ",
|
20
|
+
hours: "%d საათ",
|
21
|
+
day: "1 დღ",
|
22
|
+
days: "%d დღ",
|
23
|
+
month: "1 თვ",
|
24
|
+
months: "%d თვ",
|
25
|
+
year: "1 წლ",
|
26
|
+
years: "%d წლ",
|
27
|
+
wordSeparator: "",
|
28
|
+
};
|
29
|
+
})
|
30
|
+
);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-timeago
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- vendor/assets/javascripts/locales/jquery.timeago.dv.js
|
83
83
|
- vendor/assets/javascripts/locales/jquery.timeago.el.js
|
84
84
|
- vendor/assets/javascripts/locales/jquery.timeago.en-short.js
|
85
|
+
- vendor/assets/javascripts/locales/jquery.timeago.eo.js
|
85
86
|
- vendor/assets/javascripts/locales/jquery.timeago.es-short.js
|
86
87
|
- vendor/assets/javascripts/locales/jquery.timeago.es.js
|
87
88
|
- vendor/assets/javascripts/locales/jquery.timeago.et.js
|
@@ -102,6 +103,7 @@ files:
|
|
102
103
|
- vendor/assets/javascripts/locales/jquery.timeago.it.js
|
103
104
|
- vendor/assets/javascripts/locales/jquery.timeago.ja.js
|
104
105
|
- vendor/assets/javascripts/locales/jquery.timeago.jv.js
|
106
|
+
- vendor/assets/javascripts/locales/jquery.timeago.ka.js
|
105
107
|
- vendor/assets/javascripts/locales/jquery.timeago.ko.js
|
106
108
|
- vendor/assets/javascripts/locales/jquery.timeago.ky.js
|
107
109
|
- vendor/assets/javascripts/locales/jquery.timeago.lt.js
|
@@ -152,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
154
|
- !ruby/object:Gem::Version
|
153
155
|
version: '0'
|
154
156
|
requirements: []
|
155
|
-
rubygems_version: 3.
|
157
|
+
rubygems_version: 3.1.2
|
156
158
|
signing_key:
|
157
159
|
specification_version: 4
|
158
160
|
summary: A Rails Helper to create time tags usable for jQuery Timeago plugin
|