summaryrefslogtreecommitdiffstats
path: root/apps/user_migrate/js/export.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_migrate/js/export.js')
-rw-r--r--apps/user_migrate/js/export.js27
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..0e1e396f65d
--- /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.git')+'" />');
+ });
+ }
+ }
+ // End ajax
+ );
+ });
+}); \ No newline at end of file