')
historyResult.find('.change-link-container').append(container)
tasks.each(function() {
var tasknum = $(this).data('ijgTaskId')
var task = $('
').data('ijgTaskId', tasknum)
var link = $('
')
.text(tasknum)
.prop('href', 'http://tfs.sqlsentry.com:8080/tfs/DefaultCollection/SQLSentryWebsite/_workitems/edit/' + tasknum)
task.append(link)
container.append(task)
})
}
}
function fetchTaskLinks(historyResult) {
var base = window.location.origin + window.location.pathname.match(/^\/(.*?)\/(.*?)\//)[0]
var urls = {
changesetLinkedWorkItems: '_apis/tfvc/changesets/{}/workItems',
changesetInfo: '_apis/tfvc/changesets/{}',
apiVersion: '?api-version=1.0'
}
}
function spanifyText(historyResult) {
// wraps changeset/task IDs with spans so they can be targeted individually
// adds data to the newly-created spans
historyResult.find('.change-link').each(function() {
// commit messages may have either Tasks or Changesets
$(this).html($(this).text().replace(/[ct]\d{3,}/gi, function(match) {
var id = match.replace(/[ct]/gi, '')
if (match.startsWith('t')) {
historyResult.data('ijgTaskId', id)
return '' + match + ''
}
return '' + match + ''
}))
})
historyResult.find('.change-info').each(function() {
// '.history-result's will only have changesets, and they will not be prefixed with 'c'
$(this).html($(this).text().replace(/\d{3,}/gi, function(match) {
var changesetId = match.replace(/c/i, '')
return '' + match + ''
}))
})
}
function addCopyUtilities(historyResult) {
var $container = $('')
var changesetId = historyResult.find('.change-info').prop('title').match(/^\d{3,6}/)[0]
var url = historyResult.find('a.change-link').prop('href')
var formattedUrl = '[' + historyResult.find('a.change-link').text() + '](' + url + ')'
var message = createCommitMessage(historyResult, changesetId)
var button = $(' |