blob: 2f7b224625043a73b78ec5521c90c3e0032c771a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/*
age_class
views_class
comments_class
size_class
files_class
*/
var LastLog = View.extend({
el: ".lastlog",
events: {
},
initialize: function(){
this.__super__.initialize.call(this)
this.template = this.$(".template").html()
},
load: function(lastlog){
var s = lastlog.map(this.parse.bind(this)).join(', ')
this.$el.html(s)
},
parse: function(user){
var t = this.template
.replace(/{{username}}/g, user.username)
.replace(/{{age}}/g, get_age(user.lastseen) )
.replace(/{{age_class}}/g, carbon_date(user.lastseen) )
.trim()
return t
},
})
|