//=================================================================Previous=======================================================================================
var previous = [...document.querySelectorAll("#tstdDefinitionTable > table > tbody > tr > td:nth-child(2)")].slice(1,).map(item => item.innerText);
localStorage.setItem('previous', JSON.stringify(previous));
/*
******************************************
*/
//====================================================================Current====================================================================================
function txt_download (content, filename) {
var el = document.createElement('a');
el.download = filename;
el.style.display = 'none';
var blob = new Blob([content]);
el.href = URL.createObjectURL(blob);
document.body.appendChild(el);
el.click();
document.body.removeChild(el);
};
(function () {
var previous = JSON.parse(localStorage.getItem('previous'));
var current = [...document.querySelectorAll("#tstdDefinitionTable > table > tbody > tr > td:nth-child(2)")].slice(1,).map(item => item.innerText);
var excessData_previous = previous.filter(item => current.indexOf(item) === -1);
var excessData_current = current.filter(item => previous.indexOf(item) === -1);
if(excessData_previous.length == 0 && excessData_current.length == 0) {
console.log("They are the same");
return;
}
var content = "";
if(excessData_previous.length)
content += "Excess Test Standard_Previous job:\r\n" + excessData_previous.join("\r\n") +"\r\n";
if(excessData_current.length)
content += "Excess Test Standard_current job:\r\n" + excessData_current.join("\r\n") +"\r\n";
txt_download(content, `${document.querySelector("#ctl00_maincontent_compoheader_lblREF_NO").innerText}_excess.txt`);
})();