hack to fix the timeago for other languages. ohaibbq can you find why this broke in the first place?

This commit is contained in:
maxwell 2011-04-18 18:11:03 -07:00
parent d70ef86337
commit 14bfdbd4a9
2 changed files with 10 additions and 3 deletions

View file

@ -29,4 +29,4 @@ Diaspora.widgets.add("i18n", function() {
return ret;
};
});
});

View file

@ -5,8 +5,10 @@
Diaspora.widgets.add("timeago", function() {
this.selector = "abbr.timeago";
this.not_done = true;
this.start = function() {
this.not_done = false;
InfiniteScroll.postScroll(function(){
Diaspora.widgets.timeago.updateTimeAgo();
});
@ -16,7 +18,7 @@ Diaspora.widgets.add("timeago", function() {
}
$.each($.timeago.settings.strings, function(index, element) {
$.timeago.settings.strings[index] = Diaspora.widgets.i18n.t("timeago." + element);
$.timeago.settings.strings[index] = Diaspora.widgets.i18n.t("timeago." + index);
});
@ -24,6 +26,11 @@ Diaspora.widgets.add("timeago", function() {
};
this.updateTimeAgo = function(selector) {
if(this.not_done === true){
this.not_done = false;
Diaspora.widgets.timeago.start();
}
$(selector || this.selector).timeago();
};
});