/usr/share/javascript/yui3/node-menunav/node-menunav-min.js is in libjs-yui3-min 3.5.1-1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 | /*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("node-menunav",function(d){var L=d.UA,T=d.later,am=d.ClassNameManager.getClassName,r="menu",g="menuitem",ai="hidden",s="parentNode",v="children",aa="offsetHeight",ad="offsetWidth",ao="px",F="id",i=".",e="handledMouseOut",R="handledMouseOver",z="active",ak="label",C="a",W="mousedown",ap="keydown",ac="click",q="",u="first-of-type",aq="role",n="presentation",ae="descendants",I="UI",U="activeDescendant",j="useARIA",X="aria-hidden",Z="content",B="host",G=U+"Change",V="autoSubmenuDisplay",t="mouseOutHideDelay",K=am(r),ag=am(r,ai),y=am(r,"horizontal"),aj=am(r,ak),J=am(r,ak,z),x=am(r,ak,(r+"visible")),k=am(g),a=am(g,z),H=i+K,ah=(i+am(r,"toggle")),M=i+am(r,Z),ar=i+aj,an=">"+M+">ul>li>a",o=">"+M+">ul>li>"+ar+">a:first-child";var l=function(Y){var au=Y.previous(),at;if(!au){at=Y.get(s).get(v);au=at.item(at.size()-1);}return au;};var A=function(Y){var at=Y.next();if(!at){at=Y.get(s).get(v).item(0);}return at;};var f=function(Y){var at=false;if(Y){at=Y.get("nodeName").toLowerCase()===C;}return at;};var p=function(Y){return Y.hasClass(k);};var S=function(Y){return Y.hasClass(aj);};var Q=function(Y){return Y.hasClass(y);};var N=function(Y){return Y.hasClass(x);};var P=function(Y){return f(Y)?Y:Y.one(C);};var ab=function(au,at,Y){var av;if(au){if(au.hasClass(at)){av=au;}if(!av&&Y){av=au.ancestor((i+at));}}return av;};var m=function(Y){return Y.ancestor(H);};var w=function(at,Y){return ab(at,K,Y);};var af=function(at,Y){var au;if(at){au=ab(at,k,Y);}return au;};var O=function(at,Y){var au;if(at){if(Y){au=ab(at,aj,Y);}else{au=ab(at,aj)||at.one((i+aj));}}return au;};var b=function(at,Y){var au;if(at){au=af(at,Y)||O(at,Y);}return au;};var c=function(Y){return b(Y.one("li"));};var E=function(Y){return p(Y)?a:J;};var D=function(Y,at){return Y&&!Y[R]&&(Y.compareTo(at)||Y.contains(at));};var h=function(at,Y){return at&&!at[e]&&(!at.compareTo(Y)&&!at.contains(Y));};var al=function(){al.superclass.constructor.apply(this,arguments);};al.NAME="nodeMenuNav";al.NS="menuNav";al.SHIM_TEMPLATE_TITLE="Menu Stacking Shim";al.SHIM_TEMPLATE='<iframe frameborder="0" tabindex="-1" class="'+am("shim")+'" title="'+al.SHIM_TEMPLATE_TITLE+'" src="javascript:false;"></iframe>';al.ATTRS={useARIA:{value:true,writeOnce:true,lazyAdd:false,setter:function(aw){var at=this.get(B),ax,Y,av,au;if(aw){at.set(aq,r);at.all("ul,li,"+M).set(aq,n);at.all((i+am(g,Z))).set(aq,g);at.all((i+aj)).each(function(ay){ax=ay;Y=ay.one(ah);if(Y){Y.set(aq,n);ax=Y.previous();}ax.set(aq,g);ax.set("aria-haspopup",true);av=ay.next();if(av){av.set(aq,r);ax=av.previous();Y=ax.one(ah);if(Y){ax=Y;}au=d.stamp(ax);if(!ax.get(F)){ax.set(F,au);}av.set("aria-labelledby",au);av.set(X,true);}});}}},autoSubmenuDisplay:{value:true,writeOnce:true},submenuShowDelay:{value:250,writeOnce:true},submenuHideDelay:{value:250,writeOnce:true},mouseOutHideDelay:{value:750,writeOnce:true}};d.extend(al,d.Plugin.Base,{_rootMenu:null,_activeItem:null,_activeMenu:null,_hasFocus:false,_blockMouseEvent:false,_currentMouseX:0,_movingToSubmenu:false,_showSubmenuTimer:null,_hideSubmenuTimer:null,_hideAllSubmenusTimer:null,_firstItem:null,initializer:function(au){var av=this,aw=this.get(B),at=[],Y;if(aw){av._rootMenu=aw;aw.all("ul:first-child").addClass(u);aw.all(H).addClass(ag);at.push(aw.on("mouseover",av._onMouseOver,av));at.push(aw.on("mouseout",av._onMouseOut,av));at.push(aw.on("mousemove",av._onMouseMove,av));at.push(aw.on(W,av._toggleSubmenuDisplay,av));at.push(d.on("key",av._toggleSubmenuDisplay,aw,"down:13",av));at.push(aw.on(ac,av._toggleSubmenuDisplay,av));at.push(aw.on("keypress",av._onKeyPress,av));at.push(aw.on(ap,av._onKeyDown,av));Y=aw.get("ownerDocument");at.push(Y.on(W,av._onDocMouseDown,av));at.push(Y.on("focus",av._onDocFocus,av));this._eventHandlers=at;av._initFocusManager();}},destructor:function(){var Y=this._eventHandlers;if(Y){d.Array.each(Y,function(at){at.detach();});this._eventHandlers=null;}this.get(B).unplug("focusManager");},_isRoot:function(Y){return this._rootMenu.compareTo(Y);},_getTopmostSubmenu:function(av){var au=this,Y=m(av),at;if(!Y){at=av;}else{if(au._isRoot(Y)){at=av;}else{at=au._getTopmostSubmenu(Y);}}return at;},_clearActiveItem:function(){var at=this,Y=at._activeItem;if(Y){Y.removeClass(E(Y));}at._activeItem=null;},_setActiveItem:function(at){var Y=this;if(at){Y._clearActiveItem();at.addClass(E(at));Y._activeItem=at;}},_focusItem:function(au){var at=this,Y,av;if(au&&at._hasFocus){Y=m(au);av=P(au);if(Y&&!Y.compareTo(at._activeMenu)){at._activeMenu=Y;at._initFocusManager();}at._focusManager.focus(av);}},_showMenu:function(av){var Y=m(av),au=av.get(s),at=au.getXY();if(this.get(j)){av.set(X,false);}if(Q(Y)){at[1]=at[1]+au.get(aa);}else{at[0]=at[0]+au.get(ad);}av.setXY(at);if(L.ie<8){if(L.ie===6&&!av.hasIFrameShim){av.appendChild(d.Node.create(al.SHIM_TEMPLATE));av.hasIFrameShim=true;}av.setStyles({height:q,width:q});av.setStyles({height:(av.get(aa)+ao),width:(av.get(ad)+ao)});}av.previous().addClass(x);av.removeClass(ag);},_hideMenu:function(av,at){var au=this,aw=av.previous(),Y;aw.removeClass(x);if(at){au._focusItem(aw);au._setActiveItem(aw);}Y=av.one((i+a));if(Y){Y.removeClass(a);}av.setStyles({left:q,top:q});av.addClass(ag);if(au.get(j)){av.set(X,true);}},_hideAllSubmenus:function(at){var Y=this;at.all(H).each(d.bind(function(au){Y._hideMenu(au);},Y));},_cancelShowSubmenuTimer:function(){var at=this,Y=at._showSubmenuTimer;if(Y){Y.cancel();at._showSubmenuTimer=null;}},_cancelHideSubmenuTimer:function(){var Y=this,at=Y._hideSubmenuTimer;if(at){at.cancel();Y._hideSubmenuTimer=null;}},_initFocusManager:function(){var av=this,ax=av._rootMenu,at=av._activeMenu||ax,aw=av._isRoot(at)?q:("#"+at.get("id")),Y=av._focusManager,au,ay,az;if(Q(at)){ay=aw+an+","+aw+o;au={next:"down:39",previous:"down:37"};}else{ay=aw+an;au={next:"down:40",previous:"down:38"};}if(!Y){ax.plug(d.Plugin.NodeFocusManager,{descendants:ay,keys:au,circular:true});Y=ax.focusManager;az="#"+ax.get("id")+H+" a,"+ah;ax.all(az).set("tabIndex",-1);Y.on(G,this._onActiveDescendantChange,Y,this);Y.after(G,this._afterActiveDescendantChange,Y,this);
av._focusManager=Y;}else{Y.set(U,-1);Y.set(ae,ay);Y.set("keys",au);}},_onActiveDescendantChange:function(at,Y){if(at.src===I&&Y._activeMenu&&!Y._movingToSubmenu){Y._hideAllSubmenus(Y._activeMenu);}},_afterActiveDescendantChange:function(at,Y){var au;if(at.src===I){au=b(this.get(ae).item(at.newVal),true);Y._setActiveItem(au);}},_onDocFocus:function(aw){var av=this,Y=av._activeItem,au=aw.target,at;if(av._rootMenu.contains(au)){if(av._hasFocus){at=m(au);if(!av._activeMenu.compareTo(at)){av._activeMenu=at;av._initFocusManager();av._focusManager.set(U,au);av._setActiveItem(b(au,true));}}else{av._hasFocus=true;Y=b(au,true);if(Y){av._setActiveItem(Y);}}}else{av._clearActiveItem();av._cancelShowSubmenuTimer();av._hideAllSubmenus(av._rootMenu);av._activeMenu=av._rootMenu;av._initFocusManager();av._focusManager.set(U,0);av._hasFocus=false;}},_onMenuMouseOver:function(av,au){var at=this,Y=at._hideAllSubmenusTimer;if(Y){Y.cancel();at._hideAllSubmenusTimer=null;}at._cancelHideSubmenuTimer();if(av&&!av.compareTo(at._activeMenu)){at._activeMenu=av;if(at._hasFocus){at._initFocusManager();}}if(at._movingToSubmenu&&Q(av)){at._movingToSubmenu=false;}},_hideAndFocusLabel:function(){var au=this,at=au._activeMenu,Y;au._hideAllSubmenus(au._rootMenu);if(at){Y=au._getTopmostSubmenu(at);au._focusItem(Y.previous());}},_onMenuMouseOut:function(az,ax){var aw=this,au=aw._activeMenu,ay=ax.relatedTarget,Y=aw._activeItem,av,at;if(au&&!au.contains(ay)){av=m(au);if(av&&!av.contains(ay)){if(aw.get(t)>0){aw._cancelShowSubmenuTimer();aw._hideAllSubmenusTimer=T(aw.get(t),aw,aw._hideAndFocusLabel);}}else{if(Y){at=m(Y);if(!aw._isRoot(at)){aw._focusItem(at.previous());}}}}},_onMenuLabelMouseOver:function(av,Y){var at=this,aw=at._activeMenu,az=at._isRoot(aw),au=(at.get(V)&&az||!az),ax=at.get("submenuShowDelay"),ay;var aA=function(aB){at._cancelHideSubmenuTimer();at._cancelShowSubmenuTimer();if(!N(av)){ay=av.next();if(ay){at._hideAllSubmenus(aw);at._showSubmenuTimer=T(aB,at,at._showMenu,ay);}}};at._focusItem(av);at._setActiveItem(av);if(au){if(at._movingToSubmenu){d.message("Pause path");at._hoverTimer=T(ax,at,function(){aA(0);});}else{aA(ax);}}},_onMenuLabelMouseOut:function(aw,ay){var ax=this,at=ax._isRoot(ax._activeMenu),av=(ax.get(V)&&at||!at),az=ay.relatedTarget,au=aw.next(),Y=ax._hoverTimer;if(Y){Y.cancel();}ax._clearActiveItem();if(av){if(ax._movingToSubmenu&&!ax._showSubmenuTimer&&au){ax._hideSubmenuTimer=T(ax.get("submenuHideDelay"),ax,ax._hideMenu,au);}else{if(!ax._movingToSubmenu&&au&&(!az||(az&&!au.contains(az)&&!az.compareTo(au)))){ax._cancelShowSubmenuTimer();ax._hideMenu(au);}}}},_onMenuItemMouseOver:function(av,ax){var aw=this,au=aw._activeMenu,Y=aw._isRoot(au),at=(aw.get(V)&&Y||!Y);aw._focusItem(av);aw._setActiveItem(av);if(at&&!aw._movingToSubmenu){aw._hideAllSubmenus(au);}},_onMenuItemMouseOut:function(Y,at){this._clearActiveItem();},_onVerticalMenuKeyDown:function(Y){var at=this,ax=at._activeMenu,aC=at._rootMenu,au=Y.target,aw=false,aB=Y.keyCode,az,av,ay,aA;switch(aB){case 37:av=m(ax);if(av&&Q(av)){at._hideMenu(ax);ay=l(ax.get(s));aA=b(ay);if(aA){if(S(aA)){az=aA.next();if(az){at._showMenu(az);at._focusItem(c(az));at._setActiveItem(c(az));}else{at._focusItem(aA);at._setActiveItem(aA);}}else{at._focusItem(aA);at._setActiveItem(aA);}}}else{if(!at._isRoot(ax)){at._hideMenu(ax,true);}}aw=true;break;case 39:if(S(au)){az=au.next();if(az){at._showMenu(az);at._focusItem(c(az));at._setActiveItem(c(az));}}else{if(Q(aC)){az=at._getTopmostSubmenu(ax);ay=A(az.get(s));aA=b(ay);at._hideAllSubmenus(aC);if(aA){if(S(aA)){az=aA.next();if(az){at._showMenu(az);at._focusItem(c(az));at._setActiveItem(c(az));}else{at._focusItem(aA);at._setActiveItem(aA);}}else{at._focusItem(aA);at._setActiveItem(aA);}}}}aw=true;break;}if(aw){Y.preventDefault();}},_onHorizontalMenuKeyDown:function(ay){var ax=this,av=ax._activeMenu,at=ay.target,Y=b(at,true),aw=false,az=ay.keyCode,au;if(az===40){ax._hideAllSubmenus(av);if(S(Y)){au=Y.next();if(au){ax._showMenu(au);ax._focusItem(c(au));ax._setActiveItem(c(au));}aw=true;}}if(aw){ay.preventDefault();}},_onMouseMove:function(at){var Y=this;T(10,Y,function(){Y._currentMouseX=at.pageX;});},_onMouseOver:function(aw){var av=this,at,Y,ay,au,ax;if(av._blockMouseEvent){av._blockMouseEvent=false;}else{at=aw.target;Y=w(at,true);ay=O(at,true);ax=af(at,true);if(D(Y,at)){av._onMenuMouseOver(Y,aw);Y[R]=true;Y[e]=false;au=m(Y);if(au){au[e]=true;au[R]=false;}}if(D(ay,at)){av._onMenuLabelMouseOver(ay,aw);ay[R]=true;ay[e]=false;}if(D(ax,at)){av._onMenuItemMouseOver(ax,aw);ax[R]=true;ax[e]=false;}}},_onMouseOut:function(at){var au=this,aw=au._activeMenu,aB=false,av,ax,az,Y,ay,aA;au._movingToSubmenu=(aw&&!Q(aw)&&((at.pageX-5)>au._currentMouseX));av=at.target;ax=at.relatedTarget;az=w(av,true);Y=O(av,true);aA=af(av,true);if(h(Y,ax)){au._onMenuLabelMouseOut(Y,at);Y[e]=true;Y[R]=false;}if(h(aA,ax)){au._onMenuItemMouseOut(aA,at);aA[e]=true;aA[R]=false;}if(Y){ay=Y.next();if(ay&&ax&&(ax.compareTo(ay)||ay.contains(ax))){aB=true;}}if(h(az,ax)||aB){au._onMenuMouseOut(az,at);az[e]=true;az[R]=false;}},_toggleSubmenuDisplay:function(au){var av=this,aw=au.target,at=O(aw,true),Y=au.type,aA,az,ay,aB,aC,ax;if(at){aA=f(aw)?aw:aw.ancestor(f);if(aA){ay=aA.getAttribute("href",2);aB=ay.indexOf("#");aC=ay.length;if(aB===0&&aC>1){ax=ay.substr(1,aC);az=at.next();if(az&&(az.get(F)===ax)){if(Y===W||Y===ap){if((L.opera||L.gecko||L.ie)&&Y===ap&&!av._preventClickHandle){av._preventClickHandle=av._rootMenu.on("click",function(aD){aD.preventDefault();av._preventClickHandle.detach();av._preventClickHandle=null;});}if(Y==W){au.preventDefault();au.stopImmediatePropagation();av._hasFocus=true;}if(av._isRoot(m(aw))){if(N(at)){av._hideMenu(az);av._focusItem(at);av._setActiveItem(at);}else{av._hideAllSubmenus(av._rootMenu);av._showMenu(az);av._focusItem(c(az));av._setActiveItem(c(az));}}else{if(av._activeItem==at){av._showMenu(az);av._focusItem(c(az));av._setActiveItem(c(az));}else{if(!at._clickHandle){at._clickHandle=at.on("click",function(){av._hideAllSubmenus(av._rootMenu);
av._hasFocus=false;av._clearActiveItem();at._clickHandle.detach();at._clickHandle=null;});}}}}if(Y===ac){au.preventDefault();}}}}}},_onKeyPress:function(Y){switch(Y.keyCode){case 37:case 38:case 39:case 40:Y.preventDefault();break;}},_onKeyDown:function(ax){var aw=this,Y=aw._activeItem,at=ax.target,av=m(at),au;if(av){aw._activeMenu=av;if(Q(av)){aw._onHorizontalMenuKeyDown(ax);}else{aw._onVerticalMenuKeyDown(ax);}if(ax.keyCode===27){if(!aw._isRoot(av)){if(L.opera){T(0,aw,function(){aw._hideMenu(av,true);});}else{aw._hideMenu(av,true);}ax.stopPropagation();aw._blockMouseEvent=L.gecko?true:false;}else{if(Y){if(S(Y)&&N(Y)){au=Y.next();if(au){aw._hideMenu(au);}}else{aw._focusManager.blur();aw._clearActiveItem();aw._hasFocus=false;}}}}}},_onDocMouseDown:function(av){var au=this,at=au._rootMenu,Y=av.target;if(!(at.compareTo(Y)||at.contains(Y))){au._hideAllSubmenus(at);if(L.webkit){au._hasFocus=false;au._clearActiveItem();}}}});d.namespace("Plugin");d.Plugin.NodeMenuNav=al;},"3.5.1",{requires:["node","classnamemanager","node-focusmanager","plugin"]});
|