Hide the Community Bulletin

Hides per-site meta links from Community Bulletin

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           Hide the Community Bulletin
// @author         Cameron Bernhardt (AstroCB)
// @version        3.0.1
// @namespace  https://github.com/AstroCB
// @description  Hides per-site meta links from Community Bulletin
// @include        http://*.stackexchange.com/*
// @include        http://stackoverflow.com/*
// @include        http://meta.stackoverflow.com/*
// @include        http://serverfault.com/*
// @include        http://meta.serverfault.com/*
// @include        http://superuser.com/*
// @include        http://meta.superuser.com/*
// @include        http://askubuntu.com/*
// @include        http://meta.askubuntu.com/*
// @include        http://stackapps.com/*
// ==/UserScript==
var cb = document.getElementsByClassName("spacer");
var clear = true;

if (cb) {
	var links = [];

	for (var i = 0; i < cb.length; i++) {
		if(cb[i].parentElement.className == "related"){
			links[i] = cb[i];
		}
	}
	for (var j = 0; j < links.length; j++) {
		if ((links[j].children[1].children[0].href.search(/meta\.stackexchange\.com/) === -1) && (links[j].children[1].children[0].href.search(/meta/) === 7)) {
			links[j].hidden = "hidden";
		}else{
			clear = false;
		}
	}
	if (clear){
		var bulletin = document.getElementsByClassName("community-bulletin")[0];
		bulletin.hidden = "hidden";
	}else{
		var title = document.getElementsByClassName("bulletin-title");
		var separators = document.getElementsByTagName("hr");

		for(var x = 0; x < title.length; x++){
			if(title[x].innerHTML.search(/\s*Hot Meta Posts\s*/) !== -1){
				title[x].hidden = "hidden";
				if(separators[x]){
					separators[x].hidden = "hidden";
				}
			}
		}
	}
}