Greasy Fork is available in English.

Hack Forums Quick report box

Pops up a report box instead of a window - updated by xadamxk

  1. // ==UserScript==
  2. // @name Hack Forums Quick report box
  3. // @namespace Snorlax
  4. // @description Pops up a report box instead of a window - updated by xadamxk
  5. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
  6. // @include *hackforums.net/showthread.php?tid=*
  7. // @include *hackforums.net/report.php?pid=*
  8. // @version 1.0.2
  9. // ==/UserScript==
  10.  
  11. $('a[title*="Report this post"]').each(function(){
  12. $(this).click(function(){
  13. str = $(this).attr("href");
  14. postID = str.replace(/[^0-9]/g, '');
  15. $(this).after("<div style='position:absolute;z-index:10000;padding:5px;margin-top:-360px;background-color:#333333;border:5px ridge #000000;right:10%;'><iframe width='400px' height='300px' src='https://www.hackforums.net/report.php?pid="+postID+"'></iframe><br /><button class='button' id='closeWindow' style='float:right;'>Close</button></div>");
  16. $("#closeWindow").click(function(){
  17. $(this).parent("div").hide();
  18. });
  19. return false;
  20. });
  21. });
  22.  
  23. var url = window.location.href;
  24. if (url.search("hackforums.net/report.php?") > 0) {
  25. $('a[href*="javascript"]').parent("div").hide();
  26. }