javascript: (function ($) {
var storyTitles = [];
var stories = $('div.story .selector.selected').closest('.story');
var collapsed = true;
if (stories.length == 0) {
stories = $('div.story .details').closest('.story');
collapsed = false;
}
stories.each(function () {
var story = $(this);
var title = (collapsed ? story.find('.story_name').text() : story.find('.editor.name').val());
var id = /story_(\d+)/.exec(story.attr('class'))[1];
var gitptTitle = '[#' + id + '] ' + title;
if (storyTitles.indexOf(gitptTitle) == -1) {
storyTitles.push(gitptTitle);
}
});
if (storyTitles.length > 0) {
prompt('Your commit message:', storyTitles.join('; '));
} else {
alert("Please select the stories first.");
}
})(jQuery);
Posted by Christoph Beck to BitCrowd (2014-03-03 15:20)