Difference between revisions of "EDCS Reports"

From Digital Transformation Wiki
Jump to navigation Jump to search
(Created blank page)
 
(Table update preformed by bot)
Line 1: Line 1:
 +
<html>
 +
<script>
 +
var entityMap = {
 +
  '&': '&amp;',
 +
  '<': '&lt;',
 +
  '>': '&gt;',
 +
  '"': '&quot;',
 +
  "'": '&#39;',
 +
  '/': '&#x2F;',
 +
  '`': '&#x60;',
 +
  '=': '&#x3D;',
 +
  'm': 'm',
 +
  'a': 'a',
 +
  'p': 'p'
 +
};
  
 +
function sanitizeHtml(string) {
 +
  return String(string).replace(/[&<>"'`=\/]/g, function(s) {
 +
      return entityMap[s];
 +
  });
 +
}
 +
 +
var selectedButton = '';
 +
 +
document.addEventListener("DOMContentLoaded", function() {
 +
  hideStrat();
 +
}, false);
 +
 +
function hideStrat() {
 +
  var tables = document.getElementsByClassName("wikitable sortable table");
 +
  for (const table of tables) {
 +
      var tr = table.getElementsByTagName("tr");
 +
      // console.log(th.lastChild)
 +
      for (var i = 0; i < tr.length; i++) {
 +
          // console.log(tr[i].lastChild)
 +
          tr[i].lastChild.style["display"] = "None"
 +
      }
 +
  }
 +
}
 +
 +
function filterA(filterStringA) {
 +
  filterStringA = sanitizeHtml(filterStringA).toLowerCase();
 +
  var tables = document.getElementsByClassName("wikitable sortable table jquery-tablesorter");
 +
  for (const table of tables) {
 +
      var tr = table.getElementsByTagName("tr");
 +
      var selectedValue = "";
 +
      // Reset
 +
      for (var i = 0; i < tr.length; i++) {
 +
          tr[i].style.display = "";
 +
      }
 +
 +
      if (filterStringA == "") continue;
 +
 +
      // Loop through all table rows, and hide those who don't match the search query
 +
      for (var i = 0; i < tr.length; i++) {
 +
          for (const td of tr[i].getElementsByTagName("td")) {
 +
              if (td) {
 +
                  var txtValue = td.textContent.trim().toLowerCase() || td.innerText.trim().toLowerCase();
 +
                  if (txtValue.indexOf(filterStringA) == -1) {
 +
                      tr[i].style.display = "none";
 +
                  } else {
 +
                      tr[i].style.display = "";
 +
                      selectedValue = txtValue;
 +
                      break;
 +
                  }
 +
 +
              }
 +
          }
 +
      }
 +
  } // end for
 +
  selectedButton = filterStringA;
 +
}
 +
 +
// Had to add sanitize flag for People & Process section
 +
function filterB(filterStringB) {
 +
  if (filterStringB.startsWith("People ")) {
 +
    if(filterStringB.endsWith(" Process")){
 +
      if(filterStringB.length == 16){
 +
        filterStringB = filterStringB.toLowerCase();
 +
      } else {
 +
        filterStringB = sanitizeHtml(filterStringB).toLowerCase();
 +
      }
 +
    } else {
 +
      filterStringB = sanitizeHtml(filterStringB).toLowerCase();
 +
    }
 +
  } else {
 +
    filterStringB = sanitizeHtml(filterStringB).toLowerCase();
 +
  }
 +
  console.log(filterStringB);
 +
 +
  filterA(selectedButton);
 +
  var tables = document.getElementsByClassName("wikitable sortable table jquery-tablesorter");
 +
  for (const table of tables) {
 +
      var tr = Array.from(table.getElementsByTagName("tr")).filter(function(row) {
 +
          return row.style.display !== "none";
 +
      });
 +
 +
      // Loop through all table rows, and hide those who don't match the search query
 +
      for (var i = 0; i < tr.length; i++) {
 +
          var td = tr[i].getElementsByTagName("td")[2];
 +
          if (td) {
 +
              var txtValue = td.textContent.trim().toLowerCase() || td.innerText.trim().toLowerCase();
 +
              if (txtValue.indexOf(filterStringB) == -1) {
 +
                  // console.log("AA");
 +
                  tr[i].style.display = "none";
 +
              } else {
 +
                  // console.log("NB");
 +
                  tr[i].style.display = "";
 +
              }
 +
          } //end td if
 +
      } // end for
 +
  }
 +
}
 +
 +
</script>
 +
</html>
 +
==Search Reports==
 +
<html>
 +
<input type="text" id="input" onkeyup="filterA(document.getElementById('input').value)" placeholder="Search for reports">
 +
</html>
 +
==Strategic Focus Area==
 +
<html>
 +
<button onclick="filterB('Strategy')">Strategy</button>
 +
<button onclick="filterB('People & Process')">People &  Process</button>
 +
<button onclick="filterB('Data')">Data</button>
 +
<button onclick="filterB('Security')">Security</button>
 +
<button onclick="filterB('Implementation')">Implementation</button>
 +
<button onclick="filterB('Technology')">Technology</button>
 +
<!-- <button onclick="filterB('Unification')">Unification</button> -->
 +
<button onclick="filterB('')">Reset</button>
 +
</html>

Revision as of 12:52, 5 January 2024

Search Reports

Strategic Focus Area