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

117 Answers

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
2

Based on Michel de Ruiter's Collapse Code Blocks customization I have created a script that will collapse Email Blocks. I have a handful of cases that have accumulated a large number of lengthy emails over time. I find the ability to collapse them all facilitates reviewing the updates without the pollution of long email conversations. Any individual email block can be expanded by double-clicking the collapsed header.

By default emails display as usual, but any page that contains one or more emails will include a link at the top of the Bug Event panel to collapse them down. Once a user has collapsed emails for a case the emails will appear collapsed on the next page visit. This collapsed-state recall is on a per-case basis, and only works for the current user on the current browser (due to it's implementation using cookies).

No collapse/expand option will be displayed if the case does not contain email events.

here's a [blurry, sorry] screenshot: alt text

I'm sure that there's plenty of room for improvement. I hope you find it useful.

name:          Collapse Email Blocks
description:   Collapse/expand an email block by double-clicking it
author:        Dave Cross
version:       1.0.0.3

js:

/*
Based on Collapse Code Blocks by Michel de Ruiter
http://fogbugz.stackexchange.com/questions/6395
History:
1.0.0.3 - Dave: Updated CSS to work with the new UI in FogBugz 8.7.18
                Changed bg colour of collapsed email blocks to better indicate that some text is hidden
1.0.0.2 - Dave: Do not collapse by default, but remember individual users' collapse settings on a per-bug basis
1.0.0.1 - Dave: Added an expand/collapse all option at the top of the bug history panel
*/
var ixBug = $('div.ixBug div a').text();
var sCookie = "emgfb-" + ixBug + "-collapseEmailBlocks";
// determine if user has previously specified to collapse email blocks for this case
var bCollapseEmail = $.cookie(sCookie) || false;
var sEmailBlockCollapseText = "Collapse All Email Blocks";
function CollapseEmailBlocks(bCollapse)
{
    if (bCollapse) {
        $("div.bugevent.detailed.email").addClass("collapsed");
        $("div.bugevent.detailed.email").find(".emailHeader").addClass("collapsed");
    }
    else {
        $("div.bugevent.detailed.email").removeClass("collapsed");
        $("div.bugevent.detailed.email").find(".emailHeader").removeClass("collapsed");
    }
    sEmailBlockCollapseText = (bCollapse ? 'Expand All Email Blocks' : 'Collapse All Email Blocks');
}
CollapseEmailBlocks(bCollapseEmail);
$("div.bugevent.detailed.email").attr("title", "Double-click to collapse/expand")
.dblclick(function() {
  $(this).toggleClass("collapsed");
  $(this).find(".emailHeader").toggleClass("collapsed");
});
/* Add a link at the top of the case history to expand/collapse all email blocks */
if ( $("div.email").length > 0 ) {
    $("span#BugEvents").prepend('<p><a id="toggleEmailBlocks" class="dotted" href="javascript:;">' + sEmailBlockCollapseText + '</a></p>');
    $("#toggleEmailBlocks").click(function() {
        bCollapseEmail = !bCollapseEmail
        CollapseEmailBlocks(bCollapseEmail);
        $(this).text(sEmailBlockCollapseText);
    if (bCollapseEmail) {
        $.cookie(sCookie, true);
    }
    else {
        // Don't set the cookie false, delete it instead - to avoid cookie proliferation
        $.cookie(sCookie, null);;
    }
    });
}


css:

div.email.collapsed {
  height: 66px;
  background-color: #BBB;
  overflow: hidden !important;
  cursor: default;
}
div.emailHeader.collapsed {
  background-color: #AC9C98;
}
#toggleEmailBlocks {
  font-size: 11px;
}
link|flag
show 1 more comment
2

This script (originally posted by Michel here) will change the default selected value for the "from" when sending an email to the personal name variant.

name:          Reply as me by default
description:   Change the default From address to my personal name
author:        Michel de Ruiter
version:       1.1.1.0

js:

function ChangeFromToMe() {
  if ($("#sFrom").length &&
      $('#sFrom option:selected').text().indexOf($('#username').text()) == -1) {
    $('#sFrom option:selected + option').attr('selected', 'selected');
    DropListControl.refresh($("#sFrom")[0]);
  }
}
ChangeFromToMe();
$(window).on('BugViewChange', ChangeFromToMe);
link|flag
2

Floating Top Nav

This script sets the top nav bar in FogBugz ("List Cases", "New Case", etc.) to float as you scroll.

link|flag
show 2 more comments
1

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

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
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
1

I posted a customization that warns you if you attempt to send an email that talks about attachments, but doesn't include any.

link|flag
1

Black Theme I posted this it is a start to a black theme.

link|flag
1

I have a problem with emails attached to the wrong case due to customer's misuse of email replies. If they leave an incorrect case reference in the subject line then the email is assigned to the wrong case and it leads to a rather significant mess of a case.

This issue has been reported and we may someday see an enhancement to facilitate fixing the problem, but in the meantime I use the FB_Scratchout plugin and the following BugMonkey script to add support for scratching-out email headers:

name:          Scratchout Email Blocks
description:   Extend scratchout styling to email headers also (for the FB_ScratchOut plugin)
author:        Dave Cross
version:       1.0.0.0

js:

$("div.Scratchedout").parent().siblings(".emailHeader").toggleClass("scratchout");
$("div.Scratchedout").parent().siblings(".emailHeader").children(".emailActionsMore").hide();


css:

div.emailHeader.scratchout {
  color: grey;
  background-color: whitesmoke;
  text-decoration: line-through;
}
link|flag
1

Add icons in front of links with documents (using idea from here http://www.psyked.co.uk/css/auto-matic-link-icons.htm):

css:

a[href$='.docx']{
    display:inline-block;
    padding-left:20px;
    line-height:18px;
    background:transparent url(images/icons/docx.ico) center left no-repeat;
}
a[href$='.xlsx']{
    display:inline-block;
    padding-left:20px;
    line-height:18px;
    background:transparent url(images/icons/xlsx.ico) center left no-repeat;
}
a[href$='.pptx']{
    display:inline-block;
    padding-left:20px;
    line-height:18px;
    background:transparent url(images/icons/pptx.ico) center left no-repeat;
}
a[href$='.pdf']{
    display:inline-block;
    padding-left:20px;
    line-height:18px;
    background:transparent url(images/icons/pdf.gif) center left no-repeat;
}

Obviously you need to supply your own images.

alt text

link|flag
show 1 more comment
1

Bugmonkey script to alert user of incorrect mailbox

alt text

link|flag
1

Hacked version of Stepan Riha's lovely grouped filters script above, which does the same for wikis. Uses | as the separator, as : is not allowed in wiki titles.

name:          Grouped Wikis
description:   Changes Wikis menu to group wikis by group name
author:        Based on Stepan Riha's Grouped Filters script
version:       1.0.0.0

js:

$(document).ready(function() {
    // Change visibility of links in group
    function toggleGroup() {
        var $this = $(this);
        var group = $this.data('group');
        if(!group.prepared) {
            prepareLinks(group);
        }
        processLinks(group, group.isOpen
            ? function($link) { $link.hide(); }
            : function($link) { $link.show(); });
        group.isOpen = !group.isOpen;
        return false;
    };
    // Replace wiki group name with its list of wikis
    function prepareLinks(group) {
        var groupname = jQuery.trim(group.text+"|");
        processLinks(group, function($link) {
            var html = $link.html();
            html = html.replace(groupname, '');
            $link.html(html).addClass('wiki_group-link');
        });
        group.prepared = true;
    };
    // Apply callback to each link in group
    function processLinks(group, callback) {
        for(var j = 0; j < group.links.length; j++) {
            callback(group.links[j]);
        }
    };
    // Collect wiki links and group by prefix
    var groups = [];
    var $prev = null;
    var group = null;
    $('#wikiPopup a').each(function() {
        var $this = $(this);
        // Use everything up to first : as group name
        var text = $this.text();
        text = text.replace(/\|.*/, '');
        // Create new group, if necessary
        if(!group || group.text != text) {
            group = { text: text, links: [] };
            groups.push(group);
        }
        group.links.push($this);
    });
    // Process groups of 2 or more links
    for(var i = 0; i < groups.length; i++) {
        var group = groups[i];
        var links = group.links;
        if(links.length > 1) {
            // Hide links
            processLinks(group, function($link) { $link.hide(); });
            // Create group link
            group.link = $("<a href='#' class='wiki_group'><span>" + group.text + ": " + links.length + " wikis</span></a>")
                    .bind("click", toggleGroup)
                    .data('group', group)
                    .insertBefore(links[0]);
        }
    }
});


css:

a.wiki_group {
    padding-left: 17px !important;
    font-style: italic;
}
a.wiki_group span {
    padding-left: 5px;
    border-left: solid 3px #B1C9DD;
}
a.wiki_group:hover span {
    border-left-color: #E0E9F1;
}
a.wiki_group-link {
    padding-left: 23px !important;
}
link|flag
1

Sharing a script Rich wrote to change the project and area to the Support Inbox when you click the Send Email button. Adjust the ixProject and ixArea to suit your instance of FogBugz.

name:          Autoselect Inbox on New Email
description:   Makes it so you don't send mail from projects that never get mail sent out of them.
author:        Rich Armstrong
version:       1.0.0.0

js:

if (~document.location.href.indexOf('newemail')) {
  $('select#ixProject option[value=24]').attr('selected','selected');
  $('select#ixProject').change();
  $('select#ixArea option[value=94]').attr('selected','selected');
  $('select#ixArea').change();
}


css:

/* body { background-color: red !important; } */
link|flag
1

This script is inspired and based on Reply as me by default . When you create a new case, this defaults the "Assigned To" field to you instead of the Primary Contact. This cut down on the number of cases accidentally assigned to the wrong person for us. This script can easily be improved. I'm not a JS person at all.

name:          Assign to me by default
description:   Change the default Assign To, to the person creating the case instead of the primary contact.
author:        William Wynn
version:       1.0.0.0

js:

function ChangeAssignToMe() {
  if(window.location.href.indexOf("command=new") > 0) {
    if ($("#ixPersonAssignedTo").length &&
        $('#ixPersonAssignedTo option:selected').text().indexOf($('#username').text()) == -1) {
      $('#ixPersonAssignedTo option').each(function(index, option)
      {
        if (option.text.indexOf($('#username').text()) != -1) {
          $("#ixPersonAssignedTo").val(option.value);
        }
      });
      DropListControl.refresh($("#ixPersonAssignedTo")[0]);
    }
  }
}
ChangeAssignToMe();
link|flag
1

I have extended Daniel's very useful Summarize Events customization. It now supports:

  • summarize or hide events the user has already seen
  • summarize all events
  • expand, summarize or hide individual events
  • summary tooltips show the full event text
  • an integrated Toggle quoted texts link
link|flag
1

This customization helps when figuring out what a customer is talking about in an email when they say

in "image1.png", you can see the process. in "image2.png", the process is suddenly gone, but in "image_foo.png" it's back

As is, FogBugz makes it hard to see what the filenames of the images in a case are. They're way at the end of the link URL. This script makes a tooltip with the filename so you can just hover over them.

name:          Image filenames as tooltips in case view
description:   Shows files names when hovering over images in cases
author:        Ben McCormack and Adam Wishneusky
version:       1.1.0.0

js:

$(function(){
  // if we're not on the case page, don't do anything
  if (!$('#bugviewContainer').length) return;

  var toMatch = /sFileName=([^ ]*\b)/i;
  $('div[id*="bugeventBody_"] img').each(function(){  
    src = $(this).attr('src');
    var matches = src.match(toMatch);

    if (matches !== null){
      fileName = decodeURIComponent(matches[1]);
      $(this).attr('title',fileName);
    }
  });
});
link|flag
1

This customization removes duplicate images left in the footer of emails when InlineImageAttachments is enabled.

See also this one for dupes caused by incoming html email.

link|flag
1

This script adds a link to quickly pass a case back to the person who assigned it to you.

link|flag
1

How can I encourage a particular workflow using BugMonkey?

The above script will allow you to set up a workflow to move from one active status to the next numbered active status, e.g.:

alt text

link|flag
1

I usually reply inline to e-mails, directly replying to the original text which is prefixed by >. This customization makes the quoted text stand out, and smaller:

name:          Prefixed quote style
description:   Change text quote (prefixed with >) layout
author:        Michel de Ruiter
version:       1.0.2.2

js:
function isTextNode() {
  return this.nodeType == 3;
}
function isQuotedText() {
  return /^\s*>/m.test(this.textContent) &&
         (!this.previousSibling ||
          !this.previousSibling.tagName ||
          this.previousSibling.tagName == 'BR' ||
          this.previousSibling.tagName == 'P');
}
function findQuotes() {
  var n = $('.emailBody span').not('.tq')
  .add('.emailBody').add('.emailBody p')
  .contents().filter(isTextNode).filter(isQuotedText)
  .wrap('<span class="tq"/>').length;
}
findQuotes();
$(window).on('BugViewChange', findQuotes);
$(document).ajaxComplete(function(e, xhr, settings) {
  if (settings.url.indexOf("pg=pgQuotedEmail") != -1)
    findQuotes();
});

css:
span.tq {
  background-color: #F0F8FF;
  color: #39668E;
  font-size: 82%;
}

Like this:

Example screenshot

It can even be applied to users that are not logged-in, viewing the case (e-mails) via a case ticket.

Feel free to improve this answer, for instance by using different colors for different quote depths (>>).

link|flag
1

I adapted the following code from the Pagedown project. Javascript and JQuery are not in my wheelhouse, so I welcome any improvements to this code. I just implemented it yesterday, so it is (almost) completely untested (hence the low version number).

The code directly uses Pagedown's Markdown.Converter.js.

name:          Markdown
description:   Apply Markdown to case events
author:        John Gruber, John Fraser, Mike Wolfe, Michel de Ruiter
version:       0.2.0.0

js:
function decodeHtml(txt) {
  return txt
    .replace("&lt;pre&gt;",  "<pre>")
    .replace("&lt;/pre&gt;", "</pre>");
}
function markItDown() {
  var converter = new Markdown.Converter();
  $("div.bugevents div.body:not(.editable)").each(
    function() {
      var content = decodeHtml($(this).html());
      var replacetext = converter.makeHtml(content);
      $(this).html(replacetext);
    }
  );
}
$.getScript("http://pagedown.googlecode.com/hg/Markdown.Converter.js")
.done(function(script, textStatus) {
  markItDown();
  $(window).on('BugViewChange', markItDown);
  $(document).ajaxComplete(function(e, xhr, settings) {
    // if (settings.url.indexOf("_action=minimalUpdates") != -1)
    markItDown();
  });
})
.fail(function(jqxhr, settings, exception) {
  alert(exception.message);
});
link|flag
show 1 more comment
1

I posted a simple script to automatically expand the wiki tree view, showing more than the default 5 articles under the root article.

Initial view

link|flag
1

Here's a short script to attach a Javascript change event to dropdown in the FogBugz case view (the example shows an alert when the Priority dropdown is changed -- make sure to target the element for the dropdown you want to use).

name:        Dropdown Alert
description: Doesnt do much, yet
author:      Max Kramer
version:    1.0.0.0
minApi:      1.0

js: 
    $(window).on('BugViewChange', function() {
        $('#ixPriority').change(function() {
          alert('Dropdown changed, validate me.');
        });
    });

css: 
link|flag
1

This script will hide wikis from the main Wiki drop-down that you no longer need, but don't want to fully delete. They are still accessible in the Wiki -> Manage Wikis page. To use it, set the array to the list of wiki numbers. You can get them (the "W" number) from the URL when you hover over the link to each.

e.g. if you want to hide wiki default.asp?W1 and default.asp?W254, change the list [243, 376, 3054] below to [1, 254]:

name:        Hide Un-needed Wikis
description: Removed un-needed wikis from the Wiki drop-down. They are still listed in the Manage Wikis page
author:      Adam Wishneusky
version:     1.0.0.0
minApi:      1.0

js: 
  var wikisToHide = [243, 376, 3054];
  wikisToHide.forEach(function(element, index, array) {
    $('#wikiPopup').find('div a[href="default.asp?W' + element + '"]').hide();
  });

Or if you prefer a CSS solution:

name:        CSS Hide Wikis
description: Removes wikis from the Wiki drop-down
author:      Michel de Ruiter
version:     1.1.0.0

css: 
#wikiPopup div a[href="default.asp?W243"],
#wikiPopup div a[href="default.asp?W376"],
#wikiPopup div a[href="default.asp?W3054"] {
 display: none !important;
}
link|flag
1

name:          On Create New Project Default to a Particular Value
description:   When creating a new project, change the Initial Permissions to something else
author:        Sonny Kim
version:       1.0.0.0

js:

if (~document.location.href.indexOf('pgEditProject')) { // if this is     the 'pgEditProject' page
  if ($("#idSelectTemp_0").val() == "-1") {
     $("#idSelectTemp_0 option[value='-1']").removeAttr("selected"); 
     $("#idSelectTemp_0 option[value='0']").attr("selected", "selected"); // this changes the selected option to 'value=0'
     DropListControl.refresh($("#idSelectTemp_0")[0]); // this refreshes the DropListControl to change the selected option
  }
}
link|flag
1

name:          Prevent certain users from being assigned to cases
description:   Hide certain users in the "assign to" dropdown
author:        Adam Wishneusky and Sonny Kim
version:       1.0.0.0

js:

$(function(){
    // if we're not on the case page, don't do anything
    if (!$('#bugviewContainer').length) return;
    var arrExcludePerson = new Array();        
    // ******* YOU MUST EDIT THIS SECTION ******* 
    // array of ixPerson ids to remove from the drop-down list
    arrExcludePerson[0] = "2";
    arrExcludePerson[1] = "4";
    arrExcludePerson[2] = "6"; 
    // *******        END SECTION         ******* 
    var removeUsersFromDropDown = function(dropDownId, arrExclude) {
        if ($(dropDownId).length > 0) {
           for (var i = 0; i < arrExclude.length; i++) {
              var strConstructSelector = dropDownId + " option[value='" + arrExclude[i] + "']";
              $(strConstructSelector).remove();
           }
           DropListControl.refresh($(dropDownId)[0]);
        }
    }
    var oldShowAssignSpan = showAssignSpan;    // save the old 'showAssignSpan' function
    showAssignSpan = function(el, e) {         // overwrite 'showAssignSpan' function
        oldShowAssignSpan(el, e);              // call original 'showAssignSpan' function
        var dropDownIdParam = "#ixPersonAssignedToOverrideDropDown_assign0";
        removeUsersFromDropDown(dropDownIdParam, arrExcludePerson);
    }    
    var myFunction = function(sCommand) {
        // sCommand will specify the current action
        // (i.e., edit, resolve, assign, close, reply, forward, etc.)
        // iterate the array of persons to exclude and remove them from the dropdown list.
        if (sCommand == "new" || sCommand == "edit" || sCommand == "reopen" || sCommand == "assign") {
           var dropDownIdParam = "#ixPersonAssignedTo";
           removeUsersFromDropDown(dropDownIdParam, arrExcludePerson);
        }
        //console.log(sCommand);
    };
    if ($('#sEventEdit').length > 0)
    {
      myFunction('new');
    }
    else
    {
      myFunction('load');
    }
    // run it when the view changes and pass in the new view:
    $(window).on('BugViewChange', function(e, data) {
        myFunction(data.sCommand); 
    });
});
link|flag
1

Organize Filters menu into folding TREE.

Thanks Stepan Riha for his Grouped Filters.

alt text

name:          Filters Tree
description:   Filters menu into Tree. Make names like: "Project : Group : Filter"
author:        Alexey Galanov
version:       1.0.0.8

js:

$(document).ready (function () {
  function tree_hide (tree_elt) {
    for (var i = 0; i < tree_elt.next.length; i++) {
      var elt = tree_elt.next[i];
      if (elt.typ == 0)
        tree_hide (elt);
      elt.link.hide ();
      elt.isOpened = false;
    }
    tree_elt.isOpened = false;
  }
  function tree_show (tree_elt) {
    for (var i = 0; i < tree_elt.next.length; i++) {
      var elt = tree_elt.next[i];
      elt.link.show ();
    }
    tree_elt.isOpened = true;
  }
  function togglePath () {
    var $this = $(this);
    var t = $this.data ('tree');
    if (t.isOpened)
      tree_hide (t);
    else
      tree_show (t);
    return false;
  }
  function trim_spaces (str) {
    return str.replace (/^\s\s*/, '').replace (/\s\s*$/, '');
  }
  function tree_add (tree, link) {
    var text = link.text ();
    var elt = text.split (":");
    var t = tree;
    var found = false;
    var tree_el = null;
    var path_elt;
    for (var e = 0; e < elt.length - 1; e++) {
      path_elt = trim_spaces (elt[e]);
      for (var i = 0; i < t.length; i++) {
        if (t[i].name == path_elt) {
          t = t[i].next;
          found = true;
          break;
        }
      }
      if (found != true) {
        tree_el = {typ: 0, deep: e, name: path_elt, link: null, isOpened: false, next: []};
        t.push (tree_el);
        t = tree_el.next;
      }
      found = false;
    }
    tree_el = {typ: 1, deep: e, name: path_elt, link: link, isOpened: false, next: []};
    var h = tree_el.link.html ();
    h = h.replace (trim_spaces (text), trim_spaces (elt[e]));
    tree_el.link.html (h);
    t.push (tree_el);
  }
  function tree_draw (tree) {
    for (var i = 0; i < tree.length; i++) {
      var elt = tree[i];
      // Если ветка, входим внуть, затем делаем ссылку на предыдущий элемент (ветку или ссылку).
      if (elt.typ == 0) {
        tree_draw (elt.next);
        elt.link = $("<a href='#' class='tree_path'><span>" + elt.name + "</span></a>")
          .bind("click", togglePath)
          .data('tree', elt)
          .insertBefore (elt.next[0].link)
          .css ({"padding-left": 15 * (elt.deep + 1) });
      }
      // Если лист.
      else {
        elt.link.css ({"padding-left": 15 * (elt.deep + 1) });
      }
      elt.link.hide ();
    }
  }
  function tree_show_root (tree) {
    for (var i = 0; i < tree.length; i++) {
      var elt = tree[i];
      elt.link.show ();
    }
  }
  var tree = [];
  $('#filterPopup a').each (function() {
    var $this = $(this);
    tree_add (tree, $this);
  });
  tree_draw (tree);
  tree_show_root (tree);
});

css:

a.tree_path span {
  //padding-left: 3px;
  //border-left: solid 2px #B1C9DD;
  //border-bottom-left-radius:15em;
  //border-top-left-radius:15em;
  //padding-right: 3px;
  //border-right: solid 2px #B1C9DD;
  //border-bottom-right-radius:15em;
  //border-top-right-radius:15em;
  //border-top: solid 2px #B1C9DD;
  ////border-bottom: solid 2px #B1C9DD;
  //padding-top: 0px;
  //padding-bottom: 0px;
  ////background-color: #B1C9DD;
  //border-color: #E0E9F1;
}
a.tree_path:hover span {
  //border-left-color: #E0E9F1;
  //border-color: #FFFF00;
  //border-color: #E0E9F1;
  //background-color: #E0E9F1;
  //border-color: #B1C9DD;
  //background-color: #B1C9DD;
  //border-left-color: #FF0000;
  //background-color: #FFFFFF;
}
link|flag

Your Answer

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