rails-timeago-2.11.1/ 0000755 0000764 0000764 00000000000 12412436741 013371 5 ustar pravi pravi rails-timeago-2.11.1/spec/ 0000755 0000764 0000764 00000000000 12412436741 014323 5 ustar pravi pravi rails-timeago-2.11.1/spec/spec_helper.rb 0000644 0000764 0000764 00000000452 12412436741 017142 0 ustar pravi pravi require 'active_support'
require 'active_support/core_ext'
require File.dirname(__FILE__) + '/../lib/rails-timeago.rb'
require File.dirname(__FILE__) + '/support/stub.rb'
RSpec.configure do |config|
config.mock_with :rspec
end
# Use UTC timezone for the duration of the tests
Time.zone = 'UTC'
rails-timeago-2.11.1/spec/support/ 0000755 0000764 0000764 00000000000 12412436741 016037 5 ustar pravi pravi rails-timeago-2.11.1/spec/support/stub.rb 0000644 0000764 0000764 00000000652 12412436741 017344 0 ustar pravi pravi class TimeagoStub
include Rails::Timeago::Helper
I18n.backend.store_translations :en, :hello => 'World'
def time_tag(time, content, options = {})
options = options.map { |k,v| "#{k}=\"#{v}\""}
""
end
def time_ago_in_words(time)
"%time_ago_in_words%"
end
def javascript_tag(source)
""
end
end
rails-timeago-2.11.1/spec/timeago/ 0000755 0000764 0000764 00000000000 12412436741 015750 5 ustar pravi pravi rails-timeago-2.11.1/spec/timeago/helper_spec.rb 0000644 0000764 0000764 00000014461 12412436741 020574 0 ustar pravi pravi
require File.dirname(__FILE__) + '/../spec_helper'
describe Rails::Timeago::Helper do
before { @stub = TimeagoStub.new }
after { Rails::Timeago.reset_default_options }
let(:time) { Time.now }
context "#timeago_tag" do
it 'should create a time tag' do
@stub.timeago_tag(time).should =~ /.*<\/time>/
end
it 'should have title attribute' do
@stub.timeago_tag(time).should =~ /.*<\/time>/
end
it 'should have human readable datetime as title attribute' do
@stub.timeago_tag(time).should include("title=\"#{I18n.l time}\"")
end
it 'should have human readable datetime as title attribute with given format' do
@stub.timeago_tag(time, :format => :short).should include("title=\"#{I18n.l time, :format => :short}\"")
end
it 'should have human readable datetime as title attribute with given format' do
@stub.timeago_tag(time, :format => proc { |time, options| :long }).should include("title=\"#{I18n.l time, :format => :long}\"")
end
it 'should have human readable datetime as title attribute with global format' do
Rails::Timeago.default_options :format => :short
@stub.timeago_tag(time).should include("title=\"#{I18n.l time, :format => :short}\"")
end
it 'should have no title attribute if title is set to false globally' do
Rails::Timeago.default_options :title => false
@stub.timeago_tag(time).should_not =~ /.*<\/time>/
end
it 'should have no title attribute if title is set to nil globally' do
Rails::Timeago.default_options :title => nil
@stub.timeago_tag(time).should_not =~ /.*<\/time>/
end
it 'should have title attribute with proc value globally' do
Rails::Timeago.default_options :title => proc { |time, options| options[:format] }
@stub.timeago_tag(time, :format => :short).should =~ /.*<\/time>/
end
it 'should have title attribute with proc value locally' do
@stub.timeago_tag(time, :format => :long,
:title => proc { |time, options| options[:format] }).should =~ /.*<\/time>/
end
it 'should have format attribute with proc value locally' do
@stub.timeago_tag(time,
:format => proc { |time, options| :long }).should include(">#{I18n.l time.to_date, :format => :long}<")
end
it 'should have data-time-ago attribute' do
@stub.timeago_tag(time).should =~ /.*<\/time>/
end
it 'should not have data-time-ago attribute for times before limit' do
@stub.timeago_tag(5.days.ago).should_not =~ /.*<\/time>/
end
it 'should have data-time-ago attribute for times after given limit' do
@stub.timeago_tag(5.days.ago, :limit => 6.days.ago).
should =~ /.*<\/time>/
end
it 'should have not data-time-ago attribute for times before given limit' do
@stub.timeago_tag(6.days.ago, :limit => 5.days.ago).
should_not =~ /.*<\/time>/
end
it 'should have data-time-ago attribute for times before given limit if limit is in the future' do
@stub.timeago_tag(5.days.from_now, :limit => 6.days.from_now).
should =~ /.*<\/time>/
end
it 'should have not data-time-ago attribute for times in the past if limit is in the future' do
@stub.timeago_tag(1.days.ago, :limit => 5.days.from_now).
should_not =~ /.*<\/time>/
end
it 'should have not data-time-ago attribute for times after given limit if limit is in the future' do
@stub.timeago_tag(6.days.from_now, :limit => 5.days.from_now).
should_not =~ /.*<\/time>/
end
it 'should have data-time-ago attribute for times before limit if forced' do
@stub.timeago_tag(6.days.ago, :force => true).
should =~ /.*<\/time>/
end
it 'should have localized date as content' do
time = 3.days.ago
@stub.timeago_tag(time).should include(">#{I18n.l time.to_date}<")
end
it 'should have localized time as content if date_only is false' do
time = 3.days.ago
@stub.timeago_tag(time, :date_only => false).should include(">#{I18n.l time}<")
end
it 'should have time ago in words as content if nojs is true' do
time = 3.days.ago
@stub.timeago_tag(time, :nojs => true).should =~ /%time_ago_in_words%<\/time>/
end
it 'should pass format option to localize method' do
time = 3.days.ago
@stub.timeago_tag(time, :format => :short).
should include(">#{I18n.l time.to_date, :format => :short}<")
end
it 'should pass html option to tag helper' do
@stub.timeago_tag(time, :myattr => 'abc').should =~ /.*<\/time>/
end
it "should allow to set global options" do
Rails::Timeago.default_options :format => :short, :limit => proc { 8.days.ago }
time = 7.days.ago
@stub.timeago_tag(time).
should include(">#{I18n.l time.to_date, :format => :short}<")
@stub.timeago_tag(time).
should =~ /.*<\/time>/
end
it "should allow to override global options" do
Rails::Timeago.default_options :format => :short, :limit => proc { 8.days.ago }
time = 7.days.ago
@stub.timeago_tag(time, :format => :long).
should include(">#{I18n.l time.to_date, :format => :long}<")
@stub.timeago_tag(time, :limit => 4.days.ago).
should_not =~ /.*<\/time>/
end
it "should return default string if time is nil" do
@stub.timeago_tag(nil).should == '-'
end
it 'should respect limit option also in nojs tag content' do
time = 6.days.ago
@stub.timeago_tag(time, :nojs => true, :limit => 5.days.ago).
should_not =~ /.*<\/time>/
@stub.timeago_tag(time, :nojs => true, :limit => 5.days.ago).
should include(">#{I18n.l time.to_date}<")
end
end
context "#timeago_script_tag" do
it "should return a javascript snippet to set jQuery timeago locale" do
I18n.locale = "en"
@stub.timeago_script_tag.should == ''
end
end
end
rails-timeago-2.11.1/LICENSE 0000644 0000764 0000764 00000002054 12412436741 014377 0 ustar pravi pravi Copyright (c) 2012 Jan Graichen
MIT License
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. rails-timeago-2.11.1/.travis.yml 0000644 0000764 0000764 00000000155 12412436741 015503 0 ustar pravi pravi language: ruby
rvm:
- 2.1
- rbx-2
- '2.0'
- jruby
- 1.9.3
matrix:
allow_failures:
- rvm: jruby
rails-timeago-2.11.1/vendor/ 0000755 0000764 0000764 00000000000 12412436741 014666 5 ustar pravi pravi rails-timeago-2.11.1/vendor/assets/ 0000755 0000764 0000764 00000000000 12412436741 016170 5 ustar pravi pravi rails-timeago-2.11.1/vendor/assets/javascripts/ 0000755 0000764 0000764 00000000000 12412436741 020521 5 ustar pravi pravi rails-timeago-2.11.1/vendor/assets/javascripts/locales/ 0000755 0000764 0000764 00000000000 12412436741 022143 5 ustar pravi pravi rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.id.js 0000644 0000764 0000764 00000000663 12412436741 026044 0 ustar pravi pravi // Indonesian
jQuery.timeago.settings.strings["id"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "yang lalu",
suffixFromNow: "dari sekarang",
seconds: "kurang dari semenit",
minute: "sekitar satu menit",
minutes: "%d menit",
hour: "sekitar sejam",
hours: "sekitar %d jam",
day: "sehari",
days: "%d hari",
month: "sekitar sebulan",
months: "%d bulan",
year: "sekitar setahun",
years: "%d tahun"
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.el.js 0000644 0000764 0000764 00000001036 12412436741 026043 0 ustar pravi pravi // Greek
jQuery.timeago.settings.strings["el"] = {
prefixAgo: "πριν",
prefixFromNow: "σε",
suffixAgo: "",
suffixFromNow: "",
seconds: "λιγότερο από ένα λεπτό",
minute: "περίπου ένα λεπτό",
minutes: "%d λεπτά",
hour: "περίπου μία ώρα",
hours: "περίπου %d ώρες",
day: "μία μέρα",
days: "%d μέρες",
month: "περίπου ένα μήνα",
months: "%d μήνες",
year: "περίπου ένα χρόνο",
years: "%d χρόνια"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.es.js 0000644 0000764 0000764 00000000624 12412436741 026054 0 ustar pravi pravi // Spanish
jQuery.timeago.settings.strings["es"] = {
prefixAgo: "hace",
prefixFromNow: "dentro de",
suffixAgo: "",
suffixFromNow: "",
seconds: "menos de un minuto",
minute: "un minuto",
minutes: "unos %d minutos",
hour: "una hora",
hours: "%d horas",
day: "un día",
days: "%d días",
month: "un mes",
months: "%d meses",
year: "un año",
years: "%d años"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.en-short.js 0000644 0000764 0000764 00000000553 12412436741 027205 0 ustar pravi pravi // English shortened
jQuery.timeago.settings.strings["en-short"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "",
suffixFromNow: "",
seconds: "1m",
minute: "1m",
minutes: "%dm",
hour: "1h",
hours: "%dh",
day: "1d",
days: "%dd",
month: "1mo",
months: "%dmo",
year: "1yr",
years: "%dyr",
wordSeparator: " ",
numbers: []
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.fr-short.js 0000644 0000764 0000764 00000000563 12412436741 027213 0 ustar pravi pravi // French shortened
jQuery.timeago.settings.strings["fr-short"] = {
prefixAgo: "il y a",
prefixFromNow: "d'ici",
seconds: "moins d'une minute",
minute: "une minute",
minutes: "%d minutes",
hour: "une heure",
hours: "%d heures",
day: "un jour",
days: "%d jours",
month: "un mois",
months: "%d mois",
year: "un an",
years: "%d ans"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.tr.js 0000644 0000764 0000764 00000000515 12412436741 026071 0 ustar pravi pravi // Turkish
jQuery.timeago.settings.strings["tr"] = {
suffixAgo: 'önce',
suffixFromNow: null,
seconds: '1 dakikadan',
minute: '1 dakika',
minutes: '%d dakika',
hour: '1 saat',
hours: '%d saat',
day: '1 gün',
days: '%d gün',
month: '1 ay',
months: '%d ay',
year: '1 yıl',
years: '%d yıl'
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.lt.js 0000644 0000764 0000764 00000000623 12412436741 026063 0 ustar pravi pravi //Lithuanian
jQuery.timeago.settings.strings["lt"] = {
prefixAgo: "prieš",
prefixFromNow: null,
suffixAgo: null,
suffixFromNow: "nuo dabar",
seconds: "%d sek.",
minute: "min.",
minutes: "%d min.",
hour: "val.",
hours: "%d val.",
day: "1 d.",
days: "%d d.",
month: "mėn.",
months: "%d mėn.",
year: "metus",
years: "%d metus",
wordSeparator: " ",
numbers: []
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.gl.js 0000644 0000764 0000764 00000000621 12412436741 026044 0 ustar pravi pravi // Galician
jQuery.timeago.settings.strings["gl"] = {
prefixAgo: "hai",
prefixFromNow: "dentro de",
suffixAgo: "",
suffixFromNow: "",
seconds: "menos dun minuto",
minute: "un minuto",
minutes: "uns %d minutos",
hour: "unha hora",
hours: "%d horas",
day: "un día",
days: "%d días",
month: "un mes",
months: "%d meses",
year: "un ano",
years: "%d anos"
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.ru.js 0000644 0000764 0000764 00000002241 12412436741 026070 0 ustar pravi pravi // Russian
(function() {
function numpf(n, f, s, t) {
// f - 1, 21, 31, ...
// s - 2-4, 22-24, 32-34 ...
// t - 5-20, 25-30, ...
var n10 = n % 10;
if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) {
return f;
} else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
return s;
} else {
return t;
}
}
jQuery.timeago.settings.strings["ru"] = {
prefixAgo: null,
prefixFromNow: "через",
suffixAgo: "назад",
suffixFromNow: null,
seconds: "меньше минуты",
minute: "минуту",
minutes: function(value) { return numpf(value, "%d минута", "%d минуты", "%d минут"); },
hour: "час",
hours: function(value) { return numpf(value, "%d час", "%d часа", "%d часов"); },
day: "день",
days: function(value) { return numpf(value, "%d день", "%d дня", "%d дней"); },
month: "месяц",
months: function(value) { return numpf(value, "%d месяц", "%d месяца", "%d месяцев"); },
year: "год",
years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); }
};
})(); rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.sl.js 0000644 0000764 0000764 00000002254 12412436741 026064 0 ustar pravi pravi // Slovenian with support for dual
(function () {
var numpf;
numpf = function (n, d, m) {
if (n == 2) {
return d;
} else {
return m;
}
};
jQuery.timeago.settings.strings["sl"] = {
prefixAgo: "pred",
prefixFromNow: "čez",
suffixAgo: null,
suffixFromNow: null,
second: "sekundo",
seconds: function (value) {
return numpf(value, "%d sekundama", "%d sekundami");
},
minute: "minuto",
minutes: function (value) {
return numpf(value, "%d minutama", "%d minutami");
},
hour: "uro",
hours: function (value) {
return numpf(value, "%d urama", "%d urami");
},
day: "dnevom",
days: function (value) {
return numpf(value, "%d dnevi", "%d dnevi");
},
month: "enim mescem",
months: function (value) {
return numpf(value, "%d mesecema", "%d meseci");
},
year: "enim letom",
years: function (value) {
return numpf(value, "%d letoma", "%d leti");
},
wordSeparator: " "
};
}).call(this);
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.cs.js 0000644 0000764 0000764 00000002120 12412436741 026043 0 ustar pravi pravi // Czech
(function() {
function f(n, d, a) {
return a[d>=0 ? 0 : a.length==2 || n<5 ? 1 : 2];
}
jQuery.timeago.settings.strings["cs"] = {
prefixAgo: 'před',
prefixFromNow: 'za',
suffixAgo: null,
suffixFromNow: null,
seconds: function(n, d) {return f(n, d, ['méně než minutou', 'méně než minutu'])},
minute: function(n, d) {return f(n, d, ['minutou', 'minutu'])},
minutes: function(n, d) {return f(n, d, ['%d minutami', '%d minuty', '%d minut'])},
hour: function(n, d) {return f(n, d, ['hodinou', 'hodinu'])},
hours: function(n, d) {return f(n, d, ['%d hodinami', '%d hodiny', '%d hodin'])},
day: function(n, d) {return f(n, d, ['%d dnem', '%d den'])},
days: function(n, d) {return f(n, d, ['%d dny', '%d dny', '%d dní'])},
month: function(n, d) {return f(n, d, ['%d měsícem', '%d měsíc'])},
months: function(n, d) {return f(n, d, ['%d měsící', '%d měsíce', '%d měsíců'])},
year: function(n, d) {return f(n, d, ['%d rokem', '%d rok'])},
years: function(n, d) {return f(n, d, ['%d lety', '%d roky', '%d let'])}
};
})();
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.pt.js 0000644 0000764 0000764 00000000636 12412436741 026073 0 ustar pravi pravi // Portuguese
jQuery.timeago.settings.strings["pt"] = {
suffixAgo: "atrás",
suffixFromNow: "a partir de agora",
seconds: "menos de um minuto",
minute: "cerca de um minuto",
minutes: "%d minutos",
hour: "cerca de uma hora",
hours: "cerca de %d horas",
day: "um dia",
days: "%d dias",
month: "cerca de um mês",
months: "%d meses",
year: "cerca de um ano",
years: "%d anos"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.fr.js 0000644 0000764 0000764 00000000711 12412436741 026051 0 ustar pravi pravi // French
jQuery.timeago.settings.strings["fr"] = {
// environ ~= about, it's optional
prefixAgo: "il y a",
prefixFromNow: "d'ici",
seconds: "moins d'une minute",
minute: "environ une minute",
minutes: "environ %d minutes",
hour: "environ une heure",
hours: "environ %d heures",
day: "environ un jour",
days: "environ %d jours",
month: "environ un mois",
months: "environ %d mois",
year: "un an",
years: "%d ans"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.ja.js 0000644 0000764 0000764 00000000644 12412436741 026041 0 ustar pravi pravi // Japanese
jQuery.timeago.settings.strings["ja"] = {
prefixAgo: "",
prefixFromNow: "今から",
suffixAgo: "前",
suffixFromNow: "後",
seconds: "1 分未満",
minute: "約 1 分",
minutes: "%d 分",
hour: "約 1 時間",
hours: "約 %d 時間",
day: "約 1 日",
days: "約 %d 日",
month: "約 1 月",
months: "約 %d 月",
year: "約 1 年",
years: "約 %d 年",
wordSeparator: ""
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.cy.js 0000644 0000764 0000764 00000000646 12412436741 026064 0 ustar pravi pravi // Welsh
jQuery.timeago.settings.strings["cy"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "yn ôl",
suffixFromNow: "o hyn",
seconds: "llai na munud",
minute: "am funud",
minutes: "%d munud",
hour: "tua awr",
hours: "am %d awr",
day: "y dydd",
days: "%d diwrnod",
month: "tua mis",
months: "%d mis",
year: "am y flwyddyn",
years: "%d blynedd",
wordSeparator: " ",
numbers: []
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.ar.js 0000644 0000764 0000764 00000005335 12412436741 026053 0 ustar pravi pravi (function() {
function numpf(n, a) {
return a[plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5];
}
jQuery.timeago.settings.strings["ar"] = {
prefixAgo: "منذ",
prefixFromNow: "بعد",
suffixAgo: null,
suffixFromNow: null, // null OR "من الآن"
second: function(value) { return numpf(value, [
'أقل من ثانية',
'ثانية واحدة',
'ثانيتين',
'%d ثوانٍ',
'%d ثانية',
'%d ثانية']); },
seconds: function(value) { return numpf(value, [
'أقل من ثانية',
'ثانية واحدة',
'ثانيتين',
'%d ثوانٍ',
'%d ثانية',
'%d ثانية']); },
minute: function(value) { return numpf(value, [
'أقل من دقيقة',
'دقيقة واحدة',
'دقيقتين',
'%d دقائق',
'%d دقيقة',
'دقيقة']); },
minutes: function(value) { return numpf(value, [
'أقل من دقيقة',
'دقيقة واحدة',
'دقيقتين',
'%d دقائق',
'%d دقيقة',
'دقيقة']); },
hour: function(value) { return numpf(value, [
'أقل من ساعة',
'ساعة واحدة',
'ساعتين',
'%d ساعات',
'%d ساعة',
'%d ساعة']); },
hours: function(value) { return numpf(value, [
'أقل من ساعة',
'ساعة واحدة',
'ساعتين',
'%d ساعات',
'%d ساعة',
'%d ساعة']); },
day: function(value) { return numpf(value, [
'أقل من يوم',
'يوم واحد',
'يومين',
'%d أيام',
'%d يومًا',
'%d يوم']); },
days: function(value) { return numpf(value, [
'أقل من يوم',
'يوم واحد',
'يومين',
'%d أيام',
'%d يومًا',
'%d يوم']); },
month: function(value) { return numpf(value, [
'أقل من شهر',
'شهر واحد',
'شهرين',
'%d أشهر',
'%d شهرًا',
'%d شهر']); },
months: function(value) { return numpf(value, [
'أقل من شهر',
'شهر واحد',
'شهرين',
'%d أشهر',
'%d شهرًا',
'%d شهر']); },
year: function(value) { return numpf(value, [
'أقل من عام',
'عام واحد',
'%d عامين',
'%d أعوام',
'%d عامًا']);
},
years: function(value) { return numpf(value, [
'أقل من عام',
'عام واحد',
'عامين',
'%d أعوام',
'%d عامًا',
'%d عام']);}
};
})();
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.pl.js 0000644 0000764 0000764 00000001561 12412436741 026061 0 ustar pravi pravi // Polish
(function() {
function numpf(n, s, t) {
// s - 2-4, 22-24, 32-34 ...
// t - 5-21, 25-31, ...
var n10 = n % 10;
if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
return s;
} else {
return t;
}
}
jQuery.timeago.settings.strings["pl"] = {
prefixAgo: null,
prefixFromNow: "za",
suffixAgo: "temu",
suffixFromNow: null,
seconds: "mniej niż minutę",
minute: "minutę",
minutes: function(value) { return numpf(value, "%d minuty", "%d minut"); },
hour: "godzinę",
hours: function(value) { return numpf(value, "%d godziny", "%d godzin"); },
day: "dzień",
days: "%d dni",
month: "miesiąc",
months: function(value) { return numpf(value, "%d miesiące", "%d miesięcy"); },
year: "rok",
years: function(value) { return numpf(value, "%d lata", "%d lat"); }
};
})(); rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.vi.js 0000644 0000764 0000764 00000000772 12412436741 026067 0 ustar pravi pravi // Vietnamese
jQuery.timeago.settings.strings["vi"] = {
prefixAgo: 'cách đây',
prefixFromNow: null,
suffixAgo: null,
suffixFromNow: "trước",
seconds: "chưa đến một phút",
minute: "khoảng một phút",
minutes: "%d phút",
hour: "khoảng một tiếng",
hours: "khoảng %d tiếng",
day: "một ngày",
days: "%d ngày",
month: "khoảng một tháng",
months: "%d tháng",
year: "khoảng một năm",
years: "%d năm",
wordSeparator: " ",
numbers: []
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.da.js 0000644 0000764 0000764 00000000621 12412436741 026026 0 ustar pravi pravi // Danish
jQuery.timeago.settings.strings["da"] = {
prefixAgo: "for",
prefixFromNow: "om",
suffixAgo: "siden",
suffixFromNow: "",
seconds: "mindre end et minut",
minute: "ca. et minut",
minutes: "%d minutter",
hour: "ca. en time",
hours: "ca. %d timer",
day: "en dag",
days: "%d dage",
month: "ca. en måned",
months: "%d måneder",
year: "ca. et år",
years: "%d år"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.jv.js 0000644 0000764 0000764 00000000724 12412436741 026065 0 ustar pravi pravi // Javanesse (Boso Jowo)
jQuery.timeago.settings.strings["jv"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "kepungkur",
suffixFromNow: "seko saiki",
seconds: "kurang seko sakmenit",
minute: "kurang luwih sakmenit",
minutes: "%d menit",
hour: "kurang luwih sakjam",
hours: "kurang luwih %d jam",
day: "sedina",
days: "%d dina",
month: "kurang luwih sewulan",
months: "%d wulan",
year: "kurang luwih setahun",
years: "%d tahun"
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.ro.js 0000644 0000764 0000764 00000000566 12412436741 026072 0 ustar pravi pravi // Romanian
jQuery.timeago.settings.strings["ro"] = {
prefixAgo: "acum",
prefixFromNow: "in timp de",
suffixAgo: "",
suffixFromNow: "",
seconds: "mai putin de un minut",
minute: "un minut",
minutes: "%d minute",
hour: "o ora",
hours: "%d ore",
day: "o zi",
days: "%d zile",
month: "o luna",
months: "%d luni",
year: "un an",
years: "%d ani"
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.rs.js 0000644 0000764 0000764 00000002564 12412436741 026076 0 ustar pravi pravi // Serbian
(function () {
var numpf;
numpf = function (n, f, s, t) {
var n10;
n10 = n % 10;
if (n10 === 1 && (n === 1 || n > 20)) {
return f;
} else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
return s;
} else {
return t;
}
};
jQuery.timeago.settings.strings["rs"] = {
prefixAgo: "pre",
prefixFromNow: "za",
suffixAgo: null,
suffixFromNow: null,
second: "sekund",
seconds: function (value) {
return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
},
minute: "oko minut",
minutes: function (value) {
return numpf(value, "%d minut", "%d minuta", "%d minuta");
},
hour: "oko jedan sat",
hours: function (value) {
return numpf(value, "%d sat", "%d sata", "%d sati");
},
day: "jedan dan",
days: function (value) {
return numpf(value, "%d dan", "%d dana", "%d dana");
},
month: "mesec dana",
months: function (value) {
return numpf(value, "%d mesec", "%d meseca", "%d meseci");
},
year: "godinu dana",
years: function (value) {
return numpf(value, "%d godinu", "%d godine", "%d godina");
},
wordSeparator: " "
};
}).call(this);
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.sk.js 0000644 0000764 0000764 00000000611 12412436741 026056 0 ustar pravi pravi // Slovak
jQuery.timeago.settings.strings["sk"] = {
prefixAgo: "pred",
prefixFromNow: null,
suffixAgo: null,
suffixFromNow: null,
seconds: "menej než minútou",
minute: "minútou",
minutes: "%d minútami",
hour: "hodinou",
hours: "%d hodinami",
day: "1 dňom",
days: "%d dňami",
month: "1 mesiacom",
months: "%d mesiacmi",
year: "1 rokom",
years: "%d rokmi"
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.uz.js 0000755 0000764 0000764 00000001033 12412436741 026101 0 ustar pravi pravi //Uzbek
jQuery.timeago.settings.strings["uz"] = {
prefixAgo: null,
prefixFromNow: "keyin",
suffixAgo: "avval",
suffixFromNow: null,
seconds: "bir necha soniya",
minute: "1 daqiqa",
minutes: function(value) { return "%d daqiqa" },
hour: "1 soat",
hours: function(value) { return "%d soat" },
day: "1 kun",
days: function(value) { return "%d kun" },
month: "1 oy",
months: function(value) { return "%d oy" },
year: "1 yil",
years: function(value) { return "%d yil" },
wordSeparator: " "
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.hy.js 0000644 0000764 0000764 00000000663 12412436741 026070 0 ustar pravi pravi // Armenian
jQuery.timeago.settings.strings["hy"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "առաջ",
suffixFromNow: "հետո",
seconds: "վայրկյաններ",
minute: "մեկ րոպե",
minutes: "%d րոպե",
hour: "մեկ ժամ",
hours: "%d ժամ",
day: "մեկ օր",
days: "%d օր",
month: "մեկ ամիս",
months: "%d ամիս",
year: "մեկ տարի",
years: "%d տարի"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.fa.js 0000644 0000764 0000764 00000001163 12412436741 026032 0 ustar pravi pravi
// Persian
// Use DIR attribute for RTL text in Persian Language for ABBR tag .
// By MB.seifollahi@gmail.com
jQuery.timeago.settings.strings["fa"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "پیش",
suffixFromNow: "از حال",
seconds: "کمتر از یک دقیقه",
minute: "حدود یک دقیقه",
minutes: "%d دقیقه",
hour: "حدود یک ساعت",
hours: "حدود %d ساعت",
day: "یک روز",
days: "%d روز",
month: "حدود یک ماه",
months: "%d ماه",
year: "حدود یک سال",
years: "%d سال",
wordSeparator: " "
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.mk.js 0000644 0000764 0000764 00000000755 12412436741 026061 0 ustar pravi pravi // Macedonian
(function() {
jQuery.timeago.settings.strings["mk"]={
prefixAgo: "пред",
prefixFromNow: "за",
suffixAgo: null,
suffixFromNow: null,
seconds: "%d секунди",
minute: "%d минута",
minutes: "%d минути",
hour: "%d час",
hours: "%d часа",
day: "%d ден",
days: "%d денови" ,
month: "%d месец",
months: "%d месеци",
year: "%d година",
years: "%d години"
}
})();
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.zh-TW.js 0000644 0000764 0000764 00000000720 12412436741 026413 0 ustar pravi pravi // Traditional Chinese, zh-tw
jQuery.timeago.settings.strings["zh-TW"] = {
prefixAgo: null,
prefixFromNow: "從現在開始",
suffixAgo: "之前",
suffixFromNow: null,
seconds: "不到1分鐘",
minute: "大約1分鐘",
minutes: "%d分鐘",
hour: "大約1小時",
hours: "%d小時",
day: "大約1天",
days: "%d天",
month: "大約1個月",
months: "%d個月",
year: "大約1年",
years: "%d年",
numbers: [],
wordSeparator: ""
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.nl.js 0000644 0000764 0000764 00000000731 12412436741 026055 0 ustar pravi pravi // Dutch
jQuery.timeago.settings.strings["nl"] = {
prefixAgo: null,
prefixFromNow: "",
suffixAgo: "geleden",
suffixFromNow: "van nu",
seconds: "minder dan een minuut",
minute: "ongeveer een minuut",
minutes: "%d minuten",
hour: "ongeveer een uur",
hours: "ongeveer %d uur",
day: "een dag",
days: "%d dagen",
month: "ongeveer een maand",
months: "%d maanden",
year: "ongeveer een jaar",
years: "%d jaar",
wordSeparator: " ",
numbers: []
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.is.js 0000644 0000764 0000764 00000000657 12412436741 026066 0 ustar pravi pravi jQuery.timeago.settings.strings["is"] = {
prefixAgo: "fyrir",
prefixFromNow: "eftir",
suffixAgo: "síðan",
suffixFromNow: null,
seconds: "minna en mínútu",
minute: "mínútu",
minutes: "%d mínútum",
hour: "klukkutíma",
hours: "um %d klukkutímum",
day: "degi",
days: "%d dögum",
month: "mánuði",
months: "%d mánuðum",
year: "ári",
years: "%d árum",
wordSeparator: " ",
numbers: []
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.he.js 0000644 0000764 0000764 00000001110 12412436741 026030 0 ustar pravi pravi // Hebrew
jQuery.timeago.settings.strings["he"] = {
prefixAgo: "לפני",
prefixFromNow: "עוד",
seconds: "פחות מדקה",
minute: "דקה",
minutes: "%d דקות",
hour: "שעה",
hours: function(number){return (number==2) ? "שעתיים" : "%d שעות"},
day: "יום",
days: function(number){return (number==2) ? "יומיים" : "%d ימים"},
month: "חודש",
months: function(number){return (number==2) ? "חודשיים" : "%d חודשים"},
year: "שנה",
years: function(number){return (number==2) ? "שנתיים" : "%d שנים"}
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.es-short.js 0000644 0000764 0000764 00000000551 12412436741 027210 0 ustar pravi pravi // Spanish shortened
jQuery.timeago.settings.strings["es-short"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "",
suffixFromNow: "",
seconds: "1m",
minute: "1m",
minutes: "%dm",
hour: "1h",
hours: "%dh",
day: "1d",
days: "%dd",
month: "1me",
months: "%dme",
year: "1a",
years: "%da",
wordSeparator: " ",
numbers: []
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.pt-br.js 0000644 0000764 0000764 00000000627 12412436741 026474 0 ustar pravi pravi // Brazilian Portuguese
jQuery.timeago.settings.strings["pt-br"] = {
prefixAgo: "há",
prefixFromNow: "em",
suffixAgo: null,
suffixFromNow: null,
seconds: "alguns segundos",
minute: "um minuto",
minutes: "%d minutos",
hour: "uma hora",
hours: "%d horas",
day: "um dia",
days: "%d dias",
month: "um mês",
months: "%d meses",
year: "um ano",
years: "%d anos"
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.et.js 0000644 0000764 0000764 00000001736 12412436741 026062 0 ustar pravi pravi // Estonian
jQuery.timeago.settings.strings["et"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "tagasi",
suffixFromNow: "pärast",
seconds: function(n, d) { return d < 0 ? "vähem kui minuti aja" : "vähem kui minut aega" },
minute: function(n, d) { return d < 0 ? "umbes minuti aja" : "umbes minut aega" },
minutes: function(n, d) { return d < 0 ? "%d minuti" : "%d minutit" },
hour: function(n, d) { return d < 0 ? "umbes tunni aja" : "umbes tund aega" },
hours: function(n, d) { return d < 0 ? "%d tunni" : "%d tundi" },
day: function(n, d) { return d < 0 ? "umbes päeva" : "umbes päev" },
days: function(n, d) { return d < 0 ? "%d päeva" : "%d päeva" },
month: function(n, d) { return d < 0 ? "umbes kuu aja" : "umbes kuu aega" },
months: function(n, d) { return d < 0 ? "%d kuu" : "%d kuud" },
year: function(n, d) { return d < 0 ? "umbes aasta aja" : "umbes aasta aega" },
years: function(n, d) { return d < 0 ? "%d aasta" : "%d aastat" }
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.fi.js 0000644 0000764 0000764 00000001646 12412436741 026050 0 ustar pravi pravi // Finnish
jQuery.timeago.settings.strings["fi"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "sitten",
suffixFromNow: "tulevaisuudessa",
seconds: "alle minuutti",
minute: "minuutti",
minutes: "%d minuuttia",
hour: "tunti",
hours: "%d tuntia",
day: "päivä",
days: "%d päivää",
month: "kuukausi",
months: "%d kuukautta",
year: "vuosi",
years: "%d vuotta"
};
// The above is not a great localization because one would usually
// write "2 days ago" in Finnish as "2 päivää sitten", however
// one would write "2 days into the future" as "2:n päivän päästä"
// which cannot be achieved with localization support this simple.
// This is because Finnish has word suffixes (attached directly
// to the end of the word). The word "day" is "päivä" in Finnish.
// As workaround, the above localizations will say
// "2 päivää tulevaisuudessa" which is understandable but
// not as fluent. rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.no.js 0000644 0000764 0000764 00000000627 12412436741 026064 0 ustar pravi pravi // Norwegian
jQuery.timeago.settings.strings["no"] = {
prefixAgo: "for",
prefixFromNow: "om",
suffixAgo: "siden",
suffixFromNow: "",
seconds: "mindre enn et minutt",
minute: "ca. et minutt",
minutes: "%d minutter",
hour: "ca. en time",
hours: "ca. %d timer",
day: "en dag",
days: "%d dager",
month: "ca. en måned",
months: "%d måneder",
year: "ca. et år",
years: "%d år"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.th.js 0000644 0000764 0000764 00000001316 12412436741 026057 0 ustar pravi pravi // Thai
jQuery.timeago.settings.strings["th"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "ที่แล้ว",
suffixFromNow: "จากตอนนี้",
seconds: "น้อยกว่าหนึ่งนาที",
minute: "ประมาณหนึ่งนาที",
minutes: "%d นาที",
hour: "ประมาณหนึ่งชั่วโมง",
hours: "ประมาณ %d ชั่วโมง",
day: "หนึ่งวัน",
days: "%d วัน",
month: "ประมาณหนึ่งเดือน",
months: "%d เดือน",
year: "ประมาณหนึ่งปี",
years: "%d ปี",
wordSeparator: "",
numbers: []
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.sv.js 0000644 0000764 0000764 00000000657 12412436741 026103 0 ustar pravi pravi // Swedish
jQuery.timeago.settings.strings["sv"] = {
prefixAgo: "för",
prefixFromNow: "om",
suffixAgo: "sedan",
suffixFromNow: "",
seconds: "mindre än en minut",
minute: "ungefär en minut",
minutes: "%d minuter",
hour: "ungefär en timme",
hours: "ungefär %d timmar",
day: "en dag",
days: "%d dagar",
month: "ungefär en månad",
months: "%d månader",
year: "ungefär ett år",
years: "%d år"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.uk.js 0000644 0000764 0000764 00000002301 12412436741 026056 0 ustar pravi pravi // Ukrainian
(function() {
function numpf(n, f, s, t) {
// f - 1, 21, 31, ...
// s - 2-4, 22-24, 32-34 ...
// t - 5-20, 25-30, ...
var n10 = n % 10;
if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) {
return f;
} else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
return s;
} else {
return t;
}
}
jQuery.timeago.settings.strings["uk"] = {
prefixAgo: null,
prefixFromNow: "через",
suffixAgo: "тому",
suffixFromNow: null,
seconds: "менше хвилини",
minute: "хвилина",
minutes: function(value) { return numpf(value, "%d хвилина", "%d хвилини", "%d хвилин"); },
hour: "година",
hours: function(value) { return numpf(value, "%d година", "%d години", "%d годин"); },
day: "день",
days: function(value) { return numpf(value, "%d день", "%d дні", "%d днів"); },
month: "місяць",
months: function(value) { return numpf(value, "%d місяць", "%d місяці", "%d місяців"); },
year: "рік",
years: function(value) { return numpf(value, "%d рік", "%d роки", "%d років"); }
};
})(); rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.ko.js 0000644 0000764 0000764 00000000512 12412436741 026052 0 ustar pravi pravi // Korean
jQuery.timeago.settings.strings["ko"] = {
suffixAgo: "전",
suffixFromNow: "후",
seconds: "1분 이내",
minute: "1분",
minutes: "%d분",
hour: "1시간",
hours: "%d시간",
day: "하루",
days: "%d일",
month: "한 달",
months: "%d달",
year: "1년",
years: "%d년",
wordSeparator: " "
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.zh-CN.js 0000644 0000764 0000764 00000000705 12412436741 026364 0 ustar pravi pravi // Simplified Chinese
jQuery.timeago.settings.strings["zh-CN"] = {
prefixAgo: null,
prefixFromNow: "从现在开始",
suffixAgo: "之前",
suffixFromNow: null,
seconds: "不到1分钟",
minute: "大约1分钟",
minutes: "%d分钟",
hour: "大约1小时",
hours: "大约%d小时",
day: "1天",
days: "%d天",
month: "大约1个月",
months: "%d月",
year: "大约1年",
years: "%d年",
numbers: [],
wordSeparator: ""
};
rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.bg.js 0000644 0000764 0000764 00000000747 12412436741 026043 0 ustar pravi pravi // Bulgarian
jQuery.timeago.settings.strings["bg"] = {
prefixAgo: "преди",
prefixFromNow: "след",
suffixAgo: null,
suffixFromNow: null,
seconds: "по-малко от минута",
minute: "една минута",
minutes: "%d минути",
hour: "един час",
hours: "%d часа",
day: "един ден",
days: "%d дни",
month: "един месец",
months: "%d месеца",
year: "една година",
years: "%d години"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.hr.js 0000644 0000764 0000764 00000002604 12412436741 026056 0 ustar pravi pravi // Croatian
(function () {
var numpf;
numpf = function (n, f, s, t) {
var n10;
n10 = n % 10;
if (n10 === 1 && (n === 1 || n > 20)) {
return f;
} else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
return s;
} else {
return t;
}
};
jQuery.timeago.settings.strings["hr"] = {
prefixAgo: "prije",
prefixFromNow: "za",
suffixAgo: null,
suffixFromNow: null,
second: "sekundu",
seconds: function (value) {
return numpf(value, "%d sekundu", "%d sekunde", "%d sekundi");
},
minute: "oko minutu",
minutes: function (value) {
return numpf(value, "%d minutu", "%d minute", "%d minuta");
},
hour: "oko jedan sat",
hours: function (value) {
return numpf(value, "%d sat", "%d sata", "%d sati");
},
day: "jedan dan",
days: function (value) {
return numpf(value, "%d dan", "%d dana", "%d dana");
},
month: "mjesec dana",
months: function (value) {
return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
},
year: "prije godinu dana",
years: function (value) {
return numpf(value, "%d godinu", "%d godine", "%d godina");
},
wordSeparator: " "
};
}).call(this); rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.it.js 0000644 0000764 0000764 00000000557 12412436741 026066 0 ustar pravi pravi // Italian
jQuery.timeago.settings.strings["it"] = {
suffixAgo: "fa",
suffixFromNow: "da ora",
seconds: "meno di un minuto",
minute: "circa un minuto",
minutes: "%d minuti",
hour: "circa un'ora",
hours: "circa %d ore",
day: "un giorno",
days: "%d giorni",
month: "circa un mese",
months: "%d mesi",
year: "circa un anno",
years: "%d anni"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.hu.js 0000644 0000764 0000764 00000000744 12412436741 026064 0 ustar pravi pravi // Hungarian
jQuery.timeago.settings.strings["hu"] = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: null,
suffixFromNow: null,
seconds: "kevesebb mint egy perce",
minute: "körülbelül egy perce",
minutes: "%d perce",
hour: "körülbelül egy órája",
hours: "körülbelül %d órája",
day: "körülbelül egy napja",
days: "%d napja",
month: "körülbelül egy hónapja",
months: "%d hónapja",
year: "körülbelül egy éve",
years: "%d éve"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.bs.js 0000644 0000764 0000764 00000002304 12412436741 026046 0 ustar pravi pravi // Bosnian
(function() {
var numpf;
numpf = function(n, f, s, t) {
var n10;
n10 = n % 10;
if (n10 === 1 && (n === 1 || n > 20)) {
return f;
} else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
return s;
} else {
return t;
}
};
jQuery.timeago.settings.strings["bs"] = {
prefixAgo: "prije",
prefixFromNow: "za",
suffixAgo: null,
suffixFromNow: null,
second: "sekund",
seconds: function(value) {
return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
},
minute: "oko minut",
minutes: function(value) {
return numpf(value, "%d minut", "%d minute", "%d minuta");
},
hour: "oko sat",
hours: function(value) {
return numpf(value, "%d sat", "%d sata", "%d sati");
},
day: "oko jednog dana",
days: function(value) {
return numpf(value, "%d dan", "%d dana", "%d dana");
},
month: "mjesec dana",
months: function(value) {
return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
},
year: "prije godinu dana ",
years: function(value) {
return numpf(value, "%d godinu", "%d godine", "%d godina");
},
wordSeparator: " "
};
}).call(this); rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.de.js 0000644 0000764 0000764 00000000644 12412436741 026037 0 ustar pravi pravi // German
jQuery.timeago.settings.strings["de"] = {
prefixAgo: "vor",
prefixFromNow: "in",
suffixAgo: "",
suffixFromNow: "",
seconds: "wenigen Sekunden",
minute: "etwa einer Minute",
minutes: "%d Minuten",
hour: "etwa einer Stunde",
hours: "%d Stunden",
day: "etwa einem Tag",
days: "%d Tagen",
month: "etwa einem Monat",
months: "%d Monaten",
year: "etwa einem Jahr",
years: "%d Jahren"
}; rails-timeago-2.11.1/vendor/assets/javascripts/locales/jquery.timeago.ca.js 0000644 0000764 0000764 00000000633 12412436741 026030 0 ustar pravi pravi // Catalan
jQuery.timeago.settings.strings["ca"] = {
prefixAgo: "fa",
prefixFromNow: "d'aqui a",
suffixAgo: null,
suffixFromNow: null,
seconds: "menys d'1 minut",
minute: "1 minut",
minutes: "uns %d minuts",
hour: "1 hora",
hours: "unes %d hores",
day: "1 dia",
days: "%d dies",
month: "aproximadament un mes",
months: "%d mesos",
year: "aproximadament un any",
years: "%d anys"
}; rails-timeago-2.11.1/vendor/assets/javascripts/jquery.timeago.js 0000644 0000764 0000764 00000016150 12412436741 024025 0 ustar pravi pravi /**
* Timeago is a jQuery plugin that makes it easy to support automatically
* updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
*
* @name timeago
* @version 1.4.1
* @requires jQuery v1.2.3+
* @author Ryan McGeary
* @license MIT License - http://www.opensource.org/licenses/mit-license.php
*
* For usage and examples, visit:
* http://timeago.yarp.com/
*
* Copyright (c) 2008-2013, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
$.timeago = function(timestamp) {
if (timestamp instanceof Date) {
return inWords(timestamp);
} else if (typeof timestamp === "string") {
return inWords($.timeago.parse(timestamp));
} else if (typeof timestamp === "number") {
return inWords(new Date(timestamp));
} else {
return inWords($.timeago.datetime(timestamp));
}
};
var $t = $.timeago;
$.extend($.timeago, {
settings: {
refreshMillis: 60000,
allowPast: true,
allowFuture: false,
localeTitle: false,
cutoff: 0,
lang: "en",
strings: {
"en": {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "ago",
suffixFromNow: "from now",
inPast: 'any moment now',
seconds: "less than a minute",
minute: "about a minute",
minutes: "%d minutes",
hour: "about an hour",
hours: "about %d hours",
day: "a day",
days: "%d days",
month: "about a month",
months: "%d months",
year: "about a year",
years: "%d years",
wordSeparator: " ",
numbers: []
}
}
},
inWords: function(distanceMillis, lang) {
if(!this.settings.allowPast && ! this.settings.allowFuture) {
throw 'timeago allowPast and allowFuture settings can not both be set to false.';
}
var $l = this.settings.strings[lang] || this.settings.strings[this.settings.lang] || this.settings.strings["en"];
var prefix = $l.prefixAgo;
var suffix = $l.suffixAgo;
if (this.settings.allowFuture) {
if (distanceMillis < 0) {
prefix = $l.prefixFromNow;
suffix = $l.suffixFromNow;
}
}
if(!this.settings.allowPast && distanceMillis >= 0) {
return this.settings.strings[lang].inPast;
}
var seconds = Math.abs(distanceMillis) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
var years = days / 365;
function substitute(stringOrFunction, number) {
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
var value = ($l.numbers && $l.numbers[number]) || number;
return string.replace(/%d/i, value);
}
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
seconds < 90 && substitute($l.minute, 1) ||
minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
minutes < 90 && substitute($l.hour, 1) ||
hours < 24 && substitute($l.hours, Math.round(hours)) ||
hours < 42 && substitute($l.day, 1) ||
days < 30 && substitute($l.days, Math.round(days)) ||
days < 45 && substitute($l.month, 1) ||
days < 365 && substitute($l.months, Math.round(days / 30)) ||
years < 1.5 && substitute($l.year, 1) ||
substitute($l.years, Math.round(years));
var separator = $l.wordSeparator || "";
if ($l.wordSeparator === undefined) { separator = " "; }
return $.trim([prefix, words, suffix].join(separator));
},
parse: function(iso8601) {
var s = $.trim(iso8601);
s = s.replace(/\.\d+/,""); // remove milliseconds
s = s.replace(/-/,"/").replace(/-/,"/");
s = s.replace(/T/," ").replace(/Z/," UTC");
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900
return new Date(s);
},
datetime: function(elem) {
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
return $t.parse(iso8601);
},
isTime: function(elem) {
// jQuery's `is()` doesn't play well with HTML5 in IE
return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
}
});
// functions that can be called via $(el).timeago('action')
// init is default when no action is given
// functions are called with context of a single element
var functions = {
init: function(){
var refresh_el = $.proxy(refresh, this);
refresh_el();
var $s = $t.settings;
if ($s.refreshMillis > 0) {
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
}
},
update: function(time){
var parsedTime = $t.parse(time);
$(this).data('timeago', { datetime: parsedTime });
if($t.settings.localeTitle) $(this).attr("title", parsedTime.toLocaleString());
refresh.apply(this);
},
updateFromDOM: function(){
$(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) });
refresh.apply(this);
},
dispose: function () {
if (this._timeagoInterval) {
window.clearInterval(this._timeagoInterval);
this._timeagoInterval = null;
}
}
};
$.fn.timeago = function(action, options) {
var fn = action ? functions[action] : functions.init;
if(!fn){
throw new Error("Unknown function name '"+ action +"' for timeago");
}
// each over objects here and call the requested function
this.each(function(){
fn.call(this, options);
});
return this;
};
function refresh() {
//check if it's still visible
if(!$.contains(document.documentElement,this)){
//stop if it has been removed
$(this).timeago("dispose");
return this;
}
var data = prepareData(this);
var $s = $t.settings;
if (!isNaN(data.datetime)) {
if ( $s.cutoff == 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
$(this).text(inWords(data.datetime, ($(this).attr('lang')) ? $(this).attr('lang') : $t.settings.lang));
}
}
return this;
}
function prepareData(element) {
element = $(element);
if (!element.data("timeago")) {
element.data("timeago", { datetime: $t.datetime(element) });
var text = $.trim(element.text());
if ($t.settings.localeTitle) {
element.attr("title", element.data('timeago').datetime.toLocaleString());
} else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
element.attr("title", text);
}
}
return element.data("timeago");
}
function inWords(date, lang) {
return $t.inWords(distance(date), lang);
}
function distance(date) {
return (new Date().getTime() - date.getTime());
}
// fix for IE6 suckage
document.createElement("abbr");
document.createElement("time");
}));
rails-timeago-2.11.1/rails-timeago.gemspec 0000644 0000764 0000764 00000001700 12412436741 017471 0 ustar pravi pravi # -*- encoding: utf-8 -*-
require File.expand_path('../lib/rails-timeago/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Jan Graichen"]
gem.email = ["jan.graichen@altimos.de"]
gem.description = %q{jQuery Timeago helper for Rails 3}
gem.summary = %q{A Rails Helper to create time tags usable for jQuery Timeago plugin}
gem.homepage = "https://github.com/jgraichen/rails-timeago"
gem.license = 'MIT'
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n").reject{|file| file =~ /^scripts/}
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.name = "rails-timeago"
gem.require_paths = ["lib"]
gem.version = Rails::Timeago::VERSION
gem.add_dependency "activesupport", ">= 3.1"
gem.add_dependency "actionpack", ">= 3.1"
gem.add_development_dependency "rspec"
end
rails-timeago-2.11.1/README.md 0000644 0000764 0000764 00000010242 12412436741 014647 0 ustar pravi pravi # rails-timeago [](http://badge.fury.io/rb/rails-timeago) [](https://travis-ci.org/jgraichen/rails-timeago) [](https://codeclimate.com/github/jgraichen/rails-timeago) [](https://gemnasium.com/jgraichen/rails-timeago)
**rails-timeago** provides a timeago_tag helper to create time tags usable for
[jQuery Timeago](https://github.com/rmm5t/jquery-timeago) plugin.
## Installation
Add this line to your application's `Gemfile`:
```ruby
gem 'rails-timeago', '~> 2.0'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install rails-timeago
To use bundled jQuery Timeago plugin add this require statement to your `application.js` file:
//= require rails-timeago
This will also convert all matching time tags on page load.
Use the following to also include all available locale files:
//= require rails-timeago-all
## Usage
Use the timeago_tag helper like any other regular tag helper:
```erb
<%= timeago_tag Time.zone.now, :nojs => true, :limit => 10.days.ago %>
```
### Available options:
**nojs**
Add time ago in words as time tag content instead of absolute time.
(default: `false`)
**date_only**
Only print date as tag content instead of full time.
(default: `true`)
**format**
A time format for localize method used to format static time.
(default: `default`)
**limit**
Set a limit for time ago tags. All dates before given limit will not be converted.
(default: `4.days.ago`)
**force**
Force time ago tag ignoring limit option.
(default: `false`)
**default**
String that will be returned if time is `nil`.
(default: `'-'`)
**title**
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.
(default: `proc { |time, options| I18n.l time, :format => options[:format] }`)
All other options will be given as options to the time tag helper.
The above options can be assigned globally as defaults using
```ruby
Rails::Timeago.default_options :limit => proc { 20.days.ago }, :nojs => true
```
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.
## I18n
**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:
```erb
<%= timeago_tag Time.zone.now, :lang => :de %>
```
The following snippet will print a script tag that set the jQuery timeago locale according to your `I18n.locale`:
```erb
<%= timeago_script_tag %>
```
Just insert it in your application layout's html head. If you use another I18n framework for JavaScript you can also directly set `jQuery.timeago.settings.lang`. For example:
```js
jQuery.timeago.settings.lang = $('html').attr('lang')
````
Do not forget to require the needed locale files by either require `rails-timeago-all` in your `application.js` file or require specific locale files:
```js
//= require locales/jquery.timeago.de.js
//= require locales/jquery.timeago.ru.js
```
*Note:* English is included in jQuery timeago library, but can be easily override by include an own file that defines `jQuery.timeago.settings.strings["en"]`. See a locale file for more details.
**rails-timeago** includes locale files for the following locales taken from [jQuery Timeago](https://github.com/rmm5t/jquery-timeago).
> 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
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:
```js
jQuery.timeago.settings.strings["en"] = {
...
}
```
## License
[MIT License](http://www.opensource.org/licenses/mit-license.php)
Copyright (c) 2014, Jan Graichen
rails-timeago-2.11.1/CHANGELOG.md 0000644 0000764 0000764 00000003471 12412436741 015207 0 ustar pravi pravi # Changelog
## 2.11.1
* Update jquery-timeago and locales from upstream
## 2.10.2
* Update jquery-timeago from upstream (1.4.1)
## 2.10.1
* Fix localization bug with inPast (#27)
## 2.10.0
* Allow future times in limit (#25)
## 2.9.0
* Update jquery-timeago from upstream (1.4.0)
* Instead of using each use the jquery method on the selector (#23)
## 2.8.1
* Update jquery-timeago from upstream (1.3.1)
## 2.8.0
* Update jquery-timeago from upstream
## 2.7.1
* Fix syntax issue from upstream locale (#22)
## 2.7.0
* Update jquery-timeago from upstream
## 2.6.0
* Update Timeago with new locales + Fix update script for Mac (#20)
* README Markdown code blocks (#19)
## 2.5.1
* Add license to gemspec
## 2.5.0
* Add rails turbolinks compatibility.
## 2.4.0
* Support procs for :format argument (#15)
## 2.3.0
* Update jquery-timeago from upstream
## 2.2.3
* Respect :limit options for static :nojs conversion. fixed #13
## 2.2.2
* Update jquery-timeago from upstream
## 2.2.1
* Update jquery-timeago from upstream
## 2.2.0
* Update jquery-timeago from upstream
## 2.1.1
* Update jquery-timeago from upstream
## 2.1.0
* Add option to set, define a block or disable title attribute.
* #10, #9
## 2.0.0 (beta1)
* Add i18n patches to jquery-timeago
* Update jquery-timeago from upstream
## 1.4.3
* Run initializer on asset precompilation as well (#8)
## 1.4.2
* Update jquery-timeago from upstream
## 1.4.1
* fix precomplie locales empty error (#6)
## 1.4.0
* Add support for custom locale file mappings.
## 1.3.0
* Locale support
## 1.2.0 (rc1-rc3)
* Update jquery-timeago from upstream
* Try to style README
## 1.1.1
* Fix default string if time is nil
## 1.1.0
* Update jquery-timeago from upstream
* Add global default options
* Add default text if time is nil
## 1.0.0
* An apple fell down
rails-timeago-2.11.1/Gemfile 0000644 0000764 0000764 00000000250 12412436741 014661 0 ustar pravi pravi source 'https://rubygems.org'
# Specify your gem's dependencies in rails-timeago.gemspec
gemspec
group :development do
gem "rake"
end
gem 'rubysl', platform: :rbx
rails-timeago-2.11.1/metadata.yml 0000644 0000764 0000764 00000012162 12412436741 015676 0 ustar pravi pravi --- !ruby/object:Gem::Specification
name: rails-timeago
version: !ruby/object:Gem::Version
version: 2.11.1
platform: ruby
authors:
- Jan Graichen
autorequire:
bindir: bin
cert_chain: []
date: 2014-09-07 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: activesupport
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '3.1'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '3.1'
- !ruby/object:Gem::Dependency
name: actionpack
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '3.1'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '3.1'
- !ruby/object:Gem::Dependency
name: rspec
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
description: jQuery Timeago helper for Rails 3
email:
- jan.graichen@altimos.de
executables: []
extensions: []
extra_rdoc_files: []
files:
- ".gitignore"
- ".travis.yml"
- CHANGELOG.md
- Gemfile
- LICENSE
- README.md
- Rakefile
- lib/assets/javascripts/rails-timeago-all.js
- lib/assets/javascripts/rails-timeago.js
- lib/rails-timeago.rb
- lib/rails-timeago/helper.rb
- lib/rails-timeago/version.rb
- rails-timeago.gemspec
- spec/spec_helper.rb
- spec/support/stub.rb
- spec/timeago/helper_spec.rb
- vendor/assets/javascripts/jquery.timeago.js
- vendor/assets/javascripts/locales/jquery.timeago.ar.js
- vendor/assets/javascripts/locales/jquery.timeago.bg.js
- vendor/assets/javascripts/locales/jquery.timeago.bs.js
- vendor/assets/javascripts/locales/jquery.timeago.ca.js
- vendor/assets/javascripts/locales/jquery.timeago.cs.js
- vendor/assets/javascripts/locales/jquery.timeago.cy.js
- vendor/assets/javascripts/locales/jquery.timeago.da.js
- vendor/assets/javascripts/locales/jquery.timeago.de.js
- vendor/assets/javascripts/locales/jquery.timeago.el.js
- vendor/assets/javascripts/locales/jquery.timeago.en-short.js
- vendor/assets/javascripts/locales/jquery.timeago.es-short.js
- vendor/assets/javascripts/locales/jquery.timeago.es.js
- vendor/assets/javascripts/locales/jquery.timeago.et.js
- vendor/assets/javascripts/locales/jquery.timeago.fa.js
- vendor/assets/javascripts/locales/jquery.timeago.fi.js
- vendor/assets/javascripts/locales/jquery.timeago.fr-short.js
- vendor/assets/javascripts/locales/jquery.timeago.fr.js
- vendor/assets/javascripts/locales/jquery.timeago.gl.js
- vendor/assets/javascripts/locales/jquery.timeago.he.js
- vendor/assets/javascripts/locales/jquery.timeago.hr.js
- vendor/assets/javascripts/locales/jquery.timeago.hu.js
- vendor/assets/javascripts/locales/jquery.timeago.hy.js
- vendor/assets/javascripts/locales/jquery.timeago.id.js
- vendor/assets/javascripts/locales/jquery.timeago.is.js
- vendor/assets/javascripts/locales/jquery.timeago.it.js
- vendor/assets/javascripts/locales/jquery.timeago.ja.js
- vendor/assets/javascripts/locales/jquery.timeago.jv.js
- vendor/assets/javascripts/locales/jquery.timeago.ko.js
- vendor/assets/javascripts/locales/jquery.timeago.lt.js
- vendor/assets/javascripts/locales/jquery.timeago.mk.js
- vendor/assets/javascripts/locales/jquery.timeago.nl.js
- vendor/assets/javascripts/locales/jquery.timeago.no.js
- vendor/assets/javascripts/locales/jquery.timeago.pl.js
- vendor/assets/javascripts/locales/jquery.timeago.pt-br.js
- vendor/assets/javascripts/locales/jquery.timeago.pt.js
- vendor/assets/javascripts/locales/jquery.timeago.ro.js
- vendor/assets/javascripts/locales/jquery.timeago.rs.js
- vendor/assets/javascripts/locales/jquery.timeago.ru.js
- vendor/assets/javascripts/locales/jquery.timeago.sk.js
- vendor/assets/javascripts/locales/jquery.timeago.sl.js
- vendor/assets/javascripts/locales/jquery.timeago.sv.js
- vendor/assets/javascripts/locales/jquery.timeago.th.js
- vendor/assets/javascripts/locales/jquery.timeago.tr.js
- vendor/assets/javascripts/locales/jquery.timeago.uk.js
- vendor/assets/javascripts/locales/jquery.timeago.uz.js
- vendor/assets/javascripts/locales/jquery.timeago.vi.js
- vendor/assets/javascripts/locales/jquery.timeago.zh-CN.js
- vendor/assets/javascripts/locales/jquery.timeago.zh-TW.js
homepage: https://github.com/jgraichen/rails-timeago
licenses:
- MIT
metadata: {}
post_install_message:
rdoc_options: []
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
rubyforge_project:
rubygems_version: 2.2.2
signing_key:
specification_version: 4
summary: A Rails Helper to create time tags usable for jQuery Timeago plugin
test_files: []
rails-timeago-2.11.1/lib/ 0000755 0000764 0000764 00000000000 12412436741 014137 5 ustar pravi pravi rails-timeago-2.11.1/lib/assets/ 0000755 0000764 0000764 00000000000 12412436741 015441 5 ustar pravi pravi rails-timeago-2.11.1/lib/assets/javascripts/ 0000755 0000764 0000764 00000000000 12412436741 017772 5 ustar pravi pravi rails-timeago-2.11.1/lib/assets/javascripts/rails-timeago.js 0000644 0000764 0000764 00000000315 12412436741 023064 0 ustar pravi pravi //
// jQuery Timeago bootstrap for rails-timeago helper
//
//= require jquery.timeago
(function($) {
$(document).on('ready page:load', function() {
$('time[data-time-ago]').timeago();
});
})(jQuery);
rails-timeago-2.11.1/lib/assets/javascripts/rails-timeago-all.js 0000644 0000764 0000764 00000004021 12412436741 023630 0 ustar pravi pravi // Rails timeago bootstrap with all locales
//= require rails-timeago
//= require locales/jquery.timeago.ar.js
//= require locales/jquery.timeago.bg.js
//= require locales/jquery.timeago.bs.js
//= require locales/jquery.timeago.ca.js
//= require locales/jquery.timeago.cs.js
//= require locales/jquery.timeago.cy.js
//= require locales/jquery.timeago.da.js
//= require locales/jquery.timeago.de.js
//= require locales/jquery.timeago.el.js
//= require locales/jquery.timeago.en-short.js
//= require locales/jquery.timeago.es-short.js
//= require locales/jquery.timeago.es.js
//= require locales/jquery.timeago.et.js
//= require locales/jquery.timeago.fa.js
//= require locales/jquery.timeago.fi.js
//= require locales/jquery.timeago.fr-short.js
//= require locales/jquery.timeago.fr.js
//= require locales/jquery.timeago.gl.js
//= require locales/jquery.timeago.he.js
//= require locales/jquery.timeago.hr.js
//= require locales/jquery.timeago.hu.js
//= require locales/jquery.timeago.hy.js
//= require locales/jquery.timeago.id.js
//= require locales/jquery.timeago.is.js
//= require locales/jquery.timeago.it.js
//= require locales/jquery.timeago.ja.js
//= require locales/jquery.timeago.jv.js
//= require locales/jquery.timeago.ko.js
//= require locales/jquery.timeago.lt.js
//= require locales/jquery.timeago.mk.js
//= require locales/jquery.timeago.nl.js
//= require locales/jquery.timeago.no.js
//= require locales/jquery.timeago.pl.js
//= require locales/jquery.timeago.pt-br.js
//= require locales/jquery.timeago.pt.js
//= require locales/jquery.timeago.ro.js
//= require locales/jquery.timeago.rs.js
//= require locales/jquery.timeago.ru.js
//= require locales/jquery.timeago.sk.js
//= require locales/jquery.timeago.sl.js
//= require locales/jquery.timeago.sv.js
//= require locales/jquery.timeago.th.js
//= require locales/jquery.timeago.tr.js
//= require locales/jquery.timeago.uk.js
//= require locales/jquery.timeago.uz.js
//= require locales/jquery.timeago.vi.js
//= require locales/jquery.timeago.zh-CN.js
//= require locales/jquery.timeago.zh-TW.js
rails-timeago-2.11.1/lib/rails-timeago/ 0000755 0000764 0000764 00000000000 12412436741 016674 5 ustar pravi pravi rails-timeago-2.11.1/lib/rails-timeago/version.rb 0000644 0000764 0000764 00000000342 12412436741 020705 0 ustar pravi pravi module Rails
module Timeago
module VERSION
MAJOR = 2
MINOR = 11
PATCH = 1
STAGE = nil
def self.to_s
[MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join '.'
end
end
end
end
rails-timeago-2.11.1/lib/rails-timeago/helper.rb 0000644 0000764 0000764 00000005576 12412436741 020515 0 ustar pravi pravi require 'active_support/time'
module Rails
module Timeago
module Helper
# Create a time tag usable for jQuery timeago plugin.
#
# timeago_tag Time.zone.now
# => ""
#
# Available options:
# [:+nojs+]
# Add time ago in words as time tag content instead of absolute time.
# (default: false)
#
# [:+date_only+]
# Only print date as tag content instead of full time.
# (default: true)
#
# [:+format+]
# A time format for localize method used to format static time.
# (default: :default)
#
# [:+limit+]
# Set a limit for time ago tags. All dates before given limit will not be converted.
# (default: 4.days.ago)
#
# [:+force+]
# Force time ago tag ignoring limit option.
# (default: false)
#
# [:+default+]
# String that will be returned if time is nil.
# (default: '-')
#
# All other options will be given as options to tag helper.
#
def timeago_tag(time, html_options = {})
time_options = Rails::Timeago.default_options
time_options = time_options.merge html_options.extract!(*time_options.keys.select{|k| html_options.include?(k)})
return time_options[:default] if time.nil?
time_options[:format] = time_options[:format].call(time, time_options) if time_options[:format].is_a?(Proc)
if time_options[:title]
html_options.merge! :title => time_options[:title].is_a?(Proc) ? time_options[:title].call(time, time_options) : time_options[:title]
end
time_options[:limit] = time_options[:limit].call if time_options[:limit].is_a?(Proc)
time_range = unless time_options[:limit].nil?
now = Time.zone.now
limit = time_options[:limit]
limit < now ? limit...now : now...limit
else
nil
end
if time_options[:force] or time_range.nil? or time_range.cover?(time)
html_options.merge!('data-time-ago' => time.iso8601)
end
time_tag time, timeago_tag_content(time, time_options), html_options
end
def timeago_tag_content(time, time_options = {}) # :nodoc:
time = time.to_date if time_options[:date_only]
return time_ago_in_words(time) if time_options[:nojs] and (time_options[:limit].nil? or time_options[:limit] < time)
I18n.l time, :format => time_options[:format]
end
# Return a JavaScript tag to set jQuery timeago locale.
def timeago_script_tag
javascript_tag "jQuery.timeago.settings.lang=\"#{I18n.locale}\";" if I18n.locale != 'en'
end
end
end
end
rails-timeago-2.11.1/lib/rails-timeago.rb 0000644 0000764 0000764 00000004122 12412436741 017220 0 ustar pravi pravi require "rails-timeago/version"
require "rails-timeago/helper"
module Rails
module Timeago
if defined?(::Rails::Engine)
class Engine < ::Rails::Engine # :nodoc:
initializer 'rails-timeago', :group => :all do |app|
ActiveSupport.on_load(:action_controller) do
include Rails::Timeago::Helper
end
ActiveSupport.on_load(:action_view) do
include Rails::Timeago::Helper
end
end
end
end
# Read or write global rails-timeago default options. If no options are given
# the current defaults will be returned.
#
# Available options:
# [:+nojs+]
# Add time ago in words as time tag content instead of absolute time.
# (default: false)
#
# [:+date_only+]
# Only print date as tag content instead of full time.
# (default: true)
#
# [:+format+]
# A time format for localize method used to format static time.
# (default: :default)
#
# [:+limit+]
# Set a limit for time ago tags. All dates before given limit will not be converted.
# Global limit should be given as a block to reevaluate limit each time timeago_tag is called.
# (default: proc { 4.days.ago })
#
# [:+force+]
# Force time ago tag ignoring limit option.
# (default: false)
#
# [:+default+]
# String that will be returned if time is nil.
# (default: '-')
#
def self.default_options(opts = nil)
@defaults ||= self.option_hash
if opts
@defaults.merge! opts.extract!(*@defaults.keys.select{|k| opts.include?(k)})
else
@defaults
end
end
# Reset options to default values
def self.reset_default_options
@defaults = self.option_hash
end
def self.option_hash
{
:nojs => false,
:force => false,
:format => :default,
:limit => proc { 4.days.ago },
:date_only => true,
:default => '-',
:title => proc { |time, options| I18n.l time, :format => options[:format] }
}
end
end
end
rails-timeago-2.11.1/Rakefile 0000644 0000764 0000764 00000002674 12412436741 015047 0 ustar pravi pravi #!/usr/bin/env rake
require "bundler/gem_tasks"
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
desc 'Update jquery-timeago from upstream'
task :update do
puts "Clone repository.."
puts `mkdir ./tmp`
puts `git clone https://github.com/rmm5t/jquery-timeago.git ./tmp`
puts "Patch jquery timeago..."
puts `cd ./tmp && patch -p1 < ../scripts/jquery.timeago.js.patch`
print 'Patch locale files ... '
`rm ./tmp/locales/jquery.timeago.en.js`
is_mac = RUBY_PLATFORM.downcase.include?("darwin")
Dir["./tmp/locales/*.js"].each do |file|
if file =~ /jquery\.timeago\.(.+)\.js$/
`sed -i#{(is_mac)? " ''": nil} "s/timeago.settings.strings/timeago.settings.strings[\\"#{$1}\\"]/" #{file}`
print "#{$1} "
end
end
puts
puts "Copying asset files..."
puts `cp ./tmp/jquery.timeago.js ./vendor/assets/javascripts/`
puts `rm ./vendor/assets/javascripts/locales/*`
puts `cp ./tmp/locales/*.js ./vendor/assets/javascripts/locales`
puts "Generate rails-timeago-all.js..."
`echo "// Rails timeago bootstrap with all locales" > ./lib/assets/javascripts/rails-timeago-all.js`
`echo "//= require rails-timeago" >> ./lib/assets/javascripts/rails-timeago-all.js`
Dir["./vendor/assets/javascripts/locales/*.js"].sort.each do |file|
`echo "//= require locales/#{File.basename(file)}" >> ./lib/assets/javascripts/rails-timeago-all.js`
end
puts "Clean up..."
puts `rm -rf ./tmp`
end
rails-timeago-2.11.1/.gitignore 0000644 0000764 0000764 00000000300 12412436741 015352 0 ustar pravi pravi *.gem
*.rbc
*.iml
.bundle
.config
.yardoc
.idea
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
.rvmrc
.ruby-version
tags