diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-11-15 13:52:28 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-11-15 13:52:28 -0500 |
| commit | a4ce7bf7a9e8d472b0523e74510a4ff4c394fa3f (patch) | |
| tree | 2cfeb32ec4f11793498e99e69879ad8aac17c754 /public/assets/js/lib/views/LinksView.js | |
| parent | 94ade9321a971e81c383e14186bf4c776bd304fc (diff) | |
links view
Diffstat (limited to 'public/assets/js/lib/views/LinksView.js')
| -rw-r--r-- | public/assets/js/lib/views/LinksView.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/public/assets/js/lib/views/LinksView.js b/public/assets/js/lib/views/LinksView.js new file mode 100644 index 0000000..c8603a9 --- /dev/null +++ b/public/assets/js/lib/views/LinksView.js @@ -0,0 +1,31 @@ +var LinksView = View.extend({ + + el: "#links", + + events: { + "click a": function(){ + }, + }, + + template: $("#link_template").html(), + + initialize: function(){ + }, + + show: function(){ + $.getJSON("/_irc/links", function(data){ + data.forEach(this.append.bind(this)) + }.bind(this)) + }, + + append: function(links){ + var tmpl = this.template.replace(/{{url}}/, sanitize(data.url)) + .replace(/{{nick}}/, sanitize(data.nick)) + this.$el.append(tmpl) + }, + + loadMembers: function(){ + this.queue.forEach(this.appendMember.bind(this)) + }, + +})
\ No newline at end of file |
