{:uriI"«file://app/assets/javascripts/views/user/articles/list.coffee?type=application/javascript&pipeline=self&id=35e81c5744ff53103eb4370c029c004d13177f5cd018ec6d88e20d565b06719e:ET:load_pathI"app/assets/javascripts;T: filenameI";app/assets/javascripts/views/user/articles/list.coffee;T: nameI"views/user/articles/list;T:logical_pathI"%views/user/articles/list.self.js;T:content_typeI"application/javascript;T: sourceI"Ù (function() { var extend = 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; }, hasProp = {}.hasOwnProperty; App.Views.User.Articles.List = (function(superClass) { extend(List, superClass); function List(opts) { if (opts == null) { opts = {}; } List.__super__.constructor.call(this, opts); this.articles = opts.articles; } List.prototype.renderArticles = function(articles) { var article, i, len, results; results = []; for (i = 0, len = articles.length; i < len; i++) { article = articles[i]; results.push(this.renderArticle(article)); } return results; }; List.prototype.renderArticle = function(article) { var template; template = JST["templates/user/articles/article"]({ article: article }); if ($("#article_" + article.id).length === 1) { $("#article_" + article.id).replaceWith(template); } else { $("table").append(template); } return this._handleDeletingArticle(article); }; List.prototype.deleteArticle = function(articleId) { return $("#article_" + articleId).remove(); }; List.prototype.commentsQuantityChangedForArticle = function(articleId, quantity) { var match, sel; sel = $("#article_" + articleId + " td.comments_quantity"); if (sel.length === 0) { return; } match = /\d+/.exec(sel.text()); quantity = parseInt(match[0]) + quantity; return sel.text(quantity); }; List.prototype._handleDeletingArticle = function(article) { return $("tr#article_" + article.id + " a.delete_article").click((function(_this) { return function(e) { e.preventDefault(); if (!confirm("Are you sure?")) { return; } return article["delete"](null).then(function(data) { var flash; flash = new App.Views.Shared.Flash; if (data.success) { _this.deleteArticle(data.id); flash.setNotice(data.notice); } else { flash.setAlert(data.alert); } return flash.render(); }); }; })(this)); }; return List; })(App.Views.Base); }).call(this); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"Ifile-digest://app/assets/javascripts/views/user/articles/list.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%¬'ÓgmœBCž%ZIÓf r`p‰B=³ÆŒ? ¦çÃ: lengthiÙ :dependencies_digest"%Ð=ŠSÅ×Áé“Uq‡È