Hendrik testing #149

Merged
11342374 merged 27 commits from hendrik-testing into master 2017-01-27 16:16:10 +01:00
4 changed files with 40 additions and 4 deletions
Showing only changes of commit f27b9ec6b4 - Show all commits

View File

@@ -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 + '">\

View File

@@ -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) {

View File

@@ -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");
}

View File

@@ -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;