Add a button to the input bar to complete nicks

This commit is contained in:
Alice Jenkinson 2017-03-17 18:37:59 +13:00
parent ddc2b14584
commit 520f2ac349
7 changed files with 20 additions and 3 deletions

View file

@ -89,6 +89,12 @@ input[type=text], input[type=password], #sendMessage {
margin-bottom: 5px !important;
}
.btn-complete-nick {
position: relative;
overflow: hidden;
cursor: pointer;
}
.btn-send-image {
position: relative;
overflow: hidden;

View file

@ -302,7 +302,7 @@ input[type=text], input[type=password], #sendMessage, .badge {
box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1), 0px 1px 7px 0px rgba(0, 0, 0, 0.2) inset;
}
input[type=text], input[type=password], #sendMessage, .btn-send, .btn-send-image {
input[type=text], input[type=password], #sendMessage, .btn-send, .btn-send-image, .btn-complete-nick {
color: var(--base05);
background: var(--base01);
}
@ -335,6 +335,7 @@ input[type=text]:-moz-placeholder, input[type=password]:-moz-placeholder { /* Fi
background: var(--base08);
}
.btn-complete-nick:hover, .btn-complete-nick:focus,
.btn-send:hover, .btn-send:focus,
.btn-send-image:hover, .btn-send-image:focus {
background-color: var(--base07);

View file

@ -88,11 +88,12 @@ input[type=text], input[type=password], #sendMessage, .badge {
border: 1px solid #4a5b6c;
}
input[type=text], input[type=password], #sendMessage, .badge, .btn-send, .btn-send-image {
input[type=text], input[type=password], #sendMessage, .badge, .btn-send, .btn-send-image, .btn-complete-nick {
color: #ccc;
background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.3);
}
.btn-complete-nick:hover, .btn-complete-nick:focus,
.btn-send:hover, .btn-send:focus,
.btn-send-image:hover, .btn-send-image:focus {
background-color: #555;

View file

@ -82,11 +82,12 @@ input[type=text], input[type=password], #sendMessage, .badge {
box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1), 0px 1px 7px 0px rgba(0, 0, 0, 0.8) inset;
}
input[type=text], input[type=password], #sendMessage, .badge, .btn-send, .btn-send-image {
input[type=text], input[type=password], #sendMessage, .badge, .btn-send, .btn-send-image, .btn-complete-nick {
color: #ccc;
background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.3);
}
.btn-complete-nick:hover, .btn-complete-nick:focus,
.btn-send:hover, .btn-send:focus,
.btn-send-image:hover, .btn-send-image:focus {
background-color: #555;

View file

@ -27,6 +27,7 @@ html {
background: #428BCA;
}
.btn-complete-nick,
.btn-send,
.btn-send-image, {
background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.3);

View file

@ -3,6 +3,7 @@
<textarea id="{{inputId}}" class="form-control favorite-font" ng-trim="false" rows="1" ng-change="inputChanged()" autocomplete="on" ng-model="command" ng-focus="hideSidebar()">
</textarea>
<span class="input-group-btn">
<button class="btn btn-complete-nick unselectable" title="Complete nick" ng-click="handleCompleteNickButton($event)"><i class="glyphicon glyphicon-chevron-right"></i></button>
<label class="btn btn-send-image unselectable" for="imgur-upload" title="Send image">
<i class="glyphicon glyphicon-picture"></i>
<input type="file" accept="image/*" multiple title="Send image" id="imgur-upload" class="imgur-upload" file-change="uploadImage($event, files)">

View file

@ -497,6 +497,12 @@ weechat.directive('inputBar', function() {
return true;
}
};
$scope.handleCompleteNickButton = function($event) {
$event.preventDefault();
$scope.completeNick();
return true;
};
}]
};
});