Added help-button in chat

This commit is contained in:
Kasper Rynning-Tønnesen
2018-09-26 10:31:17 +02:00
parent f1b3ccad98
commit 9e18b85218
3 changed files with 14 additions and 3 deletions

View File

@@ -1630,9 +1630,11 @@ margin:-1px;
box-shadow: none;
}
#chat_submit{
#chat_submit, #chat_help{
margin-top: 4px;
margin-left: 4%;
margin-left: 2%;
width: 12.45%;
padding: 0;
}
.indicator {

View File

@@ -488,6 +488,14 @@ function addDynamicListeners() {
//document.getElementById("chatForm").submit();
});
addListener("click", "#chat_help", function(event) {
this.preventDefault(),
this.stopPropagation();
document.getElementById("text-chat-input").value = "/help";
Chat.chat(document.getElementById("chatForm").input);
document.getElementById("chat_submit").focus();
});
addListener("click", "#offline-mode", function(event){
this.preventDefault();
if(!Crypt.get_offline()){

View File

@@ -18,8 +18,9 @@
</li>
<li id="chat-input" class="row">
<form action="#" id="chatForm">
<input id="text-chat-input" class="col s9" name="input" type="text" autocomplete="off" placeholder="Chat" maxlength="150" />
<input id="text-chat-input" class="col s8" name="input" type="text" autocomplete="off" placeholder="Chat" maxlength="150" />
<a href="#" id="chat_submit" class="btn col s2 white waves-effect"><i class="material-icons">send</i></a>
<a href="#" id="chat_help" class="btn col s2 white waves-effect"><i class="material-icons">help</i></a>
</form>
</li>
</ul>