Makes all the tables sortable
当前为
// ==UserScript==
// @name Reddit Table Sort
// @author sharadcodes
// @version 1.0.0
// @namespace https://sharadcodes.github.io
// @match *://*reddit.com/*
// @include https://*.reddit.com/*
// @include https://reddit.com/*
// @description Makes all the tables sortable
// @license MIT
// @grant none
// ==/UserScript==
(function() {
var JS_SCRIPTS = [
'https://sharadcodes.github.io/UserScripts/COMMON/js/libs/sortable.js'
]
JS_SCRIPTS.forEach(function(js_script) {
GM_xmlhttpRequest(
{
method: 'GET',
url: js_script + '?time=' + Date.now(),
onload: function(response) {
var custom_js_script = document.createElement('script');
custom_js_script.textContent = response.responseText
document.head.appendChild(custom_js_script);
document.querySelectorAll('table').forEach(function(table) {
table.setAttribute('data-sortable','');
table.querySelector('thead').style.cursor = 'pointer';
Sortable.init();
})
}
}
);
})
})();