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; border: 0;
width: 100%; width: 100%;
} }
.panel input { .panel input, .panel .input-group {
max-width: 300px; max-width: 300px;
} }
input[type=text], input[type=password], .badge { input[type=text], input[type=password], .badge {

View file

@ -10,7 +10,7 @@
<link href="css/glowingbear.css" rel="stylesheet" media="screen"> <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.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.2/angular-sanitize.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/localstorage.js"></script>
<script type="text/javascript" src="js/weechat.js"></script> <script type="text/javascript" src="js/weechat.js"></script>
<script type="text/javascript" src="js/websockets.js"></script> <script type="text/javascript" src="js/websockets.js"></script>
@ -45,27 +45,28 @@
<div class="panel-body"> <div class="panel-body">
<form class="form-signin" role="form"> <form class="form-signin" role="form">
<div class="form-group"> <div class="form-group">
<label class="control-label" for="host">WeeChat hostname</label> <label class="control-label" for="host">WeeChat relay hostname and port number</label>
<input type="text" class="form-control" id="host" ng-model="host" placeholder="Address"> <div class="input-group">
<p class="help-block">Enter the hostname to the WeeChat relay</p> <input type="text" class="form-control" id="host" ng-model="host" placeholder="Address">
</div> <input type="text" class="form-control" id="port" ng-model="port" placeholder="9001">
<div class="form-group"> </div>
<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>
<div class="alert alert-danger" ng-show="passwordError"> <div class="alert alert-danger" ng-show="passwordError">
Error wrong password Error wrong password
</div> </div>
<label class="control-label" for="password">WeeChat relay password</label>
<input type="password" class="form-control" id="password" ng-model="password" placeholder="Password"> <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 class="checkbox">
</div> <label>
<div class="form-group"> <input type="checkbox" class="checkbox" id="savepassword" ng-model="savepassword">
<label class="control-label" for="proto">Encryption</label> Save password in your browser
<input type="checkbox" class="form-control" id="ssl" ng-model="ssl"> </label>
<p class="help-block">Read encryption instructions for help</p> </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>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="port">Lines</label> <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) { 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) { if(window.Notification) {
$log.info('Notification permission status:',status); // Request notification permission
if (Notification.permission !== status) { Notification.requestPermission(function (status) {
Notification.permission = status; $log.info('Notification permission status:',status);
} if (Notification.permission !== status) {
}); Notification.permission = status;
}
});
}
if(window.webkitNotifications != undefined) { if(window.webkitNotifications != undefined) {
if (window.webkitNotifications.checkPermission() == 0) { // 0 is PERMISSION_ALLOWED if (window.webkitNotifications.checkPermission() == 0) { // 0 is PERMISSION_ALLOWED
$log.info('Notification permission status:', window.webkitNotifications.checkPermission() == 0); $log.info('Notification permission status:', window.webkitNotifications.checkPermission() == 0);
@ -345,7 +349,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}else { }else {
$scope.isinstalled = false; $scope.isinstalled = false;
} }
console.log($scope.isinstalled);
} }
}else { }else {
$scope.isinstalled = false; $scope.isinstalled = false;
@ -362,12 +365,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// the user switches a buffer. This will ensure that notifications // the user switches a buffer. This will ensure that notifications
// are cleared in the buffer the user switches to // are cleared in the buffer the user switches to
if($scope.hotlistsync && ab.fullName) { if($scope.hotlistsync && ab.fullName) {
/*
doSend(weeChat.Protocol.formatInput({
buffer: 'weechat',
data: '/buffer ' + ab.fullName
}));
*/
connection.sendCoreCommand('/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, "host", "localhost");
$store.bind($scope, "port", "9001"); $store.bind($scope, "port", "9001");
$store.bind($scope, "proto", "weechat"); $store.bind($scope, "proto", "weechat");
$store.bind($scope, "password", "");
$store.bind($scope, "ssl", false); $store.bind($scope, "ssl", false);
$store.bind($scope, "lines", "40"); $store.bind($scope, "lines", "40");
// TODO checkbox for saving password or not? $store.bind($scope, "savepassword", false);
// $scope.password = ""; if($scope.savepassword) {
// $store.bind($scope, "password", "");
}
// Save setting for displaying only buffers with unread messages // Save setting for displaying only buffers with unread messages
$store.bind($scope, "onlyUnread", false); $store.bind($scope, "onlyUnread", false);