twitter toLocaltime for new UI

Rewrite twitter timestamp to localtime for new UI.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           twitter toLocaltime for new UI
// @version        2.9b
// @namespace      http://twitter.com/inmoutan
// @auther         inmoutan
// @description    Rewrite twitter timestamp to localtime for new UI.
// @include        https://twitter.com/*
// @include        http://twitter.com/*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// ==/UserScript==


(function() {
	var filter = function(elem){
		$(elem).find('[class*=timestamp]').each(function(){
			if(!$(this).find('span.localtime').length){
				var data = $(this).attr('title');
				if(data!=null){
				$(this).append('<span class="localtime"> - '+data+'</span>');
				}
			}
		});
	}
	
	$.event.add(window, "load", function(){
		filter('.js-stream-tweet');
	});
	
	$(document).on("DOMNodeInserted", '.js-stream-tweet', function() {
		filter($(this));
	});

})();