Browse Source

WebUI: Fix indentation.

Fix indentation in client.js and dynamicTable.js.
adaptive-webui-19844
Vladimir Golovnev (Glassez) 10 years ago
parent
commit
0488ddafa5
  1. 29
      src/webui/www/public/scripts/client.js
  2. 31
      src/webui/www/public/scripts/dynamicTable.js

29
src/webui/www/public/scripts/client.js

@ -67,7 +67,12 @@ window.addEvent('load', function(){
id : 'Filters', id : 'Filters',
title : 'Panel', title : 'Panel',
header : false, header : false,
padding: { top: 0, right: 0, bottom: 0, left: 0 }, padding : {
top : 0,
right : 0,
bottom : 0,
left : 0
},
loadMethod : 'xhr', loadMethod : 'xhr',
contentURL : 'filters.html', contentURL : 'filters.html',
column : 'filtersColumn', column : 'filtersColumn',
@ -107,9 +112,11 @@ window.addEvent('load', function(){
}, },
onSuccess : function (info) { onSuccess : function (info) {
if (info) { if (info) {
$("DlInfos").set('html', "_(D: %1 - T: %2)".replace("%1", friendlyUnit(info.dl_info_speed, true)) $("DlInfos").set('html', "_(D: %1 - T: %2)"
.replace("%1", friendlyUnit(info.dl_info_speed, true))
.replace("%2", friendlyUnit(info.dl_info_data, false))); .replace("%2", friendlyUnit(info.dl_info_data, false)));
$("UpInfos").set('html', "_(U: %1 - T: %2)".replace("%1", friendlyUnit(info.up_info_speed, true)) $("UpInfos").set('html', "_(U: %1 - T: %2)"
.replace("%1", friendlyUnit(info.up_info_speed, true))
.replace("%2", friendlyUnit(info.up_info_data, false))); .replace("%2", friendlyUnit(info.up_info_data, false)));
if(localStorage.getItem('speed_in_browser_title_bar') == 'true') if(localStorage.getItem('speed_in_browser_title_bar') == 'true')
document.title = "_(D:%1 U:%2)".replace("%1", friendlyUnit(info.dl_info_speed, true)).replace("%2", friendlyUnit(info.up_info_speed, true)); document.title = "_(D:%1 U:%2)".replace("%1", friendlyUnit(info.dl_info_speed, true)).replace("%2", friendlyUnit(info.up_info_speed, true));
@ -173,7 +180,7 @@ window.addEvent('load', function(){
row[8] = friendlyUnit(event.upspeed, true); row[8] = friendlyUnit(event.upspeed, true);
data[8] = event.upspeed; data[8] = event.upspeed;
row[9] = friendlyDuration(event.eta); row[9] = friendlyDuration(event.eta);
data[9] = event.eta data[9] = event.eta;
if (event.ratio == -1) if (event.ratio == -1)
row[10] = "∞"; row[10] = "∞";
else else
@ -215,7 +222,12 @@ window.addEvent('load', function(){
id : 'transferList', id : 'transferList',
title : 'Panel', title : 'Panel',
header : false, header : false,
padding: { top: 0, right: 0, bottom: 0, left: 0 }, padding : {
top : 0,
right : 0,
bottom : 0,
left : 0
},
loadMethod : 'xhr', loadMethod : 'xhr',
contentURL : 'transferlist.html', contentURL : 'transferlist.html',
onContentLoaded : function () { onContentLoaded : function () {
@ -234,7 +246,12 @@ window.addEvent('load', function(){
id : 'propertiesPanel', id : 'propertiesPanel',
title : 'Panel', title : 'Panel',
header : true, header : true,
padding: { top: 0, right: 0, bottom: 0, left: 0 }, padding : {
top : 0,
right : 0,
bottom : 0,
left : 0
},
contentURL : 'prop-general.html', contentURL : 'prop-general.html',
require : { require : {
css : ['css/Tabs.css'] css : ['css/Tabs.css']

31
src/webui/www/public/scripts/dynamicTable.js

@ -33,8 +33,7 @@
var dynamicTable = new Class({ var dynamicTable = new Class({
initialize: function(){ initialize : function () {},
},
setup : function (table, progressIndex, context_menu) { setup : function (table, progressIndex, context_menu) {
this.table = $(table); this.table = $(table);
@ -100,8 +99,7 @@ var dynamicTable = new Class ({
return ''; return '';
}, },
altRow: function() altRow : function () {
{
var trs = this.table.getElements('tr'); var trs = this.table.getElements('tr');
trs.each(function (el, i) { trs.each(function (el, i) {
if (i % 2) { if (i % 2) {
@ -113,7 +111,8 @@ var dynamicTable = new Class ({
}, },
hidePriority : function () { hidePriority : function () {
if(this.priority_hidden) return; if (this.priority_hidden)
return;
$('prioHeader').addClass('invisible'); $('prioHeader').addClass('invisible');
var trs = this.table.getElements('tr'); var trs = this.table.getElements('tr');
trs.each(function (tr, i) { trs.each(function (tr, i) {
@ -128,7 +127,8 @@ var dynamicTable = new Class ({
}, },
showPriority : function () { showPriority : function () {
if(!this.priority_hidden) return; if (!this.priority_hidden)
return;
$('prioHeader').removeClass('invisible'); $('prioHeader').removeClass('invisible');
var trs = this.table.getElements('tr'); var trs = this.table.getElements('tr');
trs.each(function (tr, i) { trs.each(function (tr, i) {
@ -188,16 +188,21 @@ var dynamicTable = new Class ({
var tr = new Element('tr'); var tr = new Element('tr');
tr.addClass("menu-target"); tr.addClass("menu-target");
this.rows.set(id, tr); this.rows.set(id, tr);
for(var i=0; i<row.length; i++) for (var i = 0; i < row.length; i++) {
{
var td = new Element('td'); var td = new Element('td');
if (i == this.progressIndex) { if (i == this.progressIndex) {
td.adopt(new ProgressBar(row[i].toFloat(), {'id': 'pb_'+id, 'width':80})); td.adopt(new ProgressBar(row[i].toFloat(), {
'id' : 'pb_' + id,
'width' : 80
}));
if (typeof data[i] != 'undefined') if (typeof data[i] != 'undefined')
td.set('data-raw', data[i]) td.set('data-raw', data[i])
} else { } else {
if (i == 0) { if (i == 0) {
td.adopt(new Element('img', {'src':row[i], 'class': 'statusIcon'})); td.adopt(new Element('img', {
'src' : row[i],
'class' : 'statusIcon'
}));
} else { } else {
if (i == 2) { if (i == 2) {
// Priority // Priority
@ -335,7 +340,8 @@ var dynamicTable = new Class ({
if (this.applyFilterOnRow(tr, status)) { if (this.applyFilterOnRow(tr, status)) {
var tds = tr.getElements('td'); var tds = tr.getElements('td');
for (var i = 0; i < row.length; i++) { for (var i = 0; i < row.length; i++) {
if(i==1) continue; // Do not refresh name if (i == 1)
continue; // Do not refresh name
if (i == this.progressIndex) { if (i == this.progressIndex) {
$('pb_' + id).setValue(row[i]); $('pb_' + id).setValue(row[i]);
} else { } else {
@ -362,8 +368,7 @@ var dynamicTable = new Class ({
}, },
removeRow : function (id) { removeRow : function (id) {
if(this.cur.contains(id)) if (this.cur.contains(id)) {
{
this.cur.erase(id); this.cur.erase(id);
} }
if (this.rows.has(id)) { if (this.rows.has(id)) {

Loading…
Cancel
Save