Skip to content

Instantly share code, notes, and snippets.

@grok
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 Feb 23, 2015

This is meant to help compare the first two columns in Replicon to make sure the data is lining up.

BTW ... no QA has been done on this - I've already noticed some edge case stuff where it fails -- but it does speed up the process significantly in its current state.

@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