IR Alert Module

Be sure your league is setup properly before installing any scripts.Setup Video
The IR Alert script creates a module you can place on your sites homepage to track any teams that may be violation your IR rules. The script checks the rosters page for any IR warnings and appends those franchises names or icon to a new module. I have some CSS installed to size icon , you can adjust that as you see fit.
All scripts require cache.js and font awesome file to be placed in a header message as the 1st line. Please review the section "Custom Scripts" Here
This script is already included in our custom template. Do not install it again. Custom template users do not need to load cache.js or font awesome.

IR Alert ModulePlace in any HPM

<style>
#IRviolations .franchiseicon {
    max-width: 9.375rem;
    max-height: 3.125rem;
}
</style>

<!-----  IR ALERT HTML  ------>
<div class="mobile-wrap IRviolationsWrap">
  <table class="homepagemodule report" id="IRviolations" align="center" cellspacing="1">
    <caption><span>POSSIBLE IR VIOLATIONS</span></caption>
    <tbody>
      <tr>
        <th>These Teams May Have IR Violations</th>
      </tr>
      <tr class="reportfooter">
        <td class='IRalert' align='center'>
          <a href='https://%HOST%/%YEAR%/options?LEAGUE_ID=%LEAGUEID%&O=18&%FRANCHISEID%' style='text-decoration:none'>
          <input type='button' value='Perform Injured Reserve' />
          </a>
        </td>
      </tr>
    </tbody>
  </table>
</div>

<!-----  LOAD IR ALERT SCRIPT  ------>
<script>    
if (irAlert_offseason_hide === undefined) var irAlert_offseason_hide = false;
if (deactivate_all_offseason === undefined) var deactivate_all_offseason = false;
if ((is_offseason && irAlert_offseason_hide) || (is_offseason && deactivate_all_offseason)) {
	var irWrapper = document.querySelectorAll('.IRviolationsWrap');
	for (var i = 0; i < irWrapper.length; i++) {
		irWrapper[i].parentNode.removeChild(irWrapper[i]);
	}
	console.log("Offseason - IR Alert Script");
} else {
	var xhrAlerts = new XMLHttpRequest();
	xhrAlerts.onreadystatechange = function () {
		if (xhrAlerts.readyState === 4 && xhrAlerts.status === 200) {
			var parser = new DOMParser();
			var doc = parser.parseFromString(xhrAlerts.responseText, "text/html");
			var violations = doc.querySelectorAll('td.two_column_layout');
			violations.forEach(function (violation) {
				if (violation.innerHTML.includes('Possible') && violation.innerHTML.includes('Violation')) {
					var links = violation.querySelectorAll("span a");
					links.forEach(function (link) {
						var row = document.createElement('tr');
						row.className = 'oddtablerow';
						row.innerHTML = "<td align='center'>" + link.outerHTML + "</td>";
						document.querySelector("#IRviolations .reportfooter").insertAdjacentElement('beforebegin', row);
					});
				}
			});
			var IRrow = document.querySelectorAll("#IRviolations tr");
			if (IRrow.length === 2) {
				IRrow[0].textContent = "There are no IR violations";
				IRrow[0].classList.add("oddtablerow");
				IRrow[0].innerHTML = "<th class='noIR'>" + IRrow[0].innerHTML + "</th>";
				document.querySelector("#IRviolations .reportfooter").style.display = 'none';
				var IRviolationsWrap = document.querySelector(".IRviolationsWrap");
				//IRviolationsWrap.parentNode.removeChild(IRviolationsWrap); // you can unmark this and remove the table from showing when no rosters are illegal
			}
		}
	};
	xhrAlerts.open("GET", baseURLDynamic + "/" + year + "/options?L=" + league_id + "&O=07&PRINTER=1", true);
	xhrAlerts.send();
}
</script>