Lars #141
@@ -1,3 +1,5 @@
|
||||
var previousDate = new Date("1970-01-01 00:00:00");
|
||||
|
||||
$(document).ready(function() {
|
||||
loadMessages();
|
||||
sayEmpty();
|
||||
@@ -31,13 +33,25 @@ function sendMessage() {
|
||||
}
|
||||
|
||||
function addMessages(messages) {
|
||||
for(i in messages) {
|
||||
for(var i in messages) {
|
||||
thisDate = new Date(messages[i].creationdate);
|
||||
thisDate.setHours(0,0,0,0);
|
||||
if (messages[i].destination == $(".destinationID").val()) {
|
||||
type = "chat-message-self";
|
||||
} else {
|
||||
type = "chat-message-other";
|
||||
}
|
||||
|
||||
if (thisDate > previousDate) {
|
||||
console.log(previousDate);
|
||||
previousDate = thisDate;
|
||||
$("#chat-history").append('\
|
||||
<div class="day-message"> \
|
||||
<div class="day-message-content">\
|
||||
' + days[thisDate.getDay()] + " " + thisDate.getDate() + " " + months[thisDate.getMonth()] + " " + thisDate.getFullYear() + '\
|
||||
</div> \
|
||||
</div>\
|
||||
');
|
||||
}
|
||||
$("#chat-history").append('\
|
||||
<div class="chat-message"> \
|
||||
<div class="' + type + '">\
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
var days = ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"];
|
||||
var months = ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"]
|
||||
|
||||
function getCookie(key) {
|
||||
cookies = document.cookie.split("; ");
|
||||
for (var i in cookies) {
|
||||
|
||||
@@ -8,7 +8,6 @@ function searchUsers(n, m) {
|
||||
filter: $("#search-filter").val()
|
||||
}
|
||||
).done(function(data) {
|
||||
console.log(data);
|
||||
if (!showFriends(data, "#search-users-list", 0, "profile.php", "GET")) {
|
||||
$("#search-users-list").text("Niemand gevonden");
|
||||
}
|
||||
@@ -25,7 +24,6 @@ function searchGroups(n, m) {
|
||||
filter: $("#search-filter").val()
|
||||
}
|
||||
).done(function(data) {
|
||||
console.log(data);
|
||||
if (!showGroups(data, "#search-groups-list")) {
|
||||
$("#search-groups-list").text("Geen groepen gevonden");
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Overall chat-screen */
|
||||
.chat {
|
||||
position: fixed;
|
||||
@@ -37,6 +42,22 @@
|
||||
}
|
||||
|
||||
/* Chat-message takes the whole width of the chat area */
|
||||
.day-message {
|
||||
width: 100%;
|
||||
min-height: 40px;
|
||||
padding: 10px 0;
|
||||
clear: both;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.day-message-content {
|
||||
width: auto;
|
||||
padding: 10px;
|
||||
|
||||
background-color: #F8F8F8;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.chat-message {
|
||||
width: 100%;
|
||||
min-height: 40px;
|
||||
|
||||
Reference in New Issue
Block a user