o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1336655373.038383: @value".{I" class:EFI"ProcessedAsset;FI"logical_path;F"+ems/controllers/channels_controller.jsI" pathname;F"{/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/controllers/channels_controller.coffeeI"content_type;FI"application/javascript;FI" mtime;FI"2012-04-03T15:05:21+01:00;FI" length;Fi¡ I" digest;F"%9d795f1aa014f735d80c90c4462bb827I" source;FI"¡ (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }; Ems.ChannelsController = (function(_super) { __extends(ChannelsController, _super); ChannelsController.name = 'ChannelsController'; function ChannelsController() { return ChannelsController.__super__.constructor.apply(this, arguments); } ChannelsController.prototype.channels = null; ChannelsController.prototype.categories = null; ChannelsController.prototype.index = function(params) {}; ChannelsController.prototype.show = function(params) {}; ChannelsController.prototype["new"] = function(params) { var _this = this; this.set('channel', new Ems.Channel); return Ems.Category.load(function(err, cats) { var categories, category, i; if (err) { throw err; } categories = new Batman.Set; for (i in cats) { category = cats[i]; categories.add(category); } return _this.set('categories', categories); }); }; ChannelsController.prototype.create = function(params) { var _this = this; return this.get('channel').save(function(err) { if (err) { if (!(err instanceof Batman.ErrorsSet)) { throw err; } } else { Ems.flashSuccess("Channel " + (_this.get('channel.name')) + " created successfully!"); return _this.redirect('/tags'); } }); }; ChannelsController.prototype.edit = function(params) { var _this = this; this.set('channel', Ems.Channel.find(parseInt(params.id), function(err) { if (err) { throw err; } })); return Ems.Category.load(function(err, cats) { if (err) { throw err; } return _this.set('categories', Ems.Category.get('loaded')); }); }; ChannelsController.prototype.update = function() { var _this = this; return this.get('channel').save(function(err) { if (err) { if (!(err instanceof Batman.ErrorsSet)) { throw err; } } else { Ems.flashSuccess("Channel " + (_this.get('channel.title')) + " updated successfully!"); return _this.redirect('/channels'); } }); }; ChannelsController.prototype.toggleCategory = function(node, event) { var category, category_id, channel; category_id = node.getAttribute('id'); channel = this.get('channel'); category = this.get('categories').indexedByUnique('id').get(parseInt(category_id)); if (category) { if (node.checked) { return channel.get("categories").add(category); } else { return channel.get("categories").remove(category); } } else { throw "No category found with ID: " + category_id; } }; return ChannelsController; })(Batman.Controller); }).call(this); ;TI"dependency_digest;F"%6d887bd25d2ca5785e5c4934da90a2d0I"required_paths;F["{/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/controllers/channels_controller.coffeeI"dependency_paths;F[{I" path;F"{/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/controllers/channels_controller.coffeeI" mtime;FI"2012-04-03T15:05:21+01:00;FI" digest;F"%c12696583cd5e150151b340a7b530c69I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862