Greasy Fork

Greasy Fork is available in English.

@-posting

Link to posts in the same 4chan thread with "@".

当前为 2015-08-24 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        @-posting
// @version     0.2.1.0
// @namespace   atposting
// @license     WTFPL
// @include     *://boards.4chan.org/g/*
// @run-at      document-end
// @grant       none
// @description Link to posts in the same 4chan thread with "@".
// ==/UserScript==
var twitterify = function(targets) {
	Array.prototype.forEach.call(targets, function(target) {
		target.innerHTML = target.innerHTML.replace(
			/@([0-9]+)/,
			'<a href="#p$1" class="quotelink">@$1</a>'
		);	
	});
};
var observer = new MutationObserver(function(mutations) {
	mutations.forEach(function(mutation) {
		twitterify(mutation.addedNodes);
	});
});
observer.observe(document.querySelector('.board .thread'), { attributes: true, childList: true });
twitterify(document.querySelectorAll('.postMessage'));