Skip to content

Instantly share code, notes, and snippets.

@grok
Last active August 29, 2015 14:16
Show Gist options
  • Save grok/36b237673627dbc3b2ff to your computer and use it in GitHub Desktop.
Save grok/36b237673627dbc3b2ff to your computer and use it in GitHub Desktop.
Replicon Bookmarklet
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');}});})();
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');
}
});
@grok
Copy link
Author

grok commented Mar 3, 2015

Updated with a fix to deal with rows that contain years in the billing items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment