Created
June 25, 2012 19:49
-
-
Save osa9/2990823 to your computer and use it in GitHub Desktop.
VimperatorのヒントからReadabilityの記事の削除
This file contains 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
" add Readability hints | |
js <<EOM | |
hints.addMode('d', 'delete article', function(elem) { | |
elem.getElementsByClassName('article-confirmDelete')[0].click(); | |
}, function() '//*[contains(@class,"article-box")]'); | |
EOM | |
" ,rlとかと統一性を持たせたい | |
nnoremap ,rd ;d | |
======追記====== | |
確認ダイアログあたりにも対応版。 | |
;d (,rd) → ヒントで記事を選択 → 下の方で本当に削除するか確認されるのでyかそのままEnterで削除 / nでキャンセル | |
" add Readability hints | |
js <<EOM | |
hints.addMode('d', 'delete article', function(elem) { | |
elem.getElementsByClassName('article-confirmDelete')[0].click(); | |
commandline.input("remove this article? [Y/n]", function(i) { | |
if(i == 'y' || i == '') | |
elem.getElementsByClassName('article-remove')[0].click(); | |
else | |
elem.getElementsByClassName('cancel-warning')[0].click(); | |
}); | |
}, function() '//*[contains(@class,"article-box")]'); | |
EOM | |
nnoremap ,rd ;d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
確認ダイアログ何とかした