Created
July 3, 2012 01:56
-
-
Save torufurukawa/3037041 to your computer and use it in GitHub Desktop.
Redmine のチケットから、タイトル、URL、期日を取得する bookmarklet
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
javascript:( | |
function(){ | |
var url = document.location.toString(); | |
var title_start_pattern = /(#.+)/; | |
var title_end_pattern = /- [^-]+ - Redmine/; | |
document.title.match(title_start_pattern); | |
RegExp.lastMatch.match(title_end_pattern); | |
var title = RegExp.leftContext; | |
var elements = document.getElementsByClassName('due-date'); | |
var due = elements[1].firstChild.nodeValue; | |
alert(title + '\n' + url + '\n' + due); | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment