refactored window location with angular

This commit is contained in:
hamza zia 2013-03-20 10:08:50 +01:00
parent d272f1d086
commit 02a7a595a0

View File

@ -5,8 +5,8 @@ angular
])
.factory('$rpc', [
'$syscall', '$globalTimeout', '$alerts', '$utils',
'$rootScope',
function(syscall, time, alerts, utils, rootScope) {
'$rootScope', '$location',
function(syscall, time, alerts, utils, rootScope, uri) {
var subscriptions = []
, configurations = [{ host: 'localhost', port: 6800, encrypt: false }]
@ -14,12 +14,14 @@ function(syscall, time, alerts, utils, rootScope) {
, timeout = null
, forceNextUpdate = false;
if (window.location.protocol === "http:") {
if (['http', 'https'].indexOf(uri.protocol()) != -1) {
console.log(uri.host());
configurations.unshift({
host: window.location.hostname,
host: uri.host(),
port: 6800,
encrypt: false
});
console.log(configurations);
}
var cookieConf = utils.getCookie('aria2conf');