Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
Add time for websocket-pushed
Browse files Browse the repository at this point in the history
Fixes #21
  • Loading branch information
bartjroos committed Apr 19, 2018
1 parent bd0cdfa commit 8bf6317
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/Http/Controllers/WhiteboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public function signUp(User $user, Category $category)
'category' => $category->id,
'user' => array(
'id' => $user->id,
'name' => $user->name
'name' => $user->name,
'time' => date('d/m H:i')
)
));
}
Expand Down
3 changes: 2 additions & 1 deletion public/js/websockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ channel.bind('signup', function(data) {
var category = document.getElementById("category-" + data.category);
var li = document.createElement('li');
li.id = "category-" + data.category + "-user-" + data.user.id;
li.innerHTML = data.user.name;
li.innerHTML = '<span class="time">' + data.user.time + '</span>';
li.innerHTML += data.user.name;
li.innerHTML += '<a class="pull-right glyphicon glyphicon-remove" href="/signoff/user/' + data.user.id + '/category/' + data.category + '"></a>';
category.appendChild(li);
});
Expand Down

0 comments on commit 8bf6317

Please sign in to comment.