codepaint plugins js files

This commit is contained in:
Calum Lind 2014-08-04 23:31:13 +01:00
parent 3e610ec5ba
commit 21f18a75bb
5 changed files with 319 additions and 379 deletions

View File

@ -1,7 +1,7 @@
/*!
* blocklist.js
*
* Copyright (c) Omar Alvarez 2014 <omar.alvarez@udc.es>
* Copyright (C) Omar Alvarez 2014 <omar.alvarez@udc.es>
*
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
* the additional special exception to link portions of this program with the OpenSSL library.

View File

@ -1,36 +1,17 @@
/*
Script: execute.js
The client-side javascript code for the Execute plugin.
/*!
* execute.js
* The client-side javascript code for the Execute plugin.
*
* Copyright (C) Damien Churchill 2010 <damoxc@gmail.com>
*
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
* the additional special exception to link portions of this program with the OpenSSL library.
* See LICENSE for more details.
*
*/
Copyright:
(C) Damien Churchill 2009-2010 <damoxc@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, write to:
The Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA.
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the OpenSSL
library.
You must obey the GNU General Public License in all respects for all of
the code used other than OpenSSL. If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so, delete
this exception statement from your version. If you delete this exception
statement from all source files in the program, then also delete it here.
*/
Ext.ns('Deluge.ux');
Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
layout: 'fit',
@ -47,29 +28,29 @@ Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
baseCls: 'x-plain',
bodyStyle: 'padding: 5px',
items: [{
xtype: 'combo',
width: 270,
fieldLabel: _('Event'),
store: new Ext.data.ArrayStore({
fields: ['id', 'text'],
data: [
['complete', _('Torrent Complete')],
['added', _('Torrent Added')],
['removed', _('Torrent Removed')]
]
}),
name: 'event',
mode: 'local',
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
}, {
xtype: 'textfield',
fieldLabel: _('Command'),
name: 'command',
width: 270
}]
xtype: 'combo',
width: 270,
fieldLabel: _('Event'),
store: new Ext.data.ArrayStore({
fields: ['id', 'text'],
data: [
['complete', _('Torrent Complete')],
['added', _('Torrent Added')],
['removed', _('Torrent Removed')]
]
}),
name: 'event',
mode: 'local',
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
}, {
xtype: 'textfield',
fieldLabel: _('Command'),
name: 'command',
width: 270
}]
});
},
@ -152,35 +133,35 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
initComponent: function() {
Deluge.ux.preferences.ExecutePage.superclass.initComponent.call(this);
var event_map = this.event_map = {
'complete': _('Torrent Complete'),
'added': _('Torrent Added'),
'removed': _('Torrent Removed')
}
'complete': _('Torrent Complete'),
'added': _('Torrent Added'),
'removed': _('Torrent Removed')
}
this.list = new Ext.list.ListView({
store: new Ext.data.SimpleStore({
fields: [
{name: 'event', mapping: 1},
{name: 'name', mapping: 2}
],
],
id: 0
}),
columns: [{
width: .3,
header: _('Event'),
sortable: true,
dataIndex: 'event',
tpl: new Ext.XTemplate('{[this.getEvent(values.event)]}', {
getEvent: function(e) {
return (event_map[e]) ? event_map[e] : e;
}
})
}, {
id: 'name',
header: _('Command'),
sortable: true,
dataIndex: 'name'
}],
width: .3,
header: _('Event'),
sortable: true,
dataIndex: 'event',
tpl: new Ext.XTemplate('{[this.getEvent(values.event)]}', {
getEvent: function(e) {
return (event_map[e]) ? event_map[e] : e;
}
})
}, {
id: 'name',
header: _('Command'),
sortable: true,
dataIndex: 'name'
}],
singleSelect: true,
autoExpandColumn: 'name'
});
@ -190,23 +171,23 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
items: [this.list],
bbar: {
items: [{
text: _('Add'),
iconCls: 'icon-add',
handler: this.onAddClick,
scope: this
}, {
text: _('Edit'),
iconCls: 'icon-edit',
handler: this.onEditClick,
scope: this,
disabled: true
}, '->', {
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onRemoveClick,
scope: this,
disabled: true
}]
text: _('Add'),
iconCls: 'icon-add',
handler: this.onAddClick,
scope: this
}, {
text: _('Edit'),
iconCls: 'icon-edit',
handler: this.onEditClick,
scope: this,
disabled: true
}, '->', {
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onRemoveClick,
scope: this,
disabled: true
}]
}
});

View File

@ -1,7 +1,7 @@
/*!
* extractor.js
*
* Copyright (c) Damien Churchill 2010 <damoxc@gmail.com>
* Copyright (C) Calum Lind 2014 <calumlind@gmail.com>
*
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
* the additional special exception to link portions of this program with the OpenSSL library.
@ -43,7 +43,7 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
this.extract_path = fieldset.add({
fieldLabel: _('Extract to:'),
labelSeparator : '',
labelSeparator: '',
name: 'extract_path',
width: '97%'
});
@ -62,7 +62,7 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
onApply: function() {
// build settings object
var config = { }
var config = {}
config['extract_path'] = this.extract_path.getValue();
config['use_name_folder'] = this.use_name_folder.getValue();

View File

@ -1,34 +1,14 @@
/*!
* label.js
*
* Copyright (c) Damien Churchill 2010 <damoxc@gmail.com>
* Copyright (C) Damien Churchill 2010 <damoxc@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
* the additional special exception to link portions of this program with the OpenSSL library.
* See LICENSE for more details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, write to:
* The Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301, USA.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the OpenSSL
* library.
* You must obey the GNU General Public License in all respects for all of
* the code used other than OpenSSL. If you modify file(s) with this
* exception, you may extend this exception to your version of the file(s),
* but you are not obligated to do so. If you do not wish to do so, delete
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
Ext.ns('Deluge.ux');
/**
@ -54,19 +34,19 @@ Deluge.ux.AddLabelWindow = Ext.extend(Ext.Window, {
defaultType: 'textfield',
labelWidth: 50,
items: [{
fieldLabel: _('Name'),
name: 'name',
allowBlank: false,
width: 220,
listeners: {
'specialkey': {
fn: function(field, e) {
if (e.getKey() == 13) this.onOkClick();
},
scope: this
fieldLabel: _('Name'),
name: 'name',
allowBlank: false,
width: 220,
listeners: {
'specialkey': {
fn: function(field, e) {
if (e.getKey() == 13) this.onOkClick();
},
scope: this
}
}
}
}]
}]
});
},
@ -122,186 +102,186 @@ Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
height: 175,
border: false,
items: [{
title: _('Maximum'),
items: [{
border: false,
title: _('Maximum'),
items: [{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
xtype: 'checkbox',
name: 'apply_max',
fieldLabel: '',
boxLabel: _('Apply per torrent max settings:'),
listeners: {
check: this.onFieldChecked
}
border: false,
items: [{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
xtype: 'checkbox',
name: 'apply_max',
fieldLabel: '',
boxLabel: _('Apply per torrent max settings:'),
listeners: {
check: this.onFieldChecked
}
}]
}, {
xtype: 'fieldset',
border: false,
defaultType: 'spinnerfield',
style: 'margin-top: 0px; padding-top: 0px;',
items: [{
fieldLabel: _('Download Speed'),
name: 'max_download_speed',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
fieldLabel: _('Upload Speed'),
name: 'max_upload_speed',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
fieldLabel: _('Upload Slots'),
name: 'max_upload_slots',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
fieldLabel: _('Connections'),
name: 'max_connections',
width: 80,
disabled: true,
value: -1,
minValue: -1
}]
}]
}]
}, {
xtype: 'fieldset',
border: false,
defaultType: 'spinnerfield',
style: 'margin-top: 0px; padding-top: 0px;',
items: [{
fieldLabel: _('Download Speed'),
name: 'max_download_speed',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
fieldLabel: _('Upload Speed'),
name: 'max_upload_speed',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
fieldLabel: _('Upload Slots'),
name: 'max_upload_slots',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
fieldLabel: _('Connections'),
name: 'max_connections',
width: 80,
disabled: true,
value: -1,
minValue: -1
}]
}]
}]
}, {
title: _('Queue'),
items: [{
border: false,
}, {
title: _('Queue'),
items: [{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
xtype: 'checkbox',
name: 'apply_queue',
fieldLabel: '',
boxLabel: _('Apply queue settings:'),
listeners: {
check: this.onFieldChecked
}
border: false,
items: [{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
xtype: 'checkbox',
name: 'apply_queue',
fieldLabel: '',
boxLabel: _('Apply queue settings:'),
listeners: {
check: this.onFieldChecked
}
}]
}, {
xtype: 'fieldset',
border: false,
labelWidth: 1,
defaultType: 'checkbox',
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
},
items: [{
boxLabel: _('Auto Managed'),
name: 'is_auto_managed',
disabled: true
}, {
boxLabel: _('Stop seed at ratio:'),
name: 'stop_at_ratio',
disabled: true
}, {
xtype: 'spinnerfield',
name: 'stop_ratio',
width: 60,
decimalPrecision: 2,
incrementValue: 0.1,
style: 'position: relative; left: 100px',
disabled: true
}, {
boxLabel: _('Remove at ratio'),
name: 'remove_at_ratio',
disabled: true
}]
}]
}]
}, {
xtype: 'fieldset',
border: false,
labelWidth: 1,
defaultType: 'checkbox',
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
},
items: [{
boxLabel: _('Auto Managed'),
name: 'is_auto_managed',
disabled: true
}, {
boxLabel: _('Stop seed at ratio:'),
name: 'stop_at_ratio',
disabled: true
}, {
xtype: 'spinnerfield',
name: 'stop_ratio',
width: 60,
decimalPrecision: 2,
incrementValue: 0.1,
style: 'position: relative; left: 100px',
disabled: true
}, {
boxLabel: _('Remove at ratio'),
name: 'remove_at_ratio',
disabled: true
}]
}]
}]
}, {
title: _('Location'),
items: [{
border: false,
}, {
title: _('Location'),
items: [{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
xtype: 'checkbox',
name: 'apply_move_completed',
fieldLabel: '',
boxLabel: _('Apply location settings:'),
listeners: {
check: this.onFieldChecked
}
border: false,
items: [{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
xtype: 'checkbox',
name: 'apply_move_completed',
fieldLabel: '',
boxLabel: _('Apply location settings:'),
listeners: {
check: this.onFieldChecked
}
}]
}, {
xtype: 'fieldset',
border: false,
labelWidth: 1,
defaultType: 'checkbox',
labelWidth: 1,
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
},
items: [{
boxLabel: _('Move completed to:'),
name: 'move_completed',
disabled: true
}, {
xtype: 'textfield',
name: 'move_completed_path',
width: 250,
disabled: true
}]
}]
}]
}, {
xtype: 'fieldset',
border: false,
labelWidth: 1,
defaultType: 'checkbox',
labelWidth: 1,
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
},
items: [{
boxLabel: _('Move completed to:'),
name: 'move_completed',
disabled: true
}, {
xtype: 'textfield',
name: 'move_completed_path',
width: 250,
disabled: true
}]
}]
}]
}, {
title: _('Trackers'),
items: [{
border: false,
}, {
title: _('Trackers'),
items: [{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
xtype: 'checkbox',
name: 'auto_add',
fieldLabel: '',
boxLabel: _('Automatically apply label:'),
listeners: {
check: this.onFieldChecked
}
border: false,
items: [{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
xtype: 'checkbox',
name: 'auto_add',
fieldLabel: '',
boxLabel: _('Automatically apply label:'),
listeners: {
check: this.onFieldChecked
}
}]
}, {
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
},
defaultType: 'textarea',
items: [{
boxLabel: _('Move completed to:'),
name: 'auto_add_trackers',
width: 250,
height: 100,
disabled: true
}]
}]
}]
}, {
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
},
defaultType: 'textarea',
items: [{
boxLabel: _('Move completed to:'),
name: 'auto_add_trackers',
width: 250,
height: 100,
disabled: true
}]
}]
}]
}]
});
},
@ -360,22 +340,22 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
createMenu: function() {
this.labelMenu = new Ext.menu.Menu({
items: [{
text: _('Add Label'),
iconCls: 'icon-add',
handler: this.onLabelAddClick,
scope: this
}, {
text: _('Remove Label'),
disabled: true,
iconCls: 'icon-remove',
handler: this.onLabelRemoveClick,
scope: this
}, {
text: _('Label Options'),
disabled: true,
handler: this.onLabelOptionsClick,
scope: this
}]
text: _('Add Label'),
iconCls: 'icon-add',
handler: this.onLabelAddClick,
scope: this
}, {
text: _('Remove Label'),
disabled: true,
iconCls: 'icon-remove',
handler: this.onLabelRemoveClick,
scope: this
}, {
text: _('Label Options'),
disabled: true,
handler: this.onLabelOptionsClick,
scope: this
}]
});
},
@ -396,7 +376,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
scope: this
});
for (var state in states) {
if (!state || state == 'All' ) continue;
if (!state || state == 'All') continue;
this.torrentMenu.addMenuItem({
text: state,
label: state,
@ -428,10 +408,10 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
});
var lbltpl = '<div class="x-deluge-filter">' +
'<tpl if="filter">{filter}</tpl>' +
'<tpl if="!filter">No Label</tpl>' +
' ({count})' +
'</div>';
'<tpl if="filter">{filter}</tpl>' +
'<tpl if="!filter">No Label</tpl>' +
' ({count})' +
'</div>';
if (deluge.sidebar.hasFilter('label')) {
var filter = deluge.sidebar.getFilter('label');
@ -494,7 +474,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
e.preventDefault();
if (!this.labelMenu) this.createMenu();
var r = dv.getRecord(node).get('filter');
if ( !r || r == 'All') {
if (!r || r == 'All') {
this.labelMenu.items.get(1).setDisabled(true);
this.labelMenu.items.get(2).setDisabled(true);
} else {
@ -536,7 +516,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
onTorrentMenuClick: function(item, e) {
var ids = deluge.torrents.getSelectedIds();
Ext.each(ids, function(id, i) {
if (ids.length == i +1 ) {
if (ids.length == i + 1) {
deluge.client.label.set_torrent(id, item.label, {
success: function() {
deluge.ui.update();

View File

@ -1,35 +1,14 @@
/*
Script: scheduler.js
The client-side javascript code for the Scheduler plugin.
Copyright:
(C) samuel337 2011
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, write to:
The Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA.
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the OpenSSL
library.
You must obey the GNU General Public License in all respects for all of
the code used other than OpenSSL. If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so, delete
this exception statement from your version. If you delete this exception
statement from all source files in the program, then also delete it here.
*/
/*!
* scheduler.js
* The client-side javascript code for the Scheduler plugin.
*
* Copyright (C) samuel337 2011
*
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
* the additional special exception to link portions of this program with the OpenSSL library.
* See LICENSE for more details.
*
*/
Ext.ns('Deluge.ux');
@ -59,7 +38,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
borderColor: 'FireBrick',
value: 2
}
],
],
daysOfWeek: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
initComponent: function() {
@ -110,7 +89,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
}
el2.style[floatAttr] = 'right';
for (var i=0; i < this.states.length; i++) {
for (var i = 0; i < this.states.length; i++) {
var el3 = createEl(el2, 'input');
el3.type = 'radio';
el3.value = this.states[i].value;
@ -143,10 +122,10 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
table.cellSpacing = 0;
// cache access to cells for easier access later
this.scheduleCells = { };
this.scheduleCells = {};
Ext.each(this.daysOfWeek, function(day) {
var cells = [ ];
var cells = [];
var row = createEl(table, 'tr');
var label = createEl(row, 'th');
label.setAttribute('style', 'font-weight: bold; padding-right: 5px;');
@ -248,7 +227,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
if (!this.dragAnchor)
leftTooltipCell = cell;
else if ((this.dragAnchor && this.isCellLeftTooltipHidden()) ||
(this.dragAnchor && this.dragAnchor.hour > cell.hour))
(this.dragAnchor && this.dragAnchor.hour > cell.hour))
leftTooltipCell = this.dragAnchor;
if (leftTooltipCell) {
@ -260,8 +239,8 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
pm = true;
if (hour > 12) hour -= 12;
}
// change 0 hour to 12am
else if (hour == 0) {
// change 0 hour to 12am
hour = 12;
}
this.showCellLeftTooltip(hour + ' ' + (pm ? 'pm' : 'am'), leftTooltipCell);
@ -287,8 +266,8 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
pm = true;
if (hour > 12) hour -= 12;
}
// change 0 hour to 12am
else if (hour == 0) {
// change 0 hour to 12am
hour = 12;
}
this.showCellRightTooltip(hour + ' ' + (pm ? 'pm' : 'am'), rightTooltipCell);
@ -308,19 +287,19 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
}
else if (cell.hour > this.dragAnchor.hour) {
// dragging right
this.revertCells(cell.day, cell.hour+1, 23);
this.revertCells(cell.day, cell.hour + 1, 23);
this.previewCells(cell.day, this.dragAnchor.hour, cell.hour);
}
else if (cell.hour < this.dragAnchor.hour) {
// dragging left
this.revertCells(cell.day, 0, cell.hour-1);
this.revertCells(cell.day, 0, cell.hour - 1);
this.previewCells(cell.day, cell.hour, this.dragAnchor.hour);
}
else {
// back to anchor cell
// don't know if it is from right or left, so revert all except this
this.revertCells(cell.day, cell.hour+1, 23);
this.revertCells(cell.day, 0, cell.hour-1);
this.revertCells(cell.day, cell.hour + 1, 23);
this.revertCells(cell.day, 0, cell.hour - 1);
}
}
else {
@ -346,7 +325,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
if (toHour > cells.length) toHour = cells.length;
for (var i=fromHour; i <= toHour; i++) {
for (var i = fromHour; i <= toHour; i++) {
if (cells[i].currentValue != curBrushValue) {
cells[i].oldValue = cells[i].currentValue;
cells[i].currentValue = curBrushValue;
@ -360,7 +339,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
if (toHour > cells.length) toHour = cells.length;
for (var i=fromHour; i <= toHour; i++) {
for (var i = fromHour; i <= toHour; i++) {
cells[i].currentValue = cells[i].oldValue;
this.updateCell(cells[i]);
}
@ -371,7 +350,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
if (toHour > cells.length) toHour = cells.length;
for (var i=fromHour; i <= toHour; i++) {
for (var i = fromHour; i <= toHour; i++) {
if (cells[i].currentValue != cells[i].oldValue) {
cells[i].oldValue = cells[i].currentValue;
}
@ -463,12 +442,12 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
},
getConfig: function() {
var config = [ ];
var config = [];
for (var i=0; i < 24; i++) {
var hourConfig = [ 0, 0, 0, 0, 0, 0, 0 ];
for (var i = 0; i < 24; i++) {
var hourConfig = [0, 0, 0, 0, 0, 0, 0];
for (var j=0; j < this.daysOfWeek.length; j++) {
for (var j = 0; j < this.daysOfWeek.length; j++) {
hourConfig[j] = parseInt(this.scheduleCells[this.daysOfWeek[j]][i].currentValue);
}
@ -479,10 +458,10 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
},
setConfig: function(config) {
for (var i=0; i < 24; i++) {
for (var i = 0; i < 24; i++) {
var hourConfig = config[i];
for (var j=0; j < this.daysOfWeek.length; j++) {
for (var j = 0; j < this.daysOfWeek.length; j++) {
if (this.scheduleCells == undefined) {
var cell = hourConfig[j];
} else {
@ -577,7 +556,7 @@ Deluge.ux.preferences.SchedulerPage = Ext.extend(Ext.Panel, {
onApply: function() {
// build settings object
var config = { }
var config = {}
config['button_state'] = this.schedule.getConfig();
config['low_down'] = this.downloadLimit.getValue();