您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Sort directories before files in repository tree view
A user script designed to sort directories before files in the repository tree view on git.sr.ht.
Once installed, the script will automatically sort directories before files whenever you're viewing the tree on git.sr.ht.
The script uses the following logic to sort the tree list:
Identify Tree List:
const tree_list = document.querySelector(".tree-list");
Classify Nodes:
.name
to categorize them into directories (trees
) and files (blobs
).Sorting Mechanism:
trees
and blobs
to sort the children of tree_list
with directories prioritized.Reordering:
tree_list
.This script is released under the GPL-3.0 License.