Hack Forums Quick report box

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name            Hack Forums Quick report box
// @namespace       Snorlax
// @description     Pops up a report box instead of a window - updated by xadamxk
// @require         http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @include         *hackforums.net/showthread.php?tid=*
// @include 		*hackforums.net/report.php?pid=*
// @version         1.0.2
// ==/UserScript==

$('a[title*="Report this post"]').each(function(){
    $(this).click(function(){
        str = $(this).attr("href");
        postID = str.replace(/[^0-9]/g, '');
        $(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>");
        $("#closeWindow").click(function(){
            $(this).parent("div").hide();
        });
        return false;
    });
});

var url = window.location.href;
if (url.search("hackforums.net/report.php?") > 0) {
	$('a[href*="javascript"]').parent("div").hide();
}