Funny to think of 1998 as a bygone era like 1898.
", "is_pro":false, "created_at":"about 13 hours", "avatar":"http://s3.amazonaws.com/avatars.gocomics.com/avatars_gocomicsver3/1358000/1358577/thumb_tumblr_mbbz3vRusJ1qdlmheo1_250.jpg", "user_flagged":false, "replied_to_id": null, "replied_to_account_id": null, "replied_to_username": "" } ]); // ------------------------------ Views ------ // window.CommentReplyForm = Backbone.View.extend({ el: $('Your comment has been added at the bottom of the list
')); this.hide(); } } }); window.CommentView = Backbone.View.extend({ tagName: 'li', className: 'comment', template: _.template(comment_block), current_account_id: 0, moderator_status: false, events: { 'click .flag-toggle a': 'flag_toggle', 'click .delete-toggle a': 'delete_toggle', 'click .reply-toggle a': 'reply_toggle', 'mouseenter': 'show_options', 'mouseleave': 'hide_options' }, initialize: function() { _.bindAll(this, 'render', 'on_save'); this.model.bind('change', this.on_save); this.model.view = this; }, render: function() { $(this.el).html(this.template({comment: this.model.attributes})); this.display_flagged(); this.display_delete(); this.display_reply(); return this; }, on_save: function() { this.display_flagged(); }, display_flagged: function() { if (this.current_account_id == this.model.get('account_id') || this.current_account_id == 0) { $(this.el).find('.flag-toggle').remove(); } else if (this.model.get('user_flagged')) { $(this.el).find('.flag-toggle').addClass('flagged').find('a').text('Unflag'); } else { $(this.el).find('.flag-toggle').removeClass('flagged').find('a').text('Flag'); } }, display_delete: function() { if (this.current_account_id != this.model.get('account_id') && this.moderator_status == false ) { $(this.el).find('.delete-toggle').remove(); } }, display_reply: function() { if (this.current_account_id == 0) { $(this.el).find('.reply-toggle').remove(); } }, show_options: function() { $(this.el).addClass('active-comment').children('.comment-bottom-orphan').children().fadeIn('fast'); }, hide_options: function() { $(this.el).removeClass('active-comment').children('.comment-bottom-orphan').children().fadeOut('fast'); }, flag_toggle: function(e) { if (!$(this.el).find('.flag-toggle').hasClass('disabled')) { $(this.el).find('.flag-toggle').addClass('disabled'); this.model.toggle_flag(); this.model.save(); } }, delete_toggle: function(e) { if (!$(this.el).hasClass('disabled')) { $(this.el).addClass('disabled'); this.model.destroy(function(e) { $(this.el).remove(); }, function() { $(this.el).removeClass('disabled'); }); } }, reply_toggle: function(e) { comment_modal.show_after(this); } }); window.CommentApp = Backbone.View.extend({ el: $('.comment-panel-container'), form_el: $('.comment-form.static'), username: '', has_more_comments: true, comment_count: 1, events: { 'click .comment-form button': 'submit_form', 'click .load-comments': 'load_comments' }, initialize: function() { _.bindAll(this, 'add_one', 'add_all', 'remove', 'load_comments'); Comments.bind('add', this.add_one); Comments.bind('refresh', this.add_all); Comments.bind('remove', this.remove); this.add_all(); }, add_one: function(comment) { var new_comment = new CommentView({model: comment}); $('.comment-thread .load-comments').before(new_comment.render().el); }, add_all: function() { $('.comment-thread').html(''); if (this.has_more_comments && this.comment_count > 15) { $('the rest of the comments, please refresh the page!'); } }); $('.load-comments').addClass('loading').html('Loading...'); } } }); window.comment_modal = new CommentReplyForm; window.comment_app = new CommentApp({ models: Comments }); });
Source: http://www.gocomics.com/boomerangs/2012/11/03
nevis 2012 sports illustrated swimsuit same day flower delivery valentines day westminster dog show valentines day cards hallmark
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.