Form control for number of lines to sync

This commit is contained in:
Tor Hveem 2013-10-11 23:21:51 +02:00
parent 5a8294b2cc
commit 1609346668
2 changed files with 8 additions and 3 deletions

View File

@ -72,6 +72,11 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
<input type="checkbox" class="form-control" id="ssl" ng-model="ssl"> <input type="checkbox" class="form-control" id="ssl" ng-model="ssl">
<p class="help-block">Check the box if you want to encrypt communication between browser and WeeChat. <strong>Note</strong>: Due to a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=594502">bug</a> encryption will not work in Firefox. You must also first visit the URL https://weechathost:relayport/ to accept the certificate</p> <p class="help-block">Check the box if you want to encrypt communication between browser and WeeChat. <strong>Note</strong>: Due to a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=594502">bug</a> encryption will not work in Firefox. You must also first visit the URL https://weechathost:relayport/ to accept the certificate</p>
</div> </div>
<div class="form-group">
<label class="control-label" for="port">Lines</label>
<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!</button>
</form> </form>
</div> </div>

View File

@ -429,6 +429,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$store.bind($scope, "proto", "weechat"); $store.bind($scope, "proto", "weechat");
$store.bind($scope, "password", ""); $store.bind($scope, "password", "");
$store.bind($scope, "ssl", false); $store.bind($scope, "ssl", false);
$store.bind($scope, "lines", "40");
// TODO checkbox for saving password or not? // TODO checkbox for saving password or not?
// $scope.password = ""; // $scope.password = "";
@ -466,8 +467,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl); connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl);
} }
$rootScope.getLines = function() { $rootScope.getLines = function() {
var count = 20; connection.getLines($scope.lines);
connection.getLines(count);
} }
/* Function gets called from bufferLineAdded code if user should be notified */ /* Function gets called from bufferLineAdded code if user should be notified */