From ce22e445344d88bb6d9cf0d12381b934c89bffa4 Mon Sep 17 00:00:00 2001 From: Tor Hveem <tor@hveem.no> Date: Wed, 16 Oct 2013 14:25:07 +0200 Subject: [PATCH] Use point icon for ng-click --- css/glowingbear.css | 7 ++++++- index.html | 9 +++++++-- js/websockets.js | 9 +++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 827d5d8..77c795b 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -200,7 +200,7 @@ input[type=text], input[type=password] { } .color-gray { - color: lightgray; + color: lightgray;u } .color-brown { @@ -219,3 +219,8 @@ li.notification { color: green; } +[ng-click], +[data-ng-click], +[x-ng-click] { + cursor: pointer; +} diff --git a/index.html b/index.html index e57e91c..a1dc516 100644 --- a/index.html +++ b/index.html @@ -69,7 +69,7 @@ <input type="text" class="form-control" id="lines" ng-model="lines" placeholder="40"> <p class="help-block">Enter number of lines to sync from WeeChat on connect</p> </div> - <button class="btn btn-lg btn-primary" ng-click="connect()">Connect!</button> + <button class="btn btn-lg btn-primary" ng-click="connect()">Connect <i class="glyphicon glyphicon-chevron-right"></i></button> </form> </div> </div> @@ -129,9 +129,14 @@ <div class="brand pull-left"> <img alt="brand" src="img/favicon.png"> </div> - <div class="title"> + <div class="title pull-left"> {{ pageTitle}} </div> + <div class="actions pull-right"> + <a ng-click="disconnect()"> + <i class="glyphicon glyphicon-remove"></i> + </a> + </div> </div> <div id="sidebar"> <form class="form-inline" role="form"> diff --git a/js/websockets.js b/js/websockets.js index 8cd1235..d990f4f 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -410,6 +410,11 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers', this.websocket = websocket; } + var disconnect = function() { + console.log(this.websocket); + this.websocket.close(); + } + var sendMessage = function(message) { doSend(WeeChatProtocol.formatInput({ buffer: models.getActiveBuffer()['fullName'], @@ -421,6 +426,7 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers', return { send: doSend, connect: connect, + disconnect: disconnect, sendMessage: sendMessage } }]); @@ -509,6 +515,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.connect = function() { connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl); } + $scope.discconnect = function() { + connection.disconnect(); + } /* Function gets called from bufferLineAdded code if user should be notified */ $rootScope.createHighlight = function(buffer, message) {