[Lint] Format files with Prettier

Use Prettier to auto-format javascript, CSS and YAML files so that less
manual work is involved and style is consistent across project.
This commit is contained in:
Calum Lind 2018-10-03 11:22:22 +01:00
parent b1cdc32f73
commit 358ff74d0e
97 changed files with 8330 additions and 6334 deletions

6
.prettierignore Normal file
View file

@ -0,0 +1,6 @@
deluge/ui/web/css/ext-*.css
deluge/ui/web/js/extjs/ext-*.js
deluge/ui/web/docs/
deluge/ui/web/themes/images/
*.py*
*.html

13
.prettierrc.yaml Normal file
View file

@ -0,0 +1,13 @@
trailingComma: "es5"
tabWidth: 4
singleQuote: true
overrides:
- files:
- "*.yaml"
- ".*.yaml"
- "*.yml"
- ".*.yml"
- "*.md"
options:
tabWidth: 2
singleQuote: false

View file

@ -22,7 +22,8 @@ install:
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
- ps:
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
@ -77,8 +78,8 @@ install:
- "SET PATH=%TOXENV%;%PYTHON%;%PYTHON%\\Scripts;c:\\openssl-1.1\\bin;C:\\Program Files (x86)\\NSIS;%PATH%"
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- "python -c \"import libtorrent; print(libtorrent.__version__)\""
- 'python -c "import struct; print(struct.calcsize(\"P\") * 8)"'
- 'python -c "import libtorrent; print(libtorrent.__version__)"'
- openssl version -v
cache:

View file

@ -19,7 +19,6 @@ Ext.ns('Deluge.ux.preferences');
* @extends Ext.Panel
*/
Deluge.ux.preferences.AutoAddPage = Ext.extend(Ext.Panel, {
title: _('AutoAdd'),
header: false,
layout: 'fit',
@ -33,75 +32,91 @@ Deluge.ux.preferences.AutoAddPage = Ext.extend(Ext.Panel, {
this.list = new Ext.list.ListView({
store: new Ext.data.JsonStore({
fields: [
'id',
'enabled',
'owner',
'path'
]
fields: ['id', 'enabled', 'owner', 'path'],
}),
columns: [{
columns: [
{
id: 'enabled',
header: _('Active'),
sortable: true,
dataIndex: 'enabled',
tpl: new Ext.XTemplate('{enabled:this.getCheckbox}', {
getCheckbox: function(checked, selected) {
Deluge.ux.AutoAdd.onClickFunctions[selected.id] = function () {
Deluge.ux.AutoAdd.onClickFunctions[
selected.id
] = function() {
if (selected.enabled) {
deluge.client.autoadd.disable_watchdir(selected.id);
deluge.client.autoadd.disable_watchdir(
selected.id
);
checked = false;
}
else {
deluge.client.autoadd.enable_watchdir(selected.id);
} else {
deluge.client.autoadd.enable_watchdir(
selected.id
);
checked = true;
}
autoAdd.updateWatchDirs();
};
return '<input id="enabled-' + selected.id + '" type="checkbox"' + (checked ? ' checked' : '') +
' onclick="Deluge.ux.AutoAdd.onClickFunctions[' + selected.id +']()" />'
}
return (
'<input id="enabled-' +
selected.id +
'" type="checkbox"' +
(checked ? ' checked' : '') +
' onclick="Deluge.ux.AutoAdd.onClickFunctions[' +
selected.id +
']()" />'
);
},
}),
width: .15
}, {
width: 0.15,
},
{
id: 'owner',
header: _('Owner'),
sortable: true,
dataIndex: 'owner',
width: .2
}, {
width: 0.2,
},
{
id: 'path',
header: _('Path'),
sortable: true,
dataIndex: 'path'
}],
dataIndex: 'path',
},
],
singleSelect: true,
autoExpandColumn: 'path'
autoExpandColumn: 'path',
});
this.list.on('selectionchange', this.onSelectionChange, this);
this.panel = this.add({
items: [this.list],
bbar: {
items: [{
items: [
{
text: _('Add'),
iconCls: 'icon-add',
handler: this.onAddClick,
scope: this
}, {
scope: this,
},
{
text: _('Edit'),
iconCls: 'icon-edit',
handler: this.onEditClick,
scope: this,
disabled: true
}, '->', {
disabled: true,
},
'->',
{
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onRemoveClick,
scope: this,
disabled: true
}]
}
disabled: true,
},
],
},
});
this.on('show', this.onPreferencesShow, this);
@ -117,7 +132,8 @@ Deluge.ux.preferences.AutoAddPage = Ext.extend(Ext.Panel, {
var watchdir = {};
watchdir['id'] = id;
watchdir['enabled'] = watchdirs[id].enabled;
watchdir['owner'] = watchdirs[id].owner || 'localclient';
watchdir['owner'] =
watchdirs[id].owner || 'localclient';
watchdir['path'] = watchdirs[id].path;
watchdirsArray.push(watchdir);
@ -125,16 +141,20 @@ Deluge.ux.preferences.AutoAddPage = Ext.extend(Ext.Panel, {
}
this.list.getStore().loadData(watchdirsArray);
},
scope: this
scope: this,
});
},
onAddClick: function() {
if (!this.addWin) {
this.addWin = new Deluge.ux.AutoAdd.AddAutoAddCommandWindow();
this.addWin.on('watchdiradd', function() {
this.addWin.on(
'watchdiradd',
function() {
this.updateWatchDirs();
}, this);
},
this
);
}
this.addWin.show();
},
@ -142,9 +162,13 @@ Deluge.ux.preferences.AutoAddPage = Ext.extend(Ext.Panel, {
onEditClick: function() {
if (!this.editWin) {
this.editWin = new Deluge.ux.AutoAdd.EditAutoAddCommandWindow();
this.editWin.on('watchdiredit', function() {
this.editWin.on(
'watchdiredit',
function() {
this.updateWatchDirs();
}, this);
},
this
);
}
var id = this.list.getSelectedRecords()[0].id;
this.editWin.show(id, this.watchdirs[id]);
@ -160,26 +184,38 @@ Deluge.ux.preferences.AutoAddPage = Ext.extend(Ext.Panel, {
success: function() {
this.updateWatchDirs();
},
scope: this
scope: this,
});
},
onSelectionChange: function(dv, selections) {
if (selections.length) {
this.panel.getBottomToolbar().items.get(1).enable();
this.panel.getBottomToolbar().items.get(3).enable();
this.panel
.getBottomToolbar()
.items.get(1)
.enable();
this.panel
.getBottomToolbar()
.items.get(3)
.enable();
} else {
this.panel.getBottomToolbar().items.get(1).disable();
this.panel.getBottomToolbar().items.get(3).disable();
}
this.panel
.getBottomToolbar()
.items.get(1)
.disable();
this.panel
.getBottomToolbar()
.items.get(3)
.disable();
}
},
});
Deluge.plugins.AutoAddPlugin = Ext.extend(Deluge.Plugin, {
name: 'AutoAdd',
static: {
prefsPage: null
prefsPage: null,
},
onDisable: function() {
@ -193,9 +229,11 @@ Deluge.plugins.AutoAddPlugin = Ext.extend(Deluge.Plugin, {
* This will prevent adding unnecessary tabs to the preferences window.
*/
if (!Deluge.plugins.AutoAddPlugin.prefsPage) {
Deluge.plugins.AutoAddPlugin.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.AutoAddPage());
}
Deluge.plugins.AutoAddPlugin.prefsPage = deluge.preferences.addPage(
new Deluge.ux.preferences.AutoAddPage()
);
}
},
});
Deluge.registerPlugin('AutoAdd', Deluge.plugins.AutoAddPlugin);

View file

@ -16,34 +16,48 @@ Ext.ns('Deluge.ux.AutoAdd');
* @extends Ext.Window
*/
Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
width: 350,
autoHeight: true,
closeAction: 'hide',
spin_ids: ['max_download_speed', 'max_upload_speed', 'stop_ratio'],
spin_int_ids: ['max_upload_slots', 'max_connections'],
chk_ids: ['stop_at_ratio', 'remove_at_ratio', 'move_completed',
'add_paused', 'auto_managed', 'queue_to_top'],
toggle_ids: ['append_extension_toggle', 'download_location_toggle',
'label_toggle', 'copy_torrent_toggle',
'delete_copy_torrent_toggle', 'seed_mode'],
chk_ids: [
'stop_at_ratio',
'remove_at_ratio',
'move_completed',
'add_paused',
'auto_managed',
'queue_to_top',
],
toggle_ids: [
'append_extension_toggle',
'download_location_toggle',
'label_toggle',
'copy_torrent_toggle',
'delete_copy_torrent_toggle',
'seed_mode',
],
accounts: new Ext.data.ArrayStore({
storeId: 'accountStore',
id: 0,
fields: [{
fields: [
{
name: 'displayText',
type: 'string'
}]
type: 'string',
},
],
}),
labels: new Ext.data.ArrayStore({
storeId: 'labelStore',
id: 0,
fields: [{
fields: [
{
name: 'displayText',
type: 'string'
}]
type: 'string',
},
],
}),
initComponent: function() {
@ -57,14 +71,13 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
xtype: 'form',
baseCls: 'x-plain',
bodyStyle: 'padding: 5px',
items: [{
items: [
{
xtype: 'tabpanel',
activeTab: 0,
items: [
this.MainTab,
this.OptionsTab
]
}]
items: [this.MainTab, this.OptionsTab],
},
],
});
},
@ -77,8 +90,12 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
options['enabled'] = Ext.getCmp('enabled').getValue();
options['path'] = Ext.getCmp('path').getValue();
options['download_location'] = Ext.getCmp('download_location').getValue();
options['move_completed_path'] = Ext.getCmp('move_completed_path').getValue();
options['download_location'] = Ext.getCmp(
'download_location'
).getValue();
options['move_completed_path'] = Ext.getCmp(
'move_completed_path'
).getValue();
options['copy_torrent'] = Ext.getCmp('copy_torrent').getValue();
options['label'] = Ext.getCmp('label').getValue();
@ -90,20 +107,31 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
});
this.spin_ids.forEach(function(spin_id) {
options[spin_id] = Ext.getCmp(spin_id).getValue();
options[spin_id + '_toggle'] = Ext.getCmp(spin_id + '_toggle').getValue();
options[spin_id + '_toggle'] = Ext.getCmp(
spin_id + '_toggle'
).getValue();
});
this.spin_int_ids.forEach(function(spin_int_id) {
options[spin_int_id] = Ext.getCmp(spin_int_id).getValue();
options[spin_int_id + '_toggle'] = Ext.getCmp(spin_int_id + '_toggle').getValue();
options[spin_int_id + '_toggle'] = Ext.getCmp(
spin_int_id + '_toggle'
).getValue();
});
this.chk_ids.forEach(function(chk_id) {
options[chk_id] = Ext.getCmp(chk_id).getValue();
options[chk_id + '_toggle'] = Ext.getCmp(chk_id + '_toggle').getValue();
options[chk_id + '_toggle'] = Ext.getCmp(
chk_id + '_toggle'
).getValue();
});
if (options['copy_torrent_toggle'] && options['path'] === options['copy_torrent']) {
throw _('"Watch Folder" directory and "Copy of .torrent' +
' files to" directory cannot be the same!');
if (
options['copy_torrent_toggle'] &&
options['path'] === options['copy_torrent']
) {
throw _(
'"Watch Folder" directory and "Copy of .torrent' +
' files to" directory cannot be the same!'
);
}
return options;
@ -123,22 +151,33 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
);
Ext.getCmp('isnt_append_extension').setValue(true);
Ext.getCmp('append_extension_toggle').setValue(
options['append_extension_toggle'] !== undefined ? options['append_extension_toggle'] : false
options['append_extension_toggle'] !== undefined
? options['append_extension_toggle']
: false
);
Ext.getCmp('append_extension').setValue(
options['append_extension'] !== undefined ? options['append_extension'] : '.added'
options['append_extension'] !== undefined
? options['append_extension']
: '.added'
);
Ext.getCmp('download_location_toggle').setValue(
options['download_location_toggle'] !== undefined ? options['download_location_toggle'] : false
options['download_location_toggle'] !== undefined
? options['download_location_toggle']
: false
);
Ext.getCmp('copy_torrent_toggle').setValue(
options['copy_torrent_toggle'] !== undefined ? options['copy_torrent_toggle'] : false
options['copy_torrent_toggle'] !== undefined
? options['copy_torrent_toggle']
: false
);
Ext.getCmp('delete_copy_torrent_toggle').setValue(
options['delete_copy_torrent_toggle'] !== undefined ? options['delete_copy_torrent_toggle'] : false
options['delete_copy_torrent_toggle'] !== undefined
? options['delete_copy_torrent_toggle']
: false
);
value = options['seed_mode'] !== undefined ? options['seed_mode'] : false;
value =
options['seed_mode'] !== undefined ? options['seed_mode'] : false;
Ext.getCmp('seed_mode').setValue(value);
this.accounts.removeAll(true);
@ -149,7 +188,9 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
options['label'] !== undefined ? options['label'] : ''
);
Ext.getCmp('label_toggle').setValue(
options['label_toggle'] !== undefined ? options['label_toggle'] : false
options['label_toggle'] !== undefined
? options['label_toggle']
: false
);
this.spin_ids.forEach(function(spin_id) {
@ -157,7 +198,9 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
options[spin_id] !== undefined ? options[spin_id] : 0
);
Ext.getCmp(spin_id + '_toggle').setValue(
options[spin_id + '_toggle'] !== undefined ? options[spin_id + '_toggle'] : false
options[spin_id + '_toggle'] !== undefined
? options[spin_id + '_toggle']
: false
);
});
this.chk_ids.forEach(function(chk_id) {
@ -165,23 +208,36 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
options[chk_id] !== undefined ? options[chk_id] : true
);
Ext.getCmp(chk_id + '_toggle').setValue(
options[chk_id + '_toggle'] !== undefined ? options[chk_id + '_toggle'] : false
options[chk_id + '_toggle'] !== undefined
? options[chk_id + '_toggle']
: false
);
});
value = options['add_paused'] !== undefined ? options['add_paused'] : true;
value =
options['add_paused'] !== undefined ? options['add_paused'] : true;
if (!value) {
Ext.getCmp('not_add_paused').setValue(true);
}
value = options['queue_to_top'] !== undefined ? options['queue_to_top'] : true;
value =
options['queue_to_top'] !== undefined
? options['queue_to_top']
: true;
if (!value) {
Ext.getCmp('not_queue_to_top').setValue(true);
}
value = options['auto_managed'] !== undefined ? options['auto_managed'] : true;
value =
options['auto_managed'] !== undefined
? options['auto_managed']
: true;
if (!value) {
Ext.getCmp('not_auto_managed').setValue(true)
Ext.getCmp('not_auto_managed').setValue(true);
}
['move_completed_path', 'path', 'download_location',
'copy_torrent'].forEach(function(field) {
[
'move_completed_path',
'path',
'download_location',
'copy_torrent',
].forEach(function(field) {
value = options[field] !== undefined ? options[field] : '';
Ext.getCmp(field).setValue(value);
});
@ -191,44 +247,47 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
success: function(config) {
var value;
Ext.getCmp('download_location').setValue(
options['download_location'] !== undefined ?
options['download_location'] :
config['download_location']
options['download_location'] !== undefined
? options['download_location']
: config['download_location']
);
value = options['move_completed_toggle'] !== undefined ?
options['move_completed_toggle'] :
config['move_completed'];
value =
options['move_completed_toggle'] !== undefined
? options['move_completed_toggle']
: config['move_completed'];
if (value) {
Ext.getCmp('move_completed_toggle').setValue(
options['move_completed_toggle'] !== undefined ?
options['move_completed_toggle'] :
false
options['move_completed_toggle'] !== undefined
? options['move_completed_toggle']
: false
);
Ext.getCmp('move_completed_path').setValue(
options['move_completed_path'] !== undefined ?
options['move_completed_path'] :
config['move_completed_path']
options['move_completed_path'] !== undefined
? options['move_completed_path']
: config['move_completed_path']
);
}
value = options['copy_torrent_toggle'] !== undefined ?
options['copy_torrent_toggle'] :
config['copy_torrent_file'];
value =
options['copy_torrent_toggle'] !== undefined
? options['copy_torrent_toggle']
: config['copy_torrent_file'];
if (value) {
Ext.getCmp('copy_torrent_toggle').setValue(true);
Ext.getCmp('copy_torrent').setValue(
options['copy_torrent'] !== undefined ?
options['copy_torrent'] :
config['torrentfiles_location']
options['copy_torrent'] !== undefined
? options['copy_torrent']
: config['torrentfiles_location']
);
}
value = options['delete_copy_torrent_toggle'] !== undefined ?
options['copy_torrent_toggle'] :
config['del_copy_torrent_file'];
value =
options['delete_copy_torrent_toggle'] !== undefined
? options['copy_torrent_toggle']
: config['del_copy_torrent_file'];
if (value) {
Ext.getCmp('delete_copy_torrent_toggle').setValue(true)
Ext.getCmp('delete_copy_torrent_toggle').setValue(true);
}
}
})
},
});
}
deluge.client.core.get_enabled_plugins({
@ -237,7 +296,11 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
this.MainTab.LabelFset.setVisible(true);
deluge.client.label.get_labels({
success: function(labels) {
for (var index = 0; index < labels.length; index++) {
for (
var index = 0;
index < labels.length;
index++
) {
labels[index] = [labels[index]];
}
this.labels.loadData(labels, false);
@ -245,14 +308,13 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
failure: function(failure) {
console.error(failure);
},
scope: this
scope: this,
});
}
else {
} else {
this.MainTab.LabelFset.setVisible(false);
}
},
scope: this
scope: this,
});
var me = this;
@ -262,16 +324,20 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
accounts[index] = [accounts[index]['username']];
}
me.accounts.loadData(accounts, false);
Ext.getCmp('owner').setValue(owner).enable();
Ext.getCmp('owner')
.setValue(owner)
.enable();
}
function on_accounts_failure(failure) {
deluge.client.autoadd.get_auth_user({
success: function(user) {
me.accounts.loadData([[user]], false);
Ext.getCmp('owner').setValue(user).disable(true);
Ext.getCmp('owner')
.setValue(user)
.disable(true);
},
scope: this
scope: this,
});
}
@ -282,44 +348,51 @@ Deluge.ux.AutoAdd.AutoAddWindowBase = Ext.extend(Ext.Window, {
success: function(accounts) {
deluge.client.autoadd.get_auth_user({
success: function(user) {
on_accounts(accounts,
options['owner'] !== undefined ? options['owner'] : user
on_accounts(
accounts,
options['owner'] !== undefined
? options['owner']
: user
);
},
scope: this
scope: this,
});
},
failure: on_accounts_failure,
scope: this
})
}
else {
scope: this,
});
} else {
on_accounts_failure(null);
}
},
scope: this
scope: this,
});
}
},
});
/**
* @class Deluge.ux.AutoAdd.EditAutoAddCommandWindow
* @extends Deluge.ux.AutoAdd.AutoAddWindowBase
*/
Deluge.ux.AutoAdd.EditAutoAddCommandWindow = Ext.extend(Deluge.ux.AutoAdd.AutoAddWindowBase, {
Deluge.ux.AutoAdd.EditAutoAddCommandWindow = Ext.extend(
Deluge.ux.AutoAdd.AutoAddWindowBase,
{
title: _('Edit Watch Folder'),
initComponent: function() {
Deluge.ux.AutoAdd.EditAutoAddCommandWindow.superclass.initComponent.call(this);
Deluge.ux.AutoAdd.EditAutoAddCommandWindow.superclass.initComponent.call(
this
);
this.addButton(_('Save'), this.onSaveClick, this);
this.addEvents({
'watchdiredit': true
watchdiredit: true,
});
},
show: function(watchdir_id, options) {
Deluge.ux.AutoAdd.EditAutoAddCommandWindow.superclass.show.call(this);
Deluge.ux.AutoAdd.EditAutoAddCommandWindow.superclass.show.call(
this
);
this.watchdir_id = watchdir_id;
this.loadOptions(options);
},
@ -331,41 +404,45 @@ Deluge.ux.AutoAdd.EditAutoAddCommandWindow = Ext.extend(Deluge.ux.AutoAdd.AutoAd
success: function() {
this.fireEvent('watchdiredit', this, options);
},
scope: this
scope: this,
});
}
catch(err) {
} catch (err) {
Ext.Msg.show({
title: _('Incompatible Option'),
msg: err,
buttons: Ext.Msg.OK,
scope: this
scope: this,
});
}
this.hide();
},
}
});
);
/**
* @class Deluge.ux.AutoAdd.AddAutoAddCommandWindow
* @extends Deluge.ux.AutoAdd.AutoAddWindowBase
*/
Deluge.ux.AutoAdd.AddAutoAddCommandWindow = Ext.extend(Deluge.ux.AutoAdd.AutoAddWindowBase, {
Deluge.ux.AutoAdd.AddAutoAddCommandWindow = Ext.extend(
Deluge.ux.AutoAdd.AutoAddWindowBase,
{
title: _('Add Watch Folder'),
initComponent: function() {
Deluge.ux.AutoAdd.AddAutoAddCommandWindow.superclass.initComponent.call(this);
Deluge.ux.AutoAdd.AddAutoAddCommandWindow.superclass.initComponent.call(
this
);
this.addButton(_('Add'), this.onAddClick, this);
this.addEvents({
'watchdiradd': true
watchdiradd: true,
});
},
show: function() {
Deluge.ux.AutoAdd.AddAutoAddCommandWindow.superclass.show.call(this);
Deluge.ux.AutoAdd.AddAutoAddCommandWindow.superclass.show.call(
this
);
this.loadOptions();
},
@ -381,18 +458,18 @@ Deluge.ux.AutoAdd.AddAutoAddCommandWindow = Ext.extend(Deluge.ux.AutoAdd.AutoAdd
var error;
if ((error = regex.exec(err.error.message)) !== null) {
error = error[1];
}
else {
} else {
error = err.error.message;
}
Ext.Msg.show({
title: _('Incompatible Option'),
msg: error,
buttons: Ext.Msg.OK,
scope: this
scope: this,
});
},
scope: this
scope: this,
});
},
}
});
);

View file

@ -29,18 +29,21 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
width: '85%',
labelWidth: 1,
items: [{
items: [
{
xtype: 'textfield',
id: 'path',
hideLabel: true,
width: 304
}, {
width: 304,
},
{
hideLabel: true,
id: 'enabled',
xtype: 'checkbox',
boxLabel: _('Enable this watch folder'),
checked: true
}]
checked: true,
},
],
});
this.torrentActionFset = new Ext.form.FieldSet({
@ -51,12 +54,14 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
width: '85%',
labelWidth: 1,
defaults: {
style: 'margin-bottom: 2px'
style: 'margin-bottom: 2px',
},
items: [{
items: [
{
xtype: 'radiogroup',
columns: 1,
items: [{
items: [
{
xtype: 'radio',
name: 'torrent_action',
id: 'isnt_append_extension',
@ -66,78 +71,119 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
listeners: {
check: function(cb, newValue) {
if (newValue) {
Ext.getCmp('append_extension').setDisabled(newValue);
Ext.getCmp('copy_torrent').setDisabled(newValue);
Ext.getCmp('delete_copy_torrent_toggle').setDisabled(newValue);
Ext.getCmp(
'append_extension'
).setDisabled(newValue);
Ext.getCmp('copy_torrent').setDisabled(
newValue
);
Ext.getCmp(
'delete_copy_torrent_toggle'
).setDisabled(newValue);
}
}
}
}, {
},
},
},
{
xtype: 'container',
layout: 'hbox',
hideLabel: true,
items: [{
items: [
{
xtype: 'radio',
name: 'torrent_action',
id: 'append_extension_toggle',
boxLabel: _('Append extension after adding:'),
boxLabel: _(
'Append extension after adding:'
),
hideLabel: true,
listeners: {
check: function(cb, newValue) {
if (newValue) {
Ext.getCmp('append_extension').setDisabled(!newValue);
Ext.getCmp('copy_torrent').setDisabled(newValue);
Ext.getCmp('delete_copy_torrent_toggle').setDisabled(newValue);
Ext.getCmp(
'append_extension'
).setDisabled(!newValue);
Ext.getCmp(
'copy_torrent'
).setDisabled(newValue);
Ext.getCmp(
'delete_copy_torrent_toggle'
).setDisabled(newValue);
}
}
}
}, {
},
},
},
{
xtype: 'textfield',
id: 'append_extension',
hideLabel: true,
disabled: true,
style: 'margin-left: 2px',
width: 112
}]
}, {
width: 112,
},
],
},
{
xtype: 'container',
hideLabel: true,
items: [{
items: [
{
xtype: 'container',
layout: 'hbox',
hideLabel: true,
items: [{
items: [
{
xtype: 'radio',
name: 'torrent_action',
id: 'copy_torrent_toggle',
boxLabel: _('Copy of .torrent files to:'),
boxLabel: _(
'Copy of .torrent files to:'
),
hideLabel: true,
listeners: {
check: function(cb, newValue) {
if (newValue) {
Ext.getCmp('append_extension').setDisabled(newValue);
Ext.getCmp('copy_torrent').setDisabled(!newValue);
Ext.getCmp('delete_copy_torrent_toggle').setDisabled(!newValue);
Ext.getCmp(
'append_extension'
).setDisabled(newValue);
Ext.getCmp(
'copy_torrent'
).setDisabled(
!newValue
);
Ext.getCmp(
'delete_copy_torrent_toggle'
).setDisabled(
!newValue
);
}
}
}
}, {
},
},
},
{
xtype: 'textfield',
id: 'copy_torrent',
hideLabel: true,
disabled: true,
style: 'margin-left: 2px',
width: 152
}]
}, {
width: 152,
},
],
},
{
xtype: 'checkbox',
id: 'delete_copy_torrent_toggle',
boxLabel: _('Delete copy of torrent file on remove'),
boxLabel: _(
'Delete copy of torrent file on remove'
),
style: 'margin-left: 10px',
disabled: true
}]
}]
}]
disabled: true,
},
],
},
],
},
],
});
this.downloadFolderFset = new Ext.form.FieldSet({
@ -148,23 +194,28 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
width: '85%',
labelWidth: 1,
items: [{
items: [
{
hideLabel: true,
id: 'download_location_toggle',
xtype: 'checkbox',
boxLabel: _('Set download folder'),
listeners: {
check: function(cb, checked) {
Ext.getCmp('download_location').setDisabled(!checked);
}
}
}, {
Ext.getCmp('download_location').setDisabled(
!checked
);
},
},
},
{
xtype: 'textfield',
id: 'download_location',
hideLabel: true,
width: 304,
disabled: true
}]
disabled: true,
},
],
});
this.moveCompletedFset = new Ext.form.FieldSet({
@ -175,23 +226,28 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
width: '85%',
labelWidth: 1,
items: [{
items: [
{
hideLabel: true,
id: 'move_completed_toggle',
xtype: 'checkbox',
boxLabel: _('Set move completed folder'),
listeners: {
check: function(cb, checked) {
Ext.getCmp('move_completed_path').setDisabled(!checked);
}
}
}, {
Ext.getCmp('move_completed_path').setDisabled(
!checked
);
},
},
},
{
xtype: 'textfield',
id: 'move_completed_path',
hideLabel: true,
width: 304,
disabled: true
}]
disabled: true,
},
],
});
this.LabelFset = new Ext.form.FieldSet({
@ -203,11 +259,13 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
//width: '85%',
labelWidth: 1,
//hidden: true,
items: [{
items: [
{
xtype: 'container',
layout: 'hbox',
hideLabel: true,
items: [{
items: [
{
hashLabel: false,
id: 'label_toggle',
xtype: 'checkbox',
@ -215,9 +273,10 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
listeners: {
check: function(cb, checked) {
Ext.getCmp('label').setDisabled(!checked);
}
}
}, {
},
},
},
{
xtype: 'combo',
id: 'label',
hideLabel: true,
@ -227,9 +286,11 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
style: 'margin-left: 2px',
mode: 'local',
valueField: 'displayText',
displayField: 'displayText'
}]
}]
displayField: 'displayText',
},
],
},
],
});
this.add([
@ -237,7 +298,7 @@ Deluge.ux.AutoAdd.AutoAddMainPanel = Ext.extend(Ext.Panel, {
this.torrentActionFset,
this.downloadFolderFset,
this.moveCompletedFset,
this.LabelFset
])
}
this.LabelFset,
]);
},
});

View file

@ -20,30 +20,32 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
title: _('Options'),
initComponent: function() {
Deluge.ux.AutoAdd.AutoAddOptionsPanel.superclass.initComponent.call(this);
Deluge.ux.AutoAdd.AutoAddOptionsPanel.superclass.initComponent.call(
this
);
var maxDownload = {
idCheckbox: 'max_download_speed_toggle',
labelCheckbox: 'Max Download Speed (KiB/s):',
idSpinner: 'max_download_speed',
decimalPrecision: 1
decimalPrecision: 1,
};
var maxUploadSpeed = {
idCheckbox: 'max_upload_speed_toggle',
labelCheckbox: 'Max upload Speed (KiB/s):',
idSpinner: 'max_upload_speed',
decimalPrecision: 1
decimalPrecision: 1,
};
var maxConnections = {
idCheckbox: 'max_connections_toggle',
labelCheckbox: 'Max Connections::',
idSpinner: 'max_connections',
decimalPrecision: 0
decimalPrecision: 0,
};
var maxUploadSlots = {
idCheckbox: 'max_upload_slots_toggle',
labelCheckbox: 'Max Upload Slots:',
idSpinner: 'max_upload_slots',
decimalPrecision: 0
decimalPrecision: 0,
};
// queue data
var addPause = {
@ -52,8 +54,8 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
nameRadio: 'add_paused',
labelRadio: {
yes: 'Yes',
no: 'No'
}
no: 'No',
},
};
var queueTo = {
idCheckbox: 'queue_to_top_toggle',
@ -61,8 +63,8 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
nameRadio: 'queue_to_top',
labelRadio: {
yes: 'Top',
no: 'Bottom'
}
no: 'Bottom',
},
};
var autoManaged = {
idCheckbox: 'auto_managed_toggle',
@ -70,8 +72,8 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
nameRadio: 'auto_managed',
labelRadio: {
yes: 'Yes',
no: 'No'
}
no: 'No',
},
};
this.ownerFset = new Ext.form.FieldSet({
@ -81,15 +83,17 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
//width: '85%',
labelWidth: 1,
items: [{
items: [
{
xtype: 'combo',
id: 'owner',
hideLabel: true,
width: 312,
mode: 'local',
valueField: 'displayText',
displayField: 'displayText'
}]
displayField: 'displayText',
},
],
});
this.bandwidthFset = new Ext.form.FieldSet({
@ -100,8 +104,8 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
//width: '85%',
labelWidth: 1,
defaults: {
style: 'margin-bottom: 5px'
}
style: 'margin-bottom: 5px',
},
});
this.bandwidthFset.add(this._getBandwidthContainer(maxDownload));
this.bandwidthFset.add(this._getBandwidthContainer(maxUploadSpeed));
@ -116,13 +120,15 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
//width: '85%',
labelWidth: 1,
defaults: {
style: 'margin-bottom: 5px'
style: 'margin-bottom: 5px',
},
items: [{
items: [
{
xtype: 'container',
layout: 'hbox',
hideLabel: true
}]
hideLabel: true,
},
],
});
this.queueFset.add(this._getQueueContainer(addPause));
this.queueFset.add(this._getQueueContainer(queueTo));
@ -130,11 +136,13 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
this.queueFset.add({
xtype: 'container',
hideLabel: true,
items: [{
items: [
{
xtype: 'container',
layout: 'hbox',
hideLabel: true,
items: [{
items: [
{
xtype: 'checkbox',
id: 'stop_at_ratio_toggle',
boxLabel: _('Stop seed at ratio:'),
@ -142,11 +150,16 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
width: 175,
listeners: {
check: function(cb, checked) {
Ext.getCmp('stop_ratio').setDisabled(!checked);
Ext.getCmp('remove_at_ratio').setDisabled(!checked);
}
}
}, {
Ext.getCmp('stop_ratio').setDisabled(
!checked
);
Ext.getCmp('remove_at_ratio').setDisabled(
!checked
);
},
},
},
{
xtype: 'spinnerfield',
id: 'stop_ratio',
hideLabel: true,
@ -157,53 +170,57 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
decimalPrecision: 1,
incrementValue: 0.1,
style: 'margin-left: 2px',
width: 100
}]
}, {
width: 100,
},
],
},
{
xtype: 'container',
layout: 'hbox',
hideLabel: true,
style: 'margin-left: 10px',
items: [{
items: [
{
xtype: 'checkbox',
id: 'remove_at_ratio',
boxLabel: _('Remove at ratio'),
disabled: true,
checked: true
}, {
checked: true,
},
{
xtype: 'checkbox',
id: 'remove_at_ratio_toggle',
disabled: true,
checked: true,
hidden: true
}, {
hidden: true,
},
{
xtype: 'checkbox',
id: 'stop_ratio_toggle',
disabled: true,
checked: true,
hidden: true
}, {
hidden: true,
},
{
xtype: 'checkbox',
id: 'stop_ratio_toggle',
disabled: true,
checked: true,
hidden: true
}]
}]
hidden: true,
},
],
},
],
});
this.queueFset.add({
xtype: 'checkbox',
id: 'seed_mode',
boxLabel: _('Skip File Hash Check'),
hideLabel: true,
width: 175
width: 175,
});
this.add([
this.ownerFset,
this.bandwidthFset,
this.queueFset
]);
this.add([this.ownerFset, this.bandwidthFset, this.queueFset]);
},
_getBandwidthContainer: function(values) {
@ -211,7 +228,8 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
xtype: 'container',
layout: 'hbox',
hideLabel: true,
items: [{
items: [
{
xtype: 'checkbox',
hideLabel: true,
id: values.idCheckbox,
@ -220,9 +238,10 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
listeners: {
check: function(cb, checked) {
Ext.getCmp(values.idSpinner).setDisabled(!checked);
}
}
}, {
},
},
},
{
xtype: 'spinnerfield',
id: values.idSpinner,
hideLabel: true,
@ -232,8 +251,9 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
value: 0.0,
decimalPrecision: values.decimalPrecision,
style: 'margin-left: 2px',
width: 100
}]
width: 100,
},
],
});
},
@ -242,7 +262,8 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
xtype: 'container',
layout: 'hbox',
hideLabel: true,
items: [{
items: [
{
xtype: 'checkbox',
hideLabel: true,
id: values.idCheckbox,
@ -251,10 +272,13 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
listeners: {
check: function(cb, checked) {
Ext.getCmp(values.nameRadio).setDisabled(!checked);
Ext.getCmp('not_' + values.nameRadio).setDisabled(!checked);
}
}
}, {
Ext.getCmp('not_' + values.nameRadio).setDisabled(
!checked
);
},
},
},
{
xtype: 'radio',
name: values.nameRadio,
id: values.nameRadio,
@ -262,15 +286,17 @@ Deluge.ux.AutoAdd.AutoAddOptionsPanel = Ext.extend(Ext.Panel, {
hideLabel: true,
checked: true,
disabled: true,
width: 50
}, {
width: 50,
},
{
xtype: 'radio',
name: values.nameRadio,
id: 'not_' + values.nameRadio,
boxLabel: _(values.labelRadio.no),
hideLabel: true,
disabled: true
}]
disabled: true,
},
],
});
}
},
});

View file

@ -16,7 +16,6 @@ Ext.ns('Deluge.ux.preferences');
* @extends Ext.Panel
*/
Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
title: _('Blocklist'),
header: false,
layout: 'fit',
@ -34,14 +33,14 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
defaultType: 'textfield',
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
autoWidth: true,
labelWidth: 40
labelWidth: 40,
});
this.URL = this.URLFset.add({
fieldLabel: _('URL:'),
labelSeparator: '',
name: 'url',
width: '80%'
width: '80%',
});
this.SettingsFset = this.add({
@ -52,7 +51,7 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
defaultType: 'spinnerfield',
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
autoWidth: true,
labelWidth: 160
labelWidth: 160,
});
this.checkListDays = this.SettingsFset.add({
@ -61,13 +60,13 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
name: 'check_list_days',
value: 4,
decimalPrecision: 0,
width: 80
width: 80,
});
this.chkImportOnStart = this.SettingsFset.add({
xtype: 'checkbox',
fieldLabel: _('Import blocklist on startup'),
name: 'check_import_startup'
name: 'check_import_startup',
});
this.OptionsFset = this.add({
@ -79,7 +78,7 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
autoWidth: false,
width: '80%',
labelWidth: 0
labelWidth: 0,
});
this.checkDownload = this.OptionsFset.add({
@ -88,18 +87,21 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
xtype: 'container',
layout: 'hbox',
margins: '4 0 0 5',
items: [{
items: [
{
xtype: 'button',
text: ' Check Download and Import ',
scale: 'medium'
}, {
scale: 'medium',
},
{
xtype: 'box',
autoEl: {
tag: 'img',
src: '../icons/ok.png'
src: '../icons/ok.png',
},
margins: '4 0 0 3'
}]
margins: '4 0 0 3',
},
],
});
this.forceDownload = this.OptionsFset.add({
@ -108,7 +110,7 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
text: ' Force Download and Import ',
margins: '2 0 0 0',
//icon: '../icons/blocklist_import24.png',
scale: 'medium'
scale: 'medium',
});
this.ProgressFset = this.add({
@ -120,13 +122,13 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
style: 'margin-top: 1px; margin-bottom: 0px; padding-bottom: 0px;',
autoWidth: true,
labelWidth: 0,
hidden: true
hidden: true,
});
this.downProgBar = this.ProgressFset.add({
fieldLabel: _(''),
name: 'progress_bar',
width: '90%'
width: '90%',
});
this.InfoFset = this.add({
@ -136,31 +138,31 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
autoHeight: true,
defaultType: 'label',
style: 'margin-top: 0px; margin-bottom: 0px; padding-bottom: 0px;',
labelWidth: 60
labelWidth: 60,
});
this.lblFileSize = this.InfoFset.add({
fieldLabel: _('File Size:'),
labelSeparator: '',
name: 'file_size'
name: 'file_size',
});
this.lblDate = this.InfoFset.add({
fieldLabel: _('Date:'),
labelSeparator: '',
name: 'date'
name: 'date',
});
this.lblType = this.InfoFset.add({
fieldLabel: _('Type:'),
labelSeparator: '',
name: 'type'
name: 'type',
});
this.lblURL = this.InfoFset.add({
fieldLabel: _('URL:'),
labelSeparator: '',
name: 'lbl_URL'
name: 'lbl_URL',
});
this.WhitelistFset = this.add({
@ -172,7 +174,8 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
autoWidth: true,
labelWidth: 0,
items: [{
items: [
{
fieldLabel: _(''),
name: 'whitelist',
margins: '2 0 5 5',
@ -181,10 +184,11 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
autoExpandColumn: 'ip',
viewConfig: {
emptyText: _('Add an IP...'),
deferEmptyText: false
deferEmptyText: false,
},
colModel: new Ext.grid.ColumnModel({
columns: [{
columns: [
{
id: 'ip',
header: _('IP'),
dataIndex: 'ip',
@ -192,22 +196,23 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
hideable: false,
editable: true,
editor: {
xtype: 'textfield'
}
}]
xtype: 'textfield',
},
},
],
}),
selModel: new Ext.grid.RowSelectionModel({
singleSelect: false,
moveEditorOnEnter: false
moveEditorOnEnter: false,
}),
store: new Ext.data.ArrayStore({
autoDestroy: true,
fields: [{name: 'ip'}]
fields: [{ name: 'ip' }],
}),
listeners: {
afteredit: function(e) {
e.record.commit();
}
},
},
setEmptyText: function(text) {
if (this.viewReady) {
@ -222,28 +227,32 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
if (this.viewReady) {
this.getView().updateHeaders();
}
}
}]
},
},
],
});
this.ipButtonsContainer = this.WhitelistFset.add({
xtype: 'container',
layout: 'hbox',
margins: '4 0 0 5',
items: [{
items: [
{
xtype: 'button',
text: ' Add IP ',
margins: '0 5 0 0'
},{
margins: '0 5 0 0',
},
{
xtype: 'button',
text: ' Delete IP '
}]
text: ' Delete IP ',
},
],
});
this.updateTask = Ext.TaskMgr.start({
interval: 2000,
run: this.onUpdate,
scope: this
scope: this,
});
this.on('show', this.updateConfig, this);
@ -290,8 +299,13 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
this.forceDownload.setDisabled(true);
this.ProgressFset.show();
this.downProgBar.updateProgress(status['file_progress'],'Downloading '.concat((status['file_progress'] * 100).toFixed(2)).concat('%'),true);
this.downProgBar.updateProgress(
status['file_progress'],
'Downloading '
.concat((status['file_progress'] * 100).toFixed(2))
.concat('%'),
true
);
} else if (status['state'] == 'Importing') {
this.InfoFset.hide();
this.checkDownload.getComponent(0).setDisabled(true);
@ -299,8 +313,9 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
this.forceDownload.setDisabled(true);
this.ProgressFset.show();
this.downProgBar.updateText('Importing '.concat(status['num_blocked']));
this.downProgBar.updateText(
'Importing '.concat(status['num_blocked'])
);
} else if (status['state'] == 'Idle') {
this.ProgressFset.hide();
this.checkDownload.getComponent(0).setDisabled(false);
@ -315,10 +330,12 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
this.lblFileSize.setText(fsize(status['file_size']));
this.lblDate.setText(fdate(status['file_date']));
this.lblType.setText(status['file_type']);
this.lblURL.setText(status['file_url'].substr(0,40).concat('...'));
this.lblURL.setText(
status['file_url'].substr(0, 40).concat('...')
);
}
},
scope: this
scope: this,
});
},
@ -329,7 +346,7 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
forceDown: function() {
this.onApply();
deluge.client.blocklist.check_import(force = true);
deluge.client.blocklist.check_import((force = true));
},
updateConfig: function() {
@ -348,7 +365,7 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
this.WhitelistFset.getComponent(0).loadData(data);
},
scope: this
scope: this,
});
deluge.client.blocklist.get_status({
@ -356,9 +373,11 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
this.lblFileSize.setText(fsize(status['file_size']));
this.lblDate.setText(fdate(status['file_date']));
this.lblType.setText(status['file_type']);
this.lblURL.setText(status['file_url'].substr(0,40).concat('...'));
this.lblURL.setText(
status['file_url'].substr(0, 40).concat('...')
);
},
scope: this
scope: this,
});
},
@ -366,7 +385,7 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
var store = this.WhitelistFset.getComponent(0).getStore();
var IP = store.recordType;
var i = new IP({
ip: ''
ip: '',
});
this.WhitelistFset.getComponent(0).stopEditing();
store.insert(0, i);
@ -374,12 +393,13 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
},
deleteIP: function() {
var selections = this.WhitelistFset.getComponent(0).getSelectionModel().getSelections();
var selections = this.WhitelistFset.getComponent(0)
.getSelectionModel()
.getSelections();
var store = this.WhitelistFset.getComponent(0).getStore();
this.WhitelistFset.getComponent(0).stopEditing();
for (var i = 0; i < selections.length; i++)
store.remove(selections[i]);
for (var i = 0; i < selections.length; i++) store.remove(selections[i]);
store.commitChanges();
},
@ -389,11 +409,10 @@ Deluge.ux.preferences.BlocklistPage = Ext.extend(Ext.Panel, {
deluge.preferences.un('show', this.updateConfig, this);
Deluge.ux.preferences.BlocklistPage.superclass.onDestroy.call(this);
}
},
});
Deluge.plugins.BlocklistPlugin = Ext.extend(Deluge.Plugin, {
name: 'Blocklist',
onDisable: function() {
@ -401,8 +420,10 @@ Deluge.plugins.BlocklistPlugin = Ext.extend(Deluge.Plugin, {
},
onEnable: function() {
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.BlocklistPage());
}
this.prefsPage = deluge.preferences.addPage(
new Deluge.ux.preferences.BlocklistPage()
);
},
});
Deluge.registerPlugin('Blocklist', Deluge.plugins.BlocklistPlugin);

View file

@ -13,7 +13,6 @@
Ext.ns('Deluge.ux');
Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
layout: 'fit',
width: 400,
height: 130,
@ -27,7 +26,8 @@ Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
xtype: 'form',
baseCls: 'x-plain',
bodyStyle: 'padding: 5px',
items: [{
items: [
{
xtype: 'combo',
width: 270,
fieldLabel: _('Event'),
@ -36,38 +36,39 @@ Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
data: [
['complete', _('Torrent Complete')],
['added', _('Torrent Added')],
['removed', _('Torrent Removed')]
]
['removed', _('Torrent Removed')],
],
}),
name: 'event',
mode: 'local',
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
}, {
displayField: 'text',
},
{
xtype: 'textfield',
fieldLabel: _('Command'),
name: 'command',
width: 270
}]
width: 270,
},
],
});
},
onCancelClick: function() {
this.hide();
}
},
});
Deluge.ux.EditExecuteCommandWindow = Ext.extend(Deluge.ux.ExecuteWindowBase, {
title: _('Edit Command'),
initComponent: function() {
Deluge.ux.EditExecuteCommandWindow.superclass.initComponent.call(this);
this.addButton(_('Save'), this.onSaveClick, this);
this.addEvents({
'commandedit': true
commandedit: true,
});
},
@ -76,32 +77,40 @@ Deluge.ux.EditExecuteCommandWindow = Ext.extend(Deluge.ux.ExecuteWindowBase, {
this.command = command;
this.form.getForm().setValues({
event: command.get('event'),
command: command.get('name')
command: command.get('name'),
});
},
onSaveClick: function() {
var values = this.form.getForm().getFieldValues();
deluge.client.execute.save_command(this.command.id, values.event, values.command, {
deluge.client.execute.save_command(
this.command.id,
values.event,
values.command,
{
success: function() {
this.fireEvent('commandedit', this, values.event, values.command);
this.fireEvent(
'commandedit',
this,
values.event,
values.command
);
},
scope: this
});
this.hide();
scope: this,
}
);
this.hide();
},
});
Deluge.ux.AddExecuteCommandWindow = Ext.extend(Deluge.ux.ExecuteWindowBase, {
title: _('Add Command'),
initComponent: function() {
Deluge.ux.AddExecuteCommandWindow.superclass.initComponent.call(this);
this.addButton(_('Add'), this.onAddClick, this);
this.addEvents({
'commandadd': true
commandadd: true,
});
},
@ -109,13 +118,17 @@ Deluge.ux.AddExecuteCommandWindow = Ext.extend(Deluge.ux.ExecuteWindowBase, {
var values = this.form.getForm().getFieldValues();
deluge.client.execute.add_command(values.event, values.command, {
success: function() {
this.fireEvent('commandadd', this, values.event, values.command);
this.fireEvent(
'commandadd',
this,
values.event,
values.command
);
},
scope: this
scope: this,
});
this.hide();
}
},
});
Ext.ns('Deluge.ux.preferences');
@ -125,7 +138,6 @@ Ext.ns('Deluge.ux.preferences');
* @extends Ext.Panel
*/
Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
title: _('Execute'),
header: false,
layout: 'fit',
@ -133,63 +145,71 @@ 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')
};
var event_map = (this.event_map = {
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}
{ name: 'name', mapping: 2 },
],
id: 0
id: 0,
}),
columns: [{
width: .3,
columns: [
{
width: 0.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;
}
})
}, {
return event_map[e] ? event_map[e] : e;
},
}),
},
{
id: 'name',
header: _('Command'),
sortable: true,
dataIndex: 'name'
}],
dataIndex: 'name',
},
],
singleSelect: true,
autoExpandColumn: 'name'
autoExpandColumn: 'name',
});
this.list.on('selectionchange', this.onSelectionChange, this);
this.panel = this.add({
items: [this.list],
bbar: {
items: [{
items: [
{
text: _('Add'),
iconCls: 'icon-add',
handler: this.onAddClick,
scope: this
}, {
scope: this,
},
{
text: _('Edit'),
iconCls: 'icon-edit',
handler: this.onEditClick,
scope: this,
disabled: true
}, '->', {
disabled: true,
},
'->',
{
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onRemoveClick,
scope: this,
disabled: true
}]
}
disabled: true,
},
],
},
});
this.on('show', this.onPreferencesShow, this);
@ -200,16 +220,20 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
success: function(commands) {
this.list.getStore().loadData(commands);
},
scope: this
scope: this,
});
},
onAddClick: function() {
if (!this.addWin) {
this.addWin = new Deluge.ux.AddExecuteCommandWindow();
this.addWin.on('commandadd', function() {
this.addWin.on(
'commandadd',
function() {
this.updateCommands();
}, this);
},
this
);
}
this.addWin.show();
},
@ -217,16 +241,20 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
onCommandAdded: function(win, evt, cmd) {
var record = new this.list.getStore().recordType({
event: evt,
command: cmd
command: cmd,
});
},
onEditClick: function() {
if (!this.editWin) {
this.editWin = new Deluge.ux.EditExecuteCommandWindow();
this.editWin.on('commandedit', function() {
this.editWin.on(
'commandedit',
function() {
this.updateCommands();
}, this);
},
this
);
}
this.editWin.show(this.list.getSelectedRecords()[0]);
},
@ -241,23 +269,34 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
success: function() {
this.updateCommands();
},
scope: this
scope: this,
});
},
onSelectionChange: function(dv, selections) {
if (selections.length) {
this.panel.getBottomToolbar().items.get(1).enable();
this.panel.getBottomToolbar().items.get(3).enable();
this.panel
.getBottomToolbar()
.items.get(1)
.enable();
this.panel
.getBottomToolbar()
.items.get(3)
.enable();
} else {
this.panel.getBottomToolbar().items.get(1).disable();
this.panel.getBottomToolbar().items.get(3).disable();
}
this.panel
.getBottomToolbar()
.items.get(1)
.disable();
this.panel
.getBottomToolbar()
.items.get(3)
.disable();
}
},
});
Deluge.plugins.ExecutePlugin = Ext.extend(Deluge.Plugin, {
name: 'Execute',
onDisable: function() {
@ -265,7 +304,9 @@ Deluge.plugins.ExecutePlugin = Ext.extend(Deluge.Plugin, {
},
onEnable: function() {
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.ExecutePage());
}
this.prefsPage = deluge.preferences.addPage(
new Deluge.ux.preferences.ExecutePage()
);
},
});
Deluge.registerPlugin('Execute', Deluge.plugins.ExecutePlugin);

View file

@ -16,7 +16,6 @@ Ext.ns('Deluge.ux.preferences');
* @extends Ext.Panel
*/
Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
title: _('Extractor'),
header: false,
layout: 'fit',
@ -29,7 +28,7 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
xtype: 'form',
layout: 'form',
border: false,
autoHeight: true
autoHeight: true,
});
fieldset = this.form.add({
@ -39,23 +38,22 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
autoHeight: true,
labelAlign: 'top',
labelWidth: 80,
defaultType: 'textfield'
defaultType: 'textfield',
});
this.extract_path = fieldset.add({
fieldLabel: _('Extract to:'),
labelSeparator: '',
name: 'extract_path',
width: '97%'
width: '97%',
});
this.use_name_folder = fieldset.add({
xtype: 'checkbox',
name: 'use_name_folder',
height: 22,
hideLabel: true,
boxLabel: _('Create torrent name sub-folder')
boxLabel: _('Create torrent name sub-folder'),
});
this.on('show', this.updateConfig, this);
@ -81,14 +79,12 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
this.extract_path.setValue(config['extract_path']);
this.use_name_folder.setValue(config['use_name_folder']);
},
scope: this
scope: this,
});
}
},
});
Deluge.plugins.ExtractorPlugin = Ext.extend(Deluge.Plugin, {
name: 'Extractor',
onDisable: function() {
@ -96,7 +92,9 @@ Deluge.plugins.ExtractorPlugin = Ext.extend(Deluge.Plugin, {
},
onEnable: function() {
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.ExtractorPage());
}
this.prefsPage = deluge.preferences.addPage(
new Deluge.ux.preferences.ExtractorPage()
);
},
});
Deluge.registerPlugin('Extractor', Deluge.plugins.ExtractorPlugin);

View file

@ -16,7 +16,6 @@ Ext.ns('Deluge.ux.preferences');
* @extends Ext.Panel
*/
Deluge.ux.preferences.LabelPage = Ext.extend(Ext.Panel, {
title: _('Label'),
layout: 'fit',
border: false,
@ -29,20 +28,20 @@ Deluge.ux.preferences.LabelPage = Ext.extend(Ext.Panel, {
title: _('Label Preferences'),
autoHeight: true,
labelWidth: 1,
defaultType: 'panel'
defaultType: 'panel',
});
fieldset.add({
border: false,
bodyCfg: {
html: _('<p>The Label plugin is enabled.</p><br>' +
html: _(
'<p>The Label plugin is enabled.</p><br>' +
'<p>To add, remove or edit labels right-click on the Label filter ' +
'entry in the sidebar.</p><br>' +
'<p>To apply a label right-click on torrent(s).<p>')
}
});
'<p>To apply a label right-click on torrent(s).<p>'
),
},
});
},
});
Ext.ns('Deluge.ux');
@ -52,7 +51,6 @@ Ext.ns('Deluge.ux');
* @extends Ext.Window
*/
Deluge.ux.AddLabelWindow = Ext.extend(Ext.Window, {
title: _('Add Label'),
width: 300,
height: 100,
@ -69,20 +67,22 @@ Deluge.ux.AddLabelWindow = Ext.extend(Ext.Window, {
bodyStyle: 'padding:5px 5px 0',
defaultType: 'textfield',
labelWidth: 50,
items: [{
items: [
{
fieldLabel: _('Name'),
name: 'name',
allowBlank: false,
width: 220,
listeners: {
'specialkey': {
specialkey: {
fn: function(field, e) {
if (e.getKey() == 13) this.onOkClick();
},
scope: this
}
}
}]
scope: this,
},
},
},
],
});
},
@ -97,7 +97,7 @@ Deluge.ux.AddLabelWindow = Ext.extend(Ext.Window, {
deluge.ui.update();
this.fireEvent('labeladded', label);
},
scope: this
scope: this,
});
this.hide();
},
@ -109,9 +109,11 @@ Deluge.ux.AddLabelWindow = Ext.extend(Ext.Window, {
onShow: function(comp) {
Deluge.ux.AddLabelWindow.superclass.onShow.call(this, comp);
this.form.getForm().findField('name').focus(false, 150);
}
this.form
.getForm()
.findField('name')
.focus(false, 150);
},
});
/**
@ -119,7 +121,6 @@ Deluge.ux.AddLabelWindow = Ext.extend(Ext.Window, {
* @extends Ext.Window
*/
Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
title: _('Label Options'),
width: 325,
height: 240,
@ -130,136 +131,178 @@ Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
this.addButton(_('Ok'), this.onOkClick, this);
this.form = this.add({
xtype: 'form'
xtype: 'form',
});
this.tabs = this.form.add({
xtype: 'tabpanel',
height: 175,
border: false,
items: [{
items: [
{
title: _('Maximum'),
items: [{
items: [
{
border: false,
items: [{
items: [
{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
style:
'margin-bottom: 0px; padding-bottom: 0px;',
items: [
{
xtype: 'checkbox',
name: 'apply_max',
fieldLabel: '',
boxLabel: _('Apply per torrent max settings:'),
boxLabel: _(
'Apply per torrent max settings:'
),
listeners: {
check: this.onFieldChecked
}
}]
}, {
check: this.onFieldChecked,
},
},
],
},
{
xtype: 'fieldset',
border: false,
defaultType: 'spinnerfield',
style: 'margin-top: 0px; padding-top: 0px;',
items: [{
items: [
{
fieldLabel: _('Download Speed'),
name: 'max_download_speed',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
minValue: -1,
},
{
fieldLabel: _('Upload Speed'),
name: 'max_upload_speed',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
minValue: -1,
},
{
fieldLabel: _('Upload Slots'),
name: 'max_upload_slots',
width: 80,
disabled: true,
value: -1,
minValue: -1
}, {
minValue: -1,
},
{
fieldLabel: _('Connections'),
name: 'max_connections',
width: 80,
disabled: true,
value: -1,
minValue: -1
}]
}]
}]
}, {
minValue: -1,
},
],
},
],
},
],
},
{
title: _('Queue'),
items: [{
items: [
{
border: false,
items: [{
items: [
{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
style:
'margin-bottom: 0px; padding-bottom: 0px;',
items: [
{
xtype: 'checkbox',
name: 'apply_queue',
fieldLabel: '',
boxLabel: _('Apply queue settings:'),
boxLabel: _(
'Apply queue settings:'
),
listeners: {
check: this.onFieldChecked
}
}]
}, {
check: this.onFieldChecked,
},
},
],
},
{
xtype: 'fieldset',
border: false,
labelWidth: 1,
defaultType: 'checkbox',
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
style: 'margin-left: 20px',
},
items: [{
items: [
{
boxLabel: _('Auto Managed'),
name: 'is_auto_managed',
disabled: true
}, {
disabled: true,
},
{
boxLabel: _('Stop seed at ratio:'),
name: 'stop_at_ratio',
disabled: true
}, {
disabled: true,
},
{
xtype: 'spinnerfield',
name: 'stop_ratio',
width: 60,
decimalPrecision: 2,
incrementValue: 0.1,
style: 'position: relative; left: 100px',
disabled: true
}, {
style:
'position: relative; left: 100px',
disabled: true,
},
{
boxLabel: _('Remove at ratio'),
name: 'remove_at_ratio',
disabled: true
}]
}]
}]
}, {
disabled: true,
},
],
},
],
},
],
},
{
title: _('Folders'),
items: [{
items: [
{
border: false,
items: [{
items: [
{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
style:
'margin-bottom: 0px; padding-bottom: 0px;',
items: [
{
xtype: 'checkbox',
name: 'apply_move_completed',
fieldLabel: '',
boxLabel: _('Apply folder settings:'),
boxLabel: _(
'Apply folder settings:'
),
listeners: {
check: this.onFieldChecked
}
}]
}, {
check: this.onFieldChecked,
},
},
],
},
{
xtype: 'fieldset',
border: false,
labelWidth: 1,
@ -267,64 +310,83 @@ Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
labelWidth: 1,
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
style: 'margin-left: 20px',
},
items: [{
items: [
{
boxLabel: _('Move completed to:'),
name: 'move_completed',
disabled: true
}, {
disabled: true,
},
{
xtype: 'textfield',
name: 'move_completed_path',
width: 250,
disabled: true
}]
}]
}]
}, {
disabled: true,
},
],
},
],
},
],
},
{
title: _('Trackers'),
items: [{
items: [
{
border: false,
items: [{
items: [
{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
items: [{
style:
'margin-bottom: 0px; padding-bottom: 0px;',
items: [
{
xtype: 'checkbox',
name: 'auto_add',
fieldLabel: '',
boxLabel: _('Automatically apply label:'),
boxLabel: _(
'Automatically apply label:'
),
listeners: {
check: this.onFieldChecked
}
}]
}, {
check: this.onFieldChecked,
},
},
],
},
{
xtype: 'fieldset',
border: false,
labelWidth: 1,
style: 'margin-top: 0px; padding-top: 0px;',
defaults: {
style: 'margin-left: 20px'
style: 'margin-left: 20px',
},
defaultType: 'textarea',
items: [{
items: [
{
boxLabel: _('Move completed to:'),
name: 'auto_add_trackers',
width: 250,
height: 100,
disabled: true
}]
}]
}]
}]
disabled: true,
},
],
},
],
},
],
},
],
});
},
getLabelOptions: function() {
deluge.client.label.get_options(this.label, {
success: this.gotOptions,
scope: this
scope: this,
});
},
@ -347,7 +409,9 @@ Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
onOkClick: function() {
var values = this.form.getForm().getFieldValues();
if (values['auto_add_trackers']) {
values['auto_add_trackers'] = values['auto_add_trackers'].split('\n');
values['auto_add_trackers'] = values['auto_add_trackers'].split(
'\n'
);
}
deluge.client.label.set_options(this.label, values);
this.hide();
@ -358,11 +422,9 @@ Deluge.ux.LabelOptionsWindow = Ext.extend(Ext.Window, {
fs.items.each(function(field) {
field.setDisabled(!checked);
});
}
},
});
Ext.ns('Deluge.plugins');
/**
@ -370,28 +432,31 @@ Ext.ns('Deluge.plugins');
* @extends Deluge.Plugin
*/
Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
name: 'Label',
createMenu: function() {
this.labelMenu = new Ext.menu.Menu({
items: [{
items: [
{
text: _('Add Label'),
iconCls: 'icon-add',
handler: this.onLabelAddClick,
scope: this
}, {
scope: this,
},
{
text: _('Remove Label'),
disabled: true,
iconCls: 'icon-remove',
handler: this.onLabelRemoveClick,
scope: this
}, {
scope: this,
},
{
text: _('Label Options'),
disabled: true,
handler: this.onLabelOptionsClick,
scope: this
}]
scope: this,
},
],
});
},
@ -409,7 +474,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
text: _('No Label'),
label: '',
handler: this.onTorrentMenuClick,
scope: this
scope: this,
});
for (var state in states) {
if (!state || state == 'All') continue;
@ -417,7 +482,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
text: state,
label: state,
handler: this.onTorrentMenuClick,
scope: this
scope: this,
});
}
},
@ -433,19 +498,22 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
},
onEnable: function() {
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.LabelPage());
this.prefsPage = deluge.preferences.addPage(
new Deluge.ux.preferences.LabelPage()
);
this.torrentMenu = new Ext.menu.Menu();
this.tmSep = deluge.menus.torrent.add({
xtype: 'menuseparator'
xtype: 'menuseparator',
});
this.tm = deluge.menus.torrent.add({
text: _('Label'),
menu: this.torrentMenu
menu: this.torrentMenu,
});
var lbltpl = '<div class="x-deluge-filter">' +
var lbltpl =
'<div class="x-deluge-filter">' +
'<tpl if="filter">{filter}</tpl>' +
'<tpl if="!filter">No Label</tpl>' +
' ({count})' +
@ -459,7 +527,11 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
filter.list.refresh();
} else {
deluge.sidebar.on('filtercreate', this.onFilterCreate, this);
deluge.sidebar.on('afterfiltercreate', this.onAfterFilterCreate, this);
deluge.sidebar.on(
'afterfiltercreate',
this.onAfterFilterCreate,
this
);
Deluge.FilterPanel.templates.label = lbltpl;
}
this.registerTorrentStatus('label', _('Label'));
@ -499,7 +571,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
//console.log(states);
//console.log(statesArray);
states = {}
states = {};
for (i = 0; i < statesArray.length; ++i) {
states[statesArray[i]] = 0;
@ -532,7 +604,8 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
},
onLabelOptionsClick: function() {
if (!this.labelOpts) this.labelOpts = new Deluge.ux.LabelOptionsWindow();
if (!this.labelOpts)
this.labelOpts = new Deluge.ux.LabelOptionsWindow();
this.labelOpts.show(this.filter.getState());
},
@ -547,7 +620,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
var i = item;
}, this);
},
scope: this
scope: this,
});
},
@ -558,12 +631,12 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
deluge.client.label.set_torrent(id, item.label, {
success: function() {
deluge.ui.update();
}
},
});
} else {
deluge.client.label.set_torrent(id, item.label);
}
});
}
},
});
Deluge.registerPlugin('Label', Deluge.plugins.LabelPlugin);

View file

@ -16,14 +16,15 @@ Ext.ns('Deluge.ux.preferences');
* @extends Ext.Panel
*/
Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
title: _('Notifications'),
header: false,
layout: 'fit',
border: false,
initComponent: function() {
Deluge.ux.preferences.NotificationsPage.superclass.initComponent.call(this);
Deluge.ux.preferences.NotificationsPage.superclass.initComponent.call(
this
);
this.emailNotiFset = new Ext.form.FieldSet({
xtype: 'fieldset',
@ -33,7 +34,7 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
defaultType: 'textfield',
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
width: '85%',
labelWidth: 1
labelWidth: 1,
});
this.chkEnableEmail = this.emailNotiFset.add({
@ -46,8 +47,8 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
check: function(object, checked) {
this.setSmtpDisabled(!checked);
},
scope: this
}
scope: this,
},
});
this.hBoxHost = this.emailNotiFset.add({
@ -57,14 +58,17 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
xtype: 'container',
layout: 'hbox',
disabled: true,
items: [{
items: [
{
xtype: 'label',
text: _('Hostname:'),
margins: '6 0 0 6'
},{
margins: '6 0 0 6',
},
{
xtype: 'textfield',
margins: '2 0 0 4'
}]
margins: '2 0 0 4',
},
],
});
this.hBoxPort = this.emailNotiFset.add({
@ -74,18 +78,21 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
xtype: 'container',
layout: 'hbox',
disabled: true,
items: [{
items: [
{
xtype: 'label',
text: _('Port:'),
margins: '6 0 0 6'
},{
margins: '6 0 0 6',
},
{
xtype: 'spinnerfield',
margins: '2 0 0 34',
width: 64,
decimalPrecision: 0,
minValue: 0,
maxValue: 65535
}]
maxValue: 65535,
},
],
});
this.hBoxUser = this.emailNotiFset.add({
@ -95,14 +102,17 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
xtype: 'container',
layout: 'hbox',
disabled: true,
items: [{
items: [
{
xtype: 'label',
text: _('Username:'),
margins: '6 0 0 6'
},{
margins: '6 0 0 6',
},
{
xtype: 'textfield',
margins: '2 0 0 3'
}]
margins: '2 0 0 3',
},
],
});
this.hBoxPassword = this.emailNotiFset.add({
@ -112,15 +122,18 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
xtype: 'container',
layout: 'hbox',
disabled: true,
items: [{
items: [
{
xtype: 'label',
text: _('Password:'),
margins: '6 0 0 6'
},{
margins: '6 0 0 6',
},
{
xtype: 'textfield',
inputType: 'password',
margins: '2 0 0 5'
}]
margins: '2 0 0 5',
},
],
});
this.hBoxFrom = this.emailNotiFset.add({
@ -130,14 +143,17 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
xtype: 'container',
layout: 'hbox',
disabled: true,
items: [{
items: [
{
xtype: 'label',
text: _('From:'),
margins: '6 0 0 6'
},{
margins: '6 0 0 6',
},
{
xtype: 'textfield',
margins: '2 0 0 28'
}]
margins: '2 0 0 28',
},
],
});
this.chkTLS = this.emailNotiFset.add({
@ -146,7 +162,7 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
name: 'enable_tls_ssl',
xtype: 'checkbox',
disabled: true,
boxLabel: _('Server requires TLS/SSL')
boxLabel: _('Server requires TLS/SSL'),
});
this.recipientsFset = new Ext.form.FieldSet({
@ -157,7 +173,8 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
defaultType: 'editorgrid',
style: 'margin-top: 3px; margin-bottom: 0px; padding-bottom: 0px;',
autoWidth: true,
items: [{
items: [
{
fieldLabel: '',
name: 'recipients',
margins: '2 0 5 5',
@ -167,24 +184,28 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
disabled: true,
autoExpandColumn: 'recipient',
bbar: {
items: [{
items: [
{
text: _('Add'),
iconCls: 'icon-add',
handler: this.onAddClick,
scope: this
},{
scope: this,
},
{
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onRemoveClick,
scope: this
}]
scope: this,
},
],
},
viewConfig: {
emptyText: _('Add an recipient...'),
deferEmptyText: false
deferEmptyText: false,
},
colModel: new Ext.grid.ColumnModel({
columns: [{
columns: [
{
id: 'recipient',
header: _('Recipient'),
dataIndex: 'recipient',
@ -192,22 +213,23 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
hideable: false,
editable: true,
editor: {
xtype: 'textfield'
}
}]
xtype: 'textfield',
},
},
],
}),
selModel: new Ext.grid.RowSelectionModel({
singleSelect: false,
moveEditorOnEnter: false
moveEditorOnEnter: false,
}),
store: new Ext.data.ArrayStore({
autoDestroy: true,
fields: [{name: 'recipient'}]
fields: [{ name: 'recipient' }],
}),
listeners: {
afteredit: function(e) {
e.record.commit();
}
},
},
setEmptyText: function(text) {
if (this.viewReady) {
@ -222,8 +244,9 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
if (this.viewReady) {
this.getView().updateHeaders();
}
}
}]
},
},
],
});
this.edGridSubs = new Ext.grid.EditorGridPanel({
@ -232,43 +255,59 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
autoExpandColumn: 'event',
viewConfig: {
emptyText: _('Loading events...'),
deferEmptyText: false
deferEmptyText: false,
},
colModel: new Ext.grid.ColumnModel({
defaults: {
renderer: function(value, meta, record, rowIndex, colIndex, store) {
renderer: function(
value,
meta,
record,
rowIndex,
colIndex,
store
) {
if (Ext.isNumber(value) && parseInt(value) !== value) {
return value.toFixed(6);
} else if (Ext.isBoolean(value)) {
return '<div class="x-grid3-check-col' + (value ? '-on' : '') +
'" style="width: 20px;">&#160;</div>';
return (
'<div class="x-grid3-check-col' +
(value ? '-on' : '') +
'" style="width: 20px;">&#160;</div>'
);
}
return value;
}
},
columns: [{
},
columns: [
{
id: 'event',
header: 'Event',
dataIndex: 'event',
sortable: true,
hideable: false
},{
hideable: false,
},
{
id: 'email',
header: _('Email'),
dataIndex: 'email',
sortable: true,
hideable: false,
menuDisabled: true,
width: 40
}]
width: 40,
},
],
}),
store: new Ext.data.ArrayStore({
autoDestroy: true,
fields: [{
name: 'event'
},{
name: 'email'
}]
fields: [
{
name: 'event',
},
{
name: 'email',
},
],
}),
listeners: {
cellclick: function(grid, rowIndex, colIndex, e) {
@ -292,7 +331,7 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
},
afteredit: function(e) {
e.record.commit();
}
},
},
setEmptyText: function(text) {
if (this.viewReady) {
@ -313,20 +352,23 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
if (this.viewReady) {
this.getView().updateHeaders();
}
}
},
});
this.tabPanSettings = this.add({
xtype: 'tabpanel',
activeTab: 0,
items: [{
items: [
{
title: _('Settings'),
items: [this.emailNotiFset, this.recipientsFset],
autoScroll: true
},{
autoScroll: true,
},
{
title: _('Subscriptions'),
items: this.edGridSubs
}]
items: this.edGridSubs,
},
],
});
this.on('show', this.updateConfig, this);
@ -343,7 +385,7 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
}
this.edGridSubs.loadData(data);
},
scope: this
scope: this,
});
deluge.client.notifications.get_config({
success: function(config) {
@ -369,10 +411,12 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
keys = Ext.keys(config['subscriptions']['email']);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
this.edGridSubs.setSub(config['subscriptions']['email'][key]);
this.edGridSubs.setSub(
config['subscriptions']['email'][key]
);
}
},
scope: this
scope: this,
});
},
@ -425,7 +469,7 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
var store = this.recipientsFset.getComponent(0).getStore();
var Recipient = store.recordType;
var i = new Recipient({
recipient: ''
recipient: '',
});
this.recipientsFset.getComponent(0).stopEditing();
store.insert(0, i);
@ -433,12 +477,14 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
},
onRemoveClick: function() {
var selections = this.recipientsFset.getComponent(0).getSelectionModel().getSelections();
var selections = this.recipientsFset
.getComponent(0)
.getSelectionModel()
.getSelections();
var store = this.recipientsFset.getComponent(0).getStore();
this.recipientsFset.getComponent(0).stopEditing();
for (var i = 0; i < selections.length; i++)
store.remove(selections[i]);
for (var i = 0; i < selections.length; i++) store.remove(selections[i]);
store.commitChanges();
},
@ -456,8 +502,7 @@ Deluge.ux.preferences.NotificationsPage = Ext.extend(Ext.Panel, {
deluge.preferences.un('show', this.updateConfig, this);
Deluge.ux.preferences.NotificationsPage.superclass.onDestroy.call(this);
}
},
});
Deluge.plugins.NotificationsPlugin = Ext.extend(Deluge.Plugin, {
@ -468,8 +513,10 @@ Deluge.plugins.NotificationsPlugin = Ext.extend(Deluge.Plugin, {
},
onEnable: function() {
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.NotificationsPage());
}
this.prefsPage = deluge.preferences.addPage(
new Deluge.ux.preferences.NotificationsPage()
);
},
});
Deluge.registerPlugin('Notifications', Deluge.plugins.NotificationsPlugin);

View file

@ -13,7 +13,6 @@
Ext.ns('Deluge.ux');
Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
title: _('Schedule'),
autoHeight: true,
style: 'margin-bottom: 0px; padding-bottom: 0px;',
@ -24,20 +23,20 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
name: 'Normal',
backgroundColor: 'LightGreen',
borderColor: 'DarkGreen',
value: 0
value: 0,
},
{
name: 'Throttled',
backgroundColor: 'Yellow',
borderColor: 'Gold',
value: 1
value: 1,
},
{
name: 'Paused',
backgroundColor: 'OrangeRed',
borderColor: 'FireBrick',
value: 2
}
value: 2,
},
],
daysOfWeek: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
@ -71,7 +70,8 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
// create state brushes
// tack a random number to the end to avoid clashes
this.stateBrushName = 'schedule-state-brush-' + Math.round(Math.random() * 10000);
this.stateBrushName =
'schedule-state-brush-' + Math.round(Math.random() * 10000);
var el1 = createEl(dom, 'div');
@ -124,11 +124,16 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
// cache access to cells for easier access later
this.scheduleCells = {};
Ext.each(this.daysOfWeek, function(day) {
Ext.each(
this.daysOfWeek,
function(day) {
var cells = [];
var row = createEl(table, 'tr');
var label = createEl(row, 'th');
label.setAttribute('style', 'font-weight: bold; padding-right: 5px;');
label.setAttribute(
'style',
'font-weight: bold; padding-right: 5px;'
);
label.appendChild(document.createTextNode(day));
for (var hour = 0; hour < 24; hour++) {
var cell = createEl(row, 'td');
@ -143,7 +148,8 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
cell.style.border = '1px solid #999999';
// don't repeat borders in between cells
if (hour != 23) // not the last cell
if (hour != 23)
// not the last cell
cell.style.borderRight = 'none';
this.updateCell(cell);
@ -164,7 +170,9 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
createEl(row, 'td').height = '3px';
this.scheduleCells[day] = cells;
}, this);
},
this
);
},
updateCell: function(cell) {
@ -182,10 +190,11 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
getCurrentBrushValue: function() {
var v = null;
var brushes = Ext.get(this.body.dom).findParent('form').elements[this.stateBrushName];
var brushes = Ext.get(this.body.dom).findParent('form').elements[
this.stateBrushName
];
Ext.each(brushes, function(b) {
if (b.checked)
v = b.value;
if (b.checked) v = b.value;
});
return v;
@ -209,8 +218,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
this.confirmCells(cell.day, this.dragAnchor.hour, cell.hour);
else if (cell.hour < this.dragAnchor.hour)
this.confirmCells(cell.day, cell.hour, this.dragAnchor.hour);
else
this.confirmCells(cell.day, cell.hour, cell.hour);
else this.confirmCells(cell.day, cell.hour, cell.hour);
this.hideCellLeftTooltip();
this.hideCellRightTooltip();
@ -224,10 +232,11 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
// otherwise if dragging, leave it alone unless we're dragging to the left.
// if we're not dragging, show it.
var leftTooltipCell = null;
if (!this.dragAnchor)
leftTooltipCell = cell;
else if ((this.dragAnchor && this.isCellLeftTooltipHidden()) ||
(this.dragAnchor && this.dragAnchor.hour > cell.hour))
if (!this.dragAnchor) leftTooltipCell = cell;
else if (
(this.dragAnchor && this.isCellLeftTooltipHidden()) ||
(this.dragAnchor && this.dragAnchor.hour > cell.hour)
)
leftTooltipCell = this.dragAnchor;
if (leftTooltipCell) {
@ -238,23 +247,27 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
if (hour >= 12) {
pm = true;
if (hour > 12) hour -= 12;
}
else if (hour == 0) {
} else if (hour == 0) {
// change 0 hour to 12am
hour = 12;
}
this.showCellLeftTooltip(hour + ' ' + (pm ? 'pm' : 'am'), leftTooltipCell);
this.showCellLeftTooltip(
hour + ' ' + (pm ? 'pm' : 'am'),
leftTooltipCell
);
}
// RIGHT TOOL TIP
var rightTooltipCell = null;
if (this.dragAnchor) {
if (this.dragAnchor.hour == cell.hour)
this.hideCellRightTooltip();
else if (this.dragAnchor.hour > cell.hour && this.isCellRightTooltipHidden())
if (this.dragAnchor.hour == cell.hour) this.hideCellRightTooltip();
else if (
this.dragAnchor.hour > cell.hour &&
this.isCellRightTooltipHidden()
)
rightTooltipCell = this.dragAnchor;
else // cell.hour > this.dragAnchor.hour
rightTooltipCell = cell;
// cell.hour > this.dragAnchor.hour
else rightTooltipCell = cell;
}
if (rightTooltipCell) {
@ -265,12 +278,14 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
if (hour >= 12) {
pm = true;
if (hour > 12) hour -= 12;
}
else if (hour == 0) {
} else if (hour == 0) {
// change 0 hour to 12am
hour = 12;
}
this.showCellRightTooltip(hour + ' ' + (pm ? 'pm' : 'am'), rightTooltipCell);
this.showCellRightTooltip(
hour + ' ' + (pm ? 'pm' : 'am'),
rightTooltipCell
);
}
// preview colour change and
@ -278,39 +293,38 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
if (this.dragAnchor) {
if (cell.day != this.dragAnchor.day) {
// dragged into another day. Abort! Abort!
Ext.each(this.daysOfWeek, function(day) {
Ext.each(
this.daysOfWeek,
function(day) {
this.revertCells(day, 0, 23);
}, this);
},
this
);
this.dragAnchor = null;
this.hideCellLeftTooltip();
this.hideCellRightTooltip();
}
else if (cell.hour > this.dragAnchor.hour) {
} else if (cell.hour > this.dragAnchor.hour) {
// dragging right
this.revertCells(cell.day, cell.hour + 1, 23);
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
this.revertCells(cell.day, 0, cell.hour - 1);
this.previewCells(cell.day, cell.hour, this.dragAnchor.hour);
}
else {
} 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);
}
}
else {
} else {
// not dragging, just preview this cell
this.previewCells(cell.day, cell.hour, cell.hour);
}
},
onCellMouseOut: function(event, cell) {
if (!this.dragAnchor)
this.hideCellLeftTooltip();
if (!this.dragAnchor) this.hideCellLeftTooltip();
// revert state. If new state has been set, old and new will be equal.
// if dragging, this will be handled by the next mouse over
@ -395,8 +409,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
isCellLeftTooltipHidden: function() {
if (this.cellLeftTooltip)
return this.cellLeftTooltip.style.visibility == 'hidden';
else
return true;
else return true;
},
showCellRightTooltip: function(text, cell) {
@ -437,8 +450,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
isCellRightTooltipHidden: function() {
if (this.cellRightTooltip)
return this.cellRightTooltip.style.visibility == 'hidden';
else
return true;
else return true;
},
getConfig: function() {
@ -448,7 +460,9 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
var hourConfig = [0, 0, 0, 0, 0, 0, 0];
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
);
}
config.push(hourConfig);
@ -471,13 +485,12 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
this.updateCell(cell);
}
}
}
},
});
Ext.ns('Deluge.ux.preferences');
Deluge.ux.preferences.SchedulerPage = Ext.extend(Ext.Panel, {
border: false,
title: _('Scheduler'),
header: false,
@ -490,7 +503,7 @@ Deluge.ux.preferences.SchedulerPage = Ext.extend(Ext.Panel, {
xtype: 'form',
layout: 'form',
border: false,
autoHeight: true
autoHeight: true,
});
this.schedule = this.form.add(new Deluge.ux.ScheduleSelector());
@ -503,10 +516,10 @@ Deluge.ux.preferences.SchedulerPage = Ext.extend(Ext.Panel, {
defaultType: 'spinnerfield',
defaults: {
minValue: -1,
maxValue: 99999
maxValue: 99999,
},
style: 'margin-top: 5px; margin-bottom: 0px; padding-bottom: 0px;',
labelWidth: 200
labelWidth: 200,
});
this.downloadLimit = this.slowSettings.add({
@ -514,42 +527,46 @@ Deluge.ux.preferences.SchedulerPage = Ext.extend(Ext.Panel, {
name: 'download_limit',
width: 80,
value: -1,
decimalPrecision: 0
decimalPrecision: 0,
});
this.uploadLimit = this.slowSettings.add({
fieldLabel: _('Maximum Upload Speed (KiB/s)'),
name: 'upload_limit',
width: 80,
value: -1,
decimalPrecision: 0
decimalPrecision: 0,
});
this.activeTorrents = this.slowSettings.add({
fieldLabel: _('Active Torrents'),
name: 'active_torrents',
width: 80,
value: -1,
decimalPrecision: 0
decimalPrecision: 0,
});
this.activeDownloading = this.slowSettings.add({
fieldLabel: _('Active Downloading'),
name: 'active_downloading',
width: 80,
value: -1,
decimalPrecision: 0
decimalPrecision: 0,
});
this.activeSeeding = this.slowSettings.add({
fieldLabel: _('Active Seeding'),
name: 'active_seeding',
width: 80,
value: -1,
decimalPrecision: 0
decimalPrecision: 0,
});
this.on('show', this.updateConfig, this);
},
onRender: function(ct, position) {
Deluge.ux.preferences.SchedulerPage.superclass.onRender.call(this, ct, position);
Deluge.ux.preferences.SchedulerPage.superclass.onRender.call(
this,
ct,
position
);
this.form.layout = new Ext.layout.FormLayout();
this.form.layout.setContainer(this);
this.form.doLayout();
@ -583,13 +600,12 @@ Deluge.ux.preferences.SchedulerPage = Ext.extend(Ext.Panel, {
this.activeDownloading.setValue(config['low_active_down']);
this.activeSeeding.setValue(config['low_active_up']);
},
scope: this
scope: this,
});
}
},
});
Deluge.plugins.SchedulerPlugin = Ext.extend(Deluge.Plugin, {
name: 'Scheduler',
onDisable: function() {
@ -597,7 +613,9 @@ Deluge.plugins.SchedulerPlugin = Ext.extend(Deluge.Plugin, {
},
onEnable: function() {
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.SchedulerPage());
}
this.prefsPage = deluge.preferences.addPage(
new Deluge.ux.preferences.SchedulerPage()
);
},
});
Deluge.registerPlugin('Scheduler', Deluge.plugins.SchedulerPlugin);

View file

@ -11,16 +11,17 @@
StatsPlugin = Ext.extend(Deluge.Plugin, {
constructor: function(config) {
config = Ext.apply({
name: "Stats"
}, config);
config = Ext.apply(
{
name: 'Stats',
},
config
);
StatsPlugin.superclass.constructor.call(this, config);
},
onDisable: function() {
},
onDisable: function() {},
onEnable: function() {
}
onEnable: function() {},
});
new StatsPlugin();

View file

@ -11,18 +11,17 @@
TogglePlugin = Ext.extend(Deluge.Plugin, {
constructor: function(config) {
config = Ext.apply({
name: "Toggle"
}, config);
config = Ext.apply(
{
name: 'Toggle',
},
config
);
TogglePlugin.superclass.constructor.call(this, config);
},
onDisable: function() {
onDisable: function() {},
},
onEnable: function() {
}
onEnable: function() {},
});
new TogglePlugin();

View file

@ -1,4 +1,5 @@
html, body {
html,
body {
font: normal 11px arial, tahoma, helvetica, sans-serif;
margin: 0;
padding: 0;
@ -29,13 +30,15 @@ button::-moz-focus-inner {
opacity: 1 !important;
}
.deluge-torrents td, .x-deluge-peers td {
.deluge-torrents td,
.x-deluge-peers td {
height: 16px;
line-height: 16px;
}
.deluge-torrents .torrent-name, .x-deluge-peer, .x-deluge-seed {
.deluge-torrents .torrent-name,
.x-deluge-peer,
.x-deluge-seed {
padding-left: 20px;
background-repeat: no-repeat;
}
@ -45,40 +48,95 @@ button::-moz-focus-inner {
}
/* Icon classes */
.x-deluge-all { background-image: url('../icons/all.png'); }
.x-deluge-active { background-image: url('../icons/active.png'); }
.x-deluge-downloading, .x-btn .x-deluge-downloading, .x-deluge-peer { background-image: url('../icons/downloading.png'); }
.x-deluge-seeding, .x-btn .x-deluge-seeding, .deluge-torrents .seeding, .x-deluge-seed { background-image: url('../icons/seeding.png'); }
.x-deluge-queued, .x-btn .x-deluge-queued, .deluge-torrents .queued { background-image: url('../icons/queued.png'); }
.x-deluge-paused, .x-btn .x-deluge-paused, .deluge-torrents .paused { background-image: url('../icons/inactive.png'); }
.x-deluge-error, .deluge-torrents .error { background-image: url('../icons/alert.png'); }
.x-deluge-checking, .deluge-torrents .checking { background-image: url('../icons/checking.png'); }
.x-deluge-dht, .x-btn .x-deluge-dht { background-image: url('../icons/dht.png'); }
.x-deluge-preferences, .x-btn .x-deluge-preferences { background-image: url('../icons/preferences.png') }
.x-deluge-connections, .x-btn .x-deluge-connections { background-image: url('../icons/connections.png') }
.x-deluge-connection-manager, .x-btn .x-deluge-connection-manager { background-image: url('../icons/connection_manager.png') }
.x-deluge-traffic, .x-btn .x-deluge-traffic { background-image: url('../icons/traffic.png') }
.x-deluge-edit-trackers, .x-btn .x-deluge-edit-trackers {background-image: url('../icons/edit_trackers.png'); }
.x-deluge-freespace, .x-btn .x-deluge-freespace {background-image: url('../icons/drive.png'); }
.x-deluge-install-plugin, .x-btn .x-deluge-install-plugin {background-image: url('../icons/install_plugin.png'); }
.x-deluge-find-more, .x-btn .x-deluge-find-more {background-image: url('../icons/find_more.png'); }
.x-deluge-all {
background-image: url('../icons/all.png');
}
.x-deluge-active {
background-image: url('../icons/active.png');
}
.x-deluge-downloading,
.x-btn .x-deluge-downloading,
.x-deluge-peer {
background-image: url('../icons/downloading.png');
}
.x-deluge-seeding,
.x-btn .x-deluge-seeding,
.deluge-torrents .seeding,
.x-deluge-seed {
background-image: url('../icons/seeding.png');
}
.x-deluge-queued,
.x-btn .x-deluge-queued,
.deluge-torrents .queued {
background-image: url('../icons/queued.png');
}
.x-deluge-paused,
.x-btn .x-deluge-paused,
.deluge-torrents .paused {
background-image: url('../icons/inactive.png');
}
.x-deluge-error,
.deluge-torrents .error {
background-image: url('../icons/alert.png');
}
.x-deluge-checking,
.deluge-torrents .checking {
background-image: url('../icons/checking.png');
}
.x-deluge-dht,
.x-btn .x-deluge-dht {
background-image: url('../icons/dht.png');
}
.x-deluge-preferences,
.x-btn .x-deluge-preferences {
background-image: url('../icons/preferences.png');
}
.x-deluge-connections,
.x-btn .x-deluge-connections {
background-image: url('../icons/connections.png');
}
.x-deluge-connection-manager,
.x-btn .x-deluge-connection-manager {
background-image: url('../icons/connection_manager.png');
}
.x-deluge-traffic,
.x-btn .x-deluge-traffic {
background-image: url('../icons/traffic.png');
}
.x-deluge-edit-trackers,
.x-btn .x-deluge-edit-trackers {
background-image: url('../icons/edit_trackers.png');
}
.x-deluge-freespace,
.x-btn .x-deluge-freespace {
background-image: url('../icons/drive.png');
}
.x-deluge-install-plugin,
.x-btn .x-deluge-install-plugin {
background-image: url('../icons/install_plugin.png');
}
.x-deluge-find-more,
.x-btn .x-deluge-find-more {
background-image: url('../icons/find_more.png');
}
/* Torrent Details */
#torrentDetails dl, #torrentDetails dl.singleline {
#torrentDetails dl,
#torrentDetails dl.singleline {
float: left;
min-height: 120px;
}
#torrentDetails dl dt, dl.singleline dt {
#torrentDetails dl dt,
dl.singleline dt {
float: left;
font-weight: bold;
height: 19px;
}
#torrentDetails dl dd, dl.singleline dd {
#torrentDetails dl dd,
dl.singleline dd {
margin-left: 100px;
width: 140px;
height: 19px;
@ -185,7 +243,8 @@ dl.singleline dd {
}
/* Add Url Window */
.x-deluge-add-file, .x-btn .x-deluge-add-file {
.x-deluge-add-file,
.x-btn .x-deluge-add-file {
background: url('../icons/add_file.png') no-repeat 2px;
}
@ -348,7 +407,11 @@ dl.singleline dd {
}
/* Filepriority styles */
.x-no-download, .x-low-download, .x-normal-download, .x-high-download, .x-mixed-download {
.x-no-download,
.x-low-download,
.x-normal-download,
.x-high-download,
.x-mixed-download {
padding-left: 20px;
background-repeat: no-repeat;
line-height: 16px;
@ -431,7 +494,8 @@ dl.singleline dd {
background-image: url('../icons/update.png') !important;
}
.icon-edit-trackers, .icon-edit {
.icon-edit-trackers,
.icon-edit {
background-image: url('../icons/edit_trackers.png') !important;
}

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge');
* @extends Ext.Window
*/
Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
title: _('Add Connection'),
iconCls: 'x-deluge-add-window-icon',
@ -40,13 +39,15 @@ Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
defaultType: 'textfield',
baseCls: 'x-plain',
labelWidth: 60,
items: [{
items: [
{
fieldLabel: _('Host:'),
labelSeparator: '',
name: 'host',
anchor: '75%',
value: ''
}, {
value: '',
},
{
xtype: 'spinnerfield',
fieldLabel: _('Port:'),
labelSeparator: '',
@ -55,50 +56,62 @@ Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 65535
maxValue: 65535,
},
value: '58846',
anchor: '40%'
}, {
anchor: '40%',
},
{
fieldLabel: _('Username:'),
labelSeparator: '',
name: 'username',
anchor: '75%',
value: ''
}, {
value: '',
},
{
fieldLabel: _('Password:'),
labelSeparator: '',
anchor: '75%',
name: 'password',
inputType: 'password',
value: ''
}]
value: '',
},
],
});
},
onAddClick: function() {
var values = this.form.getForm().getValues();
deluge.client.web.add_host(values.host, Number(values.port), values.username, values.password, {
deluge.client.web.add_host(
values.host,
Number(values.port),
values.username,
values.password,
{
success: function(result) {
if (!result[0]) {
Ext.MessageBox.show({
title: _('Error'),
msg: String.format(_('Unable to add host: {0}'), result[1]),
msg: String.format(
_('Unable to add host: {0}'),
result[1]
),
buttons: Ext.MessageBox.OK,
modal: false,
icon: Ext.MessageBox.ERROR,
iconCls: 'x-deluge-icon-error'
iconCls: 'x-deluge-icon-error',
});
} else {
this.fireEvent('hostadded');
}
this.hide();
},
scope: this
});
scope: this,
}
);
},
onHide: function() {
this.form.getForm().reset();
}
},
});

View file

@ -15,7 +15,7 @@ Ext.apply(Ext.form.VTypes, {
trackerUrl: function(val, field) {
return trackerUrlTest.test(val);
},
trackerUrlText: 'Not a valid tracker url'
trackerUrlText: 'Not a valid tracker url',
});
/**
@ -23,7 +23,6 @@ Ext.apply(Ext.form.VTypes, {
* @extends Ext.Window
*/
Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
title: _('Add Tracker'),
layout: 'fit',
width: 375,
@ -49,32 +48,47 @@ Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
defaultType: 'textarea',
baseCls: 'x-plain',
labelWidth: 55,
items: [{
items: [
{
fieldLabel: _('Trackers:'),
labelSeparator: '',
name: 'trackers',
anchor: '100%'
}]
})
anchor: '100%',
},
],
});
},
onAddClick: function() {
var trackers = this.form.getForm().findField('trackers').getValue();
var trackers = this.form
.getForm()
.findField('trackers')
.getValue();
trackers = trackers.split('\n');
var cleaned = [];
Ext.each(trackers, function(tracker) {
Ext.each(
trackers,
function(tracker) {
if (Ext.form.VTypes.trackerUrl(tracker)) {
cleaned.push(tracker);
}
}, this);
},
this
);
this.fireEvent('add', cleaned);
this.hide();
this.form.getForm().findField('trackers').setValue('');
this.form
.getForm()
.findField('trackers')
.setValue('');
},
onCancelClick: function() {
this.form.getForm().findField('trackers').setValue('');
this.form
.getForm()
.findField('trackers')
.setValue('');
this.hide();
}
},
});

View file

@ -16,7 +16,6 @@ Ext.namespace('Ext.ux.util');
* @namespace Ext.ux.util
*/
Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
_components: [],
_methods: [],
@ -33,7 +32,6 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
* @param {Ext.ux.util.RpcClient} this
*/
constructor: function(config) {
Ext.ux.util.RpcClient.superclass.constructor.call(this, config);
this._url = config.url || null;
this._id = 0;
@ -49,7 +47,7 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
reloadMethods: function() {
this._execute('system.listMethods', {
success: this._setMethods,
scope: this
scope: this,
});
},
@ -61,7 +59,7 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
var request = Ext.encode({
method: method,
params: options.params,
id: options.id
id: options.id,
});
this._id++;
@ -72,7 +70,7 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
failure: this._onFailure,
scope: this,
jsonData: request,
options: options
options: options,
});
},
@ -83,15 +81,20 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
result: null,
error: {
msg: 'HTTP: ' + response.status + ' ' + response.statusText,
code: 255
}
}
code: 255,
},
};
this.fireEvent('error', errorObj, response, requestOptions)
this.fireEvent('error', errorObj, response, requestOptions);
if (Ext.type(options.failure) != 'function') return;
if (options.scope) {
options.failure.call(options.scope, errorObj, response, requestOptions);
options.failure.call(
options.scope,
errorObj,
response,
requestOptions
);
} else {
options.failure(errorObj, response, requestOptions);
}
@ -105,16 +108,32 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
if (Ext.type(options.failure) != 'function') return;
if (options.scope) {
options.failure.call(options.scope, responseObj, response, requestOptions);
options.failure.call(
options.scope,
responseObj,
response,
requestOptions
);
} else {
options.failure(responseObj, response, requestOptions);
}
} else {
if (Ext.type(options.success) != 'function') return;
if (options.scope) {
options.success.call(options.scope, responseObj.result, responseObj, response, requestOptions);
options.success.call(
options.scope,
responseObj.result,
responseObj,
response,
requestOptions
);
} else {
options.success(responseObj.result, responseObj, response, requestOptions);
options.success(
responseObj.result,
responseObj,
response,
requestOptions
);
}
}
},
@ -127,26 +146,28 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
var options = params[params.length - 1];
if (Ext.type(options) == 'object') {
var keys = Ext.keys(options), isOption = false;
var keys = Ext.keys(options),
isOption = false;
Ext.each(this._optionKeys, function(key) {
if (keys.indexOf(key) > -1) isOption = true;
});
if (isOption) {
params.remove(options)
params.remove(options);
} else {
options = {}
options = {};
}
} else {
options = {}
options = {};
}
options.params = params;
return options;
},
_setMethods: function(methods) {
var components = {}, self = this;
var components = {},
self = this;
Ext.each(methods, function(method) {
var parts = method.split('.');
@ -155,7 +176,7 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
var fn = function() {
var options = self._parseArgs(arguments);
return self._execute(method, options);
}
};
component[parts[1]] = fn;
components[parts[0]] = component;
});
@ -163,12 +184,16 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
for (var name in components) {
self[name] = components[name];
}
Ext.each(this._components, function(component) {
Ext.each(
this._components,
function(component) {
if (!component in components) {
delete this[component];
}
}, this);
},
this
);
this._components = Ext.keys(components);
this.fireEvent('connected', this);
}
},
});

View file

@ -9,7 +9,6 @@
*/
Deluge.ConnectionManager = Ext.extend(Ext.Window, {
layout: 'fit',
width: 300,
height: 220,
@ -40,13 +39,14 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
{ name: 'host', mapping: 1 },
{ name: 'port', mapping: 2 },
{ name: 'user', mapping: 3 },
{name: 'version', mapping: 5}
{ name: 'version', mapping: 5 },
],
id: 0
id: 0,
}),
columns: [{
columns: [
{
header: _('Status'),
width: .24,
width: 0.24,
sortable: true,
tpl: new Ext.XTemplate(
'<tpl if="status == \'Online\'">',
@ -57,26 +57,30 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
'</tpl>',
'<tpl if="status == \'Connected\'">',
_('Connected'),
'</tpl>'),
dataIndex: 'status'
}, {
'</tpl>'
),
dataIndex: 'status',
},
{
id: 'host',
header: _('Host'),
width: .51,
width: 0.51,
sortable: true,
tpl: '{user}@{host}:{port}',
dataIndex: 'host'
}, {
dataIndex: 'host',
},
{
header: _('Version'),
width: .25,
width: 0.25,
sortable: true,
tpl: '<tpl if="version">{version}</tpl>',
dataIndex: 'version'
}],
dataIndex: 'version',
},
],
singleSelect: true,
listeners: {
'selectionchange': {fn: this.onSelectionChanged, scope: this}
}
selectionchange: { fn: this.onSelectionChanged, scope: this },
},
});
this.panel = this.add({
@ -90,33 +94,37 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
text: _('Add'),
iconCls: 'icon-add',
handler: this.onAddClick,
scope: this
}, {
scope: this,
},
{
id: 'cm-edit',
cls: 'x-btn-text-icon',
text: _('Edit'),
iconCls: 'icon-edit',
handler: this.onEditClick,
scope: this
}, {
scope: this,
},
{
id: 'cm-remove',
cls: 'x-btn-text-icon',
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onRemoveClick,
disabled: true,
scope: this
}, '->', {
scope: this,
},
'->',
{
id: 'cm-stop',
cls: 'x-btn-text-icon',
text: _('Stop Daemon'),
iconCls: 'icon-error',
handler: this.onStopClick,
disabled: true,
scope: this
}
]
})
scope: this,
},
],
}),
});
this.update = this.update.createDelegate(this);
},
@ -134,7 +142,7 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
this.show();
}
},
scope: this
scope: this,
});
},
@ -149,7 +157,7 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
loadHosts: function() {
deluge.client.web.get_hosts({
success: this.onGetHosts,
scope: this
scope: this,
});
},
@ -157,7 +165,7 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
this.list.getStore().each(function(r) {
deluge.client.web.get_host_status(r.id, {
success: this.onGetHostStatus,
scope: this
scope: this,
});
}, this);
},
@ -168,7 +176,8 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
* @param {Ext.data.Record} record The hosts record to update the UI for
*/
updateButtons: function(record) {
var button = this.buttons[1], status = record.get('status');
var button = this.buttons[1],
status = record.get('status');
// Update the Connect/Disconnect button
button.enable();
@ -180,11 +189,17 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
}
// Update the Stop/Start Daemon button
if (status.toLowerCase() == 'connected' || status.toLowerCase() == 'online') {
if (
status.toLowerCase() == 'connected' ||
status.toLowerCase() == 'online'
) {
this.stopHostButton.enable();
this.stopHostButton.setText(_('Stop Daemon'));
} else {
if (record.get('host') == '127.0.0.1' || record.get('host') == 'localhost') {
if (
record.get('host') == '127.0.0.1' ||
record.get('host') == 'localhost'
) {
this.stopHostButton.enable();
this.stopHostButton.setText(_('Start Daemon'));
} else {
@ -236,26 +251,38 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
this.update(this);
deluge.events.fire('disconnect');
},
scope: me
scope: me,
});
};
if (selected.get('status').toLowerCase() == 'connected') {
disconnect();
} else {
if (this.list.getStore().find('status', 'Connected', 0, false, false) > -1) {
if (
this.list
.getStore()
.find('status', 'Connected', 0, false, false) > -1
) {
disconnect();
}
var id = selected.id;
deluge.client.web.connect(id, {
deluge.client.web.connect(
id,
{
success: function(methods) {
deluge.client.reloadMethods();
deluge.client.on('connected', function(e) {
deluge.client.on(
'connected',
function(e) {
deluge.events.fire('connect');
}, this, {single: true});
},
this,
{ single: true }
);
},
}
});
);
this.hide();
}
},
@ -263,21 +290,25 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
// private
onGetHosts: function(hosts) {
this.list.getStore().loadData(hosts);
Ext.each(hosts, function(host) {
Ext.each(
hosts,
function(host) {
deluge.client.web.get_host_status(host[0], {
success: this.onGetHostStatus,
scope: this
scope: this,
});
}, this);
},
this
);
},
// private
onGetHostStatus: function(host) {
var record = this.list.getStore().getById(host[0]);
record.set('status', host[1])
record.set('version', host[2])
record.set('status', host[1]);
record.set('version', host[2]);
record.commit();
var selected = this.list.getSelectedRecords()[0]
var selected = this.list.getSelectedRecords()[0];
if (!selected) return;
if (selected == record) this.updateButtons(record);
},
@ -290,8 +321,11 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
// private
onLogin: function() {
if (deluge.config.first_login) {
Ext.MessageBox.confirm(_('Change Default Password'),
_('We recommend changing the default password.<br><br>Would you like to change it now?'),
Ext.MessageBox.confirm(
_('Change Default Password'),
_(
'We recommend changing the default password.<br><br>Would you like to change it now?'
),
function(res) {
this.checkConnected();
if (res == 'yes') {
@ -299,7 +333,9 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
deluge.preferences.selectPage('Interface');
}
deluge.client.web.set_config({ first_login: false });
}, this);
},
this
);
} else {
this.checkConnected();
}
@ -327,13 +363,13 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
buttons: Ext.MessageBox.OK,
modal: false,
icon: Ext.MessageBox.ERROR,
iconCls: 'x-deluge-icon-error'
iconCls: 'x-deluge-icon-error',
});
} else {
this.list.getStore().remove(connection);
}
},
scope: this
scope: this,
});
},
@ -386,11 +422,11 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
buttons: Ext.MessageBox.OK,
modal: false,
icon: Ext.MessageBox.ERROR,
iconCls: 'x-deluge-icon-error'
iconCls: 'x-deluge-icon-error',
});
}
}
},
});
}
}
},
});

View file

@ -9,25 +9,33 @@
*/
// Setup the state manager
Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
Ext.state.Manager.setProvider(
new Ext.state.CookieProvider({
/**
* By default, cookies will expire after 7 days. Provide
* an expiry date 10 years in the future to approximate
* a cookie that does not expire.
*/
expires: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 365 * 10))
}));
expires: new Date(
new Date().getTime() + 1000 * 60 * 60 * 24 * 365 * 10
),
})
);
// Add some additional functions to ext and setup some of the
// configurable parameters
Ext.apply(Ext, {
escapeHTML: function(text) {
text = String(text).replace('<', '&lt;').replace('>', '&gt;');
text = String(text)
.replace('<', '&lt;')
.replace('>', '&gt;');
return text.replace('&', '&amp;');
},
isObjectEmpty: function(obj) {
for(var i in obj) { return false; }
for (var i in obj) {
return false;
}
return true;
},
@ -44,8 +52,8 @@ Ext.apply(Ext, {
keys: function(obj) {
var keys = [];
for (var i in obj) if (obj.hasOwnProperty(i))
{
for (var i in obj)
if (obj.hasOwnProperty(i)) {
keys.push(i);
}
return keys;
@ -63,8 +71,8 @@ Ext.apply(Ext, {
splat: function(obj) {
var type = Ext.type(obj);
return (type) ? ((type != 'array') ? [obj] : obj) : [];
}
return type ? (type != 'array' ? [obj] : obj) : [];
},
});
Ext.getKeys = Ext.keys;
Ext.BLANK_IMAGE_URL = deluge.config.base + 'images/s.gif';
@ -72,12 +80,12 @@ Ext.USE_NATIVE_JSON = true;
// Create the Deluge namespace
Ext.apply(Deluge, {
// private
pluginStore: {},
// private
progressTpl: '<div class="x-progress-wrap x-progress-renderered">' +
progressTpl:
'<div class="x-progress-wrap x-progress-renderered">' +
'<div class="x-progress-inner">' +
'<div style="width: {2}px" class="x-progress-bar">' +
'<div style="z-index: 99; width: {3}px" class="x-progress-text">' +
@ -90,7 +98,6 @@ Ext.apply(Deluge, {
'</div>' +
'</div>',
/**
* A method to create a progress bar that can be used by renderers
* to display a bar within a grid or tree.
@ -103,8 +110,15 @@ Ext.apply(Deluge, {
modifier = Ext.value(modifier, 10);
var progressWidth = ((width / 100.0) * progress).toFixed(0);
var barWidth = progressWidth - 1;
var textWidth = ((progressWidth - modifier) > 0 ? progressWidth - modifier : 0);
return String.format(Deluge.progressTpl, text, width, barWidth, textWidth);
var textWidth =
progressWidth - modifier > 0 ? progressWidth - modifier : 0;
return String.format(
Deluge.progressTpl,
text,
width,
barWidth,
textWidth
);
},
/**
@ -120,7 +134,7 @@ Ext.apply(Deluge, {
* @param {String} name The plugin name to check
*/
hasPlugin: function(name) {
return (Deluge.pluginStore[name]) ? true : false;
return Deluge.pluginStore[name] ? true : false;
},
/**
@ -130,8 +144,7 @@ Ext.apply(Deluge, {
*/
registerPlugin: function(name, plugin) {
Deluge.pluginStore[name] = plugin;
}
},
});
// Setup a space for plugins to insert themselves
@ -152,12 +165,12 @@ FILE_PRIORITY = {
6: 'High',
7: 'High',
9: 'Mixed',
'Ignore': 0,
'Low': 1,
'Normal': 4,
'High': 7,
'Mixed': 9
}
Ignore: 0,
Low: 1,
Normal: 4,
High: 7,
Mixed: 9,
};
FILE_PRIORITY_CSS = {
0: 'x-no-download',
@ -168,5 +181,5 @@ FILE_PRIORITY_CSS = {
5: 'x-high-download',
6: 'x-high-download',
7: 'x-high-download',
9: 'x-mixed-download'
}
9: 'x-mixed-download',
};

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge');
* @extends Ext.Window
*/
Deluge.EditConnectionWindow = Ext.extend(Ext.Window, {
title: _('Edit Connection'),
iconCls: 'x-deluge-add-window-icon',
@ -40,13 +39,15 @@ Deluge.EditConnectionWindow = Ext.extend(Ext.Window, {
defaultType: 'textfield',
baseCls: 'x-plain',
labelWidth: 60,
items: [{
items: [
{
fieldLabel: _('Host:'),
labelSeparator: '',
name: 'host',
anchor: '75%',
value: ''
}, {
value: '',
},
{
xtype: 'spinnerfield',
fieldLabel: _('Port:'),
labelSeparator: '',
@ -55,60 +56,79 @@ Deluge.EditConnectionWindow = Ext.extend(Ext.Window, {
xtype: 'number',
decimalPrecision: 0,
minValue: 0,
maxValue: 65535
maxValue: 65535,
},
anchor: '40%',
value: 58846
}, {
value: 58846,
},
{
fieldLabel: _('Username:'),
labelSeparator: '',
name: 'username',
anchor: '75%',
value: ''
}, {
value: '',
},
{
fieldLabel: _('Password:'),
labelSeparator: '',
anchor: '75%',
name: 'password',
inputType: 'password',
value: ''
}]
value: '',
},
],
});
},
show: function(connection) {
Deluge.EditConnectionWindow.superclass.show.call(this);
this.form.getForm().findField('host').setValue(connection.get('host'));
this.form.getForm().findField('port').setValue(connection.get('port'));
this.form.getForm().findField('username').setValue(connection.get('user'));
this.host_id = connection.id
this.form
.getForm()
.findField('host')
.setValue(connection.get('host'));
this.form
.getForm()
.findField('port')
.setValue(connection.get('port'));
this.form
.getForm()
.findField('username')
.setValue(connection.get('user'));
this.host_id = connection.id;
},
onEditClick: function() {
var values = this.form.getForm().getValues();
deluge.client.web.edit_host(this.host_id, values.host, Number(values.port), values.username, values.password, {
deluge.client.web.edit_host(
this.host_id,
values.host,
Number(values.port),
values.username,
values.password,
{
success: function(result) {
if (!result) {
console.log(result)
console.log(result);
Ext.MessageBox.show({
title: _('Error'),
msg: String.format(_('Unable to edit host')),
buttons: Ext.MessageBox.OK,
modal: false,
icon: Ext.MessageBox.ERROR,
iconCls: 'x-deluge-icon-error'
iconCls: 'x-deluge-icon-error',
});
} else {
this.fireEvent('hostedited');
}
this.hide();
},
scope: this
});
scope: this,
}
);
},
onHide: function() {
this.form.getForm().reset();
}
},
});

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge');
* @extends Ext.Window
*/
Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
title: _('Edit Tracker'),
layout: 'fit',
width: 375,
@ -40,12 +39,14 @@ Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
defaultType: 'textfield',
baseCls: 'x-plain',
labelWidth: 55,
items: [{
items: [
{
fieldLabel: _('Tracker:'),
labelSeparator: '',
name: 'tracker',
anchor: '100%'
}]
anchor: '100%',
},
],
});
},
@ -53,7 +54,10 @@ Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
Deluge.EditTrackerWindow.superclass.show.call(this);
this.record = record;
this.form.getForm().findField('tracker').setValue(record.data['url']);
this.form
.getForm()
.findField('tracker')
.setValue(record.data['url']);
},
onCancelClick: function() {
@ -61,13 +65,19 @@ Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
},
onHide: function() {
this.form.getForm().findField('tracker').setValue('');
this.form
.getForm()
.findField('tracker')
.setValue('');
},
onSaveClick: function() {
var url = this.form.getForm().findField('tracker').getValue();
var url = this.form
.getForm()
.findField('tracker')
.getValue();
this.record.set('url', url);
this.record.commit();
this.hide();
}
},
});

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge');
* @extends Ext.Window
*/
Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
title: _('Edit Trackers'),
layout: 'fit',
width: 350,
@ -46,29 +45,29 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
this.list = new Ext.list.ListView({
store: new Ext.data.JsonStore({
root: 'trackers',
fields: [
'tier',
'url'
]
fields: ['tier', 'url'],
}),
columns: [{
columns: [
{
header: _('Tier'),
width: .1,
dataIndex: 'tier'
}, {
width: 0.1,
dataIndex: 'tier',
},
{
header: _('Tracker'),
width: .9,
dataIndex: 'url'
}],
width: 0.9,
dataIndex: 'url',
},
],
columnSort: {
sortClasses: ['', '']
sortClasses: ['', ''],
},
stripeRows: true,
singleSelect: true,
listeners: {
'dblclick': {fn: this.onListNodeDblClicked, scope: this},
'selectionchange': {fn: this.onSelect, scope: this}
}
dblclick: { fn: this.onListNodeDblClicked, scope: this },
selectionchange: { fn: this.onSelect, scope: this },
},
});
this.panel = this.add({
@ -80,30 +79,35 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
text: _('Up'),
iconCls: 'icon-up',
handler: this.onUpClick,
scope: this
}, {
scope: this,
},
{
text: _('Down'),
iconCls: 'icon-down',
handler: this.onDownClick,
scope: this
}, '->', {
scope: this,
},
'->',
{
text: _('Add'),
iconCls: 'icon-add',
handler: this.onAddClick,
scope: this
}, {
scope: this,
},
{
text: _('Edit'),
iconCls: 'icon-edit-trackers',
handler: this.onEditClick,
scope: this
}, {
scope: this,
},
{
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onRemoveClick,
scope: this
}
]
})
scope: this,
},
],
}),
});
},
@ -113,8 +117,11 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
onAddTrackers: function(trackers) {
var store = this.list.getStore();
Ext.each(trackers, function(tracker) {
var duplicate = false, heightestTier = -1;
Ext.each(
trackers,
function(tracker) {
var duplicate = false,
heightestTier = -1;
store.each(function(record) {
if (record.get('tier') > heightestTier) {
heightestTier = record.get('tier');
@ -125,8 +132,15 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
}
}, this);
if (duplicate) return;
store.add(new store.recordType({'tier': heightestTier + 1, 'url': tracker}));
}, this);
store.add(
new store.recordType({
tier: heightestTier + 1,
url: tracker,
})
);
},
this
);
},
onCancelClick: function() {
@ -151,14 +165,14 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
var trackers = [];
this.list.getStore().each(function(record) {
trackers.push({
'tier': record.get('tier'),
'url': record.get('url')
})
tier: record.get('tier'),
url: record.get('url'),
});
}, this);
deluge.client.core.set_torrent_trackers(this.torrentId, trackers, {
failure: this.onSaveFail,
scope: this
scope: this,
});
this.hide();
@ -176,23 +190,27 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
this.list.getStore().sort('tier', 'ASC');
},
onSaveFail: function() {
},
onSaveFail: function() {},
onSelect: function(list) {
if (list.getSelectionCount()) {
this.panel.getBottomToolbar().items.get(4).enable();
this.panel
.getBottomToolbar()
.items.get(4)
.enable();
}
},
onShow: function() {
this.panel.getBottomToolbar().items.get(4).disable();
this.panel
.getBottomToolbar()
.items.get(4)
.disable();
var r = deluge.torrents.getSelected();
this.torrentId = r.id;
deluge.client.core.get_torrent_status(r.id, ['trackers'], {
success: this.onRequestComplete,
scope: this
scope: this,
});
},
@ -217,5 +235,5 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
r.store.commitChanges();
this.list.select(r.store.indexOf(r));
}
},
});

View file

@ -33,14 +33,20 @@ Deluge.EventsManager = Ext.extend(Ext.util.Observable, {
deluge.client.web.register_event_listener(eventName);
}
}
Deluge.EventsManager.superclass.addListener.call(this, eventName, fn, scope, o);
Deluge.EventsManager.superclass.addListener.call(
this,
eventName,
fn,
scope,
o
);
},
getEvents: function() {
deluge.client.web.get_events({
success: this.onGetEventsSuccess,
failure: this.onGetEventsFailure,
scope: this
scope: this,
});
},
@ -71,11 +77,16 @@ Deluge.EventsManager = Ext.extend(Ext.util.Observable, {
onGetEventsSuccess: function(events) {
if (!this.running) return;
if (events) {
Ext.each(events, function(event) {
var name = event[0], args = event[1];
Ext.each(
events,
function(event) {
var name = event[0],
args = event[1];
args.splice(0, 0, name);
this.fireEvent.apply(this, args);
}, this);
},
this
);
}
this.getEvents();
},
@ -89,19 +100,19 @@ Deluge.EventsManager = Ext.extend(Ext.util.Observable, {
return;
}
this.getEvents();
}
},
});
/**
* Appends an event handler to this object (shorthand for {@link #addListener})
* @method
*/
Deluge.EventsManager.prototype.on = Deluge.EventsManager.prototype.addListener
Deluge.EventsManager.prototype.on = Deluge.EventsManager.prototype.addListener;
/**
* Fires the specified event with the passed parameters (minus the
* event name).
* @method
*/
Deluge.EventsManager.prototype.fire = Deluge.EventsManager.prototype.fireEvent
Deluge.EventsManager.prototype.fire = Deluge.EventsManager.prototype.fireEvent;
deluge.events = new Deluge.EventsManager();

View file

@ -10,7 +10,6 @@
Ext.namespace('Deluge');
Deluge.FileBrowser = Ext.extend(Ext.Window, {
title: _('File Browser'),
width: 500,
@ -21,20 +20,24 @@ Deluge.FileBrowser = Ext.extend(Ext.Window, {
this.add({
xtype: 'toolbar',
items: [{
items: [
{
text: _('Back'),
iconCls: 'icon-back'
}, {
iconCls: 'icon-back',
},
{
text: _('Forward'),
iconCls: 'icon-forward'
}, {
iconCls: 'icon-forward',
},
{
text: _('Up'),
iconCls: 'icon-up'
}, {
iconCls: 'icon-up',
},
{
text: _('Home'),
iconCls: 'icon-home'
}]
iconCls: 'icon-home',
},
],
});
}
},
});

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge');
* @extends Ext.list.ListView
*/
Deluge.FilterPanel = Ext.extend(Ext.Panel, {
autoScroll: true,
border: false,
@ -34,9 +33,9 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
} else if (this.filterType == 'label') {
title = _('Labels');
} else {
title = this.filterType.replace('_', ' '),
parts = title.split(' '),
title = '';
(title = this.filterType.replace('_', ' ')),
(parts = title.split(' ')),
(title = '');
Ext.each(parts, function(p) {
fl = p.substring(0, 1).toUpperCase();
title += fl + p.substring(1) + ' ';
@ -47,7 +46,8 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
if (Deluge.FilterPanel.templates[this.filterType]) {
var tpl = Deluge.FilterPanel.templates[this.filterType];
} else {
var tpl = '<div class="x-deluge-filter x-deluge-{filter:lowercase}">{filter} ({count})</div>';
var tpl =
'<div class="x-deluge-filter x-deluge-{filter:lowercase}">{filter} ({count})</div>';
}
this.list = this.add({
@ -57,14 +57,16 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
reserveScrollOffset: true,
store: new Ext.data.ArrayStore({
idIndex: 0,
fields: ['filter', 'count']
fields: ['filter', 'count'],
}),
columns: [{
columns: [
{
id: 'filter',
sortable: false,
tpl: tpl,
dataIndex: 'filter'
}]
dataIndex: 'filter',
},
],
});
this.relayEvents(this.list, ['selectionchange']);
},
@ -102,11 +104,18 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
*/
updateStates: function(states) {
this.states = {};
Ext.each(states, function(state) {
Ext.each(
states,
function(state) {
this.states[state[0]] = state[1];
}, this);
},
this
);
var show_zero = (this.show_zero == null) ? deluge.config.sidebar_show_zero : this.show_zero;
var show_zero =
this.show_zero == null
? deluge.config.sidebar_show_zero
: this.show_zero;
if (!show_zero) {
var newStates = [];
Ext.each(states, function(state) {
@ -119,12 +128,14 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
var store = this.getStore();
var filters = {};
Ext.each(states, function(s, i) {
Ext.each(
states,
function(s, i) {
var record = store.getById(s[0]);
if (!record) {
record = new store.recordType({
filter: s[0],
count: s[1]
count: s[1],
});
record.id = s[0];
store.insert(i, record);
@ -134,7 +145,9 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
record.set('count', s[1]);
record.endEdit();
filters[s[0]] = true;
}, this);
},
this
);
store.each(function(record) {
if (filters[record.id]) return;
@ -151,10 +164,12 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
if (!this.list.getSelectionCount()) {
this.list.select(0);
}
}
},
});
Deluge.FilterPanel.templates = {
'tracker_host': '<div class="x-deluge-filter" style="background-image: url(' + deluge.config.base + 'tracker/{filter});">{filter} ({count})</div>'
}
tracker_host:
'<div class="x-deluge-filter" style="background-image: url(' +
deluge.config.base +
'tracker/{filter});">{filter} ({count})</div>',
};

View file

@ -34,9 +34,15 @@ Deluge.Formatters = {
}
timestamp = timestamp * 1000;
var date = new Date(timestamp);
return String.format('{0}/{1}/{2} {3}:{4}:{5}',
zeroPad(date.getDate(), 2), zeroPad(date.getMonth() + 1, 2), date.getFullYear(),
zeroPad(date.getHours(), 2), zeroPad(date.getMinutes(), 2), zeroPad(date.getSeconds(), 2));
return String.format(
'{0}/{1}/{2} {3}:{4}:{5}',
zeroPad(date.getDate(), 2),
zeroPad(date.getMonth() + 1, 2),
date.getFullYear(),
zeroPad(date.getHours(), 2),
zeroPad(date.getMinutes(), 2),
zeroPad(date.getSeconds(), 2)
);
},
/**
@ -50,13 +56,19 @@ Deluge.Formatters = {
if (!bytes && !showZero) return '';
bytes = bytes / 1024.0;
if (bytes < 1024) { return bytes.toFixed(1) + ' KiB'; }
else { bytes = bytes / 1024; }
if (bytes < 1024) {
return bytes.toFixed(1) + ' KiB';
} else {
bytes = bytes / 1024;
}
if (bytes < 1024) { return bytes.toFixed(1) + ' MiB'; }
else { bytes = bytes / 1024; }
if (bytes < 1024) {
return bytes.toFixed(1) + ' MiB';
} else {
bytes = bytes / 1024;
}
return bytes.toFixed(1) + ' GiB'
return bytes.toFixed(1) + ' GiB';
},
/**
@ -70,13 +82,19 @@ Deluge.Formatters = {
if (!bytes && !showZero) return '';
bytes = bytes / 1024.0;
if (bytes < 1024) { return bytes.toFixed(1) + ' K'; }
else { bytes = bytes / 1024; }
if (bytes < 1024) {
return bytes.toFixed(1) + ' K';
} else {
bytes = bytes / 1024;
}
if (bytes < 1024) { return bytes.toFixed(1) + ' M'; }
else { bytes = bytes / 1024; }
if (bytes < 1024) {
return bytes.toFixed(1) + ' M';
} else {
bytes = bytes / 1024;
}
return bytes.toFixed(1) + ' G'
return bytes.toFixed(1) + ' G';
},
/**
@ -87,7 +105,7 @@ Deluge.Formatters = {
* @return {String} formatted string with KiB, MiB or GiB units.
*/
speed: function(bytes, showZero) {
return (!bytes && !showZero) ? '' : fsize(bytes, showZero) + '/s';
return !bytes && !showZero ? '' : fsize(bytes, showZero) + '/s';
},
/**
@ -97,34 +115,42 @@ Deluge.Formatters = {
* @return {String} a formatted time string. will return '' if seconds == 0
*/
timeRemaining: function(time) {
if (time <= 0) { return '&infin;' }
if (time <= 0) {
return '&infin;';
}
time = time.toFixed(0);
if (time < 60) { return time + 's'; }
else { time = time / 60; }
if (time < 60) {
return time + 's';
} else {
time = time / 60;
}
if (time < 60) {
var minutes = Math.floor(time)
var seconds = Math.round(60 * (time - minutes))
var minutes = Math.floor(time);
var seconds = Math.round(60 * (time - minutes));
if (seconds > 0) {
return minutes + 'm ' + seconds + 's';
} else {
return minutes + 'm'; }
return minutes + 'm';
}
} else {
time = time / 60;
}
else { time = time / 60; }
if (time < 24) {
var hours = Math.floor(time)
var minutes = Math.round(60 * (time - hours))
var hours = Math.floor(time);
var minutes = Math.round(60 * (time - hours));
if (minutes > 0) {
return hours + 'h ' + minutes + 'm';
} else {
return hours + 'h';
}
} else {
time = time / 24;
}
else { time = time / 24; }
var days = Math.floor(time)
var hours = Math.round(24 * (time - days))
var days = Math.floor(time);
var hours = Math.round(24 * (time - days));
if (hours > 0) {
return days + 'd ' + hours + 'h';
} else {
@ -144,8 +170,8 @@ Deluge.Formatters = {
cssClassEscape: function(value) {
return value.toLowerCase().replace('.', '_');
}
}
},
};
var fsize = Deluge.Formatters.size;
var fsize_short = Deluge.Formatters.sizeShort;
var fspeed = Deluge.Formatters.speed;

View file

@ -14,7 +14,6 @@
* @singleton
*/
Deluge.Keys = {
/**
* Keys that are used within the torrent grid.
* <pre>['queue', 'name', 'total_wanted', 'state', 'progress', 'num_seeds',
@ -25,12 +24,33 @@ Deluge.Keys = {
* 'seeds_peers_ratio', 'total_remaining', 'completed_time', 'time_since_transfer']</pre>
*/
Grid: [
'queue', 'name', 'total_wanted', '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', 'download_location', 'last_seen_complete',
'total_done', 'total_uploaded', 'max_download_speed', 'max_upload_speed',
'seeds_peers_ratio', 'total_remaining', 'completed_time', 'time_since_transfer'
'queue',
'name',
'total_wanted',
'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',
'download_location',
'last_seen_complete',
'total_done',
'total_uploaded',
'max_download_speed',
'max_upload_speed',
'seeds_peers_ratio',
'total_remaining',
'completed_time',
'time_since_transfer',
],
/**
@ -42,34 +62,50 @@ Deluge.Keys = {
* 'seed_rank', 'last_seen_complete', 'completed_time', 'owner', 'public', 'shared']</pre>
*/
Status: [
'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', 'time_since_transfer',
'seed_rank', 'last_seen_complete', 'completed_time', 'owner', 'public', 'shared'
'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',
'time_since_transfer',
'seed_rank',
'last_seen_complete',
'completed_time',
'owner',
'public',
'shared',
],
/**
* Keys used in the files tab of the statistics panel.
* <pre>['files', 'file_progress', 'file_priorities']</pre>
*/
Files: [
'files', 'file_progress', 'file_priorities'
],
Files: ['files', 'file_progress', 'file_priorities'],
/**
* Keys used in the peers tab of the statistics panel.
* <pre>['peers']</pre>
*/
Peers: [
'peers'
],
Peers: ['peers'],
/**
* Keys used in the details tab of the statistics panel.
*/
Details: [
'name', 'download_location', 'total_size', 'num_files', 'message',
'tracker_host', 'comment', 'creator'
'name',
'download_location',
'total_size',
'num_files',
'message',
'tracker_host',
'comment',
'creator',
],
/**
@ -79,11 +115,19 @@ Deluge.Keys = {
* 'prioritize_first_last']</pre>
*/
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',
'move_completed', 'move_completed_path'
]
'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',
'move_completed',
'move_completed_path',
],
};
// Merge the grid and status keys together as the status keys contain all the

View file

@ -9,7 +9,6 @@
*/
Deluge.LoginWindow = Ext.extend(Ext.Window, {
firstShow: true,
bodyStyle: 'padding: 10px 5px;',
buttonAlign: 'center',
@ -31,7 +30,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
this.addButton({
text: _('Login'),
handler: this.onLogin,
scope: this
scope: this,
});
this.form = this.add({
@ -40,7 +39,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
labelWidth: 120,
labelAlign: 'right',
defaults: { width: 110 },
defaultType: 'textfield'
defaultType: 'textfield',
});
this.passwordField = this.form.add({
@ -52,7 +51,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
growMax: '145',
id: '_password',
name: 'password',
inputType: 'password'
inputType: 'password',
});
this.passwordField.on('specialkey', this.onSpecialKey, this);
},
@ -63,7 +62,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
success: function(result) {
this.show(true);
},
scope: this
scope: this,
});
},
@ -88,7 +87,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
failure: function(result) {
this.show(true);
},
scope: this
scope: this,
});
},
@ -114,11 +113,11 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
passwordField.focus(true, 10);
},
icon: Ext.MessageBox.WARNING,
iconCls: 'x-deluge-icon-warning'
iconCls: 'x-deluge-icon-warning',
});
}
},
scope: this
scope: this,
});
},
@ -131,5 +130,5 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
onShow: function() {
this.passwordField.focus(true, 300);
}
},
});

View file

@ -23,7 +23,7 @@ deluge.menus = {
deluge.client.core[action](ids, {
success: function() {
deluge.ui.update();
}
},
});
},
@ -41,284 +41,348 @@ deluge.menus = {
deluge.moveStorage.show(ids);
break;
}
}
}
},
};
deluge.menus.torrent = new Ext.menu.Menu({
id: 'torrentMenu',
items: [{
items: [
{
torrentAction: 'pause_torrent',
text: _('Pause'),
iconCls: 'icon-pause',
handler: deluge.menus.onTorrentActionMethod,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: 'resume_torrent',
text: _('Resume'),
iconCls: 'icon-resume',
handler: deluge.menus.onTorrentActionMethod,
scope: deluge.menus
}, '-', {
scope: deluge.menus,
},
'-',
{
text: _('Options'),
iconCls: 'icon-options',
hideOnClick: false,
menu: new Ext.menu.Menu({
items: [{
items: [
{
text: _('D/L Speed Limit'),
iconCls: 'x-deluge-downloading',
hideOnClick: false,
menu: new Ext.menu.Menu({
items: [{
items: [
{
torrentAction: ['max_download_speed', 5],
text: _('5 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_download_speed', 10],
text: _('10 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_download_speed', 30],
text: _('30 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_download_speed', 80],
text: _('80 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_download_speed', 300],
text: _('300 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
},{
scope: deluge.menus,
},
{
torrentAction: ['max_download_speed', -1],
text: _('Unlimited'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}]
})
}, {
scope: deluge.menus,
},
],
}),
},
{
text: _('U/L Speed Limit'),
iconCls: 'x-deluge-seeding',
hideOnClick: false,
menu: new Ext.menu.Menu({
items: [{
items: [
{
torrentAction: ['max_upload_speed', 5],
text: _('5 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_upload_speed', 10],
text: _('10 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_upload_speed', 30],
text: _('30 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_upload_speed', 80],
text: _('80 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_upload_speed', 300],
text: _('300 KiB/s'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
},{
scope: deluge.menus,
},
{
torrentAction: ['max_upload_speed', -1],
text: _('Unlimited'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}]
})
}, {
scope: deluge.menus,
},
],
}),
},
{
text: _('Connection Limit'),
iconCls: 'x-deluge-connections',
hideOnClick: false,
menu: new Ext.menu.Menu({
items: [{
items: [
{
torrentAction: ['max_connections', 50],
text: '50',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_connections', 100],
text: '100',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_connections', 200],
text: '200',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_connections', 300],
text: '300',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_connections', 500],
text: '500',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
},{
scope: deluge.menus,
},
{
torrentAction: ['max_connections', -1],
text: _('Unlimited'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}]
})
}, {
scope: deluge.menus,
},
],
}),
},
{
text: _('Upload Slot Limit'),
iconCls: 'icon-upload-slots',
hideOnClick: false,
menu: new Ext.menu.Menu({
items: [{
items: [
{
torrentAction: ['max_upload_slots', 0],
text: '0',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_upload_slots', 1],
text: '1',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_upload_slots', 2],
text: '2',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_upload_slots', 3],
text: '3',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['max_upload_slots', 5],
text: '5',
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
},{
scope: deluge.menus,
},
{
torrentAction: ['max_upload_slots', -1],
text: _('Unlimited'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}]
})
}, {
scope: deluge.menus,
},
],
}),
},
{
id: 'auto_managed',
text: _('Auto Managed'),
hideOnClick: false,
menu: new Ext.menu.Menu({
items: [{
items: [
{
torrentAction: ['auto_managed', true],
text: _('On'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: ['auto_managed', false],
text: _('Off'),
handler: deluge.menus.onTorrentActionSetOpt,
scope: deluge.menus
}]
})
}]
})
}, '-', {
scope: deluge.menus,
},
],
}),
},
],
}),
},
'-',
{
text: _('Queue'),
iconCls: 'icon-queue',
hideOnClick: false,
menu: new Ext.menu.Menu({
items: [{
items: [
{
torrentAction: 'queue_top',
text: _('Top'),
iconCls: 'icon-top',
handler: deluge.menus.onTorrentActionMethod,
scope: deluge.menus
},{
scope: deluge.menus,
},
{
torrentAction: 'queue_up',
text: _('Up'),
iconCls: 'icon-up',
handler: deluge.menus.onTorrentActionMethod,
scope: deluge.menus
},{
scope: deluge.menus,
},
{
torrentAction: 'queue_down',
text: _('Down'),
iconCls: 'icon-down',
handler: deluge.menus.onTorrentActionMethod,
scope: deluge.menus
},{
scope: deluge.menus,
},
{
torrentAction: 'queue_bottom',
text: _('Bottom'),
iconCls: 'icon-bottom',
handler: deluge.menus.onTorrentActionMethod,
scope: deluge.menus
}]
})
}, '-', {
scope: deluge.menus,
},
],
}),
},
'-',
{
torrentAction: 'force_reannounce',
text: _('Update Tracker'),
iconCls: 'icon-update-tracker',
handler: deluge.menus.onTorrentActionMethod,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: 'edit_trackers',
text: _('Edit Trackers'),
iconCls: 'icon-edit-trackers',
handler: deluge.menus.onTorrentActionShow,
scope: deluge.menus
}, '-', {
scope: deluge.menus,
},
'-',
{
torrentAction: 'remove',
text: _('Remove Torrent'),
iconCls: 'icon-remove',
handler: deluge.menus.onTorrentActionShow,
scope: deluge.menus
}, '-', {
scope: deluge.menus,
},
'-',
{
torrentAction: 'force_recheck',
text: _('Force Recheck'),
iconCls: 'icon-recheck',
handler: deluge.menus.onTorrentActionMethod,
scope: deluge.menus
}, {
scope: deluge.menus,
},
{
torrentAction: 'move',
text: _('Move Download Folder'),
iconCls: 'icon-move',
handler: deluge.menus.onTorrentActionShow,
scope: deluge.menus
}]
scope: deluge.menus,
},
],
});
deluge.menus.filePriorities = new Ext.menu.Menu({
id: 'filePrioritiesMenu',
items: [{
items: [
{
id: 'expandAll',
text: _('Expand All'),
iconCls: 'icon-expand-all'
}, '-', {
iconCls: 'icon-expand-all',
},
'-',
{
id: 'ignore',
text: _('Ignore'),
iconCls: 'icon-do-not-download',
filePriority: FILE_PRIORITY['Ignore']
}, {
filePriority: FILE_PRIORITY['Ignore'],
},
{
id: 'low',
text: _('Low'),
iconCls: 'icon-low',
filePriority: FILE_PRIORITY['Low']
}, {
filePriority: FILE_PRIORITY['Low'],
},
{
id: 'normal',
text: _('Normal'),
iconCls: 'icon-normal',
filePriority: FILE_PRIORITY['Normal']
}, {
filePriority: FILE_PRIORITY['Normal'],
},
{
id: 'high',
text: _('High'),
iconCls: 'icon-high',
filePriority: FILE_PRIORITY['High']
}]
filePriority: FILE_PRIORITY['High'],
},
],
});

View file

@ -10,9 +10,9 @@
Ext.namespace('Deluge');
Deluge.MoveStorage = Ext.extend(Ext.Window, {
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
title: _('Move Download Folder'),
width: 375,
height: 110,
@ -23,8 +23,10 @@ Deluge.MoveStorage = Ext.extend(Ext.Window, {
iconCls: 'x-deluge-move-storage',
plain: true,
constrainHeader: true,
resizable: false
}, config);
resizable: false,
},
config
);
Deluge.MoveStorage.superclass.constructor.call(this, config);
},
@ -39,13 +41,13 @@ Deluge.MoveStorage = Ext.extend(Ext.Window, {
border: false,
defaultType: 'textfield',
width: 300,
bodyStyle: 'padding: 5px'
bodyStyle: 'padding: 5px',
});
this.moveLocation = this.form.add({
fieldLabel: _('Download Folder'),
name: 'location',
width: 240
width: 240,
});
//this.form.add({
// xtype: 'button',
@ -78,6 +80,6 @@ Deluge.MoveStorage = Ext.extend(Ext.Window, {
var dest = this.moveLocation.getValue();
deluge.client.core.move_storage(this.torrentIds, dest);
this.hide();
}
},
});
deluge.moveStorage = new Deluge.MoveStorage();

View file

@ -15,7 +15,6 @@
* @extends Deluge.OptionsManager
*/
Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
constructor: function(config) {
this.currentId = null;
this.stored = {};
@ -32,9 +31,13 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
if (!dontUpdateBinds) {
for (var option in this.options) {
if (!this.binds[option]) continue;
Ext.each(this.binds[option], function(bind) {
Ext.each(
this.binds[option],
function(bind) {
bind.setValue(this.get(option));
}, this);
},
this
);
}
}
return oldId;
@ -45,7 +48,10 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
* @param {String} id
*/
commit: function() {
this.stored[this.currentId] = Ext.apply(this.stored[this.currentId], this.changed[this.currentId]);
this.stored[this.currentId] = Ext.apply(
this.stored[this.currentId],
this.changed[this.currentId]
);
this.reset();
},
@ -57,18 +63,28 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
get: function() {
if (arguments.length == 1) {
var option = arguments[0];
return (this.isDirty(option)) ? this.changed[this.currentId][option] : this.getDefault(option);
return this.isDirty(option)
? this.changed[this.currentId][option]
: this.getDefault(option);
} else if (arguments.length == 0) {
var options = {};
for (var option in this.options) {
options[option] = (this.isDirty(option)) ? this.changed[this.currentId][option] : this.getDefault(option);
options[option] = this.isDirty(option)
? this.changed[this.currentId][option]
: this.getDefault(option);
}
return options;
} else {
var options = {};
Ext.each(arguments, function(option) {
options[option] = (this.isDirty(option)) ? this.changed[this.currentId][option] : this.getDefault(option);
}, this);
Ext.each(
arguments,
function(option) {
options[option] = this.isDirty(option)
? this.changed[this.currentId][option]
: this.getDefault(option);
},
this
);
return options;
}
},
@ -79,7 +95,9 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
* @returns {Object} the value of the option
*/
getDefault: function(option) {
return (this.has(option)) ? this.stored[this.currentId][option] : this.options[option];
return this.has(option)
? this.stored[this.currentId][option]
: this.options[option];
},
/**
@ -87,7 +105,7 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
* @returns {Object} the changed options
*/
getDirty: function() {
return (this.changed[this.currentId]) ? this.changed[this.currentId] : {};
return this.changed[this.currentId] ? this.changed[this.currentId] : {};
},
/**
@ -96,7 +114,10 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
* @returns {Boolean} true if the option has been changed, else false.
*/
isDirty: function(option) {
return (this.changed[this.currentId] && !Ext.isEmpty(this.changed[this.currentId][option]));
return (
this.changed[this.currentId] &&
!Ext.isEmpty(this.changed[this.currentId][option])
);
},
/**
@ -106,7 +127,10 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
* @returns {Boolean} true if the id has an option, else false.
*/
has: function(option) {
return (this.stored[this.currentId] && !Ext.isEmpty(this.stored[this.currentId][option]));
return (
this.stored[this.currentId] &&
!Ext.isEmpty(this.stored[this.currentId][option])
);
},
/**
@ -171,7 +195,8 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
this.update(key, option[key]);
}
} else {
if (!this.changed[this.currentId]) this.changed[this.currentId] = {};
if (!this.changed[this.currentId])
this.changed[this.currentId] = {};
var defaultValue = this.getDefault(option);
value = this.convertValueType(defaultValue, value);
@ -180,7 +205,8 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
if (oldValue == value) return;
if (defaultValue == value) {
if (this.isDirty(option)) delete this.changed[this.currentId][option];
if (this.isDirty(option))
delete this.changed[this.currentId][option];
this.fireEvent('changed', option, value, oldValue);
return;
} else {
@ -188,5 +214,5 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
this.fireEvent('changed', option, value, oldValue);
}
}
}
},
});

View file

@ -18,7 +18,6 @@ Ext.namespace('Deluge');
* @param {Object} config Configuration options
*/
Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
constructor: function(config) {
config = config || {};
this.binds = {};
@ -31,7 +30,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
* @event add
* Fires when an option is added
*/
'add': true,
add: true,
/**
* @event changed
@ -40,13 +39,13 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
* @param {Mixed} value The options new value
* @param {Mixed} oldValue The options old value
*/
'changed': true,
changed: true,
/**
* @event reset
* Fires when the options are reset
*/
'reset': true
reset: true,
});
this.on('changed', this.onChange, this);
@ -104,7 +103,10 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
case 'boolean':
if (Ext.type(value) == 'string') {
value = value.toLowerCase();
value = (value == 'true' || value == '1' || value == 'on') ? true : false;
value =
value == 'true' || value == '1' || value == 'on'
? true
: false;
} else {
value = Boolean(value);
}
@ -122,13 +124,21 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
get: function() {
if (arguments.length == 1) {
var option = arguments[0];
return (this.isDirty(option)) ? this.changed[option] : this.options[option];
return this.isDirty(option)
? this.changed[option]
: this.options[option];
} else {
var options = {};
Ext.each(arguments, function(option) {
Ext.each(
arguments,
function(option) {
if (!this.has(option)) return;
options[option] = (this.isDirty(option)) ? this.changed[option] : this.options[option];
}, this);
options[option] = this.isDirty(option)
? this.changed[option]
: this.options[option];
},
this
);
return options;
}
},
@ -164,7 +174,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
* @returns {Boolean} true if the option exists, else false.
*/
has: function(option) {
return (this.options[option]);
return this.options[option];
},
/**
@ -190,7 +200,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
}
} else {
this.options[option] = value;
this.onChange(option, value)
this.onChange(option, value);
}
},
@ -255,11 +265,15 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
onChange: function(option, newValue, oldValue) {
// If we don't have a bind there's nothing to do.
if (Ext.isEmpty(this.binds[option])) return;
Ext.each(this.binds[option], function(bind) {
Ext.each(
this.binds[option],
function(bind) {
// The field is currently focused so we do not want to change it.
if (bind == this.focused) return;
// Set the form field to the new value.
bind.setValue(newValue);
}, this);
}
},
this
);
},
});

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge');
* @extends Ext.Window
*/
Deluge.OtherLimitWindow = Ext.extend(Ext.Window, {
layout: 'fit',
width: 210,
height: 100,
@ -29,19 +28,21 @@ Deluge.OtherLimitWindow = Ext.extend(Ext.Window, {
bodyStyle: 'padding: 5px',
layout: 'hbox',
layoutConfig: {
pack: 'start'
pack: 'start',
},
items: [{
items: [
{
xtype: 'spinnerfield',
name: 'limit'
}]
name: 'limit',
},
],
});
if (this.initialConfig.unit) {
this.form.add({
border: false,
baseCls: 'x-plain',
bodyStyle: 'padding: 5px',
html: this.initialConfig.unit
html: this.initialConfig.unit,
});
} else {
this.setSize(180, 100);
@ -67,12 +68,15 @@ Deluge.OtherLimitWindow = Ext.extend(Ext.Window, {
deluge.client.core.set_config(config, {
success: function() {
deluge.ui.update();
}
},
});
this.hide();
},
doFocusField: function() {
this.form.getForm().findField('limit').focus(true, 10);
}
this.form
.getForm()
.findField('limit')
.focus(true, 10);
},
});

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge');
* @extends Ext.util.Observable
*/
Deluge.Plugin = Ext.extend(Ext.util.Observable, {
/**
* The plugins name
* @property name
@ -29,13 +28,13 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, {
* @event enabled
* @param {Plugin} plugin the plugin instance
*/
'enabled': true,
enabled: true,
/**
* @event disabled
* @param {Plugin} plugin the plugin instance
*/
'disabled': true
disabled: true,
});
Deluge.Plugin.superclass.constructor.call(this, config);
},
@ -61,14 +60,15 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, {
registerTorrentStatus: function(key, header, options) {
options = options || {};
var cc = options.colCfg || {}, sc = options.storeCfg || {};
var cc = options.colCfg || {},
sc = options.storeCfg || {};
sc = Ext.apply(sc, { name: key });
deluge.torrents.meta.fields.push(sc);
deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);
cc = Ext.apply(cc, {
header: header,
dataIndex: key
dataIndex: key,
});
var cols = deluge.torrents.columns.slice(0);
cols.push(cc);
@ -100,7 +100,7 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, {
});
Deluge.Keys.Grid = keys;
deluge.torrents.getView().refresh(true);
}
},
});
Ext.ns('Deluge.plugins');

View file

@ -13,7 +13,6 @@
* @extends Ext.Window
*/
Deluge.RemoveWindow = Ext.extend(Ext.Window, {
title: _('Remove Torrent'),
layout: 'fit',
width: 350,
@ -39,12 +38,14 @@ Deluge.RemoveWindow = Ext.extend(Ext.Window, {
deluge.client.core.remove_torrents(this.torrentIds, removeData, {
success: function(result) {
if (result == true) {
console.log('Error(s) occured when trying to delete torrent(s).');
console.log(
'Error(s) occured when trying to delete torrent(s).'
);
}
this.onRemoved(this.torrentIds);
},
scope: this,
torrentIds: this.torrentIds
torrentIds: this.torrentIds,
});
},
@ -70,7 +71,7 @@ Deluge.RemoveWindow = Ext.extend(Ext.Window, {
deluge.events.fire('torrentsRemoved', torrentIds);
this.hide();
deluge.ui.update();
}
},
});
deluge.removeWindow = new Deluge.RemoveWindow();

View file

@ -18,7 +18,6 @@
* @version 1.3
*/
Deluge.Sidebar = Ext.extend(Ext.Panel, {
// private
panels: {},
@ -26,7 +25,8 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
selected: null,
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
id: 'sidebar',
region: 'west',
cls: 'deluge-sidebar',
@ -35,8 +35,10 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
split: true,
width: 200,
minSize: 100,
collapsible: true
}, config);
collapsible: true,
},
config
);
Deluge.Sidebar.superclass.constructor.call(this, config);
},
@ -48,7 +50,7 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
createFilter: function(filter, states) {
var panel = new Deluge.FilterPanel({
filter: filter
filter: filter,
});
panel.on('selectionchange', function(view, nodes) {
deluge.ui.update();
@ -77,7 +79,7 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
},
getFilterStates: function() {
var states = {}
var states = {};
if (deluge.config.sidebar_multiple_filters) {
// Grab the filters from each of the filter panels
@ -99,7 +101,7 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
},
hasFilter: function(filter) {
return (this.panels[filter]) ? true : false;
return this.panels[filter] ? true : false;
},
// private
@ -126,13 +128,17 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
}
// Perform a cleanup of fitlers that are not enabled any more.
Ext.each(Ext.keys(this.panels), function(filter) {
Ext.each(
Ext.keys(this.panels),
function(filter) {
if (Ext.keys(filters).indexOf(filter) == -1) {
// We need to remove the panel
this.remove(this.panels[filter]);
this.doLayout();
delete this.panels[filter];
}
}, this);
}
},
this
);
},
});

View file

@ -11,11 +11,14 @@ Ext.namespace('Deluge');
Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
id: 'deluge-statusbar',
defaultIconCls: 'x-deluge-statusbar x-not-connected',
defaultText: _('Not Connected')
}, config);
defaultText: _('Not Connected'),
},
config
);
Deluge.Statusbar.superclass.constructor.call(this, config);
},
@ -27,150 +30,184 @@ Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
},
createButtons: function() {
this.buttons = this.add({
this.buttons = this.add(
{
id: 'statusbar-connections',
text: ' ',
cls: 'x-btn-text-icon',
iconCls: 'x-deluge-connections',
tooltip: _('Connections'),
menu: new Deluge.StatusbarMenu({
items: [{
items: [
{
text: '50',
value: '50',
group: 'max_connections_global',
checked: false
},{
checked: false,
},
{
text: '100',
value: '100',
group: 'max_connections_global',
checked: false
},{
checked: false,
},
{
text: '200',
value: '200',
group: 'max_connections_global',
checked: false
},{
checked: false,
},
{
text: '300',
value: '300',
group: 'max_connections_global',
checked: false
},{
checked: false,
},
{
text: '500',
value: '500',
group: 'max_connections_global',
checked: false
},{
checked: false,
},
{
text: _('Unlimited'),
value: '-1',
group: 'max_connections_global',
checked: false
},'-',{
checked: false,
},
'-',
{
text: _('Other'),
value: 'other',
group: 'max_connections_global',
checked: false
}],
checked: false,
},
],
otherWin: {
title: _('Set Maximum Connections')
}
})
}, '-', {
title: _('Set Maximum Connections'),
},
}),
},
'-',
{
id: 'statusbar-downspeed',
text: ' ',
cls: 'x-btn-text-icon',
iconCls: 'x-deluge-downloading',
tooltip: _('Download Speed'),
menu: new Deluge.StatusbarMenu({
items: [{
items: [
{
value: '5',
text: _('5 KiB/s'),
group: 'max_download_speed',
checked: false
},{
checked: false,
},
{
value: '10',
text: _('10 KiB/s'),
group: 'max_download_speed',
checked: false
},{
checked: false,
},
{
value: '30',
text: _('30 KiB/s'),
group: 'max_download_speed',
checked: false
},{
checked: false,
},
{
value: '80',
text: _('80 KiB/s'),
group: 'max_download_speed',
checked: false
},{
checked: false,
},
{
value: '300',
text: _('300 KiB/s'),
group: 'max_download_speed',
checked: false
},{
checked: false,
},
{
value: '-1',
text: _('Unlimited'),
group: 'max_download_speed',
checked: false
},'-',{
checked: false,
},
'-',
{
value: 'other',
text: _('Other'),
group: 'max_download_speed',
checked: false
}],
checked: false,
},
],
otherWin: {
title: _('Set Maximum Download Speed'),
unit: _('KiB/s')
}
})
}, '-', {
unit: _('KiB/s'),
},
}),
},
'-',
{
id: 'statusbar-upspeed',
text: ' ',
cls: 'x-btn-text-icon',
iconCls: 'x-deluge-seeding',
tooltip: _('Upload Speed'),
menu: new Deluge.StatusbarMenu({
items: [{
items: [
{
value: '5',
text: _('5 KiB/s'),
group: 'max_upload_speed',
checked: false
},{
checked: false,
},
{
value: '10',
text: _('10 KiB/s'),
group: 'max_upload_speed',
checked: false
},{
checked: false,
},
{
value: '30',
text: _('30 KiB/s'),
group: 'max_upload_speed',
checked: false
},{
checked: false,
},
{
value: '80',
text: _('80 KiB/s'),
group: 'max_upload_speed',
checked: false
},{
checked: false,
},
{
value: '300',
text: _('300 KiB/s'),
group: 'max_upload_speed',
checked: false
},{
checked: false,
},
{
value: '-1',
text: _('Unlimited'),
group: 'max_upload_speed',
checked: false
},'-',{
checked: false,
},
'-',
{
value: 'other',
text: _('Other'),
group: 'max_upload_speed',
checked: false
}],
checked: false,
},
],
otherWin: {
title: _('Set Maximum Upload Speed'),
unit: _('KiB/s')
}
})
}, '-', {
unit: _('KiB/s'),
},
}),
},
'-',
{
id: 'statusbar-traffic',
text: ' ',
cls: 'x-btn-text-icon',
@ -179,19 +216,25 @@ Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
handler: function() {
deluge.preferences.show();
deluge.preferences.selectPage('Network');
}
}, '-', {
},
},
'-',
{
id: 'statusbar-externalip',
text: ' ',
cls: 'x-btn-text',
tooltip: _('External IP Address')
}, '-', {
tooltip: _('External IP Address'),
},
'-',
{
id: 'statusbar-dht',
text: ' ',
cls: 'x-btn-text-icon',
iconCls: 'x-deluge-dht',
tooltip: _('DHT Nodes')
}, '-', {
tooltip: _('DHT Nodes'),
},
'-',
{
id: 'statusbar-freespace',
text: ' ',
cls: 'x-btn-text-icon',
@ -200,15 +243,16 @@ Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
handler: function() {
deluge.preferences.show();
deluge.preferences.selectPage('Downloads');
},
}
});
);
this.created = true;
},
onConnect: function() {
this.setStatus({
iconCls: 'x-connected',
text: ''
text: '',
});
if (!this.created) {
this.createButtons();
@ -233,16 +277,24 @@ Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
update: function(stats) {
if (!stats) return;
function addSpeed(val) {return val + ' KiB/s'}
function addSpeed(val) {
return val + ' KiB/s';
}
var updateStat = function(name, config) {
var item = this.items.get('statusbar-' + name);
if (config.limit.value > 0) {
var value = (config.value.formatter) ? config.value.formatter(config.value.value, true) : config.value.value;
var limit = (config.limit.formatter) ? config.limit.formatter(config.limit.value, true) : config.limit.value;
var value = config.value.formatter
? config.value.formatter(config.value.value, true)
: config.value.value;
var limit = config.limit.formatter
? config.limit.formatter(config.limit.value, true)
: config.limit.value;
var str = String.format(config.format, value, limit);
} else {
var str = (config.value.formatter) ? config.value.formatter(config.value.value, true) : config.value.value;
var str = config.value.formatter
? config.value.formatter(config.value.value, true)
: config.value.value;
}
item.setText(str);
@ -253,48 +305,58 @@ Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
updateStat('connections', {
value: { value: stats.num_connections },
limit: { value: stats.max_num_connections },
format: '{0} ({1})'
format: '{0} ({1})',
});
updateStat('downspeed', {
value: {
value: stats.download_rate,
formatter: Deluge.Formatters.speed
formatter: Deluge.Formatters.speed,
},
limit: {
value: stats.max_download,
formatter: addSpeed
formatter: addSpeed,
},
format: '{0} ({1})'
format: '{0} ({1})',
});
updateStat('upspeed', {
value: {
value: stats.upload_rate,
formatter: Deluge.Formatters.speed
formatter: Deluge.Formatters.speed,
},
limit: {
value: stats.max_upload,
formatter: addSpeed
formatter: addSpeed,
},
format: '{0} ({1})'
format: '{0} ({1})',
});
updateStat('traffic', {
value: {
value: stats.download_protocol_rate,
formatter: Deluge.Formatters.speed
formatter: Deluge.Formatters.speed,
},
limit: {
value: stats.upload_protocol_rate,
formatter: Deluge.Formatters.speed
formatter: Deluge.Formatters.speed,
},
format: '{0}/{1}'
format: '{0}/{1}',
});
this.items.get('statusbar-dht').setText(stats.dht_nodes);
this.items.get('statusbar-freespace').setText(stats.free_space >= 0 ? fsize(stats.free_space): _('Error'));
this.items.get('statusbar-externalip').setText(
String.format(_('<b>IP</b> {0}'), stats.external_ip ? stats.external_ip: _("n/a")));
}
this.items
.get('statusbar-freespace')
.setText(
stats.free_space >= 0 ? fsize(stats.free_space) : _('Error')
);
this.items
.get('statusbar-externalip')
.setText(
String.format(
_('<b>IP</b> {0}'),
stats.external_ip ? stats.external_ip : _('n/a')
)
);
},
});

View file

@ -15,10 +15,11 @@ Ext.ns('Deluge');
* @extends Ext.menu.Menu
*/
Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
initComponent: function() {
Deluge.StatusbarMenu.superclass.initComponent.call(this);
this.otherWin = new Deluge.OtherLimitWindow(this.initialConfig.otherWin || {});
this.otherWin = new Deluge.OtherLimitWindow(
this.initialConfig.otherWin || {}
);
this.items.each(function(item) {
if (item.getXType() != 'menucheckitem') return;
@ -33,7 +34,7 @@ Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
setValue: function(value) {
var beenSet = false;
// set the new value
this.value = value = (value == 0) ? -1 : value;
this.value = value = value == 0 ? -1 : value;
var other = null;
// uncheck all items
@ -61,12 +62,12 @@ Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
onLimitChanged: function(item, checked) {
if (!checked || item.value == 'other') return; // We do not care about unchecked or other.
var config = {}
config[item.group] = item.value
var config = {};
config[item.group] = item.value;
deluge.client.core.set_config(config, {
success: function() {
deluge.ui.update();
}
},
});
},
@ -74,5 +75,5 @@ Deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
this.otherWin.group = item.group;
this.otherWin.setValue(this.value);
this.otherWin.show();
}
},
});

View file

@ -15,92 +15,108 @@
*/
Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
items: [
{
id: 'tbar-deluge-text',
disabled: true,
text: _('Deluge'),
iconCls: 'x-deluge-main-panel'
}, new Ext.Toolbar.Separator(),
iconCls: 'x-deluge-main-panel',
},
new Ext.Toolbar.Separator(),
{
id: 'create',
disabled: true,
hidden: true,
text: _('Create'),
iconCls: 'icon-create',
handler: this.onTorrentAction
},{
handler: this.onTorrentAction,
},
{
id: 'add',
disabled: true,
text: _('Add'),
iconCls: 'icon-add',
handler: this.onTorrentAdd
},{
handler: this.onTorrentAdd,
},
{
id: 'remove',
disabled: true,
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onTorrentAction
}, new Ext.Toolbar.Separator(),{
handler: this.onTorrentAction,
},
new Ext.Toolbar.Separator(),
{
id: 'pause',
disabled: true,
text: _('Pause'),
iconCls: 'icon-pause',
handler: this.onTorrentAction
},{
handler: this.onTorrentAction,
},
{
id: 'resume',
disabled: true,
text: _('Resume'),
iconCls: 'icon-resume',
handler: this.onTorrentAction
}, new Ext.Toolbar.Separator(),{
handler: this.onTorrentAction,
},
new Ext.Toolbar.Separator(),
{
id: 'up',
cls: 'x-btn-text-icon',
disabled: true,
text: _('Up'),
iconCls: 'icon-up',
handler: this.onTorrentAction
},{
handler: this.onTorrentAction,
},
{
id: 'down',
disabled: true,
text: _('Down'),
iconCls: 'icon-down',
handler: this.onTorrentAction
}, new Ext.Toolbar.Separator(),{
handler: this.onTorrentAction,
},
new Ext.Toolbar.Separator(),
{
id: 'preferences',
text: _('Preferences'),
iconCls: 'x-deluge-preferences',
handler: this.onPreferencesClick,
scope: this
},{
scope: this,
},
{
id: 'connectionman',
text: _('Connection Manager'),
iconCls: 'x-deluge-connection-manager',
handler: this.onConnectionManagerClick,
scope: this
},'->',{
scope: this,
},
'->',
{
id: 'help',
iconCls: 'icon-help',
text: _('Help'),
handler: this.onHelpClick,
scope: this
},{
scope: this,
},
{
id: 'logout',
iconCls: 'icon-logout',
disabled: true,
text: _('Logout'),
handler: this.onLogout,
scope: this
}
]
}, config);
scope: this,
},
],
},
config
);
Deluge.Toolbar.superclass.constructor.call(this, config);
},
connectedButtons: [
'add', 'remove', 'pause', 'resume', 'up', 'down'
],
connectedButtons: ['add', 'remove', 'pause', 'resume', 'up', 'down'],
initComponent: function() {
Deluge.Toolbar.superclass.initComponent.call(this);
@ -109,15 +125,23 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
},
onConnect: function() {
Ext.each(this.connectedButtons, function(buttonId) {
Ext.each(
this.connectedButtons,
function(buttonId) {
this.items.get(buttonId).enable();
}, this);
},
this
);
},
onDisconnect: function() {
Ext.each(this.connectedButtons, function(buttonId) {
Ext.each(
this.connectedButtons,
function(buttonId) {
this.items.get(buttonId).disable();
}, this);
},
this
);
},
onLogin: function() {
@ -157,7 +181,7 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
deluge.client.core[item.id + '_torrent'](ids, {
success: function() {
deluge.ui.update();
}
},
});
break;
case 'up':
@ -165,7 +189,7 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
deluge.client.core['queue_' + item.id](ids, {
success: function() {
deluge.ui.update();
}
},
});
break;
}
@ -173,5 +197,5 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
onTorrentAdd: function() {
deluge.add.show();
}
},
});

View file

@ -9,13 +9,16 @@
*/
(function() {
/* Renderers for the Torrent Grid */
function queueRenderer(value) {
return (value == -1) ? '' : value + 1;
return value == -1 ? '' : value + 1;
}
function torrentNameRenderer(value, p, r) {
return String.format('<div class="torrent-name x-deluge-{0}">{1}</div>', r.data['state'].toLowerCase(), value);
return String.format(
'<div class="torrent-name x-deluge-{0}">{1}</div>',
r.data['state'].toLowerCase(),
value
);
}
function torrentSpeedRenderer(value) {
if (!value) return;
@ -30,9 +33,9 @@
var progress = value;
var text = _(r.data['state']) + ' ' + value.toFixed(2) + '%';
if (this.style) {
var style = this.style
var style = this.style;
} else {
var style = p.style
var style = p.style;
}
var width = new Number(style.match(/\w+:\s*(\d+)\w+/)[1]);
return Deluge.progressBar(value, width - 8, text);
@ -52,10 +55,15 @@
}
}
function availRenderer(value, p, r) {
return (value < 0) ? '&infin;' : parseFloat(new Number(value).toFixed(3));
return value < 0 ? '&infin;' : parseFloat(new Number(value).toFixed(3));
}
function trackerRenderer(value, p, r) {
return String.format('<div style="background: url(' + deluge.config.base + 'tracker/{0}) no-repeat; padding-left: 20px;">{0}</div>', value);
return String.format(
'<div style="background: url(' +
deluge.config.base +
'tracker/{0}) no-repeat; padding-left: 20px;">{0}</div>',
value
);
}
function etaSorter(eta) {
@ -63,7 +71,7 @@
}
function dateOrNever(date) {
return date > 0.0 ? fdate(date) : _('Never')
return date > 0.0 ? fdate(date) : _('Never');
}
/**
@ -78,194 +86,222 @@
* @param {Object} config Configuration options
*/
Deluge.TorrentGrid = Ext.extend(Ext.grid.GridPanel, {
// object to store contained torrent ids
torrents: {},
columns: [{
columns: [
{
id: 'queue',
header: '#',
width: 30,
sortable: true,
renderer: queueRenderer,
dataIndex: 'queue'
}, {
dataIndex: 'queue',
},
{
id: 'name',
header: _('Name'),
width: 150,
sortable: true,
renderer: torrentNameRenderer,
dataIndex: 'name'
}, {
dataIndex: 'name',
},
{
header: _('Size'),
width: 75,
sortable: true,
renderer: fsize,
dataIndex: 'total_wanted'
}, {
dataIndex: 'total_wanted',
},
{
header: _('Progress'),
width: 150,
sortable: true,
renderer: torrentProgressRenderer,
dataIndex: 'progress'
}, {
dataIndex: 'progress',
},
{
header: _('Seeds'),
hidden: true,
width: 60,
sortable: true,
renderer: seedsRenderer,
dataIndex: 'num_seeds'
}, {
dataIndex: 'num_seeds',
},
{
header: _('Peers'),
hidden: true,
width: 60,
sortable: true,
renderer: peersRenderer,
dataIndex: 'num_peers'
}, {
dataIndex: 'num_peers',
},
{
header: _('Down Speed'),
width: 80,
sortable: true,
renderer: torrentSpeedRenderer,
dataIndex: 'download_payload_rate'
}, {
dataIndex: 'download_payload_rate',
},
{
header: _('Up Speed'),
width: 80,
sortable: true,
renderer: torrentSpeedRenderer,
dataIndex: 'upload_payload_rate'
}, {
dataIndex: 'upload_payload_rate',
},
{
header: _('ETA'),
width: 60,
sortable: true,
renderer: ftime,
dataIndex: 'eta'
}, {
dataIndex: 'eta',
},
{
header: _('Ratio'),
hidden: true,
width: 60,
sortable: true,
renderer: availRenderer,
dataIndex: 'ratio'
}, {
dataIndex: 'ratio',
},
{
header: _('Avail'),
hidden: true,
width: 60,
sortable: true,
renderer: availRenderer,
dataIndex: 'distributed_copies'
}, {
dataIndex: 'distributed_copies',
},
{
header: _('Added'),
hidden: true,
width: 80,
sortable: true,
renderer: fdate,
dataIndex: 'time_added'
}, {
dataIndex: 'time_added',
},
{
header: _('Complete Seen'),
hidden: true,
width: 80,
sortable: true,
renderer: dateOrNever,
dataIndex: 'last_seen_complete'
}, {
dataIndex: 'last_seen_complete',
},
{
header: _('Completed'),
hidden: true,
width: 80,
sortable: true,
renderer: dateOrNever,
dataIndex: 'completed_time'
}, {
dataIndex: 'completed_time',
},
{
header: _('Tracker'),
hidden: true,
width: 120,
sortable: true,
renderer: trackerRenderer,
dataIndex: 'tracker_host'
}, {
dataIndex: 'tracker_host',
},
{
header: _('Download Folder'),
hidden: true,
width: 120,
sortable: true,
renderer: fplain,
dataIndex: 'download_location'
}, {
dataIndex: 'download_location',
},
{
header: _('Owner'),
width: 80,
sortable: true,
renderer: fplain,
dataIndex: 'owner'
}, {
dataIndex: 'owner',
},
{
header: _('Public'),
hidden: true,
width: 80,
sortable: true,
renderer: fplain,
dataIndex: 'public'
}, {
dataIndex: 'public',
},
{
header: _('Shared'),
hidden: true,
width: 80,
sortable: true,
renderer: fplain,
dataIndex: 'shared'
}, {
dataIndex: 'shared',
},
{
header: _('Downloaded'),
hidden: true,
width: 75,
sortable: true,
renderer: fsize,
dataIndex: 'total_done'
}, {
dataIndex: 'total_done',
},
{
header: _('Uploaded'),
hidden: true,
width: 75,
sortable: true,
renderer: fsize,
dataIndex: 'total_uploaded'
}, {
dataIndex: 'total_uploaded',
},
{
header: _('Remaining'),
hidden: true,
width: 75,
sortable: true,
renderer: fsize,
dataIndex: 'total_remaining'
}, {
dataIndex: 'total_remaining',
},
{
header: _('Down Limit'),
hidden: true,
width: 75,
sortable: true,
renderer: torrentLimitRenderer,
dataIndex: 'max_download_speed'
}, {
dataIndex: 'max_download_speed',
},
{
header: _('Up Limit'),
hidden: true,
width: 75,
sortable: true,
renderer: torrentLimitRenderer,
dataIndex: 'max_upload_speed'
}, {
dataIndex: 'max_upload_speed',
},
{
header: _('Seeds:Peers'),
hidden: true,
width: 75,
sortable: true,
renderer: availRenderer,
dataIndex: 'seeds_peers_ratio'
}, {
dataIndex: 'seeds_peers_ratio',
},
{
header: _('Last Transfer'),
hidden: true,
width: 75,
sortable: true,
renderer: ftime,
dataIndex: 'time_since_transfer'
}],
dataIndex: 'time_since_transfer',
},
],
meta: {
root: 'torrents',
idProperty: 'id',
fields: [
{name: 'queue', sortType: Deluge.data.SortTypes.asQueuePosition},
{
name: 'queue',
sortType: Deluge.data.SortTypes.asQueuePosition,
},
{ name: 'name', sortType: Deluge.data.SortTypes.asName },
{ name: 'total_wanted', type: 'int' },
{ name: 'state' },
@ -288,28 +324,32 @@
{ name: 'max_download_speed', type: 'int' },
{ name: 'max_upload_speed', type: 'int' },
{ name: 'seeds_peers_ratio', type: 'float' },
{name: 'time_since_transfer', type: 'int'}
]
{ name: 'time_since_transfer', type: 'int' },
],
},
keys: [{
keys: [
{
key: 'a',
ctrl: true,
stopEvent: true,
handler: function() {
deluge.torrents.getSelectionModel().selectAll();
}
}, {
},
},
{
key: [46],
stopEvent: true,
handler: function() {
ids = deluge.torrents.getSelectedIds();
deluge.removeWindow.show(ids);
}
}],
},
},
],
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
id: 'torrentGrid',
store: new Ext.data.JsonStore(this.meta),
columns: this.columns,
@ -324,9 +364,11 @@
stateful: true,
view: new Ext.ux.grid.BufferView({
rowHeight: 26,
scrollDelay: false
})
}, config);
scrollDelay: false,
}),
},
config
);
Deluge.TorrentGrid.superclass.constructor.call(this, config);
},
@ -375,7 +417,7 @@
* @return {String} The currently selected id.
*/
getSelectedId: function() {
return this.getSelectionModel().getSelected().id
return this.getSelectionModel().getSelected().id;
},
/**
@ -432,7 +474,7 @@
}, this);
store.commitChanges();
var sortState = store.getSortState()
var sortState = store.getSortState();
if (!sortState) return;
store.sort(sortState.field, sortState.direction);
},
@ -446,15 +488,19 @@
// private
onTorrentsRemoved: function(torrentIds) {
var selModel = this.getSelectionModel();
Ext.each(torrentIds, function(torrentId) {
Ext.each(
torrentIds,
function(torrentId) {
var record = this.getStore().getById(torrentId);
if (selModel.isSelected(record)) {
selModel.deselectRow(this.getStore().indexOf(record));
}
this.getStore().remove(record);
delete this.torrents[torrentId];
}, this);
}
},
this
);
},
});
deluge.torrents = new Deluge.TorrentGrid();
})();

View file

@ -24,7 +24,8 @@ var TORRENT_STATE_TRANSLATION = [
_('Paused'),
_('Checking'),
_('Queued'),
_('Error')];
_('Error'),
];
/**
* @static
@ -33,7 +34,6 @@ var TORRENT_STATE_TRANSLATION = [
* together and handles the 2 second poll.
*/
deluge.ui = {
errorCount: 0,
filters: null,
@ -62,9 +62,7 @@ deluge.ui = {
minSize: 100,
collapsible: true,
layout: 'fit',
items: [
deluge.details
]
items: [deluge.details],
});
this.MainPanel = new Ext.Panel({
@ -73,17 +71,13 @@ deluge.ui = {
layout: 'border',
border: false,
tbar: deluge.toolbar,
items: [
deluge.sidebar,
this.detailsPanel,
deluge.torrents
],
bbar: deluge.statusbar
items: [deluge.sidebar, this.detailsPanel, deluge.torrents],
bbar: deluge.statusbar,
});
this.Viewport = new Ext.Viewport({
layout: 'fit',
items: [this.MainPanel]
items: [this.MainPanel],
});
deluge.events.on('connect', this.onConnect, this);
@ -91,7 +85,7 @@ deluge.ui = {
deluge.events.on('PluginDisabledEvent', this.onPluginDisabled, this);
deluge.events.on('PluginEnabledEvent', this.onPluginEnabled, this);
deluge.client = new Ext.ux.util.RpcClient({
url: deluge.config.base + 'json'
url: deluge.config.base + 'json',
});
// enable all the already active plugins
@ -104,9 +98,14 @@ deluge.ui = {
// Initialize quicktips so all the tooltip configs start working.
Ext.QuickTips.init();
deluge.client.on('connected', function(e) {
deluge.client.on(
'connected',
function(e) {
deluge.login.show();
}, this, {single: true});
},
this,
{ single: true }
);
this.update = this.update.createDelegate(this);
this.checkConnection = this.checkConnection.createDelegate(this);
@ -118,7 +117,7 @@ deluge.ui = {
deluge.client.web.connected({
success: this.onConnectionSuccess,
failure: this.onConnectionError,
scope: this
scope: this,
});
},
@ -130,19 +129,17 @@ deluge.ui = {
deluge.client.web.update_ui(Deluge.Keys.Grid, filters, {
success: this.onUpdate,
failure: this.onUpdateError,
scope: this
scope: this,
});
deluge.details.update();
},
onConnectionError: function(error) {
},
onConnectionError: function(error) {},
onConnectionSuccess: function(result) {
deluge.statusbar.setStatus({
iconCls: 'x-deluge-statusbar icon-ok',
text: _('Connection restored')
text: _('Connection restored'),
});
clearInterval(this.checking);
if (!result) {
@ -156,12 +153,12 @@ deluge.ui = {
title: _('Lost Connection'),
msg: _('The connection to the webserver has been lost!'),
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
icon: Ext.MessageBox.ERROR,
});
deluge.events.fire('disconnect');
deluge.statusbar.setStatus({
text: _('Lost connection to webserver')}
);
text: _('Lost connection to webserver'),
});
this.checking = setInterval(this.checkConnection, 2000);
}
this.errorCount++;
@ -179,8 +176,12 @@ deluge.ui = {
}
if (deluge.config.show_session_speed) {
document.title = 'D: ' + fsize_short(data['stats'].download_rate, true) +
' U: ' + fsize_short(data['stats'].upload_rate, true) + ' - ' +
document.title =
'D: ' +
fsize_short(data['stats'].download_rate, true) +
' U: ' +
fsize_short(data['stats'].upload_rate, true) +
' - ' +
this.originalTitle;
}
if (Ext.areObjectsEqual(this.filters, this.oldFilters)) {
@ -205,7 +206,7 @@ deluge.ui = {
}
deluge.client.web.get_plugins({
success: this.onGotPlugins,
scope: this
scope: this,
});
},
@ -218,13 +219,17 @@ deluge.ui = {
},
onGotPlugins: function(plugins) {
Ext.each(plugins.enabled_plugins, function(plugin) {
Ext.each(
plugins.enabled_plugins,
function(plugin) {
if (deluge.plugins[plugin]) return;
deluge.client.web.get_plugin_resources(plugin, {
success: this.onGotPluginResources,
scope: this
scope: this,
});
}, this);
},
this
);
},
onPluginEnabled: function(pluginName) {
@ -233,20 +238,26 @@ deluge.ui = {
} else {
deluge.client.web.get_plugin_resources(pluginName, {
success: this.onGotPluginResources,
scope: this
scope: this,
});
}
},
onGotPluginResources: function(resources) {
var scripts = (Deluge.debug) ? resources.debug_scripts : resources.scripts;
Ext.each(scripts, function(script) {
var scripts = Deluge.debug
? resources.debug_scripts
: resources.scripts;
Ext.each(
scripts,
function(script) {
Ext.ux.JSLoader({
url: deluge.config.base + script,
onLoad: this.onPluginLoaded,
pluginName: resources.name
pluginName: resources.name,
});
}, this);
},
this
);
},
onPluginDisabled: function(pluginName) {
@ -273,8 +284,8 @@ deluge.ui = {
this.running = false;
deluge.torrents.getStore().removeAll();
}
}
}
},
};
Ext.onReady(function(e) {
deluge.ui.initialize();

View file

@ -13,7 +13,11 @@ Ext.namespace('Deluge.add');
// This override allows file upload buttons to contain icons
Ext.override(Ext.ux.form.FileUploadField, {
onRender: function(ct, position) {
Ext.ux.form.FileUploadField.superclass.onRender.call(this, ct, position);
Ext.ux.form.FileUploadField.superclass.onRender.call(
this,
ct,
position
);
this.wrap = this.el.wrap({ cls: 'x-form-field-wrap x-form-file-wrap' });
this.el.addClass('x-form-file-text');
@ -21,12 +25,16 @@ Ext.override(Ext.ux.form.FileUploadField, {
this.createFileInput();
var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
text: this.buttonText
text: this.buttonText,
});
this.button = new Ext.Button(Ext.apply(btnCfg, {
this.button = new Ext.Button(
Ext.apply(btnCfg, {
renderTo: this.wrap,
cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-text-icon' : '')
}));
cls:
'x-form-file-btn' +
(btnCfg.iconCls ? ' x-btn-text-icon' : ''),
})
);
if (this.buttonOnly) {
this.el.hide();
@ -35,7 +43,7 @@ Ext.override(Ext.ux.form.FileUploadField, {
this.bindListeners();
this.resizeEl = this.positionEl = this.wrap;
}
},
});
Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
@ -58,9 +66,15 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
function torrentRenderer(value, p, r) {
if (r.data['info_hash']) {
return String.format('<div class="x-deluge-add-torrent-name">{0}</div>', value);
return String.format(
'<div class="x-deluge-add-torrent-name">{0}</div>',
value
);
} else {
return String.format('<div class="x-deluge-add-torrent-name-loading">{0}</div>', value);
return String.format(
'<div class="x-deluge-add-torrent-name-loading">{0}</div>',
value
);
}
}
@ -68,29 +82,31 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
store: new Ext.data.SimpleStore({
fields: [
{ name: 'info_hash', mapping: 1 },
{name: 'text', mapping: 2}
{ name: 'text', mapping: 2 },
],
id: 0
id: 0,
}),
columns: [{
columns: [
{
id: 'torrent',
width: 150,
sortable: true,
renderer: torrentRenderer,
dataIndex: 'text'
}],
dataIndex: 'text',
},
],
stripeRows: true,
singleSelect: true,
listeners: {
'selectionchange': {
selectionchange: {
fn: this.onSelect,
scope: this
}
scope: this,
},
},
hideHeaders: true,
autoExpandColumn: 'torrent',
height: '100%',
autoScroll: true
autoScroll: true,
});
this.add({
@ -98,43 +114,51 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
items: [this.list],
border: false,
bbar: new Ext.Toolbar({
items: [{
items: [
{
id: 'fileUploadForm',
xtype: 'form',
layout: 'fit',
baseCls: 'x-plain',
fileUpload: true,
items: [{
items: [
{
buttonOnly: true,
xtype: 'fileuploadfield',
id: 'torrentFile',
name: 'file',
buttonCfg: {
iconCls: 'x-deluge-add-file',
text: _('File')
text: _('File'),
},
listeners: {
scope: this,
'fileselected': this.onFileSelected
}
}]
}, {
fileselected: this.onFileSelected,
},
},
],
},
{
text: _('Url'),
iconCls: 'icon-add-url',
handler: this.onUrl,
scope: this
}, {
scope: this,
},
{
text: _('Infohash'),
iconCls: 'icon-add-magnet',
hidden: true,
disabled: true
}, '->', {
disabled: true,
},
'->',
{
text: _('Remove'),
iconCls: 'icon-remove',
handler: this.onRemove,
scope: this
}]
})
scope: this,
},
],
}),
});
this.fileUploadForm = Ext.getCmp('fileUploadForm').getForm();
@ -157,13 +181,12 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
var id = r.get('info_hash');
torrents.push({
path: this.optionsPanel.getFilename(id),
options: this.optionsPanel.getOptions(id)
options: this.optionsPanel.getOptions(id),
});
}, this);
deluge.client.web.add_torrents(torrents, {
success: function(result) {
}
success: function(result) {},
});
this.clear();
this.hide();
@ -192,7 +215,8 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
this.list.getStore().remove(torrent);
this.optionsPanel.clear();
if (this.torrents && this.torrents[torrent.id]) delete this.torrents[torrent.id];
if (this.torrents && this.torrents[torrent.id])
delete this.torrents[torrent.id];
},
onSelect: function(list, selections) {
@ -222,7 +246,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
url: deluge.config.base + 'upload',
waitMsg: _('Uploading your torrent...'),
success: this.onUploadSuccess,
scope: this
scope: this,
});
var name = this.fileUploadForm.findField('torrentFile').value;
name = name.split('\\').slice(-1)[0];
@ -237,7 +261,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
deluge.client.web.get_torrent_info(filename, {
success: this.onGotInfo,
scope: this,
filename: filename
filename: filename,
});
}
},
@ -261,7 +285,7 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
buttons: Ext.MessageBox.OK,
modal: false,
icon: Ext.MessageBox.ERROR,
iconCls: 'x-deluge-icon-error'
iconCls: 'x-deluge-icon-error',
});
this.list.getStore().remove(r);
} else {
@ -275,5 +299,5 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
onUrl: function(button, event) {
this.url.show();
}
},
});

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge.add');
* @extends Ext.ux.tree.TreeGrid
*/
Deluge.add.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
layout: 'fit',
title: _('Files'),
@ -24,29 +23,37 @@ Deluge.add.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
disabled: true,
rootVisible: false,
columns: [{
columns: [
{
header: _('Filename'),
width: 295,
dataIndex: 'filename'
},{
dataIndex: 'filename',
},
{
header: _('Size'),
width: 60,
dataIndex: 'size',
tpl: new Ext.XTemplate('{size:this.fsize}', {
fsize: function(v) {
return fsize(v);
}
})
},{
},
}),
},
{
header: _('Download'),
width: 65,
dataIndex: 'download',
tpl: new Ext.XTemplate('{download:this.format}', {
format: function(v) {
return '<div rel="chkbox" class="x-grid3-check-col'+(v?'-on':'')+'"> </div>';
}
})
}],
return (
'<div rel="chkbox" class="x-grid3-check-col' +
(v ? '-on' : '') +
'"> </div>'
);
},
}),
},
],
initComponent: function() {
Deluge.add.FilesTab.superclass.initComponent.call(this);
@ -88,5 +95,5 @@ Deluge.add.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
if (el.getAttribute('rel') == 'chkbox') {
this.setDownload(node, !node.attributes.download);
}
}
},
});

View file

@ -10,7 +10,6 @@
Ext.ns('Deluge.add');
Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
torrents: {},
// layout options
@ -30,17 +29,24 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
addTorrent: function(torrent) {
this.torrents[torrent['info_hash']] = torrent;
var fileIndexes = {};
this.walkFileTree(torrent['files_tree'], function(filename, type, entry, parent) {
this.walkFileTree(
torrent['files_tree'],
function(filename, type, entry, parent) {
if (type != 'file') return;
fileIndexes[entry.index] = entry.download;
}, this);
},
this
);
var priorities = [];
Ext.each(Ext.keys(fileIndexes), function(index) {
priorities[index] = fileIndexes[index];
});
var oldId = this.form.optionsManager.changeId(torrent['info_hash'], true);
var oldId = this.form.optionsManager.changeId(
torrent['info_hash'],
true
);
this.form.optionsManager.setDefault('file_priorities', priorities);
this.form.optionsManager.changeId(oldId, true);
},
@ -59,7 +65,7 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
var options = this.form.optionsManager.get();
this.form.optionsManager.changeId(oldId, true);
Ext.each(options['file_priorities'], function(priority, index) {
options['file_priorities'][index] = (priority) ? 1 : 0;
options['file_priorities'][index] = priority ? 1 : 0;
});
return options;
},
@ -77,17 +83,22 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
this.form.setDisabled(false);
if (this.torrents[torrentId]['files_tree']) {
this.walkFileTree(this.torrents[torrentId]['files_tree'], function(filename, type, entry, parentNode) {
this.walkFileTree(
this.torrents[torrentId]['files_tree'],
function(filename, type, entry, parentNode) {
var node = new Ext.tree.TreeNode({
download: (entry.index) ? priorities[entry.index] : true,
download: entry.index ? priorities[entry.index] : true,
filename: filename,
fileindex: entry.index,
leaf: type != 'dir',
size: entry.length
size: entry.length,
});
parentNode.appendChild(node);
if (type == 'dir') return node;
}, this, root);
},
this,
root
);
root.firstChild.expand();
this.files.setDisabled(false);
this.files.show();
@ -96,7 +107,6 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
this.form.show();
this.files.setDisabled(true);
}
},
walkFileTree: function(files, callback, scope, parentNode) {
@ -105,7 +115,12 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
var type = entry.type;
if (scope) {
var ret = callback.apply(scope, [filename, type, entry, parentNode]);
var ret = callback.apply(scope, [
filename,
type,
entry,
parentNode,
]);
} else {
var ret = callback(filename, type, entry, parentNode);
}
@ -115,12 +130,17 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
},
onFilesChecked: function(nodes, newValue, oldValue) {
Ext.each(nodes, function(node) {
Ext.each(
nodes,
function(node) {
if (node.attributes.fileindex < 0) return;
var priorities = this.form.optionsManager.get('file_priorities');
var priorities = this.form.optionsManager.get(
'file_priorities'
);
priorities[node.attributes.fileindex] = newValue;
this.form.optionsManager.update('file_priorities', priorities);
}, this);
}
},
this
);
},
});

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge.add');
* @extends Ext.form.FormPanel
*/
Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
title: _('Options'),
height: 170,
border: false,
@ -35,14 +34,17 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
defaultType: 'textfield',
labelWidth: 1,
fieldLabel: '',
style: 'padding: 5px 0; margin-bottom: 0;'
style: 'padding: 5px 0; margin-bottom: 0;',
});
this.optionsManager.bind('download_location', fieldset.add({
this.optionsManager.bind(
'download_location',
fieldset.add({
fieldLabel: '',
name: 'download_location',
anchor: '95%',
labelSeparator: ''
}));
labelSeparator: '',
})
);
var fieldset = this.add({
xtype: 'fieldset',
title: _('Move Completed Folder'),
@ -51,20 +53,20 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
defaultType: 'togglefield',
labelWidth: 1,
fieldLabel: '',
style: 'padding: 5px 0; margin-bottom: 0;'
style: 'padding: 5px 0; margin-bottom: 0;',
});
var field = fieldset.add({
fieldLabel: '',
name: 'move_completed_path',
anchor:'98%'
anchor: '98%',
});
this.optionsManager.bind('move_completed', field.toggle)
this.optionsManager.bind('move_completed_path', field.input)
this.optionsManager.bind('move_completed', field.toggle);
this.optionsManager.bind('move_completed_path', field.input);
var panel = this.add({
border: false,
layout: 'column',
defaultType: 'fieldset'
defaultType: 'fieldset',
});
fieldset = panel.add({
@ -75,95 +77,131 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
labelWidth: 105,
width: 200,
defaultType: 'spinnerfield',
style: 'padding-right: 10px;'
style: 'padding-right: 10px;',
});
this.optionsManager.bind('max_download_speed', fieldset.add({
this.optionsManager.bind(
'max_download_speed',
fieldset.add({
fieldLabel: _('Max Down Speed'),
name: 'max_download_speed',
width: 60
}));
this.optionsManager.bind('max_upload_speed', fieldset.add({
width: 60,
})
);
this.optionsManager.bind(
'max_upload_speed',
fieldset.add({
fieldLabel: _('Max Up Speed'),
name: 'max_upload_speed',
width: 60
}));
this.optionsManager.bind('max_connections', fieldset.add({
width: 60,
})
);
this.optionsManager.bind(
'max_connections',
fieldset.add({
fieldLabel: _('Max Connections'),
name: 'max_connections',
width: 60
}));
this.optionsManager.bind('max_upload_slots', fieldset.add({
width: 60,
})
);
this.optionsManager.bind(
'max_upload_slots',
fieldset.add({
fieldLabel: _('Max Upload Slots'),
name: 'max_upload_slots',
width: 60
}));
width: 60,
})
);
fieldset = panel.add({
title: _('General'),
border: false,
autoHeight: true,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
this.optionsManager.bind('add_paused', fieldset.add({
this.optionsManager.bind(
'add_paused',
fieldset.add({
name: 'add_paused',
boxLabel: _('Add In Paused State'),
fieldLabel: '',
labelSeparator: ''
}));
this.optionsManager.bind('prioritize_first_last_pieces', fieldset.add({
labelSeparator: '',
})
);
this.optionsManager.bind(
'prioritize_first_last_pieces',
fieldset.add({
name: 'prioritize_first_last_pieces',
boxLabel: _('Prioritize First/Last Pieces'),
fieldLabel: '',
labelSeparator: ''
}));
this.optionsManager.bind('sequential_download', fieldset.add({
labelSeparator: '',
})
);
this.optionsManager.bind(
'sequential_download',
fieldset.add({
name: 'sequential_download',
boxLabel: _('Sequential Download'),
fieldLabel: '',
labelSeparator: ''
}));
this.optionsManager.bind('seed_mode', fieldset.add({
labelSeparator: '',
})
);
this.optionsManager.bind(
'seed_mode',
fieldset.add({
name: 'seed_mode',
boxLabel: _('Skip File Hash Check'),
fieldLabel: '',
labelSeparator: ''
}));
this.optionsManager.bind('pre_allocate_storage', fieldset.add({
labelSeparator: '',
})
);
this.optionsManager.bind(
'pre_allocate_storage',
fieldset.add({
name: 'pre_allocate_storage',
boxLabel: _('Preallocate Disk Space'),
fieldLabel: '',
labelSeparator: ''
}));
labelSeparator: '',
})
);
},
getDefaults: function() {
var keys = ['add_paused','pre_allocate_storage','download_location',
'max_connections_per_torrent','max_download_speed_per_torrent',
'move_completed', 'move_completed_path',
'max_upload_slots_per_torrent','max_upload_speed_per_torrent',
'prioritize_first_last_pieces', 'sequential_download'];
var keys = [
'add_paused',
'pre_allocate_storage',
'download_location',
'max_connections_per_torrent',
'max_download_speed_per_torrent',
'move_completed',
'move_completed_path',
'max_upload_slots_per_torrent',
'max_upload_speed_per_torrent',
'prioritize_first_last_pieces',
'sequential_download',
];
deluge.client.core.get_config_values(keys, {
success: function(config) {
var options = {
'file_priorities': [],
'add_paused': config.add_paused,
'sequential_download': config.sequential_download,
'pre_allocate_storage': config.pre_allocate_storage,
'download_location': config.download_location,
'move_completed': config.move_completed,
'move_completed_path': config.move_completed_path,
'max_connections': config.max_connections_per_torrent,
'max_download_speed': config.max_download_speed_per_torrent,
'max_upload_slots': config.max_upload_slots_per_torrent,
'max_upload_speed': config.max_upload_speed_per_torrent,
'prioritize_first_last_pieces': config.prioritize_first_last_pieces,
'seed_mode': false
}
file_priorities: [],
add_paused: config.add_paused,
sequential_download: config.sequential_download,
pre_allocate_storage: config.pre_allocate_storage,
download_location: config.download_location,
move_completed: config.move_completed,
move_completed_path: config.move_completed_path,
max_connections: config.max_connections_per_torrent,
max_download_speed: config.max_download_speed_per_torrent,
max_upload_slots: config.max_upload_slots_per_torrent,
max_upload_speed: config.max_upload_speed_per_torrent,
prioritize_first_last_pieces:
config.prioritize_first_last_pieces,
seed_mode: false,
};
this.optionsManager.options = options;
this.optionsManager.resetAll();
},
scope: this
scope: this,
});
}
},
});

View file

@ -10,7 +10,6 @@
Ext.namespace('Deluge.add');
Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
title: _('Add from Url'),
modal: true,
plain: true,
@ -31,14 +30,14 @@ Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
xtype: 'form',
defaultType: 'textfield',
baseCls: 'x-plain',
labelWidth: 55
labelWidth: 55,
});
this.urlField = form.add({
fieldLabel: _('Url'),
id: 'url',
name: 'url',
width: '97%'
width: '97%',
});
this.urlField.on('specialkey', this.onAdd, this);
@ -46,13 +45,17 @@ Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
fieldLabel: _('Cookies'),
id: 'cookies',
name: 'cookies',
width: '97%'
width: '97%',
});
this.cookieField.on('specialkey', this.onAdd, this);
},
onAddClick: function(field, e) {
if ((field.id == 'url' || field.id == 'cookies') && e.getKey() != e.ENTER) return;
if (
(field.id == 'url' || field.id == 'cookies') &&
e.getKey() != e.ENTER
)
return;
var field = this.urlField;
var url = field.getValue();
@ -64,13 +67,13 @@ Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
success: this.onGotInfo,
scope: this,
filename: url,
torrentId: torrentId
torrentId: torrentId,
});
} else {
deluge.client.web.download_torrent_from_url(url, cookies, {
success: this.onDownload,
scope: this,
torrentId: torrentId
torrentId: torrentId,
});
}
@ -84,12 +87,12 @@ Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
success: this.onGotInfo,
scope: this,
filename: filename,
torrentId: req.options.torrentId
torrentId: req.options.torrentId,
});
},
onGotInfo: function(info, obj, response, request) {
info['filename'] = request.options.filename;
this.fireEvent('add', request.options.torrentId, info);
}
},
});

View file

@ -17,10 +17,7 @@ Ext.ns('Deluge.add');
Deluge.add.Window = Ext.extend(Ext.Window, {
initComponent: function() {
Deluge.add.Window.superclass.initComponent.call(this);
this.addEvents(
'beforeadd',
'add'
);
this.addEvents('beforeadd', 'add');
},
/**
@ -28,5 +25,5 @@ Deluge.add.Window = Ext.extend(Ext.Window, {
*/
createTorrentId: function() {
return new Date().getTime();
}
},
});

View file

@ -23,25 +23,31 @@ Ext.namespace('Deluge.data');
Deluge.data.Peer = Ext.data.Record.create([
{
name: 'country',
type: 'string'
}, {
type: 'string',
},
{
name: 'ip',
type: 'string',
sortType: Deluge.data.SortTypes.asIPAddress
}, {
sortType: Deluge.data.SortTypes.asIPAddress,
},
{
name: 'client',
type: 'string'
}, {
type: 'string',
},
{
name: 'progress',
type: 'float'
}, {
type: 'float',
},
{
name: 'down_speed',
type: 'int'
}, {
type: 'int',
},
{
name: 'up_speed',
type: 'int'
}, {
type: 'int',
},
{
name: 'seed',
type: 'int'
}
type: 'int',
},
]);

View file

@ -20,15 +20,17 @@ Ext.namespace('Deluge.data');
*/
Deluge.data.SortTypes = {
asIPAddress: function(value) {
var d = value.match(/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/);
return ((((((+d[1])*256)+(+d[2]))*256)+(+d[3]))*256)+(+d[4]);
var d = value.match(
/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/
);
return ((+d[1] * 256 + +d[2]) * 256 + +d[3]) * 256 + +d[4];
},
asQueuePosition: function(value) {
return (value > -1) ? value : Number.MAX_VALUE;
return value > -1 ? value : Number.MAX_VALUE;
},
asName: function(value) {
return String(value).toLowerCase();
}
}
},
};

View file

@ -20,78 +20,102 @@ Ext.namespace('Deluge.data');
* @constructor
* @param {Object} data The torrents data
*/
Deluge.data.Torrent = Ext.data.Record.create([{
Deluge.data.Torrent = Ext.data.Record.create([
{
name: 'queue',
type: 'int'
}, {
type: 'int',
},
{
name: 'name',
type: 'string',
sortType: Deluge.data.SortTypes.asName
}, {
sortType: Deluge.data.SortTypes.asName,
},
{
name: 'total_wanted',
type: 'int'
}, {
type: 'int',
},
{
name: 'state',
type: 'string'
}, {
type: 'string',
},
{
name: 'progress',
type: 'int'
}, {
type: 'int',
},
{
name: 'num_seeds',
type: 'int'
}, {
type: 'int',
},
{
name: 'total_seeds',
type: 'int'
}, {
type: 'int',
},
{
name: 'num_peers',
type: 'int'
}, {
type: 'int',
},
{
name: 'total_peers',
type: 'int'
}, {
type: 'int',
},
{
name: 'download_payload_rate',
type: 'int'
}, {
type: 'int',
},
{
name: 'upload_payload_rate',
type: 'int'
}, {
type: 'int',
},
{
name: 'eta',
type: 'int'
}, {
type: 'int',
},
{
name: 'ratio',
type: 'float'
}, {
type: 'float',
},
{
name: 'distributed_copies',
type: 'float'
}, {
type: 'float',
},
{
name: 'time_added',
type: 'int'
}, {
type: 'int',
},
{
name: 'tracker_host',
type: 'string'
}, {
type: 'string',
},
{
name: 'save_path',
type: 'string'
}, {
type: 'string',
},
{
name: 'total_done',
type: 'int'
}, {
type: 'int',
},
{
name: 'total_uploaded',
type: 'int'
}, {
type: 'int',
},
{
name: 'total_remaining',
type: 'int'
}, {
type: 'int',
},
{
name: 'max_download_speed',
type: 'int'
}, {
type: 'int',
},
{
name: 'max_upload_speed',
type: 'int'
}, {
type: 'int',
},
{
name: 'seeds_peers_ratio',
type: 'float'
}, {
type: 'float',
},
{
name: 'time_since_transfer',
type: 'int'
}
type: 'int',
},
]);

View file

@ -13,7 +13,6 @@ Ext.namespace('Deluge.details');
* @class Deluge.details.DetailsPanel
*/
Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
id: 'torrentDetails',
activeTab: 0,
@ -35,7 +34,6 @@ Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
});
},
update: function(tab) {
var torrent = deluge.torrents.getSelected();
if (!torrent) {
@ -55,14 +53,22 @@ Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
// We need to add the events in onRender since Deluge.Torrents has not been created yet.
onRender: function(ct, position) {
Deluge.details.DetailsPanel.superclass.onRender.call(this, ct, position);
Deluge.details.DetailsPanel.superclass.onRender.call(
this,
ct,
position
);
deluge.events.on('disconnect', this.clear, this);
deluge.torrents.on('rowclick', this.onTorrentsClick, this);
this.on('tabchange', this.onTabChange, this);
deluge.torrents.getSelectionModel().on('selectionchange', function(selModel) {
deluge.torrents.getSelectionModel().on(
'selectionchange',
function(selModel) {
if (!selModel.hasSelection()) this.clear();
}, this);
},
this
);
},
onTabChange: function(panel, tab) {
@ -71,5 +77,5 @@ Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
onTorrentsClick: function(grid, rowIndex, e) {
this.update();
}
},
});

View file

@ -16,7 +16,6 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
autoScroll: true,
queuedItems: {},
oldData: {},
initComponent: function() {
@ -53,7 +52,11 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
// private
doAddItem: function(id, label) {
Ext.DomHelper.append(this.dl, { tag: 'dt', cls: id, html: label });
this.fields[id] = Ext.DomHelper.append(this.dl, {tag: 'dd', cls: id, html: ''}, true);
this.fields[id] = Ext.DomHelper.append(
this.dl,
{ tag: 'dd', cls: id, html: '' },
true
);
},
clear: function() {
@ -61,14 +64,14 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
for (var k in this.fields) {
this.fields[k].dom.innerHTML = '';
}
this.oldData = {}
this.oldData = {};
},
update: function(torrentId) {
deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Details, {
success: this.onRequestComplete,
scope: this,
torrentId: torrentId
torrentId: torrentId,
});
},
@ -82,7 +85,7 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
status: torrent.message,
tracker: torrent.tracker_host,
comment: torrent.comment,
creator: torrent.creator
creator: torrent.creator,
};
for (var field in this.fields) {
@ -91,5 +94,5 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
this.fields[field].dom.innerHTML = Ext.escapeHTML(data[field]);
}
this.oldData = data;
}
},
});

View file

@ -9,48 +9,62 @@
*/
Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
title: _('Files'),
rootVisible: false,
columns: [{
columns: [
{
header: _('Filename'),
width: 330,
dataIndex: 'filename'
}, {
dataIndex: 'filename',
},
{
header: _('Size'),
width: 150,
dataIndex: 'size',
tpl: new Ext.XTemplate('{size:this.fsize}', {
fsize: function(v) { return fsize(v); }
})
}, {
fsize: function(v) {
return fsize(v);
},
}),
},
{
xtype: 'tgrendercolumn',
header: _('Progress'),
width: 150,
dataIndex: 'progress',
renderer: function(v) {
var progress = v * 100;
return Deluge.progressBar(progress, this.col.width, progress.toFixed(2) + '%', 0);
}
}, {
return Deluge.progressBar(
progress,
this.col.width,
progress.toFixed(2) + '%',
0
);
},
},
{
header: _('Priority'),
width: 150,
dataIndex: 'priority',
tpl: new Ext.XTemplate('<tpl if="!isNaN(priority)">' +
tpl: new Ext.XTemplate(
'<tpl if="!isNaN(priority)">' +
'<div class="{priority:this.getClass}">' +
'{priority:this.getName}' +
'</div></tpl>', {
'</div></tpl>',
{
getClass: function(v) {
return FILE_PRIORITY_CSS[v];
},
getName: function(v) {
return _(FILE_PRIORITY[v]);
},
}
})
}],
),
},
],
selModel: new Ext.tree.MultiSelectionModel(),
@ -75,15 +89,21 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
for (var file in files.contents) {
var item = files.contents[file];
if (item.type == 'dir') {
walk(item, parentNode.appendChild(new Ext.tree.TreeNode({
walk(
item,
parentNode.appendChild(
new Ext.tree.TreeNode({
text: file,
filename: file,
size: item.size,
progress: item.progress,
priority: item.priority
})));
priority: item.priority,
})
)
);
} else {
parentNode.appendChild(new Ext.tree.TreeNode({
parentNode.appendChild(
new Ext.tree.TreeNode({
text: file,
filename: file,
fileIndex: item.index,
@ -92,8 +112,9 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
priority: item.priority,
leaf: true,
iconCls: 'x-deluge-file',
uiProvider: Ext.ux.tree.TreeGridNodeUI
}));
uiProvider: Ext.ux.tree.TreeGridNodeUI,
})
);
}
}
}
@ -111,7 +132,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
deluge.client.web.get_torrent_files(torrentId, {
success: this.onRequestComplete,
scope: this,
torrentId: torrentId
torrentId: torrentId,
});
},
@ -137,7 +158,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
deluge.menus.filePriorities.on('itemclick', this.onItemClick, this);
this.on('contextmenu', this.onContextMenu, this);
this.sorter = new Ext.tree.TreeSorter(this, {
folderSort: true
folderSort: true,
});
},
@ -160,7 +181,8 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
var indexes = {};
function walk(node) {
if (Ext.isEmpty(node.attributes.fileIndex)) return;
indexes[node.attributes.fileIndex] = node.attributes.priority;
indexes[node.attributes.fileIndex] =
node.attributes.priority;
}
this.getRootNode().cascade(walk);
@ -169,11 +191,13 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
if (!node.isLeaf()) {
function setPriorities(node) {
if (Ext.isEmpty(node.attributes.fileIndex)) return;
indexes[node.attributes.fileIndex] = baseItem.filePriority;
indexes[node.attributes.fileIndex] =
baseItem.filePriority;
}
node.cascade(setPriorities);
} else if (!Ext.isEmpty(node.attributes.fileIndex)) {
indexes[node.attributes.fileIndex] = baseItem.filePriority;
indexes[node.attributes.fileIndex] =
baseItem.filePriority;
return;
}
});
@ -183,14 +207,18 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
priorities[index] = indexes[index];
}
deluge.client.core.set_torrent_options([this.torrentId], {'file_priorities': priorities}, {
deluge.client.core.set_torrent_options(
[this.torrentId],
{ file_priorities: priorities },
{
success: function() {
Ext.each(nodes, function(node) {
node.setColumnValue(3, baseItem.filePriority);
});
},
scope: this
});
scope: this,
}
);
break;
}
},
@ -201,5 +229,5 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
} else {
this.updateFileTree(files);
}
}
},
});

View file

@ -8,11 +8,10 @@
* See LICENSE for more details.
*/
Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
autoScroll: true,
bodyStyle: 'padding: 5px;',
border: false,
@ -20,34 +19,36 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
defaults: {
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
},
deferredRender: false,
layout: 'column',
title: _('Options')
}, config);
title: _('Options'),
},
config
);
Deluge.details.OptionsTab.superclass.constructor.call(this, config);
},
initComponent: function() {
Deluge.details.OptionsTab.superclass.initComponent.call(this);
this.fieldsets = {}, this.fields = {};
(this.fieldsets = {}), (this.fields = {});
this.optionsManager = new Deluge.MultiOptionsManager({
options: {
'max_download_speed': -1,
'max_upload_speed': -1,
'max_connections': -1,
'max_upload_slots': -1,
'auto_managed': false,
'stop_at_ratio': false,
'stop_ratio': 2.0,
'remove_at_ratio': false,
'move_completed': false,
'move_completed_path': '',
'private': false,
'prioritize_first_last': false
}
max_download_speed: -1,
max_upload_speed: -1,
max_connections: -1,
max_upload_slots: -1,
auto_managed: false,
stop_at_ratio: false,
stop_ratio: 2.0,
remove_at_ratio: false,
move_completed: false,
move_completed_path: '',
private: false,
prioritize_first_last: false,
},
});
/*
@ -64,7 +65,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
style: 'margin-left: 10px; margin-right: 5px; padding: 5px',
title: _('Bandwidth'),
width: 250
width: 250,
});
/*
@ -74,7 +75,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'label',
text: _('Max Download Speed:'),
forId: 'max_download_speed',
cls: 'x-deluge-options-label'
cls: 'x-deluge-options-label',
});
this.fields.max_download_speed = this.fieldsets.bandwidth.add({
id: 'max_download_speed',
@ -84,13 +85,13 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'number',
decimalPrecision: 1,
minValue: -1,
maxValue: 99999
}
maxValue: 99999,
},
});
this.fieldsets.bandwidth.add({
xtype: 'label',
text: _('KiB/s'),
style: 'margin-left: 10px'
style: 'margin-left: 10px',
});
/*
@ -100,7 +101,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'label',
text: _('Max Upload Speed:'),
forId: 'max_upload_speed',
cls: 'x-deluge-options-label'
cls: 'x-deluge-options-label',
});
this.fields.max_upload_speed = this.fieldsets.bandwidth.add({
id: 'max_upload_speed',
@ -111,13 +112,13 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'number',
decimalPrecision: 1,
minValue: -1,
maxValue: 99999
}
maxValue: 99999,
},
});
this.fieldsets.bandwidth.add({
xtype: 'label',
text: _('KiB/s'),
style: 'margin-left: 10px'
style: 'margin-left: 10px',
});
/*
@ -127,7 +128,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'label',
text: _('Max Connections:'),
forId: 'max_connections',
cls: 'x-deluge-options-label'
cls: 'x-deluge-options-label',
});
this.fields.max_connections = this.fieldsets.bandwidth.add({
id: 'max_connections',
@ -138,9 +139,9 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
maxValue: 99999,
},
colspan: 2
colspan: 2,
});
/*
@ -150,7 +151,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'label',
text: _('Max Upload Slots:'),
forId: 'max_upload_slots',
cls: 'x-deluge-options-label'
cls: 'x-deluge-options-label',
});
this.fields.max_upload_slots = this.fieldsets.bandwidth.add({
id: 'max_upload_slots',
@ -161,9 +162,9 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
maxValue: 99999,
},
colspan: 2
colspan: 2,
});
/*
@ -181,8 +182,8 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
defaults: {
fieldLabel: '',
labelSeparator: ''
}
labelSeparator: '',
},
});
this.fields.auto_managed = this.fieldsets.queue.add({
@ -192,7 +193,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
name: 'is_auto_managed',
boxLabel: _('Auto Managed'),
width: 200,
colspan: 2
colspan: 2,
});
this.fields.stop_at_ratio = this.fieldsets.queue.add({
@ -202,7 +203,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
width: 120,
boxLabel: _('Stop seed at ratio:'),
handler: this.onStopRatioChecked,
scope: this
scope: this,
});
this.fields.stop_ratio = this.fieldsets.queue.add({
@ -218,8 +219,8 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
maxValue: 99999,
incrementValue: 0.1,
alternateIncrementValue: 1,
decimalPrecision: 1
}
decimalPrecision: 1,
},
});
this.fields.remove_at_ratio = this.fieldsets.queue.add({
@ -230,7 +231,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
bodyStyle: 'padding-left: 10px',
boxLabel: _('Remove at ratio'),
disabled: true,
colspan: 2
colspan: 2,
});
this.fields.move_completed = this.fieldsets.queue.add({
@ -240,7 +241,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
boxLabel: _('Move Completed:'),
colspan: 2,
handler: this.onMoveCompletedChecked,
scope: this
scope: this,
});
this.fields.move_completed_path = this.fieldsets.queue.add({
@ -250,10 +251,9 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
colspan: 3,
bodyStyle: 'margin-left: 20px',
width: 180,
disabled: true
disabled: true,
});
/*
* General Options
*/
@ -261,7 +261,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
border: false,
autoHeight: true,
style: 'margin-left: 5px',
width: 210
width: 210,
});
this.fieldsets.general = this.rightColumn.add({
@ -269,7 +269,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
autoHeight: true,
defaultType: 'checkbox',
title: _('General'),
layout: 'form'
layout: 'form',
});
this.fields['private'] = this.fieldsets.general.add({
@ -277,14 +277,14 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
labelSeparator: '',
boxLabel: _('Private'),
id: 'private',
disabled: true
disabled: true,
});
this.fields.prioritize_first_last = this.fieldsets.general.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Prioritize First/Last'),
id: 'prioritize_first_last'
id: 'prioritize_first_last',
});
// Bind the fields so the options manager can manage them.
@ -298,7 +298,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
this.buttonPanel = this.rightColumn.add({
layout: 'hbox',
xtype: 'panel',
border: false
border: false,
});
/*
@ -313,7 +313,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
border: false,
width: 100,
handler: this.onEditTrackers,
scope: this
scope: this,
});
/*
@ -327,7 +327,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
border: false,
width: 100,
handler: this.onApply,
scope: this
scope: this,
});
},
@ -361,7 +361,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
}
deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Options, {
success: this.onRequestComplete,
scope: this
scope: this,
});
},
@ -371,7 +371,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
success: function() {
this.optionsManager.commit();
},
scope: this
scope: this,
});
},
@ -396,11 +396,14 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
this.fields['private'].setDisabled(true);
delete torrent['private'];
torrent['auto_managed'] = torrent['is_auto_managed'];
torrent['prioritize_first_last_pieces'] = torrent['prioritize_first_last'];
torrent['prioritize_first_last_pieces'] =
torrent['prioritize_first_last'];
this.optionsManager.setDefault(torrent);
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'));
}
this.fields.move_completed_path.setDisabled(
!this.optionsManager.get('move_completed')
);
},
});

View file

@ -13,10 +13,15 @@
if (!value.replace(' ', '').replace(' ', '')) {
return '';
}
return String.format('<img src="{0}flag/{1}" />', deluge.config.base, value);
return String.format(
'<img src="{0}flag/{1}" />',
deluge.config.base,
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';
// Modify display of IPv6 to include brackets
var peer_ip = value.split(':');
if (peer_ip.length > 2) {
@ -32,61 +37,73 @@
}
Deluge.details.PeersTab = Ext.extend(Ext.grid.GridPanel, {
// fast way to figure out if we have a peer already.
peers: {},
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
title: _('Peers'),
cls: 'x-deluge-peers',
store: new Ext.data.Store({
reader: new Ext.data.JsonReader({
reader: new Ext.data.JsonReader(
{
idProperty: 'ip',
root: 'peers'
}, Deluge.data.Peer)
root: 'peers',
},
Deluge.data.Peer
),
}),
columns: [{
columns: [
{
header: '&nbsp;',
width: 30,
sortable: true,
renderer: flagRenderer,
dataIndex: 'country'
}, {
dataIndex: 'country',
},
{
header: _('Address'),
width: 125,
sortable: true,
renderer: peerAddressRenderer,
dataIndex: 'ip'
}, {
dataIndex: 'ip',
},
{
header: _('Client'),
width: 125,
sortable: true,
renderer: fplain,
dataIndex: 'client'
}, {
dataIndex: 'client',
},
{
header: _('Progress'),
width: 150,
sortable: true,
renderer: peerProgressRenderer,
dataIndex: 'progress'
}, {
dataIndex: 'progress',
},
{
header: _('Down Speed'),
width: 100,
sortable: true,
renderer: fspeed,
dataIndex: 'down_speed'
}, {
dataIndex: 'down_speed',
},
{
header: _('Up Speed'),
width: 100,
sortable: true,
renderer: fspeed,
dataIndex: 'up_speed'
}],
dataIndex: 'up_speed',
},
],
stripeRows: true,
deferredRender: false,
autoScroll:true
}, config);
autoScroll: true,
},
config
);
Deluge.details.PeersTab.superclass.constructor.call(this, config);
},
@ -98,7 +115,7 @@
update: function(torrentId) {
deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Peers, {
success: this.onRequestComplete,
scope: this
scope: this,
});
},
@ -110,7 +127,9 @@
var addresses = {};
// Go through the peers updating and creating peer records
Ext.each(torrent.peers, function(peer) {
Ext.each(
torrent.peers,
function(peer) {
if (this.peers[peer.ip]) {
var record = store.getById(peer.ip);
record.beginEdit();
@ -125,7 +144,9 @@
newPeers.push(new Deluge.data.Peer(peer, peer.ip));
}
addresses[peer.ip] = 1;
}, this);
},
this
);
store.add(newPeers);
// Remove any peers that should not be left in the store.
@ -140,6 +161,6 @@
var sortState = store.getSortState();
if (!sortState) return;
store.sort(sortState.field, sortState.direction);
}
},
});
})();

View file

@ -22,7 +22,7 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
this.progressBar = this.add({
xtype: 'progress',
cls: 'x-deluge-status-progressbar'
cls: 'x-deluge-status-progressbar',
});
this.status = this.add({
@ -32,17 +32,19 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
border: false,
width: 1000,
listeners: {
'render': {
render: {
fn: function(panel) {
panel.load({
url: deluge.config.base + 'render/tab_status.html',
text: _('Loading') + '...'
text: _('Loading') + '...',
});
panel.getUpdater().on('update', this.onPanelUpdate, this);
panel
.getUpdater()
.on('update', this.onPanelUpdate, this);
},
scope: this,
},
},
scope: this
}
}
});
},
@ -57,31 +59,49 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
if (!this.fields) this.getFields();
deluge.client.web.get_torrent_status(torrentId, Deluge.Keys.Status, {
success: this.onRequestComplete,
scope: this
scope: this,
});
},
onPanelUpdate: function(el, response) {
this.fields = {};
Ext.each(Ext.query('dd', this.status.body.dom), function(field) {
Ext.each(
Ext.query('dd', this.status.body.dom),
function(field) {
this.fields[field.className] = field;
}, this);
},
this
);
},
onRequestComplete: function(status) {
seeds = 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';
completed_time = status.completed_time > 0.0 ? fdate(status.completed_time) : '';
seeds =
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';
completed_time =
status.completed_time > 0.0 ? fdate(status.completed_time) : '';
var data = {
downloaded: fsize(status.total_done, true),
uploaded: fsize(status.total_uploaded, true),
share: (status.ratio == -1) ? '&infin;' : status.ratio.toFixed(3),
share: status.ratio == -1 ? '&infin;' : status.ratio.toFixed(3),
announce: ftime(status.next_announce),
tracker_status: status.tracker_status,
downspeed: (status.download_payload_rate) ? fspeed(status.download_payload_rate) : '0.0 KiB/s',
upspeed: (status.upload_payload_rate) ? fspeed(status.upload_payload_rate) : '0.0 KiB/s',
downspeed: status.download_payload_rate
? fspeed(status.download_payload_rate)
: '0.0 KiB/s',
upspeed: status.upload_payload_rate
? fspeed(status.upload_payload_rate)
: '0.0 KiB/s',
eta: ftime(status.eta),
pieces: status.num_pieces + ' (' + fsize(status.piece_length) + ')',
seeds: seeds,
@ -93,30 +113,43 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
time_added: fdate(status.time_added),
last_seen_complete: last_seen_complete,
completed_time: completed_time,
time_since_transfer: ftime(status.time_since_transfer)
}
data.auto_managed = _((status.is_auto_managed) ? 'True' : 'False');
time_since_transfer: ftime(status.time_since_transfer),
};
data.auto_managed = _(status.is_auto_managed ? 'True' : 'False');
var translate_tracker_status = {
'Error' : _('Error'),
'Warning' : _('Warning'),
Error: _('Error'),
Warning: _('Warning'),
'Announce OK': _('Announce OK'),
'Announce Sent' : _('Announce Sent')
'Announce Sent': _('Announce Sent'),
};
for (var key in translate_tracker_status) {
if (data.tracker_status.indexOf(key) != -1) {
data.tracker_status = data.tracker_status.replace(key, translate_tracker_status[key]);
data.tracker_status = data.tracker_status.replace(
key,
translate_tracker_status[key]
);
break;
}
}
data.downloaded += ' (' + ((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') + ')';
data.downloaded +=
' (' +
(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];
}
var text = status.state + ' ' + status.progress.toFixed(2) + '%';
this.progressBar.updateProgress(status.progress / 100.0, text);
}
},
});

View file

@ -15,13 +15,16 @@ Ext.namespace('Deluge.preferences');
*/
Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
border: false,
title: _('Bandwidth'),
header: false,
layout: 'form',
labelWidth: 10
}, config);
labelWidth: 10,
},
config
);
Deluge.preferences.Bandwidth.superclass.constructor.call(this, config);
},
@ -37,82 +40,107 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
defaultType: 'spinnerfield',
defaults: {
minValue: -1,
maxValue: 99999
maxValue: 99999,
},
style: 'margin-bottom: 0px; padding-bottom: 0px;',
autoHeight: true
autoHeight: true,
});
om.bind('max_connections_global', fieldset.add({
om.bind(
'max_connections_global',
fieldset.add({
name: 'max_connections_global',
fieldLabel: _('Maximum Connections:'),
labelSeparator: '',
width: 80,
value: -1,
decimalPrecision: 0
}));
om.bind('max_upload_slots_global', fieldset.add({
decimalPrecision: 0,
})
);
om.bind(
'max_upload_slots_global',
fieldset.add({
name: 'max_upload_slots_global',
fieldLabel: _('Maximum Upload Slots'),
labelSeparator: '',
width: 80,
value: -1,
decimalPrecision: 0
}));
om.bind('max_download_speed', fieldset.add({
decimalPrecision: 0,
})
);
om.bind(
'max_download_speed',
fieldset.add({
name: 'max_download_speed',
fieldLabel: _('Maximum Download Speed (KiB/s):'),
labelSeparator: '',
width: 80,
value: -1.0,
decimalPrecision: 1
}));
om.bind('max_upload_speed', fieldset.add({
decimalPrecision: 1,
})
);
om.bind(
'max_upload_speed',
fieldset.add({
name: 'max_upload_speed',
fieldLabel: _('Maximum Upload Speed (KiB/s):'),
labelSeparator: '',
width: 80,
value: -1.0,
decimalPrecision: 1
}));
om.bind('max_half_open_connections', fieldset.add({
decimalPrecision: 1,
})
);
om.bind(
'max_half_open_connections',
fieldset.add({
name: 'max_half_open_connections',
fieldLabel: _('Maximum Half-Open Connections:'),
labelSeparator: '',
width: 80,
value: -1,
decimalPrecision: 0
}));
om.bind('max_connections_per_second', fieldset.add({
decimalPrecision: 0,
})
);
om.bind(
'max_connections_per_second',
fieldset.add({
name: 'max_connections_per_second',
fieldLabel: _('Maximum Connection Attempts per Second:'),
labelSeparator: '',
width: 80,
value: -1,
decimalPrecision: 0
}));
decimalPrecision: 0,
})
);
fieldset = this.add({
xtype: 'fieldset',
border: false,
title: '',
defaultType: 'checkbox',
style: 'padding-top: 0px; padding-bottom: 5px; margin-top: 0px; margin-bottom: 0px;',
autoHeight: true
style:
'padding-top: 0px; padding-bottom: 5px; margin-top: 0px; margin-bottom: 0px;',
autoHeight: true,
});
om.bind('ignore_limits_on_local_network', fieldset.add({
om.bind(
'ignore_limits_on_local_network',
fieldset.add({
name: 'ignore_limits_on_local_network',
height: 22,
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Ignore limits on local network')
}));
om.bind('rate_limit_ip_overhead', fieldset.add({
boxLabel: _('Ignore limits on local network'),
})
);
om.bind(
'rate_limit_ip_overhead',
fieldset.add({
name: 'rate_limit_ip_overhead',
height: 22,
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Rate limit IP overhead')
}));
boxLabel: _('Rate limit IP overhead'),
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -123,41 +151,53 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
labelWidth: 200,
defaults: {
minValue: -1,
maxValue: 99999
maxValue: 99999,
},
autoHeight: true
autoHeight: true,
});
om.bind('max_connections_per_torrent', fieldset.add({
om.bind(
'max_connections_per_torrent',
fieldset.add({
name: 'max_connections_per_torrent',
fieldLabel: _('Maximum Connections:'),
labelSeparator: '',
width: 80,
value: -1,
decimalPrecision: 0
}));
om.bind('max_upload_slots_per_torrent', fieldset.add({
decimalPrecision: 0,
})
);
om.bind(
'max_upload_slots_per_torrent',
fieldset.add({
name: 'max_upload_slots_per_torrent',
fieldLabel: _('Maximum Upload Slots:'),
labelSeparator: '',
width: 80,
value: -1,
decimalPrecision: 0
}));
om.bind('max_download_speed_per_torrent', fieldset.add({
decimalPrecision: 0,
})
);
om.bind(
'max_download_speed_per_torrent',
fieldset.add({
name: 'max_download_speed_per_torrent',
fieldLabel: _('Maximum Download Speed (KiB/s):'),
labelSeparator: '',
width: 80,
value: -1,
decimalPrecision: 0
}));
om.bind('max_upload_speed_per_torrent', fieldset.add({
decimalPrecision: 0,
})
);
om.bind(
'max_upload_speed_per_torrent',
fieldset.add({
name: 'max_upload_speed_per_torrent',
fieldLabel: _('Maximum Upload Speed (KiB/s):'),
labelSeparator: '',
width: 80,
value: -1,
decimalPrecision: 0
}));
}
decimalPrecision: 0,
})
);
},
});

View file

@ -14,13 +14,11 @@ Ext.namespace('Deluge.preferences');
* @extends Ext.form.FormPanel
*/
Deluge.preferences.Cache = Ext.extend(Ext.form.FormPanel, {
border: false,
title: _('Cache'),
header: false,
layout: 'form',
initComponent: function() {
Deluge.preferences.Cache.superclass.initComponent.call(this);
@ -36,22 +34,28 @@ Deluge.preferences.Cache = Ext.extend(Ext.form.FormPanel, {
defaults: {
decimalPrecision: 0,
minValue: -1,
maxValue: 999999
}
maxValue: 999999,
},
});
om.bind('cache_size', fieldset.add({
om.bind(
'cache_size',
fieldset.add({
fieldLabel: _('Cache Size (16 KiB Blocks):'),
labelSeparator: '',
name: 'cache_size',
width: 60,
value: 512
}));
om.bind('cache_expiry', fieldset.add({
value: 512,
})
);
om.bind(
'cache_expiry',
fieldset.add({
fieldLabel: _('Cache Expiry (seconds):'),
labelSeparator: '',
name: 'cache_expiry',
width: 60,
value: 60
}));
}
value: 60,
})
);
},
});

View file

@ -14,7 +14,6 @@ Ext.namespace('Deluge.preferences');
* @extends Ext.form.FormPanel
*/
Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
border: false,
title: _('Daemon'),
header: false,
@ -30,17 +29,20 @@ Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
border: false,
title: _('Port'),
autoHeight: true,
defaultType: 'spinnerfield'
defaultType: 'spinnerfield',
});
om.bind('daemon_port', fieldset.add({
om.bind(
'daemon_port',
fieldset.add({
fieldLabel: _('Daemon port:'),
labelSeparator: '',
name: 'daemon_port',
value: 58846,
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
}));
maxValue: 99999,
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -48,15 +50,18 @@ Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
title: _('Connections'),
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
om.bind('allow_remote', fieldset.add({
om.bind(
'allow_remote',
fieldset.add({
fieldLabel: '',
height: 22,
labelSeparator: '',
boxLabel: _('Allow Remote Connections'),
name: 'allow_remote'
}));
name: 'allow_remote',
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -64,14 +69,17 @@ Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
title: _('Other'),
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
om.bind('new_release_check', fieldset.add({
om.bind(
'new_release_check',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
height: 40,
boxLabel: _('Periodically check the website for new releases'),
id: 'new_release_check'
}));
}
id: 'new_release_check',
})
);
},
});

View file

@ -15,14 +15,17 @@ Ext.namespace('Deluge.preferences');
*/
Deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
border: false,
title: _('Downloads'),
header: false,
layout: 'form',
autoHeight: true,
width: 320
}, config);
width: 320,
},
config
);
Deluge.preferences.Downloads.superclass.constructor.call(this, config);
},
@ -39,22 +42,25 @@ Deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
autoHeight: true,
labelAlign: 'top',
width: 300,
style: 'margin-bottom: 5px; padding-bottom: 5px;'
style: 'margin-bottom: 5px; padding-bottom: 5px;',
});
optMan.bind('download_location', fieldset.add({
optMan.bind(
'download_location',
fieldset.add({
xtype: 'textfield',
name: 'download_location',
fieldLabel: _('Download to:'),
labelSeparator: '',
width: 280
}));
width: 280,
})
);
var field = fieldset.add({
name: 'move_completed_path',
fieldLabel: _('Move completed to:'),
labelSeparator: '',
width: 280
width: 280,
});
optMan.bind('move_completed', field.toggle);
optMan.bind('move_completed_path', field.input);
@ -63,7 +69,7 @@ Deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
name: 'torrentfiles_location',
fieldLabel: _('Copy of .torrent files to:'),
labelSeparator: '',
width: 280
width: 280,
});
optMan.bind('copy_torrent_file', field.toggle);
optMan.bind('torrentfiles_location', field.input);
@ -76,32 +82,43 @@ Deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
labelWidth: 1,
defaultType: 'checkbox',
style: 'margin-bottom: 0; padding-bottom: 0;',
width: 280
width: 280,
});
optMan.bind('prioritize_first_last_pieces', fieldset.add({
optMan.bind(
'prioritize_first_last_pieces',
fieldset.add({
name: 'prioritize_first_last_pieces',
labelSeparator: '',
height: 22,
boxLabel: _('Prioritize first and last pieces of torrent')
}));
optMan.bind('sequential_download', fieldset.add({
boxLabel: _('Prioritize first and last pieces of torrent'),
})
);
optMan.bind(
'sequential_download',
fieldset.add({
name: 'sequential_download',
labelSeparator: '',
height: 22,
boxLabel: _('Sequential download')
}));
optMan.bind('add_paused', fieldset.add({
boxLabel: _('Sequential download'),
})
);
optMan.bind(
'add_paused',
fieldset.add({
name: 'add_paused',
labelSeparator: '',
height: 22,
boxLabel: _('Add torrents in Paused state')
}));
optMan.bind('pre_allocate_storage', fieldset.add({
boxLabel: _('Add torrents in Paused state'),
})
);
optMan.bind(
'pre_allocate_storage',
fieldset.add({
name: 'pre_allocate_storage',
labelSeparator: '',
height: 22,
boxLabel: _('Pre-allocate disk space')
}));
}
boxLabel: _('Pre-allocate disk space'),
})
);
},
});

View file

@ -14,7 +14,6 @@ Ext.namespace('Deluge.preferences');
* @extends Ext.form.FormPanel
*/
Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, {
border: false,
title: _('Encryption'),
header: false,
@ -31,9 +30,11 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, {
header: false,
autoHeight: true,
defaultType: 'combo',
width: 300
width: 300,
});
optMan.bind('enc_in_policy', fieldset.add({
optMan.bind(
'enc_in_policy',
fieldset.add({
fieldLabel: _('Incoming:'),
labelSeparator: '',
mode: 'local',
@ -43,15 +44,18 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, {
data: [
[0, _('Forced')],
[1, _('Enabled')],
[2, _('Disabled')]
]
[2, _('Disabled')],
],
}),
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
}));
optMan.bind('enc_out_policy', fieldset.add({
displayField: 'text',
})
);
optMan.bind(
'enc_out_policy',
fieldset.add({
fieldLabel: _('Outgoing:'),
labelSeparator: '',
mode: 'local',
@ -61,15 +65,18 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, {
data: [
[0, _('Forced')],
[1, _('Enabled')],
[2, _('Disabled')]
]
[2, _('Disabled')],
],
}),
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
}));
optMan.bind('enc_level', fieldset.add({
displayField: 'text',
})
);
optMan.bind(
'enc_level',
fieldset.add({
fieldLabel: _('Level:'),
labelSeparator: '',
mode: 'local',
@ -79,13 +86,14 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, {
data: [
[0, _('Handshake')],
[1, _('Full Stream')],
[2, _('Either')]
]
[2, _('Either')],
],
}),
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
}));
}
displayField: 'text',
})
);
},
});

View file

@ -14,7 +14,6 @@ Ext.namespace('Deluge.preferences');
* @extends Ext.Window
*/
Deluge.preferences.InstallPluginWindow = Ext.extend(Ext.Window, {
title: _('Install Plugin'),
layout: 'fit',
height: 115,
@ -28,7 +27,9 @@ Deluge.preferences.InstallPluginWindow = Ext.extend(Ext.Window, {
plain: true,
initComponent: function() {
Deluge.preferences.InstallPluginWindow.superclass.initComponent.call(this);
Deluge.preferences.InstallPluginWindow.superclass.initComponent.call(
this
);
this.addButton(_('Install'), this.onInstall, this);
this.form = this.add({
@ -37,16 +38,18 @@ Deluge.preferences.InstallPluginWindow = Ext.extend(Ext.Window, {
labelWidth: 70,
autoHeight: true,
fileUpload: true,
items: [{
items: [
{
xtype: 'fileuploadfield',
width: 240,
emptyText: _('Select an egg'),
fieldLabel: _('Plugin Egg'),
name: 'file',
buttonCfg: {
text: _('Browse...')
}
}]
text: _('Browse...'),
},
},
],
});
},
@ -55,7 +58,7 @@ Deluge.preferences.InstallPluginWindow = Ext.extend(Ext.Window, {
url: deluge.config.base + 'upload',
waitMsg: _('Uploading your plugin...'),
success: this.onUploadSuccess,
scope: this
scope: this,
});
},
@ -67,14 +70,14 @@ Deluge.preferences.InstallPluginWindow = Ext.extend(Ext.Window, {
this.hide();
if (upload.result.success) {
var filename = this.form.getForm().getFieldValues().file;
filename = filename.split('\\').slice(-1)[0]
filename = filename.split('\\').slice(-1)[0];
var path = upload.result.files[0];
this.form.getForm().setValues({ file: '' });
deluge.client.web.upload_plugin(filename, path, {
success: this.onUploadPlugin,
scope: this,
filename: filename
filename: filename,
});
}
}
},
});

View file

@ -14,7 +14,6 @@ Ext.namespace('Deluge.preferences');
* @extends Ext.form.FormPanel
*/
Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
border: false,
title: _('Interface'),
header: false,
@ -23,7 +22,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
initComponent: function() {
Deluge.preferences.Interface.superclass.initComponent.call(this);
var om = this.optionsManager = new Deluge.OptionsManager();
var om = (this.optionsManager = new Deluge.OptionsManager());
this.on('show', this.onPageShow, this);
var fieldset = this.add({
@ -37,21 +36,30 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
defaults: {
height: 17,
fieldLabel: '',
labelSeparator: ''
}
labelSeparator: '',
},
});
om.bind('show_session_speed', fieldset.add({
om.bind(
'show_session_speed',
fieldset.add({
name: 'show_session_speed',
boxLabel: _('Show session speed in titlebar')
}));
om.bind('sidebar_show_zero', fieldset.add({
boxLabel: _('Show session speed in titlebar'),
})
);
om.bind(
'sidebar_show_zero',
fieldset.add({
name: 'sidebar_show_zero',
boxLabel: _('Show filters with zero torrents')
}));
om.bind('sidebar_multiple_filters', fieldset.add({
boxLabel: _('Show filters with zero torrents'),
})
);
om.bind(
'sidebar_multiple_filters',
fieldset.add({
name: 'sidebar_multiple_filters',
boxLabel: _('Allow the use of multiple filters at once')
}));
boxLabel: _('Allow the use of multiple filters at once'),
})
);
var languagePanel = this.add({
xtype: 'fieldset',
@ -60,22 +68,25 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
style: 'margin-bottom: 0px; padding-bottom: 5px; padding-top: 5px',
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
this.language = om.bind('language', languagePanel.add({
this.language = om.bind(
'language',
languagePanel.add({
xtype: 'combo',
labelSeparator: '',
name: 'language',
mode: 'local',
width: 200,
store: new Ext.data.ArrayStore({
fields: ['id', 'text']
fields: ['id', 'text'],
}),
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
}));
displayField: 'text',
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -90,21 +101,21 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
inputType: 'password',
labelStyle: 'padding-left: 5px',
height: 20,
labelSeparator: ''
}
labelSeparator: '',
},
});
this.oldPassword = fieldset.add({
name: 'old_password',
fieldLabel: _('Old:')
fieldLabel: _('Old:'),
});
this.newPassword = fieldset.add({
name: 'new_password',
fieldLabel: _('New:')
fieldLabel: _('New:'),
});
this.confirmPassword = fieldset.add({
name: 'confirm_password',
fieldLabel: _('Confirm:')
fieldLabel: _('Confirm:'),
});
fieldset = this.add({
@ -119,46 +130,63 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
labelSeparator: '',
labelStyle: 'padding-left: 5px',
height: 20,
width: 80
}
width: 80,
},
});
om.bind('session_timeout', fieldset.add({
om.bind(
'session_timeout',
fieldset.add({
name: 'session_timeout',
fieldLabel: _('Session Timeout:'),
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
}));
om.bind('port', fieldset.add({
maxValue: 99999,
})
);
om.bind(
'port',
fieldset.add({
name: 'port',
fieldLabel: _('Port:'),
decimalPrecision: 0,
minValue: 1,
maxValue: 65535
}));
this.httpsField = om.bind('https', fieldset.add({
maxValue: 65535,
})
);
this.httpsField = om.bind(
'https',
fieldset.add({
xtype: 'checkbox',
name: 'https',
hideLabel: true,
width: 300,
style: 'margin-left: 5px',
boxLabel: _('Enable SSL (paths relative to Deluge config folder)')
}));
boxLabel: _(
'Enable SSL (paths relative to Deluge config folder)'
),
})
);
this.httpsField.on('check', this.onSSLCheck, this);
this.pkeyField = om.bind('pkey', fieldset.add({
this.pkeyField = om.bind(
'pkey',
fieldset.add({
xtype: 'textfield',
disabled: true,
name: 'pkey',
width: 180,
fieldLabel: _('Private Key:')
}));
this.certField = om.bind('cert', fieldset.add({
fieldLabel: _('Private Key:'),
})
);
this.certField = om.bind(
'cert',
fieldset.add({
xtype: 'textfield',
disabled: true,
name: 'cert',
width: 180,
fieldLabel: _('Certificate:')
}));
fieldLabel: _('Certificate:'),
})
);
},
onApply: function() {
@ -166,7 +194,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
if (!Ext.isObjectEmpty(changed)) {
deluge.client.web.set_config(changed, {
success: this.onSetConfig,
scope: this
scope: this,
});
for (var key in deluge.config) {
@ -175,16 +203,18 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
if ('language' in changed) {
Ext.Msg.show({
title: _('WebUI Language Changed'),
msg: _('Do you want to refresh the page now to use the new language?'),
msg: _(
'Do you want to refresh the page now to use the new language?'
),
buttons: {
yes: _('Refresh'),
no: _('Close')
no: _('Close'),
},
multiline: false,
fn: function(btnText) {
if (btnText === 'yes') location.reload();
},
icon: Ext.MessageBox.QUESTION
icon: Ext.MessageBox.QUESTION,
});
}
}
@ -202,7 +232,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
},
onGotLanguages: function(info, obj, response, request) {
info.unshift(['', _('System Default')])
info.unshift(['', _('System Default')]);
this.language.store.loadData(info);
this.language.setValue(this.optionsManager.get('language'));
},
@ -212,11 +242,11 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
if (newPassword != this.confirmPassword.getValue()) {
Ext.MessageBox.show({
title: _('Invalid Password'),
msg: _('Your passwords don\'t match!'),
msg: _("Your passwords don't match!"),
buttons: Ext.MessageBox.OK,
modal: false,
icon: Ext.MessageBox.ERROR,
iconCls: 'x-deluge-icon-error'
iconCls: 'x-deluge-icon-error',
});
return;
}
@ -231,7 +261,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
buttons: Ext.MessageBox.OK,
modal: false,
icon: Ext.MessageBox.ERROR,
iconCls: 'x-deluge-icon-error'
iconCls: 'x-deluge-icon-error',
});
this.oldPassword.setValue('');
} else {
@ -241,14 +271,14 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
buttons: Ext.MessageBox.OK,
modal: false,
icon: Ext.MessageBox.INFO,
iconCls: 'x-deluge-icon-info'
iconCls: 'x-deluge-icon-info',
});
this.oldPassword.setValue('');
this.newPassword.setValue('');
this.confirmPassword.setValue('');
}
},
scope: this
scope: this,
});
},
@ -259,16 +289,16 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
onPageShow: function() {
deluge.client.web.get_config({
success: this.onGotConfig,
scope: this
scope: this,
});
deluge.client.webutils.get_languages({
success: this.onGotLanguages,
scope: this
scope: this,
});
},
onSSLCheck: function(e, checked) {
this.pkeyField.setDisabled(!checked);
this.certField.setDisabled(!checked);
}
},
});

View file

@ -15,7 +15,7 @@ Ext.apply(Ext.form.VTypes, {
return /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(v);
},
IPAddressText: 'Must be a numeric IP address',
IPAddressMask: /[\d\.]/i
IPAddressMask: /[\d\.]/i,
});
/**
@ -23,7 +23,6 @@ Ext.apply(Ext.form.VTypes, {
* @extends Ext.form.FormPanel
*/
Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
border: false,
layout: 'form',
title: _('Network'),
@ -40,15 +39,18 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
style: 'margin-bottom: 5px; padding-bottom: 0px;',
autoHeight: true,
labelWidth: 1,
defaultType: 'textfield'
defaultType: 'textfield',
});
optMan.bind('listen_interface', fieldset.add({
optMan.bind(
'listen_interface',
fieldset.add({
name: 'listen_interface',
fieldLabel: '',
labelSeparator: '',
width: 200,
vtype: 'IPAddress'
}));
vtype: 'IPAddress',
})
);
var fieldset = this.add({
xtype: 'fieldset',
@ -57,23 +59,26 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
style: 'margin-bottom: 5px; padding-bottom: 0px;',
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
optMan.bind('random_port', fieldset.add({
optMan.bind(
'random_port',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Use Random Port'),
name: 'random_port',
height: 22,
listeners: {
'check': {
check: {
fn: function(e, checked) {
this.listenPort.setDisabled(checked);
},
scope: this
}
}
}));
scope: this,
},
},
})
);
this.listenPort = fieldset.add({
xtype: 'spinnerfield',
@ -85,8 +90,8 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
xtype: 'number',
decimalPrecision: 0,
minValue: 0,
maxValue: 65535
}
maxValue: 65535,
},
});
optMan.bind('listen_ports', this.listenPort);
@ -97,14 +102,17 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
style: 'margin-bottom: 5px; padding-bottom: 0px;',
autoHeight: true,
labelWidth: 1,
defaultType: 'textfield'
defaultType: 'textfield',
});
optMan.bind('outgoing_interface', fieldset.add({
optMan.bind(
'outgoing_interface',
fieldset.add({
name: 'outgoing_interface',
fieldLabel: '',
labelSeparator: '',
width: 40,
}));
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -113,23 +121,26 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
style: 'margin-bottom: 5px; padding-bottom: 0px;',
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
optMan.bind('random_outgoing_ports', fieldset.add({
optMan.bind(
'random_outgoing_ports',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Use Random Ports'),
name: 'random_outgoing_ports',
height: 22,
listeners: {
'check': {
check: {
fn: function(e, checked) {
this.outgoingPorts.setDisabled(checked);
},
scope: this
}
}
}));
scope: this,
},
},
})
);
this.outgoingPorts = fieldset.add({
xtype: 'spinnergroup',
name: 'outgoing_ports',
@ -137,27 +148,30 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
labelSeparator: '',
colCfg: {
labelWidth: 40,
style: 'margin-right: 10px;'
style: 'margin-right: 10px;',
},
items: [{
items: [
{
fieldLabel: _('From:'),
labelSeparator: '',
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: 0,
maxValue: 65535
}
}, {
maxValue: 65535,
},
},
{
fieldLabel: _('To:'),
labelSeparator: '',
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: 0,
maxValue: 65535
}
}]
maxValue: 65535,
},
},
],
});
optMan.bind('outgoing_ports', this.outgoingPorts);
@ -168,43 +182,58 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
autoHeight: true,
layout: 'table',
layoutConfig: {
columns: 3
columns: 3,
},
defaultType: 'checkbox'
defaultType: 'checkbox',
});
optMan.bind('upnp', fieldset.add({
optMan.bind(
'upnp',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('UPnP'),
name: 'upnp'
}));
optMan.bind('natpmp', fieldset.add({
name: 'upnp',
})
);
optMan.bind(
'natpmp',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('NAT-PMP'),
ctCls: 'x-deluge-indent-checkbox',
name: 'natpmp'
}));
optMan.bind('utpex', fieldset.add({
name: 'natpmp',
})
);
optMan.bind(
'utpex',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Peer Exchange'),
ctCls: 'x-deluge-indent-checkbox',
name: 'utpex'
}));
optMan.bind('lsd', fieldset.add({
name: 'utpex',
})
);
optMan.bind(
'lsd',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('LSD'),
name: 'lsd'
}));
optMan.bind('dht', fieldset.add({
name: 'lsd',
})
);
optMan.bind(
'dht',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('DHT'),
ctCls: 'x-deluge-indent-checkbox',
name: 'dht'
}));
name: 'dht',
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -213,13 +242,16 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
style: 'margin-bottom: 5px; padding-bottom: 0px;',
bodyStyle: 'margin: 0px; padding: 0px',
autoHeight: true,
defaultType: 'textfield'
defaultType: 'textfield',
});
optMan.bind('peer_tos', fieldset.add({
optMan.bind(
'peer_tos',
fieldset.add({
name: 'peer_tos',
fieldLabel: _('Peer TOS Byte:'),
labelSeparator: '',
width: 40
}));
}
width: 40,
})
);
},
});

View file

@ -15,12 +15,15 @@ Ext.namespace('Deluge.preferences');
*/
Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, {
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
border: false,
title: _('Other'),
header: false,
layout: 'form'
}, config);
layout: 'form',
},
config
);
Deluge.preferences.Other.superclass.constructor.call(this, config);
},
@ -35,15 +38,18 @@ Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, {
title: _('Updates'),
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
optMan.bind('new_release_check', fieldset.add({
optMan.bind(
'new_release_check',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
height: 22,
name: 'new_release_check',
boxLabel: _('Be alerted about new releases')
}));
boxLabel: _('Be alerted about new releases'),
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -51,22 +57,27 @@ Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, {
title: _('System Information'),
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
fieldset.add({
xtype: 'panel',
border: false,
bodyCfg: {
html: _('Help us improve Deluge by sending us your Python version, PyGTK version, OS and processor types. Absolutely no other information is sent.')
}
html: _(
'Help us improve Deluge by sending us your Python version, PyGTK version, OS and processor types. Absolutely no other information is sent.'
),
},
});
optMan.bind('send_info', fieldset.add({
optMan.bind(
'send_info',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
height: 22,
boxLabel: _('Yes, please send anonymous statistics'),
name: 'send_info'
}));
name: 'send_info',
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -74,13 +85,16 @@ Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, {
title: _('GeoIP Database'),
autoHeight: true,
labelWidth: 80,
defaultType: 'textfield'
defaultType: 'textfield',
});
optMan.bind('geoip_db_location', fieldset.add({
optMan.bind(
'geoip_db_location',
fieldset.add({
name: 'geoip_db_location',
fieldLabel: _('Path:'),
labelSeparator: '',
width: 200
}));
}
width: 200,
})
);
},
});

View file

@ -14,7 +14,6 @@ Ext.namespace('Deluge.preferences');
* @extends Ext.Panel
*/
Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
layout: 'border',
title: _('Plugins'),
header: false,
@ -23,60 +22,79 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
pluginTemplate: new Ext.Template(
'<dl class="singleline">' +
'<dt>' + _('Author:') + '</dt><dd>{author}</dd>' +
'<dt>' + _('Version:') + '</dt><dd>{version}</dd>' +
'<dt>' + _('Author Email:') + '</dt><dd>{email}</dd>' +
'<dt>' + _('Homepage:') + '</dt><dd>{homepage}</dd>' +
'<dt>' + _('Details:') + '</dt><dd style="white-space:normal">{details}</dd>' +
'<dt>' +
_('Author:') +
'</dt><dd>{author}</dd>' +
'<dt>' +
_('Version:') +
'</dt><dd>{version}</dd>' +
'<dt>' +
_('Author Email:') +
'</dt><dd>{email}</dd>' +
'<dt>' +
_('Homepage:') +
'</dt><dd>{homepage}</dd>' +
'<dt>' +
_('Details:') +
'</dt><dd style="white-space:normal">{details}</dd>' +
'</dl>'
),
initComponent: function() {
Deluge.preferences.Plugins.superclass.initComponent.call(this);
this.defaultValues = {
'version': '',
'email': '',
'homepage': '',
'details': ''
version: '',
email: '',
homepage: '',
details: '',
};
this.pluginTemplate.compile();
var checkboxRenderer = function(v, p, record) {
p.css += ' x-grid3-check-col-td';
return '<div class="x-grid3-check-col'+(v?'-on':'')+'"> </div>';
}
return (
'<div class="x-grid3-check-col' + (v ? '-on' : '') + '"> </div>'
);
};
this.list = this.add({
xtype: 'listview',
store: new Ext.data.ArrayStore({
fields: [
{ name: 'enabled', mapping: 0 },
{name: 'plugin', mapping: 1, sortType: 'asUCString'}
]
{ name: 'plugin', mapping: 1, sortType: 'asUCString' },
],
}),
columns: [{
columns: [
{
id: 'enabled',
header: _('Enabled'),
width: .2,
width: 0.2,
sortable: true,
tpl: new Ext.XTemplate('{enabled:this.getCheckbox}', {
getCheckbox: function(v) {
return '<div class="x-grid3-check-col'+(v?'-on':'')+'" rel="chkbox"> </div>';
}
return (
'<div class="x-grid3-check-col' +
(v ? '-on' : '') +
'" rel="chkbox"> </div>'
);
},
}),
dataIndex: 'enabled'
}, {
dataIndex: 'enabled',
},
{
id: 'plugin',
header: _('Plugin'),
width: .8,
width: 0.8,
sortable: true,
dataIndex: 'plugin'
}],
dataIndex: 'plugin',
},
],
singleSelect: true,
autoExpandColumn: 'plugin',
listeners: {
selectionchange: {fn: this.onPluginSelect, scope: this}
}
selectionchange: { fn: this.onPluginSelect, scope: this },
},
});
this.panel = this.add({
@ -84,23 +102,27 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
autoScroll: true,
items: [this.list],
bbar: new Ext.Toolbar({
items: [{
items: [
{
cls: 'x-btn-text-icon',
iconCls: 'x-deluge-install-plugin',
text: _('Install'),
handler: this.onInstallPluginWindow,
scope: this
}, '->', {
scope: this,
},
'->',
{
cls: 'x-btn-text-icon',
text: _('Find More'),
iconCls: 'x-deluge-find-more',
handler: this.onFindMorePlugins,
scope: this
}]
})
scope: this,
},
],
}),
});
var pp = this.pluginInfo = this.add({
var pp = (this.pluginInfo = this.add({
xtype: 'panel',
border: false,
height: 100,
@ -108,9 +130,9 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
padding: '5',
autoScroll: true,
bodyCfg: {
style: 'white-space: nowrap'
}
});
style: 'white-space: nowrap',
},
}));
this.pluginInfo.on('render', this.onPluginInfoRender, this);
this.list.on('click', this.onNodeClick, this);
@ -141,30 +163,34 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
deluge.client.core.get_enabled_plugins({
success: onGotEnabledPlugins,
scope: this
scope: this,
});
}
};
var onGotEnabledPlugins = function(plugins) {
this.enabledPlugins = plugins;
this.onGotPlugins()
}
this.onGotPlugins();
};
deluge.client.core.get_available_plugins({
success: onGotAvailablePlugins,
scope: this
scope: this,
});
},
updatePluginsGrid: function() {
var plugins = [];
Ext.each(this.availablePlugins, function(plugin) {
Ext.each(
this.availablePlugins,
function(plugin) {
if (this.enabledPlugins.indexOf(plugin) > -1) {
plugins.push([true, plugin]);
} else {
plugins.push([false, plugin]);
}
}, this);
},
this
);
this.list.getStore().loadData(plugins);
},
@ -173,7 +199,7 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
if (el.getAttribute('rel') != 'chkbox') return;
var r = dv.getStore().getAt(index);
if (r.get('plugin') == "WebUi") return;
if (r.get('plugin') == 'WebUi') return;
r.set('enabled', !r.get('enabled'));
r.commit();
if (r.get('enabled')) {
@ -198,8 +224,8 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
version: info['Version'],
email: info['Author-email'],
homepage: info['Home-page'],
details: info['Description']
}
details: info['Description'],
};
this.setInfo(values);
delete info;
},
@ -237,7 +263,7 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
var r = dv.getRecords(selections)[0];
deluge.client.web.get_plugin_info(r.get('plugin'), {
success: this.onGotPluginInfo,
scope: this
scope: this,
});
},
@ -247,5 +273,5 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
onPluginInfoRender: function(ct, position) {
this.setInfo();
}
},
});

View file

@ -16,7 +16,6 @@ PreferencesRecord = Ext.data.Record.create([{name:'name', type:'string'}]);
* @extends Ext.Window
*/
Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
/**
* @property {String} currentPage The currently selected page.
*/
@ -38,33 +37,38 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
pages: {},
initComponent: function() {
Deluge.preferences.PreferencesWindow.superclass.initComponent.call(this);
Deluge.preferences.PreferencesWindow.superclass.initComponent.call(
this
);
this.list = new Ext.list.ListView({
store: new Ext.data.Store(),
columns: [{
columns: [
{
id: 'name',
renderer: fplain,
dataIndex: 'name'
}],
dataIndex: 'name',
},
],
singleSelect: true,
listeners: {
'selectionchange': {
fn: this.onPageSelect, scope: this
}
selectionchange: {
fn: this.onPageSelect,
scope: this,
},
},
hideHeaders: true,
autoExpandColumn: 'name',
deferredRender: false,
autoScroll: true,
collapsible: true
collapsible: true,
});
this.add({
region: 'west',
items: [this.list],
width: 120,
margins: '0 5 0 0',
cmargins: '0 5 0 0'
cmargins: '0 5 0 0',
});
this.configPanel = this.add({
@ -73,10 +77,10 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
region: 'center',
layout: 'card',
layoutConfig: {
deferredRender: true
deferredRender: true,
},
autoScroll: true,
width: 300
width: 300,
});
this.addButton(_('Close'), this.onClose, this);
@ -110,11 +114,14 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
if (!Ext.isObjectEmpty(changed)) {
// Workaround for only displaying single listen port but still pass array to core.
if ('listen_ports' in changed) {
changed.listen_ports = [changed.listen_ports, changed.listen_ports]
changed.listen_ports = [
changed.listen_ports,
changed.listen_ports,
];
}
deluge.client.core.set_config(changed, {
success: this.onSetConfig,
scope: this
scope: this,
});
}
@ -123,7 +130,6 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
}
},
/**
* Return the options manager for the preferences window.
* @returns {Deluge.OptionsManager} the options manager
@ -165,7 +171,9 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
*/
selectPage: function(page) {
if (this.pages[page].index < 0) {
this.pages[page].index = this.configPanel.items.indexOf(this.pages[page]);
this.pages[page].index = this.configPanel.items.indexOf(
this.pages[page]
);
}
this.list.select(this.pages[page].index);
},
@ -173,7 +181,9 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
// private
doSelectPage: function(page) {
if (this.pages[page].index < 0) {
this.pages[page].index = this.configPanel.items.indexOf(this.pages[page]);
this.pages[page].index = this.configPanel.items.indexOf(
this.pages[page]
);
}
this.configPanel.getLayout().setActiveItem(this.pages[page].index);
this.currentPage = page;
@ -208,8 +218,8 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
if (!deluge.client.core) return;
deluge.client.core.get_config({
success: this.onGotConfig,
scope: this
})
scope: this,
});
},
// private
@ -223,7 +233,7 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
if (!Ext.isObjectEmpty(changed)) {
deluge.client.core.set_config(changed, {
success: this.onSetConfig,
scope: this
scope: this,
});
}
@ -232,5 +242,5 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
}
this.hide();
}
},
});

View file

@ -14,7 +14,6 @@ Ext.ns('Deluge.preferences');
* @extends Ext.form.FieldSet
*/
Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
border: false,
autoHeight: true,
labelWidth: 70,
@ -37,13 +36,13 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
[3, _('Socks5 Auth')],
[4, _('HTTP')],
[5, _('HTTP Auth')],
[6, _('I2P')]
]
[6, _('I2P')],
],
}),
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
displayField: 'text',
});
this.proxyType.on('change', this.onFieldChange, this);
this.proxyType.on('select', this.onTypeSelect, this);
@ -53,7 +52,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
name: 'hostname',
fieldLabel: _('Host:'),
labelSeparator: '',
width: 220
width: 220,
});
this.hostname.on('change', this.onFieldChange, this);
@ -65,7 +64,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
width: 80,
decimalPrecision: 0,
minValue: 0,
maxValue: 65535
maxValue: 65535,
});
this.port.on('change', this.onFieldChange, this);
@ -74,7 +73,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
name: 'username',
fieldLabel: _('Username:'),
labelSeparator: '',
width: 220
width: 220,
});
this.username.on('change', this.onFieldChange, this);
@ -84,7 +83,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
fieldLabel: _('Password:'),
labelSeparator: '',
inputType: 'password',
width: 220
width: 220,
});
this.password.on('change', this.onFieldChange, this);
@ -93,7 +92,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
name: 'proxy_host_resolve',
fieldLabel: '',
boxLabel: _('Proxy Hostnames'),
width: 220
width: 220,
});
this.proxy_host_resolve.on('change', this.onFieldChange, this);
@ -102,7 +101,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
name: 'proxy_peer_conn',
fieldLabel: '',
boxLabel: _('Proxy Peers'),
width: 220
width: 220,
});
this.proxy_peer_conn.on('change', this.onFieldChange, this);
@ -111,7 +110,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
name: 'proxy_tracker_conn',
fieldLabel: '',
boxLabel: _('Proxy Trackers'),
width: 220
width: 220,
});
this.proxy_tracker_conn.on('change', this.onFieldChange, this);
@ -122,7 +121,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox',
style: 'padding-left: 0px; margin-top: 10px'
style: 'padding-left: 0px; margin-top: 10px',
});
this.force_proxy = fieldset.add({
@ -130,8 +129,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
labelSeparator: '',
height: 20,
name: 'force_proxy',
boxLabel: _('Force Use of Proxy')
boxLabel: _('Force Use of Proxy'),
});
this.force_proxy.on('change', this.onFieldChange, this);
@ -140,7 +138,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
labelSeparator: '',
height: 20,
name: 'anonymous_mode',
boxLabel: _('Hide Client Identity')
boxLabel: _('Hide Client Identity'),
});
this.anonymous_mode.on('change', this.onFieldChange, this);
@ -153,17 +151,17 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
getValue: function() {
return {
'type': this.proxyType.getValue(),
'hostname': this.hostname.getValue(),
'port': Number(this.port.getValue()),
'username': this.username.getValue(),
'password': this.password.getValue(),
'proxy_hostnames': this.proxy_host_resolve.getValue(),
'proxy_peer_connections': this.proxy_peer_conn.getValue(),
'proxy_tracker_connections': this.proxy_tracker_conn.getValue(),
'force_proxy': this.force_proxy.getValue(),
'anonymous_mode': this.anonymous_mode.getValue()
}
type: this.proxyType.getValue(),
hostname: this.hostname.getValue(),
port: Number(this.port.getValue()),
username: this.username.getValue(),
password: this.password.getValue(),
proxy_hostnames: this.proxy_host_resolve.getValue(),
proxy_peer_connections: this.proxy_peer_conn.getValue(),
proxy_tracker_connections: this.proxy_tracker_conn.getValue(),
force_proxy: this.force_proxy.getValue(),
anonymous_mode: this.anonymous_mode.getValue(),
};
},
// Set the values of the proxies
@ -223,5 +221,5 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
this.username.hide();
this.password.hide();
}
}
},
});

View file

@ -15,30 +15,35 @@ Ext.namespace('Deluge.preferences');
*/
Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
constructor: function(config) {
config = Ext.apply({
config = Ext.apply(
{
border: false,
title: _('Proxy'),
header: false,
layout: 'form',
autoScroll: true
}, config);
autoScroll: true,
},
config
);
Deluge.preferences.Proxy.superclass.constructor.call(this, config);
},
initComponent: function() {
Deluge.preferences.Proxy.superclass.initComponent.call(this);
this.proxy = this.add(new Deluge.preferences.ProxyField({
this.proxy = this.add(
new Deluge.preferences.ProxyField({
title: _('Proxy'),
name: 'proxy'
}));
name: 'proxy',
})
);
this.proxy.on('change', this.onProxyChange, this);
deluge.preferences.getOptionsManager().bind('proxy', this.proxy);
},
getValue: function() {
return {
'proxy': this.proxy.getValue()
}
proxy: this.proxy.getValue(),
};
},
setValue: function(value) {
@ -53,5 +58,5 @@ Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
oldValues[field.getName()] = oldValue;
this.fireEvent('change', this, newValues, oldValues);
}
},
});

View file

@ -14,7 +14,6 @@ Ext.namespace('Deluge.preferences');
* @extends Ext.form.FormPanel
*/
Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
border: false,
title: _('Queue'),
header: false,
@ -32,15 +31,18 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
style: 'padding-top: 5px; margin-bottom: 0px;',
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
defaultType: 'checkbox',
});
om.bind('queue_new_to_top', fieldset.add({
om.bind(
'queue_new_to_top',
fieldset.add({
fieldLabel: '',
labelSeparator: '',
height: 22,
boxLabel: _('Queue to top'),
name: 'queue_new_to_top'
}));
name: 'queue_new_to_top',
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -49,9 +51,11 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
autoHeight: true,
labelWidth: 150,
defaultType: 'spinnerfield',
style: 'padding-top: 5px; margin-bottom: 0px'
style: 'padding-top: 5px; margin-bottom: 0px',
});
om.bind('max_active_limit', fieldset.add({
om.bind(
'max_active_limit',
fieldset.add({
fieldLabel: _('Total:'),
labelSeparator: '',
name: 'max_active_limit',
@ -59,9 +63,12 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
width: 80,
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
}));
om.bind('max_active_downloading', fieldset.add({
maxValue: 99999,
})
);
om.bind(
'max_active_downloading',
fieldset.add({
fieldLabel: _('Downloading:'),
labelSeparator: '',
name: 'max_active_downloading',
@ -69,9 +76,12 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
width: 80,
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
}));
om.bind('max_active_seeding', fieldset.add({
maxValue: 99999,
})
);
om.bind(
'max_active_seeding',
fieldset.add({
fieldLabel: _('Seeding:'),
labelSeparator: '',
name: 'max_active_seeding',
@ -79,21 +89,28 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
width: 80,
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
}));
om.bind('dont_count_slow_torrents', fieldset.add({
maxValue: 99999,
})
);
om.bind(
'dont_count_slow_torrents',
fieldset.add({
xtype: 'checkbox',
name: 'dont_count_slow_torrents',
height: 22,
hideLabel: true,
boxLabel: _('Ignore slow torrents')
}));
om.bind('auto_manage_prefer_seeds', fieldset.add({
boxLabel: _('Ignore slow torrents'),
})
);
om.bind(
'auto_manage_prefer_seeds',
fieldset.add({
xtype: 'checkbox',
name: 'auto_manage_prefer_seeds',
hideLabel: true,
boxLabel: _('Prefer seeding torrents')
}));
boxLabel: _('Prefer seeding torrents'),
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -102,9 +119,11 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
autoHeight: true,
labelWidth: 150,
defaultType: 'spinnerfield',
style: 'padding-top: 5px; margin-bottom: 0px'
style: 'padding-top: 5px; margin-bottom: 0px',
});
om.bind('share_ratio_limit', fieldset.add({
om.bind(
'share_ratio_limit',
fieldset.add({
fieldLabel: _('Share Ratio:'),
labelSeparator: '',
name: 'share_ratio_limit',
@ -114,9 +133,12 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
minValue: -1,
maxValue: 99999,
alternateIncrementValue: 1,
decimalPrecision: 2
}));
om.bind('seed_time_ratio_limit', fieldset.add({
decimalPrecision: 2,
})
);
om.bind(
'seed_time_ratio_limit',
fieldset.add({
fieldLabel: _('Time Ratio:'),
labelSeparator: '',
name: 'seed_time_ratio_limit',
@ -126,9 +148,12 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
minValue: -1,
maxValue: 99999,
alternateIncrementValue: 1,
decimalPrecision: 2
}));
om.bind('seed_time_limit', fieldset.add({
decimalPrecision: 2,
})
);
om.bind(
'seed_time_limit',
fieldset.add({
fieldLabel: _('Time (m):'),
labelSeparator: '',
name: 'seed_time_limit',
@ -136,8 +161,9 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
width: 80,
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
}));
maxValue: 99999,
})
);
fieldset = this.add({
xtype: 'fieldset',
@ -153,12 +179,12 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
defaults: {
fieldLabel: '',
labelSeparator: ''
}
labelSeparator: '',
},
});
this.stopAtRatio = fieldset.add({
name: 'stop_seed_at_ratio',
boxLabel: _('Share Ratio:')
boxLabel: _('Share Ratio:'),
});
this.stopAtRatio.on('check', this.onStopRatioCheck, this);
om.bind('stop_seed_at_ratio', this.stopAtRatio);
@ -174,7 +200,7 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
minValue: -1,
maxValue: 99999,
alternateIncrementValue: 1,
decimalPrecision: 2
decimalPrecision: 2,
});
om.bind('stop_seed_ratio', this.stopRatio);
@ -183,17 +209,20 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
columns: 1,
colspan: 2,
disabled: true,
style: "margin-left: 10px",
items: [{
style: 'margin-left: 10px',
items: [
{
boxLabel: _('Pause torrent'),
name: 'at_ratio',
inputValue: false,
checked: true
}, {
checked: true,
},
{
boxLabel: _('Remove torrent'),
name: 'at_ratio',
inputValue: true
}]
inputValue: true,
},
],
});
om.bind('remove_seed_at_ratio', this.removeAtRatio);
},
@ -201,5 +230,5 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
onStopRatioCheck: function(e, checked) {
this.stopRatio.setDisabled(!checked);
this.removeAtRatio.setDisabled(!checked);
}
},
});

View file

@ -6,7 +6,7 @@ Ext.ux.JSLoader = function(options) {
options: options,
onLoad: options.onLoad || Ext.emptyFn,
onError: options.onError || Ext.ux.JSLoader.stdError,
scope: options.scope || this
scope: options.scope || this,
};
Ext.Ajax.request({
@ -28,11 +28,13 @@ Ext.ux.JSLoader = function(options) {
var script = Ext.ux.JSLoader.scripts[options.scriptIndex];
script.success = false;
script.onError(script.options, response.status);
}
},
});
};
Ext.ux.JSLoader.index = 0;
Ext.ux.JSLoader.scripts = [];
Ext.ux.JSLoader.stdError = function(options, e) {
window.alert('Error loading script:\n\n' + options.url + '\n\nstatus: ' + e);
window.alert(
'Error loading script:\n\n' + options.url + '\n\nstatus: ' + e
);
};

View file

@ -37,22 +37,21 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
},
doRender: function(ct, position) {
var el = this.el = this.field.getEl();
var el = (this.el = this.field.getEl());
var f = this.field;
if (!f.wrap) {
f.wrap = this.wrap = el.wrap({
cls: "x-form-field-wrap"
cls: 'x-form-field-wrap',
});
}
else {
} else {
this.wrap = f.wrap.addClass('x-form-field-wrap');
}
this.trigger = this.wrap.createChild({
tag: "img",
tag: 'img',
src: Ext.BLANK_IMAGE_URL,
cls: "x-form-trigger " + this.triggerClass
cls: 'x-form-trigger ' + this.triggerClass,
});
if (!f.width) {
@ -62,17 +61,20 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
this.splitter = this.wrap.createChild({
tag: 'div',
cls: this.splitterClass,
style: 'width:13px; height:2px;'
style: 'width:13px; height:2px;',
});
this.splitter.setRight((Ext.isIE) ? 1 : 2).setTop(10).show();
this.splitter
.setRight(Ext.isIE ? 1 : 2)
.setTop(10)
.show();
this.proxy = this.trigger.createProxy('', this.splitter, true);
this.proxy.addClass("x-form-spinner-proxy");
this.proxy.addClass('x-form-spinner-proxy');
this.proxy.setStyle('left', '0px');
this.proxy.setSize(14, 1);
this.proxy.hide();
this.dd = new Ext.dd.DDProxy(this.splitter.dom.id, "SpinnerDrag", {
dragElId: this.proxy.id
this.dd = new Ext.dd.DDProxy(this.splitter.dom.id, 'SpinnerDrag', {
dragElId: this.proxy.id,
});
this.initTrigger();
@ -113,9 +115,14 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
if (!this.mimicing) {
this.wrap.addClass('x-trigger-wrap-focus');
this.mimicing = true;
Ext.get(Ext.isIE ? document.body : document).on("mousedown", this.mimicBlur, this, {
delay: 10
});
Ext.get(Ext.isIE ? document.body : document).on(
'mousedown',
this.mimicBlur,
this,
{
delay: 10,
}
);
this.el.on('keydown', this.checkTab, this);
}
},
@ -137,8 +144,12 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
// private
triggerBlur: function() {
this.mimicing = false;
Ext.get(Ext.isIE ? document.body : document).un("mousedown", this.mimicBlur, this);
this.el.un("keydown", this.checkTab, this);
Ext.get(Ext.isIE ? document.body : document).un(
'mousedown',
this.mimicBlur,
this
);
this.el.un('keydown', this.checkTab, this);
this.field.beforeBlur();
this.wrap.removeClass('x-trigger-wrap-focus');
this.field.onBlur.call(this.field);
@ -151,40 +162,40 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
initSpinner: function() {
this.field.addEvents({
'spin': true,
'spinup': true,
'spindown': true
spin: true,
spinup: true,
spindown: true,
});
this.keyNav = new Ext.KeyNav(this.el, {
"up": function(e){
up: function(e) {
e.preventDefault();
this.onSpinUp();
},
"down": function(e){
down: function(e) {
e.preventDefault();
this.onSpinDown();
},
"pageUp": function(e){
pageUp: function(e) {
e.preventDefault();
this.onSpinUpAlternate();
},
"pageDown": function(e){
pageDown: function(e) {
e.preventDefault();
this.onSpinDownAlternate();
},
scope: this
scope: this,
});
this.repeater = new Ext.util.ClickRepeater(this.trigger, {
accelerate: this.accelerate
accelerate: this.accelerate,
});
this.field.mon(this.repeater, "click", this.onTriggerClick, this, {
preventDefault: true
this.field.mon(this.repeater, 'click', this.onTriggerClick, this, {
preventDefault: true,
});
this.field.mon(this.trigger, {
@ -194,10 +205,10 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
mousedown: this.onMouseDown,
mouseup: this.onMouseUp,
scope: this,
preventDefault: true
preventDefault: true,
});
this.field.mon(this.wrap, "mousewheel", this.handleMouseWheel, this);
this.field.mon(this.wrap, 'mousewheel', this.handleMouseWheel, this);
this.dd.setXConstraint(0, 0, 10);
this.dd.setYConstraint(1500, 1500, 10);
@ -211,7 +222,10 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
return;
}
var middle = this.getMiddle();
this.tmpHoverClass = (Ext.EventObject.getPageY() < middle) ? 'x-form-spinner-overup' : 'x-form-spinner-overdown';
this.tmpHoverClass =
Ext.EventObject.getPageY() < middle
? 'x-form-spinner-overup'
: 'x-form-spinner-overdown';
this.trigger.addClass(this.tmpHoverClass);
},
@ -226,8 +240,12 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
return;
}
var middle = this.getMiddle();
if (((Ext.EventObject.getPageY() > middle) && this.tmpHoverClass == "x-form-spinner-overup") ||
((Ext.EventObject.getPageY() < middle) && this.tmpHoverClass == "x-form-spinner-overdown")) {
if (
(Ext.EventObject.getPageY() > middle &&
this.tmpHoverClass == 'x-form-spinner-overup') ||
(Ext.EventObject.getPageY() < middle &&
this.tmpHoverClass == 'x-form-spinner-overdown')
) {
}
},
@ -237,7 +255,10 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
return;
}
var middle = this.getMiddle();
this.tmpClickClass = (Ext.EventObject.getPageY() < middle) ? 'x-form-spinner-clickup' : 'x-form-spinner-clickdown';
this.tmpClickClass =
Ext.EventObject.getPageY() < middle
? 'x-form-spinner-clickup'
: 'x-form-spinner-clickdown';
this.trigger.addClass(this.tmpClickClass);
},
@ -252,7 +273,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
return;
}
var middle = this.getMiddle();
var ud = (Ext.EventObject.getPageY() < middle) ? 'Up' : 'Down';
var ud = Ext.EventObject.getPageY() < middle ? 'Up' : 'Down';
this['onSpin' + ud]();
},
@ -260,7 +281,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
getMiddle: function() {
var t = this.trigger.getTop();
var h = this.trigger.getHeight();
var middle = t + (h / 2);
var middle = t + h / 2;
return middle;
},
@ -284,9 +305,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
if (delta > 0) {
this.onSpinUp();
e.stopEvent();
}
else
if (delta < 0) {
} else if (delta < 0) {
this.onSpinDown();
e.stopEvent();
}
@ -332,12 +351,11 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
if (Ext.EventObject.shiftKey == true) {
this.onSpinUpAlternate();
return;
}
else {
} else {
this.spin(false, false);
}
this.field.fireEvent("spin", this);
this.field.fireEvent("spinup", this);
this.field.fireEvent('spin', this);
this.field.fireEvent('spinup', this);
},
//private
@ -348,12 +366,11 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
if (Ext.EventObject.shiftKey == true) {
this.onSpinDownAlternate();
return;
}
else {
} else {
this.spin(true, false);
}
this.field.fireEvent("spin", this);
this.field.fireEvent("spindown", this);
this.field.fireEvent('spin', this);
this.field.fireEvent('spindown', this);
},
//private
@ -362,8 +379,8 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
return;
}
this.spin(false, true);
this.field.fireEvent("spin", this);
this.field.fireEvent("spinup", this);
this.field.fireEvent('spin', this);
this.field.fireEvent('spinup', this);
},
//private
@ -372,16 +389,19 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
return;
}
this.spin(true, true);
this.field.fireEvent("spin", this);
this.field.fireEvent("spindown", this);
this.field.fireEvent('spin', this);
this.field.fireEvent('spindown', this);
},
spin: function(down, alternate) {
var v = parseFloat(this.field.getValue());
var incr = (alternate == true) ? this.alternateIncrementValue : this.incrementValue;
(down == true) ? v -= incr : v += incr;
var incr =
alternate == true
? this.alternateIncrementValue
: this.incrementValue;
down == true ? (v -= incr) : (v += incr);
v = (isNaN(v)) ? this.defaultValue : v;
v = isNaN(v) ? this.defaultValue : v;
v = this.fixBoundries(v);
this.field.setRawValue(v);
},
@ -402,10 +422,17 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
// private
fixPrecision: function(value) {
var nan = isNaN(value);
if (!this.field.allowDecimals || this.field.decimalPrecision == -1 || nan || !value) {
if (
!this.field.allowDecimals ||
this.field.decimalPrecision == -1 ||
nan ||
!value
) {
return nan ? '' : value;
}
return parseFloat(parseFloat(value).toFixed(this.field.decimalPrecision));
return parseFloat(
parseFloat(value).toFixed(this.field.decimalPrecision)
);
},
doDestroy: function() {
@ -434,9 +461,13 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, {
this.repeater.purgeListeners();
}
if (this.mimicing) {
Ext.get(Ext.isIE ? document.body : document).un("mousedown", this.mimicBlur, this);
}
Ext.get(Ext.isIE ? document.body : document).un(
'mousedown',
this.mimicBlur,
this
);
}
},
});
//backwards compat

View file

@ -198,7 +198,7 @@ sb.setStatus({
this.currIconCls = this.iconCls || this.defaultIconCls;
this.statusEl = new Ext.Toolbar.TextItem({
cls: 'x-status-text ' + (this.currIconCls || ''),
text: this.text || this.defaultText || ''
text: this.text || this.defaultText || '',
});
if (right) {
@ -318,7 +318,11 @@ statusBar.setStatus({
}
var text = o.useDefaults ? this.defaultText : this.emptyText,
iconCls = o.useDefaults ? (this.defaultIconCls ? this.defaultIconCls : '') : '';
iconCls = o.useDefaults
? this.defaultIconCls
? this.defaultIconCls
: ''
: '';
if (o.anim) {
// animate the statusEl Ext.Element
@ -329,18 +333,18 @@ statusBar.setStatus({
callback: function() {
this.setStatus({
text: text,
iconCls: iconCls
iconCls: iconCls,
});
this.statusEl.el.show();
}
},
});
} else {
// hide/show the el to avoid jumpy text or icon
this.statusEl.hide();
this.setStatus({
text: text,
iconCls: iconCls
iconCls: iconCls,
});
this.statusEl.show();
}
@ -410,9 +414,9 @@ statusBar.setStatus({
}
o = Ext.applyIf(o || {}, {
text: this.busyText,
iconCls: this.busyIconCls
iconCls: this.busyIconCls,
});
return this.setStatus(o);
}
},
});
Ext.reg('statusbar', Ext.ux.StatusBar);

View file

@ -60,7 +60,11 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
// private
onRender: function(ct, position) {
Ext.ux.form.FileUploadField.superclass.onRender.call(this, ct, position);
Ext.ux.form.FileUploadField.superclass.onRender.call(
this,
ct,
position
);
this.wrap = this.el.wrap({ cls: 'x-form-field-wrap x-form-file-wrap' });
this.el.addClass('x-form-file-text');
@ -68,12 +72,14 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
this.createFileInput();
var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
text: this.buttonText
text: this.buttonText,
});
this.button = new Ext.Button(Ext.apply(btnCfg, {
this.button = new Ext.Button(
Ext.apply(btnCfg, {
renderTo: this.wrap,
cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-icon' : '')
}));
cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-icon' : ''),
})
);
if (this.buttonOnly) {
this.el.hide();
@ -88,22 +94,30 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
this.fileInput.on({
scope: this,
mouseenter: function() {
this.button.addClass(['x-btn-over','x-btn-focus'])
this.button.addClass(['x-btn-over', 'x-btn-focus']);
},
mouseleave: function() {
this.button.removeClass(['x-btn-over','x-btn-focus','x-btn-click'])
this.button.removeClass([
'x-btn-over',
'x-btn-focus',
'x-btn-click',
]);
},
mousedown: function() {
this.button.addClass('x-btn-click')
this.button.addClass('x-btn-click');
},
mouseup: function() {
this.button.removeClass(['x-btn-over','x-btn-focus','x-btn-click'])
this.button.removeClass([
'x-btn-over',
'x-btn-focus',
'x-btn-click',
]);
},
change: function() {
var v = this.fileInput.dom.value;
this.setValue(v);
this.fireEvent('fileselected', this, v);
}
},
});
},
@ -114,7 +128,7 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
cls: 'x-form-file',
tag: 'input',
type: 'file',
size: 1
size: 1,
});
},
@ -139,7 +153,10 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
this.wrap.setWidth(w);
if (!this.buttonOnly) {
var w = this.wrap.getWidth() - this.button.getEl().getWidth() - this.buttonOffset;
var w =
this.wrap.getWidth() -
this.button.getEl().getWidth() -
this.buttonOffset;
this.el.setWidth(w);
}
},
@ -158,7 +175,6 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
onEnable: function() {
Ext.ux.form.FileUploadField.superclass.onEnable.call(this);
this.doDisable(false);
},
// private
@ -167,15 +183,13 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
this.button.setDisabled(disabled);
},
// private
preFocus: Ext.emptyFn,
// private
alignErrorIcon: function() {
this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
}
},
});
Ext.reg('fileuploadfield', Ext.ux.form.FileUploadField);

View file

@ -10,7 +10,6 @@
// Allow radiogroups to be treated as a single form element.
Ext.override(Ext.form.RadioGroup, {
afterRender: function() {
this.items.each(function(i) {
this.relayEvents(i, ['check']);
@ -20,7 +19,7 @@ Ext.override(Ext.form.RadioGroup, {
delete this.value;
delete this.lazyValue;
}
Ext.form.RadioGroup.superclass.afterRender.call(this)
Ext.form.RadioGroup.superclass.afterRender.call(this);
},
getName: function() {
@ -39,11 +38,13 @@ Ext.override(Ext.form.RadioGroup, {
}
this.items.each(function(item) {
if (item.rendered) {
var checked = (item.el.getValue() == String(v));
var checked = item.el.getValue() == String(v);
item.el.dom.checked = checked;
item.el.dom.defaultChecked = checked;
item.wrap[checked ? 'addClass' : 'removeClass'](item.checkedCls);
item.wrap[checked ? 'addClass' : 'removeClass'](
item.checkedCls
);
}
});
}
},
});

View file

@ -20,17 +20,24 @@ Ext.ux.form.SpinnerField = Ext.extend(Ext.form.NumberField, {
adjustSize: Ext.BoxComponent.prototype.adjustSize,
constructor: function(config) {
var spinnerConfig = Ext.copyTo({}, config, 'incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass');
var spinnerConfig = Ext.copyTo(
{},
config,
'incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass'
);
var spl = this.spinner = new Ext.ux.Spinner(spinnerConfig);
var spl = (this.spinner = new Ext.ux.Spinner(spinnerConfig));
var plugins = config.plugins
? (Ext.isArray(config.plugins)
? Ext.isArray(config.plugins)
? config.plugins.push(spl)
: [config.plugins, spl])
: [config.plugins, spl]
: spl;
Ext.ux.form.SpinnerField.superclass.constructor.call(this, Ext.apply(config, {plugins: plugins}));
Ext.ux.form.SpinnerField.superclass.constructor.call(
this,
Ext.apply(config, { plugins: plugins })
);
},
// private
@ -52,7 +59,7 @@ Ext.ux.form.SpinnerField = Ext.extend(Ext.form.NumberField, {
validateBlur: function() {
return true;
}
},
});
Ext.reg('spinnerfield', Ext.ux.form.SpinnerField);

View file

@ -9,5 +9,5 @@
*/
Ext.override(Ext.ux.form.SpinnerField, {
onBlur: Ext.form.Field.prototype.onBlur
onBlur: Ext.form.Field.prototype.onBlur,
});

View file

@ -13,7 +13,6 @@ Ext.ns('Ext.ux.form');
*
*/
Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {
// private
defaultType: 'spinnerfield',
anchor: '98%',
@ -30,46 +29,48 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {
cls: this.groupCls,
layout: 'column',
border: false,
renderTo: ct
renderTo: ct,
};
var colCfg = Ext.apply({
var colCfg = Ext.apply(
{
defaultType: this.defaultType,
layout: 'form',
border: false,
labelWidth: 60,
defaults: {
hideLabel: true,
anchor: '60%'
}
}, this.colCfg);
anchor: '60%',
},
},
this.colCfg
);
if (this.items[0].items) {
// The container has standard ColumnLayout configs, so pass them in directly
Ext.apply(panelCfg, {
layoutConfig: { columns: this.items.length },
defaults: this.defaults,
items: this.items
items: this.items,
});
for (var i = 0, len = this.items.length; i < len; i++) {
Ext.applyIf(this.items[i], colCfg);
};
}
} else {
// The container has field item configs, so we have to generate the column
// panels first then move the items into the columns as needed.
var numCols, cols = [];
var numCols,
cols = [];
if(typeof this.columns == 'string'){ // 'auto' so create a col per item
if (typeof this.columns == 'string') {
// 'auto' so create a col per item
this.columns = this.items.length;
}
if (!Ext.isArray(this.columns)) {
var cs = [];
for (var i = 0; i < this.columns; i++) {
cs.push((100/this.columns)*.01); // distribute by even %
cs.push((100 / this.columns) * 0.01); // distribute by even %
}
this.columns = cs;
}
@ -79,16 +80,22 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {
// Generate the column configs with the correct width setting
for (var i = 0; i < numCols; i++) {
var cc = Ext.apply({ items: [] }, colCfg);
cc[this.columns[i] <= 1 ? 'columnWidth' : 'width'] = this.columns[i];
cc[
this.columns[i] <= 1 ? 'columnWidth' : 'width'
] = this.columns[i];
if (this.defaults) {
cc.defaults = Ext.apply(cc.defaults || {}, this.defaults)
cc.defaults = Ext.apply(
cc.defaults || {},
this.defaults
);
}
cols.push(cc);
};
}
// Distribute the original items into the columns
if (this.vertical) {
var rows = Math.ceil(this.items.length / numCols), ri = 0;
var rows = Math.ceil(this.items.length / numCols),
ri = 0;
for (var i = 0, len = this.items.length; i < len; i++) {
if (i > 0 && i % rows == 0) {
ri++;
@ -97,7 +104,7 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {
this.items[i].hideLabel = false;
}
cols[ri].items.push(this.items[i]);
};
}
} else {
for (var i = 0, len = this.items.length; i < len; i++) {
var ci = i % numCols;
@ -105,12 +112,12 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {
this.items[i].hideLabel = false;
}
cols[ci].items.push(this.items[i]);
};
}
}
Ext.apply(panelCfg, {
layoutConfig: { columns: numCols },
items: cols
items: cols,
});
}
@ -194,6 +201,6 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {
item.setRawValue(value[i]);
});
}
}
},
});
Ext.reg('spinnergroup', Ext.ux.form.SpinnerGroup);

View file

@ -7,7 +7,7 @@
* the additional special exception to link portions of this program with the OpenSSL library.
* See LICENSE for more details.
*/
Ext.namespace("Ext.ux.form");
Ext.namespace('Ext.ux.form');
/**
* Ext.ux.form.ToggleField class
@ -19,7 +19,6 @@ Ext.namespace("Ext.ux.form");
* @extends Ext.form.TriggerField
*/
Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, {
cls: 'x-toggle-field',
initComponent: function() {
@ -29,7 +28,7 @@ Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, {
this.toggle.on('check', this.onToggleCheck, this);
this.input = new Ext.form.TextField({
disabled: true
disabled: true,
});
},
@ -39,10 +38,10 @@ Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, {
cls: this.groupCls,
layout: 'table',
layoutConfig: {
columns: 2
columns: 2,
},
border: false,
renderTo: ct
renderTo: ct,
});
this.panel.ownerCt = this;
this.el = this.panel.getEl();
@ -51,7 +50,10 @@ Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, {
this.panel.add(this.input);
this.panel.doLayout();
this.toggle.getEl().parent().setStyle('padding-right', '10px');
this.toggle
.getEl()
.parent()
.setStyle('padding-right', '10px');
}
Ext.ux.form.ToggleField.superclass.onRender.call(this, ct, position);
},
@ -68,6 +70,6 @@ Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, {
onToggleCheck: function(toggle, checked) {
this.input.setDisabled(!checked);
}
},
});
Ext.reg('togglefield', Ext.ux.form.ToggleField);

View file

@ -59,7 +59,9 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
ts.rowBody = new Ext.Template(
'<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
'<tbody><tr>{cells}</tr>',
(this.enableRowBody ? '<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>' : ''),
this.enableRowBody
? '<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>'
: '',
'</tbody></table>'
);
ts.rowBody.disableFormats = true;
@ -67,7 +69,9 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
},
getStyleRowHeight: function() {
return Ext.isBorderBox ? (this.rowHeight + this.borderHeight) : this.rowHeight;
return Ext.isBorderBox
? this.rowHeight + this.borderHeight
: this.rowHeight;
},
getCalculatedRowHeight: function() {
@ -77,16 +81,19 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
getVisibleRowCount: function() {
var rh = this.getCalculatedRowHeight(),
visibleHeight = this.scroller.dom.clientHeight;
return (visibleHeight < 1) ? 0 : Math.ceil(visibleHeight / rh);
return visibleHeight < 1 ? 0 : Math.ceil(visibleHeight / rh);
},
getVisibleRows: function() {
var count = this.getVisibleRowCount(),
sc = this.scroller.dom.scrollTop,
start = (sc === 0 ? 0 : Math.floor(sc/this.getCalculatedRowHeight())-1);
start =
sc === 0
? 0
: Math.floor(sc / this.getCalculatedRowHeight()) - 1;
return {
first: Math.max(start, 0),
last: Math.min(start + count + 2, this.ds.getCount()-1)
last: Math.min(start + count + 2, this.ds.getCount() - 1),
};
},
@ -107,19 +114,25 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
rp = { tstyle: tstyle },
r;
for (var j = 0, len = rs.length; j < len; j++) {
r = rs[j]; cb = [];
var rowIndex = (j+startRow),
r = rs[j];
cb = [];
var rowIndex = j + startRow,
visible = rowIndex >= vr.first && rowIndex <= vr.last;
if (visible) {
for (var i = 0; i < colCount; i++) {
c = cs[i];
p.id = c.id;
p.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
p.attr = p.cellAttr = "";
p.css =
i === 0
? 'x-grid3-cell-first '
: i == last
? 'x-grid3-cell-last '
: '';
p.attr = p.cellAttr = '';
p.value = c.renderer(r.data[c.name], p, r, rowIndex, i, ds);
p.style = c.style;
if (p.value === undefined || p.value === "") {
p.value = "&#160;";
if (p.value === undefined || p.value === '') {
p.value = '&#160;';
}
if (r.dirty && typeof r.modified[c.name] !== 'undefined') {
p.css += ' x-grid3-dirty-cell';
@ -128,21 +141,25 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
}
}
var alt = [];
if(stripe && ((rowIndex+1) % 2 === 0)){
alt[0] = "x-grid3-row-alt";
if (stripe && (rowIndex + 1) % 2 === 0) {
alt[0] = 'x-grid3-row-alt';
}
if (r.dirty) {
alt[1] = " x-grid3-dirty-row";
alt[1] = ' x-grid3-dirty-row';
}
rp.cols = colCount;
if (this.getRowClass) {
alt[2] = this.getRowClass(r, rowIndex, rp, ds);
}
rp.alt = alt.join(" ");
rp.cells = cb.join("");
buf[buf.length] = !visible ? ts.rowHolder.apply(rp) : (onlyBody ? rb.apply(rp) : rt.apply(rp));
rp.alt = alt.join(' ');
rp.cells = cb.join('');
buf[buf.length] = !visible
? ts.rowHolder.apply(rp)
: onlyBody
? rb.apply(rp)
: rt.apply(rp);
}
return buf.join("");
return buf.join('');
},
isRowRendered: function(index) {
@ -185,7 +202,15 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
for (var i = vr.first; i <= vr.last; i++) {
// if row is NOT rendered and is visible, render it
if (!this.isRowRendered(i) && (row = this.getRow(i))) {
var html = this.doRender(cs, [ds.getAt(i)], ds, i, cm.getColumnCount(), g.stripeRows, true);
var html = this.doRender(
cs,
[ds.getAt(i)],
ds,
i,
cm.getColumnCount(),
g.stripeRows,
true
);
row.innerHTML = html;
}
}
@ -207,7 +232,8 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
vr.first -= this.cacheSize;
vr.last += this.cacheSize;
var i = 0, rows = this.getRows();
var i = 0,
rows = this.getRows();
// if first is less than 0, all rows have been rendered
// so lets clean the end...
if (vr.first <= 0) {
@ -240,5 +266,5 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
layout: function() {
Ext.ux.grid.BufferView.superclass.layout.call(this);
this.update();
}
},
});

View file

@ -13,7 +13,12 @@
// the label. don't use hideLabel with this.
Ext.override(Ext.layout.FormLayout, {
renderItem: function(c, position, target) {
if(c && !c.rendered && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){
if (
c &&
!c.rendered &&
(c.isFormField || c.fieldLabel) &&
c.inputType != 'hidden'
) {
var args = this.getTemplateArgs(c);
if (typeof position == 'number') {
position = target.dom.childNodes[position] || null;
@ -30,5 +35,5 @@ Ext.override(Ext.layout.FormLayout, {
} else {
Ext.layout.FormLayout.superclass.renderItem.apply(this, arguments);
}
}
},
});

View file

@ -13,7 +13,6 @@
* @author Damien Churchill <damoxc@gmail.com>
*/
Ext.override(Ext.tree.MultiSelectionModel, {
onNodeClick: function(node, e) {
if (e.ctrlKey && this.isSelected(node)) {
this.unselect(node);
@ -31,7 +30,7 @@ Ext.override(Ext.tree.MultiSelectionModel, {
// Swap the values if required
if (fi > li) {
fi = fi + li, li = fi - li, fi = fi - li;
(fi = fi + li), (li = fi - li), (fi = fi - li);
}
// Select all the nodes
@ -65,6 +64,5 @@ Ext.override(Ext.tree.MultiSelectionModel, {
this.fireEvent('selectionchange', this, this.selNodes);
}
return node;
}
},
});

View file

@ -37,7 +37,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
l = new Ext.ux.tree.TreeGridLoader({
dataUrl: this.dataUrl,
requestMethod: this.requestMethod,
store: this.store
store: this.store,
});
} else if (Ext.isObject(l) && !l.load) {
l = new Ext.ux.tree.TreeGridLoader(l);
@ -49,7 +49,10 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
this.initColumns();
if (this.enableSort) {
this.treeGridSorter = new Ext.ux.tree.TreeGridSorter(this, this.enableSort);
this.treeGridSorter = new Ext.ux.tree.TreeGridSorter(
this,
this.enableSort
);
}
if (this.columnResize) {
@ -66,10 +69,16 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
'<table style="table-layout: fixed;" cellspacing="0" cellpadding="0" border="0"><colgroup><tpl for="columns"><col /></tpl></colgroup>',
'<thead><tr class="x-grid3-hd-row">',
'<tpl for="columns">',
'<td class="x-grid3-hd x-grid3-cell x-treegrid-hd" style="text-align: {align};" id="', this.id, '-xlhd-{#}">',
'<td class="x-grid3-hd x-grid3-cell x-treegrid-hd" style="text-align: {align};" id="',
this.id,
'-xlhd-{#}">',
'<div class="x-grid3-hd-inner x-treegrid-hd-inner" unselectable="on">',
this.enableHdMenu ? '<a class="x-grid3-hd-btn" href="#"></a>' : '',
'{header}<img class="x-grid3-sort-icon" src="', Ext.BLANK_IMAGE_URL, '" />',
this.enableHdMenu
? '<a class="x-grid3-hd-btn" href="#"></a>'
: '',
'{header}<img class="x-grid3-sort-icon" src="',
Ext.BLANK_IMAGE_URL,
'" />',
'</div>',
'</td></tpl>',
'</tr></thead>',
@ -93,12 +102,17 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
var cs = this.columns,
len = cs.length,
columns = [],
i, c;
i,
c;
for (i = 0; i < len; i++) {
c = cs[i];
if (!c.isColumn) {
c.xtype = c.xtype ? (/^tg/.test(c.xtype) ? c.xtype : 'tg' + c.xtype) : 'tgcolumn';
c.xtype = c.xtype
? /^tg/.test(c.xtype)
? c.xtype
: 'tg' + c.xtype
: 'tgcolumn';
c = Ext.create(c);
}
c.init(this);
@ -119,7 +133,13 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
this.el.addClass('x-treegrid');
this.outerCt = this.body.createChild({
cls:'x-tree-root-ct x-treegrid-ct ' + (this.useArrows ? 'x-tree-arrows' : this.lines ? 'x-tree-lines' : 'x-tree-no-lines')
cls:
'x-tree-root-ct x-treegrid-ct ' +
(this.useArrows
? 'x-tree-arrows'
: this.lines
? 'x-tree-lines'
: 'x-tree-no-lines'),
});
this.internalTpl.overwrite(this.outerCt, { columns: this.columns });
@ -133,22 +153,23 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
if (this.hideHeaders) {
this.el.child('.x-grid3-header').setDisplayed('none');
}
else if(this.enableHdMenu !== false){
} else if (this.enableHdMenu !== false) {
this.hmenu = new Ext.menu.Menu({ id: this.id + '-hctx' });
if (this.enableColumnHide !== false) {
this.colMenu = new Ext.menu.Menu({id: this.id + '-hcols-menu'});
this.colMenu = new Ext.menu.Menu({
id: this.id + '-hcols-menu',
});
this.colMenu.on({
scope: this,
beforeshow: this.beforeColMenuShow,
itemclick: this.handleHdMenuClick
itemclick: this.handleHdMenuClick,
});
this.hmenu.add({
itemId: 'columns',
hideOnClick: false,
text: this.columnsText,
menu: this.colMenu,
iconCls: 'x-cols-icon'
iconCls: 'x-cols-icon',
});
}
this.hmenu.on('itemclick', this.handleHdMenuClick, this);
@ -159,7 +180,9 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
node.attributes.uiProvider = Ext.ux.tree.TreeGridRootNodeUI;
node = Ext.ux.tree.TreeGrid.superclass.setRootNode.call(this, node);
if (this.innerCt) {
this.colgroupTpl.insertFirst(this.innerCt, {columns: this.columns});
this.colgroupTpl.insertFirst(this.innerCt, {
columns: this.columns,
});
}
return node;
},
@ -183,7 +206,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
this.mon(this.mainHd, {
scope: this,
mouseover: this.handleHdOver,
mouseout: this.handleHdOut
mouseout: this.handleHdOut,
});
},
@ -198,17 +221,23 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
}
if (Ext.isNumber(h)) {
bd.style.height = this.body.getHeight(true) - hd.offsetHeight + 'px';
bd.style.height =
this.body.getHeight(true) - hd.offsetHeight + 'px';
}
if (Ext.isNumber(w)) {
var sw = Ext.num(this.scrollOffset, Ext.getScrollBarWidth());
if(this.reserveScrollOffset || ((bd.offsetWidth - bd.clientWidth) > 10)){
if (
this.reserveScrollOffset ||
bd.offsetWidth - bd.clientWidth > 10
) {
this.setScrollOffset(sw);
} else {
var me = this;
setTimeout(function() {
me.setScrollOffset(bd.offsetWidth - bd.clientWidth > 10 ? sw : 0);
me.setScrollOffset(
bd.offsetWidth - bd.clientWidth > 10 ? sw : 0
);
}, 10);
}
}
@ -219,7 +248,10 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
colCount = cols.length,
groups = this.outerCt.query('colgroup'),
groupCount = groups.length,
c, g, i, j;
c,
g,
i,
j;
for (i = 0; i < colCount; i++) {
c = cols[i];
@ -229,18 +261,23 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
}
}
for(i = 0, groups = this.innerHd.query('td'), len = groups.length; i<len; i++) {
for (
i = 0, groups = this.innerHd.query('td'), len = groups.length;
i < len;
i++
) {
c = Ext.fly(groups[i]);
if (cols[i] && cols[i].hidden) {
c.addClass('x-treegrid-hd-hidden');
}
else {
} else {
c.removeClass('x-treegrid-hd-hidden');
}
}
var tcw = this.getTotalColumnWidth();
Ext.fly(this.innerHd.dom.firstChild).setWidth(tcw + (this.scrollOffset || 0));
Ext.fly(this.innerHd.dom.firstChild).setWidth(
tcw + (this.scrollOffset || 0)
);
this.outerCt.select('table').setWidth(tcw);
this.syncHeaderScroll();
},
@ -261,7 +298,11 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
getTotalColumnWidth: function() {
var total = 0;
for(var i = 0, cs = this.getVisibleColumns(), len = cs.length; i<len; i++) {
for (
var i = 0, cs = this.getVisibleColumns(), len = cs.length;
i < len;
i++
) {
total += cs[i].width;
}
return total;
@ -289,13 +330,17 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
this.fireEvent('headerbuttonclick', ms, c, hd, index);
this.hmenu.on('hide', function(){
this.hmenu.on(
'hide',
function() {
Ext.fly(hd).removeClass('x-grid3-hd-menu-open');
}, this, {single:true});
},
this,
{ single: true }
);
this.hmenu.show(t, 'tl-bl?');
}
else if(hd) {
} else if (hd) {
var index = this.findHeaderIndex(hd);
this.fireEvent('headerclick', this.columns[index], hd, index);
}
@ -313,7 +358,8 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
el.addClass('x-grid3-hd-over');
this.activeHdBtn = el.child('.x-grid3-hd-btn');
if (this.activeHdBtn) {
this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight-1)+'px';
this.activeHdBtn.dom.style.height =
hd.firstChild.offsetHeight - 1 + 'px';
}
}
},
@ -331,7 +377,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
findHeaderIndex: function(hd) {
hd = hd.dom || hd;
var cs = hd.parentNode.childNodes;
for(var i = 0, c; c = cs[i]; i++){
for (var i = 0, c; (c = cs[i]); i++) {
if (c == hd) {
return i;
}
@ -343,18 +389,21 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
beforeColMenuShow: function() {
var cols = this.columns,
colCount = cols.length,
i, c;
i,
c;
this.colMenu.removeAll();
for (i = 1; i < colCount; i++) {
c = cols[i];
if (c.hideable !== false) {
this.colMenu.add(new Ext.menu.CheckItem({
this.colMenu.add(
new Ext.menu.CheckItem({
itemId: 'col-' + i,
text: c.header,
checked: !c.hidden,
hideOnClick: false,
disabled: c.hideable === false
}));
disabled: c.hideable === false,
})
);
}
}
},
@ -364,7 +413,14 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
var index = this.hdCtxIndex,
id = item.getItemId();
if(this.fireEvent('headermenuclick', this.columns[index], id, index) !== false) {
if (
this.fireEvent(
'headermenuclick',
this.columns[index],
id,
index
) !== false
) {
index = id.substr(4);
if (index > 0 && this.columns[index]) {
this.setColumnVisible(index, !item.checked);
@ -406,7 +462,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, {
if (!n.uiProvider && !n.isRoot && !n.ui.isTreeGridNodeUI) {
n.ui = new Ext.ux.tree.TreeGridNodeUI(n);
}
}
},
});
Ext.reg('treegrid', Ext.ux.tree.TreeGrid);

View file

@ -33,7 +33,7 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, {
onDrag: this.onDrag.createDelegate(this),
onEnd: this.onEnd.createDelegate(this),
tolerance: 3,
autoStart: 300
autoStart: 300,
});
this.tracker.initEl(tree.innerHd);
tree.on('beforedestroy', this.tracker.destroy, this.tracker);
@ -93,12 +93,16 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, {
this.proxy.setX(this.hdX);
this.proxy.setWidth(x - this.hdX);
this.maxWidth = this.tree.outerCt.getWidth() - this.tree.innerBody.translatePoints(this.hdX).left;
this.maxWidth =
this.tree.outerCt.getWidth() -
this.tree.innerBody.translatePoints(this.hdX).left;
},
onDrag: function(e) {
var cursorX = this.tracker.getXY()[0];
this.proxy.setWidth((cursorX-this.hdX).constrain(this.minWidth, this.maxWidth));
this.proxy.setWidth(
(cursorX - this.hdX).constrain(this.minWidth, this.maxWidth)
);
},
onEnd: function(e) {
@ -115,5 +119,5 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, {
setTimeout(function() {
tree.headersDisabled = disabled;
}, 100);
}
},
});

View file

@ -12,7 +12,8 @@
if (this.type) {
if (Ext.isString(this.type)) {
this.type = Ext.data.Types[this.type.toUpperCase()] || types.AUTO;
this.type =
Ext.data.Types[this.type.toUpperCase()] || types.AUTO;
}
} else {
this.type = types.AUTO;
@ -24,7 +25,7 @@
} else if (Ext.isEmpty(st)) {
this.sortType = this.type.sortType;
}
}
},
});
Ext.tree.Column = Ext.extend(Ext.list.Column, {});

View file

@ -14,5 +14,5 @@ Ext.ux.tree.TreeGridLoader = Ext.extend(Ext.tree.TreeLoader, {
attr.uiProvider = Ext.ux.tree.TreeGridNodeUI;
}
return Ext.tree.TreeLoader.prototype.createNode.call(this, attr);
}
},
});

View file

@ -15,47 +15,89 @@ Ext.ux.tree.TreeGridNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
var t = n.getOwnerTree(),
cols = t.columns,
c = cols[0],
i, buf, len;
i,
buf,
len;
this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
this.indentMarkup = n.parentNode
? n.parentNode.ui.getChildIndent()
: '';
buf = [
'<tbody class="x-tree-node">',
'<tr ext:tree-node-id="', n.id ,'" class="x-tree-node-el x-tree-node-leaf ', a.cls, '">',
'<tr ext:tree-node-id="',
n.id,
'" class="x-tree-node-el x-tree-node-leaf ',
a.cls,
'">',
'<td class="x-treegrid-col">',
'<span class="x-tree-node-indent">', this.indentMarkup, "</span>",
'<img src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow" />',
'<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon', (a.icon ? " x-tree-node-inline-icon" : ""), (a.iconCls ? " "+a.iconCls : ""), '" unselectable="on" />',
'<a hidefocus="on" class="x-tree-node-anchor" href="', a.href ? a.href : '#', '" tabIndex="1" ',
a.hrefTarget ? ' target="'+a.hrefTarget+'"' : '', '>',
'<span unselectable="on">', (c.tpl ? c.tpl.apply(a) : a[c.dataIndex] || c.text), '</span></a>',
'</td>'
'<span class="x-tree-node-indent">',
this.indentMarkup,
'</span>',
'<img src="',
this.emptyIcon,
'" class="x-tree-ec-icon x-tree-elbow" />',
'<img src="',
a.icon || this.emptyIcon,
'" class="x-tree-node-icon',
a.icon ? ' x-tree-node-inline-icon' : '',
a.iconCls ? ' ' + a.iconCls : '',
'" unselectable="on" />',
'<a hidefocus="on" class="x-tree-node-anchor" href="',
a.href ? a.href : '#',
'" tabIndex="1" ',
a.hrefTarget ? ' target="' + a.hrefTarget + '"' : '',
'>',
'<span unselectable="on">',
c.tpl ? c.tpl.apply(a) : a[c.dataIndex] || c.text,
'</span></a>',
'</td>',
];
for (i = 1, len = cols.length; i < len; i++) {
c = cols[i];
buf.push(
'<td class="x-treegrid-col ', (c.cls ? c.cls : ''), '">',
'<div unselectable="on" class="x-treegrid-text"', (c.align ? ' style="text-align: ' + c.align + ';"' : ''), '>',
(c.tpl ? c.tpl.apply(a) : a[c.dataIndex]),
'<td class="x-treegrid-col ',
c.cls ? c.cls : '',
'">',
'<div unselectable="on" class="x-treegrid-text"',
c.align ? ' style="text-align: ' + c.align + ';"' : '',
'>',
c.tpl ? c.tpl.apply(a) : a[c.dataIndex],
'</div>',
'</td>'
);
}
buf.push(
'</tr><tr class="x-tree-node-ct"><td colspan="', cols.length, '">',
'<table class="x-treegrid-node-ct-table" cellpadding="0" cellspacing="0" style="table-layout: fixed; display: none; width: ', t.innerCt.getWidth() ,'px;"><colgroup>'
'</tr><tr class="x-tree-node-ct"><td colspan="',
cols.length,
'">',
'<table class="x-treegrid-node-ct-table" cellpadding="0" cellspacing="0" style="table-layout: fixed; display: none; width: ',
t.innerCt.getWidth(),
'px;"><colgroup>'
);
for (i = 0, len = cols.length; i < len; i++) {
buf.push('<col style="width: ', (cols[i].hidden ? 0 : cols[i].width) ,'px;" />');
buf.push(
'<col style="width: ',
cols[i].hidden ? 0 : cols[i].width,
'px;" />'
);
}
buf.push('</colgroup></table></td></tr></tbody>');
if (bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()) {
this.wrap = Ext.DomHelper.insertHtml("beforeBegin", n.nextSibling.ui.getEl(), buf.join(''));
this.wrap = Ext.DomHelper.insertHtml(
'beforeBegin',
n.nextSibling.ui.getEl(),
buf.join('')
);
} else {
this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(''));
this.wrap = Ext.DomHelper.insertHtml(
'beforeEnd',
targetNode,
buf.join('')
);
}
this.elNode = this.wrap.childNodes[0];
@ -70,9 +112,9 @@ Ext.ux.tree.TreeGridNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
// private
animExpand: function(cb) {
this.ctNode.style.display = "";
this.ctNode.style.display = '';
Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this, cb);
}
},
});
Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
@ -91,7 +133,7 @@ Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
ct.style.tableLayout = null;
(function() {
ct.style.tableLayout = 'fixed';
}).defer(1);
}.defer(1));
}
},
@ -103,5 +145,5 @@ Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
},
collapse: Ext.emptyFn,
expand : Ext.emptyFn
expand: Ext.emptyFn,
});

View file

@ -9,7 +9,6 @@
*/
Ext.override(Ext.ux.tree.TreeGridNodeUI, {
updateColumns: function() {
if (!this.rendered) return;
@ -19,13 +18,16 @@ Ext.override(Ext.ux.tree.TreeGridNodeUI, {
c = cols[0];
// Update the first column
this.anchor.firstChild.innerHTML = (c.tpl ? c.tpl.apply(a) : a[c.dataIndex] || c.text);
this.anchor.firstChild.innerHTML = c.tpl
? c.tpl.apply(a)
: a[c.dataIndex] || c.text;
// Update the remaining columns
for (i = 1, len = cols.length; i < len; i++) {
c = cols[i];
this.elNode.childNodes[i].firstChild.innerHTML = (c.tpl ? c.tpl.apply(a) : a[c.dataIndex] || c.text);
this.elNode.childNodes[i].firstChild.innerHTML = c.tpl
? c.tpl.apply(a)
: a[c.dataIndex] || c.text;
}
}
},
});

View file

@ -1,10 +1,9 @@
Ext.tree.RenderColumn = Ext.extend(Ext.tree.Column, {
constructor: function(c) {
c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}');
c.tpl.format = c.renderer;
c.tpl.col = this;
Ext.tree.RenderColumn.superclass.constructor.call(this, c);
}
},
});
Ext.reg('tgrendercolumn', Ext.tree.RenderColumn);

View file

@ -44,11 +44,14 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
if (!Ext.isObject(config)) {
config = {
property: tree.columns[0].dataIndex || 'text',
folderSort: true
}
folderSort: true,
};
}
Ext.ux.tree.TreeGridSorter.superclass.constructor.apply(this, arguments);
Ext.ux.tree.TreeGridSorter.superclass.constructor.apply(
this,
arguments
);
this.tree = tree;
tree.on('headerclick', this.onHeaderClick, this);
@ -56,7 +59,6 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
var me = this;
this.defaultSortFn = function(n1, n2) {
var desc = me.dir && me.dir.toLowerCase() == 'desc',
prop = me.property || 'text',
sortType = me.sortType,
@ -75,8 +77,16 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
}
var prop1 = attr1[prop],
prop2 = attr2[prop],
v1 = sortType ? sortType(prop1) : (caseSensitive ? prop1 : prop1.toUpperCase());
v2 = sortType ? sortType(prop2) : (caseSensitive ? prop2 : prop2.toUpperCase());
v1 = sortType
? sortType(prop1)
: caseSensitive
? prop1
: prop1.toUpperCase();
v2 = sortType
? sortType(prop2)
: caseSensitive
? prop2
: prop2.toUpperCase();
if (v1 < v2) {
return desc ? +1 : -1;
@ -93,9 +103,18 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
onAfterTreeRender: function() {
if (this.tree.hmenu) {
this.tree.hmenu.insert(0,
{itemId:'asc', text: this.sortAscText, cls: 'xg-hmenu-sort-asc'},
{itemId:'desc', text: this.sortDescText, cls: 'xg-hmenu-sort-desc'}
this.tree.hmenu.insert(
0,
{
itemId: 'asc',
text: this.sortAscText,
cls: 'xg-hmenu-sort-asc',
},
{
itemId: 'desc',
text: this.sortDescText,
cls: 'xg-hmenu-sort-desc',
}
);
}
this.updateSortIcon(0, 'asc');
@ -113,9 +132,11 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
var me = this;
me.property = c.dataIndex;
me.dir = c.dir = (c.dir === 'desc' ? 'asc' : 'desc');
me.dir = c.dir = c.dir === 'desc' ? 'asc' : 'desc';
me.sortType = c.sortType;
me.caseSensitive === Ext.isBoolean(c.caseSensitive) ? c.caseSensitive : this.caseSensitive;
me.caseSensitive === Ext.isBoolean(c.caseSensitive)
? c.caseSensitive
: this.caseSensitive;
me.sortFn = c.sortFn || this.defaultSortFn;
this.tree.root.cascade(function(n) {
@ -133,5 +154,5 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
var sc = this.sortClasses,
hds = this.tree.innerHd.select('td').removeClass(sc);
hds.item(col).addClass(sc[dir == 'desc' ? 1 : 0]);
}
},
});

View file

@ -46,7 +46,8 @@ body {
border-color: #fff;
}
.x-color-palette a:hover, .x-color-palette a.x-color-palette-sel {
.x-color-palette a:hover,
.x-color-palette a.x-color-palette-sel {
border-color: #8bb8f3;
background-color: #deecfd;
}
@ -63,11 +64,17 @@ body {
background-image: url(../images/default/shadow-c.png);
}
.x-shadow .xsml, .x-shadow .xsmr {
.x-shadow .xsml,
.x-shadow .xsmr {
background-image: url(../images/default/shadow-lr.png);
}
.x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{
.x-shadow .xstl,
.x-shadow .xstc,
.x-shadow .xstr,
.x-shadow .xsbl,
.x-shadow .xsbc,
.x-shadow .xsbr {
background-image: url(../images/default/shadow.png);
}
@ -78,14 +85,17 @@ body {
.x-spotlight {
background-color: #ccc;
}.x-tab-panel-header, .x-tab-panel-footer {
}
.x-tab-panel-header,
.x-tab-panel-footer {
background-color: #e18325;
border-color: #8db2e3;
overflow: hidden;
zoom: 1;
}
.x-tab-panel-header, .x-tab-panel-footer {
.x-tab-panel-header,
.x-tab-panel-footer {
border-color: #222;
}
@ -125,7 +135,9 @@ ul.x-tab-strip-bottom{
color: #aaaaaa;
}
.x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{
.x-tab-strip-top .x-tab-right,
.x-tab-strip-top .x-tab-left,
.x-tab-strip-top .x-tab-strip-inner {
background-image: url(../images/access/tabs/tabs-sprite.gif);
}
@ -177,8 +189,8 @@ ul.x-tab-strip-bottom{
.x-tab-scroller-left-disabled {
background-position: -18px 0;
opacity:.5;
-moz-opacity:.5;
opacity: 0.5;
-moz-opacity: 0.5;
filter: alpha(opacity=50);
cursor: default;
}
@ -188,14 +200,16 @@ ul.x-tab-strip-bottom{
border-bottom-color: #8db2e3;
}
.x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar {
.x-tab-panel-bbar .x-toolbar,
.x-tab-panel-tbar .x-toolbar {
border-color: #99bbe8;
}
.x-form-field {
font: normal 15px tahoma, arial, helvetica, sans-serif;
}
.x-form-text, textarea.x-form-field{
.x-form-text,
textarea.x-form-field {
color: #ffffff;
background-color: #33373d;
background-image: url(../images/access/form/text-bg.gif);
@ -203,11 +217,13 @@ ul.x-tab-strip-bottom{
border-width: 2px;
}
.ext-webkit .x-form-text, .ext-webkit textarea.x-form-field{
.ext-webkit .x-form-text,
.ext-webkit textarea.x-form-field {
border-width: 2px;
}
.x-form-text, .ext-ie .x-form-file {
.x-form-text,
.ext-ie .x-form-file {
height: 26px;
}
@ -293,12 +309,15 @@ ul.x-tab-strip-bottom{
border-bottom-color: #b5b8c8;
}
.x-form-focus, textarea.x-form-focus{
.x-form-focus,
textarea.x-form-focus {
border-color: #ff9c33;
}
.x-form-invalid, textarea.x-form-invalid,
.ext-webkit .x-form-invalid, .ext-webkit textarea.x-form-invalid{
.x-form-invalid,
textarea.x-form-invalid,
.ext-webkit .x-form-invalid,
.ext-webkit textarea.x-form-invalid {
background-color: #15171a;
background-image: url(../images/access/grid/invalid_line.gif);
border-color: #c30;
@ -311,7 +330,8 @@ ul.x-tab-strip-bottom{
}
*/
.x-form-inner-invalid, textarea.x-form-inner-invalid{
.x-form-inner-invalid,
textarea.x-form-inner-invalid {
background-color: #fff;
background-image: url(../images/access/grid/invalid_line.gif);
}
@ -354,7 +374,7 @@ ul.x-tab-strip-bottom{
}
.x-fieldset {
border-color:#737B8C;
border-color: #737b8c;
}
.x-fieldset legend {
@ -376,8 +396,10 @@ ul.x-tab-strip-bottom{
color: #fff;
}
.x-btn-noicon .x-btn-small .x-btn-text, .x-btn-text-icon .x-btn-icon-small-left .x-btn-text,
.x-btn-icon .x-btn-small .x-btn-text, .x-btn-text-icon .x-btn-icon-small-right .x-btn-text {
.x-btn-noicon .x-btn-small .x-btn-text,
.x-btn-text-icon .x-btn-icon-small-left .x-btn-text,
.x-btn-icon .x-btn-small .x-btn-text,
.x-btn-text-icon .x-btn-icon-small-right .x-btn-text {
height: 18px;
}
@ -414,11 +436,21 @@ ul.x-tab-strip-bottom{
font-weight: normal;
}
.x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{
.x-btn-tl,
.x-btn-tr,
.x-btn-tc,
.x-btn-ml,
.x-btn-mr,
.x-btn-mc,
.x-btn-bl,
.x-btn-br,
.x-btn-bc {
background-image: url(../images/access/button/btn.gif);
}
.x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{
.x-btn-click .x-btn-text,
.x-btn-menu-active .x-btn-text,
.x-btn-pressed .x-btn-text {
color: #fff;
}
@ -436,7 +468,10 @@ ul.x-tab-strip-bottom{
padding-right: 20px;
}
.x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split {
.x-btn-over .x-btn-mc em.x-btn-split,
.x-btn-click .x-btn-mc em.x-btn-split,
.x-btn-menu-active .x-btn-mc em.x-btn-split,
.x-btn-pressed .x-btn-mc em.x-btn-split {
background-image: url(../images/access/button/s-arrow-o.gif);
}
@ -448,7 +483,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/access/button/s-arrow-b.gif);
}
.x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
.x-btn-over .x-btn-mc em.x-btn-split-bottom,
.x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-btn-menu-active .x-btn-mc em.x-btn-split-bottom,
.x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
background-image: url(../images/access/button/s-arrow-bo.gif);
}
@ -497,7 +535,12 @@ ul.x-tab-strip-bottom{
background-image: url(../images/access/toolbar/bg.gif);
}
.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{
.x-toolbar td,
.x-toolbar span,
.x-toolbar input,
.x-toolbar div,
.x-toolbar select,
.x-toolbar label {
font: normal 14px arial, tahoma, helvetica, sans-serif;
}
@ -513,9 +556,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/access/button/s-arrow-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
{
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split {
background-image: url(../images/access/button/s-arrow-o.gif);
}
@ -523,9 +567,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/access/button/s-arrow-b-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
{
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
background-image: url(../images/access/button/s-arrow-bo.gif);
}
@ -610,31 +655,38 @@ ul.x-tab-strip-bottom{
color: #000;
}
.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east,
.x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west
{
.x-resizable-over .x-resizable-handle-east,
.x-resizable-pinned .x-resizable-handle-east,
.x-resizable-over .x-resizable-handle-west,
.x-resizable-pinned .x-resizable-handle-west {
background-image: url(../images/access/sizer/e-handle.gif);
}
.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south,
.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north
{
.x-resizable-over .x-resizable-handle-south,
.x-resizable-pinned .x-resizable-handle-south,
.x-resizable-over .x-resizable-handle-north,
.x-resizable-pinned .x-resizable-handle-north {
background-image: url(../images/access/sizer/s-handle.gif);
}
.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{
.x-resizable-over .x-resizable-handle-north,
.x-resizable-pinned .x-resizable-handle-north {
background-image: url(../images/access/sizer/s-handle.gif);
}
.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{
.x-resizable-over .x-resizable-handle-southeast,
.x-resizable-pinned .x-resizable-handle-southeast {
background-image: url(../images/access/sizer/se-handle.gif);
}
.x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{
.x-resizable-over .x-resizable-handle-northwest,
.x-resizable-pinned .x-resizable-handle-northwest {
background-image: url(../images/access/sizer/nw-handle.gif);
}
.x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{
.x-resizable-over .x-resizable-handle-northeast,
.x-resizable-pinned .x-resizable-handle-northeast {
background-image: url(../images/access/sizer/ne-handle.gif);
}
.x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{
.x-resizable-over .x-resizable-handle-southwest,
.x-resizable-pinned .x-resizable-handle-southwest {
background-image: url(../images/access/sizer/sw-handle.gif);
}
.x-resizable-proxy {
@ -651,7 +703,9 @@ ul.x-tab-strip-bottom{
border-color: #223;
}
.x-grid3-hd-row td, .x-grid3-row td, .x-grid3-summary-row td{
.x-grid3-hd-row td,
.x-grid3-row td,
.x-grid3-summary-row td {
font: normal 14px arial, tahoma, helvetica, sans-serif;
}
@ -701,17 +755,24 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/grid/hd-pop.gif);
}
td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open {
td.x-grid3-hd-over,
td.sort-desc,
td.sort-asc,
td.x-grid3-hd-menu-open {
border-left-color: #889;
border-right-color: #445;
}
td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner {
td.x-grid3-hd-over .x-grid3-hd-inner,
td.sort-desc .x-grid3-hd-inner,
td.sort-asc .x-grid3-hd-inner,
td.x-grid3-hd-menu-open .x-grid3-hd-inner {
background-color: #4e628a;
background-image: url(../images/access/grid/grid3-hrow-over.gif);
}
.x-grid3-cell-inner, .x-grid3-hd-inner {
.x-grid3-cell-inner,
.x-grid3-hd-inner {
color: #fff;
}
@ -729,7 +790,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
margin-left: 5px;
}
.x-grid3-cell-text, .x-grid3-hd-text {
.x-grid3-cell-text,
.x-grid3-hd-text {
color: #fff;
}
@ -778,7 +840,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
color: #fff;
}
.x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{
.x-grid3-locked td.x-grid3-row-marker,
.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker {
background-color: #ebeadb !important;
background-image: url(../images/default/grid/grid-hrow.gif) !important;
color: #fff;
@ -786,7 +849,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
border-right-color: #6fa0df !important;
}
.x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{
.x-grid3-locked td.x-grid3-row-marker div,
.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div {
color: #fff !important;
}
@ -794,7 +858,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/access/grid/dirty.gif);
}
.x-grid3-topbar, .x-grid3-bottombar{
.x-grid3-topbar,
.x-grid3-bottombar {
font: normal 14px arial, tahoma, helvetica, sans-serif;
}
@ -848,7 +913,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/access/grid/grid3-special-col-bg.gif);
}
.x-grid3-row-checker, .x-grid3-hd-checker {
.x-grid3-row-checker,
.x-grid3-hd-checker {
background-image: url(../images/default/grid/row-check-sprite.gif);
}
@ -878,7 +944,9 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/default/menu/checked.gif);
}
.x-grid-group, .x-grid-group-body, .x-grid-group-hd {
.x-grid-group,
.x-grid-group-body,
.x-grid-group-hd {
zoom: 1;
}
@ -1043,19 +1111,23 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
font: normal 14px arial, tahoma, helvetica, sans-serif;
}
.x-tree-node a, .x-dd-drag-ghost a{
.x-tree-node a,
.x-dd-drag-ghost a {
color: #fff;
}
.x-tree-node a span, .x-dd-drag-ghost a span{
.x-tree-node a span,
.x-dd-drag-ghost a span {
color: #fff;
}
.x-tree-node .x-tree-selected a, .x-dd-drag-ghost a{
.x-tree-node .x-tree-selected a,
.x-dd-drag-ghost a {
color: #fff;
}
.x-tree-node .x-tree-selected a span, .x-dd-drag-ghost a span{
.x-tree-node .x-tree-selected a span,
.x-dd-drag-ghost a span {
color: #fff;
}
@ -1112,10 +1184,12 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-color: #21252e;
}
.x-date-middle,.x-date-left,.x-date-right {
.x-date-middle,
.x-date-left,
.x-date-right {
background-image: url(../images/access/shared/hd-sprite.gif);
color: #fff;
font:bold 14px "sans serif", tahoma, verdana, helvetica;
font: bold 14px 'sans serif', tahoma, verdana, helvetica;
}
.x-date-middle .x-btn .x-btn-text {
@ -1171,7 +1245,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
font-weight: bold;
}
.x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a {
.x-date-inner .x-date-prevday a,
.x-date-inner .x-date-nextday a {
color: #aaa;
}
@ -1181,7 +1256,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/access/shared/glass-bg.gif);
}
.x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{
.x-date-inner a:hover,
.x-date-inner .x-date-disabled a:hover {
color: #fff;
background-color: #7e5530;
}
@ -1224,11 +1300,13 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
border-top-color: #c5d2df;
}
td.x-date-mp-month a,td.x-date-mp-year a {
td.x-date-mp-month a,
td.x-date-mp-year a {
color: #fff;
}
td.x-date-mp-month a:hover,td.x-date-mp-year a:hover {
td.x-date-mp-month a:hover,
td.x-date-mp-year a:hover {
color: #fff;
background-color: #7e5530;
}
@ -1250,7 +1328,14 @@ td.x-date-mp-sep {
background-image: url(../images/access/qtip/close.gif);
}
.x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr {
.x-tip .x-tip-tc,
.x-tip .x-tip-tl,
.x-tip .x-tip-tr,
.x-tip .x-tip-bc,
.x-tip .x-tip-bl,
.x-tip .x-tip-br,
.x-tip .x-tip-ml,
.x-tip .x-tip-mr {
background-image: url(../images/access/qtip/tip-sprite.gif);
}
@ -1271,9 +1356,14 @@ td.x-date-mp-sep {
color: #000;
}
.x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc,
.x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr
{
.x-form-invalid-tip .x-tip-tc,
.x-form-invalid-tip .x-tip-tl,
.x-form-invalid-tip .x-tip-tr,
.x-form-invalid-tip .x-tip-bc,
.x-form-invalid-tip .x-tip-bl,
.x-form-invalid-tip .x-tip-br,
.x-form-invalid-tip .x-tip-ml,
.x-form-invalid-tip .x-tip-mr {
background-image: url(../images/default/form/error-tip-corners.gif);
}
@ -1376,7 +1466,8 @@ a.x-menu-item {
.x-box-mc {
background-color: #eee;
background-image: url(../images/default/box/tb.gif);
font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif;
font-family: 'Myriad Pro', 'Myriad Web', 'Tahoma', 'Helvetica', 'Arial',
sans-serif;
color: #393939;
font-size: 15px;
}
@ -1402,11 +1493,16 @@ a.x-menu-item {
background-image: url(../images/default/box/corners.gif);
}
.x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr {
.x-box-blue .x-box-bl,
.x-box-blue .x-box-br,
.x-box-blue .x-box-tl,
.x-box-blue .x-box-tr {
background-image: url(../images/default/box/corners-blue.gif);
}
.x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc {
.x-box-blue .x-box-bc,
.x-box-blue .x-box-mc,
.x-box-blue .x-box-tc {
background-image: url(../images/default/box/tb-blue.gif);
}
@ -1488,15 +1584,18 @@ a.x-menu-item {
background-color: #1f2730;
}
.x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar {
.x-panel-bbar .x-toolbar,
.x-panel-tbar .x-toolbar {
border-color: #223;
}
.x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar {
.x-panel-tbar-noheader .x-toolbar,
.x-panel-mc .x-panel-tbar .x-toolbar {
border-top-color: #223;
}
.x-panel-body-noheader, .x-panel-mc .x-panel-body {
.x-panel-body-noheader,
.x-panel-mc .x-panel-body {
border-top-color: #223;
}
@ -1509,7 +1608,10 @@ a.x-menu-item {
background-image: url(../images/access/panel/top-bottom.gif);
}
.x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{
.x-panel-tl,
.x-panel-tr,
.x-panel-bl,
.x-panel-br {
background-image: url(../images/access/panel/corners-sprite.gif);
border-bottom-color: #222224;
}
@ -1547,7 +1649,12 @@ a.x-menu-item {
border-color: #18181a;
}
.x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{
.x-panel-fbar td,
.x-panel-fbar span,
.x-panel-fbar input,
.x-panel-fbar div,
.x-panel-fbar select,
.x-panel-fbar label {
font: normal 14px arial, tahoma, helvetica, sans-serif;
}
.x-window-proxy {
@ -1625,14 +1732,14 @@ a.x-menu-item {
.x-window-plain .x-window-body {
color: #fffff6;
border-color: #464F61;
border-color: #464f61;
}
body.x-body-masked .x-window-plain .x-window-mc {
background-color: #464f61;
}
.x-html-editor-wrap {
border-color:#737B8C;
border-color: #737b8c;
background-color: #fff;
}
.x-html-editor-wrap iframe {
@ -1640,7 +1747,8 @@ body.x-body-masked .x-window-plain .x-window-mc {
}
.x-html-editor-tb .x-btn-text {
background-image: url(../images/access/editor/tb-sprite.gif);
}.x-panel-noborder .x-panel-header-noborder {
}
.x-panel-noborder .x-panel-header-noborder {
border-bottom-color: #343d4e;
}
@ -1751,7 +1859,7 @@ body.x-body-masked .x-window-plain .x-window-mc {
}
.x-list-body-inner {
background-color:#1B232B;
background-color: #1b232b;
}
.x-list-body dt em {
@ -1759,11 +1867,11 @@ body.x-body-masked .x-window-plain .x-window-mc {
}
.x-list-over {
background-color:#7E5530;
background-color: #7e5530;
}
.x-list-selected {
background-color:#E5872C;
background-color: #e5872c;
}
.x-list-resizer {
@ -1771,11 +1879,14 @@ body.x-body-masked .x-window-plain .x-window-mc {
border-right-color: #555;
}
.x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc {
.x-list-header-inner em.sort-asc,
.x-list-header-inner em.sort-desc {
background-image: url(../images/access/grid/sort-hd.gif);
border-color: #3e4e6c;
}
.x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner {
.x-slider-horz,
.x-slider-horz .x-slider-end,
.x-slider-horz .x-slider-inner {
background-image: url(../images/access/slider/slider-bg.png);
}
@ -1783,7 +1894,9 @@ body.x-body-masked .x-window-plain .x-window-mc {
background-image: url(../images/access/slider/slider-thumb.png);
}
.x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner {
.x-slider-vert,
.x-slider-vert .x-slider-end,
.x-slider-vert .x-slider-inner {
background-image: url(../images/access/slider/slider-v-bg.png);
}

View file

@ -41,7 +41,8 @@
border-color: #fff;
}
.x-color-palette a:hover, .x-color-palette a.x-color-palette-sel {
.x-color-palette a:hover,
.x-color-palette a.x-color-palette-sel {
border-color: #8bb8f3;
background-color: #deecfd;
}
@ -64,11 +65,17 @@
background-image: url(../images/default/shadow-c.png);
}
.x-shadow .xsml, .x-shadow .xsmr {
.x-shadow .xsml,
.x-shadow .xsmr {
background-image: url(../images/default/shadow-lr.png);
}
.x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{
.x-shadow .xstl,
.x-shadow .xstc,
.x-shadow .xstr,
.x-shadow .xsbl,
.x-shadow .xsbc,
.x-shadow .xsbr {
background-image: url(../images/default/shadow.png);
}
@ -80,14 +87,16 @@
.x-spotlight {
background-color: #ccc;
}
.x-tab-panel-header, .x-tab-panel-footer {
.x-tab-panel-header,
.x-tab-panel-footer {
background-color: #deecfd;
border-color: #8db2e3;
overflow: hidden;
zoom: 1;
}
.x-tab-panel-header, .x-tab-panel-footer {
.x-tab-panel-header,
.x-tab-panel-footer {
border-color: #8db2e3;
}
@ -127,7 +136,9 @@ ul.x-tab-strip-bottom{
color: #aaaaaa;
}
.x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{
.x-tab-strip-top .x-tab-right,
.x-tab-strip-top .x-tab-left,
.x-tab-strip-top .x-tab-strip-inner {
background-image: url(../images/default/tabs/tabs-sprite.gif);
}
@ -187,8 +198,8 @@ ul.x-tab-strip-bottom{
.x-tab-scroller-left-disabled {
background-position: -18px 0;
opacity:.5;
-moz-opacity:.5;
opacity: 0.5;
-moz-opacity: 0.5;
filter: alpha(opacity=50);
cursor: default;
}
@ -198,13 +209,16 @@ ul.x-tab-strip-bottom{
border-bottom-color: #8db2e3;
}
.x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar {
.x-tab-panel-bbar .x-toolbar,
.x-tab-panel-tbar .x-toolbar {
border-color: #99bbe8;
}.x-form-field {
}
.x-form-field {
font: normal 12px tahoma, arial, helvetica, sans-serif;
}
.x-form-text, textarea.x-form-field {
.x-form-text,
textarea.x-form-field {
background-color: #fff;
background-image: url(../images/default/form/text-bg.gif);
border-color: #b5b8c8;
@ -253,11 +267,13 @@ ul.x-tab-strip-bottom{
border-bottom-color: #b5b8c8;
}
.x-form-focus, textarea.x-form-focus {
.x-form-focus,
textarea.x-form-focus {
border-color: #7eadd9;
}
.x-form-invalid, textarea.x-form-invalid {
.x-form-invalid,
textarea.x-form-invalid {
background-color: #fff;
background-image: url(../images/default/grid/invalid_line.gif);
border-color: #c30;
@ -274,7 +290,8 @@ ul.x-tab-strip-bottom{
border-color: #c30;
}
.x-form-inner-invalid, textarea.x-form-inner-invalid {
.x-form-inner-invalid,
textarea.x-form-inner-invalid {
background-color: #fff;
background-image: url(../images/default/grid/invalid_line.gif);
}
@ -331,11 +348,21 @@ ul.x-tab-strip-bottom{
font-weight: normal;
}
.x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{
.x-btn-tl,
.x-btn-tr,
.x-btn-tc,
.x-btn-ml,
.x-btn-mr,
.x-btn-mc,
.x-btn-bl,
.x-btn-br,
.x-btn-bc {
background-image: url(../images/default/button/btn.gif);
}
.x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{
.x-btn-click .x-btn-text,
.x-btn-menu-active .x-btn-text,
.x-btn-pressed .x-btn-text {
color: #000;
}
@ -351,7 +378,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/button/s-arrow.gif);
}
.x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split {
.x-btn-over .x-btn-mc em.x-btn-split,
.x-btn-click .x-btn-mc em.x-btn-split,
.x-btn-menu-active .x-btn-mc em.x-btn-split,
.x-btn-pressed .x-btn-mc em.x-btn-split {
background-image: url(../images/default/button/s-arrow-o.gif);
}
@ -363,7 +393,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/button/s-arrow-b.gif);
}
.x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
.x-btn-over .x-btn-mc em.x-btn-split-bottom,
.x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-btn-menu-active .x-btn-mc em.x-btn-split-bottom,
.x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
background-image: url(../images/default/button/s-arrow-bo.gif);
}
@ -404,13 +437,19 @@ ul.x-tab-strip-bottom{
.x-btn-group-notitle .x-btn-group-tc {
background-image: url(../images/default/button/group-tb.gif);
}.x-toolbar{
}
.x-toolbar {
border-color: #a9bfd3;
background-color: #d0def0;
background-image: url(../images/default/toolbar/bg.gif);
}
.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{
.x-toolbar td,
.x-toolbar span,
.x-toolbar input,
.x-toolbar div,
.x-toolbar select,
.x-toolbar label {
font: normal 11px arial, tahoma, helvetica, sans-serif;
}
@ -426,9 +465,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/button/s-arrow-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
{
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split {
background-image: url(../images/default/button/s-arrow-o.gif);
}
@ -436,9 +476,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/button/s-arrow-b-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
{
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
background-image: url(../images/default/button/s-arrow-bo.gif);
}
@ -492,35 +533,43 @@ ul.x-tab-strip-bottom{
.x-toolbar-more-icon {
background-image: url(../images/default/toolbar/more.gif) !important;
}.x-resizable-handle {
}
.x-resizable-handle {
background-color: #fff;
}
.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east,
.x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west
{
.x-resizable-over .x-resizable-handle-east,
.x-resizable-pinned .x-resizable-handle-east,
.x-resizable-over .x-resizable-handle-west,
.x-resizable-pinned .x-resizable-handle-west {
background-image: url(../images/default/sizer/e-handle.gif);
}
.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south,
.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north
{
.x-resizable-over .x-resizable-handle-south,
.x-resizable-pinned .x-resizable-handle-south,
.x-resizable-over .x-resizable-handle-north,
.x-resizable-pinned .x-resizable-handle-north {
background-image: url(../images/default/sizer/s-handle.gif);
}
.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{
.x-resizable-over .x-resizable-handle-north,
.x-resizable-pinned .x-resizable-handle-north {
background-image: url(../images/default/sizer/s-handle.gif);
}
.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{
.x-resizable-over .x-resizable-handle-southeast,
.x-resizable-pinned .x-resizable-handle-southeast {
background-image: url(../images/default/sizer/se-handle.gif);
}
.x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{
.x-resizable-over .x-resizable-handle-northwest,
.x-resizable-pinned .x-resizable-handle-northwest {
background-image: url(../images/default/sizer/nw-handle.gif);
}
.x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{
.x-resizable-over .x-resizable-handle-northeast,
.x-resizable-pinned .x-resizable-handle-northeast {
background-image: url(../images/default/sizer/ne-handle.gif);
}
.x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{
.x-resizable-over .x-resizable-handle-southwest,
.x-resizable-pinned .x-resizable-handle-southwest {
background-image: url(../images/default/sizer/sw-handle.gif);
}
.x-resizable-proxy {
@ -537,7 +586,8 @@ ul.x-tab-strip-bottom{
border-color: #99bbe8;
}
.x-grid3-row td, .x-grid3-summary-row td{
.x-grid3-row td,
.x-grid3-summary-row td {
font: normal 11px/13px arial, tahoma, helvetica, sans-serif;
}
@ -545,7 +595,6 @@ ul.x-tab-strip-bottom{
font: normal 11px/15px arial, tahoma, helvetica, sans-serif;
}
.x-grid3-hd-row td {
border-left-color: #eee;
border-right-color: #d0d0d0;
@ -593,15 +642,20 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/grid/hd-pop.gif);
}
td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open {
td.x-grid3-hd-over,
td.sort-desc,
td.sort-asc,
td.x-grid3-hd-menu-open {
border-left-color: #aaccf6;
border-right-color: #aaccf6;
}
td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner {
td.x-grid3-hd-over .x-grid3-hd-inner,
td.sort-desc .x-grid3-hd-inner,
td.sort-asc .x-grid3-hd-inner,
td.x-grid3-hd-menu-open .x-grid3-hd-inner {
background-color: #ebf3fd;
background-image: url(../images/default/grid/grid3-hrow-over.gif);
}
.sort-asc .x-grid3-sort-icon {
@ -612,7 +666,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/default/grid/sort_desc.gif);
}
.x-grid3-cell-text, .x-grid3-hd-text {
.x-grid3-cell-text,
.x-grid3-hd-text {
color: #000;
}
@ -661,7 +716,8 @@ td.grid-hd-group-cell {
color: #000;
}
.x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{
.x-grid3-locked td.x-grid3-row-marker,
.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker {
background-color: #ebeadb !important;
background-image: url(../images/default/grid/grid-hrow.gif) !important;
color: #000;
@ -669,7 +725,8 @@ td.grid-hd-group-cell {
border-right-color: #6fa0df !important;
}
.x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{
.x-grid3-locked td.x-grid3-row-marker div,
.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div {
color: #15428b !important;
}
@ -677,7 +734,8 @@ td.grid-hd-group-cell {
background-image: url(../images/default/grid/dirty.gif);
}
.x-grid3-topbar, .x-grid3-bottombar{
.x-grid3-topbar,
.x-grid3-bottombar {
font: normal 11px arial, tahoma, helvetica, sans-serif;
}
@ -728,7 +786,8 @@ td.grid-hd-group-cell {
background-image: url(../images/default/grid/grid3-special-col-bg.gif);
}
.x-grid3-row-checker, .x-grid3-hd-checker {
.x-grid3-row-checker,
.x-grid3-hd-checker {
background-image: url(../images/default/grid/row-check-sprite.gif);
}
@ -758,7 +817,9 @@ td.grid-hd-group-cell {
background-image: url(../images/default/menu/checked.gif);
}
.x-grid-group, .x-grid-group-body, .x-grid-group-hd {
.x-grid-group,
.x-grid-group-body,
.x-grid-group-hd {
zoom: 1;
}
@ -799,12 +860,13 @@ td.grid-hd-group-cell {
.x-grid-with-col-lines .x-grid3-row-selected {
border-top-color: #a3bae9;
}.x-pivotgrid .x-grid3-header-offset table td {
}
.x-pivotgrid .x-grid3-header-offset table td {
background: url(../images/default/grid/grid3-hrow.gif) repeat-x 50% 100%;
border-left: 1px solid;
border-right: 1px solid;
border-left-color: #EEE;
border-right-color: #D0D0D0;
border-left-color: #eee;
border-right-color: #d0d0d0;
}
.x-pivotgrid .x-grid3-row-headers {
@ -812,13 +874,14 @@ td.grid-hd-group-cell {
}
.x-pivotgrid .x-grid3-row-headers table td {
background: #EEE url(../images/default/grid/grid3-rowheader.gif) repeat-x left top;
background: #eee url(../images/default/grid/grid3-rowheader.gif) repeat-x
left top;
border-left: 1px solid;
border-right: 1px solid;
border-left-color: #EEE;
border-right-color: #D0D0D0;
border-left-color: #eee;
border-right-color: #d0d0d0;
border-bottom: 1px solid;
border-bottom-color: #D0D0D0;
border-bottom-color: #d0d0d0;
height: 18px;
}
.x-dd-drag-ghost {
@ -843,7 +906,8 @@ td.grid-hd-group-cell {
.x-view-selector {
background-color: #c3daf9;
border-color: #3399bb;
}.x-tree-node-expanded .x-tree-node-icon{
}
.x-tree-node-expanded .x-tree-node-icon {
background-image: url(../images/default/tree/folder-open.gif);
}
@ -933,11 +997,13 @@ td.grid-hd-group-cell {
font: normal 11px arial, tahoma, helvetica, sans-serif;
}
.x-tree-node a, .x-dd-drag-ghost a{
.x-tree-node a,
.x-dd-drag-ghost a {
color: #000;
}
.x-tree-node a span, .x-dd-drag-ghost a span{
.x-tree-node a span,
.x-dd-drag-ghost a span {
color: #000;
}
@ -988,15 +1054,18 @@ td.grid-hd-group-cell {
.x-tree-drop-ok-between .x-dd-drop-icon {
background-image: url(../images/default/tree/drop-between.gif);
}.x-date-picker {
}
.x-date-picker {
border-color: #1b376c;
background-color: #fff;
}
.x-date-middle,.x-date-left,.x-date-right {
.x-date-middle,
.x-date-left,
.x-date-right {
background-image: url(../images/default/shared/hd-sprite.gif);
color: #fff;
font:bold 11px "sans serif", tahoma, verdana, helvetica;
font: bold 11px 'sans serif', tahoma, verdana, helvetica;
}
.x-date-middle .x-btn .x-btn-text {
@ -1050,7 +1119,8 @@ td.grid-hd-group-cell {
font-weight: bold;
}
.x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a {
.x-date-inner .x-date-prevday a,
.x-date-inner .x-date-nextday a {
color: #aaa;
}
@ -1060,7 +1130,8 @@ td.grid-hd-group-cell {
background-image: url(../images/default/shared/glass-bg.gif);
}
.x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{
.x-date-inner a:hover,
.x-date-inner .x-date-disabled a:hover {
color: #000;
background-color: #ddecfe;
}
@ -1103,11 +1174,13 @@ td.grid-hd-group-cell {
border-top-color: #c5d2df;
}
td.x-date-mp-month a,td.x-date-mp-year a {
td.x-date-mp-month a,
td.x-date-mp-year a {
color: #15428b;
}
td.x-date-mp-month a:hover,td.x-date-mp-year a:hover {
td.x-date-mp-month a:hover,
td.x-date-mp-year a:hover {
color: #15428b;
background-color: #ddecfe;
}
@ -1124,11 +1197,19 @@ td.x-date-mp-sel a {
td.x-date-mp-sep {
border-right-color: #c5d2df;
}.x-tip .x-tip-close{
}
.x-tip .x-tip-close {
background-image: url(../images/default/qtip/close.gif);
}
.x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr {
.x-tip .x-tip-tc,
.x-tip .x-tip-tl,
.x-tip .x-tip-tr,
.x-tip .x-tip-bc,
.x-tip .x-tip-bl,
.x-tip .x-tip-br,
.x-tip .x-tip-ml,
.x-tip .x-tip-mr {
background-image: url(../images/default/qtip/tip-sprite.gif);
}
@ -1149,9 +1230,14 @@ td.x-date-mp-sep {
color: #444;
}
.x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc,
.x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr
{
.x-form-invalid-tip .x-tip-tc,
.x-form-invalid-tip .x-tip-tl,
.x-form-invalid-tip .x-tip-tr,
.x-form-invalid-tip .x-tip-bc,
.x-form-invalid-tip .x-tip-bl,
.x-form-invalid-tip .x-tip-br,
.x-form-invalid-tip .x-tip-ml,
.x-form-invalid-tip .x-tip-mr {
background-image: url(../images/default/form/error-tip-corners.gif);
}
@ -1161,7 +1247,8 @@ td.x-date-mp-sep {
.x-tip-anchor {
background-image: url(../images/default/qtip/tip-anchor-sprite.gif);
}.x-menu {
}
.x-menu {
background-color: #f0f0f0;
background-image: url(../images/default/menu/menu.gif);
}
@ -1222,7 +1309,8 @@ a.x-menu-item {
background-image: none;
}
.x-date-menu, .x-color-menu{
.x-date-menu,
.x-color-menu {
background-color: #fff !important;
}
@ -1261,7 +1349,8 @@ a.x-menu-item {
.x-box-mc {
background-color: #eee;
background-image: url(../images/default/box/tb.gif);
font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif;
font-family: 'Myriad Pro', 'Myriad Web', 'Tahoma', 'Helvetica', 'Arial',
sans-serif;
color: #393939;
font-size: 12px;
}
@ -1287,11 +1376,16 @@ a.x-menu-item {
background-image: url(../images/default/box/corners.gif);
}
.x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr {
.x-box-blue .x-box-bl,
.x-box-blue .x-box-br,
.x-box-blue .x-box-tl,
.x-box-blue .x-box-tr {
background-image: url(../images/default/box/corners-blue.gif);
}
.x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc {
.x-box-blue .x-box-bc,
.x-box-blue .x-box-mc,
.x-box-blue .x-box-tc {
background-image: url(../images/default/box/tb-blue.gif);
}
@ -1309,7 +1403,8 @@ a.x-menu-item {
.x-box-blue .x-box-mr {
background-image: url(../images/default/box/r-blue.gif);
}.x-combo-list {
}
.x-combo-list {
border-color: #98c0f4;
background-color: #ddecfe;
font: normal 12px tahoma, arial, helvetica, sans-serif;
@ -1345,7 +1440,8 @@ a.x-menu-item {
.x-combo-list-small {
font: normal 11px tahoma, arial, helvetica, sans-serif;
}.x-panel {
}
.x-panel {
border-color: #99bbe8;
}
@ -1363,15 +1459,18 @@ a.x-menu-item {
background-color: #fff;
}
.x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar {
.x-panel-bbar .x-toolbar,
.x-panel-tbar .x-toolbar {
border-color: #99bbe8;
}
.x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar {
.x-panel-tbar-noheader .x-toolbar,
.x-panel-mc .x-panel-tbar .x-toolbar {
border-top-color: #99bbe8;
}
.x-panel-body-noheader, .x-panel-mc .x-panel-body {
.x-panel-body-noheader,
.x-panel-mc .x-panel-body {
border-top-color: #99bbe8;
}
@ -1384,7 +1483,10 @@ a.x-menu-item {
background-image: url(../images/default/panel/top-bottom.gif);
}
.x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{
.x-panel-tl,
.x-panel-tr,
.x-panel-bl,
.x-panel-br {
background-image: url(../images/default/panel/corners-sprite.gif);
border-bottom-color: #99bbe8;
}
@ -1423,7 +1525,12 @@ a.x-menu-item {
border-color: #99bbe8;
}
.x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{
.x-panel-fbar td,
.x-panel-fbar span,
.x-panel-fbar input,
.x-panel-fbar div,
.x-panel-fbar select,
.x-panel-fbar label {
font: normal 11px arial, tahoma, helvetica, sans-serif;
}
.x-window-proxy {
@ -1505,13 +1612,15 @@ a.x-menu-item {
body.x-body-masked .x-window-plain .x-window-mc {
background-color: #ccd9e8;
}.x-html-editor-wrap {
}
.x-html-editor-wrap {
border-color: #a9bfd3;
background-color: #fff;
}
.x-html-editor-tb .x-btn-text {
background-image: url(../images/default/editor/tb-sprite.gif);
}.x-panel-noborder .x-panel-header-noborder {
}
.x-panel-noborder .x-panel-header-noborder {
border-bottom-color: #99bbe8;
}
@ -1529,7 +1638,8 @@ body.x-body-masked .x-window-plain .x-window-mc {
.x-tab-panel-tbar-noborder .x-toolbar {
border-bottom-color: #99bbe8;
}.x-border-layout-ct {
}
.x-border-layout-ct {
background-color: #dfe8f6;
}
@ -1575,7 +1685,8 @@ body.x-body-masked .x-window-plain .x-window-mc {
.x-layout-cmini-south .x-layout-mini {
background-image: url(../images/default/layout/mini-top.gif);
}.x-progress-wrap {
}
.x-progress-wrap {
border-color: #6593cf;
}
@ -1600,7 +1711,8 @@ body.x-body-masked .x-window-plain .x-window-mc {
.x-progress-text-back {
color: #396095;
}.x-list-header{
}
.x-list-header {
background-color: #f9f9f9;
background-image: url(../images/default/grid/grid3-hrow.gif);
}
@ -1627,10 +1739,14 @@ body.x-body-masked .x-window-plain .x-window-mc {
border-right-color: #555;
}
.x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc {
.x-list-header-inner em.sort-asc,
.x-list-header-inner em.sort-desc {
background-image: url(../images/default/grid/sort-hd.gif);
border-color: #99bbe8;
}.x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner {
}
.x-slider-horz,
.x-slider-horz .x-slider-end,
.x-slider-horz .x-slider-inner {
background-image: url(../images/default/slider/slider-bg.png);
}
@ -1638,13 +1754,16 @@ body.x-body-masked .x-window-plain .x-window-mc {
background-image: url(../images/default/slider/slider-thumb.png);
}
.x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner {
.x-slider-vert,
.x-slider-vert .x-slider-end,
.x-slider-vert .x-slider-inner {
background-image: url(../images/default/slider/slider-v-bg.png);
}
.x-slider-vert .x-slider-thumb {
background-image: url(../images/default/slider/slider-v-thumb.png);
}.x-window-dlg .ext-mb-text,
}
.x-window-dlg .ext-mb-text,
.x-window-dlg .x-window-header-text {
font-size: 12px;
}

View file

@ -42,8 +42,9 @@
border-color: #fff;
}
.x-color-palette a:hover, .x-color-palette a.x-color-palette-sel {
border-color:#CFCFCF;
.x-color-palette a:hover,
.x-color-palette a.x-color-palette-sel {
border-color: #cfcfcf;
background-color: #eaeaea;
}
@ -65,11 +66,17 @@
background-image: url(../images/default/shadow-c.png);
}
.x-shadow .xsml, .x-shadow .xsmr {
.x-shadow .xsml,
.x-shadow .xsmr {
background-image: url(../images/default/shadow-lr.png);
}
.x-shadow .xstl, .x-shadow .xstc, .x-shadow .xstr, .x-shadow .xsbl, .x-shadow .xsbc, .x-shadow .xsbr{
.x-shadow .xstl,
.x-shadow .xstc,
.x-shadow .xstr,
.x-shadow .xsbl,
.x-shadow .xsbc,
.x-shadow .xsbr {
background-image: url(../images/default/shadow.png);
}
@ -80,14 +87,17 @@
.x-spotlight {
background-color: #ccc;
}.x-tab-panel-header, .x-tab-panel-footer {
}
.x-tab-panel-header,
.x-tab-panel-footer {
background-color: #eaeaea;
border-color: #d0d0d0;
overflow: hidden;
zoom: 1;
}
.x-tab-panel-header, .x-tab-panel-footer {
.x-tab-panel-header,
.x-tab-panel-footer {
border-color: #d0d0d0;
}
@ -127,7 +137,9 @@ ul.x-tab-strip-bottom{
color: #aaaaaa;
}
.x-tab-strip-top .x-tab-right, .x-tab-strip-top .x-tab-left, .x-tab-strip-top .x-tab-strip-inner{
.x-tab-strip-top .x-tab-right,
.x-tab-strip-top .x-tab-left,
.x-tab-strip-top .x-tab-strip-inner {
background-image: url(../images/gray/tabs/tabs-sprite.gif);
}
@ -187,8 +199,8 @@ ul.x-tab-strip-bottom{
.x-tab-scroller-left-disabled {
background-position: -18px 0;
opacity:.5;
-moz-opacity:.5;
opacity: 0.5;
-moz-opacity: 0.5;
filter: alpha(opacity=50);
cursor: default;
}
@ -198,22 +210,24 @@ ul.x-tab-strip-bottom{
border-bottom-color: #d0d0d0;
}
.x-tab-panel-bbar .x-toolbar, .x-tab-panel-tbar .x-toolbar {
.x-tab-panel-bbar .x-toolbar,
.x-tab-panel-tbar .x-toolbar {
border-color: #d0d0d0;
}
.x-form-field {
font: normal 12px tahoma, arial, helvetica, sans-serif;
}
.x-form-text, textarea.x-form-field{
.x-form-text,
textarea.x-form-field {
background-color: #fff;
background-image: url(../images/default/form/text-bg.gif);
border-color:#C1C1C1;
border-color: #c1c1c1;
}
.x-form-select-one {
background-color: #fff;
border-color:#C1C1C1;
border-color: #c1c1c1;
}
.x-form-check-group-label {
@ -254,11 +268,13 @@ ul.x-tab-strip-bottom{
border-bottom-color: #b5b8c8;
}
.x-form-focus, textarea.x-form-focus{
.x-form-focus,
textarea.x-form-focus {
border-color: #777777;
}
.x-form-invalid, textarea.x-form-invalid{
.x-form-invalid,
textarea.x-form-invalid {
background-color: #fff;
background-image: url(../images/default/grid/invalid_line.gif);
border-color: #c30;
@ -269,7 +285,8 @@ ul.x-tab-strip-bottom{
border-color: #ff7870;
}
.x-form-inner-invalid, textarea.x-form-inner-invalid{
.x-form-inner-invalid,
textarea.x-form-inner-invalid {
background-color: #fff;
background-image: url(../images/default/grid/invalid_line.gif);
}
@ -305,13 +322,14 @@ ul.x-tab-strip-bottom{
}
.x-fieldset {
border-color:#CCCCCC;
border-color: #cccccc;
}
.x-fieldset legend {
font: bold 11px tahoma, arial, helvetica, sans-serif;
color: #777777;
}.x-btn{
}
.x-btn {
font: normal 11px tahoma, verdana, helvetica;
}
@ -325,11 +343,21 @@ ul.x-tab-strip-bottom{
font-weight: normal;
}
.x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{
.x-btn-tl,
.x-btn-tr,
.x-btn-tc,
.x-btn-ml,
.x-btn-mr,
.x-btn-mc,
.x-btn-bl,
.x-btn-br,
.x-btn-bc {
background-image: url(../images/gray/button/btn.gif);
}
.x-btn-click .x-btn-text, .x-btn-menu-active .x-btn-text, .x-btn-pressed .x-btn-text{
.x-btn-click .x-btn-text,
.x-btn-menu-active .x-btn-text,
.x-btn-pressed .x-btn-text {
color: #000;
}
@ -345,7 +373,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/button/s-arrow.gif);
}
.x-btn-over .x-btn-mc em.x-btn-split, .x-btn-click .x-btn-mc em.x-btn-split, .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-btn-pressed .x-btn-mc em.x-btn-split {
.x-btn-over .x-btn-mc em.x-btn-split,
.x-btn-click .x-btn-mc em.x-btn-split,
.x-btn-menu-active .x-btn-mc em.x-btn-split,
.x-btn-pressed .x-btn-mc em.x-btn-split {
background-image: url(../images/gray/button/s-arrow-o.gif);
}
@ -357,7 +388,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/button/s-arrow-b.gif);
}
.x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-btn-click .x-btn-mc em.x-btn-split-bottom, .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
.x-btn-over .x-btn-mc em.x-btn-split-bottom,
.x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-btn-menu-active .x-btn-mc em.x-btn-split-bottom,
.x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
background-image: url(../images/gray/button/s-arrow-bo.gif);
}
@ -405,7 +439,12 @@ ul.x-tab-strip-bottom{
background-image: url(../images/gray/toolbar/bg.gif);
}
.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{
.x-toolbar td,
.x-toolbar span,
.x-toolbar input,
.x-toolbar div,
.x-toolbar select,
.x-toolbar label {
font: normal 11px arial, tahoma, helvetica, sans-serif;
}
@ -421,9 +460,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/button/s-arrow-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split
{
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-click .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split,
.x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split {
background-image: url(../images/gray/button/s-arrow-o.gif);
}
@ -431,9 +471,10 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/button/s-arrow-b-noline.gif);
}
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom, .x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom
{
.x-toolbar .x-btn-over .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-click .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-menu-active .x-btn-mc em.x-btn-split-bottom,
.x-toolbar .x-btn-pressed .x-btn-mc em.x-btn-split-bottom {
background-image: url(../images/gray/button/s-arrow-bo.gif);
}
@ -492,31 +533,38 @@ ul.x-tab-strip-bottom{
background-color: #fff;
}
.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east,
.x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west
{
.x-resizable-over .x-resizable-handle-east,
.x-resizable-pinned .x-resizable-handle-east,
.x-resizable-over .x-resizable-handle-west,
.x-resizable-pinned .x-resizable-handle-west {
background-image: url(../images/gray/sizer/e-handle.gif);
}
.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south,
.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north
{
.x-resizable-over .x-resizable-handle-south,
.x-resizable-pinned .x-resizable-handle-south,
.x-resizable-over .x-resizable-handle-north,
.x-resizable-pinned .x-resizable-handle-north {
background-image: url(../images/gray/sizer/s-handle.gif);
}
.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{
.x-resizable-over .x-resizable-handle-north,
.x-resizable-pinned .x-resizable-handle-north {
background-image: url(../images/gray/sizer/s-handle.gif);
}
.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{
.x-resizable-over .x-resizable-handle-southeast,
.x-resizable-pinned .x-resizable-handle-southeast {
background-image: url(../images/gray/sizer/se-handle.gif);
}
.x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{
.x-resizable-over .x-resizable-handle-northwest,
.x-resizable-pinned .x-resizable-handle-northwest {
background-image: url(../images/gray/sizer/nw-handle.gif);
}
.x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{
.x-resizable-over .x-resizable-handle-northeast,
.x-resizable-pinned .x-resizable-handle-northeast {
background-image: url(../images/gray/sizer/ne-handle.gif);
}
.x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{
.x-resizable-over .x-resizable-handle-southwest,
.x-resizable-pinned .x-resizable-handle-southwest {
background-image: url(../images/gray/sizer/sw-handle.gif);
}
.x-resizable-proxy {
@ -533,7 +581,8 @@ ul.x-tab-strip-bottom{
border-color: #d0d0d0;
}
.x-grid3-row td, .x-grid3-summary-row td{
.x-grid3-row td,
.x-grid3-summary-row td {
font: normal 11px/13px arial, tahoma, helvetica, sans-serif;
}
@ -588,15 +637,20 @@ ul.x-tab-strip-bottom{
background-image: url(../images/default/grid/hd-pop.gif);
}
td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open {
border-left-color:#ACACAC;
border-right-color:#ACACAC;
td.x-grid3-hd-over,
td.sort-desc,
td.sort-asc,
td.x-grid3-hd-menu-open {
border-left-color: #acacac;
border-right-color: #acacac;
}
td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-asc .x-grid3-hd-inner, td.x-grid3-hd-menu-open .x-grid3-hd-inner {
td.x-grid3-hd-over .x-grid3-hd-inner,
td.sort-desc .x-grid3-hd-inner,
td.sort-asc .x-grid3-hd-inner,
td.x-grid3-hd-menu-open .x-grid3-hd-inner {
background-color: #f9f9f9;
background-image: url(../images/gray/grid/grid3-hrow-over2.gif);
}
.sort-asc .x-grid3-sort-icon {
@ -607,7 +661,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/gray/grid/sort_desc.gif);
}
.x-grid3-cell-text, .x-grid3-hd-text {
.x-grid3-cell-text,
.x-grid3-hd-text {
color: #000;
}
@ -622,7 +677,7 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
.x-dd-drag-proxy .x-grid3-hd-inner {
background-color: #f9f9f9;
background-image: url(../images/gray/grid/grid3-hrow-over2.gif);
border-color:#ACACAC;
border-color: #acacac;
}
.col-move-top {
@ -634,13 +689,13 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
}
.x-grid3-row-selected {
background-color:#CCCCCC !important;
background-color: #cccccc !important;
background-image: none;
border-color:#ACACAC;
border-color: #acacac;
}
.x-grid3-cell-selected {
background-color: #CBCBCB !important;
background-color: #cbcbcb !important;
color: #000;
}
@ -652,7 +707,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
color: #000;
}
.x-grid3-locked td.x-grid3-row-marker, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker{
.x-grid3-locked td.x-grid3-row-marker,
.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker {
background-color: #ebeadb !important;
background-image: url(../images/default/grid/grid-hrow.gif) !important;
color: #000;
@ -660,7 +716,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
border-right-color: #6fa0df !important;
}
.x-grid3-locked td.x-grid3-row-marker div, .x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div{
.x-grid3-locked td.x-grid3-row-marker div,
.x-grid3-locked .x-grid3-row-selected td.x-grid3-row-marker div {
color: #333 !important;
}
@ -668,7 +725,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/default/grid/dirty.gif);
}
.x-grid3-topbar, .x-grid3-bottombar{
.x-grid3-topbar,
.x-grid3-bottombar {
font: normal 11px arial, tahoma, helvetica, sans-serif;
}
@ -719,7 +777,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/default/grid/grid3-special-col-bg.gif);
}
.x-grid3-row-checker, .x-grid3-hd-checker {
.x-grid3-row-checker,
.x-grid3-hd-checker {
background-image: url(../images/default/grid/row-check-sprite.gif);
}
@ -749,7 +808,9 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-image: url(../images/default/menu/checked.gif);
}
.x-grid-group, .x-grid-group-body, .x-grid-group-hd {
.x-grid-group,
.x-grid-group-body,
.x-grid-group-hd {
zoom: 1;
}
@ -759,7 +820,7 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
.x-grid-group-hd div.x-grid-group-title {
background-image: url(../images/gray/grid/group-collapse.gif);
color:#5F5F5F;
color: #5f5f5f;
font: bold 11px tahoma, arial, helvetica, sans-serif;
}
@ -793,14 +854,14 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
}
.x-grid-with-col-lines .x-grid3-row-selected {
border-top-color:#B9B9B9;
border-top-color: #b9b9b9;
}
.x-pivotgrid .x-grid3-header-offset table td {
background: url(../images/gray/grid/grid3-hrow2.gif) repeat-x 50% 100%;
border-left: 1px solid;
border-right: 1px solid;
border-left-color: #D0D0D0;
border-right-color: #D0D0D0;
border-left-color: #d0d0d0;
border-right-color: #d0d0d0;
}
.x-pivotgrid .x-grid3-row-headers {
@ -808,13 +869,14 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
}
.x-pivotgrid .x-grid3-row-headers table td {
background: #EEE url(../images/default/grid/grid3-rowheader.gif) repeat-x left top;
background: #eee url(../images/default/grid/grid3-rowheader.gif) repeat-x
left top;
border-left: 1px solid;
border-right: 1px solid;
border-left-color: #EEE;
border-right-color: #D0D0D0;
border-left-color: #eee;
border-right-color: #d0d0d0;
border-bottom: 1px solid;
border-bottom-color: #D0D0D0;
border-bottom-color: #d0d0d0;
height: 18px;
}
.x-dd-drag-ghost {
@ -837,9 +899,10 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
}
.x-view-selector {
background-color:#D6D6D6;
background-color: #d6d6d6;
border-color: #888888;
}.x-tree-node-expanded .x-tree-node-icon{
}
.x-tree-node-expanded .x-tree-node-icon {
background-image: url(../images/default/tree/folder-open.gif);
}
@ -934,11 +997,13 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
font: normal 11px arial, tahoma, helvetica, sans-serif;
}
.x-tree-node a, .x-dd-drag-ghost a{
.x-tree-node a,
.x-dd-drag-ghost a {
color: #000;
}
.x-tree-node a span, .x-dd-drag-ghost a span{
.x-tree-node a span,
.x-dd-drag-ghost a span {
color: #000;
}
@ -995,10 +1060,12 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
background-color: #fff;
}
.x-date-middle,.x-date-left,.x-date-right {
.x-date-middle,
.x-date-left,
.x-date-right {
background-image: url(../images/gray/shared/hd-sprite.gif);
color: #fff;
font:bold 11px "sans serif", tahoma, verdana, helvetica;
font: bold 11px 'sans serif', tahoma, verdana, helvetica;
}
.x-date-middle .x-btn .x-btn-text {
@ -1018,9 +1085,9 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
}
.x-date-inner th {
background-color:#D8D8D8;
background-color: #d8d8d8;
background-image: url(../images/gray/panel/white-top-bottom.gif);
border-bottom-color:#AFAFAF;
border-bottom-color: #afafaf;
font: normal 10px arial, helvetica, tahoma, sans-serif;
color: #595959;
}
@ -1040,8 +1107,8 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
.x-date-inner .x-date-selected a {
background-image: none;
background-color:#D8D8D8;
border-color:#DCDCDC;
background-color: #d8d8d8;
border-color: #dcdcdc;
}
.x-date-inner .x-date-today a {
@ -1052,19 +1119,21 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
font-weight: bold;
}
.x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a {
.x-date-inner .x-date-prevday a,
.x-date-inner .x-date-nextday a {
color: #aaa;
}
.x-date-bottom {
border-top-color:#AFAFAF;
background-color:#D8D8D8;
background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px;
border-top-color: #afafaf;
background-color: #d8d8d8;
background: #d8d8d8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px;
}
.x-date-inner a:hover, .x-date-inner .x-date-disabled a:hover{
.x-date-inner a:hover,
.x-date-inner .x-date-disabled a:hover {
color: #000;
background-color:#D8D8D8;
background-color: #d8d8d8;
}
.x-date-inner .x-date-disabled a {
@ -1090,34 +1159,36 @@ td.x-grid3-hd-over .x-grid3-hd-inner, td.sort-desc .x-grid3-hd-inner, td.sort-as
}
.x-date-mp-btns button {
background-color:#4E565F;
background-color: #4e565f;
color: #fff;
border-color:#C0C0C0 #434343 #434343 #C0C0C0;
border-color: #c0c0c0 #434343 #434343 #c0c0c0;
font: normal 11px arial, helvetica, tahoma, sans-serif;
}
.x-date-mp-btns {
background-color:#D8D8D8;
background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px;
background-color: #d8d8d8;
background: #d8d8d8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px;
}
.x-date-mp-btns td {
border-top-color:#AFAFAF;
border-top-color: #afafaf;
}
td.x-date-mp-month a,td.x-date-mp-year a {
td.x-date-mp-month a,
td.x-date-mp-year a {
color: #333;
}
td.x-date-mp-month a:hover,td.x-date-mp-year a:hover {
td.x-date-mp-month a:hover,
td.x-date-mp-year a:hover {
color: #333;
background-color:#FDFDFD;
background-color: #fdfdfd;
}
td.x-date-mp-sel a {
background-color:#D8D8D8;
background:#D8D8D8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px;
border-color:#DCDCDC;
background-color: #d8d8d8;
background: #d8d8d8 url(../images/gray/panel/white-top-bottom.gif) 0 -2px;
border-color: #dcdcdc;
}
.x-date-mp-ybtn a {
@ -1125,12 +1196,20 @@ td.x-date-mp-sel a {
}
td.x-date-mp-sep {
border-right-color:#D7D7D7;
}.x-tip .x-tip-close{
border-right-color: #d7d7d7;
}
.x-tip .x-tip-close {
background-image: url(../images/gray/qtip/close.gif);
}
.x-tip .x-tip-tc, .x-tip .x-tip-tl, .x-tip .x-tip-tr, .x-tip .x-tip-bc, .x-tip .x-tip-bl, .x-tip .x-tip-br, .x-tip .x-tip-ml, .x-tip .x-tip-mr {
.x-tip .x-tip-tc,
.x-tip .x-tip-tl,
.x-tip .x-tip-tr,
.x-tip .x-tip-bc,
.x-tip .x-tip-bl,
.x-tip .x-tip-br,
.x-tip .x-tip-ml,
.x-tip .x-tip-mr {
background-image: url(../images/gray/qtip/tip-sprite.gif);
}
@ -1151,9 +1230,14 @@ td.x-date-mp-sep {
color: #444;
}
.x-form-invalid-tip .x-tip-tc, .x-form-invalid-tip .x-tip-tl, .x-form-invalid-tip .x-tip-tr, .x-form-invalid-tip .x-tip-bc,
.x-form-invalid-tip .x-tip-bl, .x-form-invalid-tip .x-tip-br, .x-form-invalid-tip .x-tip-ml, .x-form-invalid-tip .x-tip-mr
{
.x-form-invalid-tip .x-tip-tc,
.x-form-invalid-tip .x-tip-tl,
.x-form-invalid-tip .x-tip-tr,
.x-form-invalid-tip .x-tip-bc,
.x-form-invalid-tip .x-tip-bl,
.x-form-invalid-tip .x-tip-br,
.x-form-invalid-tip .x-tip-ml,
.x-form-invalid-tip .x-tip-mr {
background-image: url(../images/default/form/error-tip-corners.gif);
}
@ -1163,13 +1247,14 @@ td.x-date-mp-sep {
.x-tip-anchor {
background-image: url(../images/gray/qtip/tip-anchor-sprite.gif);
}.x-menu {
}
.x-menu {
background-color: #f0f0f0;
background-image: url(../images/default/menu/menu.gif);
}
.x-menu-floating {
border-color:#7D7D7D;
border-color: #7d7d7d;
}
.x-menu-nosep {
@ -1196,11 +1281,11 @@ a.x-menu-item {
.x-menu-item-active {
background-image: url(../images/gray/menu/item-over.gif);
background-color: #f1f1f1;
border-color:#ACACAC;
border-color: #acacac;
}
.x-menu-item-active a.x-menu-item {
border-color:#ACACAC;
border-color: #acacac;
}
.x-menu-check-item .x-menu-item-icon {
@ -1224,12 +1309,12 @@ a.x-menu-item {
}
.x-menu .x-date-picker {
border-color:#AFAFAF;
border-color: #afafaf;
}
.x-cycle-menu .x-menu-item-checked {
border-color:#B9B9B9 !important;
background-color:#F1F1F1;
border-color: #b9b9b9 !important;
background-color: #f1f1f1;
}
.x-menu-scroller-top {
@ -1238,7 +1323,8 @@ a.x-menu-item {
.x-menu-scroller-bottom {
background-image: url(../images/default/layout/mini-bottom.gif);
}.x-box-tl {
}
.x-box-tl {
background-image: url(../images/default/box/corners.gif);
}
@ -1257,7 +1343,8 @@ a.x-menu-item {
.x-box-mc {
background-color: #eee;
background-image: url(../images/default/box/tb.gif);
font-family: "Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif;
font-family: 'Myriad Pro', 'Myriad Web', 'Tahoma', 'Helvetica', 'Arial',
sans-serif;
color: #393939;
font-size: 12px;
}
@ -1283,11 +1370,16 @@ a.x-menu-item {
background-image: url(../images/default/box/corners.gif);
}
.x-box-blue .x-box-bl, .x-box-blue .x-box-br, .x-box-blue .x-box-tl, .x-box-blue .x-box-tr {
.x-box-blue .x-box-bl,
.x-box-blue .x-box-br,
.x-box-blue .x-box-tl,
.x-box-blue .x-box-tr {
background-image: url(../images/default/box/corners-blue.gif);
}
.x-box-blue .x-box-bc, .x-box-blue .x-box-mc, .x-box-blue .x-box-tc {
.x-box-blue .x-box-bc,
.x-box-blue .x-box-mc,
.x-box-blue .x-box-tc {
background-image: url(../images/default/box/tb-blue.gif);
}
@ -1320,11 +1412,11 @@ a.x-menu-item {
font: bold 11px tahoma, arial, helvetica, sans-serif;
color: #333;
background-image: url(../images/default/layout/panel-title-light-bg.gif);
border-bottom-color:#BCBCBC;
border-bottom-color: #bcbcbc;
}
.x-resizable-pinned .x-combo-list-inner {
border-bottom-color:#BEBEBE;
border-bottom-color: #bebebe;
}
.x-combo-list-item {
@ -1337,12 +1429,13 @@ a.x-menu-item {
}
.x-combo-list .x-toolbar {
border-top-color:#BCBCBC;
border-top-color: #bcbcbc;
}
.x-combo-list-small {
font: normal 11px tahoma, arial, helvetica, sans-serif;
}.x-panel {
}
.x-panel {
border-color: #d0d0d0;
}
@ -1360,15 +1453,18 @@ a.x-menu-item {
background-color: #fff;
}
.x-panel-bbar .x-toolbar, .x-panel-tbar .x-toolbar {
.x-panel-bbar .x-toolbar,
.x-panel-tbar .x-toolbar {
border-color: #d0d0d0;
}
.x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar {
.x-panel-tbar-noheader .x-toolbar,
.x-panel-mc .x-panel-tbar .x-toolbar {
border-top-color: #d0d0d0;
}
.x-panel-body-noheader, .x-panel-mc .x-panel-body {
.x-panel-body-noheader,
.x-panel-mc .x-panel-body {
border-top-color: #d0d0d0;
}
@ -1381,7 +1477,10 @@ a.x-menu-item {
background-image: url(../images/gray/panel/top-bottom.gif);
}
.x-panel-tl, .x-panel-tr, .x-panel-bl, .x-panel-br{
.x-panel-tl,
.x-panel-tr,
.x-panel-bl,
.x-panel-br {
background-image: url(../images/gray/panel/corners-sprite.gif);
border-bottom-color: #d0d0d0;
}
@ -1420,7 +1519,12 @@ a.x-menu-item {
border-color: #d0d0d0;
}
.x-panel-fbar td,.x-panel-fbar span,.x-panel-fbar input,.x-panel-fbar div,.x-panel-fbar select,.x-panel-fbar label{
.x-panel-fbar td,
.x-panel-fbar span,
.x-panel-fbar input,
.x-panel-fbar div,
.x-panel-fbar select,
.x-panel-fbar label {
font: normal 11px arial, tahoma, helvetica, sans-serif;
}
.x-window-proxy {
@ -1492,19 +1596,19 @@ a.x-menu-item {
}
.x-window-plain .x-window-mc {
background-color: #E8E8E8;
border-color: #D0D0D0 #EEEEEE #EEEEEE #D0D0D0;
background-color: #e8e8e8;
border-color: #d0d0d0 #eeeeee #eeeeee #d0d0d0;
}
.x-window-plain .x-window-body {
border-color: #EEEEEE #D0D0D0 #D0D0D0 #EEEEEE;
border-color: #eeeeee #d0d0d0 #d0d0d0 #eeeeee;
}
body.x-body-masked .x-window-plain .x-window-mc {
background-color: #E4E4E4;
background-color: #e4e4e4;
}
.x-html-editor-wrap {
border-color:#BCBCBC;
border-color: #bcbcbc;
background-color: #fff;
}
.x-html-editor-tb .x-btn-text {
@ -1581,20 +1685,20 @@ body.x-body-masked .x-window-plain .x-window-mc {
background-image: url(../images/default/layout/mini-top.gif);
}
.x-progress-wrap {
border-color:#8E8E8E;
border-color: #8e8e8e;
}
.x-progress-inner {
background-color:#E7E7E7;
background-color: #e7e7e7;
background-image: url(../images/gray/qtip/bg.gif);
}
.x-progress-bar {
background-color:#BCBCBC;
background-color: #bcbcbc;
background-image: url(../images/gray/progress/progress-bg.gif);
border-top-color:#E2E2E2;
border-bottom-color:#A4A4A4;
border-right-color:#A4A4A4;
border-top-color: #e2e2e2;
border-bottom-color: #a4a4a4;
border-right-color: #a4a4a4;
}
.x-progress-text {
@ -1604,7 +1708,7 @@ body.x-body-masked .x-window-plain .x-window-mc {
}
.x-progress-text-back {
color:#5F5F5F;
color: #5f5f5f;
}
.x-list-header {
background-color: #f9f9f9;
@ -1633,11 +1737,14 @@ body.x-body-masked .x-window-plain .x-window-mc {
border-right-color: #555;
}
.x-list-header-inner em.sort-asc, .x-list-header-inner em.sort-desc {
.x-list-header-inner em.sort-asc,
.x-list-header-inner em.sort-desc {
background-image: url(../images/gray/grid/sort-hd.gif);
border-color: #d0d0d0;
}
.x-slider-horz, .x-slider-horz .x-slider-end, .x-slider-horz .x-slider-inner {
.x-slider-horz,
.x-slider-horz .x-slider-end,
.x-slider-horz .x-slider-inner {
background-image: url(../images/default/slider/slider-bg.png);
}
@ -1645,7 +1752,9 @@ body.x-body-masked .x-window-plain .x-window-mc {
background-image: url(../images/gray/slider/slider-thumb.png);
}
.x-slider-vert, .x-slider-vert .x-slider-end, .x-slider-vert .x-slider-inner {
.x-slider-vert,
.x-slider-vert .x-slider-end,
.x-slider-vert .x-slider-inner {
background-image: url(../images/default/slider/slider-v-bg.png);
}

View file

@ -4,16 +4,18 @@ For a quick summary read: https://docs.pipenv.org/basics/
## Prerequisites
* python-libtorrent
* pip
* pipenv
- python-libtorrent
- pip
- pipenv
## Install pipenv and packages
Install Pipenv and upgrade pip:
pip install -U pip pipenv
On Ubuntu:
sudo -H pip install -U pip pipenv
In order to have access to system libtorrent we use `--site-packages` and