Merge pull request #2 from danbarretodev/5637-imanol

5637
1.9.x
ilosada 11 years ago
commit 9dea644c79
  1. 7
      main/inc/ajax/social.ajax.php
  2. 22
      main/inc/lib/javascript/jquery-timeago/LICENSE.txt
  3. 109
      main/inc/lib/javascript/jquery-timeago/README.markdown
  4. 17
      main/inc/lib/javascript/jquery-timeago/Rakefile
  5. 13
      main/inc/lib/javascript/jquery-timeago/bower.json
  6. 221
      main/inc/lib/javascript/jquery-timeago/jquery.timeago.js
  7. 27
      main/inc/lib/javascript/jquery-timeago/locales/README.md
  8. 96
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.ar.js
  9. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.bg.js
  10. 49
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.bs.js
  11. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.ca.js
  12. 24
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.cs.js
  13. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.cy.js
  14. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.da.js
  15. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.de.js
  16. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.el.js
  17. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.en-short.js
  18. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.en.js
  19. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.es-short.js
  20. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.es.js
  21. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.et.js
  22. 22
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.fa.js
  23. 28
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.fi.js
  24. 16
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.fr-short.js
  25. 17
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.fr.js
  26. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.gl.js
  27. 16
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.he.js
  28. 49
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.hr.js
  29. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.hu.js
  30. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.hy.js
  31. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.id.js
  32. 19
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.is.js
  33. 16
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.it.js
  34. 19
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.ja.js
  35. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.jv.js
  36. 17
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.ko.js
  37. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.lt.js
  38. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.mk.js
  39. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.nl.js
  40. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.no.js
  41. 31
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.pl.js
  42. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.pt-br.js
  43. 16
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.pt.js
  44. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.ro.js
  45. 49
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.rs.js
  46. 34
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.ru.js
  47. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.sk.js
  48. 44
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.sl.js
  49. 18
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.sv.js
  50. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.th.js
  51. 16
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.tr.js
  52. 34
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.uk.js
  53. 19
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.uz.js
  54. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.vi.js
  55. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.zh-CN.js
  56. 20
      main/inc/lib/javascript/jquery-timeago/locales/jquery.timeago.zh-TW.js
  57. 33
      main/inc/lib/javascript/jquery-timeago/package.json
  58. 30
      main/inc/lib/javascript/jquery-timeago/timeago.jquery.json
  59. 6
      main/inc/lib/social.lib.php
  60. 20
      main/social/profile.php

@ -188,7 +188,7 @@ switch ($action) {
case 'listWallMessage':
$start = isset($_REQUEST['start']) ? intval($_REQUEST['start']) - 1 : 0;
$length = isset($_REQUEST['length']) ? intval($_REQUEST['length']) : 10;
$userId = api_get_user_id();
$userId = isset($_REQUEST['u']) ? intval($_REQUEST['u']) : api_get_user_id();
$friendId = $userId;
$array = SocialManager::getWallMessagesPostHTML($userId, $friendId, null, $length, $start);
if (!empty($array)) {
@ -202,15 +202,14 @@ switch ($action) {
$html .= Display::div(
Display::url(
get_lang('Next'),
api_get_self() . '?a=listWallMessage&start=' .
api_get_self() . '?u=' . $userId . '&a=listWallMessage&start=' .
($start + $length + 1) . '&length=' . $length,
array(
'class' => 'nextPage',
'style' => 'display: none;'
)
),
array(
'class' => 'next'
'class' => 'next',
)
);
echo $html;

@ -0,0 +1,22 @@
Copyright (c) 2008-2013 Ryan McGeary
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.

@ -0,0 +1,109 @@
# timeago: a jQuery plugin
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") from ISO 8601
formatted dates and times embedded in your HTML (à la microformats).
## How You Can Help
**If you like this project, please help. [Donate via Gittip][gittip] or [buy me a coffee with Bitcoin][bitcoin].**<br>
[![Gittip](http://img.shields.io/gittip/rmm5t.svg)][gittip]
[![Bitcoin](http://img.shields.io/badge/bitcoin-buy%20me%20a%20coffee-brightgreen.svg)][bitcoin]
**[Bitcoin][bitcoin]**: `1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m`<br>
[![Bitcoin Donation][bitcoin-qr-small]][bitcoin-qr-big]
## Need Help?
**You can [book a session with me on Codementor][codementor].**<br>
[![Book a Codementor session](http://img.shields.io/badge/codementor-book%20a%20session-orange.svg)][codementor]
[gittip]: https://www.gittip.com/rmm5t/ "Donate to rmm5t for open source!"
[bitcoin]: https://blockchain.info/address/1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m "Buy rmm5t a coffee for open source!"
[bitcoin-scheme]: bitcoin:1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m?amount=0.01&label=Coffee%20to%20rmm5t%20for%20Open%20Source "Buy rmm5t a coffee for open source!"
[bitcoin-qr-small]: http://chart.apis.google.com/chart?cht=qr&chs=150x150&chl=bitcoin%3A1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m%3Famount%3D0.01%26label%3DCoffee%2520to%2520rmm5t%2520for%2520Open%2520Source
[bitcoin-qr-big]: http://chart.apis.google.com/chart?cht=qr&chs=500x500&chl=bitcoin%3A1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m%3Famount%3D0.01%26label%3DCoffee%2520to%2520rmm5t%2520for%2520Open%2520Source
[codementor]: https://www.codementor.io/rmm5t?utm_campaign=profile&utm_source=button-rmm5t&utm_medium=shields "Book a session with rmm5t on Codementor!"
## Usage
First, load jQuery and the plugin:
```html
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery.timeago.js" type="text/javascript"></script>
```
Now, let's attach it to your timestamps on DOM ready - put this in the head
section:
```html
<script type="text/javascript">
jQuery(document).ready(function() {
$("abbr.timeago").timeago();
});
</script>
```
This will turn all abbr elements with a class of timeago and an ISO 8601
timestamp in the title (conforming to the
[datetime design pattern microformat](http://microformats.org/wiki/datetime-design-pattern)):
```html
<abbr class="timeago" title="2011-12-17T09:24:17Z">December 17, 2011</abbr>
```
into something like this:
```html
<abbr class="timeago" title="December 17, 2011">about 1 day ago</abbr>
```
HTML5 `<time>` elements are also supported:
```html
<time class="timeago" datetime="2011-12-17T09:24:17Z">December 17, 2011</time>
```
As time passes, the timestamps will automatically update.
**For more usage and examples**: [http://timeago.yarp.com/](http://timeago.yarp.com/)
**For different language configurations**: visit the [`locales`](https://github.com/rmm5t/jquery-timeago/tree/master/locales) directory.
## Changes
| Version | Notes |
|---------|---------------------------------------------------------------------------------|
| 1.4.x | ([compare][compare-1.4]) Added allowPast setting |
| 1.3.x | ([compare][compare-1.3]) Added updateFromDOM function; bug fixes; bower support |
| 1.2.x | ([compare][compare-1.2]) Added cutoff setting |
| 1.1.x | ([compare][compare-1.1]) Added update function |
| 1.0.x | ([compare][compare-1.0]) locale updates; bug fixes; AMD wrapper |
| 0.11.x | ([compare][compare-0.11]) natural rounding; locale updates; |
| 0.10.x | ([compare][compare-0.10]) locale updates |
| 0.9.x | ([compare][compare-0.9]) microsecond support; bug fixes |
| 0.8.x | ([compare][compare-0.8]) `<time>` element support; bug fixes |
| 0.7.x | ([compare][compare-0.7]) locale function overrides; unit tests |
| ... | ... |
[compare-1.4]: https://github.com/rmm5t/jquery-timeago/compare/v1.3.2...v1.4.1
[compare-1.3]: https://github.com/rmm5t/jquery-timeago/compare/v1.2.0...v1.3.2
[compare-1.2]: https://github.com/rmm5t/jquery-timeago/compare/v1.1.0...v1.2.0
[compare-1.1]: https://github.com/rmm5t/jquery-timeago/compare/v1.0.2...v1.1.0
[compare-1.0]: https://github.com/rmm5t/jquery-timeago/compare/v0.11.4...v1.0.2
[compare-0.11]: https://github.com/rmm5t/jquery-timeago/compare/v0.10.1...v0.11.4
[compare-0.10]: https://github.com/rmm5t/jquery-timeago/compare/v0.9.3...v0.10.1
[compare-0.9]: https://github.com/rmm5t/jquery-timeago/compare/v0.8.2...v0.9.3
[compare-0.8]: https://github.com/rmm5t/jquery-timeago/compare/v0.7.2...v0.8.2
[compare-0.7]: https://github.com/rmm5t/jquery-timeago/compare/v0.6.2...v0.7.2
## Author
[Ryan McGeary](http://ryan.mcgeary.org) ([@rmm5t](http://twitter.com/rmm5t))
## Other
[MIT License](http://www.opensource.org/licenses/mit-license.php)
Copyright (c) 2008-2013, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)

@ -0,0 +1,17 @@
require "bundler/setup"
task :default => :test
desc "Publish \"marketing\" docs"
task :publish do
sh("git rebase master gh-pages")
sh("git checkout master")
sh("git push origin master")
sh("git push origin gh-pages")
sh("git push --tags")
end
desc "Open your default browser with the test page"
task :test do
sh("open test/index.html")
end

@ -0,0 +1,13 @@
{
"name": "jquery-timeago",
"version": "1.4.1",
"license": "MIT",
"main": "jquery.timeago.js",
"ignore": [
"test",
"vendor"
],
"dependencies": {
"jquery": ">=1.4"
}
}

@ -0,0 +1,221 @@
/**
* 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,
strings: {
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) {
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;
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.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));
}
}
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) {
return $t.inWords(distance(date));
}
function distance(date) {
return (new Date().getTime() - date.getTime());
}
// fix for IE6 suckage
document.createElement("abbr");
document.createElement("time");
}));

@ -0,0 +1,27 @@
# Locale override examples for timeago
You can represent time statements in most western languages where
a prefix and/or suffix is used.
The default case is to use suffix only (as in English), which you
do by providing the `suffixAgo` and `suffixFromNow` settings in
the strings hash (earlier versions of timeago used the deprecated
`ago` and `fromNow` options). If present, they are used.
2 minutes [suffixAgo]
2 minutes [suffixFromNow]
In case you want to use prefix only instead of
suffix (e.g. Greek), you provide the `prefixAgo` and
`prefixFromNow` options in the strings hash and leave `suffixAgo`
and `suffixFromNow` empty or null.
[prefixAgo] 2 minutes
[prefixFromNow] 2 minutes
For languages where you want to use a prefix only for future
tense and prefix/suffix for past tense (for example swedish), you
can combine the prefix and suffixes as needed.
[prefixAgo] 2 minutes [suffixAgo]
[prefixFromNow] 2 minutes

@ -0,0 +1,96 @@
(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 = {
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 عام']);}
};
})();

@ -0,0 +1,18 @@
// Bulgarian
jQuery.timeago.settings.strings = {
prefixAgo: "преди",
prefixFromNow: "след",
suffixAgo: null,
suffixFromNow: null,
seconds: "по-малко от минута",
minute: "една минута",
minutes: "%d минути",
hour: "един час",
hours: "%d часа",
day: "един ден",
days: "%d дни",
month: "един месец",
months: "%d месеца",
year: "една година",
years: "%d години"
};

@ -0,0 +1,49 @@
// 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 = {
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);

@ -0,0 +1,18 @@
// Catalan
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,24 @@
// Czech
(function() {
function f(n, d, a) {
return a[d>=0 ? 0 : a.length==2 || n<5 ? 1 : 2];
}
jQuery.timeago.settings.strings = {
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'])}
};
})();

@ -0,0 +1,20 @@
// Welsh
jQuery.timeago.settings.strings = {
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: []
};

@ -0,0 +1,18 @@
// Danish
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,18 @@
// German
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,18 @@
// Greek
jQuery.timeago.settings.strings = {
prefixAgo: "πριν",
prefixFromNow: "σε",
suffixAgo: "",
suffixFromNow: "",
seconds: "λιγότερο από ένα λεπτό",
minute: "περίπου ένα λεπτό",
minutes: "%d λεπτά",
hour: "περίπου μία ώρα",
hours: "περίπου %d ώρες",
day: "μία μέρα",
days: "%d μέρες",
month: "περίπου ένα μήνα",
months: "%d μήνες",
year: "περίπου ένα χρόνο",
years: "%d χρόνια"
};

@ -0,0 +1,20 @@
// English shortened
jQuery.timeago.settings.strings = {
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: []
};

@ -0,0 +1,20 @@
// English (Template)
jQuery.timeago.settings.strings = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "ago",
suffixFromNow: "from 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: []
};

@ -0,0 +1,20 @@
// Spanish shortened
jQuery.timeago.settings.strings = {
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: []
};

@ -0,0 +1,18 @@
// Spanish
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,18 @@
// Estonian
jQuery.timeago.settings.strings = {
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" }
};

@ -0,0 +1,22 @@

// Persian
// Use DIR attribute for RTL text in Persian Language for ABBR tag .
// By MB.seifollahi@gmail.com
jQuery.timeago.settings.strings = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "پیش",
suffixFromNow: "از حال",
seconds: "کمتر از یک دقیقه",
minute: "حدود یک دقیقه",
minutes: "%d دقیقه",
hour: "حدود یک ساعت",
hours: "حدود %d ساعت",
day: "یک روز",
days: "%d روز",
month: "حدود یک ماه",
months: "%d ماه",
year: "حدود یک سال",
years: "%d سال",
wordSeparator: " "
};

@ -0,0 +1,28 @@
// Finnish
jQuery.timeago.settings.strings = {
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.

@ -0,0 +1,16 @@
// French shortened
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,17 @@
// French
jQuery.timeago.settings.strings = {
// 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"
};

@ -0,0 +1,18 @@
// Galician
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,16 @@
// Hebrew
jQuery.timeago.settings.strings = {
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 שנים"}
};

@ -0,0 +1,49 @@
// 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 = {
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);

@ -0,0 +1,18 @@
// Hungarian
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,18 @@
// Armenian
jQuery.timeago.settings.strings = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "առաջ",
suffixFromNow: "հետո",
seconds: "վայրկյաններ",
minute: "մեկ րոպե",
minutes: "%d րոպե",
hour: "մեկ ժամ",
hours: "%d ժամ",
day: "մեկ օր",
days: "%d օր",
month: "մեկ ամիս",
months: "%d ամիս",
year: "մեկ տարի",
years: "%d տարի"
};

@ -0,0 +1,18 @@
// Indonesian
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,19 @@
jQuery.timeago.settings.strings = {
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: []
};

@ -0,0 +1,16 @@
// Italian
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,19 @@
// Japanese
jQuery.timeago.settings.strings = {
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: ""
};

@ -0,0 +1,18 @@
// Javanesse (Boso Jowo)
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,17 @@
// Korean
jQuery.timeago.settings.strings = {
suffixAgo: "전",
suffixFromNow: "후",
seconds: "1분 이내",
minute: "1분",
minutes: "%d분",
hour: "1시간",
hours: "%d시간",
day: "하루",
days: "%d일",
month: "한 달",
months: "%d달",
year: "1년",
years: "%d년",
wordSeparator: " "
};

@ -0,0 +1,20 @@
//Lithuanian
jQuery.timeago.settings.strings = {
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: []
};

@ -0,0 +1,20 @@
// Macedonian
(function() {
jQuery.timeago.settings.strings={
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 години"
}
})();

@ -0,0 +1,20 @@
// Dutch
jQuery.timeago.settings.strings = {
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: []
};

@ -0,0 +1,18 @@
// Norwegian
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,31 @@
// 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 = {
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"); }
};
})();

@ -0,0 +1,18 @@
// Brazilian Portuguese
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,16 @@
// Portuguese
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,18 @@
// Romanian
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,49 @@
// 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 = {
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);

@ -0,0 +1,34 @@
// 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 = {
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 лет"); }
};
})();

@ -0,0 +1,18 @@
// Slovak
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,44 @@
// 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 = {
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);

@ -0,0 +1,18 @@
// Swedish
jQuery.timeago.settings.strings = {
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"
};

@ -0,0 +1,20 @@
// Thai
jQuery.timeago.settings.strings = {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "ทแลว",
suffixFromNow: "จากตอนน",
seconds: "นอยกวาหนงนาท",
minute: "ประมาณหนงนาท",
minutes: "%d นาท",
hour: "ประมาณหนงชวโมง",
hours: "ประมาณ %d ชวโมง",
day: "หนงวน",
days: "%d วน",
month: "ประมาณหนงเดอน",
months: "%d เดอน",
year: "ประมาณหนงป",
years: "%d ป",
wordSeparator: "",
numbers: []
};

@ -0,0 +1,16 @@
// Turkish
jQuery.timeago.settings.strings = {
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'
};

@ -0,0 +1,34 @@
// 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 = {
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 років"); }
};
})();

@ -0,0 +1,19 @@
//Uzbek
jQuery.timeago.settings.strings = {
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: " "
};

@ -0,0 +1,20 @@
// Vietnamese
jQuery.timeago.settings.strings = {
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: []
};

@ -0,0 +1,20 @@
// Simplified Chinese
jQuery.timeago.settings.strings = {
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: ""
};

@ -0,0 +1,20 @@
// Traditional Chinese, zh-tw
jQuery.timeago.settings.strings = {
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: ""
};

@ -0,0 +1,33 @@
{
"name": "timeago",
"version": "1.4.1",
"title": "jQuery Timeago",
"author": {
"name": "Ryan McGeary",
"email": "ryan@mcgeary.org",
"url": "http://ryan.mcgeary.org/"
},
"licenses": [
{
"type": "MIT",
"url": "http://opensource.org/licenses/mit-license.php"
}
],
"dependencies": {
"jquery": ">=1.2.3"
},
"description": "jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. \"4 minutes ago\" or \"about 1 day ago\").",
"keywords": [
"time",
"microformat"
],
"homepage": "http://timeago.yarp.com/",
"docs": "https://github.com/rmm5t/jquery-timeago",
"demo": "http://timeago.yarp.com/",
"download": "http://timeago.yarp.com/jquery.timeago.js",
"bugs": "https://github.com/rmm5t/jquery-timeago/issues",
"maintainers": [],
"spm": {
"main": "jquery.timeago.js"
}
}

@ -0,0 +1,30 @@
{
"name": "timeago",
"version": "1.4.1",
"title": "jQuery Timeago",
"author": {
"name": "Ryan McGeary",
"email": "ryan@mcgeary.org",
"url": "http://ryan.mcgeary.org/"
},
"licenses": [
{
"type": "MIT",
"url": "http://opensource.org/licenses/mit-license.php"
}
],
"dependencies": {
"jquery": ">=1.2.3"
},
"description": "jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. \"4 minutes ago\" or \"about 1 day ago\").",
"keywords": [
"time",
"microformat"
],
"homepage": "http://timeago.yarp.com/",
"docs": "https://github.com/rmm5t/jquery-timeago",
"demo": "http://timeago.yarp.com/",
"download": "http://timeago.yarp.com/jquery.timeago.js",
"bugs": "https://github.com/rmm5t/jquery-timeago/issues",
"maintainers": []
}

@ -1301,6 +1301,8 @@ class SocialManager extends UserManager
display:block;padding-left:14px">';
$users = array();
// The messages are ordered by date descendant, for comments we need ascendant
krsort($messages);
foreach ($messages as $message) {
$date = api_get_local_time($message['send_date']);
$userIdLoop = $message['user_sender_id'];
@ -1328,7 +1330,7 @@ class SocialManager extends UserManager
$media .= '</div>';
$media .= '<div style="width: 100%; height: 50%;">';
$media .= '<div class="pull-left" style="height: 100%;">';
$media .= '<small><span class="time" title="'.$date.'">'.$date.'</span></small>';
$media .= '<small><span class="time timeago" title="'.$date.'">'.$date.'</span></small>';
$media .= '</div>';
$media .= '</div>';
$media .= '</div>';
@ -1459,7 +1461,7 @@ class SocialManager extends UserManager
$html .= '</div>';
$html .= '<div style="width: 100%; height: 50%;">';
$html .= '<div class="pull-left" style="height: 100%;">';
$html .= '<small><span class="time" title="'.$date.'">'.$date.'</span></small>';
$html .= '<small><span class="time timeago" title="'.$date.'">'.$date.'</span></small>';
$html .= '</div>';
$html .= '</div>';
$html .= '</div>';

@ -113,9 +113,17 @@ require_once api_get_path(SYS_CODE_PATH).'announcements/announcements.inc.php';
require_once $libpath.'magpierss/rss_fetch.inc';
$ajax_url = api_get_path(WEB_AJAX_PATH).'message.ajax.php';
$socialAjaxUrl = api_get_path(WEB_AJAX_PATH).'social.ajax.php';
$javascriptDir = api_get_path(LIBRARY_PATH) . 'javascript/';
api_block_anonymous_users();
$locale = _api_get_locale_from_language();
// Add Jquery scroll pagination plugin
$htmlHeadXtra[] = api_get_js('jscroll/jquery.jscroll.js');
// Add Jquery Time ago plugin
$htmlHeadXtra[] = api_get_js('jquery-timeago/jquery.timeago.js');
$timeAgoLocaleDir = $javascriptDir . 'jquery-timeago/locales/jquery.timeago.' . $locale . '.js';
if (file_exists($timeAgoLocaleDir)) {
$htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.' . $locale . '.js');
}
$htmlHeadXtra[] = '<script>
@ -264,11 +272,16 @@ $(document).ready(function (){
loadingHtml: "<div class=\"well_border\">' . get_lang('Loading') . ' </div>",
nextSelector: "a.nextPage:last",
contentSelector: "",
debug: true
callback: timeAgo
});
timeAgo()
});
function timeAgo() {
$(".timeago").timeago();
}
function display_hide () {
setTimeout("hide_display_message()",3000);
}
@ -418,10 +431,9 @@ $social_right_content .= SocialManager::social_wrapper_div($wallSocialAddPost, 5
$social_right_content .= wallSocialPost($my_user_id, $friendId);
$socialAutoExtendLink = Display::url(
get_lang('Next'),
$socialAjaxUrl . '?a=listWallMessage&start=10&length=5',
$socialAjaxUrl . '?u='. $my_user_id . '&a=listWallMessage&start=10&length=5',
array(
'class' => 'nextPage next',
'style' => 'display: none;'
)
);

Loading…
Cancel
Save