Created
January 30, 2011 07:03
-
-
Save dafi/802637 to your computer and use it in GitHub Desktop.
Press F2 to add the current google reader entry title to tags
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
/** | |
* Author: Davide Ficano https://github.com/dafi | |
* Greader Auto Tagger from current entry title | |
* While you are on google reader press F2, the tag input box will open containing the | |
* current tags for current entry plus the title | |
*/ | |
javascript:window.addEventListener('keydown', function(event) { | |
// F2 key | |
var isValidKey = event.keyCode == 113; | |
if (!isValidKey) { | |
return; | |
} | |
var currentEntry = document.getElementById('current-entry'); | |
var title = document.querySelector('#current-entry .entry-title-link').firstChild.nodeValue; | |
var tag = document.querySelector('#current-entry .entry-tagging-action-title'); | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, | |
0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
tag.dispatchEvent(evt); | |
setTimeout(function() { | |
document.querySelector('.tags-edit-tags').value += title; | |
}, 10); | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment