Last active
August 29, 2015 14:23
-
-
Save ashildebrandt/d70c1b14507837dd6536 to your computer and use it in GitHub Desktop.
A Tampermonkey script that modifies the query list on QueryTracker to hide irrelevant information and show any notes you may have added.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name QueryTracker query list cleanup | |
// @namespace http://aaronhildebrandt.com/ | |
// @version 1.5 | |
// @description Kills a bunch of needless (to me, at least) columns and adds in a column for notes. Nice. Might need a longer delay if your internet connection is bad. Or, you know, logic for checking if the list has been populated. | |
// @author Aaron Hildebrandt | |
// @match https://querytracker.net/qlist.php | |
// @grant none | |
// @updateURL https://gist.githubusercontent.com/ashildebrandt/d70c1b14507837dd6536/raw | |
// ==/UserScript== | |
var refresher = setInterval(updateList, 100); | |
function updateList() { | |
if($('#agentList tr').length > 4) { | |
clearInterval(refresher); | |
$('.alert.pull-right').hide(); | |
$('.clearfix').hide(); | |
$('.popoverTrigger.pointer').hide(); | |
$.each([7, 9, 11, 12, 13], function(i, val) { | |
$('th:nth-child('+val+'), td:nth-child('+val+')').hide(); | |
}); | |
var note_contents = $('.change_note span'); | |
for (index = 0; index < note_contents.length; ++index) { | |
var this_note = $(note_contents[index]).attr('title'); | |
var this_parent = $(note_contents[index]).parent().parent().parent(); | |
if(this_note=='Add a note for this query.' || !this_note) { | |
$(this_parent).find('td').eq(3).after('<td> </td>'); | |
} else { | |
$(this_parent).find('td').eq(3).after('<td>'+this_note.substring(6)+'</td>'); | |
} | |
} | |
$('td').css('vertical-align', 'middle'); | |
$('thead').find('th').eq(5).after('<th>Notes</th>'); | |
$('tr').each(function() { | |
if($(this).find('.icon-status-closed').length) { | |
$(this).css('opacity', 0.5); | |
$(this).appendTo('table'); | |
} | |
if($(this).find('.icon-status-rej').length) { | |
$(this).css('opacity', 0.3); | |
$(this).appendTo('table'); | |
} | |
if($(this).find('.icon-status-sub-email').length) { | |
$(this).css('background', '#0f0'); | |
$(this).prependTo('table'); | |
} | |
}); | |
$('.table-striped>tbody>tr:nth-child(odd)>td, .table-striped>tbody>tr:nth-child(odd)>th').css('background-color', '#f0f0f0'); | |
$('tr').each(function() { | |
if($(this).find('.icon-status-sub-email').length) { | |
$(this).find('td').css('background-color', '#efe'); | |
} | |
}); | |
$('.rowSelected').removeClass('rowSelected'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment