Skip to content

Instantly share code, notes, and snippets.

@imrahil
Created March 15, 2012 09:39
Show Gist options
  • Save imrahil/2043287 to your computer and use it in GitHub Desktop.
Save imrahil/2043287 to your computer and use it in GitHub Desktop.
ecDB.net - Adds red background to missing components
// ==UserScript==
// @name ecDB
// @namespace http://www.ecdb.net
// @description Adds red background to missing components
// @include http://ecdb.net/proj_show.php?proj_id=*
// ==/UserScript==
var componentsTable = document.getElementsByClassName('globalTables')[0];
var componentsTableBody = componentsTable.getElementsByTagName("tbody")[0];
var componentsTableRows = componentsTableBody.getElementsByTagName("tr");
for (i in componentsTableRows)
{
var cell = componentsTableRows[i].getElementsByTagName("td")[7];
var quantity = cell.childNodes[0].data;
if (quantity == 0)
{
cell.style.background = "rgb(255,0,0)";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment