mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-20 17:18:44 +00:00
codepaint plugins js files
This commit is contained in:
parent
3e610ec5ba
commit
21f18a75bb
5 changed files with 319 additions and 379 deletions
|
@ -1,7 +1,7 @@
|
||||||
/*!
|
/*!
|
||||||
* blocklist.js
|
* 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
|
* 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.
|
* the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
|
|
@ -1,36 +1,17 @@
|
||||||
/*
|
/*!
|
||||||
Script: execute.js
|
* execute.js
|
||||||
The client-side javascript code for the Execute plugin.
|
* 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');
|
Ext.ns('Deluge.ux');
|
||||||
|
|
||||||
Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
|
Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
|
||||||
|
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
|
@ -47,29 +28,29 @@ Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
|
||||||
baseCls: 'x-plain',
|
baseCls: 'x-plain',
|
||||||
bodyStyle: 'padding: 5px',
|
bodyStyle: 'padding: 5px',
|
||||||
items: [{
|
items: [{
|
||||||
xtype: 'combo',
|
xtype: 'combo',
|
||||||
width: 270,
|
width: 270,
|
||||||
fieldLabel: _('Event'),
|
fieldLabel: _('Event'),
|
||||||
store: new Ext.data.ArrayStore({
|
store: new Ext.data.ArrayStore({
|
||||||
fields: ['id', 'text'],
|
fields: ['id', 'text'],
|
||||||
data: [
|
data: [
|
||||||
['complete', _('Torrent Complete')],
|
['complete', _('Torrent Complete')],
|
||||||
['added', _('Torrent Added')],
|
['added', _('Torrent Added')],
|
||||||
['removed', _('Torrent Removed')]
|
['removed', _('Torrent Removed')]
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
name: 'event',
|
name: 'event',
|
||||||
mode: 'local',
|
mode: 'local',
|
||||||
editable: false,
|
editable: false,
|
||||||
triggerAction: 'all',
|
triggerAction: 'all',
|
||||||
valueField: 'id',
|
valueField: 'id',
|
||||||
displayField: 'text'
|
displayField: 'text'
|
||||||
}, {
|
}, {
|
||||||
xtype: 'textfield',
|
xtype: 'textfield',
|
||||||
fieldLabel: _('Command'),
|
fieldLabel: _('Command'),
|
||||||
name: 'command',
|
name: 'command',
|
||||||
width: 270
|
width: 270
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -152,35 +133,35 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
Deluge.ux.preferences.ExecutePage.superclass.initComponent.call(this);
|
Deluge.ux.preferences.ExecutePage.superclass.initComponent.call(this);
|
||||||
var event_map = this.event_map = {
|
var event_map = this.event_map = {
|
||||||
'complete': _('Torrent Complete'),
|
'complete': _('Torrent Complete'),
|
||||||
'added': _('Torrent Added'),
|
'added': _('Torrent Added'),
|
||||||
'removed': _('Torrent Removed')
|
'removed': _('Torrent Removed')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.list = new Ext.list.ListView({
|
this.list = new Ext.list.ListView({
|
||||||
store: new Ext.data.SimpleStore({
|
store: new Ext.data.SimpleStore({
|
||||||
fields: [
|
fields: [
|
||||||
{name: 'event', mapping: 1},
|
{name: 'event', mapping: 1},
|
||||||
{name: 'name', mapping: 2}
|
{name: 'name', mapping: 2}
|
||||||
],
|
],
|
||||||
id: 0
|
id: 0
|
||||||
}),
|
}),
|
||||||
columns: [{
|
columns: [{
|
||||||
width: .3,
|
width: .3,
|
||||||
header: _('Event'),
|
header: _('Event'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
dataIndex: 'event',
|
dataIndex: 'event',
|
||||||
tpl: new Ext.XTemplate('{[this.getEvent(values.event)]}', {
|
tpl: new Ext.XTemplate('{[this.getEvent(values.event)]}', {
|
||||||
getEvent: function(e) {
|
getEvent: function(e) {
|
||||||
return (event_map[e]) ? event_map[e] : e;
|
return (event_map[e]) ? event_map[e] : e;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, {
|
}, {
|
||||||
id: 'name',
|
id: 'name',
|
||||||
header: _('Command'),
|
header: _('Command'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
dataIndex: 'name'
|
dataIndex: 'name'
|
||||||
}],
|
}],
|
||||||
singleSelect: true,
|
singleSelect: true,
|
||||||
autoExpandColumn: 'name'
|
autoExpandColumn: 'name'
|
||||||
});
|
});
|
||||||
|
@ -190,23 +171,23 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
||||||
items: [this.list],
|
items: [this.list],
|
||||||
bbar: {
|
bbar: {
|
||||||
items: [{
|
items: [{
|
||||||
text: _('Add'),
|
text: _('Add'),
|
||||||
iconCls: 'icon-add',
|
iconCls: 'icon-add',
|
||||||
handler: this.onAddClick,
|
handler: this.onAddClick,
|
||||||
scope: this
|
scope: this
|
||||||
}, {
|
}, {
|
||||||
text: _('Edit'),
|
text: _('Edit'),
|
||||||
iconCls: 'icon-edit',
|
iconCls: 'icon-edit',
|
||||||
handler: this.onEditClick,
|
handler: this.onEditClick,
|
||||||
scope: this,
|
scope: this,
|
||||||
disabled: true
|
disabled: true
|
||||||
}, '->', {
|
}, '->', {
|
||||||
text: _('Remove'),
|
text: _('Remove'),
|
||||||
iconCls: 'icon-remove',
|
iconCls: 'icon-remove',
|
||||||
handler: this.onRemoveClick,
|
handler: this.onRemoveClick,
|
||||||
scope: this,
|
scope: this,
|
||||||
disabled: true
|
disabled: true
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*!
|
/*!
|
||||||
* extractor.js
|
* 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
|
* 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.
|
* 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({
|
this.extract_path = fieldset.add({
|
||||||
fieldLabel: _('Extract to:'),
|
fieldLabel: _('Extract to:'),
|
||||||
labelSeparator : '',
|
labelSeparator: '',
|
||||||
name: 'extract_path',
|
name: 'extract_path',
|
||||||
width: '97%'
|
width: '97%'
|
||||||
});
|
});
|
||||||
|
@ -62,7 +62,7 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
|
||||||
|
|
||||||
onApply: function() {
|
onApply: function() {
|
||||||
// build settings object
|
// build settings object
|
||||||
var config = { }
|
var config = {}
|
||||||
|
|
||||||
config['extract_path'] = this.extract_path.getValue();
|
config['extract_path'] = this.extract_path.getValue();
|
||||||
config['use_name_folder'] = this.use_name_folder.getValue();
|
config['use_name_folder'] = this.use_name_folder.getValue();
|
||||||
|
|
|
@ -1,34 +1,14 @@
|
||||||
/*!
|
/*!
|
||||||
* label.js
|
* 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
|
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||||
* it under the terms of the GNU General Public License as published by
|
* the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
* the Free Software Foundation; either version 3, or (at your option)
|
* See LICENSE for more details.
|
||||||
* 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');
|
Ext.ns('Deluge.ux');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,19 +34,19 @@ Deluge.ux.AddLabelWindow = Ext.extend(Ext.Window, {
|
||||||
defaultType: 'textfield',
|
defaultType: 'textfield',
|
||||||
labelWidth: 50,
|
labelWidth: 50,
|
||||||
items: [{
|
items: [{
|
||||||
fieldLabel: _('Name'),
|
fieldLabel: _('Name'),
|
||||||
name: 'name',
|
name: 'name',
|
||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
width: 220,
|
width: 220,
|
||||||
listeners: {
|
listeners: {
|
||||||
'specialkey': {
|
'specialkey': {
|
||||||
fn: function(field, e) {
|
fn: function(field, e) {
|
||||||
if (e.getKey() == 13) this.onOkClick();
|
if (e.getKey() == 13) this.onOkClick();
|
||||||
},
|
},
|
||||||
scope: this
|
scope: this
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
}]
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -122,186 +102,186 @@ Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
|
||||||
height: 175,
|
height: 175,
|
||||||
border: false,
|
border: false,
|
||||||
items: [{
|
items: [{
|
||||||
title: _('Maximum'),
|
title: _('Maximum'),
|
||||||
items: [{
|
|
||||||
border: false,
|
|
||||||
items: [{
|
items: [{
|
||||||
xtype: 'fieldset',
|
border: false,
|
||||||
border: false,
|
items: [{
|
||||||
labelWidth: 1,
|
xtype: 'fieldset',
|
||||||
style: 'margin-bottom: 0px; padding-bottom: 0px;',
|
border: false,
|
||||||
items: [{
|
labelWidth: 1,
|
||||||
xtype: 'checkbox',
|
style: 'margin-bottom: 0px; padding-bottom: 0px;',
|
||||||
name: 'apply_max',
|
items: [{
|
||||||
fieldLabel: '',
|
xtype: 'checkbox',
|
||||||
boxLabel: _('Apply per torrent max settings:'),
|
name: 'apply_max',
|
||||||
listeners: {
|
fieldLabel: '',
|
||||||
check: this.onFieldChecked
|
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',
|
title: _('Queue'),
|
||||||
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,
|
|
||||||
items: [{
|
items: [{
|
||||||
xtype: 'fieldset',
|
border: false,
|
||||||
border: false,
|
items: [{
|
||||||
labelWidth: 1,
|
xtype: 'fieldset',
|
||||||
style: 'margin-bottom: 0px; padding-bottom: 0px;',
|
border: false,
|
||||||
items: [{
|
labelWidth: 1,
|
||||||
xtype: 'checkbox',
|
style: 'margin-bottom: 0px; padding-bottom: 0px;',
|
||||||
name: 'apply_queue',
|
items: [{
|
||||||
fieldLabel: '',
|
xtype: 'checkbox',
|
||||||
boxLabel: _('Apply queue settings:'),
|
name: 'apply_queue',
|
||||||
listeners: {
|
fieldLabel: '',
|
||||||
check: this.onFieldChecked
|
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',
|
title: _('Location'),
|
||||||
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,
|
|
||||||
items: [{
|
items: [{
|
||||||
xtype: 'fieldset',
|
border: false,
|
||||||
border: false,
|
items: [{
|
||||||
labelWidth: 1,
|
xtype: 'fieldset',
|
||||||
style: 'margin-bottom: 0px; padding-bottom: 0px;',
|
border: false,
|
||||||
items: [{
|
labelWidth: 1,
|
||||||
xtype: 'checkbox',
|
style: 'margin-bottom: 0px; padding-bottom: 0px;',
|
||||||
name: 'apply_move_completed',
|
items: [{
|
||||||
fieldLabel: '',
|
xtype: 'checkbox',
|
||||||
boxLabel: _('Apply location settings:'),
|
name: 'apply_move_completed',
|
||||||
listeners: {
|
fieldLabel: '',
|
||||||
check: this.onFieldChecked
|
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',
|
title: _('Trackers'),
|
||||||
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,
|
|
||||||
items: [{
|
items: [{
|
||||||
xtype: 'fieldset',
|
border: false,
|
||||||
border: false,
|
items: [{
|
||||||
labelWidth: 1,
|
xtype: 'fieldset',
|
||||||
style: 'margin-bottom: 0px; padding-bottom: 0px;',
|
border: false,
|
||||||
items: [{
|
labelWidth: 1,
|
||||||
xtype: 'checkbox',
|
style: 'margin-bottom: 0px; padding-bottom: 0px;',
|
||||||
name: 'auto_add',
|
items: [{
|
||||||
fieldLabel: '',
|
xtype: 'checkbox',
|
||||||
boxLabel: _('Automatically apply label:'),
|
name: 'auto_add',
|
||||||
listeners: {
|
fieldLabel: '',
|
||||||
check: this.onFieldChecked
|
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() {
|
createMenu: function() {
|
||||||
this.labelMenu = new Ext.menu.Menu({
|
this.labelMenu = new Ext.menu.Menu({
|
||||||
items: [{
|
items: [{
|
||||||
text: _('Add Label'),
|
text: _('Add Label'),
|
||||||
iconCls: 'icon-add',
|
iconCls: 'icon-add',
|
||||||
handler: this.onLabelAddClick,
|
handler: this.onLabelAddClick,
|
||||||
scope: this
|
scope: this
|
||||||
}, {
|
}, {
|
||||||
text: _('Remove Label'),
|
text: _('Remove Label'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
iconCls: 'icon-remove',
|
iconCls: 'icon-remove',
|
||||||
handler: this.onLabelRemoveClick,
|
handler: this.onLabelRemoveClick,
|
||||||
scope: this
|
scope: this
|
||||||
}, {
|
}, {
|
||||||
text: _('Label Options'),
|
text: _('Label Options'),
|
||||||
disabled: true,
|
disabled: true,
|
||||||
handler: this.onLabelOptionsClick,
|
handler: this.onLabelOptionsClick,
|
||||||
scope: this
|
scope: this
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -396,7 +376,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
|
||||||
scope: this
|
scope: this
|
||||||
});
|
});
|
||||||
for (var state in states) {
|
for (var state in states) {
|
||||||
if (!state || state == 'All' ) continue;
|
if (!state || state == 'All') continue;
|
||||||
this.torrentMenu.addMenuItem({
|
this.torrentMenu.addMenuItem({
|
||||||
text: state,
|
text: state,
|
||||||
label: state,
|
label: state,
|
||||||
|
@ -428,10 +408,10 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
|
||||||
});
|
});
|
||||||
|
|
||||||
var lbltpl = '<div class="x-deluge-filter">' +
|
var lbltpl = '<div class="x-deluge-filter">' +
|
||||||
'<tpl if="filter">{filter}</tpl>' +
|
'<tpl if="filter">{filter}</tpl>' +
|
||||||
'<tpl if="!filter">No Label</tpl>' +
|
'<tpl if="!filter">No Label</tpl>' +
|
||||||
' ({count})' +
|
' ({count})' +
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
||||||
if (deluge.sidebar.hasFilter('label')) {
|
if (deluge.sidebar.hasFilter('label')) {
|
||||||
var filter = deluge.sidebar.getFilter('label');
|
var filter = deluge.sidebar.getFilter('label');
|
||||||
|
@ -494,7 +474,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!this.labelMenu) this.createMenu();
|
if (!this.labelMenu) this.createMenu();
|
||||||
var r = dv.getRecord(node).get('filter');
|
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(1).setDisabled(true);
|
||||||
this.labelMenu.items.get(2).setDisabled(true);
|
this.labelMenu.items.get(2).setDisabled(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -536,7 +516,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
|
||||||
onTorrentMenuClick: function(item, e) {
|
onTorrentMenuClick: function(item, e) {
|
||||||
var ids = deluge.torrents.getSelectedIds();
|
var ids = deluge.torrents.getSelectedIds();
|
||||||
Ext.each(ids, function(id, i) {
|
Ext.each(ids, function(id, i) {
|
||||||
if (ids.length == i +1 ) {
|
if (ids.length == i + 1) {
|
||||||
deluge.client.label.set_torrent(id, item.label, {
|
deluge.client.label.set_torrent(id, item.label, {
|
||||||
success: function() {
|
success: function() {
|
||||||
deluge.ui.update();
|
deluge.ui.update();
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
/*
|
/*!
|
||||||
Script: scheduler.js
|
* scheduler.js
|
||||||
The client-side javascript code for the Scheduler plugin.
|
* The client-side javascript code for the Scheduler plugin.
|
||||||
|
*
|
||||||
Copyright:
|
* Copyright (C) samuel337 2011
|
||||||
(C) samuel337 2011
|
*
|
||||||
This program is free software; you can redistribute it and/or modify
|
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||||
it under the terms of the GNU General Public License as published by
|
* the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
the Free Software Foundation; either version 3, or (at your option)
|
* See LICENSE for more details.
|
||||||
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');
|
Ext.ns('Deluge.ux');
|
||||||
|
|
||||||
|
@ -59,7 +38,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
borderColor: 'FireBrick',
|
borderColor: 'FireBrick',
|
||||||
value: 2
|
value: 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
daysOfWeek: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
daysOfWeek: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||||
|
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
|
@ -110,7 +89,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
}
|
}
|
||||||
el2.style[floatAttr] = 'right';
|
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');
|
var el3 = createEl(el2, 'input');
|
||||||
el3.type = 'radio';
|
el3.type = 'radio';
|
||||||
el3.value = this.states[i].value;
|
el3.value = this.states[i].value;
|
||||||
|
@ -143,10 +122,10 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
table.cellSpacing = 0;
|
table.cellSpacing = 0;
|
||||||
|
|
||||||
// cache access to cells for easier access later
|
// cache access to cells for easier access later
|
||||||
this.scheduleCells = { };
|
this.scheduleCells = {};
|
||||||
|
|
||||||
Ext.each(this.daysOfWeek, function(day) {
|
Ext.each(this.daysOfWeek, function(day) {
|
||||||
var cells = [ ];
|
var cells = [];
|
||||||
var row = createEl(table, 'tr');
|
var row = createEl(table, 'tr');
|
||||||
var label = createEl(row, 'th');
|
var label = createEl(row, 'th');
|
||||||
label.setAttribute('style', 'font-weight: bold; padding-right: 5px;');
|
label.setAttribute('style', 'font-weight: bold; padding-right: 5px;');
|
||||||
|
@ -248,7 +227,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
if (!this.dragAnchor)
|
if (!this.dragAnchor)
|
||||||
leftTooltipCell = cell;
|
leftTooltipCell = cell;
|
||||||
else if ((this.dragAnchor && this.isCellLeftTooltipHidden()) ||
|
else if ((this.dragAnchor && this.isCellLeftTooltipHidden()) ||
|
||||||
(this.dragAnchor && this.dragAnchor.hour > cell.hour))
|
(this.dragAnchor && this.dragAnchor.hour > cell.hour))
|
||||||
leftTooltipCell = this.dragAnchor;
|
leftTooltipCell = this.dragAnchor;
|
||||||
|
|
||||||
if (leftTooltipCell) {
|
if (leftTooltipCell) {
|
||||||
|
@ -260,8 +239,8 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
pm = true;
|
pm = true;
|
||||||
if (hour > 12) hour -= 12;
|
if (hour > 12) hour -= 12;
|
||||||
}
|
}
|
||||||
// change 0 hour to 12am
|
|
||||||
else if (hour == 0) {
|
else if (hour == 0) {
|
||||||
|
// change 0 hour to 12am
|
||||||
hour = 12;
|
hour = 12;
|
||||||
}
|
}
|
||||||
this.showCellLeftTooltip(hour + ' ' + (pm ? 'pm' : 'am'), leftTooltipCell);
|
this.showCellLeftTooltip(hour + ' ' + (pm ? 'pm' : 'am'), leftTooltipCell);
|
||||||
|
@ -287,8 +266,8 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
pm = true;
|
pm = true;
|
||||||
if (hour > 12) hour -= 12;
|
if (hour > 12) hour -= 12;
|
||||||
}
|
}
|
||||||
// change 0 hour to 12am
|
|
||||||
else if (hour == 0) {
|
else if (hour == 0) {
|
||||||
|
// change 0 hour to 12am
|
||||||
hour = 12;
|
hour = 12;
|
||||||
}
|
}
|
||||||
this.showCellRightTooltip(hour + ' ' + (pm ? 'pm' : 'am'), rightTooltipCell);
|
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) {
|
else if (cell.hour > this.dragAnchor.hour) {
|
||||||
// dragging right
|
// 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);
|
this.previewCells(cell.day, this.dragAnchor.hour, cell.hour);
|
||||||
}
|
}
|
||||||
else if (cell.hour < this.dragAnchor.hour) {
|
else if (cell.hour < this.dragAnchor.hour) {
|
||||||
// dragging left
|
// 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);
|
this.previewCells(cell.day, cell.hour, this.dragAnchor.hour);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// back to anchor cell
|
// back to anchor cell
|
||||||
// don't know if it is from right or left, so revert all except this
|
// 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, cell.hour + 1, 23);
|
||||||
this.revertCells(cell.day, 0, cell.hour-1);
|
this.revertCells(cell.day, 0, cell.hour - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -346,7 +325,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
|
|
||||||
if (toHour > cells.length) toHour = cells.length;
|
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) {
|
if (cells[i].currentValue != curBrushValue) {
|
||||||
cells[i].oldValue = cells[i].currentValue;
|
cells[i].oldValue = cells[i].currentValue;
|
||||||
cells[i].currentValue = curBrushValue;
|
cells[i].currentValue = curBrushValue;
|
||||||
|
@ -360,7 +339,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
|
|
||||||
if (toHour > cells.length) toHour = cells.length;
|
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;
|
cells[i].currentValue = cells[i].oldValue;
|
||||||
this.updateCell(cells[i]);
|
this.updateCell(cells[i]);
|
||||||
}
|
}
|
||||||
|
@ -371,7 +350,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
|
|
||||||
if (toHour > cells.length) toHour = cells.length;
|
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) {
|
if (cells[i].currentValue != cells[i].oldValue) {
|
||||||
cells[i].oldValue = cells[i].currentValue;
|
cells[i].oldValue = cells[i].currentValue;
|
||||||
}
|
}
|
||||||
|
@ -463,12 +442,12 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
},
|
},
|
||||||
|
|
||||||
getConfig: function() {
|
getConfig: function() {
|
||||||
var config = [ ];
|
var config = [];
|
||||||
|
|
||||||
for (var i=0; i < 24; i++) {
|
for (var i = 0; i < 24; i++) {
|
||||||
var hourConfig = [ 0, 0, 0, 0, 0, 0, 0 ];
|
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);
|
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) {
|
setConfig: function(config) {
|
||||||
for (var i=0; i < 24; i++) {
|
for (var i = 0; i < 24; i++) {
|
||||||
var hourConfig = config[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) {
|
if (this.scheduleCells == undefined) {
|
||||||
var cell = hourConfig[j];
|
var cell = hourConfig[j];
|
||||||
} else {
|
} else {
|
||||||
|
@ -577,7 +556,7 @@ Deluge.ux.preferences.SchedulerPage = Ext.extend(Ext.Panel, {
|
||||||
|
|
||||||
onApply: function() {
|
onApply: function() {
|
||||||
// build settings object
|
// build settings object
|
||||||
var config = { }
|
var config = {}
|
||||||
|
|
||||||
config['button_state'] = this.schedule.getConfig();
|
config['button_state'] = this.schedule.getConfig();
|
||||||
config['low_down'] = this.downloadLimit.getValue();
|
config['low_down'] = this.downloadLimit.getValue();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue