name: ResolveAndClose
description: Adds a resolve and close button to the side of bugs when you hover
author: Jervis
version: 1.0.0.0
js:
var TOKEN = 'YOURTOKENHERE';
var API = 'https://example.fogbugz.com/api.asp';
var resolve = function(elem) {
// mark this bugzId as resolved and closed.
var parentRow = $(elem).closest('[ix]');
var bugzId = parseInt(parentRow.attr('ix'));
$.get(API, {'cmd': 'resolve', 'ixBug': bugzId, 'token': TOKEN, 'ixStatus': 0})
.success(function() {
$.get(API, {'cmd': 'close', 'ixBug': bugzId, 'token': TOKEN})
.success(function() {parentRow.css({'display': 'none'})}).error(function() {alert("didn't resolve or close")});
}).error(function() {alert("didn't resolve or close")});
}
$('body').on('mouseenter', '[ix]', function() {
$(this).find('td#r-s').html('<a class="dotted j-resolve" href="#" >Resolve & Close</a>')
$(this).find('a.j-resolve').click(function() {resolve(this); return false});
}).on('mouseleave', '[ix]', function() {$(this).find('td#r-s').html('');});
css:
/* body { background-color: red !important; } */
API: Change the domain name here to match your fogbugz account. A good way to check is to look at what the domain is when you are logged into your fogbugz account. For example. If your account domain is "
icecream.fogbugz.com" then your API variable will be:
var API = 'https://example.fogbugz.com/api.asp'