hg serveで表示しているhg annotateの結果を強調表示するbookmarklet

実行するとリビジョン番号を聞いてくるので、
数字を入れると、その次以降のリビジョン番号の行のみ強調表示する。

javascript:(function%20(options)%20{var%20s=document.createElement('script');var%20head=document.getElementsByTagName('head')[0];var%20done=false;s.charset='UTF-8';s.language='javascript';s.type='text/javascript';s.src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js';s.onload=s.onreadystatechange=function%20()%20{if%20(!done%20&&%20(!this.readyState%20||%20this.readyState=='loaded'%20||%20this.readyState=='complete'))%20{done=true;head.removeChild(s);var%20rev=window.prompt('\u30EC\u30D3\u30E5\u30FC\u6E08\u307F\u306E\u30EA\u30D3\u30B8\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044');var%20$=jQuery;$('.annotate').filter(function%20(i)%20{return%20$(this).find('a').text().split('@')[1]-0%20>%20rev;}).parent().css('background-color',%20'yellow');}};head.appendChild(s);})();


手抜きソース

(function(options){
	var s=document.createElement('script');
	var head = document.getElementsByTagName('head')[0];
	var done = false;
	s.charset='UTF-8';
	s.language='javascript';
	s.type='text/javascript';
	s.src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js';
	s.onload = s.onreadystatechange = function(){
		if ( !done && (!this.readyState ||
				this.readyState == "loaded" || this.readyState == "complete") ) {
			done = true;
			head.removeChild( s );
            var rev = window.prompt('レビュー済みのリビジョンを指定してください');
            var $ = jQuery;
            $('.annotate').filter(function(i){ return $(this).find('a').text().split('@')[1]-0 > rev;}).parent().css('background-color','yellow');
		}
	};
	head.appendChild(s);
})();