update timeago usages
This commit is contained in:
parent
0831ad6e40
commit
b89a59ca55
8 changed files with 20 additions and 22 deletions
|
|
@ -15,5 +15,6 @@ $(document).ready(function() {
|
|||
loadingText: "",
|
||||
loadingImg: '/images/ajax-loader.gif'
|
||||
});
|
||||
$("abbr.timeago").timeago();
|
||||
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@
|
|||
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
||||
|
||||
= include_javascripts :mobile
|
||||
- if ["cz", "da", "de", "el", "es", "fr", "he", "hu", "id", "it", "ja", "ko", "nl", "pl", "pt", "ro", "ru", "sv", "zh-CN"].include?(I18n.locale.to_s)
|
||||
= javascript_include_tag "vendor/timeago_locale/jquery.timeago.#{I18n.locale.to_s}.js"
|
||||
-if current_user
|
||||
:javascript
|
||||
Diaspora.widgets.i18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}");
|
||||
|
||||
= stylesheet_link_tag 'vendor/jquery_mobile.min', 'mobile'
|
||||
= csrf_meta_tag
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ javascripts:
|
|||
- public/javascripts/vendor/timeago.js
|
||||
- public/javascripts/mobile.js
|
||||
- public/javascripts/application.js
|
||||
- public/javascripts/diaspora.js
|
||||
- public/javascripts/widgets/alert.js
|
||||
- public/javascripts/widgets/i18n.js
|
||||
- public/javascripts/widgets/timeago.js
|
||||
mailchimp:
|
||||
- public/javascripts/vendor/mailchimp/jquery.form.js
|
||||
- public/javascripts/vendor/mailchimp/jquery.validate.js
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ $(document).ready(function() {
|
|||
.detach()
|
||||
.appendTo("#main_stream")
|
||||
.css("display", "block");
|
||||
$("abbr.timeago").timeago();
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
});
|
||||
|
||||
$(window).unbind('.infscr');
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@
|
|||
var Stream = {
|
||||
initialize: function() {
|
||||
var $stream = $(".stream");
|
||||
var $publisher = $("#publisher");
|
||||
|
||||
$("abbr.timeago").timeago();
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
$stream.not(".show").delegate("a.show_post_comments", "click", Stream.toggleComments);
|
||||
|
||||
// comment link form focus
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ var WebSocketReceiver = {
|
|||
}
|
||||
}
|
||||
|
||||
$("abbr.timeago").timeago();
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
},
|
||||
|
||||
processPost: function(className, postId, html, aspectIds) {
|
||||
|
|
@ -134,7 +134,7 @@ var WebSocketReceiver = {
|
|||
showMessage();
|
||||
}
|
||||
}
|
||||
$("abbr.timeago").timeago();
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
},
|
||||
|
||||
onPageForClass: function(className) {
|
||||
|
|
|
|||
|
|
@ -13,19 +13,7 @@ Diaspora.widgets.add("i18n", function() {
|
|||
|
||||
this.loadLocale = function(locale, language) {
|
||||
this.language = language;
|
||||
|
||||
if(typeof locale !== "undefined") {
|
||||
this.locale = locale;
|
||||
return;
|
||||
}
|
||||
|
||||
if(!this.locale) {
|
||||
function setLocale(data) {
|
||||
this.locale = $.parseJSON(data);
|
||||
}
|
||||
|
||||
$.getJSON("/localize", setLocale);
|
||||
}
|
||||
};
|
||||
|
||||
this.t = function(item, views) {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
Diaspora.widgets.add("timeago", function() {
|
||||
this.selector = "abbr.timeago";
|
||||
|
||||
this.start = function() {
|
||||
if(Diaspora.widgets.i18n.language === "en") {
|
||||
return;
|
||||
|
|
@ -33,6 +35,6 @@ Diaspora.widgets.add("timeago", function() {
|
|||
};
|
||||
|
||||
this.updateTimeAgo = function(selector) {
|
||||
$(selector).timeago();
|
||||
$(selector || this.selector).timeago();
|
||||
};
|
||||
});
|
||||
Loading…
Reference in a new issue