nhorquender

company recuitment

May 1st, 2020
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Recuit2
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://www.torn.com/page.php?*
  8. // @grant none
  9. // ==/UserScript==
  10. (function() {
  11. 'use strict';
  12.  
  13. jQuery.expr[':'].regex = function(elem, index, match) {
  14. var matchParams = match[3].split(','),
  15. validLabels = /^(data|css):/,
  16. attr = {
  17. method: matchParams[0].match(validLabels) ?
  18. matchParams[0].split(':')[0] : 'attr',
  19. property: matchParams.shift().replace(validLabels,'')
  20. },
  21. regexFlags = 'ig',
  22. regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
  23. return regex.test(jQuery(elem)[attr.method](attr.property));
  24. }
  25. var listObserver = new MutationObserver(function(mutations) {
  26. mutations.forEach(function(mutation) {
  27. //hides faction status
  28. /*
  29. $("li:regex(id,icon9__[.]*)").parent().parent().parent().parent().parent().hide() //hides already in a faction (shows leader and co)
  30. $("li:regex(id,icon74__[.]*)").parent().parent().parent().parent().parent().hide() //hides leader or coleader
  31. */
  32. //hides company status
  33. $("li:regex(id,icon27__[.]*)").parent().parent().parent().parent().parent().hide() //hides company employee
  34. $("li:regex(id,icon73__[.]*)").parent().parent().parent().parent().parent().hide() //hides company director
  35. //$("li #icon23").parent().parent().parent().parent().parent().show() //show medical
  36. });
  37. });
  38. listObserver.observe($('.user-info-list-wrap')[0], { attributes: true, childList: true, characterData: true });
  39. })();
Add Comment
Please, Sign In to add comment