Commit 2a9bdbd8 authored by Kristopher Ruzic's avatar Kristopher Ruzic

remove jquery usage

use pure JS for message sending etc.
parent 7afa6fa1
......@@ -369,10 +369,10 @@
theme = "a",\n
timestamp_class, final_text, msg_class;\n
if (is_incoming) {\n
msg_class = "msg incoming-msg";\n
msg_class = "msg incoming-msg ui-li-static ui-body-a";\n
timestamp_class = "incoming-timestamp";\n
} else {\n
msg_class = "msg outgoing-msg";\n
msg_class = "msg outgoing-msg ui-li-static ui-body-a";\n
timestamp_class = "outgoing-timestamp";\n
}\n
var timestamp = getHumanReadableDate();\n
......@@ -490,17 +490,17 @@
\n
function sendMessageHandler(e) {\n
// don\'t send empty messages \n
if (!message_box.val().trim()) {\n
if (!message_box.value.trim()) {\n
if (e.which === 13 && !e.shiftKey) {\n
e.preventDefault();\n
} \n
return true;\n
}\n
// send messages when the field is focused and Enter is pressed \n
if (e.which == 13 && !e.shiftKey && message_box.is(":focus")) {\n
if (e.which == 13 && !e.shiftKey) {\n
e.preventDefault(); // prevent newline from being added before sending\n
var text = message_box.val();\n
message_box.val("");\n
var text = message_box.value;\n
message_box.value = "";\n
return RSVP.all([\n
connection_gadget.sendMessage(jid, text),\n
updateConversation(gadget, jid, text, false)\n
......@@ -509,8 +509,8 @@
}\n
\n
// add keypress listener to textarea\n
message_box = $(\'#jabber-message\');\n
message_box.on(\'keypress\', function(e) {\n
message_box = document.getElementById(\'jabber-message\');\n
message_box.addEventListener(\'keypress\', function(e) {\n
sendMessageHandler(e);\n
});\n
\n
......@@ -1071,7 +1071,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.50968.2671.43690</string> </value>
<value> <string>945.58073.19264.41113</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -1089,7 +1089,7 @@
</tuple>
<state>
<tuple>
<float>1442395694.36</float>
<float>1442822136.19</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment