您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Sort changes by id, not last update date, in Gerrit
// ==UserScript== // @name Gerrit sort changes // @namespace http://tampermonkey.net/ // @version 0.1 // @description Sort changes by id, not last update date, in Gerrit // @author Adrien Destugues <[email protected]> // @match https://review.haiku-os.org/* // @grant none // @run-at context-menu // ==/UserScript== (function() { 'use strict'; function sortTable(table, col) { var rows = Array.prototype.slice.call(table.getElementsByTagName('gr-change-list-item'), 0); rows.sort(function(a,b) { return getRowValue(a, col) - getRowValue(b, col); }); for (var i=0, row; row = rows[i]; i++) { table.appendChild(row); } function getRowValue(row, col) { return parseInt(row.getElementsByClassName(col)[0].children[0].innerHTML, 10); } } var table = document.getElementById("changeList"); sortTable(table, "number"); })();