|
@@ -384,6 +384,27 @@ $(document).ready(function() {
|
|
Collaborative features
|
|
Collaborative features
|
|
================================================= */
|
|
================================================= */
|
|
|
|
|
|
|
|
+ // Add the owner as a collaborator if the currently logged in user is the owner and hasn't been added before
|
|
|
|
+ function addOwnerToCollaborators() {
|
|
|
|
+ // AJAX
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "POST",
|
|
|
|
+ url: "php/add-owner-to-collaborators.php",
|
|
|
|
+ dataType: "JSON",
|
|
|
|
+ data: {
|
|
|
|
+ "canvas_id": canvasId
|
|
|
|
+ },
|
|
|
|
+ timeout: 5000,
|
|
|
|
+ success: function() {
|
|
|
|
+ },
|
|
|
|
+ error: function(xhr) {
|
|
|
|
+ console.log(xhr.statusText);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ addOwnerToCollaborators();
|
|
|
|
+
|
|
// Update active collaborators
|
|
// Update active collaborators
|
|
function updateActiveCollaborators() {
|
|
function updateActiveCollaborators() {
|
|
// AJAX
|
|
// AJAX
|
|
@@ -429,8 +450,10 @@ $(document).ready(function() {
|
|
|
|
|
|
// Toggle the text explaining that the canvas is saved automatically
|
|
// Toggle the text explaining that the canvas is saved automatically
|
|
// $("p#save-canvas").hide();
|
|
// $("p#save-canvas").hide();
|
|
- $("p#saved-automatically").show();
|
|
|
|
- $("div.save-canvas-feedback").hide();
|
|
|
|
|
|
+ if(returnData.length > 1) {
|
|
|
|
+ $("p#saved-automatically").show();
|
|
|
|
+ $("div.save-canvas-feedback").hide();
|
|
|
|
+ }
|
|
|
|
|
|
// If the user clicks on the "Remove" button
|
|
// If the user clicks on the "Remove" button
|
|
showRemoveCollaboratorDialog();
|
|
showRemoveCollaboratorDialog();
|