Last active
August 29, 2015 14:10
-
-
Save Qofar/5a21e768268b56a8c4ed to your computer and use it in GitHub Desktop.
TweetDeckで簡易既読管理するUserScript vキー押下でツイートが非表示になるだけ shift+vキーで非表示解除
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 Tweetdeck Show/Hide Tweet | |
// @include https://tweetdeck.twitter.com/* | |
// @version 1.0 | |
// @license MIT License | |
// ==/UserScript== | |
(function() { | |
var KEY_CODE = 86; | |
function showTweet(e) { | |
var articles = document.querySelectorAll('article.stream-item.js-stream-item'); | |
for (var i = 0, length = articles.length; i < length; i++) { | |
// articles[i].style.display = e ? 'block' : 'none'; | |
articles[i].style.visibility = e ? 'visible' : 'hidden'; | |
} | |
}; | |
document.documentElement.addEventListener('keydown', function(e) { | |
if (e.keyCode === KEY_CODE && !e.ctrlKey && !e.altKey && !e.metaKey && !/^input|^textarea/i.test(e.target.tagName)) { | |
showTweet(e.shiftKey); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment