diff options
author | Simon Birnbach <simon@simon-birnbach.de> | 2012-04-15 15:59:57 +0200 |
---|---|---|
committer | Simon Birnbach <simon@simon-birnbach.de> | 2012-04-15 15:59:57 +0200 |
commit | a384fcb99fc3a12d7dac937398bf827c79e86098 (patch) | |
tree | 55a631751578cd1f642e5fa0f88fd2290509b126 /apps/user_migrate/js/export.js | |
parent | 4e89a0faf652f2f100cca47cca54a3b35e720aad (diff) | |
parent | 38cb716a572a8af136f6260089bc486413c6ca9f (diff) | |
download | nextcloud-server-a384fcb99fc3a12d7dac937398bf827c79e86098.tar.gz nextcloud-server-a384fcb99fc3a12d7dac937398bf827c79e86098.zip |
Merge git://gitorious.org/owncloud/owncloud
Conflicts:
files/css/files.css
files/js/files.js
Diffstat (limited to 'apps/user_migrate/js/export.js')
-rw-r--r-- | apps/user_migrate/js/export.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/user_migrate/js/export.js b/apps/user_migrate/js/export.js new file mode 100644 index 00000000000..2d660b2de6b --- /dev/null +++ b/apps/user_migrate/js/export.js @@ -0,0 +1,27 @@ +$(document).ready(function(){ + // Do the export + $('#exportbtn').click(function(){ + // Show loader + $('.loading').show(); + $.getJSON( + OC.filePath('user_migrate','ajax','export.php'), + {operation:'create'}, + function(result){ + if(result.status == 'success'){ + // Download the file + window.location = OC.filePath('user_migrate','ajax','export.php?operation=download') ; + $('.loading').hide(); + $('#exportbtn').val(t('user_migrate', 'Export')); + } else { + // Cancel loading + $('#exportbtn').html('Failed'); + // Show Dialog + OC.dialogs.alert(t('user_migrate', 'Something went wrong while the export file was being generated'), t('user_migrate', 'An error has occurred'), function(){ + $('#exportbtn').html(t('user_migrate', 'Export')+'<img style="display: none;" class="loading" src="'+OC.filePath('core','img','loading.gif')+'" />'); + }); + } + } + // End ajax + ); + }); +});
\ No newline at end of file |