-
Notifications
You must be signed in to change notification settings - Fork 0
/
puruText.html
58 lines (48 loc) · 2.12 KB
/
puruText.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!--
/**
*
* @author Johan Kasselman
* @since 27-01-2016
*
* puruText: Simple chatRoom with history and users etc.
*/
-->
<head>
<title>Simple Instant messaging Application!</title>
<script scr="moment.js"></script>
</head>
<body>
<div class="container"
ng-controller="MessagesListCtrl">
<header>
<h1>Messages</h1>
<login-buttons></login-buttons>
<select class="form-control" name="repeatRoom" id="repeatRoom" ng-model="selectedRoom" ng-show="$root.currentUser">
<option ng-repeat="room in rooms" value="{{room.id}}">{{room.name}}</option>
</select>
<br />
</header>
<section>
<ul style="background-color: #FFFFFF" ng-show="!$root.currentUser">
<li>Please Sign in to start chatting!<br>
If you're not a member already please sign up.</li>
</ul>
<ul id="messageContainer" ng-show="$root.currentUser">
<li ng-class="$root.currentUser._id==message.owner ? 'triangle-border-right textCurrentUser' : 'triangle-border-left textOther'" ng-repeat="message in messages">
<div style="float: right;">
<button class="delete" ng-click="deleteMesasage(message._id, message.owner)" ng-show="$root.currentUser._id==message.owner || $root.currentUser.username=='admin'" title="Delete">×</button>
</div>
<!-- <span class="text">{{message.text}}</span> -->
<span ng-bind-html="message.text"></span>
<span class="messageDateTime">{{formatRawDate(message.createdAt)}}<br />by <b class="messageUsername">{{message.username}}</b></span>
</li>
</ul>
</section>
<div id="messageBox">
<form class="new-message" ng-submit="addMessage(newMessage); newMessage='';" ng-show="$root.currentUser">
<input id="messageInput" ng-model="newMessage" type="text"
name="text" placeholder="Type to add new message" />
</form>
</div>
</div>
</body>