35

28

Bug-monkey scripts probably don't qualify as full plug-ins on their own right and probably don't belong in the plug-in gallery, but it would be nice to have a centralized repository of BugMonkey scripts/css where people can share them

Since they are essentially just text blocks, I though I'd open a Question on here where people could post their scripts and/or vote on the best ones.

Michael: If you had other ideas for another place to do this, please let me know and I'll delete this post.

flag
2 
Seems fine to me! – Michael Pryor Sep 16 2009 at 17:29
show 1 more comment

116 Answers

1 2 3 4 next
2

Here's what we're currently working on. This is very much a work in progress and we've got a more planned.

Some notes:

  • Adjusted the width of the case so that it fills 1/2 of a standard 22" widescreen monitor (950px), yay Windows 7!
  • Removed the dark blue borders from the header strip
  • Made some fonts bigger & more readable, replaced excessive Verdana use with some Arial (personal preference)
  • Changed the bug grid colors to be a little less overwhelming and more Gmail-y

Here's the code (just the CSS field in BugMonkey):

a.vb{color: #0F5491 !important}
a.uvb{font-weight:bold !important}
#mainArea,#mainAreaContinued{font-size:10pt !important}
.changes{padding: 0 !important}
#idContainer{width: 90% !important}
#www-fogcreek-com-fogbugz,#mainArea{font-family:Arial;}

.buttonbar {width: 100% !important}

div.bugShadowBottom {width: 100% !important; max-width: 79em;}
#bugviewContainer {width: 100% !important}
#bugviewContainer .top .ixBug {width:13em !important}
#bugviewContainer .top .idTitleProjectAndArea {margin-left:13.5em !important}
#bugviewContainer .side {width:13em !important}
#bugviewContainer .bugevents {margin-left:14em !important}
#bugviewContainer .bugevents .bugevent .body textarea { width:99% !important}
#BugFields, #BugMeta {width:100% !important}
div.emailHeaderName {font-family:arial !important; font-size:8pt !important; color:#555 !important;}
div.emailHeaderValue {font-family:arial !important; font-size:8pt !important; color:#555 !important;}
div.emailBody {font-size:10pt !important; padding:12px 10px !important;}

#bugviewContainer .top .row1 {width: 49.3em !important;} 
#bugviewContainer .top .row2, 
#bugviewContainer .top .row3, 
#bugviewContainer .top .rowPlugin {width: 15.5em !important} 
#bugviewContainer .top .row2 input,
#bugviewContainer .top .row3 input,
#bugviewContainer .top .rowPlugin input {width: 17em !important}
#bugviewContainer .top .plugins.edit {margin-left:0em !important; clear:left; width:100% !important;}
#bugviewContainer .top .title {font-size:1.5em !important;}
.bugTopItem3 {width: 99% !important}

#bugviewContainer .bugevents .bugevent .summary .action {font-size:10pt !important;}
#bugviewContainer .bugevents .bugevent .changes {font-size:10pt !important;}

#banner {border-top: 2px solid #E0E9F1 !important; border-bottom: 2px solid #E0E9F1 !important; }

.bugs tbody tr td {font-size:12px !important; color:#888 !important; }
.bugs tbody tr td a {text-decoration:none !important; }
.bugs tbody tr td a:hover {text-decoration:underline !important; }

#mainArea #bugGrid .g-r-context td a { color: #999 !important; } 
#mainArea #bugGrid .g-r-context td a.dotted { border-bottom: 1px dotted #999 !important;}
link|flag
1 
note: 7.3 introduces re-sizable case view. You can click and drag the little handles to change the width. – adambox May 17 2010 at 18:49
show 1 more comment
7

Here's some sample javascript which can be used to replace text in bug events. I'm currently using this for creating links and replacing long urls with shorter ones within bug events.

In this sample there are two objects which I use as a poor man's replacement for hashes:

  • aRegExps contains regular expressions to match in the text of the bug event
  • aReplacements contains the replacement texts for the corresponding regexps

What these replacements do:

  • svnlink - This replaces a string in the form of SVN#revision with a link to our svn viewVC server
  • shortenlink - Replaces a very long url (we have a lot of those here) with a shorter one (note that this doesn't modify the href in the anchor tag, just the text that is displayed)
  • replaceurl - Replaces one url with another

To add more replacements just add a matching pair of aRegExps and aReplacements objects.

A couple of notes about this sample:

  • The regular expressions in the sample are obviously examples which I replaced before posting here and need to be customized.
  • Remember to escape special characters in the regexps
  • It has been mostly tested in Chrome and Firefox. No guarantees on other browsers.

Here's the sample:

Note that you need to edit the below js code to adit/add your keywords and corresponding replacements.

name:          Replace links
description:   Replaces keywords with links in BugEvents
author:        Roman Hernandez
version:       1.0

js:

var aRegExps = new Object();
var aReplacements = new Object();

aRegExps["svnlink"] = RegExp(/SVN#(\d+)/g);
aReplacements["svnlink"] = "<a href=\"http://your.svn.url/viewvc?view=rev&revision=$1\">SVN#$1</a>";

aRegExps["shortenlink"] = RegExp(/>http:\/\/some\.common\.url\/path\?link=something/g);
aReplacements["shortenlink"] = ">SVN#";

aRegExps["replaceurl"] = RegExp(/http:\/\/url\.to\.replace/g);
aReplacements["replaceurl"] = "http://replacement.url.here";

// Find all the bugevent body elements
$("div.body").each(
  function (){
     var content = $(this).html();
     var replace = false;
     for (var key in aRegExps){
       if (aRegExps[key].test(content)){
        replace = true;
        content = content.replace(aRegExps[key], aReplacements[key]);
       }    
     }
     if (replace)
       $(this).html(content);
  }
);    
link|flag
4

I have taken parts of Jake B's CSS code and joined it with our own Bugmonkey CSS code.

Fogbugz 7 default look (left) and the look after the redesign (right):

Screenshots here: http://img12.imageshack.us/img12/7561/fogbugz.png

/* some edited stuff from Jake B's code from http://fogbugz.stackexchange.com/questions/59/bugmonkey-script-archive/60#60 */

a.vb{color: #0F5491 !important}
a.uvb{font-weight:bold !important}
#mainArea,#mainAreaContinued{font-size:10pt !important}
.changes{padding: 0 !important;padding-left:5px !important}
#idContainer{width: 90% !important}
#www-fogcreek-com-fogbugz,#mainArea{font-family:segoe ui,arial,sans-serif;}

.buttonbar {width: 100% !important}

div.bugShadowBottom {width: 100% !important; max-width: 79em;}
#bugviewContainer {width: 100% !important}
#bugviewContainer .top .idTitleProjectAndArea {margin-left:13.5em !important}
#bugviewContainer .bugevents {margin-left:14em !important}
#bugviewContainer .bugevents .bugevent .body textarea { width:99% !important}
#BugFields, #BugMeta {width:100% !important;min-width:800px !important}
div.emailHeaderName {font-family:segoe ui,arial,sans-serif !important; font-size:8pt !important; color:#555 !important;}
div.emailHeaderValue {font-family:segoe ui,arial,sans-serif !important; font-size:8pt !important; color:#555 !important;}
div.emailBody {padding:4px!important;}

#bugviewContainer .top .row1 {width: 49.3em !important;} 
#bugviewContainer .top .row2, 
#bugviewContainer .top .row3, 
#bugviewContainer .top .rowPlugin {width: 15.5em !important} 
#bugviewContainer .top .row2 input,
#bugviewContainer .top .row3 input,
#bugviewContainer .top .rowPlugin input {width: 17em !important}
#bugviewContainer .top .plugins.edit {margin-left:0em !important; clear:left; width:100% !important;}
#bugviewContainer .top .title {font-size:1.5em !important;}
.bugTopItem3 {width: 99% !important}


#banner {border-top: 2px solid #E0E9F1 !important; border-bottom: 2px solid #E0E9F1 !important; }

.bugs tbody tr td {font-size:12px !important; color:#888 !important; }
.bugs tbody tr td a {text-decoration:none !important; }
.bugs tbody tr td a:hover {text-decoration:underline !important; }

#mainArea #bugGrid .g-r-context td a { color: #999 !important; } 
#mainArea #bugGrid .g-r-context td a.dotted { border-bottom: 1px dotted #999 !important;}

/*********************************** stuff by dirk paessler *****************************/

#BugFields, #BugMeta { width: 100%!important;}
.buttonbar{ width: 100%;}
#bugviewContainer { background-color: #F0EDE6; width:100%;}

#bugviewContainer .side { width: 175px;}
#bugviewContainer .top .ixBug {width: 180px;}
#bugviewContainer .top .row1 { width: 80%;}

div.emailHeaderValue,div.emailHeaderName{font-size:11px}

#bugviewContainer .bugevents .bugevent .summary .action { color: #555; font-weight: normal; font-size: 10px;float:left}
#bugviewContainer .bugevents .bugevent .summary .date { color: #555;  font-weight: normal; font-size: 10px;float:right}
#bugviewContainer .bugevents .bugevent .summary a:link { color: #555; text-decoration:none;font-weight:bolder}
#bugviewContainer .bugevents .bugevent .summary {background-color:#eee;border-left:1px solid#888;border-right:1px solid#888;border-top:1px solid#888;border-bottom:0px solid#888;padding:0px;padding-left:2px;padding-right:2px}
#bugviewContainer .bugevents .bugevent .changes {background-color:#fff;border-left:1px solid#888;border-right:1px solid#888;padding:0px;}

#bugviewContainer .bugevents .bugevent .summary .date { color: #666; }

#bugviewContainer .bugevents .bugevent .body {padding:0px;margin-top:0px;border-left:1px solid#888;border-right:1px solid#888;border-bottom:1px solid#888; font-size: 11px; background-color:#fff;}
#bugviewContainer .bugevents .bugevent .editable { font-size:11px; }

div.bugShadowBottom { background: none;margin:none;left:0px;width:100%!important}
div.bugShadowRight { background: none;width:100%!important}
div.bugShadowBL { background: none; width:100%!important}
div.bugShadowUR { background: none; width:100%!important}
div.bugShadowBR { background: none;width:100%!important }

textarea.bug{width:700px;font-size:11px;font-family:segoe ui,arial,sans-serif;}

#bugviewContainer .bugevents .bugevent .body textarea {width:auto;}

textarea.smallBug{width:400px;font-size:11px;font-family:segoe ui,arial,sans-serif;}

div.emailBody {font-size:11px;background-color: white;}

#bugviewContainer .bugevents .bugevent .body textarea {width:95%;padding:6px}

#bugviewContainer .bugevents .bugevent .emailHeaderValue input {width:95% !important;}

#bugviewContainer .top .row2:first-child{clear:both}

#bugviewContainer .top .ixBug {;font-family:segoe ui,arial,sans-serif;}
textarea,input,body,td,span,div{;font-family:segoe ui,arial,sans-serif!important;}

#mainnav a.navlink{;font-family:segoe ui,arial,sans-serif!important;}

#bugviewContainer .top .title {font-weight:bold}

#bugviewContainer .top #statusbarspacer {display:none}
#bugviewContainer .top {min-height:0px}
#bugviewContainer .top .ixBug{height:100px}
#bugviewContainer .top .statusbar {padding-top:0px;}
#bugviewContainer .top .title{padding:0px}
#bugviewContainer .top .idTitleProjectAndArea{min-height:0px}
.summary{height:12px!important}

div.email {border:none;border-top:1px solid #888;}
link|flag
5

I posted a simple script to make the Project: Area on the case page into live links.

link|flag
show 1 more comment
2

I wanted to get the contents of one special article displayed in a panel to the left of every page in a Wiki. The Wiki is a product spec, the special article is where we maintain the table of contents. Not an ideal solution, because the left panel gets cleared/reloaded with every refresh, but... here's what I did:

First, I modified that Wiki's template HTML so that there were some new div's with unique id's. The most important ones for this example are an empty container for the table of contents and a container containing only the body of the article.

HTML:
...
<div id="idTablesContainer">
</div>

<div id="idArticleContainer">
    <h1>$headline$</h1>
    <div id="idBodyContainer">$body$</div>
</div>
...

Then I modified the Wiki's template CSS to lay out the new div's (there are most likely many ways to do this nicer).

CSS:
...
#idTablesContainer, #idArticleContainer
{
    position:	absolute; 
    top:		160px; 
    bottom:		40px; 
    overflow:	auto;
}
#idTablesContainer
{
    left:		1%;
    width:		23%;
}
#idArticleContainer
{
    left:		25%;
    width:		75%; 
}
...

Next, I created the table of contents in a Wiki article (W370 in my case) and added the JavaScript to BugMonkey that would load it. There's also a function to show/hide it. I call it from an onClick attribute in a tag that I put in the HTML template.

JAVASCRIPT:
function Slide()
{
    if ($('#idTablesContainer').is (':visible'))
    {
    	$("#idTablesContainer").hide();
    	$("#idArticleContainer").animate({width: "98%",left: "1%"}, 0 );
    }
    else
    {
    	$("#idArticleContainer").animate({width: "75%",left: "25%"}, 0 );
    	$("#idTablesContainer").show();
    }
}

/* thanks to Kory Gorsky for the code I based this on */
$(document).ready(function(){
    /* only if this is a page from the customized Wiki... */
    if($("#idTablesContainer").length ) {
    	/* ...get W370 (the table of contents)... */
    	$.get("/default.asp?W370", function (data){
    		/* ... and put only the Body from the ToC into the current page's Table Container. */
    		$("#idTablesContainer").html(data).html($("#idBodyContainer").html());
    	});
    }

});
link|flag
3

I posted a script that adds a "Toggle Hierarchies" button to the upper-right corner of the list cases page. Clicking it will collapse/expand all the case hierarchies on the page.

link|flag
show 2 more comments
3

I posted a script that will help you determine what type of user you're dealing with (Not logged in, Normal, Community, or Administrator) and the user's full name (or "Anonymous" if they're not logged in).

link|flag
2

I did a script that lets you go into Edit mode by clicking anywhere in the body of a wiki page.

This is a feature of TiddlyWiki that was sorely missing IMHO. :)

I implemented this as an optional thing, since some of the users didn't want this dbl-click functionality.

name:          Double click to edit Wiki
description:   Edit a Wiki by double clicking the page
author:        Assaf Lavie
version:       1.0.0.0

js:

$(".contentWikiView").dblclick(function () { 
  location.href = $("#idEditArticle").attr("href");
});
link|flag
show 3 more comments
5

I posted a script that makes the case history text that is generated when you add a subcase (e.g., Created subcase 1234) a clickable link to the subcase you're adding.

link|flag
3

Add the following CSS to hide the "Send & Close" and "Resolve & Close" buttons when editing a case. (The wording and function of these buttons are confusing to users and more often than not lead to incorrectly-closed cases.)

.dlgButtonWide#Button_SendAndCloseEmail { font-weight: normal; display: none; }
.dlgButtonWide#Button_ResolveAndClose { font-weight: normal; display: none; }
link|flag
show 1 more comment
6

In using FogBugz, I noticed that most of the users didn't like seeing the full history of everywhere a bug had been in its storied life. For particularly old bugs, there might be a full page of "Assigned to Peter", "Assigned to Paul", "Assigned to Mary", "Milestone changed to 1.2.3" et cetera. Since people managing the bugs usually needed to see these 'empty edits' and the people fixing bugs only rarely did, I use BugMonkey to hide the 'empty edits'. I use a session cookie to remember the setting.

Also, I very rarely need to see the full header of an email. We use email as a method for our support staff to submit information about cases. As such, their email should look more like an edit and less like something else. I've reformatted the email so that the header is togglable (default to off) and the emails look more like edits. If the email is an Out of Office Autoreply, hide it.

This will also provide color coding for incoming vs. outgoing emails, so the email chain can be easily scanned for information.

Script:

name:          Hide empty edits and tidy up
description:   Hides edits with no text, optionally hides email headers, colors incoming and outgoing emails
author:        alficles, FogBugz 8 compatibility edits by Quentin Schroeder
version:       1.0.0.0

js:

// Cookie functions (mostly) stolen from some blog on the net.
function createCookie(name, value, days)
{
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
    var ca = document.cookie.split(';');
    var nameEQ = name + "=";
    for(var i=0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}
function eraseCookie(name)
{
    createCookie(name, "", -1);
}
$("div.emailHeader").parent().prepend("<div class=\"emailHeaderToggle\">Toggle Email Header</div>");
$("div.emailHeader").each(function(i) { 
    var whoEle = $(this).find("div.emailHeaderValue:first");
    var actEle = whoEle.parents("div.bugevent").find("span.action");
    var who = whoEle.text();
    var act = actEle.text();
    var nameReg = /"([^"]*)"/;
    if (!(/^Replied/.exec(act))) {
        if (nameReg.test(whoEle.text())) {
            actEle.append(" by "+nameReg.exec(who)[1]);
        }
        else {
            actEle.append(" by "+whoEle.html());
        }
    }
});
$("div.emailHeaderToggle").click(function() {
    var emailHeader = $(this).parent().find("div.emailHeader");
    var old_val = emailHeader.css("display");
    if (old_val == "block") { emailHeader.css("display","none"); }
    else { emailHeader.css("display","block"); }
});
var emptyCount = 0;
$(".bugevent").each(function() {
    var bodyEle = $(this).find(".body");
    var bodyTxt = bodyEle.text();
    if (/^[ \t\n]*$/.exec(bodyTxt)) {
        $(this).addClass("emptyBody");
        emptyCount += 1;
    }
});
$(".email .emailHeader .emailHeaderValue").each(function() {
    if (/^Out of Office AutoReply/i.exec($(this).text())) {
        $(this).parents(".bugevent").addClass("emptyBody");
        emptyCount += 1;
    }
});
if (emptyCount > 0) {
    $("#BugEvents").prepend("<div id=\"EmptyBodyToggle\">Show/Hide Empty Edits ("+emptyCount+")</div>");
}
$("#EmptyBodyToggle").click(function() {
    var old_val = $(".emptyBody").css("display");
    if (old_val == "block")
    {
        $(".emptyBody").css("display","none");
        createCookie("showEmpty","false");
    } else {
        $(".emptyBody").css("display","block");
        createCookie("showEmpty","true");
    }
});
if (readCookie("showEmpty") == "true") {
    $(".emptyBody").css("display","block");
}
$(".email").each(function() {
    var actions = this.getElementsByClassName('action');
    if (actions.length > 0)
        if (/Replied/.exec(actions[0].innerText)) {
            $(this).children('.body').addClass("outgoing");
        }
        else { // outgoing message
            $(this).children('.body').addClass("incoming");
        }
});


css:

div.emailBody {
    padding: 0px;
    background-color: inherit;
}
div.email {
    border: none;
}
div.incoming {
    background-color: #E0F5E0 !important; // green
}
div.outgoing {
    background-color: #EBF5FF !important; // blue
}
div.emailHeader {
    display: none;
    border: 1px solid #ADABA8;
    margin-bottom: 10px;
    margin-top: 5px;
}
div.editable div.emailHeader {
    display: block;
}
div.emailHeaderToggle {
    font-size: 70%;
    font-style: italic;
    color: #888;
    padding: 2px;
    cursor: pointer;
}
div.emailHeaderToggle:hover {
    text-decoration: underline;
    color: #000;
}
#EmptyBodyToggle {
    font-style: italic;
    color: #888;
    padding-bottom: 7px;
    cursor: pointer;
}
#EmptyBodyToggle:hover {
    text-decoration: underline;
    color: #000;
}
.emptyBody {
    display: none;
    padding-left: 5px;
    margin-left: 5px;
    border-left: 3px solid #d6d6d6;
}
link|flag
2

I posted a script to auto-create links on the case view page for protocols other than http and https (such as ftp://, file://, telnet://, etc.).

link|flag
9

name:          +Sub/Parent Case links
description:   Add new subcase/parent case quick links to the case view
author:        Adam Wishneusky, Chad McElligott, Michel de Ruiter
version:       1.3.0.0

js:

if (!window.goBug)
  return;
function getSel() {
  if        (window.getSelection)
    return   window.getSelection().toString();
  else if (document.getSelection)
    return document.getSelection().toString();
  else if (document.selection)
    return document.selection.createRange().text;
  return '';
};
function addButtons() {
  $('.icon-left.subcase,.icon-left.addparent').remove(); // Existing buttons
  if ($("ul.buttons").length == 0)
    return;
  var sLinkStart = 'default.asp?command=new&pg=pgEditBug'                +
    '&ixCategory='         +                    goBug.ixCategory         +
    '&ixProject='          +                    goBug.ixProject          +
    '&ixArea='             +                    goBug.ixArea             +
    '&ixFixFor='           +                    goBug.ixFixFor           +
    '&ixPersonAssignedTo=' +                    goBug.ixPersonAssignedTo +
    '&sCustomerEmail='     + encodeURIComponent(goBug.sCustomerEmail)    +
    '&ixPriority='         +                    goBug.ixPriority         +
    '&sTags='              + encodeURIComponent(goBug.ListTagsAsArray()) +
    '&sEvent='; // To be updated dynamically.
  var sNewButtons = '<li><a class="actionButton2 icon-left subcase" href="'   +
    sLinkStart +
    '&ixBugParent='        +                    goBug.ixBug              +
    '&b=c">Subcase</a><li>';
  if (goBug.ixBugParent == 0)
    sNewButtons +=  '<li><a class="actionButton2 icon-left addparent" href="' +
    sLinkStart +
    '&ixBugChildren='      +                    goBug.ixBug              +
    '&b=c">Parent</a></li>';
  $("ul.buttons").prepend($(sNewButtons));
}
addButtons();
$(window).on('BugViewChange', addButtons);
$(document).on('mouseup', '#bugviewContainer', function() { // Update sEvent:
  $('a.subcase,a.addparent').each(function() {
    this.setAttribute('href', this.getAttribute('href')
      .replace(/&sEvent=[^&]*/, '&sEvent=' + encodeURIComponent(getSel())));
  });
});


css:

/* Green plus sign: */
.icon-left.subcase::before,
.icon-left.addparent::before {
  background-position: 0px -163px;
  height: 16px;
}
#mainArea ul {
  font-size: 12px !important;
}
#bugviewContainer .buttonbar ul.toolbar.buttons {
  white-space: nowrap;
}
link|flag
1 
I have modified this script to work with the recent layout change (noticed when upgrading to 8.7.57.0). I will happily share, just not sure where would be best to put it. – Chad McElligott Jan 23 2012 at 16:37
show 8 more comments
2

I posted Daniel's script to highlight cases in grid view which are overdue. It can also highlight due today and due tomorrow.

link|flag
0

Here is a really simple script to alternate the colors for case events on the case detail view.

//alternate colors in case detail events
$(".bugevent:odd").css("background-color","#E0E9F1")

Prompted by this newsgroup question.

link|flag
2

Links to UNC paths: convert [\unc\path\directory] to proper link:

if(!window.goBug) {
   var wikiBody = $("div#bodyContent").html();
   wikiBody = wikiBody.replace(/\[\\\\([^\]]+)\]/g, "<a href='file://///$1'>\\\\$1</a>");
   $("div#bodyContent").html(wikiBody);
}

Requires proper configuration of Firefox, to allow intranet links from your FogBugz server:

http://kb.mozillazine.org/Links_to_local_pages_don%27t_work

[Note: Someone please post Chrome solution, and delete this note]

link|flag
1 
There's an extension to make file:// - Links work on Chrome: chrome.google.com/extensions/detail/… – peterchen Apr 1 2011 at 8:43
show 1 more comment
1

I posted a script which gives you the option to convert things in hours format to days/hours/minutes format.

link|flag
2

Daniel posted a script to hide bugevents you have already seen.

link|flag
0

Here's a script to hide all Backlog change entries:

$("div.bugevent").each(function() {
  if ($("div.changes", this).text().toLowerCase().indexOf(" backlog") >= 0) {
    $(this).css("display", "none");
  }
});
link|flag
1

I posted a script that lets you make custom fields always visible or always hidden on a per-project basis.

link|flag
1

I posted a script that saves drafts of emails and bug edits as you type (and allows you to restore them if your browser crashes or you accidentally close your window)

link|flag
0

If you want all your case titles on the single bug view page to contain the case number pre-pended ala FogBugz 6 (perhaps for easy copy and paste):

$(document).ready(function() {
    // Don't do anything unless we're looking at a single bug
    if (!window.goBug || 
        !$("#bugviewContainer").length || 
        $("#miniBugList").length) 
        return;

    $(".title").html("Case " + goBug.ixBug + ": " + goBug.sTitle);
});
link|flag
0

I posted a script that adds the "Favorites" star to the popup that appears when you hover over a case ID.

link|flag
1

I posted a script that shows the size of files that you are attaching to a case event, and gives a visual warning if the file size exceeds the maximum allowed attachment size.

link|flag
1

I wanted to add up a custom field called "Story Points" and also total the "Estimate (original)" column. Here's a script that does this, it is adaptable to summing up other columns as well.

Many thanks to others who posted scripts, I have incorporated (i.e. stolen) many ideas!

function convertFloat( inVal ) 
{ 
    var numVal = parseFloat( inVal.replace( ",", "." ) );

    if( isNaN( numVal ) )
    {
        return 0;
    }

    if( /minute/(inVal) )
    {
        // Convert to hours for time columns
        return( numVal / 60 );
    }
    else
    {
        return( numVal );
    }
}

function totalColumn( inColumn )
{
    // Let's find the where the column is
    var columnClass = /col_\d+/.exec($("th:has(a[text=" + inColumn + "]):first").attr("class"));

    // Get the items in the list for that class
    var bugList = "#bugListContainer td." + columnClass;

    // Total that list
    var total = 0;
    var row = 0;
    $(bugList).each( function() {
        total += convertFloat( $(this).attr("textContent") );
    } )

    return total;
}

$(document).ready(function() 
{
    // If we're not looking at a bug list, we don't do anything
    if (!$('#bugListContainer').length) return;

    // Get totals of some columns
    var totalOrigEstimate = totalColumn( FB_ESTIMATE_ORIGINAL );
    var totalSP = totalColumn( "Story Points" );

    // Add stuff to the bottom
    $('#fbsidebar tbody').append('<tr class=row><td align=left><nobr>Total original hours</nobr></td><td align=left><nobr>' + totalOrigEstimate + ' hours' +  '</nobr></td></tr>');
    $('#fbsidebar tbody').append('<tr class=row><td align=left><nobr>Total story points</nobr></td><td align=left><nobr>' + totalSP + ' points' +  '</nobr></td></tr>');
});
link|flag
0

Some Kanban plugin mods to make it play nice in FB8:

// Kanban Plugin hackery from Offroadcode.com
$( document ).ready( function() {
  // What is the plugin number for the Kanban plugin (hint hover over the kanban link and it will be in the url)
  var kanbanPlugInNumber = 21;

  // Change page title so it sticks out in tabbed browsers
  if ( typeof initKanban != "undefined" ) {
    // Enter code that will only run on the Kanban board here
    $("title").text( "Kanban" );
  }

  // Update, this hack is no longer needed with the latest version of 
  // the Kanban plug. I'll leave it here if you need it though :)
  // Make the "Kanban" link in the top right menu work with FB8
  /*
  var kanbanurl = "/default.asp?pg=pgPlugin&ixPlugin=" + kanbanPlugInNumber ; 
  var bb = $('#belowBanner');
  bb.prepend('<span><a class="navlink" href="' + kanbanurl + '">Kanban</a></span>');
  */
});
link|flag
0

I posted a script to easily toggle the visibility of all quoted texts in e-mails.

When searching a long case for something you just know is there but you cannot find it, it might be hidden in a 'quote'. One click now expands them all!

link|flag
2

Here is a short script I wrote that adds an "Edit" link next to each case in the case list/grid. This allows to quickly open several tests in a new window, already in edit mode.

link|flag
show 1 more comment
6

I've been able to create a custom menu that looks and performs exactly like the native menus in FogBugz (Filters, Schedules, Wiki, etc)

Custom Menu

http://fogbugz.stackexchange.com/questions/6471/how-to-create-a-custom-menu-in-the-menu-bar

link|flag
1 2 3 4 next

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.