1var SkipLinks = (function() { 2 3 var closeTimer; 4 var hideTop 5 6 var ricercaNodeLink; 7 var centraleNodeLink; 8 var sxNodeLink; 9 var dxNodeLink; 10 11 function buildNode(label, href, accessKey) { 12 var nodeLI = document.createElement("li"); 13 var nodeA = document.createElement('a'); 14 nodeA.href = href; 15 nodeA.title = ""; 16 nodeA.accessKey = accessKey; 17 nodeA.appendChild(document.createTextNode(label)); 18 nodeLI.appendChild(nodeA); 19 return nodeLI; 20 } 21 22 function build(ricLbl, centraleLbl, sxLbl, dxLbl) { 23 var skiplinks = find.id("skiplinks"); 24 25 ricercaNodeLink = buildNode(ricLbl, "#psspaziocentrale", "3"); 26 centraleNodeLink = buildNode(centraleLbl, "#pagecentercontent", "5"); 27 28 skiplinks.appendChild(ricercaNodeLink); 29 skiplinks.appendChild(centraleNodeLink); 30 31 sxNodeLink = buildNode(sxLbl, "#pageleftcontent", "6"); 32 dxNodeLink = buildNode(dxLbl, "#pagerightcontent", "7"); 33 34 set.event(skiplinks, "actualize", function(e) { 35 if (sxNodeLink.parentNode) { 36 sxNodeLink.parentNode.removeChild(sxNodeLink); 37 } 38 39 if (dxNodeLink.parentNode) { 40 dxNodeLink.parentNode.removeChild(dxNodeLink); 41 } 42 43 var skiplinks = document.querySelector("#skiplinks"); 44 45 var leftContent = document.querySelector("#pageleftcontent"); 46 var rightContent = document.querySelector("#pagerightcontent"); 47 48 if(isValid(leftContent)) { 49 skiplinks.appendChild(sxNodeLink); 50 } 51 52 if(isValid(rightContent)) { 53 skiplinks.appendChild(dxNodeLink); 54 } 55 56 var size = get.size(skiplinks); 57 // aggiungo 50 come margine di sicurezza 58 hideTop = -(size.height + 50); 59 set.style(skiplinks, "top", hideTop + "px"); 60 }); 61 62 set.event(skiplinks, "focus", function(e) { 63 var top = get.style(skiplinks, "top"); 64 if (top === 0) { 65 return true; 66 } 67 $(skiplinks).animate({ "top" : 0 }, 200); 68 }); 69 70 set.event(skiplinks, "blur", function(e) { 71 clear.timeout(closeTimer); 72 closeTimer = set.timeout(function() { 73 var focus = query(":focus", skiplinks); 74 if (focus.length === 0) { 75 $(skiplinks).animate({ "top" : hideTop }, 200); 76 } 77 }, 200); 78 }); 79 } 80 81 function isValid(column) { 82 if (!is.element(column) || 83 nav.childs(column).length === 0 || 84 !is.visible(column) || 85 !is.visible(column.parentNode)) { 86 return false; 87 } 88 return true; 89 } 90 91 return { 92 init: function(ricLbl, centraleLbl, sxLbl, dxLbl) { 93 build(ricLbl, centraleLbl, sxLbl, dxLbl); 94 } 95 } 96}()); 97
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.