mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +00:00
Build deluge-all.js
This commit is contained in:
parent
774e614f7b
commit
75b9fd5cb4
2 changed files with 6722 additions and 6619 deletions
|
@ -419,7 +419,7 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
|
|||
path: torrent.save_path,
|
||||
size: fsize(torrent.total_size),
|
||||
files: torrent.num_files,
|
||||
status: torrent.tracker_status,
|
||||
status: torrent.message,
|
||||
tracker: torrent.tracker,
|
||||
comment: torrent.comment
|
||||
};
|
||||
|
@ -727,7 +727,8 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
'stop_at_ratio': false,
|
||||
'stop_ratio': 2.0,
|
||||
'remove_at_ratio': false,
|
||||
'move_completed': null,
|
||||
'move_completed': false,
|
||||
'move_completed_path': '',
|
||||
'private': false,
|
||||
'prioritize_first_last': false
|
||||
}
|
||||
|
@ -921,7 +922,19 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
labelSeparator: '',
|
||||
id: 'move_completed',
|
||||
boxLabel: _('Move Completed'),
|
||||
colspan: 2
|
||||
colspan: 2,
|
||||
handler: this.onMoveCompletedChecked,
|
||||
scope: this
|
||||
});
|
||||
|
||||
this.fields.move_completed_path = this.fieldsets.queue.add({
|
||||
xtype: 'textfield',
|
||||
fieldLabel: '',
|
||||
id: 'move_completed_path',
|
||||
colspan: 3,
|
||||
bodyStyle: 'margin-left: 20px',
|
||||
width: 180,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
|
||||
|
@ -1059,6 +1072,13 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
deluge.editTrackers.show();
|
||||
},
|
||||
|
||||
onMoveCompletedChecked: function(checkbox, checked) {
|
||||
this.fields.move_completed_path.setDisabled(!checked);
|
||||
|
||||
if (!checked) return;
|
||||
this.fields.move_completed_path.focus();
|
||||
},
|
||||
|
||||
onStopRatioChecked: function(checkbox, checked) {
|
||||
this.fields.remove_at_ratio.setDisabled(!checked);
|
||||
this.fields.stop_ratio.setDisabled(!checked);
|
||||
|
@ -1073,6 +1093,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
var stop_at_ratio = this.optionsManager.get('stop_at_ratio');
|
||||
this.fields.remove_at_ratio.setDisabled(!stop_at_ratio);
|
||||
this.fields.stop_ratio.setDisabled(!stop_at_ratio);
|
||||
this.fields.move_completed_path.setDisabled(!this.optionsManager.get('move_completed'));
|
||||
}
|
||||
});
|
||||
/*!
|
||||
|
@ -1109,11 +1130,18 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
|
||||
(function() {
|
||||
function flagRenderer(value) {
|
||||
if (!value) return '';
|
||||
if (!value.replace(' ', '').replace(' ', '')){
|
||||
return '';
|
||||
}
|
||||
return String.format('<img src="flag/{0}" />', value);
|
||||
}
|
||||
function peerAddressRenderer(value, p, record) {
|
||||
var seed = (record.data['seed'] == 1024) ? 'x-deluge-seed' : 'x-deluge-peer'
|
||||
var seed = (record.data['seed'] == 1024) ? 'x-deluge-seed' : 'x-deluge-peer';
|
||||
if (peer_ip.length > 2) {
|
||||
var port = peer_ip.pop();
|
||||
var ip = peer_ip.join(":");
|
||||
value = "[" + ip + "]:" + port;
|
||||
}
|
||||
return String.format('<div class="{0}">{1}</div>', seed, value);
|
||||
}
|
||||
function peerProgressRenderer(value) {
|
||||
|
@ -1202,6 +1230,14 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
// Go through the peers updating and creating peer records
|
||||
Ext.each(torrent.peers, function(peer) {
|
||||
if (this.peers[peer.ip]) {
|
||||
var record = store.getById(peer.ip);
|
||||
record.beginEdit();
|
||||
for (var k in peer) {
|
||||
if (record.get(k) != peer[k]) {
|
||||
record.set(k, peer[k]);
|
||||
}
|
||||
}
|
||||
record.endEdit();
|
||||
} else {
|
||||
this.peers[peer.ip] = 1;
|
||||
newPeers.push(new Deluge.data.Peer(peer, peer.ip));
|
||||
|
@ -1318,8 +1354,9 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
|
|||
},
|
||||
|
||||
onRequestComplete: function(status) {
|
||||
seeders = status.total_seeds > -1 ? status.num_seeds + ' (' + status.total_seeds + ')' : status.num_seeds
|
||||
peers = status.total_peers > -1 ? status.num_peers + ' (' + status.total_peers + ')' : status.num_peers
|
||||
seeders = status.total_seeds > -1 ? status.num_seeds + ' (' + status.total_seeds + ')' : status.num_seeds;
|
||||
peers = status.total_peers > -1 ? status.num_peers + ' (' + status.total_peers + ')' : status.num_peers;
|
||||
last_seen_complete = status.last_seen_complete > 0.0 ? fdate(status.last_seen_complete) : "Never";
|
||||
var data = {
|
||||
downloaded: fsize(status.total_done, true),
|
||||
uploaded: fsize(status.total_uploaded, true),
|
||||
|
@ -1336,12 +1373,13 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
|
|||
active_time: ftime(status.active_time),
|
||||
seeding_time: ftime(status.seeding_time),
|
||||
seed_rank: status.seed_rank,
|
||||
time_added: fdate(status.time_added)
|
||||
time_added: fdate(status.time_added),
|
||||
last_seen_complete: last_seen_complete
|
||||
}
|
||||
data.auto_managed = _((status.is_auto_managed) ? 'True' : 'False');
|
||||
|
||||
data.downloaded += ' (' + ((status.total_payload_download) ? fsize(status.total_payload_download) : '0.0 KiB') + ')';
|
||||
data.uploaded += ' (' + ((status.total_payload_download) ? fsize(status.total_payload_download): '0.0 KiB') + ')';
|
||||
data.uploaded += ' (' + ((status.total_payload_upload) ? fsize(status.total_payload_upload): '0.0 KiB') + ')';
|
||||
|
||||
for (var field in this.fields) {
|
||||
this.fields[field].innerHTML = data[field];
|
||||
|
@ -2299,7 +2337,7 @@ Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
|
|||
fieldLabel: _('Url'),
|
||||
id: 'url',
|
||||
name: 'url',
|
||||
anchor: '100%'
|
||||
width: '97%'
|
||||
});
|
||||
this.urlField.on('specialkey', this.onAdd, this);
|
||||
|
||||
|
@ -2307,7 +2345,7 @@ Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
|
|||
fieldLabel: _('Cookies'),
|
||||
id: 'cookies',
|
||||
name: 'cookies',
|
||||
anchor: '100%'
|
||||
width: '97%'
|
||||
});
|
||||
this.cookieField.on('specialkey', this.onAdd, this);
|
||||
},
|
||||
|
@ -2576,7 +2614,7 @@ Deluge.preferences.Cache = Ext.extend(Ext.form.FormPanel, {
|
|||
defaults: {
|
||||
decimalPrecision: 0,
|
||||
minValue: -1,
|
||||
maxValue: 99999
|
||||
maxValue: 999999
|
||||
}
|
||||
});
|
||||
om.bind('cache_size', fieldset.add({
|
||||
|
@ -3903,6 +3941,7 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
|
|||
},
|
||||
|
||||
onPluginSelect: function(dv, selections) {
|
||||
if (selections.length == 0) return;
|
||||
var r = dv.getRecords(selections)[0];
|
||||
deluge.client.web.get_plugin_info(r.get('plugin'), {
|
||||
success: this.onGotPluginInfo,
|
||||
|
@ -4527,10 +4566,17 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
|
|||
om.bind('dont_count_slow_torrents', fieldset.add({
|
||||
xtype: 'checkbox',
|
||||
name: 'dont_count_slow_torrents',
|
||||
height: 40,
|
||||
height: 22,
|
||||
hideLabel: true,
|
||||
boxLabel: _('Do not count slow torrents')
|
||||
}));
|
||||
om.bind('auto_manage_prefer_seeds', fieldset.add({
|
||||
xtype: 'checkbox',
|
||||
name: 'auto_manage_prefer_seeds',
|
||||
height: 40,
|
||||
hideLabel: true,
|
||||
boxLabel: _('Prefer Seeding over Downloading')
|
||||
}));
|
||||
|
||||
fieldset = this.add({
|
||||
xtype: 'fieldset',
|
||||
|
@ -5758,6 +5804,7 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
|
|||
}
|
||||
},
|
||||
|
||||
// FIXME: Find out why this is being fired twice
|
||||
// private
|
||||
onShow: function() {
|
||||
if (!this.addHostButton) {
|
||||
|
@ -5767,6 +5814,7 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
|
|||
this.stopHostButton = bbar.items.get('cm-stop');
|
||||
}
|
||||
this.loadHosts();
|
||||
if (this.running) return;
|
||||
this.running = window.setInterval(this.update, 2000, this);
|
||||
},
|
||||
|
||||
|
@ -5845,7 +5893,7 @@ Ext.apply(Ext, {
|
|||
return true;
|
||||
},
|
||||
|
||||
isObjectsEqual: function(obj1, obj2) {
|
||||
areObjectsEqual: function(obj1, obj2) {
|
||||
var equal = true;
|
||||
if (!obj1 || !obj2) return false;
|
||||
for (var i in obj1) {
|
||||
|
@ -5961,12 +6009,13 @@ FILE_PRIORITY = {
|
|||
0: 'Do Not Download',
|
||||
1: 'Normal Priority',
|
||||
2: 'High Priority',
|
||||
5: 'Highest Priority',
|
||||
5: 'High Priority',
|
||||
7: 'Highest Priority',
|
||||
'Mixed': 9,
|
||||
'Do Not Download': 0,
|
||||
'Normal Priority': 1,
|
||||
'High Priority': 2,
|
||||
'Highest Priority': 5
|
||||
'High Priority': 5,
|
||||
'Highest Priority': 7
|
||||
}
|
||||
|
||||
FILE_PRIORITY_CSS = {
|
||||
|
@ -5974,7 +6023,8 @@ FILE_PRIORITY_CSS = {
|
|||
0: 'x-no-download',
|
||||
1: 'x-normal-download',
|
||||
2: 'x-high-download',
|
||||
5: 'x-highest-download'
|
||||
5: 'x-high-download',
|
||||
7: 'x-highest-download'
|
||||
}
|
||||
/*!
|
||||
* Deluge.EditTrackerWindow.js
|
||||
|
@ -6115,7 +6165,7 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
|
|||
height: 220,
|
||||
plain: true,
|
||||
closable: true,
|
||||
resizable: false,
|
||||
resizable: true,
|
||||
|
||||
bodyStyle: 'padding: 5px',
|
||||
buttonAlign: 'right',
|
||||
|
@ -6158,7 +6208,6 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
|
|||
},
|
||||
stripeRows: true,
|
||||
singleSelect: true,
|
||||
autoScroll: true,
|
||||
listeners: {
|
||||
'dblclick': {fn: this.onListNodeDblClicked, scope: this},
|
||||
'selectionchange': {fn: this.onSelect, scope: this}
|
||||
|
@ -6168,6 +6217,7 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
|
|||
this.panel = this.add({
|
||||
margins: '0 0 0 0',
|
||||
items: [this.list],
|
||||
autoScroll: true,
|
||||
bbar: new Ext.Toolbar({
|
||||
items: [
|
||||
{
|
||||
|
@ -6288,17 +6338,25 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
|
|||
|
||||
onDownClick: function() {
|
||||
var r = this.list.getSelectedRecords()[0];
|
||||
if (!r) return;
|
||||
|
||||
r.set('tier', r.get('tier') + 1);
|
||||
r.commit();
|
||||
r.store.sort('tier', 'ASC');
|
||||
r.store.commitChanges();
|
||||
|
||||
this.list.select(r.store.indexOf(r));
|
||||
},
|
||||
|
||||
onUpClick: function() {
|
||||
var r = this.list.getSelectedRecords()[0];
|
||||
if (!r) return;
|
||||
|
||||
if (r.get('tier') == 0) return;
|
||||
r.set('tier', r.get('tier') - 1);
|
||||
r.commit();
|
||||
r.store.sort('tier', 'ASC');
|
||||
r.store.commitChanges();
|
||||
|
||||
this.list.select(r.store.indexOf(r));
|
||||
}
|
||||
});
|
||||
/*!
|
||||
|
@ -6529,6 +6587,8 @@ Ext.ns('Deluge');
|
|||
*/
|
||||
Deluge.FilterPanel = Ext.extend(Ext.Panel, {
|
||||
|
||||
autoScroll: true,
|
||||
|
||||
border: false,
|
||||
|
||||
show_zero: null,
|
||||
|
@ -6864,7 +6924,7 @@ Deluge.Keys = {
|
|||
'queue', 'name', 'total_size', 'state', 'progress', 'num_seeds',
|
||||
'total_seeds', 'num_peers', 'total_peers', 'download_payload_rate',
|
||||
'upload_payload_rate', 'eta', 'ratio', 'distributed_copies',
|
||||
'is_auto_managed', 'time_added', 'tracker_host', 'save_path'
|
||||
'is_auto_managed', 'time_added', 'tracker_host', 'save_path', 'last_seen_complete'
|
||||
],
|
||||
|
||||
/**
|
||||
|
@ -6879,7 +6939,7 @@ Deluge.Keys = {
|
|||
'total_done', 'total_payload_download', 'total_uploaded',
|
||||
'total_payload_upload', 'next_announce', 'tracker_status', 'num_pieces',
|
||||
'piece_length', 'is_auto_managed', 'active_time', 'seeding_time',
|
||||
'seed_rank'
|
||||
'seed_rank', 'last_seen_complete', 'owner', 'public', 'shared'
|
||||
],
|
||||
|
||||
/**
|
||||
|
@ -6902,7 +6962,7 @@ Deluge.Keys = {
|
|||
* Keys used in the details tab of the statistics panel.
|
||||
*/
|
||||
Details: [
|
||||
'name', 'save_path', 'total_size', 'num_files', 'tracker_status',
|
||||
'name', 'save_path', 'total_size', 'num_files', 'message',
|
||||
'tracker', 'comment'
|
||||
],
|
||||
|
||||
|
@ -6915,7 +6975,8 @@ Deluge.Keys = {
|
|||
Options: [
|
||||
'max_download_speed', 'max_upload_speed', 'max_connections',
|
||||
'max_upload_slots','is_auto_managed', 'stop_at_ratio', 'stop_ratio',
|
||||
'remove_at_ratio', 'private', 'prioritize_first_last'
|
||||
'remove_at_ratio', 'private', 'prioritize_first_last',
|
||||
'move_completed', 'move_completed_path'
|
||||
]
|
||||
};
|
||||
|
||||
|
@ -7329,22 +7390,22 @@ deluge.menus.filePriorities = new Ext.menu.Menu({
|
|||
id: 'no_download',
|
||||
text: _('Do Not Download'),
|
||||
iconCls: 'icon-do-not-download',
|
||||
filePriority: 0
|
||||
filePriority: FILE_PRIORITY['Do Not Download']
|
||||
}, {
|
||||
id: 'normal',
|
||||
text: _('Normal Priority'),
|
||||
iconCls: 'icon-normal',
|
||||
filePriority: 1
|
||||
filePriority: FILE_PRIORITY['Normal Priority']
|
||||
}, {
|
||||
id: 'high',
|
||||
text: _('High Priority'),
|
||||
iconCls: 'icon-high',
|
||||
filePriority: 2
|
||||
filePriority: FILE_PRIORITY['High Priority']
|
||||
}, {
|
||||
id: 'highest',
|
||||
text: _('Highest Priority'),
|
||||
iconCls: 'icon-highest',
|
||||
filePriority: 5
|
||||
filePriority: FILE_PRIORITY['Highest Priority']
|
||||
}]
|
||||
});
|
||||
/*!
|
||||
|
@ -8736,6 +8797,10 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
|
|||
return eta * -1;
|
||||
}
|
||||
|
||||
function dateOrNever(date) {
|
||||
return date > 0.0 ? fdate(date) : "Never"
|
||||
}
|
||||
|
||||
/**
|
||||
* Deluge.TorrentGrid Class
|
||||
*
|
||||
|
@ -8826,6 +8891,12 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
|
|||
sortable: true,
|
||||
renderer: fdate,
|
||||
dataIndex: 'time_added'
|
||||
}, {
|
||||
header: _('Last Seen Complete'),
|
||||
width: 80,
|
||||
sortable: true,
|
||||
renderer: dateOrNever,
|
||||
dataIndex: 'last_seen_complete'
|
||||
}, {
|
||||
header: _('Tracker'),
|
||||
width: 120,
|
||||
|
@ -8838,6 +8909,24 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
|
|||
sortable: true,
|
||||
renderer: fplain,
|
||||
dataIndex: 'save_path'
|
||||
}, {
|
||||
header: _('Owner'),
|
||||
width: 80,
|
||||
sortable: true,
|
||||
renderer: fplain,
|
||||
dataIndex: 'owner'
|
||||
}, {
|
||||
header: _('Public'),
|
||||
width: 80,
|
||||
sortable: true,
|
||||
renderer: fplain,
|
||||
dataIndex: 'public'
|
||||
}, {
|
||||
header: _('Shared'),
|
||||
width: 80,
|
||||
sortable: true,
|
||||
renderer: fplain,
|
||||
dataIndex: 'shared'
|
||||
}],
|
||||
|
||||
meta: {
|
||||
|
@ -8945,8 +9034,15 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
|
|||
return ids;
|
||||
},
|
||||
|
||||
update: function(torrents) {
|
||||
update: function(torrents, wipe) {
|
||||
var store = this.getStore();
|
||||
|
||||
// Need to perform a complete reload of the torrent grid.
|
||||
if (wipe) {
|
||||
store.removeAll();
|
||||
this.torrents = {};
|
||||
}
|
||||
|
||||
var newTorrents = [];
|
||||
|
||||
// Update and add any new torrents.
|
||||
|
@ -9122,6 +9218,9 @@ deluge.ui = {
|
|||
|
||||
update: function() {
|
||||
var filters = deluge.sidebar.getFilterStates();
|
||||
this.oldFilters = this.filters;
|
||||
this.filters = filters;
|
||||
|
||||
deluge.client.web.update_ui(Deluge.Keys.Grid, filters, {
|
||||
success: this.onUpdate,
|
||||
failure: this.onUpdateError,
|
||||
|
@ -9178,7 +9277,11 @@ deluge.ui = {
|
|||
' (Down: ' + fspeed(data['stats'].download_rate, true) +
|
||||
' Up: ' + fspeed(data['stats'].upload_rate, true) + ')';
|
||||
}
|
||||
if (Ext.areObjectsEqual(this.filters, this.oldFilters)) {
|
||||
deluge.torrents.update(data['torrents']);
|
||||
} else {
|
||||
deluge.torrents.update(data['torrents'], true);
|
||||
}
|
||||
deluge.statusbar.update(data['stats']);
|
||||
deluge.sidebar.update(data['filters']);
|
||||
this.errorCount = 0;
|
||||
|
@ -9233,7 +9336,7 @@ deluge.ui = {
|
|||
var scripts = (Deluge.debug) ? resources.debug_scripts : resources.scripts;
|
||||
Ext.each(scripts, function(script) {
|
||||
Ext.ux.JSLoader({
|
||||
url: script,
|
||||
url: deluge.config.base + script,
|
||||
onLoad: this.onPluginLoaded,
|
||||
pluginName: resources.name
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue