<commit_before>import ModalDialog from 'ghost/components/gh-modal-dialog';
import upload from 'ghost/assets/lib/uploader';

var UploadModal = ModalDialog.extend({
    layoutName: 'components/gh-modal-dialog',

    didInsertElement: function () {
        this._super();
        upload.call(this.$('.js-drop-zone'), {fileStorage: this.get('config.fileStorage')});
    },
    confirm: {
        reject: {
            func: function () { // The function called on rejection
                return true;
            },
            buttonClass: true,
            text: 'Cancel' // The reject button text
        },
        accept: {
            buttonClass: 'btn btn-blue right',
            text: 'Save', // The accept button texttext: 'Save'
            func: function () {
                var imageType = 'model.' + this.get('imageType');

                if (this.$('.js-upload-url').val()) {
                    this.set(imageType, this.$('.js-upload-url').val());
                } else {
                    this.set(imageType, this.$('.js-upload-target').attr('src'));
                }
                return true;
            }
        }
    },

    actions: {
        closeModal: function () {
            this.sendAction();
        },
        confirm: function (type) {
            var func = this.get('confirm.' + type + '.func');
            if (typeof func === 'function') {
                func.apply(this);<commit_msg>Fix button class on upload modal<commit_after>import ModalDialog from 'ghost/components/gh-modal-dialog';
import upload from 'ghost/assets/lib/uploader';

var UploadModal = ModalDialog.extend({
    layoutName: 'components/gh-modal-dialog',

    didInsertElement: function () {
        this._super();
        upload.call(this.$('.js-drop-zone'), {fileStorage: this.get('config.fileStorage')});
    },
    confirm: {
        reject: {
            func: function () { // The function called on rejection
                return true;
            },
            buttonClass: 'btn btn-default',
            text: 'Cancel' // The reject button text
        },
        accept: {
            buttonClass: 'btn btn-blue right',
            text: 'Save', // The accept button texttext: 'Save'
            func: function () {
                var imageType = 'model.' + this.get('imageType');

                if (this.$('.js-upload-url').val()) {
                    this.set(imageType, this.$('.js-upload-url').val());
                } else {
                    this.set(imageType, this.$('.js-upload-target').attr('src'));
                }
                return true;
            }
        }
    },

    actions: {
        closeModal: function () {
            this.sendAction();
        },
        confirm: function (type) {
            var func = this.get('confirm.' + type + '.func');
            if (typeof func === 'function') {
                func.apply(this);
{'fraction_non_alphanumeric': 0.14844290657439446, 'fraction_numerical': 0.0, 'mean_word_length': 1.6092057761732852, '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': '6513214', 'n_tokens_mistral': 782, 'n_tokens_neox': 757, 'n_words': 169}