Created
July 11, 2009 17:16
-
-
Save hitode909/145317 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name useful | |
// @namespace http://www.hatena.ne.jp/hitode909/ | |
// @description useful | |
// @include http://twitter.com/* | |
// @require http://code.jquery.com/jquery-latest.js | |
// ==/UserScript== | |
(function(){ | |
GM_registerMenuCommand('useful - clear cache', function () { | |
GM_setValue('read_posts', '{}'); | |
$('li.status').show('slow'); | |
}); | |
var read_posts = eval(GM_getValue('read_posts')); | |
if (typeof(read_posts) == 'undefined'){ | |
read_posts = {}; | |
} | |
var posts = $('li.status'); | |
console.log(posts.length); | |
// 前に消したやつを消す | |
for (var k in read_posts) if (read_posts.hasOwnProperty(k)) { | |
$('li.status#'+k).hide(); | |
} | |
// 消す | |
var setvalue = function(v){GM_setValue('read_posts',v)}; | |
posts.mouseover( | |
function(){ | |
$(this).hide('fast'); | |
read_posts[this.id] = true; | |
setvalue(uneval(read_posts)); | |
} | |
); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment