diff --git a/js/public/app.js b/js/public/app.js index 4c3f801..75b0fea 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -39,31 +39,6 @@ function toBool(str) { return null; } -var SearchProxy = {}; - -(function(OC, _) { - 'use strict'; - - var filter = function() {}; - - SearchProxy = { - attach: function(search) { - search.setFilter('phone', this.filterProxy); - }, - filterProxy: function(query) { - filter(query); - }, - setFilter: function(newFilter) { - filter = newFilter; - } - }; - - if (!_.isUndefined(OC.Plugins)) { - OC.Plugins.register('OCA.Search', SearchProxy); - } - -})(OC, _); - app.directive('toInt', function() { return { require: 'ngModel', @@ -127,6 +102,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' $scope.totalMessageCount = 0; $scope.photoVersion = 1; $scope.selectedContact = {}; + $scope.lastSearch = ''; // Settings $scope.sendCountry = function () { @@ -313,9 +289,14 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' }; $scope.filterSms = function (query) { - alert('scope filter'); + if (query != $scope.lastSearch) { + } }; - SearchProxy.setFilter($scope.filterSms); + OC.Plugins.register('OCA.Search', { + attach: function(search) { + search.setFilter('sms', $scope.filterSms); + } + }); /* * Contact list management diff --git a/templates/main.php b/templates/main.php index 834981c..d6aed8b 100644 --- a/templates/main.php +++ b/templates/main.php @@ -78,13 +78,16 @@ use \OCA\OcSms\Lib\CountryCodes;
Please choose a conversation on the left menu
-
-
-
{{ message.content }}
-
-
{{ message.date | date:'medium' }}
+
+
+
+
{{ message.content }}
+
+
{{ message.date | date:'medium' }}
+
+
-
+