Skip to content

Instantly share code, notes, and snippets.

@mdeboer
Created July 19, 2014 18:00
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 mdeboer/8854a2b48093c999fff8 to your computer and use it in GitHub Desktop.
Save mdeboer/8854a2b48093c999fff8 to your computer and use it in GitHub Desktop.
X-Rite Hue color test cheat
function cheat(rowindex) {
var patches = document.querySelectorAll('.drag_container div[id^=patch_'+rowindex+'_]');
patches = Array.prototype.slice.call(patches);
patches.sort(function(a,b) {
var indexA = parseInt(a.id.substr(8));
var indexB = parseInt(b.id.substr(8));
if(indexA < indexB) {
return -1;
}
else if(indexA > indexB) {
return 1;
}
else {
return 0;
}
});
var row = document.querySelector('#draggable_row_container_'+rowindex);
while(row.firstChild) {
row.removeChild(row.firstChild);
}
for(var i = 0; i < patches.length; i++) {
row.appendChild(patches[i]);
}
}
for(var r = 1; r < 5; r++) {
cheat(r);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment