mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
first commit for sharing dialog
This commit is contained in:
17
js/script.js
17
js/script.js
@@ -162,6 +162,13 @@ View.prototype = {
|
||||
var modalnote = $("#modal-note-div .quicknote");
|
||||
|
||||
var note = $('.notes-grid [data-id=' + id + ']').parent();
|
||||
if($('.notes-grid [data-id=' + id + ']').hasClass('shareowner')) {
|
||||
$('.save-button #unshare-button').show();
|
||||
$('.save-button #share-button').hide();
|
||||
} else {
|
||||
$('.save-button #unshare-button').hide();
|
||||
$('.save-button #share-button').show();
|
||||
}
|
||||
|
||||
var title = note.find("#title-editable").html();
|
||||
var content = note.find("#content-editable").html();
|
||||
@@ -336,6 +343,16 @@ View.prototype = {
|
||||
modalnote.css("background-color", color);
|
||||
});
|
||||
|
||||
// handle share editing notes.
|
||||
$('#modal-note-div #share-button').click(function (event) {
|
||||
$.get(OC.generateUrl('/apps/quicknotes/api/0.1/getusergroups'), function(data) {
|
||||
var groups = data.groups;
|
||||
var users = data.users;
|
||||
alert('groups: ' + groups.toSource());
|
||||
alert('users: ' + users.toSource());
|
||||
});
|
||||
});
|
||||
|
||||
// handle cancel editing notes.
|
||||
$('#modal-note-div #cancel-button').click(function (event) {
|
||||
self.cancelEdit();
|
||||
|
||||
Reference in New Issue
Block a user