Guest User

Подсветка ответов ((You)) для синча

a guest
Sep 13th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.98 KB | None | 0 0
  1. // ==UserScript==
  2. // @name         Подсветка ответов ((You)) для синча
  3. // @version      0.1
  4. // @description  none
  5. // @author       (You)
  6. // @match       *://syn-ch.com/*
  7. // @exclude      *catalog*
  8. // @grant        none
  9. // @version     1.3
  10. // @require     http://code.jquery.com/jquery-1.11.1.min.js
  11. // @run-at      document-end
  12. // ==/UserScript==
  13. $(document).ready(
  14.     function() {
  15.         $('body').append('<input id="de-highlight-you" type="button" value="Найти ответы">');
  16.         var button=document.getElementById("de-highlight-you");
  17.         button.onclick=function(){
  18.             var posts = document.querySelectorAll('.post.reply');
  19.             for (var i = 0; i < posts.length; i++){
  20.                 if(posts[i].querySelectorAll('.de-ref-my').length > 0)
  21.                     posts[i].style.backgroundColor = '#9FE89F';
  22.             }
  23.             highlightPosts(); // Call after fetching and displaying new posts.
  24.         };
  25.     });
Advertisement
Add Comment
Please, Sign In to add comment