first version of import GUI
This commit is contained in:
@@ -133,7 +133,15 @@ function load_spaces(id, is_home, on_success, on_error) {
|
||||
}, on_error);
|
||||
}
|
||||
|
||||
function load_writable_folders( on_success, on_error) {
|
||||
function load_importables(user, on_success, on_error) {
|
||||
load_resource("get", "/users/"+user._id+"/importables", null, on_success, on_error);
|
||||
}
|
||||
|
||||
function import_zip(user, filename, on_success, on_error) {
|
||||
load_resource("get", "/users/"+user._id+"/import?zip="+filename, null, on_success, on_error);
|
||||
}
|
||||
|
||||
function load_writable_folders(on_success, on_error) {
|
||||
load_resource("get", "/spaces?writablefolders=true", null, on_success, on_error);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,20 @@ SpacedeckAccount = {
|
||||
account_confirmed_sent: false,
|
||||
account_tab: 'invoices',
|
||||
password_change_error: null,
|
||||
feedback_text: ""
|
||||
feedback_text: "",
|
||||
importables: [], // spacedeck.com zip import files
|
||||
},
|
||||
methods: {
|
||||
show_account: function(user) {
|
||||
show_account: function() {
|
||||
this.activate_dropdown('account');
|
||||
},
|
||||
|
||||
start_zip_import: function(f) {
|
||||
if (confirm("Your archive will be imported in the background. This can take a few minutes. You can continue using Spacedeck in the meantime.")) {
|
||||
import_zip(this.user, f);
|
||||
}
|
||||
},
|
||||
|
||||
account_save_user_digest: function(val) {
|
||||
this.user.prefs_email_digest = val;
|
||||
this.save_user(function() {
|
||||
|
||||
@@ -15,7 +15,8 @@ SpacedeckUsers = {
|
||||
account_remove_error: null,
|
||||
loading_user: false,
|
||||
password_reset_confirm_error: "",
|
||||
password_reset_error: ""
|
||||
password_reset_error: "",
|
||||
|
||||
},
|
||||
methods:{
|
||||
load_user: function(on_success, on_error) {
|
||||
@@ -29,6 +30,12 @@ SpacedeckUsers = {
|
||||
if (on_success) {
|
||||
on_success(user);
|
||||
}
|
||||
|
||||
// see spacedeck_account.js
|
||||
load_importables(this.user, function(files) {
|
||||
this.importables = files;
|
||||
}.bind(this));
|
||||
|
||||
}.bind(this), function() {
|
||||
// error
|
||||
this.loading_user = false;
|
||||
@@ -40,18 +47,6 @@ SpacedeckUsers = {
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
login_google: function(evt) {
|
||||
this.loading_user = true;
|
||||
|
||||
create_oauthtoken(function(data){
|
||||
this.loading_user = false;
|
||||
location.href = data.url;
|
||||
}, function(xhr){
|
||||
this.loading_user = false;
|
||||
alert("could not get oauth token");
|
||||
});
|
||||
},
|
||||
|
||||
finalize_login: function(session_token, on_success) {
|
||||
if(!window.socket_auth || window.socket_auth == '' || window.socket_auth == 'null') {
|
||||
window.socket_auth = session_token;
|
||||
@@ -169,7 +164,6 @@ SpacedeckUsers = {
|
||||
},
|
||||
|
||||
password_reset_submit: function(evt, email) {
|
||||
|
||||
if (evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
@@ -203,7 +197,6 @@ SpacedeckUsers = {
|
||||
},
|
||||
|
||||
password_reset_confirm: function(evt, password, password_confirmation) {
|
||||
|
||||
if (evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
|
||||
Reference in New Issue
Block a user