1. // ==UserScript==
  2. // @name GameMiner.ru border
  3. // @namespace http://userstyles.org
  4. // @description Cria uma borda
  5. // @author MurkBRA
  6. // @include http://gameminer.ru/*
  7. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
  8. // @require https://gist.github.com/raw/2625891/waitForKeyElements.js
  9. // @grant GM_addStyle
  10. // @version 0.1
  11. // ==/UserScript==
  12. startMain();
  13. function startMain() {
  14. var target = document.querySelector('.giveaways');
  15. var observer = new MutationObserver(function(mutations) {
  16. addEventListener();
  17. });
  18. var config = { childList: true,
  19. subtree: true};
  20. observer.observe(target, config);
  21. }
  22. //addEventListener();
  23. function addEventListener(){
  24. $('span.g-coal-icon').each(function(){
  25. if ($(this).html() == '1' | $(this).html() == '1 coal') {
  26. $(this).closest("div.giveaway.c-giveaway").css("border","4px solid yellow");
  27. }
  28. if($(this).html() == '0' | $(this).html() == '0 coal'){
  29. $(this).closest("div.giveaway.c-giveaway").css("border","4px solid red");
  30. }
  31. });
  32. }