diff --git a/index.html b/index.html index e26fd18..20897d2 100644 --- a/index.html +++ b/index.html @@ -30,8 +30,8 @@ - -
+ +

logo glowing bear @@ -178,7 +178,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel

-
+
diff --git a/js/glowingbear.js b/js/glowingbear.js index 13b63b3..2a37cf2 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -84,6 +84,7 @@ weechat.factory('handlers', ['$rootScope', 'models', 'plugins', function($rootSc }; var handleBufferOpened = function(message) { + console.log(message); var bufferMessage = message.objects[0].content[0]; var buffer = new models.Buffer(bufferMessage); models.addBuffer(buffer); @@ -446,6 +447,39 @@ function($rootScope, }; }]); +weechat.controller('indexCtrl', + ['$rootScope', + '$scope', + '$store', + 'connection', + + function($rootScope, + $scope, + $store, + connection) { + + $store.bind($scope, "host", "localhost"); + $store.bind($scope, "port", "9001"); + $store.bind($scope, "proto", "weechat"); + $store.bind($scope, "ssl", false); + $store.bind($scope, "savepassword", false); + + if ($scope.savepassword) { + $store.bind($scope, "password", ""); + } + + $scope.connect = function() { + connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl); + }; + + $scope.disconnect = function() { + connection.disconnect(); + }; + + } + ]); + + weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', '$log', 'models', 'connection', function ($rootScope, $scope, $store, $timeout, $log, models, connection) { if (window.Notification) { // Request notification permission @@ -558,15 +592,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $rootScope.iterCandidate = null; - $store.bind($scope, "host", "localhost"); - $store.bind($scope, "port", "9001"); - $store.bind($scope, "proto", "weechat"); - $store.bind($scope, "ssl", false); - $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); // Save setting for not showing timestamp @@ -663,12 +688,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', }; - $scope.connect = function() { - connection.connect($scope.host, $scope.port, $scope.password, $scope.ssl); - }; - $scope.disconnect = function() { - connection.disconnect(); - }; + $scope.install = function() { if (navigator.mozApps !== undefined) { var request = navigator.mozApps.install('http://torhve.github.io/glowing-bear/manifest.webapp');