From 2e2851dc13d73352530dd4495c7e05603b2e520d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 23:38:38 +0200 Subject: Adding upstream version 2.1.2~dev0+20240219. Signed-off-by: Daniel Baumann --- .../ui/web/js/deluge-all/preferences/ProxyPage.js | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 deluge/ui/web/js/deluge-all/preferences/ProxyPage.js (limited to 'deluge/ui/web/js/deluge-all/preferences/ProxyPage.js') diff --git a/deluge/ui/web/js/deluge-all/preferences/ProxyPage.js b/deluge/ui/web/js/deluge-all/preferences/ProxyPage.js new file mode 100644 index 0000000..2dc4cae --- /dev/null +++ b/deluge/ui/web/js/deluge-all/preferences/ProxyPage.js @@ -0,0 +1,62 @@ +/** + * Deluge.preferences.ProxyPage.js + * + * Copyright (c) Damien Churchill 2009-2010 + * + * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with + * the additional special exception to link portions of this program with the OpenSSL library. + * See LICENSE for more details. + */ +Ext.namespace('Deluge.preferences'); + +/** + * @class Deluge.preferences.Proxy + * @extends Ext.form.FormPanel + */ +Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, { + constructor: function (config) { + config = Ext.apply( + { + border: false, + title: _('Proxy'), + header: false, + layout: 'form', + 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({ + title: _('Proxy'), + name: 'proxy', + }) + ); + this.proxy.on('change', this.onProxyChange, this); + deluge.preferences.getOptionsManager().bind('proxy', this.proxy); + }, + + getValue: function () { + return { + proxy: this.proxy.getValue(), + }; + }, + + setValue: function (value) { + for (var proxy in value) { + this[proxy].setValue(value[proxy]); + } + }, + + onProxyChange: function (field, newValue, oldValue) { + var newValues = this.getValue(); + var oldValues = Ext.apply({}, newValues); + oldValues[field.getName()] = oldValue; + + this.fireEvent('change', this, newValues, oldValues); + }, +}); -- cgit v1.2.3