endlich!!!
[ReadingsJQM.git] / js / app / app.js
1 // Generated by CoffeeScript 1.3.3
2 (function() {
3   var rcategory;
4
5   window.Readings = {};
6
7   $.fn.Readings = function() {
8     var a, args, meth, _i, _len;
9     meth = arguments[0];
10     args = [];
11     for (_i = 0, _len = arguments.length; _i < _len; _i++) {
12       a = arguments[_i];
13       args.push(a);
14     }
15     args.shift();
16     return $.fn.Readings[meth].apply(this, args);
17   };
18
19   Readings.init = function() {
20     if (Readings.initialized != null) {
21       return;
22     }
23     Readings.config = new Readings.Config({
24       wlurl: 'http://readings.local',
25       categories: {
26         'authors': 'autor',
27         'epochs': 'epoka',
28         'genres': 'gatunek',
29         'kinds': 'rodzaj',
30         'themes': 'motyw'
31       }
32     });
33     return Readings.initialized = true;
34   };
35
36   $(document).on('pageinit', '#page-categories', function(ev) {
37     Readings.init();
38     return $('#list-categories').Readings('CategoryList');
39   });
40
41   rcategory = /category=(\w+)/;
42
43   $(document).on('pageshow', "#page-tags", function(ev, ui) {
44     var category;
45     category = rcategory.exec($(this).attr('data-url'));
46     if ((category != null) && (category[1] != null)) {
47       return $(this).Readings('TagList', category[1]);
48     }
49   });
50
51 }).call(this);