1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 16:06:15 +00:00

another cleanup

This commit is contained in:
Loïc Blot (@U-Exp) 2014-09-26 18:25:57 +02:00
parent 36b90e41e9
commit 968cc49a7f

View File

@ -7,7 +7,7 @@
* @author Loic Blot <loic.blot@unix-experience.fr> * @author Loic Blot <loic.blot@unix-experience.fr>
* @copyright Loic Blot 2014 * @copyright Loic Blot 2014
*/ */
// Some global vars to improve performances // Some global vars to improve performances
var selectedConversation = null; var selectedConversation = null;
@ -64,8 +64,8 @@ function fetchConversation(phoneNumber) {
formatedDate = msgDate.getDate() + " " + months[msgDate.getMonth()-1] + " " + formatedDate = msgDate.getDate() + " " + months[msgDate.getMonth()-1] + " " +
formatedHour + ":" + formatedMin; formatedHour + ":" + formatedMin;
conversationBuf += '<div><div class="' + msgClass + '"><div>' + conversationBuf += '<div><div class="' + msgClass + '"><div>' +
vals["msg"] + '</div><div class="msg-date">' + vals["msg"] + '</div><div class="msg-date">' +
formatedDate + '</div></div><div class="msg-spacer"></div></div>'; formatedDate + '</div></div><div class="msg-spacer"></div></div>';
}); });
@ -86,11 +86,6 @@ function changeSelectedConversation(item) {
(function ($, OC) { (function ($, OC) {
$(document).ready(function () { $(document).ready(function () {
// Now bind the events when we click on the phone number // Now bind the events when we click on the phone number
$('#app-navigation').find('a').on('click', function (event) {
OC.Util.History.pushState('feed=' + $(this).attr('nav-feed'));
event.preventDefault();
});
$.getJSON(OC.generateUrl('/apps/ocsms/get/peerlist'), function(jsondata, status) { $.getJSON(OC.generateUrl('/apps/ocsms/get/peerlist'), function(jsondata, status) {
// Use a buffer for better jQuery performance // Use a buffer for better jQuery performance
var peerListBuf = ""; var peerListBuf = "";
@ -113,7 +108,7 @@ function changeSelectedConversation(item) {
var urlPhoneNumber = decodeURIComponent($.urlParam('phonenumber')); var urlPhoneNumber = decodeURIComponent($.urlParam('phonenumber'));
if (urlPhoneNumber != null) { if (urlPhoneNumber != null) {
fetchConversation(urlPhoneNumber); fetchConversation(urlPhoneNumber);
var pObject = $("a[mailbox-navigation='" + urlPhoneNumber + "']"); var pObject = $("a[mailbox-navigation='" + urlPhoneNumber + "']");
if (pObject != null) { if (pObject != null) {
changeSelectedConversation(pObject); changeSelectedConversation(pObject);