1 2function grid_accessibility(sender, evt, isWG) { 3 var grd = document.getElementById(sender.get_id()); 4 var tbls; 5 var ctrlTblCount = 0; 6 if (grd != null) { 7 tbls = grd.querySelectorAll('table'); 8 if (tbls.length > 0) tbls[0].role = "presentation"; 9 if (tbls.length > 1) tbls[1].role = "none"; 10 for (var idx = 0; idx < tbls.length; idx++) { 11 var cls = tbls[idx].getAttribute("class"); 12 if (cls != null && cls.indexOf("igdd_ControlArea") > -1) ctrlTblCount++; 13 } 14 15 } 16 17 if (tbls != null && tbls.length > (3 + ctrlTblCount)) { 18 var hdrs = tbls[2].querySelectorAll('th'); 19 20 var dest; 21 if (isWG) { 22 dest = hdrs[0].parentElement; 23 //return; 24 } 25 else { 26 dest = tbls[3 + ctrlTblCount].childNodes[0].childNodes[0]; //tbody > 1st tr ("sizerow") 27 } 28 var rowhtml = dest.innerHTML; 29 rowhtml = rowhtml.replace(/<td /g, '<th scope="col" '); 30 rowhtml = rowhtml.replace(/<\/td>/g, '</th>'); 31 rowhtml = rowhtml.replace(/style="/g, 'style="padding:0px 8px 0px 8px; ');//add in padding bc class no longer valid now they're th's 32 if (isWG) { 33 var tr = document.createElement('tr'); 34 tr.setAttribute("mkr", "sizeRow"); 35 tr.setAttribute("style", "font-size: 0px; height: 0px; display:block; overflow: hidden;"); 36 tr.innerHTML = rowhtml; 37 try { 38 tbls[3].childNodes[0].insertBefore(tr, tbls[3].childNodes[0].childNodes[0]); 39 console.log("inserted size row for WG grid"); 40 } 41 catch (e) { 42 //console.log(tbls[2].getAttribute("data-ig")); 43 //console.log(tbls[3].getAttribute("data-ig")); 44 //if (tbls.length > 3) console.log(tbls[4].getAttribute("data-ig")); 45 try { 46 tbls[4].childNodes[0].insertBefore(tr, tbls[4].childNodes[0].childNodes[0]); 47 console.log("retrying insert of size row for WG grid"); 48 } 49 catch (e) { 50 console.log("failed to add accessibility header tags for " + sender.get_id()); 51 } 52 } 53 dest = tr; 54 } 55 else { 56 dest.innerHTML = rowhtml; 57 } 58 59 for (var idx = 0; idx < hdrs.length; idx++) { 60 var th = dest.childNodes[idx]; 61 if (th == null) { alert('missing hdr ' + idx.toString()); continue; } 62 if (isWG) { 63 th.removeAttribute("data-ig"); 64 th.removeAttribute("key"); 65 th.style.fontSize = "0px"; 66 th.style.border = "0px"; 67 } 68 var chkbx = hdrs[idx].querySelector("input[type='checkbox']"); 69 if (chkbx) { 70 th.innerHTML = "Item Select"; 71 } 72 else { 73 th.innerHTML = hdrs[idx].innerHTML; 74 } 75 } 76 } 77} 78 79function dialog_accessibility(sender, evt) { 80 var g = document.getElementById(sender.get_id()); 81 var c; 82 if (g != null) { 83 c = g.querySelectorAll('table'); 84 if (c.length > 0) { c[0].role = "none"; c[0].attributes["aria-label"] = "Window Title"; } 85 if (c.length > 1) c[1].role = "presentation"; 86 } 87} 88 89function webcbo_accessibility(sender, evt) { 90 var o = document.getElementById(sender.get_id()); 91 if (o != null) { 92 c = o.querySelectorAll('table'); 93 if (c.length > 0) c[0].role = "presentation"; 94 var v = o.getAttribute("aria-labelledby"); 95 var bReq = (o.getAttribute("ariareqd") == "true"); 96 if (v) sender._elements.Input.setAttribute("aria-labelledby", v); 97 if (bReq) sender._elements.Input.setAttribute("aria-required", "true"); 98 } 99} 100 101function webtab_accessibility(sender, evt) { 102 var t = document.getElementById(sender.get_id()); 103 if (t != null) { 104 var tabs = t.querySelectorAll('.igtab_ElectricBlueTHContent'); 105 for (var idx = 0; idx < tabs.length; idx++) { 106 tabs[idx].tabIndex = idx + 1; 107 } 108 } 109 var m = sender.get_id() + '.i'; 110 var c = document.getElementById(m); 111 if (c != null) { 112 c.title = 'not user accessible'; 113 c.style.display = 'none'; 114 } 115} 116 117function webmnu_accessibility(sender, evt) { 118 var m = sender.get_id(); 119 var m1 = document.getElementById(m); 120 if (m1 != null) { 121 var c = m1.querySelector('input'); 122 if (c != null) { 123 c.title = 'not user accessible'; 124 c.style.display = 'none'; 125 } 126 } 127} 128 129function webdp_accessibility(sender, evt) { 130 var d = document.getElementById(sender.get_id()); 131 d.setAttribute("role", "grid"); 132 var bReq = (d.getAttribute("ariareqd") == "true"); 133 var lbl = d.getAttribute("aria-labelledby"); 134 var i = d.querySelector('input'); 135 var a = d.getAttribute("title"); 136 if (d != null && a != null) { 137 var i = d.querySelector('input'); 138 if (i != null) { 139 i.setAttribute("aria-label", a); 140 if (bReq) i.setAttribute("aria-required", "true"); 141 if (lbl) i.setAttribute("aria-labelledby", lbl); 142 if (a) i.setAttribute("title", a); 143 } 144 } 145}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.