mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-21 09:38:44 +00:00
codepaint plugins js files
This commit is contained in:
parent
3e610ec5ba
commit
21f18a75bb
5 changed files with 319 additions and 379 deletions
|
@ -1,7 +1,7 @@
|
||||||
/*!
|
/*!
|
||||||
* blocklist.js
|
* blocklist.js
|
||||||
*
|
*
|
||||||
* Copyright (c) Omar Alvarez 2014 <omar.alvarez@udc.es>
|
* Copyright (C) Omar Alvarez 2014 <omar.alvarez@udc.es>
|
||||||
*
|
*
|
||||||
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||||
* the additional special exception to link portions of this program with the OpenSSL library.
|
* the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
|
|
@ -1,36 +1,17 @@
|
||||||
/*
|
/*!
|
||||||
Script: execute.js
|
* execute.js
|
||||||
The client-side javascript code for the Execute plugin.
|
* The client-side javascript code for the Execute plugin.
|
||||||
|
*
|
||||||
|
* Copyright (C) Damien Churchill 2010 <damoxc@gmail.com>
|
||||||
|
*
|
||||||
|
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||||
|
* the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
* See LICENSE for more details.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
Copyright:
|
|
||||||
(C) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 3, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, write to:
|
|
||||||
The Free Software Foundation, Inc.,
|
|
||||||
51 Franklin Street, Fifth Floor
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
In addition, as a special exception, the copyright holders give
|
|
||||||
permission to link the code of portions of this program with the OpenSSL
|
|
||||||
library.
|
|
||||||
You must obey the GNU General Public License in all respects for all of
|
|
||||||
the code used other than OpenSSL. If you modify file(s) with this
|
|
||||||
exception, you may extend this exception to your version of the file(s),
|
|
||||||
but you are not obligated to do so. If you do not wish to do so, delete
|
|
||||||
this exception statement from your version. If you delete this exception
|
|
||||||
statement from all source files in the program, then also delete it here.
|
|
||||||
*/
|
|
||||||
Ext.ns('Deluge.ux');
|
Ext.ns('Deluge.ux');
|
||||||
|
|
||||||
Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
|
Deluge.ux.ExecuteWindowBase = Ext.extend(Ext.Window, {
|
||||||
|
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*!
|
/*!
|
||||||
* extractor.js
|
* extractor.js
|
||||||
*
|
*
|
||||||
* Copyright (c) Damien Churchill 2010 <damoxc@gmail.com>
|
* Copyright (C) Calum Lind 2014 <calumlind@gmail.com>
|
||||||
*
|
*
|
||||||
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||||
* the additional special exception to link portions of this program with the OpenSSL library.
|
* the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
|
@ -43,7 +43,7 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
|
||||||
|
|
||||||
this.extract_path = fieldset.add({
|
this.extract_path = fieldset.add({
|
||||||
fieldLabel: _('Extract to:'),
|
fieldLabel: _('Extract to:'),
|
||||||
labelSeparator : '',
|
labelSeparator: '',
|
||||||
name: 'extract_path',
|
name: 'extract_path',
|
||||||
width: '97%'
|
width: '97%'
|
||||||
});
|
});
|
||||||
|
@ -62,7 +62,7 @@ Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, {
|
||||||
|
|
||||||
onApply: function() {
|
onApply: function() {
|
||||||
// build settings object
|
// build settings object
|
||||||
var config = { }
|
var config = {}
|
||||||
|
|
||||||
config['extract_path'] = this.extract_path.getValue();
|
config['extract_path'] = this.extract_path.getValue();
|
||||||
config['use_name_folder'] = this.use_name_folder.getValue();
|
config['use_name_folder'] = this.use_name_folder.getValue();
|
||||||
|
|
|
@ -1,34 +1,14 @@
|
||||||
/*!
|
/*!
|
||||||
* label.js
|
* label.js
|
||||||
*
|
*
|
||||||
* Copyright (c) Damien Churchill 2010 <damoxc@gmail.com>
|
* Copyright (C) Damien Churchill 2010 <damoxc@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||||
* it under the terms of the GNU General Public License as published by
|
* the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
* the Free Software Foundation; either version 3, or (at your option)
|
* See LICENSE for more details.
|
||||||
* any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, write to:
|
|
||||||
* The Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor
|
|
||||||
* Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* In addition, as a special exception, the copyright holders give
|
|
||||||
* permission to link the code of portions of this program with the OpenSSL
|
|
||||||
* library.
|
|
||||||
* You must obey the GNU General Public License in all respects for all of
|
|
||||||
* the code used other than OpenSSL. If you modify file(s) with this
|
|
||||||
* exception, you may extend this exception to your version of the file(s),
|
|
||||||
* but you are not obligated to do so. If you do not wish to do so, delete
|
|
||||||
* this exception statement from your version. If you delete this exception
|
|
||||||
* statement from all source files in the program, then also delete it here.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Ext.ns('Deluge.ux');
|
Ext.ns('Deluge.ux');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -396,7 +376,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
|
||||||
scope: this
|
scope: this
|
||||||
});
|
});
|
||||||
for (var state in states) {
|
for (var state in states) {
|
||||||
if (!state || state == 'All' ) continue;
|
if (!state || state == 'All') continue;
|
||||||
this.torrentMenu.addMenuItem({
|
this.torrentMenu.addMenuItem({
|
||||||
text: state,
|
text: state,
|
||||||
label: state,
|
label: state,
|
||||||
|
@ -494,7 +474,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!this.labelMenu) this.createMenu();
|
if (!this.labelMenu) this.createMenu();
|
||||||
var r = dv.getRecord(node).get('filter');
|
var r = dv.getRecord(node).get('filter');
|
||||||
if ( !r || r == 'All') {
|
if (!r || r == 'All') {
|
||||||
this.labelMenu.items.get(1).setDisabled(true);
|
this.labelMenu.items.get(1).setDisabled(true);
|
||||||
this.labelMenu.items.get(2).setDisabled(true);
|
this.labelMenu.items.get(2).setDisabled(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -536,7 +516,7 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
|
||||||
onTorrentMenuClick: function(item, e) {
|
onTorrentMenuClick: function(item, e) {
|
||||||
var ids = deluge.torrents.getSelectedIds();
|
var ids = deluge.torrents.getSelectedIds();
|
||||||
Ext.each(ids, function(id, i) {
|
Ext.each(ids, function(id, i) {
|
||||||
if (ids.length == i +1 ) {
|
if (ids.length == i + 1) {
|
||||||
deluge.client.label.set_torrent(id, item.label, {
|
deluge.client.label.set_torrent(id, item.label, {
|
||||||
success: function() {
|
success: function() {
|
||||||
deluge.ui.update();
|
deluge.ui.update();
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
/*
|
/*!
|
||||||
Script: scheduler.js
|
* scheduler.js
|
||||||
The client-side javascript code for the Scheduler plugin.
|
* The client-side javascript code for the Scheduler plugin.
|
||||||
|
*
|
||||||
Copyright:
|
* Copyright (C) samuel337 2011
|
||||||
(C) samuel337 2011
|
*
|
||||||
This program is free software; you can redistribute it and/or modify
|
* This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
|
||||||
it under the terms of the GNU General Public License as published by
|
* the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
the Free Software Foundation; either version 3, or (at your option)
|
* See LICENSE for more details.
|
||||||
any later version.
|
*
|
||||||
|
*/
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, write to:
|
|
||||||
The Free Software Foundation, Inc.,
|
|
||||||
51 Franklin Street, Fifth Floor
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
In addition, as a special exception, the copyright holders give
|
|
||||||
permission to link the code of portions of this program with the OpenSSL
|
|
||||||
library.
|
|
||||||
You must obey the GNU General Public License in all respects for all of
|
|
||||||
the code used other than OpenSSL. If you modify file(s) with this
|
|
||||||
exception, you may extend this exception to your version of the file(s),
|
|
||||||
but you are not obligated to do so. If you do not wish to do so, delete
|
|
||||||
this exception statement from your version. If you delete this exception
|
|
||||||
statement from all source files in the program, then also delete it here.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Ext.ns('Deluge.ux');
|
Ext.ns('Deluge.ux');
|
||||||
|
|
||||||
|
@ -110,7 +89,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
}
|
}
|
||||||
el2.style[floatAttr] = 'right';
|
el2.style[floatAttr] = 'right';
|
||||||
|
|
||||||
for (var i=0; i < this.states.length; i++) {
|
for (var i = 0; i < this.states.length; i++) {
|
||||||
var el3 = createEl(el2, 'input');
|
var el3 = createEl(el2, 'input');
|
||||||
el3.type = 'radio';
|
el3.type = 'radio';
|
||||||
el3.value = this.states[i].value;
|
el3.value = this.states[i].value;
|
||||||
|
@ -143,10 +122,10 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
table.cellSpacing = 0;
|
table.cellSpacing = 0;
|
||||||
|
|
||||||
// cache access to cells for easier access later
|
// cache access to cells for easier access later
|
||||||
this.scheduleCells = { };
|
this.scheduleCells = {};
|
||||||
|
|
||||||
Ext.each(this.daysOfWeek, function(day) {
|
Ext.each(this.daysOfWeek, function(day) {
|
||||||
var cells = [ ];
|
var cells = [];
|
||||||
var row = createEl(table, 'tr');
|
var row = createEl(table, 'tr');
|
||||||
var label = createEl(row, 'th');
|
var label = createEl(row, 'th');
|
||||||
label.setAttribute('style', 'font-weight: bold; padding-right: 5px;');
|
label.setAttribute('style', 'font-weight: bold; padding-right: 5px;');
|
||||||
|
@ -260,8 +239,8 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
pm = true;
|
pm = true;
|
||||||
if (hour > 12) hour -= 12;
|
if (hour > 12) hour -= 12;
|
||||||
}
|
}
|
||||||
// change 0 hour to 12am
|
|
||||||
else if (hour == 0) {
|
else if (hour == 0) {
|
||||||
|
// change 0 hour to 12am
|
||||||
hour = 12;
|
hour = 12;
|
||||||
}
|
}
|
||||||
this.showCellLeftTooltip(hour + ' ' + (pm ? 'pm' : 'am'), leftTooltipCell);
|
this.showCellLeftTooltip(hour + ' ' + (pm ? 'pm' : 'am'), leftTooltipCell);
|
||||||
|
@ -287,8 +266,8 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
pm = true;
|
pm = true;
|
||||||
if (hour > 12) hour -= 12;
|
if (hour > 12) hour -= 12;
|
||||||
}
|
}
|
||||||
// change 0 hour to 12am
|
|
||||||
else if (hour == 0) {
|
else if (hour == 0) {
|
||||||
|
// change 0 hour to 12am
|
||||||
hour = 12;
|
hour = 12;
|
||||||
}
|
}
|
||||||
this.showCellRightTooltip(hour + ' ' + (pm ? 'pm' : 'am'), rightTooltipCell);
|
this.showCellRightTooltip(hour + ' ' + (pm ? 'pm' : 'am'), rightTooltipCell);
|
||||||
|
@ -308,19 +287,19 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
}
|
}
|
||||||
else if (cell.hour > this.dragAnchor.hour) {
|
else if (cell.hour > this.dragAnchor.hour) {
|
||||||
// dragging right
|
// dragging right
|
||||||
this.revertCells(cell.day, cell.hour+1, 23);
|
this.revertCells(cell.day, cell.hour + 1, 23);
|
||||||
this.previewCells(cell.day, this.dragAnchor.hour, cell.hour);
|
this.previewCells(cell.day, this.dragAnchor.hour, cell.hour);
|
||||||
}
|
}
|
||||||
else if (cell.hour < this.dragAnchor.hour) {
|
else if (cell.hour < this.dragAnchor.hour) {
|
||||||
// dragging left
|
// dragging left
|
||||||
this.revertCells(cell.day, 0, cell.hour-1);
|
this.revertCells(cell.day, 0, cell.hour - 1);
|
||||||
this.previewCells(cell.day, cell.hour, this.dragAnchor.hour);
|
this.previewCells(cell.day, cell.hour, this.dragAnchor.hour);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// back to anchor cell
|
// back to anchor cell
|
||||||
// don't know if it is from right or left, so revert all except this
|
// don't know if it is from right or left, so revert all except this
|
||||||
this.revertCells(cell.day, cell.hour+1, 23);
|
this.revertCells(cell.day, cell.hour + 1, 23);
|
||||||
this.revertCells(cell.day, 0, cell.hour-1);
|
this.revertCells(cell.day, 0, cell.hour - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -346,7 +325,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
|
|
||||||
if (toHour > cells.length) toHour = cells.length;
|
if (toHour > cells.length) toHour = cells.length;
|
||||||
|
|
||||||
for (var i=fromHour; i <= toHour; i++) {
|
for (var i = fromHour; i <= toHour; i++) {
|
||||||
if (cells[i].currentValue != curBrushValue) {
|
if (cells[i].currentValue != curBrushValue) {
|
||||||
cells[i].oldValue = cells[i].currentValue;
|
cells[i].oldValue = cells[i].currentValue;
|
||||||
cells[i].currentValue = curBrushValue;
|
cells[i].currentValue = curBrushValue;
|
||||||
|
@ -360,7 +339,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
|
|
||||||
if (toHour > cells.length) toHour = cells.length;
|
if (toHour > cells.length) toHour = cells.length;
|
||||||
|
|
||||||
for (var i=fromHour; i <= toHour; i++) {
|
for (var i = fromHour; i <= toHour; i++) {
|
||||||
cells[i].currentValue = cells[i].oldValue;
|
cells[i].currentValue = cells[i].oldValue;
|
||||||
this.updateCell(cells[i]);
|
this.updateCell(cells[i]);
|
||||||
}
|
}
|
||||||
|
@ -371,7 +350,7 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
|
|
||||||
if (toHour > cells.length) toHour = cells.length;
|
if (toHour > cells.length) toHour = cells.length;
|
||||||
|
|
||||||
for (var i=fromHour; i <= toHour; i++) {
|
for (var i = fromHour; i <= toHour; i++) {
|
||||||
if (cells[i].currentValue != cells[i].oldValue) {
|
if (cells[i].currentValue != cells[i].oldValue) {
|
||||||
cells[i].oldValue = cells[i].currentValue;
|
cells[i].oldValue = cells[i].currentValue;
|
||||||
}
|
}
|
||||||
|
@ -463,12 +442,12 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
},
|
},
|
||||||
|
|
||||||
getConfig: function() {
|
getConfig: function() {
|
||||||
var config = [ ];
|
var config = [];
|
||||||
|
|
||||||
for (var i=0; i < 24; i++) {
|
for (var i = 0; i < 24; i++) {
|
||||||
var hourConfig = [ 0, 0, 0, 0, 0, 0, 0 ];
|
var hourConfig = [0, 0, 0, 0, 0, 0, 0];
|
||||||
|
|
||||||
for (var j=0; j < this.daysOfWeek.length; j++) {
|
for (var j = 0; j < this.daysOfWeek.length; j++) {
|
||||||
hourConfig[j] = parseInt(this.scheduleCells[this.daysOfWeek[j]][i].currentValue);
|
hourConfig[j] = parseInt(this.scheduleCells[this.daysOfWeek[j]][i].currentValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,10 +458,10 @@ Deluge.ux.ScheduleSelector = Ext.extend(Ext.form.FieldSet, {
|
||||||
},
|
},
|
||||||
|
|
||||||
setConfig: function(config) {
|
setConfig: function(config) {
|
||||||
for (var i=0; i < 24; i++) {
|
for (var i = 0; i < 24; i++) {
|
||||||
var hourConfig = config[i];
|
var hourConfig = config[i];
|
||||||
|
|
||||||
for (var j=0; j < this.daysOfWeek.length; j++) {
|
for (var j = 0; j < this.daysOfWeek.length; j++) {
|
||||||
if (this.scheduleCells == undefined) {
|
if (this.scheduleCells == undefined) {
|
||||||
var cell = hourConfig[j];
|
var cell = hourConfig[j];
|
||||||
} else {
|
} else {
|
||||||
|
@ -577,7 +556,7 @@ Deluge.ux.preferences.SchedulerPage = Ext.extend(Ext.Panel, {
|
||||||
|
|
||||||
onApply: function() {
|
onApply: function() {
|
||||||
// build settings object
|
// build settings object
|
||||||
var config = { }
|
var config = {}
|
||||||
|
|
||||||
config['button_state'] = this.schedule.getConfig();
|
config['button_state'] = this.schedule.getConfig();
|
||||||
config['low_down'] = this.downloadLimit.getValue();
|
config['low_down'] = this.downloadLimit.getValue();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue