Skip to content

Instantly share code, notes, and snippets.

@torufurukawa
Created July 3, 2012 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torufurukawa/3037041 to your computer and use it in GitHub Desktop.
Save torufurukawa/3037041 to your computer and use it in GitHub Desktop.
Redmine のチケットから、タイトル、URL、期日を取得する bookmarklet
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