Gaia Online PM improvements

Improves PMs on Gaia in a few different ways.

目前为 2014-08-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Gaia Online PM improvements
  3. // @namespace http://mathemaniac.org
  4. // @version 1.1
  5. // @description Improves PMs on Gaia in a few different ways.
  6. // @match http://www.gaiaonline.com/profile/privmsg.php*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js
  8. // @copyright 2012, Sebastian Paaske Tørholm
  9. // ==/UserScript==
  10.  
  11. // Downloaded from http://userscripts.org/scripts/show/137486
  12.  
  13. $('#erroroutput.msgbad').each( function (i, e) {
  14. //$('#entry_form').attr('action', $('#entry_form').attr('action') + '?auto=1');
  15. var cnt = 50;
  16. var username = $('#username').attr('value');
  17. var i = setInterval(function () {
  18. if (cnt > 0) {
  19. $(e).text("Autosending in " + cnt + " seconds.");
  20. $('title').text(username + ': ' + cnt + " seconds.");
  21. cnt--;
  22. } else {
  23. $(e).text("Autosending now...");
  24. clearInterval(i);
  25. $('title').text(username + ': Sending...');
  26. $('#selected_options').attr('value', 'post');
  27. $('#entry_form').submit();
  28. }
  29. }, 1000);
  30. } );
  31.  
  32. $('button#btn_delete').each( function (i, e) {
  33. $(e).after('<a href="#" id="select_read" style="padding-left: 1em; padding-right: 1em;">Select replied</a>');
  34. $('#select_read').click( function (ev) {
  35. $('tr').each( function (i, e) {
  36. $('input[type="checkbox"]', e).attr('checked', $('img[alt="Replied Message"]', e).length > 0);
  37. });
  38. ev.preventDefault();
  39. } );
  40. } );
  41.  
  42. $('div.mainError div.errorHead').each( function (i, e) {
  43. if ($.trim($(e).text()) != "Information") { return; }
  44.  
  45. if (("" + document.location).match(/folder=inbox/)) {
  46. document.location = "http://www.gaiaonline.com/profile/privmsg.php?folder=inbox";
  47. } else {
  48. // TODO: Make it close window on sent message.
  49. // window.close();
  50. }
  51. });
  52.  
  53. (function () {
  54. // Hide quotes more than 10 levels deep.
  55. var levels = 10;
  56. var selector = "";
  57. for (var i = 0; i < levels; i++) {
  58. selector += 'td.quote ';
  59. }
  60. var first = $(selector + 'table').first();
  61.  
  62. first.css({'display': 'none'});
  63. first.before('<a id="mathemaniac_show_deeply_nested" href="#">Show hidden quotes.</a>');
  64. var nestlink = $('#mathemaniac_show_deeply_nested');
  65. nestlink.css({
  66. 'display': 'block',
  67. 'border': '1px solid red',
  68. 'padding': '0.25em',
  69. 'margin': '0.25em',
  70. 'text-align': 'center'
  71. });
  72. nestlink.click( function (ev) {
  73. nestlink.remove();
  74. first.css({'display': 'inherit'});
  75. ev.preventDefault();
  76. });
  77. })();