mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-07 08:02:30 -06:00
@@ -106,8 +106,8 @@
|
||||
<li><a href="#ForceStart"><img src="theme/media-seek-forward" alt="QBT_TR(Force Resume)QBT_TR"/> QBT_TR(Force Resume)QBT_TR</a></li>
|
||||
<li class="separator"><a href="#Delete"><img src="theme/list-remove" alt="QBT_TR(Delete)QBT_TR"/> QBT_TR(Delete)QBT_TR</a></li>
|
||||
<li class="separator">
|
||||
<a href="#Label" class="arrow-right"><img src="theme/view-categories" alt="QBT_TR(Label)QBT_TR"/> QBT_TR(Label)QBT_TR</a>
|
||||
<ul id="contextLabelList"></ul>
|
||||
<a href="#Category" class="arrow-right"><img src="theme/view-categories" alt="QBT_TR(Category)QBT_TR"/> QBT_TR(Category)QBT_TR</a>
|
||||
<ul id="contextCategoryList"></ul>
|
||||
</li>
|
||||
<li id="queueingMenuItems" class="separator">
|
||||
<a href="#priority" class="arrow-right"><span style="display: inline-block; width:16px"></span> QBT_TR(Priority)QBT_TR</a>
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>QBT_TR(Add Torrent Link)QBT_TR</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>QBT_TR(Add Torrent Link)QBT_TR</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
||||
<link rel="stylesheet" href="css/Window.css" type="text/css" />
|
||||
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="scripts/download.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="scripts/download.js" charset="utf-8"></script>
|
||||
</head>
|
||||
<body>
|
||||
<iframe id="download_frame" name="download_frame" class="invisible" src="javascript:false;"></iframe>
|
||||
<form action="command/download" enctype="multipart/form-data" method="post" id="downloadForm" style="text-align: center;" target="download_frame">
|
||||
<center>
|
||||
<br/>
|
||||
<h2 class="vcenter">QBT_TR(Download Torrents from their URLs or Magnet links)QBT_TR</h2>
|
||||
<textarea id="urls" rows="10" name="urls"></textarea>
|
||||
<br/>
|
||||
<h2 class="vcenter">QBT_TR(Download Torrents from their URLs or Magnet links)QBT_TR</h2>
|
||||
<textarea id="urls" rows="10" name="urls"></textarea>
|
||||
<p>QBT_TR(Only one link per line)QBT_TR</p>
|
||||
<fieldset class="settings" style="border: 0; text-align: left;">
|
||||
<div class="formRow" style="margin-top: 6px;">
|
||||
<label for="savepath" class="leftLabelLarge">QBT_TR(Save files to location:)QBT_TR</label>
|
||||
<input type="text" id="savepath" name="savepath" style="width: 16em;"/>
|
||||
<label for="savepath" class="leftLabelLarge">QBT_TR(Save files to location:)QBT_TR</label>
|
||||
<input type="text" id="savepath" name="savepath" style="width: 16em;"/>
|
||||
</div>
|
||||
<div class="formRow">
|
||||
<label for="cookie" class="leftLabelLarge">QBT_TR(Cookie:)QBT_TR</label>
|
||||
<input type="text" id="cookie" name="cookie" style="width: 16em;"/>
|
||||
<label for="cookie" class="leftLabelLarge">QBT_TR(Cookie:)QBT_TR</label>
|
||||
<input type="text" id="cookie" name="cookie" style="width: 16em;"/>
|
||||
</div>
|
||||
<div class="formRow">
|
||||
<label for="label" class="leftLabelLarge">QBT_TR(Label:)QBT_TR</label>
|
||||
<input type="text" id="label" name="label" style="width: 16em;"/>
|
||||
<label for="category" class="leftLabelLarge">QBT_TR(Category:)QBT_TR</label>
|
||||
<input type="text" id="category" name="category" style="width: 16em;"/>
|
||||
</div>
|
||||
<div id="submitbutton" style="margin-top: 12px; text-align: center;">
|
||||
<button type="submit" id="submitButton">QBT_TR(Download)QBT_TR</button>
|
||||
@@ -39,13 +39,13 @@
|
||||
var submitted = false;
|
||||
|
||||
$('downloadForm').addEventListener("submit", function() {
|
||||
$('download_spinner').style.display = "block";
|
||||
$('download_spinner').style.display = "block";
|
||||
submitted = true;
|
||||
});
|
||||
|
||||
$('download_frame').addEventListener("load", function() {
|
||||
if (submitted)
|
||||
window.parent.closeWindows();
|
||||
if (submitted)
|
||||
window.parent.closeWindows();
|
||||
});
|
||||
</script>
|
||||
<div id="download_spinner" class="mochaSpinner"></div>
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
<li id="errored_filter"><a href="#" onclick="setFilter('errored');return false;"><img src="images/skin/error.png"/>QBT_TR(Errored (0))QBT_TR</a></li>
|
||||
</ul>
|
||||
<br/>
|
||||
<span class="filterTitle">QBT_TR(Labels)QBT_TR</span>
|
||||
<ul id="filterLabelList" class="filterList">
|
||||
<span class="filterTitle">QBT_TR(Categories)QBT_TR</span>
|
||||
<ul id="filterCategoryList" class="filterList">
|
||||
</ul>
|
||||
|
||||
@@ -2,41 +2,41 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>QBT_TR(New Label)QBT_TR</title>
|
||||
<title>QBT_TR(New Category)QBT_TR</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
||||
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="scripts/mootools-1.2-more.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var newLabelKeyboardEvents = new Keyboard({
|
||||
var newCategoryKeyboardEvents = new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'enter': function (event) {
|
||||
$('newLabelButton').click();
|
||||
$('newCategoryButton').click();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
newLabelKeyboardEvents.activate();
|
||||
newCategoryKeyboardEvents.activate();
|
||||
|
||||
window.addEvent('domready', function() {
|
||||
$('newLabel').focus();
|
||||
$('newLabelButton').addEvent('click', function(e) {
|
||||
$('newCategory').focus();
|
||||
$('newCategoryButton').addEvent('click', function(e) {
|
||||
new Event(e).stop();
|
||||
// check field
|
||||
var labelName = $('newLabel').value.trim();
|
||||
if (labelName == null || labelName == "")
|
||||
var categoryName = $('newCategory').value.trim();
|
||||
if (categoryName == null || categoryName == "")
|
||||
return false;
|
||||
if (labelName.match("[\\\\/:?\"*<>|]") !== null) {
|
||||
alert("QBT_TR(Invalid label name:\nPlease do not use any special characters in the label name.)QBT_TR");
|
||||
if (categoryName.match("^([^\\\\\\/]|[^\\\\\\/]([^\\\\\\/]|\\/(?=[^\\/]))*[^\\\\\\/])$") === null) {
|
||||
alert("QBT_TR(Invalid category name:\nPlease do not use any special characters in the category name.)QBT_TR");
|
||||
return false;
|
||||
}
|
||||
var hashesList = new URI().getData('hashes');
|
||||
new Request({
|
||||
url: 'command/setLabel',
|
||||
url: 'command/setCategory',
|
||||
method: 'post',
|
||||
data: {
|
||||
hashes: hashesList,
|
||||
label: labelName
|
||||
category: categoryName
|
||||
},
|
||||
onComplete: function() {
|
||||
window.parent.closeWindows();
|
||||
@@ -48,10 +48,10 @@
|
||||
</head>
|
||||
<body>
|
||||
<div style="padding: 10px 10px 0px 10px;">
|
||||
<p style="font-weight: bold;">QBT_TR(Label)QBT_TR:</p>
|
||||
<input type="text" id="newLabel" value="" maxlength="100" style="width: 220px;"/>
|
||||
<p style="font-weight: bold;">QBT_TR(Category)QBT_TR:</p>
|
||||
<input type="text" id="newCategory" value="" maxlength="100" style="width: 220px;"/>
|
||||
<div style="text-align: center;">
|
||||
<input type="button" value="QBT_TR(Add)QBT_TR" id="newLabelButton"/>
|
||||
<input type="button" value="QBT_TR(Add)QBT_TR" id="newCategoryButton"/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
@@ -73,7 +73,7 @@
|
||||
<i>QBT_TR(Supported parameters (case sensitive):)QBT_TR
|
||||
<ul>
|
||||
<li>QBT_TR(%N: Torrent name)QBT_TR</li>
|
||||
<li>QBT_TR(%L: Label)QBT_TR</li>
|
||||
<li>QBT_TR(%L: Category)QBT_TR</li>
|
||||
<li>QBT_TR(%F: Content path (same as root path for multifile torrent))QBT_TR</li>
|
||||
<li>QBT_TR(%R: Root path (first torrent subdirectory path))QBT_TR</li>
|
||||
<li>QBT_TR(%D: Save path)QBT_TR</li>
|
||||
@@ -1263,19 +1263,19 @@ applyPreferences = function() {
|
||||
var json_str = JSON.encode(settings);
|
||||
|
||||
new Request({url: 'command/setPreferences',
|
||||
method: 'post',
|
||||
data: {'json': json_str,
|
||||
method: 'post',
|
||||
data: {'json': json_str,
|
||||
},
|
||||
onFailure: function() {
|
||||
alert("QBT_TR(Unable to save program preferences, qBittorrent is probably unreachable.)QBT_TR");
|
||||
window.parent.closeWindows();
|
||||
},
|
||||
onSuccess: function() {
|
||||
onSuccess: function() {
|
||||
// Close window
|
||||
window.parent.location.reload();
|
||||
window.parent.closeWindows();
|
||||
}
|
||||
}).send();
|
||||
window.parent.closeWindows();
|
||||
}
|
||||
}).send();
|
||||
};
|
||||
|
||||
loadPreferences();
|
||||
|
||||
@@ -38,21 +38,21 @@ var alternativeSpeedLimits = false;
|
||||
var queueing_enabled = true;
|
||||
var syncMainDataTimerPeriod = 1500;
|
||||
|
||||
var LABELS_ALL = 1;
|
||||
var LABELS_UNLABELLED = 2;
|
||||
var CATEGORIES_ALL = 1;
|
||||
var CATEGORIES_UNCATEGORIZED = 2;
|
||||
|
||||
var label_list = {};
|
||||
var category_list = {};
|
||||
|
||||
var selected_label = LABELS_ALL;
|
||||
var setLabelFilter = function(){};
|
||||
var selected_category = CATEGORIES_ALL;
|
||||
var setCategoryFilter = function(){};
|
||||
|
||||
var selected_filter = getLocalStorageItem('selected_filter', 'all');
|
||||
var setFilter = function(){};
|
||||
|
||||
var loadSelectedLabel = function () {
|
||||
selected_label = getLocalStorageItem('selected_label', LABELS_ALL);
|
||||
var loadSelectedCategory = function () {
|
||||
selected_category = getLocalStorageItem('selected_category', CATEGORIES_ALL);
|
||||
};
|
||||
loadSelectedLabel();
|
||||
loadSelectedCategory();
|
||||
|
||||
function genHash(string) {
|
||||
var hash = 0;
|
||||
@@ -103,10 +103,10 @@ window.addEvent('load', function () {
|
||||
resizeLimit : [100, 300]
|
||||
});
|
||||
|
||||
setLabelFilter = function(hash) {
|
||||
selected_label = hash;
|
||||
localStorage.setItem('selected_label', selected_label);
|
||||
highlightSelectedLabel();
|
||||
setCategoryFilter = function(hash) {
|
||||
selected_category = hash;
|
||||
localStorage.setItem('selected_category', selected_category);
|
||||
highlightSelectedCategory();
|
||||
if (typeof torrentsTable.table != 'undefined')
|
||||
updateMainData();
|
||||
};
|
||||
@@ -170,59 +170,59 @@ window.addEvent('load', function () {
|
||||
var syncMainDataLastResponseId = 0;
|
||||
var serverState = {};
|
||||
|
||||
var removeTorrentFromLabelList = function(hash) {
|
||||
var removeTorrentFromCategoryList = function(hash) {
|
||||
if (hash == null || hash == "")
|
||||
return false;
|
||||
var removed = false;
|
||||
Object.each(label_list, function(label) {
|
||||
if (Object.contains(label.torrents, hash)) {
|
||||
Object.each(category_list, function(category) {
|
||||
if (Object.contains(category.torrents, hash)) {
|
||||
removed = true;
|
||||
label.torrents.splice(label.torrents.indexOf(hash), 1);
|
||||
category.torrents.splice(category.torrents.indexOf(hash), 1);
|
||||
}
|
||||
});
|
||||
return removed;
|
||||
};
|
||||
|
||||
var addTorrentToLabelList = function(torrent) {
|
||||
var label = torrent['label'];
|
||||
if (label == null)
|
||||
var addTorrentToCategoryList = function(torrent) {
|
||||
var category = torrent['category'];
|
||||
if (category == null)
|
||||
return false;
|
||||
if (label.length === 0) { // Empty label
|
||||
removeTorrentFromLabelList(torrent['hash']);
|
||||
if (category.length === 0) { // Empty category
|
||||
removeTorrentFromCategoryList(torrent['hash']);
|
||||
return true;
|
||||
}
|
||||
var labelHash = genHash(label);
|
||||
if (label_list[labelHash] == null) // This should not happen
|
||||
label_list[labelHash] = {name: label, torrents: []};
|
||||
if (!Object.contains(label_list[labelHash].torrents, torrent['hash'])) {
|
||||
removeTorrentFromLabelList(torrent['hash']);
|
||||
label_list[labelHash].torrents = label_list[labelHash].torrents.combine([torrent['hash']]);
|
||||
var categoryHash = genHash(category);
|
||||
if (category_list[categoryHash] == null) // This should not happen
|
||||
category_list[categoryHash] = {name: category, torrents: []};
|
||||
if (!Object.contains(category_list[categoryHash].torrents, torrent['hash'])) {
|
||||
removeTorrentFromCategoryList(torrent['hash']);
|
||||
category_list[categoryHash].torrents = category_list[categoryHash].torrents.combine([torrent['hash']]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
var updateContextMenu = function () {
|
||||
var labelList = $('contextLabelList');
|
||||
labelList.empty();
|
||||
labelList.appendChild(new Element('li', {html: '<a href="javascript:newLabelFN();"><img src="theme/list-add" alt="QBT_TR(New...)QBT_TR"/> QBT_TR(New...)QBT_TR</a>'}));
|
||||
labelList.appendChild(new Element('li', {html: '<a href="javascript:updateLabelFN(0);"><img src="theme/edit-clear" alt="QBT_TR(Reset)QBT_TR"/> QBT_TR(Reset)QBT_TR</a>'}));
|
||||
var categoryList = $('contextCategoryList');
|
||||
categoryList.empty();
|
||||
categoryList.appendChild(new Element('li', {html: '<a href="javascript:newCategoryFN();"><img src="theme/list-add" alt="QBT_TR(New...)QBT_TR"/> QBT_TR(New...)QBT_TR</a>'}));
|
||||
categoryList.appendChild(new Element('li', {html: '<a href="javascript:updateCategoryFN(0);"><img src="theme/edit-clear" alt="QBT_TR(Reset)QBT_TR"/> QBT_TR(Reset)QBT_TR</a>'}));
|
||||
|
||||
var sortedLabels = []
|
||||
Object.each(label_list, function(label) {
|
||||
sortedLabels.push(label.name);
|
||||
var sortedCategories = []
|
||||
Object.each(category_list, function(category) {
|
||||
sortedCategories.push(category.name);
|
||||
});
|
||||
sortedLabels.sort();
|
||||
sortedCategories.sort();
|
||||
|
||||
var first = true;
|
||||
Object.each(sortedLabels, function(labelName) {
|
||||
var labelHash = genHash(labelName);
|
||||
var el = new Element('li', {html: '<a href="javascript:updateLabelFN(\'' + labelHash + '\');"><img src="theme/inode-directory"/> ' + labelName + '</a>'});
|
||||
Object.each(sortedCategories, function(categoryName) {
|
||||
var categoryHash = genHash(categoryName);
|
||||
var el = new Element('li', {html: '<a href="javascript:updateCategoryFN(\'' + categoryHash + '\');"><img src="theme/inode-directory"/> ' + categoryName + '</a>'});
|
||||
if (first) {
|
||||
el.addClass('separator');
|
||||
first = false;
|
||||
}
|
||||
labelList.appendChild(el);
|
||||
categoryList.appendChild(el);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -242,50 +242,50 @@ window.addEvent('load', function () {
|
||||
updateFilter('errored', 'QBT_TR(Errored (%1))QBT_TR');
|
||||
};
|
||||
|
||||
var updateLabelList = function() {
|
||||
var labelList = $('filterLabelList');
|
||||
if (!labelList)
|
||||
var updateCategoryList = function() {
|
||||
var categoryList = $('filterCategoryList');
|
||||
if (!categoryList)
|
||||
return;
|
||||
labelList.empty();
|
||||
categoryList.empty();
|
||||
|
||||
var create_link = function(hash, text, count) {
|
||||
var html = '<a href="#" onclick="setLabelFilter(' + hash + ');return false;">' +
|
||||
var html = '<a href="#" onclick="setCategoryFilter(' + hash + ');return false;">' +
|
||||
'<img src="theme/inode-directory"/>' +
|
||||
text + ' (' + count + ')' + '</a>';
|
||||
return new Element('li', {id: hash, html: html});
|
||||
};
|
||||
|
||||
var all = torrentsTable.getRowIds().length;
|
||||
var unlabelled = 0;
|
||||
var uncategorized = 0;
|
||||
Object.each(torrentsTable.rows, function(row) {
|
||||
if (row['full_data'].label.length === 0)
|
||||
unlabelled += 1;
|
||||
if (row['full_data'].category.length === 0)
|
||||
uncategorized += 1;
|
||||
});
|
||||
labelList.appendChild(create_link(LABELS_ALL, 'QBT_TR(All (0))QBT_TR'.replace(' (0)', ''), all));
|
||||
labelList.appendChild(create_link(LABELS_UNLABELLED, 'QBT_TR(Unlabeled (0))QBT_TR'.replace(' (0)', ''), unlabelled));
|
||||
categoryList.appendChild(create_link(CATEGORIES_ALL, 'QBT_TR(All (0))QBT_TR'.replace(' (0)', ''), all));
|
||||
categoryList.appendChild(create_link(CATEGORIES_UNCATEGORIZED, 'QBT_TR(Uncategorized (0))QBT_TR'.replace(' (0)', ''), uncategorized));
|
||||
|
||||
var sortedLabels = []
|
||||
Object.each(label_list, function(label) {
|
||||
sortedLabels.push(label.name);
|
||||
var sortedCategories = []
|
||||
Object.each(category_list, function(category) {
|
||||
sortedCategories.push(category.name);
|
||||
});
|
||||
sortedLabels.sort();
|
||||
sortedCategories.sort();
|
||||
|
||||
Object.each(sortedLabels, function(labelName) {
|
||||
var labelHash = genHash(labelName);
|
||||
var labelCount = label_list[labelHash].torrents.length;
|
||||
labelList.appendChild(create_link(labelHash, labelName, labelCount));
|
||||
Object.each(sortedCategories, function(categoryName) {
|
||||
var categoryHash = genHash(categoryName);
|
||||
var categoryCount = category_list[categoryHash].torrents.length;
|
||||
categoryList.appendChild(create_link(categoryHash, categoryName, categoryCount));
|
||||
});
|
||||
|
||||
highlightSelectedLabel();
|
||||
highlightSelectedCategory();
|
||||
};
|
||||
|
||||
var highlightSelectedLabel = function() {
|
||||
var labelList = $('filterLabelList');
|
||||
if (!labelList)
|
||||
var highlightSelectedCategory = function() {
|
||||
var categoryList = $('filterCategoryList');
|
||||
if (!categoryList)
|
||||
return;
|
||||
var childrens = labelList.childNodes;
|
||||
var childrens = categoryList.childNodes;
|
||||
for (var i in childrens) {
|
||||
if (childrens[i].id == selected_label)
|
||||
if (childrens[i].id == selected_category)
|
||||
childrens[i].className = "selectedFilter";
|
||||
else
|
||||
childrens[i].className = "";
|
||||
@@ -308,43 +308,43 @@ window.addEvent('load', function () {
|
||||
onSuccess : function (response) {
|
||||
$('error_div').set('html', '');
|
||||
if (response) {
|
||||
var update_labels = false;
|
||||
var update_categories = false;
|
||||
var full_update = (response['full_update'] == true);
|
||||
if (full_update) {
|
||||
torrentsTable.clear();
|
||||
label_list = {};
|
||||
category_list = {};
|
||||
}
|
||||
if (response['rid']) {
|
||||
syncMainDataLastResponseId = response['rid'];
|
||||
}
|
||||
if (response['labels']) {
|
||||
response['labels'].each(function(label) {
|
||||
var labelHash = genHash(label);
|
||||
label_list[labelHash] = {name: label, torrents: []};
|
||||
if (response['categories']) {
|
||||
response['categories'].each(function(category) {
|
||||
var categoryHash = genHash(category);
|
||||
category_list[categoryHash] = {name: category, torrents: []};
|
||||
});
|
||||
update_labels = true;
|
||||
update_categories = true;
|
||||
}
|
||||
if (response['labels_removed']) {
|
||||
response['labels_removed'].each(function(label) {
|
||||
var labelHash = genHash(label);
|
||||
delete label_list[labelHash];
|
||||
if (response['categories_removed']) {
|
||||
response['categories_removed'].each(function(category) {
|
||||
var categoryHash = genHash(category);
|
||||
delete category_list[categoryHash];
|
||||
});
|
||||
update_labels = true;
|
||||
update_categories = true;
|
||||
}
|
||||
if (response['torrents']) {
|
||||
for (var key in response['torrents']) {
|
||||
response['torrents'][key]['hash'] = key;
|
||||
response['torrents'][key]['rowId'] = key;
|
||||
torrentsTable.updateRowData(response['torrents'][key]);
|
||||
if (addTorrentToLabelList(response['torrents'][key]))
|
||||
update_labels = true;
|
||||
if (addTorrentToCategoryList(response['torrents'][key]))
|
||||
update_categories = true;
|
||||
}
|
||||
}
|
||||
if (response['torrents_removed'])
|
||||
response['torrents_removed'].each(function (hash) {
|
||||
torrentsTable.removeRow(hash);
|
||||
removeTorrentFromLabelList(hash);
|
||||
update_labels = true; // Allways to update All label
|
||||
removeTorrentFromCategoryList(hash);
|
||||
update_categories = true; // Allways to update All category
|
||||
});
|
||||
torrentsTable.updateTable(full_update);
|
||||
torrentsTable.altRow();
|
||||
@@ -355,8 +355,8 @@ window.addEvent('load', function () {
|
||||
processServerState();
|
||||
}
|
||||
updateFiltersList();
|
||||
if (update_labels) {
|
||||
updateLabelList();
|
||||
if (update_categories) {
|
||||
updateCategoryList();
|
||||
updateContextMenu();
|
||||
}
|
||||
}
|
||||
@@ -683,4 +683,4 @@ var loadTorrentPeersData = function(){
|
||||
updateTorrentPeersData = function(){
|
||||
clearTimeout(loadTorrentPeersTimer);
|
||||
loadTorrentPeersData();
|
||||
};
|
||||
};
|
||||
|
||||
@@ -452,7 +452,7 @@ var TorrentsTable = new Class({
|
||||
this.newColumn('upspeed', 'width: 100px', 'QBT_TR(Up Speed)QBT_TR');
|
||||
this.newColumn('eta', 'width: 100px', 'QBT_TR(ETA)QBT_TR');
|
||||
this.newColumn('ratio', 'width: 100px', 'QBT_TR(Ratio)QBT_TR');
|
||||
this.newColumn('label', 'width: 100px', 'QBT_TR(Label)QBT_TR');
|
||||
this.newColumn('category', 'width: 100px', 'QBT_TR(Category)QBT_TR');
|
||||
|
||||
this.columns['state_icon'].onclick = '';
|
||||
this.columns['state_icon'].dataProperties[0] = 'state';
|
||||
@@ -620,7 +620,7 @@ var TorrentsTable = new Class({
|
||||
};
|
||||
},
|
||||
|
||||
applyFilter : function (row, filterName, labelName) {
|
||||
applyFilter : function (row, filterName, categoryName) {
|
||||
var state = row['full_data'].state;
|
||||
var inactive = false;
|
||||
var r;
|
||||
@@ -662,13 +662,13 @@ var TorrentsTable = new Class({
|
||||
break;
|
||||
}
|
||||
|
||||
if (labelName == LABELS_ALL)
|
||||
if (categoryName == CATEGORIES_ALL)
|
||||
return true;
|
||||
|
||||
if (labelName == LABELS_UNLABELLED && row['full_data'].label.length === 0)
|
||||
if (categoryName == CATEGORIES_UNCATEGORIZED && row['full_data'].category.length === 0)
|
||||
return true;
|
||||
|
||||
if (labelName != genHash( row['full_data'].label) )
|
||||
if (categoryName != genHash(row['full_data'].category))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -679,7 +679,7 @@ var TorrentsTable = new Class({
|
||||
var rows = this.rows.getValues();
|
||||
|
||||
for (i = 0; i < rows.length; i++)
|
||||
if (this.applyFilter(rows[i], filterName, LABELS_ALL)) cnt++;
|
||||
if (this.applyFilter(rows[i], filterName, CATEGORIES_ALL)) cnt++;
|
||||
|
||||
return cnt;
|
||||
},
|
||||
@@ -690,7 +690,7 @@ var TorrentsTable = new Class({
|
||||
var rows = this.rows.getValues();
|
||||
|
||||
for (i = 0; i < rows.length; i++)
|
||||
if (this.applyFilter(rows[i], selected_filter, selected_label)) {
|
||||
if (this.applyFilter(rows[i], selected_filter, selected_category)) {
|
||||
filteredRows.push(rows[i]);
|
||||
filteredRows[rows[i].rowId] = rows[i];
|
||||
}
|
||||
|
||||
@@ -304,14 +304,14 @@ initializeWindows = function() {
|
||||
}
|
||||
};
|
||||
|
||||
newLabelFN = function () {
|
||||
newCategoryFN = function () {
|
||||
var h = torrentsTable.selectedRowsIds();
|
||||
if (h.length) {
|
||||
new MochaUI.Window({
|
||||
id: 'newLabelPage',
|
||||
title: "QBT_TR(New Label)QBT_TR",
|
||||
id: 'newCategoryPage',
|
||||
title: "QBT_TR(New Category)QBT_TR",
|
||||
loadMethod: 'iframe',
|
||||
contentURL: 'newlabel.html?hashes=' + h.join('|'),
|
||||
contentURL: 'newcategory.html?hashes=' + h.join('|'),
|
||||
scrollbars: false,
|
||||
resizable: false,
|
||||
maximizable: false,
|
||||
@@ -323,18 +323,18 @@ initializeWindows = function() {
|
||||
}
|
||||
};
|
||||
|
||||
updateLabelFN = function (labelHash) {
|
||||
var labelName = '';
|
||||
if (labelHash != 0)
|
||||
var labelName = label_list[labelHash].name;
|
||||
updateCategoryFN = function (categoryHash) {
|
||||
var categoryName = '';
|
||||
if (categoryHash != 0)
|
||||
var categoryName = category_list[categoryHash].name;
|
||||
var h = torrentsTable.selectedRowsIds();
|
||||
if (h.length) {
|
||||
new Request({
|
||||
url: 'command/setLabel',
|
||||
url: 'command/setCategory',
|
||||
method: 'post',
|
||||
data: {
|
||||
hashes: h.join("|"),
|
||||
label: labelName
|
||||
category: categoryName
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<input type="text" id="savepath" name="savepath" style="width: 16em;"/>
|
||||
</div>
|
||||
<div class="formRow">
|
||||
<label for="label" class="leftLabelLarge">QBT_TR(Label:)QBT_TR</label>
|
||||
<label for="label" class="leftLabelLarge">QBT_TR(Category:)QBT_TR</label>
|
||||
<input type="text" id="label" name="label"/ style="width: 16em;"/>
|
||||
</div>
|
||||
<div id="submitbutton" style="margin-top: 30px; text-align: center;">
|
||||
|
||||
Reference in New Issue
Block a user