- if ((category != null) && (category[1] != null)) {
- return $(this).Readings('list', {
- category: category[1],
- url: Readings.config.get('wlurl') + ("/api/" + category[1]),
- filter: Readings.config.get('show_filter').indexOf(category[1]) >= 0,
- mapper: function(rec) {
- return new Readings.Tag(rec, category[1]);
+ if (category != null) {
+ category = category[1];
+ if (category != null) {
+ return $(this).Readings('list', {
+ sql: "SELECT * FROM tag WHERE category=? ORDER BY sort_key",
+ params: [category],
+ filter: Readings.config.get('show_filter').indexOf(category) >= 0,
+ mapper: function(rec) {
+ return new Readings.Tag(rec, category);
+ },
+ dividers: Readings.config.get('show_dividers').indexOf(category) >= 0
+ });
+ }
+ }
+ return alert('no category in query string');
+ });
+
+ $(document).on('pageinit', '#page-books', function(ev, ui) {
+ var tag, tag_id, tag_id_m,
+ _this = this;
+ tag_id_m = rtagid.exec($(this).attr('data-url'));
+ if (tag_id_m != null) tag_id = tag_id_m[1];
+ return tag = Readings.catalogue.withTag(tag_id, function(tag) {
+ return $(_this).Readings('list', {
+ fetch: function(cb) {
+ return Readings.catalogue.withBooks(tag, cb);