Last active
August 29, 2015 14:16
-
-
Save grok/36b237673627dbc3b2ff to your computer and use it in GitHub Desktop.
Replicon Bookmarklet
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
javascript:(function(){var rows=jQuery('iframe#body').contents().find('.timesheet tr[type="time"]');rows.splice(-1,1);jQuery.map(rows,function(value,key){var that=value;var task=jQuery(value).find('.rowTask .taskPartName');var billing=jQuery(value).find('.rowBilling .additional');var task_number=jQuery(task).text().match(/\d{4}/g);var billing_numbers=jQuery(billing).text().match(/\d{4}/g);if(jQuery(billing_numbers).last().get(0)!==jQuery(task_number).last().get(0)){jQuery(that).css('background-color','#F26B6B');}else{jQuery(that).css('background-color','#6BD2F5');}});})(); |
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
var rows = jQuery('iframe#body').contents().find('.timesheet tr[type="time"]'); | |
rows.splice(-1,1); jQuery.map(rows, function(value, key) { | |
var that = value; | |
var task = jQuery(value).find('.rowTask .taskPartName'); | |
var billing = jQuery(value).find('.rowBilling .additional'); | |
var task_number = jQuery(task).text().match(/\d{4}/g); | |
var billing_numbers = jQuery(billing).text().match(/\d{4}/g); | |
if(jQuery(billing_numbers).last().get(0) !== jQuery(task_number).last().get(0)) { | |
jQuery(that).css('background-color','#F26B6B'); | |
} else { | |
jQuery(that).css('background-color','#6BD2F5'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated with a fix to deal with rows that contain years in the billing items.