diff --git a/CHANGELOG.md b/CHANGELOG.md index bf7762a..16e76a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +1.7.0 (-CURRENT) +* Enhance the contact list using nicer list like in contact app +* PHP code cleanup (thanks to PHPStorm) +* Angular app code cleanup & enhancements + 1.6.0 * You can now limit messages shown when loading a conversation * Update AngularJS to 1.4.9 diff --git a/js/public/app.js b/js/public/app.js index 83c6b4b..87c7ab0 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -237,6 +237,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' $scope.messages = []; }); $scope.selectedContact.nav = ""; + OC.Util.History.pushState(''); }); }; @@ -307,7 +308,6 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' $scope.fetchInitialPeerList = function (jsondata) { // Use a buffer for better jQuery performance - var peerListBuf = ""; var photoPrefix = ""; var bufferedContacts = []; @@ -317,16 +317,14 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' } $.each(jsondata['phonelist'], function(id, val) { - var fn, peerLabel, idxVal; + var peerLabel, idxVal; idxVal = id.replace(/\//g,' '); idxVal2 = idxVal.replace('/ /g',''); if (typeof jsondata['contacts'][id] == 'undefined') { - fn = ''; peerLabel = idxVal; } else { - fn = jsondata['contacts'][id]; - peerLabel = fn; + peerLabel = jsondata['contacts'][id]; } if (!inArray(peerLabel, bufferedContacts)) { $scope.addContact({'label': peerLabel, 'nav': idxVal2, 'avatar': photoPrefix + jsondata['photos'][peerLabel], 'unread' : 0}); @@ -422,6 +420,11 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' if (pnParam != null) { var urlPhoneNumber = decodeURIComponent(pnParam); if (urlPhoneNumber != null) { + // If no contact when loading, creating a new contact from urlPhoneNumber + if ($scope.selectedContact.nav === undefined) { + $scope.selectedContact.label = urlPhoneNumber; + $scope.selectedContact.nav = urlPhoneNumber; + } $scope.fetchConversation(null); changeSelectedConversation($("a[mailbox-navigation='" + urlPhoneNumber + "']")); }