hunk.code_window:   - bower_components/splitargs/src/splitargs.js
     - bower_components/toastr/toastr.js
     - bower_components/xterm.js/dist/xterm.js
     - assets/js/legend.js
     minified:
     - bower_components/jquery/dist/jquery.min.js
     - bower_components/bootstrap/dist/js/bootstrap.min.js
  
hunk.labels: keep keep add keep keep keep keep
hunk.after_edit:   - bower_components/xterm.js/dist/addons/fit/fit.js
  
hunk.file_path: vendor.yml
hunk.type: add
file: angular.module('userSettings', [])
  .controller('UserSettingsController', ['$scope', '$state', '$sanitize', 'Authentication', 'UserService', 'Notifications',
  function ($scope, $state, $sanitize, Authentication, UserService, Notifications) {
    $scope.formValues = {
      currentPassword: '',
      newPassword: '',
      confirmPassword: ''
    };
  
    $scope.updatePassword = function() {
      $scope.invalidPassword = false;
      var userID = Authentication.getUserDetails().ID;
      var currentPassword = $sanitize($scope.formValues.currentPassword);
      var newPassword = $sanitize($scope.formValues.newPassword);
  
      UserService.updateUserPassword(userID, currentPassword, newPassword)
      .then(function success() {
        Notifications.success('Success', 'Password successfully updated');
        $state.reload();
      })
      .catch(function error(err) {
        if (err.invalidPassword) {
          $scope.invalidPassword = true;
        } else {
          Notifications.error('Failure', err, err.msg);
        }
      });
    };
  }]);
  