Merge pull request #644 from glowing-bear/url-hash

Add support for supplying credentials in the URL via the hash.
This commit is contained in:
Tor Hveem 2015-09-17 09:10:55 +02:00
commit 9f6f70eb3e
2 changed files with 20 additions and 1 deletions

View file

@ -760,6 +760,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',