NGU Shout Mod

NGU Shout Box Plugin that adds shout editing and deleting features

  1. // ==UserScript==
  2. // @name NGU Shout Mod
  3. // @namespace http://www.nextgenupdate.com
  4. // @description NGU Shout Box Plugin that adds shout editing and deleting features
  5. // @include /^https?:\/\/www\.nextgenupdate\.com\/forums\/infernoshout\.php\?do=detach$/
  6. // @include /^https?:\/\/www\.nextgenupdate\.com\/forums\/(forumhome|index)\.php$/
  7. // @include /^https?:\/\/www\.nextgenupdate\.com\/forums.?.?$/
  8. // @version 2.0
  9. // @grant none
  10. // ==/UserScript==
  11. $(document).ready(function() {
  12. var t = document.getElementsByClassName("btn btn-default btn-sm shoutbox_editor_send");
  13. sbAddButton = '<button id="MassWhisper" class="btn btn-default btn-sm shoutbox_editor_send" type="button">Mass Whisper</button>';
  14. t[0].outerHTML += sbAddButton;
  15. t = document.getElementsByClassName("col-xs-5 col-md-6 col-lg-5 shoutbox_editor_controls");
  16. sbAddButton = '<button id="JimErase" class="hidden-xs hidden-sm btn btn-default btn-sm sb-btn" type="button">JimErase</button>', sbAddButton += ' <button id="EditShouts" class="bhidden-xs hidden-sm btn btn-default btn-sm sb-btn" type="button">Edit Shouts</button>', t[0].innerHTML += sbAddButton
  17. }), $("#JimErase").click(function() {
  18. $("[ondblclick]").each(function() {
  19. iboxoshouts.shout.ajax.send("infernoshout.php", "do=doeditshout&shoutid=" + $(this).attr("ondblclick").slice(41, -2) + "&shout=&delete=1")
  20. })
  21. }), $("#EditShouts").click(function() {
  22. var t = prompt("Enter new message!", "");
  23. null != t && $("[ondblclick]").each(function() {
  24. iboxoshouts.shout.ajax.send("infernoshout.php", "do=doeditshout&shoutid=" + $(this).attr("ondblclick").slice(41, -2) + "&shout=" + t)
  25. })
  26. }), $("#MassWhisper").click(function() {
  27. var t = prompt("Enter the usernames or userids of the people to whisper, seperate them with a comma ','", "");
  28. var f = prompt("Enter the message you want to send.", "");
  29. var i = 0;
  30. function myLoop () {
  31. var split = t.split(',')
  32. setTimeout(function () {
  33. var formData = new FormData();
  34. formData.append("do", "shout");
  35. formData.append("message", "/pm " + split[i] + ";" + f);
  36. formData.append("securitytoken", SECURITYTOKEN);
  37. $.ajax({
  38. url: "infernoshout.php",
  39. type: "POST",
  40. data: formData,
  41. processData: false,
  42. contentType: false,
  43. cache: false,
  44. success: function (html) {
  45. console.log("ass");
  46. },
  47. });
  48. i++;
  49. if (i < split.length) {
  50. myLoop();
  51. }
  52. }, 4000)
  53. }
  54. myLoop();
  55. });