fixed rpc and modal issues

This commit is contained in:
hamza zia 2013-01-15 16:19:26 +05:00
parent 571eaf8257
commit 50218debae
6 changed files with 241 additions and 219 deletions

View File

@ -12,7 +12,9 @@
<link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/font-awesome.css"> <link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/download.css">
<!-- external javascript dependencies --> <!-- external javascript dependencies -->

82
css/download.css Normal file
View File

@ -0,0 +1,82 @@
.download-name {
font-size: 12px;
}
.active-download {
width: 100%;
margin-bottom: 10px;
background-color: rgb(245, 245, 245);
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 4px 4px 4px 4px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
}
.waiting-download {
width: 100%;
margin-bottom: 10px;
background-color: rgb(245, 245, 245);
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 4px 4px 4px 4px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
}
.stopped-download {
width: 100%;
margin-bottom: 10px;
background-color: rgb(245, 245, 245);
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 4px 4px 4px 4px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
}
.stats {
margin-left: auto;
margin-right: auto;
text-align: center;
}
.stats li {
padding: 5px;
}
.download-controls {
width: 60px;
}
.download-controls .btn-group {
height: 70px;
width: 100%;
float: right;
}
.download-controls .btn-group .btn:nth-child(1) {
width: 70%;
}
.download-controls .btn-group .btn:nth-child(2) {
width: 30%;
}
.download-controls .btn-group .btn {
height: 100%;
}
.download-controls .btn-group .btn i {
height: 100%;
font-size: 28px;
color: gray;
}
.download-overview {
padding: 10px;
cursor: pointer;
}
.download-detail {
cursor: pointer;
}
.download-detail .stats li {
width: 150px;
margin-bottom: 5px;
}
.download-detail h4 {
margin-left: 10px;
}
.download-files {
width: 90%;
margin-left: auto;
margin-right: auto;
}
.download-files li {
padding: 5px;
margin: 5px;
}

View File

@ -1,84 +1,6 @@
.download-name { /* fix modal overflow on low resolutions */
font-size: 12px; .modal {
} position: absolute;
.active-download {
width: 100%;
margin-bottom: 10px;
background-color: rgb(245, 245, 245);
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 4px 4px 4px 4px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
}
.waiting-download {
width: 100%;
margin-bottom: 10px;
background-color: rgb(245, 245, 245);
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 4px 4px 4px 4px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
}
.stopped-download {
width: 100%;
margin-bottom: 10px;
background-color: rgb(245, 245, 245);
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 4px 4px 4px 4px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
}
.stats {
margin-left: auto;
margin-right: auto;
text-align: center;
}
.stats li {
padding: 5px;
}
.download-controls {
width: 60px;
}
.download-controls .btn-group {
height: 70px;
width: 100%;
float: right;
}
.download-controls .btn-group .btn:nth-child(1) {
width: 70%;
}
.download-controls .btn-group .btn:nth-child(2) {
width: 30%;
}
.download-controls .btn-group .btn {
height: 100%;
}
.download-controls .btn-group .btn i {
height: 100%;
font-size: 28px;
color: gray;
}
.download-overview {
padding: 10px;
cursor: pointer;
}
.download-detail {
cursor: pointer;
}
.download-detail .stats li {
width: 150px;
margin-bottom: 5px;
}
.download-detail h4 {
margin-left: 10px;
}
.download-files {
width: 90%;
margin-left: auto;
margin-right: auto;
}
.download-files li {
padding: 5px;
margin: 5px;
} }
@media all and (min-width: 980px) { @media all and (min-width: 980px) {
body { body {

View File

@ -12,7 +12,9 @@
<link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/font-awesome.css"> <link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/download.css">
<!-- external javascript dependencies --> <!-- external javascript dependencies -->

View File

@ -79,10 +79,15 @@ var SocketRPC = function(conf) {
return new SocketRPC(); return new SocketRPC();
var rpc = this; var rpc = this;
rpc.serverConf = conf;
rpc.initialized = false; rpc.initialized = false;
rpc.serverConf = conf;
rpc.handles = []; rpc.handles = [];
var scheme = rpc.serverConf.encryption ? 'wss' : 'ws'; var scheme = rpc.serverConf.encryption ? 'wss' : 'ws';
if (typeof WebSocket == "undefined")
return;
try {
rpc.sock = new WebSocket(scheme + '://' + conf.host + ':' + conf.port + '/jsonrpc'); rpc.sock = new WebSocket(scheme + '://' + conf.host + ':' + conf.port + '/jsonrpc');
rpc.sock.onopen = function() { rpc.sock.onopen = function() {
rpc.initialized = true; rpc.initialized = true;
@ -105,6 +110,10 @@ var SocketRPC = function(conf) {
} }
}; };
} }
catch(ex) {
rpc.initialized = false;
}
}
SocketRPC.prototype = { SocketRPC.prototype = {
invoke: function(opts) { invoke: function(opts) {
var data = { var data = {

View File

@ -78,10 +78,15 @@ app.factory('$sockcall', ['$_', '$json', '$name', '$utils', function(_, JSON, na
this.onerror(); this.onerror();
} }
try {
this.sock = new WebSocket(this.scheme + '://' + conf.host + ':' + conf.port + '/jsonrpc'); this.sock = new WebSocket(this.scheme + '://' + conf.host + ':' + conf.port + '/jsonrpc');
this.sock.onopen = this.onopen; this.sock.onopen = this.onopen;
this.sock.onclose = this.sock.onerror = this.onerror; this.sock.onclose = this.sock.onerror = this.onerror;
this.sock.onmessage = this.onmessage; this.sock.onmessage = this.onmessage;
}
catch (ex) {
// ignoring IE securty exception on local ip addresses
}
}, },
}; };
}]); }]);