endlich!!!
[ReadingsJQM.git] / js / app / app.js
index 79aa20c..c5a9521 100644 (file)
@@ -1,10 +1,25 @@
+// Generated by CoffeeScript 1.3.3
 (function() {
+  var rcategory;
 
   window.Readings = {};
 
-  $.fn.Readings = {};
+  $.fn.Readings = function() {
+    var a, args, meth, _i, _len;
+    meth = arguments[0];
+    args = [];
+    for (_i = 0, _len = arguments.length; _i < _len; _i++) {
+      a = arguments[_i];
+      args.push(a);
+    }
+    args.shift();
+    return $.fn.Readings[meth].apply(this, args);
+  };
 
-  $(document).on('pageinit', function(ev) {
+  Readings.init = function() {
+    if (Readings.initialized != null) {
+      return;
+    }
     Readings.config = new Readings.Config({
       wlurl: 'http://readings.local',
       categories: {
         'themes': 'motyw'
       }
     });
-    return Readings.category_list($('#list-categories'));
+    return Readings.initialized = true;
+  };
+
+  $(document).on('pageinit', '#page-categories', function(ev) {
+    Readings.init();
+    return $('#list-categories').Readings('CategoryList');
+  });
+
+  rcategory = /category=(\w+)/;
+
+  $(document).on('pageshow', "#page-tags", function(ev, ui) {
+    var category;
+    category = rcategory.exec($(this).attr('data-url'));
+    if ((category != null) && (category[1] != null)) {
+      return $(this).Readings('TagList', category[1]);
+    }
   });
 
 }).call(this);