Sunday, November 4, 2012

Boomerangs Comic Strip, November 03, 2012 on GoComics.com

Boomerangs

' + '' + ''; $(function() { window.Comment = Backbone.Model.extend({ toggle_flag: function() { if (this.get('user_flagged')) { this.set({'user_flagged': false}); } else { this.set({'user_flagged': true}); } } }); window.CommentList = Backbone.Collection.extend({ model: Comment, page: 1, url: function() { return '/comments/851623/'; } }); window.Comments = new CommentList([ { "id":3921012, "account_id":455299, "username":"Night-Gaunt49", "body":"

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: $('
  • ').addClass('reply-to-form').html($('.reply-thread').show()).hide(), is_showing: false, comment: null, comment_id: null, events: { 'click button': 'submit_form', 'click .cancel': 'hide' }, initialize: function() { }, show_after: function(comment) { if (!this.is_showing || this.comment_id != comment.model.get('id')) { this.is_showing = true; this.comment = comment; this.comment_id = comment.model.get('id'); $(this.comment.el).after($(this.el).show()); $(this.el).find('.meta a').html(this.comment.model.get('username')); $(this.el).find('.meta em').html(this.comment.model.get('body')); $(this.el).find('input').val(this.comment.model.get('id')); $(this.el).find('textarea').val(''); $(this.el).find('textarea').focus(); } }, hide: function() { $(this.el).hide(); this.is_showing = false; }, new_attributes: function() { return { "body": $(this.el).find('textarea').val(), "replied_to": $(this.el).find('input').val(), "username": this.username, "created_at": 'Just a moment ' } }, submit_form: function() { if ($(this.el).find('textarea').val() != '') { Comments.create(this.new_attributes()); $(this.comment.el).after($('
  • ').addClass('comment-at-bottom').html('

    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) { $('
  • ').addClass('load-comments').html('Load the rest of the comments.').appendTo('.comment-thread'); } else { $('
  • ').addClass('load-comments refresh').html('Refresh List...').appendTo('.comment-thread'); } Comments.each(this.add_one); this.has_more_comments = false; }, remove: function(comment) { $(comment.view.el).remove() }, new_attributes: function() { return { "body": $(this.form_el).find('textarea').val(), "replied_to": $(this.form_el).find('input').val(), "username": this.username, "created_at": 'Just a moment ' } }, submit_form: function() { if ($(this.form_el).find('textarea').val() != '') { Comments.create(this.new_attributes()); $(this.form_el).find('textarea').val(''); $(this.form_el).find('input').val(''); } }, load_comments: function() { if (!$('.load-comments').hasClass('loading')) { Comments.fetch({ error: function(data, xhr) { $('.load-comments').removeClass('loading').addClass('error').html('Oops! There was a problem loading
    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.