Skip to content

Commit

Permalink
Added basic sending/ receiving of group-messages (still very buggy!)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthyG committed Dec 3, 2017
1 parent 7c8de3b commit e6ba8f7
Show file tree
Hide file tree
Showing 4 changed files with 1,110 additions and 10 deletions.
13 changes: 13 additions & 0 deletions dbschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"node": "private_messages",
"table": "private_messages"
},
{
"node": "group_messages",
"table": "group_messages"
},
{
"node": "extra_data",
"table": "extra_data"
Expand Down Expand Up @@ -60,6 +64,15 @@
"indexes": ["CREATE UNIQUE INDEX private_message_key ON private_messages(json_id, message_id)"],
"schema_changed": 6
},
"group_messages": {
"cols": [
["message_id", "INTEGER PRIMARY KEY AUTOINCREMENT"],
["message", "TEXT"],
["json_id", "INTEGER REFERENCES json (json_id)"]
],
"indexes": ["CREATE UNIQUE INDEX group_message_key ON group_messages(json_id, message_id)"],
"schema_changed": 1
},
"images": {
"cols": [
["image_id", "INTEGER PRIMARY KEY AUTOINCREMENT"],
Expand Down
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<a target-tab="PrivateChat" href="javascript:void(0)"><i class="icon icon-mail"></i></a>
</li>

<li class="tab-item hideifnotloggedin hide">
<a target-tab="GroupChat" href="javascript:void(0)"><i class="icon icon-share"></i></a>
</li>

<li class="tab-item hideifnotloggedin hide">
<a target-tab="LastSeen" href="javascript:void(0)"><i class="icon icon-time"></i></a>
</li>
Expand Down Expand Up @@ -152,6 +156,43 @@
</div>
</div>

<div tab="GroupChat" class="panel">
<div class="panel-nav">
<input type="hidden" id="group_recipient" />
<ul class="tab" id="group_list">
</ul>
</div>
<div id="group_messagesAt" class="label fixed"></div>

<div class="panel-body" style="overflow-x: hidden;">
<button id="group_scrolltobottombtn" class="btn btn-action btn-lg btn-primary shadow-drop-2-bottom circle hide"><i class="icon icon-arrow-down"></i></button>

<ul id="group_messages" class="unstyled message-list"></ul>
</div>

<div id="group_inputsC2" class="panel-footer #fixed shadow-drop-top inputsC2">
<input class="hide form-input media_uploader" is-group="true" type="file" name="files[]" accept="image/png,image/jpg,image/jpeg,image/gif,.png,.jpg,.jpeg,.gif,audio/mp3,audio/ogg,.mp3,.ogg,video/ogg,video/mp4,mp4" />

<div class="hide media_previewC container grid-lg">
<div class="media_preview" is-group="true">
<figure class="figure">
<img src="" class="img-responsive img-fit-contain" alt="" />
<figcaption class="figure-caption text-center"></figcaption>
</figure>
</div>
</div>

<div class="container grid-lg pt-5 pb-5" style="/*background-color: #202a2f;*/">
<div class="input-group" style="/*padding-right: 4rem;*/">
<button class="btn btn-primary btn-lg btn-action input-group-btn media_selector_btn" is-group="true" id="group_media_selector_btn"><i class="icon icon-plus"></i></button>
<button class="btn btn-lg btn-action input-group-btn hide media_selector_cancel_btn" is-group="true" id="group_media_selector_cancel_btn"><i class="icon icon-cross"></i></button>
<textarea class="form-input input-lg message" placeholder="Message.." id="group_message" is-group="true" onkeypress="if (event.keyCode == 13 && !event.shiftKey) { page.sendGroupMessage(); return false; }" rows="1"></textarea>
<button class="btn btn-primary btn-lg btn-action input-group-btn" id="group_send" is-group="true" onclick="return page.sendGroupMessage()"><i class="icon icon-forward"></i></button>
</div>
</div>
</div>
</div>

<div tab="PrivateChat" class="panel">
<div class="panel-nav">
<input type="hidden" id="private_recipient" />
Expand Down
Loading

0 comments on commit e6ba8f7

Please sign in to comment.