remove sharing
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
class BaseCtrl {
|
||||
constructor($rootScope, modelManager, apiController, dbManager) {
|
||||
apiController.getCurrentUser(function(){});
|
||||
dbManager.openDatabase(null, function(){
|
||||
// new database, delete syncToken so that items can be refetched entirely from server
|
||||
apiController.clearSyncToken();
|
||||
|
||||
@@ -171,7 +171,6 @@ angular.module('app.frontend')
|
||||
this.onContentFocus = function() {
|
||||
this.showSampler = false;
|
||||
$rootScope.$broadcast("editorFocused");
|
||||
this.editingUrl = false;
|
||||
}
|
||||
|
||||
this.onNameBlur = function() {
|
||||
@@ -202,64 +201,8 @@ angular.module('app.frontend')
|
||||
}
|
||||
}
|
||||
|
||||
this.editUrlPressed = function() {
|
||||
this.showMenu = false;
|
||||
var url = this.publicUrlForNote(this.note);
|
||||
url = url.replace(this.note.presentation_name, "");
|
||||
this.url = {base: url, token : this.note.presentation_name};
|
||||
this.editingUrl = true;
|
||||
}
|
||||
|
||||
this.saveUrl = function($event) {
|
||||
$event.target.blur();
|
||||
|
||||
var original = this.note.presentation_name;
|
||||
this.note.presentation_name = this.url.token;
|
||||
this.note.setDirty(true);
|
||||
|
||||
apiController.sync(function(response){
|
||||
if(response && response.error) {
|
||||
this.note.presentation_name = original;
|
||||
this.url.token = original;
|
||||
alert("This URL is not available.");
|
||||
} else {
|
||||
this.editingUrl = false;
|
||||
}
|
||||
}.bind(this))
|
||||
}
|
||||
|
||||
this.shareNote = function() {
|
||||
|
||||
function openInNewTab(url) {
|
||||
var a = document.createElement("a");
|
||||
a.target = "_blank";
|
||||
a.href = url;
|
||||
a.click();
|
||||
}
|
||||
|
||||
apiController.shareItem(this.note, function(note){
|
||||
openInNewTab(this.publicUrlForNote(note));
|
||||
}.bind(this))
|
||||
this.showMenu = false;
|
||||
}
|
||||
|
||||
this.unshareNote = function() {
|
||||
apiController.unshareItem(this.note, function(note){
|
||||
|
||||
})
|
||||
this.showMenu = false;
|
||||
}
|
||||
|
||||
this.publicUrlForNote = function() {
|
||||
return this.note.presentationURL();
|
||||
}
|
||||
|
||||
this.clickedMenu = function() {
|
||||
if(this.note.locked) {
|
||||
alert("This note has been shared without an account, and can therefore not be changed.")
|
||||
} else {
|
||||
this.showMenu = !this.showMenu;
|
||||
}
|
||||
this.showMenu = !this.showMenu;
|
||||
}
|
||||
|
||||
this.deleteNote = function() {
|
||||
|
||||
@@ -67,29 +67,6 @@ angular.module('app.frontend')
|
||||
this.removeTag()(this.tag);
|
||||
}
|
||||
|
||||
this.selectedTagShare = function() {
|
||||
this.showMenu = false;
|
||||
|
||||
if(!apiController.isUserSignedIn()) {
|
||||
alert("You must be signed in to share a tag.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.tag.all) {
|
||||
alert("You cannot share the 'All' tag.");
|
||||
return;
|
||||
}
|
||||
|
||||
apiController.shareItem(this.tag, function(response){})
|
||||
}
|
||||
|
||||
this.selectedTagUnshare = function() {
|
||||
this.showMenu = false;
|
||||
apiController.unshareItem(this.tag, function(response){
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
this.selectFirstNote = function(createNew) {
|
||||
var visibleNotes = this.tag.notes.filter(function(note){
|
||||
return note.visible;
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
angular.module('app.frontend')
|
||||
.controller('UsernameModalCtrl', function ($scope, apiController, Restangular, callback, $timeout) {
|
||||
$scope.formData = {};
|
||||
|
||||
$scope.saveUsername = function() {
|
||||
apiController.setUsername($scope.formData.username, function(response){
|
||||
var username = response.username;
|
||||
callback(username);
|
||||
$scope.closeThisDialog();
|
||||
})
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user