From fafed6a91545ba0e445ffeec5ccd4282fd032e57 Mon Sep 17 00:00:00 2001 From: AppleDash Date: Mon, 11 May 2015 22:27:27 -0400 Subject: [PATCH] Add support for supplying credentials in the URL via the hash. --- index.html | 2 +- js/glowingbear.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 0db107f..eb9e73e 100644 --- a/index.html +++ b/index.html @@ -40,7 +40,7 @@ - +

logo diff --git a/js/glowingbear.js b/js/glowingbear.js index d3a0a94..f6e0f0f 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -752,6 +752,25 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', } }; + $scope.init = function() { + if (window.location.hash) { + var rawStr = atob(window.location.hash.substring(1)); + window.location.hash = ""; + var spl = rawStr.split(":"); + var host = spl[0]; + var port = parseInt(spl[1]); + var password = spl[2]; + var ssl = spl.length > 3; + notifications.requestNotificationPermission(); + $rootScope.sslError = false; + $rootScope.securityError = false; + $rootScope.errorMessage = false; + $rootScope.bufferBottom = true; + $scope.connectbutton = 'Connecting ...'; + connection.connect(host, port, password, ssl); + } + }; + }]); weechat.config(['$routeProvider',