Merge pull request #64 from torhve/master

Fixes
This commit is contained in:
David Cormier 2013-10-25 11:11:25 -07:00
commit f50b89e062
4 changed files with 35 additions and 1283 deletions

View file

@ -95,7 +95,7 @@ input#sendMessage {
border: 0;
width: 100%;
}
.panel input {
.panel input, .panel .input-group {
max-width: 300px;
}
input[type=text], input[type=password], .badge {

View file

@ -10,7 +10,7 @@
<link href="css/glowingbear.css" rel="stylesheet" media="screen">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular-sanitize.min.js"></script>
<script type="text/javascript" src="js/underscore.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
<script type="text/javascript" src="js/localstorage.js"></script>
<script type="text/javascript" src="js/weechat.js"></script>
<script type="text/javascript" src="js/websockets.js"></script>
@ -45,27 +45,28 @@
<div class="panel-body">
<form class="form-signin" role="form">
<div class="form-group">
<label class="control-label" for="host">WeeChat hostname</label>
<input type="text" class="form-control" id="host" ng-model="host" placeholder="Address">
<p class="help-block">Enter the hostname to the WeeChat relay</p>
</div>
<div class="form-group">
<label class="control-label" for="port">WeeChat port number</label>
<input type="text" class="form-control" id="port" ng-model="port" placeholder="9001">
<p class="help-block">Enter the the port to the WeeChat relay</p>
</div>
<div class="form-group">
<label class="control-label" for="password">WeeChat relay password</label>
<label class="control-label" for="host">WeeChat relay hostname and port number</label>
<div class="input-group">
<input type="text" class="form-control" id="host" ng-model="host" placeholder="Address">
<input type="text" class="form-control" id="port" ng-model="port" placeholder="9001">
</div>
<div class="alert alert-danger" ng-show="passwordError">
Error wrong password
</div>
<label class="control-label" for="password">WeeChat relay password</label>
<input type="password" class="form-control" id="password" ng-model="password" placeholder="Password">
<p class="help-block">Password will be stored in your browser session</p>
</div>
<div class="form-group">
<label class="control-label" for="proto">Encryption</label>
<input type="checkbox" class="form-control" id="ssl" ng-model="ssl">
<p class="help-block">Read encryption instructions for help</p>
<div class="checkbox">
<label>
<input type="checkbox" class="checkbox" id="savepassword" ng-model="savepassword">
Save password in your browser
</label>
</div>
<div class="checkbox">
<label class="control-label " for="ssl">
<input type="checkbox" class="" id="ssl" ng-model="ssl">
Encryption. Read instructions for help
</label>
</div>
</div>
<div class="form-group">
<label class="control-label" for="port">Lines</label>

File diff suppressed because it is too large Load diff

View file

@ -323,13 +323,17 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', '$log', 'models', 'connection', function ($rootScope, $scope, $store, $timeout, $log, models, connection, testService) {
// Request notification permission
Notification.requestPermission(function (status) {
$log.info('Notification permission status:',status);
if (Notification.permission !== status) {
Notification.permission = status;
}
});
if(window.Notification) {
// Request notification permission
Notification.requestPermission(function (status) {
$log.info('Notification permission status:',status);
if (Notification.permission !== status) {
Notification.permission = status;
}
});
}
if(window.webkitNotifications != undefined) {
if (window.webkitNotifications.checkPermission() == 0) { // 0 is PERMISSION_ALLOWED
$log.info('Notification permission status:', window.webkitNotifications.checkPermission() == 0);
@ -345,7 +349,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}else {
$scope.isinstalled = false;
}
console.log($scope.isinstalled);
}
}else {
$scope.isinstalled = false;
@ -362,12 +365,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// the user switches a buffer. This will ensure that notifications
// are cleared in the buffer the user switches to
if($scope.hotlistsync && ab.fullName) {
/*
doSend(weeChat.Protocol.formatInput({
buffer: 'weechat',
data: '/buffer ' + ab.fullName
}));
*/
connection.sendCoreCommand('/buffer ' + ab.fullName);
}
@ -404,12 +401,12 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$store.bind($scope, "host", "localhost");
$store.bind($scope, "port", "9001");
$store.bind($scope, "proto", "weechat");
$store.bind($scope, "password", "");
$store.bind($scope, "ssl", false);
$store.bind($scope, "lines", "40");
// TODO checkbox for saving password or not?
// $scope.password = "";
//
$store.bind($scope, "savepassword", false);
if($scope.savepassword) {
$store.bind($scope, "password", "");
}
// Save setting for displaying only buffers with unread messages
$store.bind($scope, "onlyUnread", false);