aboutsummaryrefslogtreecommitdiffstats
path: root/alias-angular
diff options
context:
space:
mode:
Diffstat (limited to 'alias-angular')
-rw-r--r--alias-angular/app/css/app.less14
-rw-r--r--alias-angular/app/index.html14
-rw-r--r--alias-angular/app/js/controllers.js22
-rw-r--r--alias-angular/app/js/filters.js2
4 files changed, 42 insertions, 10 deletions
diff --git a/alias-angular/app/css/app.less b/alias-angular/app/css/app.less
index 5006542..e78e124 100644
--- a/alias-angular/app/css/app.less
+++ b/alias-angular/app/css/app.less
@@ -13,7 +13,7 @@ html, body{
width: 250px;
background-color: @background-gray;
border: 1px solid @border-gray;
-
+
ul{
list-style: none;
padding: 0;
@@ -28,19 +28,19 @@ html, body{
padding: 1em 1em;
color: #363636;
.transition(0.3s);
-
+
&:hover{
background-color: @background-gray;
}
-
+
&:first-child{
border-top: 1px solid @border-gray;
}
-
+
i{
font-size:120%;
}
-
+
.online{
color: #3D9940;
}
@@ -62,3 +62,7 @@ html, body{
margin-bottom:20px;
}
+#main{
+ float: left;
+ margin-left: 20px;
+} \ No newline at end of file
diff --git a/alias-angular/app/index.html b/alias-angular/app/index.html
index 2c823e3..4305308 100644
--- a/alias-angular/app/index.html
+++ b/alias-angular/app/index.html
@@ -32,12 +32,24 @@
</label>
</form>
<ul>
- <li ng-repeat="contact in get_contacts() | hideoffline:checkoffline | rosterFilter:query|orderBy:'status'"><i ng-class="contact.status" class="icon-user"></i> {{contact.name||contact.jid}}</li>
+ <li ng-repeat="contact in get_contacts() | showoffline:checkoffline | rosterFilter:query|orderBy:'status'" ng-click="chatWith(contact)">
+ <i ng-class="contact.status" class="icon-user"></i> {{contact.name||contact.jid}}</li>
</ul>
</div>
+ <div id="main" ng-controller="MsgCtl">
+ <ul class="tabs">
+ <li ng-repeat="conversation in conversations" ng-class="isAsctive(conversation.jid)" ng-click="activetab=conversation.jid">
+ <a ng-href="#{{conversation.jid}}">{{conversation.name||conversation.jid}} <i class="icon-remove"></i></a>
+ </li>
+ </ul>
+ <div class="tab-content">
+ <div id="{{conversation.jid}}" ng-class="isActive(conversation.jid)" ng-repeat="conversation in conversations">Je suis {{conversation.jid}}
+ </div>
+ </div>
<script src="lib/angular/angular.js"></script>
<script src="lib/jquery-1.7.2.min.js"></script>
<script src="lib/underscore-min.js"></script>
+ <script src="lib/bootstrap-tab.js"></script>
<script src="lib/config.js"></script>
<script src="js/alias.js"></script>
<script src="lib/strophe.js"></script>
diff --git a/alias-angular/app/js/controllers.js b/alias-angular/app/js/controllers.js
index 1eb53e7..8768915 100644
--- a/alias-angular/app/js/controllers.js
+++ b/alias-angular/app/js/controllers.js
@@ -36,7 +36,7 @@ function ConnectCtl($scope, StropheSrv, $log, $rootScope) {
ConnectCtl.$inject = ['$scope', 'StropheSrv', '$log', '$rootScope'];
-function RosterCtl($scope, StropheSrv, $log) {
+function RosterCtl($scope, StropheSrv, $log, $rootScope) {
$scope.contacts = {};
$scope.get_contacts = function() {
return _.toArray($scope.contacts);
@@ -82,10 +82,26 @@ function RosterCtl($scope, StropheSrv, $log) {
$scope.getRoster();
});
- $scope.getRoster = function () {
+ $scope.getRoster = function() {
var query = $iq({type : 'get'}).c('query', {xmlns : Strophe.NS.ROSTER});
StropheSrv.sendIQ(query, onRoster);
};
+
+ $scope.chatWith = function(contact) {
+ $rootScope.$broadcast('msgrequest', {jid: contact.jid, name:contact.name});
+ };
}
-RosterCtl.$inject = ['$scope','StropheSrv','$log'];
+RosterCtl.$inject = ['$scope','StropheSrv','$log', '$rootScope'];
+
+function MsgCtl($scope, $log) {
+ $scope.conversations = [];
+ $scope.$on('msgrequest', function(event, contact){
+ $log.log(contact);
+ if (_.indexOf($scope.conversations, contact)) {
+ $scope.conversations.push(contact);
+ }
+ });
+}
+
+MsgCtl.$inject = ['$scope','$log']; \ No newline at end of file
diff --git a/alias-angular/app/js/filters.js b/alias-angular/app/js/filters.js
index 6b77998..772e523 100644
--- a/alias-angular/app/js/filters.js
+++ b/alias-angular/app/js/filters.js
@@ -15,7 +15,7 @@ angular.module('Alias.filters', []).
});
}
};
- }).filter('hideoffline', function() {
+ }).filter('showoffline', function() {
return function(contacts, checkoffline) {
if(checkoffline) {
return contacts;