Blame view

sources/apps/files_encryption/js/detect-migration.js 1.13 KB
31b7f2792   Kload   Upgrade to ownclo...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  /**
   * Copyright (c) 2013
   *  Bjoern Schiessle <schiessle@owncloud.com>
   * This file is licensed under the Affero General Public License version 3 or later.
   * See the COPYING-README file.
   */
  
  
  $(document).ready(function(){
  	$('form[name="login"]').on('submit', function() {
  		var user = $('#user').val();
  		var password = $('#password').val();
  		$.ajax({
  			type: 'POST',
  			url: OC.linkTo('files_encryption', 'ajax/getMigrationStatus.php'),
  			dataType: 'json',
  			data: {user: user, password: password},
  			async: false,
  			success: function(response) {
a293d369c   Kload   Update sources to...
20
  				if (response.data.migrationStatus === OC.Encryption.MIGRATION_OPEN) {
31b7f2792   Kload   Upgrade to ownclo...
21
22
23
  					var message = t('files_encryption', 'Initial encryption started... This can take some time. Please wait.');
  					$('#messageText').text(message);
  					$('#message').removeClass('hidden').addClass('update');
a293d369c   Kload   Update sources to...
24
25
26
27
  				} else if (response.data.migrationStatus === OC.Encryption.MIGRATION_IN_PROGRESS) {
  					var message = t('files_encryption', 'Initial encryption running... Please try again later.');
  					$('#messageText').text(message);
  					$('#message').removeClass('hidden').addClass('update');
31b7f2792   Kload   Upgrade to ownclo...
28
29
30
31
32
33
  				}
  			}
  		});
  	});
  
  });