Last active
August 7, 2019 03:54
-
-
Save yogin/fcf60ad5e7737e5450ed926c3738b01a to your computer and use it in GitHub Desktop.
TORN UserScript: Friendly Faction Give To User
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name TORN - Friendly Faction Give To User | |
// @description Removes the background bars in the Faction's Give To User tab, so it is easier to read and search for members | |
// @version 0.4 | |
// @author Sekor [2170311] | |
// @namespace https://github.com/yogin | |
// @homepage https://gist.github.com/yogin/fcf60ad5e7737e5450ed926c3738b01a | |
// @match https://www.torn.com/factions.php?step=your* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var $ = window.jQuery; | |
// Tabs are loaded asynchronously, and navigation is done using url anchors | |
// For these reasons, we need to periodically check if the page contains depositors | |
// This is not ideal as it could consume cpu resources for no reason | |
setInterval(function() { | |
$(".userlist-wrapper .user-info-list-wrap .depositor a.user.name img").each(function(idx, el) { | |
var user = $(el).attr("alt"); | |
$(el).replaceWith("<span alt=\""+user+"\" title=\""+user+"\">"+user.replace(/\s+\[\d+\]$/g,"")+"</span>"); | |
}); | |
}, 1500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment