|
|
|
@ -13,7 +13,6 @@ Requires:
@@ -13,7 +13,6 @@ Requires:
|
|
|
|
|
Core.js, Window.js |
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
MochaUI.extend({ |
|
|
|
|
addUpLimitSlider: function(hash) { |
|
|
|
|
if ($('uplimitSliderarea')) { |
|
|
|
@ -30,7 +29,8 @@ MochaUI.extend({
@@ -30,7 +29,8 @@ MochaUI.extend({
|
|
|
|
|
var tmp = data.toInt(); |
|
|
|
|
if (tmp > 0) { |
|
|
|
|
maximum = tmp / 1024. |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
maximum = 1000 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -48,7 +48,8 @@ MochaUI.extend({
@@ -48,7 +48,8 @@ MochaUI.extend({
|
|
|
|
|
if (pos > 0) { |
|
|
|
|
$('uplimitUpdatevalue').set('html', pos); |
|
|
|
|
$('upLimitUnit').set('html', "_(KiB/s)"); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$('uplimitUpdatevalue').set('html', '∞'); |
|
|
|
|
$('upLimitUnit').set('html', ""); |
|
|
|
|
} |
|
|
|
@ -58,15 +59,19 @@ MochaUI.extend({
@@ -58,15 +59,19 @@ MochaUI.extend({
|
|
|
|
|
if (up_limit == 0) { |
|
|
|
|
$('uplimitUpdatevalue').set('html', '∞'); |
|
|
|
|
$('upLimitUnit').set('html', ""); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$('uplimitUpdatevalue').set('html', up_limit.round()); |
|
|
|
|
$('upLimitUnit').set('html', "_(KiB/s)"); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
var req = new Request({ |
|
|
|
|
url: 'command/getTorrentUpLimit', |
|
|
|
|
method: 'post', |
|
|
|
|
data: {hash: hash}, |
|
|
|
|
data: { |
|
|
|
|
hash: hash |
|
|
|
|
}, |
|
|
|
|
onSuccess: function(data) { |
|
|
|
|
if (data) { |
|
|
|
|
var up_limit = data.toInt(); |
|
|
|
@ -79,7 +84,8 @@ MochaUI.extend({
@@ -79,7 +84,8 @@ MochaUI.extend({
|
|
|
|
|
if (pos > 0) { |
|
|
|
|
$('uplimitUpdatevalue').set('html', pos); |
|
|
|
|
$('upLimitUnit').set('html', "_(KiB/s)"); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$('uplimitUpdatevalue').set('html', '∞'); |
|
|
|
|
$('upLimitUnit').set('html', ""); |
|
|
|
|
} |
|
|
|
@ -89,7 +95,8 @@ MochaUI.extend({
@@ -89,7 +95,8 @@ MochaUI.extend({
|
|
|
|
|
if (up_limit == 0) { |
|
|
|
|
$('uplimitUpdatevalue').set('html', '∞'); |
|
|
|
|
$('upLimitUnit').set('html', ""); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$('uplimitUpdatevalue').set('html', (up_limit / 1024.).round()); |
|
|
|
|
$('upLimitUnit').set('html', "_(KiB/s)"); |
|
|
|
|
} |
|
|
|
@ -117,7 +124,8 @@ MochaUI.extend({
@@ -117,7 +124,8 @@ MochaUI.extend({
|
|
|
|
|
var tmp = data.toInt(); |
|
|
|
|
if (tmp > 0) { |
|
|
|
|
maximum = tmp / 1024. |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
maximum = 1000 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -135,7 +143,8 @@ MochaUI.extend({
@@ -135,7 +143,8 @@ MochaUI.extend({
|
|
|
|
|
if (pos > 0) { |
|
|
|
|
$('dllimitUpdatevalue').set('html', pos); |
|
|
|
|
$('dlLimitUnit').set('html', "_(KiB/s)"); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$('dllimitUpdatevalue').set('html', '∞'); |
|
|
|
|
$('dlLimitUnit').set('html', ""); |
|
|
|
|
} |
|
|
|
@ -145,15 +154,19 @@ MochaUI.extend({
@@ -145,15 +154,19 @@ MochaUI.extend({
|
|
|
|
|
if (dl_limit == 0) { |
|
|
|
|
$('dllimitUpdatevalue').set('html', '∞'); |
|
|
|
|
$('dlLimitUnit').set('html', ""); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$('dllimitUpdatevalue').set('html', dl_limit.round()); |
|
|
|
|
$('dlLimitUnit').set('html', "_(KiB/s)"); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
var req = new Request({ |
|
|
|
|
url: 'command/getTorrentDlLimit', |
|
|
|
|
method: 'post', |
|
|
|
|
data: {hash: hash}, |
|
|
|
|
data: { |
|
|
|
|
hash: hash |
|
|
|
|
}, |
|
|
|
|
onSuccess: function(data) { |
|
|
|
|
if (data) { |
|
|
|
|
var dl_limit = data.toInt(); |
|
|
|
@ -166,7 +179,8 @@ MochaUI.extend({
@@ -166,7 +179,8 @@ MochaUI.extend({
|
|
|
|
|
if (pos > 0) { |
|
|
|
|
$('dllimitUpdatevalue').set('html', pos); |
|
|
|
|
$('dlLimitUnit').set('html', "_(KiB/s)"); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$('dllimitUpdatevalue').set('html', '∞'); |
|
|
|
|
$('dlLimitUnit').set('html', ""); |
|
|
|
|
} |
|
|
|
@ -176,7 +190,8 @@ MochaUI.extend({
@@ -176,7 +190,8 @@ MochaUI.extend({
|
|
|
|
|
if (dl_limit == 0) { |
|
|
|
|
$('dllimitUpdatevalue').set('html', '∞'); |
|
|
|
|
$('dlLimitUnit').set('html', ""); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
$('dllimitUpdatevalue').set('html', (dl_limit / 1024.).round()); |
|
|
|
|
$('dlLimitUnit').set('html', "_(KiB/s)"); |
|
|
|
|
} |
|
|
|
|