Use point icon for ng-click

This commit is contained in:
Tor Hveem 2013-10-16 14:25:07 +02:00
parent b40ff4fb43
commit ce22e44534
3 changed files with 22 additions and 3 deletions

View File

@ -200,7 +200,7 @@ input[type=text], input[type=password] {
} }
.color-gray { .color-gray {
color: lightgray; color: lightgray;u
} }
.color-brown { .color-brown {
@ -219,3 +219,8 @@ li.notification {
color: green; color: green;
} }
[ng-click],
[data-ng-click],
[x-ng-click] {
cursor: pointer;
}

View File

@ -69,7 +69,7 @@
<input type="text" class="form-control" id="lines" ng-model="lines" placeholder="40"> <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> <p class="help-block">Enter number of lines to sync from WeeChat on connect</p>
</div> </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> </form>
</div> </div>
</div> </div>
@ -129,9 +129,14 @@
<div class="brand pull-left"> <div class="brand pull-left">
<img alt="brand" src="img/favicon.png"> <img alt="brand" src="img/favicon.png">
</div> </div>
<div class="title"> <div class="title pull-left">
{{ pageTitle}} {{ pageTitle}}
</div> </div>
<div class="actions pull-right">
<a ng-click="disconnect()">
<i class="glyphicon glyphicon-remove"></i>
</a>
</div>
</div> </div>
<div id="sidebar"> <div id="sidebar">
<form class="form-inline" role="form"> <form class="form-inline" role="form">

View File

@ -410,6 +410,11 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
this.websocket = websocket; this.websocket = websocket;
} }
var disconnect = function() {
console.log(this.websocket);
this.websocket.close();
}
var sendMessage = function(message) { var sendMessage = function(message) {
doSend(WeeChatProtocol.formatInput({ doSend(WeeChatProtocol.formatInput({
buffer: models.getActiveBuffer()['fullName'], buffer: models.getActiveBuffer()['fullName'],
@ -421,6 +426,7 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
return { return {
send: doSend, send: doSend,
connect: connect, connect: connect,
disconnect: disconnect,
sendMessage: sendMessage sendMessage: sendMessage
} }
}]); }]);
@ -509,6 +515,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$scope.connect = function() { $scope.connect = function() {
connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl); 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 */ /* Function gets called from bufferLineAdded code if user should be notified */
$rootScope.createHighlight = function(buffer, message) { $rootScope.createHighlight = function(buffer, message) {