V2EX助手

V2EX助手,将v2ex.com的帖子超链接改为新窗口打开

Verze ze dne 13. 09. 2016. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         V2EX助手
// @namespace    http://zhihaofans.com
// @version      0.4.1
// @description  V2EX助手,将v2ex.com的帖子超链接改为新窗口打开
// @author       zhihaofans
// @match        *://www.v2ex.com/*
// @grant        none
// @icon		 https://www.v2ex.com/static/img/icon_rayps_64.png
// ==/UserScript==
$(document).ready(function(){
	var nowurl=location.pathname;
	if(nowurl=="/" || nowurl.substr(0,6)=="/?tab=" || nowurl.substr(0,4)=="/go/" ){
		$("span.item_title a").attr("target","_blank");
	}
	if(nowurl.substr(0,3)=="/t/"){
		$("a[rel=nofollow]").attr("target","_blank");
		$(".inner a").attr("target","_blank");
		$(".inner:first a").removeAttr("target");
		var lzname=$(".header .gray a").text();
		var replynum=$("div.cell[id^=r_] strong a").length;
		console.log(replynum);
		for(var aa=0;aa<replynum;aa++){
			console.log($("div.cell[id^=r_]:eq("+aa+") strong a").text());
			if($("div.cell[id^=r_]:eq("+aa+") strong a").text()==lzname){
				$("div.cell[id^=r_]:eq("+aa+") strong").html($("div.cell[id^=r_]:eq("+aa+") strong").html()+"&nbsp;[楼主]");
			}
		}
	}
});