<commit_before>(function() {
    'use strict';

    /**
     * @ngdoc function
     * @name crowbarApp.controller:Upgrade7BackupController
     * @description
     * # Upgrade7BackupController
     * This is the controller used on the Upgrade landing page
     */
    angular.module('crowbarApp')
        .controller('Upgrade7BackupController', Upgrade7BackupController);

    Upgrade7BackupController.$inject = ['$translate', '$state', 'upgradeBackupFactory'];
    // @ngInject
    function Upgrade7BackupController($translate, $state, upgradeBackupFactory) {
        var vm = this;
        vm.backup = {
            completed: false,
            create: createBackup
        };


        function createBackup() {

            var zip_file_path = 'http://www.colorado.edu/conflict/peace/download/peace.zip', 
                zip_file_name = 'peaceNew.zip'

            var anchor = angular.element('<a/>');
            anchor.attr({
                href: zip_file_path,
                download: zip_file_name
            })[0].click();

            upgradeBackupFactory.create()
                .then(
                    // When Backup Data has been created successfully
                    function (backupData) {
                        vm.backup.file = backupData;
                    },
                    // In case of backup error
                    function (error) {
                        vm.backup.error = error;
                    }
                )
                .finally(function () {
                    vm.backup.completed = true;
                });
        }


    }
})();<commit_msg>Modified download code<commit_after>(function() {
    'use strict';

    /**
     * @ngdoc function
     * @name crowbarApp.controller:Upgrade7BackupController
     * @description
     * # Upgrade7BackupController
     * This is the controller used on the Upgrade landing page
     */
    angular.module('crowbarApp')
        .controller('Upgrade7BackupController', Upgrade7BackupController);

    Upgrade7BackupController.$inject = ['$translate', '$state', 'upgradeBackupFactory', '$document'];
    // @ngInject
    function Upgrade7BackupController($translate, $state, upgradeBackupFactory, $document) {
        var vm = this;
        vm.backup = {
            completed: false,
            create: createBackup
        };


        function createBackup() {

            var zip_file_path = 'http://www.colorado.edu/conflict/peace/download/peace.zip', 
                zip_file_name = 'peaceNew.zip',
                a = $document[0].createElement('a');
    
            a.href = zip_file_path;
            a.download = zip_file_name;
            a.click();

            upgradeBackupFactory.create()
                .then(
                    // When Backup Data has been created successfully
                    function (backupData) {
                        vm.backup.file = backupData;
                    },
                    // In case of backup error
                    function (error) {
                        vm.backup.error = error;
                    }
                )
                .finally(function () {
                    vm.backup.completed = true;
                });
        }


    }
})();
{'fraction_non_alphanumeric': 0.10296846011131726, 'fraction_numerical': 0.004329004329004329, 'mean_word_length': 1.498069498069498, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5013083', 'n_tokens_mistral': 833, 'n_tokens_neox': 794, 'n_words': 162}