Merge branch 'master' into marijn-postdelete
This commit is contained in:
@@ -17,12 +17,10 @@ $(window).on("load", function () {
|
||||
because serialize doesn't take submit values. */
|
||||
$('#admin-batchform > button').click(function () {
|
||||
$('#batchinput').prop('value', $(this).prop('value'));
|
||||
console.log($('#batchinput').prop('value'));
|
||||
});
|
||||
|
||||
$('#admin-groupbatchform > button').click(function () {
|
||||
$('#groupbatchinput').prop('value', $(this).prop('value'));
|
||||
console.log($('#batchinput').prop('value'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,7 +65,6 @@ function searchFromOne() {
|
||||
}
|
||||
|
||||
function adminSearch() {
|
||||
console.log($("#admin-searchform").serialize());
|
||||
$.post(
|
||||
"API/adminSearchUsers.php",
|
||||
$("#admin-searchform").serialize()
|
||||
|
||||
@@ -49,7 +49,6 @@ function addMessages(messages) {
|
||||
// Initialize message variables
|
||||
var thisDate = new Date(messages[i].creationdate.replace(/ /,"T"));
|
||||
var thisTime = thisDate.getHours() + ":" + thisDate.getMinutes();
|
||||
console.log(thisDate);
|
||||
var type;
|
||||
thisDate.setHours(0,0,0,0);
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ function placeGroupButtons() {
|
||||
.done(function() {
|
||||
$buttonContainer.children().remove();
|
||||
placeGroupButtons();
|
||||
updateMenus();
|
||||
}).fail(function() {
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,11 +30,23 @@ $(document).ready(function() {
|
||||
|
||||
// Change menu cookie to close
|
||||
document.cookie = "menu=closed; path=/";
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if (getCookie("menu") == "open") {
|
||||
$("#own-profile-picture").click();
|
||||
// Make the menu visible and move the content to the left.
|
||||
$(".modal").width("calc(100% - 512px)");
|
||||
$(".content").css("margin-right", "256px");
|
||||
$("#notification-center").css("right", "0px");
|
||||
$("#notification-center").css("display", "block");
|
||||
$("#contact-menu").css("display", "block");
|
||||
|
||||
// Add cookie so the menu stays open on other pages
|
||||
if (window.innerWidth > 1080) {
|
||||
$("#chat-history").width("calc(100% - 587px)");
|
||||
document.cookie = "menu=open; path=/";
|
||||
} else {
|
||||
document.cookie = "menu=closed; path=/";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -53,6 +53,7 @@ function editFriendship(userID, value) {
|
||||
$.post("API/editFriendship.php", { usr: userID, action: value })
|
||||
.done(function() {
|
||||
placeFriendButtons();
|
||||
updateMenus();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,24 +2,29 @@ var menuFriendsData;
|
||||
var menuGroupsData;
|
||||
var notificationMessagesData;
|
||||
var notificationRequestsData;
|
||||
var updatingMenus = 0;
|
||||
|
||||
|
||||
// On document load, load menus and loops loading menus every 10 seconds.
|
||||
$(document).ready(function() {
|
||||
updatingMenus = 4;
|
||||
loadMenuFriends(5);
|
||||
loadNotificationFriends();
|
||||
loadUnreadMessages();
|
||||
loadMenuGroups();
|
||||
setInterval(updateMenus, 3000);
|
||||
setInterval(updateMenus, 10000);
|
||||
});
|
||||
|
||||
|
||||
// Update the menu and notification items.
|
||||
function updateMenus() {
|
||||
if (updatingMenus <= 0) {
|
||||
updatingMenus = 4;
|
||||
loadMenuFriends(5);
|
||||
loadNotificationFriends();
|
||||
loadUnreadMessages();
|
||||
loadMenuGroups();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get, every 3 seconds, the friends and insert them in the menu.
|
||||
@@ -38,6 +43,7 @@ function loadMenuFriends(limit) {
|
||||
$("#friends-menu-section").hide();
|
||||
}
|
||||
}
|
||||
updatingMenus --;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,6 +63,7 @@ function loadMenuGroups() {
|
||||
$("#groups-menu-section").hide();
|
||||
}
|
||||
}
|
||||
updatingMenus --;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,6 +80,7 @@ function loadNotificationFriends() {
|
||||
$("#friend-request-section").hide();
|
||||
}
|
||||
}
|
||||
updatingMenus --;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -89,5 +97,6 @@ function loadUnreadMessages() {
|
||||
$("#unread-messages-section").hide();
|
||||
}
|
||||
}
|
||||
updatingMenus --;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user