1

It would be cool if there was a plugin that would allow me to view case attachments in the browser without downloading it. Most (all?) of the attachments i get in my cases are just text files, it would make my life so much easier if I didn't have to download and open them to view their contents. Thanks!

flag
I use safari on a Mac. – Evan Coleman Apr 1 2011 at 12:29

1 Answer

5

This isn't something that's currently possible with FogBugz straight out-of-the-box, but you can use the following BugMonkey script to accomplish what you're asking for:

name:        Inline text-based attachments
description: Inlines the specified attachments types directly into the bug view
author:      Dane Bertram
version:     1.0.0.0
minApi:      1.0

js: 

var inlineExtensions = ['txt', 'js'];

var regex = new RegExp('\\.(' + inlineExtensions.join('|') + ')$');
$('div.attachments a[href^=default.asp?pg=pgDownload]')
.filter(function(){ return regex.test($(this).attr('href')); }) // only the extensions we want inlined
.each(function(){
    var $anchor = $(this);
    $.get($anchor.attr('href'), function(data) {
        $('<pre>')
        .css({ 'max-height' : '200px', 'border' : '1px solid #C7C7C7' })
        .text(data)
        .appendTo($anchor.parent('p'));
    });
});

Right now that will inline any text or JavaScript attachments, but you can modify inlineExtensions to include other file types as well.

link|flag
Awesome! Thanks! – Evan Coleman Apr 2 2011 at 1:53
Agreed, this is awesome! – Samuel Neff Apr 2 2011 at 14:47

Your Answer

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