X-Git-Url: https://git.mdrn.pl/ReadingsJQM.git/blobdiff_plain/c956fba7332f45e9abab07b2b8ac417b0f6514c8..45f8b33043d9aad64b1f89906323bc477efda0f3:/js/app/models.js diff --git a/js/app/models.js b/js/app/models.js new file mode 100644 index 0000000..d332ac1 --- /dev/null +++ b/js/app/models.js @@ -0,0 +1,50 @@ +// Generated by CoffeeScript 1.3.3 +(function() { + var url_to_slug; + + url_to_slug = function(url) { + var slug_in_url; + slug_in_url = /([a-z0-9-]+)[/]?$/; + return slug_in_url.exec(url)[1]; + }; + + Readings.Book = (function() { + + function Book(record) { + $.extend(this, record); + } + + Book.prototype.render = function() { + var wlurl; + wlurl = Readings.config.get('wlurl'); + return "
  • " + this.title + "

  • "; + }; + + Book.prototype.group = function() { + return this.authors; + }; + + return Book; + + })(); + + Readings.Tag = (function() { + + function Tag(record, category) { + this.category = category; + $.extend(this, record); + } + + Tag.prototype.render = function() { + return "
  • " + this.name + "
  • "; + }; + + Tag.prototype.group = function() { + return this.sort_key[0].toUpperCase(); + }; + + return Tag; + + })(); + +}).call(this);