<commit_before>
App.WallPostController = Em.ObjectController.extend(App.IsAuthorMixin, {
    needs: ['currentUser'],

    // Don't show Fundraiser (title/link) on FundRaiser page.
    showFundRaiser: function(){
        if (this.get('parent_type') == 'fundraiser') {
            return false;
        }
        // Show FundRaiser if any.
        return this.get('fundraiser');
    }.property('fundraiser', 'parent_type'),

    newReaction: function(){
        var transaction = this.get('store').transaction();
        return transaction.createRecord(App.WallPostReaction, {'wallpost': this.get('model')});
    }.property('model'),

    actions: {
		editWallPost: function() {
			console.log("edit");
		}
    }
});

App.TaskWallPostListController = Em.ArrayController.extend({
    needs: ['currentUser'],
	
	actions: {
		editWallPost: function() {
			console.log("edit");
		}
	}
});


App.TextWallPostNewController = Em.ObjectController.extend({
    /**
     * This is the base class for a wall-post form.
     *
     * To use it extend it and add:
     * - Extend 'needs' to have parent object and wall-post list controllers.
     * - Overwrite 'parentId' to return the id of the parent object.
     * - Overwrite 'wallPostList' to return the array (model) that holds the wall-post list.
     * - Define a 'type'
     *
     * Look at App.ProjectTextWallPostNewController for example
     */

    needs: ['currentUser'],

    wallPostList: function(){
        return Em.K();
    }.property(),

    init: function() {
        this._super();
        this.createNewWallPost();
    },
    actions: {
        saveWallPost: function() {
			var parent_type = this.get('parentType')
            var wallPost = this.get('model');
            wallPost.set('parent_id', this.get('parentId'));
            wallPost.set('parent_type', parent_type);
            wallPost.set('type', 'text');

            var controller = this;
            wallPost.on('didCreate', function(record) {
                var list = controller.get('wallPostList');
                list.unshiftObject(record);
                Ember.run.next(function() {
                    controller.createNewWallPost();
                });
            });
            wallPost.on('becameInvalid', function(record) {
                controller.set('errors', record.get('errors'));
            });
            wallPost.save();
        },
		
		showImages: function(event) {
			$(".photos-tab").addClass("active");
			$(".video-tab").removeClass("active");

			$(".video-container").hide();
			$(".photos-container").show();
		},
		
		showVideo: function() {<commit_msg>Update controllers.js<commit_after>
App.WallPostController = Em.ObjectController.extend(App.IsAuthorMixin, {
    needs: ['currentUser'],

    // Don't show Fundraiser (title/link) on FundRaiser page.
    showFundRaiser: function(){
        if (this.get('parent_type') == 'fundraiser') {
            return false;
        }
        // Show FundRaiser if any.
        return this.get('fundraiser');
    }.property('fundraiser', 'parent_type'),

    newReaction: function(){
        var transaction = this.get('store').transaction();
        return transaction.createRecord(App.WallPostReaction, {'wallpost': this.get('model')});
    }.property('model'),

    actions: {
		editWallPost: function() {
			console.log("edit");
		}
    }
});

App.TaskWallPostListController = Em.ArrayController.extend({
    needs: ['currentUser'],
	
	actions: {
		editWallPost: function() {
			console.log("edit");
		}
	}
});


App.TextWallPostNewController = Em.ObjectController.extend({
    /**
     * This is the base class for a wall-post form.
     *
     * To use it extend it and add:
     * - Extend 'needs' to have parent object and wall-post list controllers.
     * - Overwrite 'parentId' to return the id of the parent object.
     * - Overwrite 'wallPostList' to return the array (model) that holds the wall-post list.
     * - Define a 'type'
     *
     * Look at App.ProjectTextWallPostNewController for example
     */

    needs: ['currentUser'],

    wallPostList: function(){
        return Em.K();
    }.property(),

    init: function() {
        this._super();
        this.createNewWallPost();
    },
    actions: {
        saveWallPost: function() {
            var parent_type = this.get('parentType')
            var wallPost = this.get('model');
            wallPost.set('parent_id', this.get('parentId'));
            wallPost.set('parent_type', parent_type);
            wallPost.set('type', 'text');

            var controller = this;
            wallPost.on('didCreate', function(record) {
                var list = controller.get('wallPostList');
                list.unshiftObject(record);
                Ember.run.next(function() {
                    controller.createNewWallPost();
                });
            });
            wallPost.on('becameInvalid', function(record) {
                controller.set('errors', record.get('errors'));
            });
            wallPost.save();
        },
		
		showImages: function(event) {
			$(".photos-tab").addClass("active");
			$(".video-tab").removeClass("active");

			$(".video-container").hide();
			$(".photos-container").show();
		},
		
		showVideo: function() {
{'fraction_non_alphanumeric': 0.14917127071823205, 'fraction_numerical': 0.0, 'mean_word_length': 2.3697047496790757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2276453', 'n_tokens_mistral': 1569, 'n_tokens_neox': 1459, 'n_words': 315}