WebUI: Implement subcategories

PR #18740.
This commit is contained in:
Bartu Özen 2023-04-02 11:02:22 +03:00 committed by GitHub
parent 40e28930a4
commit b55d4b1733
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 86 additions and 7 deletions

View file

@ -66,6 +66,7 @@ let renameFilesFN = function() {};
let torrentNewCategoryFN = function() {};
let torrentSetCategoryFN = function() {};
let createCategoryFN = function() {};
let createSubcategoryFN = function() {};
let editCategoryFN = function() {};
let removeCategoryFN = function() {};
let deleteUnusedCategoriesFN = function() {};
@ -604,6 +605,25 @@ const initializeWindows = function() {
updateMainData();
};
createSubcategoryFN = function(categoryHash) {
const action = "createSubcategory";
const categoryName = category_list[categoryHash].name + "/";
new MochaUI.Window({
id: 'newSubcategoryPage',
title: "QBT_TR(New Category)QBT_TR[CONTEXT=CategoryFilterWidget]",
loadMethod: 'iframe',
contentURL: new URI("newcategory.html").setData("action", action).setData("categoryName", categoryName).toString(),
scrollbars: false,
resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
width: 400,
height: 150
});
updateMainData();
};
editCategoryFN = function(categoryHash) {
const action = "edit";
const categoryName = category_list[categoryHash].name;