Mini review controller

Adds an ability to see the review queues by hovering "review" link

  1. // ==UserScript==
  2. // @name Mini review controller
  3. // @version 1.3
  4. // @description Adds an ability to see the review queues by hovering "review" link
  5. // @author nicael
  6. // @include *://*.stackexchange.com/*
  7. // @include *://*stackoverflow.com/*
  8. // @include *://*serverfault.com/*
  9. // @include *://*superuser.com/*
  10. // @include *://*askubuntu.com/*
  11. // @include *://*stackapps.com/*
  12. // @include *://*mathoverflow.net/*
  13. // @grant none
  14. // @namespace https://greasyfork.org/users/9713
  15. // ==/UserScript==
  16.  
  17.  
  18. //$(".help-dialog").hover(function(){alert($(this).css("left"))})
  19. $(".topbar-wrapper").append('<div class="topbar-dialog cfr" style="top: 34px; left: 650px; display: none;"><div class="modal-content crd" style="margin-top:-1px;"><ul><li><div><img src="/content/img/progress-dots.gif"></div></li></ul></div></div>');
  20. $(".topbar-menu-links > a[href='/review']:last").append('&nbsp;<span class="icon-help"><div class="triangle" style=""></div></span><tmp style="display:none"></tmp>')
  21.  
  22. $("tmp").load("/review .dashboard-num",function(){
  23. var stats=[];
  24. $("tmp > .dashboard-num").each(function(){
  25. stats.push($(this).text());
  26. });
  27. $("tmp").load("/review .dashboard-title > a",function(){$(".crd>ul>li").remove();
  28. $("tmp>a").each(function(index){
  29. if($(this).text()!="Meta Reviews"){
  30. $(".crd>ul").append('<li><div><span style="display:inline-block;width:20px;text-align:center;margin:2px;color:grey;">'+stats[index]+'</span>&nbsp;<a href="'+$(this).attr("href")+'">'+$(this).text()+'</a></div></li>');
  31. }else{
  32. $(".crd>ul").append('<li><div><span style="display:inline-block;width:20px;text-align:center;margin:2px;color:grey;"></span>&nbsp;<a href="'+$(this).attr("href")+'">'+$(this).text()+'</a></div></li>');
  33. }
  34. });
  35. });})
  36.  
  37.  
  38. $(".topbar-menu-links > a[href='/review']:last").hover(function(){$(this).addClass("topbar-icon-on").css({"color":"black"});$(".cfr").css({"display":"block"});})
  39. $(".cfr").hover(function(){$(".topbar-menu-links > a[href='/review']:last").addClass("topbar-icon-on").css({"color":"black"});$(".cfr").css({"display":"block"})})
  40. $(".topbar-menu-links > a[href='/review']:last").mouseleave(function(){$(this).removeClass("topbar-icon-on").css({"color":"#e0e0e0"});$(".cfr").css({"display":"none"})})
  41. $(".cfr").mouseleave(function(){$(".topbar-menu-links > a[href='/review']:last").removeClass("topbar-icon-on").css({"color":"#e0e0e0"});$(".cfr").css({"display":"none"})})