I wrote this today and figured I'd share the love since I've used your examples so much in the last couple of weeks while writing BugMonkey scripts and full-featured plugins.
This just moves the 'My Filters' section above 'Shared Filters' in the Filters dropdown. Tested in 8.3.42, but it likely works in other versions.
name: Filter Re-Sorter
description: Puts 'My Filters' above 'Shared Filters' in the Filters dropdown
author: Daniel Jennings
version: 1.0.0.0
js:
var $divs = $('#filterPopup div');
if (!$divs) return;
$filterListDiv = $($divs[0]);
//console.log($filterListDiv);
var deletedItems = [];
var isDeleting = false;
$filterListDiv.children().each(function () {
var $this = $(this);
if ($this.text() == 'Shared Filters')
isDeleting = true;
var thisTagName = $this.get(0).tagName;
if (isDeleting || $this.attr('href') == "default.asp?pg=pgFilter") {
deletedItems.push(this);
$this.remove();
}
if (isDeleting && thisTagName == 'HR') {
isDeleting = false;
}
});
$filterListDiv.append(deletedItems);
I'm a bit of a jQuery noob, so I might've done things a little bit weird, but it works, so if this is helpful, let me know here :)
$this.get(0).tagName == "HR"can be abbreviated to$this.is("hr")– Daniel LeCheminant♦ May 6 2011 at 12:42