Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 42 additions & 44 deletions quickblox.min.js

Large diffs are not rendered by default.

65 changes: 61 additions & 4 deletions samples/newChat/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,34 @@
color: #007AFF;
}

.dialog__last_message_date {

.dialog_additional_info {
flex:0 0 24px;
text-align: right;
}

.dialog__last_message_date {
font-size: 12px;
line-height: 14px;
color: #4A4A4A;
margin: 0 0 2px;
display: inline-block;
}

.dialog_unread_counter {
min-width: 23px;
background-color: #17D04B;
border-radius: 4px;
font-size: 13px;
font-weight: 500;
line-height: 19px;
color: #FFFFFF;
text-align: center;
display: inline-block;
}

.dialog_unread_counter.hidden {
display: none;
}
/* END DIALOG STYLES */

Expand Down Expand Up @@ -421,9 +444,43 @@
flex-wrap: nowrap;
overflow: hidden;
}
/*
WELCOME MESSAGE
*/

.notifications {
display: flex;
padding: 19px 16px;
font-size: 15px;
font-weight: 500;
line-height: 18px;
color: #4A4A4A;
border-bottom: 1px solid #DADFE1;
flex: 0 0 58px;
box-sizing: border-box;
}

.notifications.hidden {
display: none;
}

.notifications .title {
font-size: 15px;
font-weight: 500;
line-height: 18px;
color: #4A4A4A;
flex: 1 1 100%;
}

.notifications .spinner {
margin: 0 0 0 14px;
}

.notifications .spinner img{
width: 15px;
height: 15px;
}

/*
WELCOME MESSAGE
*/

.welcome__message {
display: flex;
Expand Down
4 changes: 4 additions & 0 deletions samples/newChat/img/ic_add_circle_outline_black_24px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 26 additions & 12 deletions samples/newChat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h2 class="dashboard__title">Text Chat Sample</h2>
</li>
<li class="sidebar__tab m-sidebar__tab_new">
<a href="#" class="sidebar__tab_link j-sidebar__create_dilalog m-sidebar__tab_link_new" data-type="create">
<i class="material-icons">supervisor_account</i>
<i class="material-icons">add_circle_outline</i>
</a>
</li>
</ul>
Expand All @@ -101,9 +101,10 @@ <h2 class="dashboard__title">Text Chat Sample</h2>
</script>

<script type="text/template" id="tpl_welcome">
<div class="content__title j-content__title">
<div class="content__title j-content__title j-welcome">
Welcome to QuickBlox chat sample!
</div>
<div class="notifications j-notifications hidden"></div>
<div class="content__inner j-content__inner">
<div class="welcome__message">
<p>Please select you opponent to start chatting.</p>
Expand All @@ -112,9 +113,8 @@ <h2 class="dashboard__title">Text Chat Sample</h2>
</script>

<script type="text/template" id="tpl_userConversations">
<% var num = _.random(1, 10) %>
<li class="dialog__item j-dialog__item" id="<%= dialog._id %>" data-name="<%- dialog.name %>">
<span class="dialog__avatar m-user__img_<%= num %> m-type_<%= dialog.type === 2 ? 'group' : 'chat' %>" >
<span class="dialog__avatar m-user__img_<%= dialog.color %> m-type_<%= dialog.type === 2 ? 'group' : 'chat' %>" >
<% if(dialog.type === 2) { %>
<i class="material-icons">supervisor_account</i>
<% } else { %>
Expand All @@ -125,21 +125,28 @@ <h2 class="dashboard__title">Text Chat Sample</h2>
<p class="dialog__name"><%- dialog.name %></p>
<p class="dialog__last_message j-dialog__last_message <%= dialog.attachment ? 'attachment' : ''%>"><%- dialog.last_message%></p>
</div>
<span class="dialog__last_message_date j-dialog__last_message_date">
<%= dialog.last_message_date_sent %>
</span>
<div class="dialog_additional_info">
<span class="dialog__last_message_date j-dialog__last_message_date">
<%= dialog.last_message_date_sent %>
</span>
<span class="dialog_unread_counter j-dialog_unread_counter <% !dialog.unread_messages_count ? print('hidden') : '' %>">
<% dialog.unread_messages_count ? print(dialog.unread_messages_count) : '' %>
</span>
</div>
</li>
</script>

<script type="text/template" id="tpl_conversationContainer">
<div class="content__title j-content__title">
<div class="content__title j-content__title j-dialog">
<button class="open_sidebar j-open_sidebar"></button>
<h1 class="dialog__title j-dialog__title"><%- title %></h1>
</div>
<div class="notifications j-notifications hidden"></div>
<div class="content__inner j-content__inner">
<div class=" messages j-messages"></div>
<form name="send_message" class="send_message" autocomplete="off">
<textarea name="message_feald" class="message_feald" id="message_feald" placeholder="Type a message"></textarea>
<textarea name="message_feald" class="message_feald" id="message_feald" autocomplete="off"
autocorrect="off" autocapitalize="off" placeholder="Type a message" autofocus></textarea>
<div class="message__actions">
<div class="attachments_preview j-attachments_preview"></div>
<label for="attach_btn" class="attach_btn">
Expand All @@ -160,7 +167,7 @@ <h1 class="dialog__title j-dialog__title"><%- title %></h1>
<div class="message__content_wrap">
<p class="message__sender_name"><%- sender ? sender.name : message.sender_id %></p>
<% if (message.message || message.body) { %>
<p class="message__text"><%- message.message || message.body %></p>
<p class="message__text"><%= message.message || message.body %></p>
<% } %>

<% if (message.attachments.length) { %>
Expand All @@ -178,18 +185,20 @@ <h1 class="dialog__title j-dialog__title"><%- title %></h1>
</script>

<script type="text/template" id="tpl_newGroupChat">
<div class="content__title j-content__title">
<div class="content__title j-content__title j-create_dialog">
<button class="back_to_dialog j-back_to_dialog">
<i class="material-icons">arrow_back</i>
</button>
<h1 class="group_chat__title">New Group Chat</h1>
</div>
<div class="notifications j-notifications hidden"></div>
<div class="content__inner j-content__inner">
<p class="group__chat__description">Select participants:</p>
<div class="group_chat__user_list j-group_chat__user_list">
</div>
<form action="" name="create_dialog" class="create_dialog_form j-create_dialog_form">
<input class="dialog_name" name="dialog_name" type="text" placeholder="Add conversation name" disabled>
<input class="dialog_name" name="dialog_name" type="text" autocomplete="off"
autocorrect="off" autocapitalize="off" placeholder="Add conversation name" disabled>
<button class="create_dialog_btn j-create_dialog_btn" type="submit" name="create_dialog_submit" disabled>create</button>
</form>
</div>
Expand Down Expand Up @@ -238,6 +247,11 @@ <h1 class="group_chat__title">New Group Chat</h1>
<p class="attachment__error">Can't load attachment...</p>
</script>

<script type="text/template" id="tpl_lost_connection">
<div class="titile">Waiting for network.</div>
<div class="spinner"><img src="img/loader2.gif" alt="wating"></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wating = waiting

</script>

<script src="./js/QBconfig.js" defer></script>
<script src="./js/user.js" defer></script>
<script src="./js/dialog.js" defer></script>
Expand Down
10 changes: 6 additions & 4 deletions samples/newChat/js/QBconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ var QBconfig = {
enable: true
},
debug: {
mode: 0,
mode: 1,
file: null
},
}
}
};

Expand Down Expand Up @@ -95,7 +95,9 @@ var CONSTANTS = {
PUBLICCHAT: 1
},
ATTACHMENT: {
TYPE : 'image',
BODY : '[attachment]'
TYPE: 'image',
BODY: '[attachment]',
MAXSIZE: 2 * 1000000, // set 2 megabytes,
MAXSIZEMESSAGE: 'Image is too large. Max size is 2 mb.'
}
};
Loading