Mini review controller

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

目前为 2015-03-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Mini review controller
  3. // @version 1.1
  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. $(".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>');
  18. $(".topbar-menu-links > a[href='/review']").append('&nbsp;<span class="icon-help"><div class="triangle" style=""></div></span><tmp style="display:none"></tmp>')
  19.  
  20. $("tmp").load("/review .dashboard-num",function(){
  21. var stats=[];
  22. $("tmp > .dashboard-num").each(function(){
  23. stats.push($(this).text());
  24. });
  25. $("tmp").load("/review .dashboard-title > a",function(){$(".crd>ul>li").remove();
  26. $("tmp>a").each(function(index){
  27. if($(this).text()!="Meta Reviews"){
  28. $(".crd>ul").append('<li><div><span style="display:inline-block;width:15px;text-align:center;margin:2px;color:grey;">'+stats[index]+'</span>&nbsp;<a href="'+$(this).attr("href")+'">'+$(this).text()+'</a></div></li>');
  29. }
  30. });
  31. });})
  32.  
  33.  
  34. $(".topbar-menu-links > a[href='/review']").hover(function(){$(this).addClass("topbar-icon-on").css({"color":"black"});$(".cfr").css({"display":"block"});})
  35. $(".cfr").hover(function(){$(".topbar-menu-links > a[href='/review']").addClass("topbar-icon-on").css({"color":"black"});$(".cfr").css({"display":"block"})})
  36. $(".topbar-menu-links > a[href='/review']").mouseleave(function(){$(this).removeClass("topbar-icon-on").css({"color":"#e0e0e0"});$(".cfr").css({"display":"none"})})
  37. $(".cfr").mouseleave(function(){$(".topbar-menu-links > a[href='/review']").removeClass("topbar-icon-on").css({"color":"#e0e0e0"});$(".cfr").css({"display":"none"})})