1 // Generated by CoffeeScript 1.3.3
4 Readings.Tag = (function() {
7 this.href = record.href;
8 this.name = record.name;
9 this.slug = $.grep(this.href.split('/'), function(e) {
14 Tag.prototype.render = function() {
15 return "<li><a href=\"#\">" + this.name + "</a></li>";
22 $.fn.Readings.TagList = function(category) {
23 return this.each(function() {
25 $('[data-role=header] h1').text(Readings.config.get('categories')[category]);
26 list = $('[data-role=listview]', this);
28 url: Readings.config.get('wlurl') + ("/api/" + category),
30 success: function(data) {
31 var t, tags, _i, _len;
33 tags = $.map(data, function(rec) {
34 return new Readings.Tag(rec);
37 for (_i = 0, _len = tags.length; _i < _len; _i++) {
39 list.append(t.render());
41 return list.listview('refresh');