Bugmenot Button 2015

Adds menu button that opens the Bugmenot user/password page for the current site you are visiting.

当前为 2021-08-10 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Bugmenot Button 2015
  3. // @namespace BB2014
  4. // @version 3.0.1
  5. // @description Adds menu button that opens the Bugmenot user/password page for the current site you are visiting.
  6. // @run-at document-start
  7. // @include *
  8. // @include http://bugmenot.com/*
  9. // @grant GM_registerMenuCommand
  10. // @author drhouse
  11. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  12. // @require https://cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/tinysort/2.2.2/tinysort.min.js
  14. // @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js
  15. // @icon http://bugmenot.com/favicon.ico
  16. // ==/UserScript==
  17.  
  18. GM_registerMenuCommand("BugMeNot Button", function() {
  19. location.replace("javascript:("+ function() {
  20. window.open('http://www.bugmenot.com/view/'+window.location.host+'#content', '_blank', 'width=500,height=400,menu=no');
  21. } + ")()");
  22. });
  23.  
  24.  
  25. if (location.href.toString().indexOf("bugmenot.com") != -1) {
  26. $(document).ready(function () {
  27.  
  28. function formatDate(d) {
  29. var dd = d.getDate();
  30. var mm = d.getMonth()+1;
  31. var yy = d.getFullYear() % 100;
  32. yy = 2000 + yy;
  33.  
  34. return yy+'-'+mm+'-'+dd;
  35. }
  36.  
  37. $("#content > article > dl > dd.stats > ul > li:nth-child(3)").text(function(index, text) {
  38. var x = text.replace('old', 'ago');
  39. x = x.replace(x, Date.parse(x));
  40. x = x.replace('(Eastern Daylight Time)', '');
  41. x = x.replace('(Eastern Standard Time)', '');
  42. var d = new Date(x);
  43. return x.replace(x,formatDate(d));
  44. });
  45.  
  46. a = $('#share-it').detach();
  47. b = $('#content > h2').detach();
  48. c = $('#content > ul').detach();
  49. d = $('#page > footer').detach();
  50.  
  51. tinysort.defaults.order = 'desc';
  52. tinysort('#content > article ',{selector:'#content > article > dl > dd.stats > ul > li:nth-child(3)'});
  53.  
  54. a.appendTo("#content");
  55. b.appendTo("#content");
  56. c.appendTo("#content");
  57. d.appendTo("#content");
  58.  
  59. $("#content > article > dl > dd.stats > ul > li:nth-child(3)").text(function(index, text) {
  60. var day = new Date(text);
  61. var dayWrapper = moment(day).fromNow();
  62. return text.replace(text, dayWrapper) + ' | ' + text;
  63. });
  64.  
  65. });
  66. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址