import/export
This commit is contained in:
@@ -123,7 +123,7 @@ angular.module('app.frontend')
|
||||
this.downloadDataArchive = function() {
|
||||
var link = document.createElement('a');
|
||||
link.setAttribute('download', 'neeto.json');
|
||||
link.href = apiController.notesDataFile(this.user);
|
||||
link.href = apiController.itemsDataFile();
|
||||
link.click();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,25 +7,17 @@ angular.module('app.frontend')
|
||||
var onUserSet = function() {
|
||||
apiController.setUser($scope.defaultUser);
|
||||
$scope.allTag = new Tag({all: true});
|
||||
$scope.allTag.content.name = "All";
|
||||
$scope.allTag.content.title = "All";
|
||||
$scope.tags = modelManager.tags;
|
||||
|
||||
// apiController.verifyEncryptionStatusOfAllItems($scope.defaultUser, function(success){});
|
||||
}
|
||||
|
||||
apiController.getCurrentUser(function(response){
|
||||
if(response && !response.errors) {
|
||||
console.log("Get user response", response);
|
||||
$scope.defaultUser = new User(response);
|
||||
modelManager.items = _.map(response.items, function(json_obj){
|
||||
if(json_obj.content_type == "Note") {
|
||||
return new Note(json_obj);
|
||||
} else if(json_obj.content_type == "Tag") {
|
||||
return new Tag(json_obj);
|
||||
} else {
|
||||
return new Item(json_obj);
|
||||
}
|
||||
});
|
||||
apiController.getCurrentUser(function(user, items){
|
||||
if(user && items) {
|
||||
console.log("Get user response", user, items);
|
||||
$scope.defaultUser = user;
|
||||
modelManager.items = items;
|
||||
$rootScope.title = "Notes — Neeto";
|
||||
onUserSet();
|
||||
} else {
|
||||
|
||||
@@ -71,7 +71,7 @@ angular.module('app.frontend')
|
||||
|
||||
var originalTagName = "";
|
||||
this.onTagTitleFocus = function(tag) {
|
||||
originalTagName = tag.content.name;
|
||||
originalTagName = tag.content.title;
|
||||
}
|
||||
|
||||
this.tagTitleDidChange = function(tag) {
|
||||
@@ -80,14 +80,14 @@ angular.module('app.frontend')
|
||||
|
||||
this.saveTag = function($event, tag) {
|
||||
this.editingTag = null;
|
||||
if(tag.content.name.length == 0) {
|
||||
tag.content.name = originalTagName;
|
||||
if(tag.content.title.length == 0) {
|
||||
tag.content.title = originalTagName;
|
||||
originalTagName = "";
|
||||
return;
|
||||
}
|
||||
|
||||
$event.target.blur();
|
||||
if(!tag.content.name || tag.content.name.length == 0) {
|
||||
if(!tag.content.title || tag.content.title.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ angular.module('app.frontend')
|
||||
|
||||
$scope.saveUsername = function() {
|
||||
apiController.setUsername(user, $scope.formData.username, function(response){
|
||||
var username = response.root_path;
|
||||
user.presentation = response;
|
||||
var username = response.username;
|
||||
user.username = username;
|
||||
callback(username);
|
||||
$scope.closeThisDialog();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user