1 line
6.2 KiB
Plaintext
1 line
6.2 KiB
Plaintext
var MMDropDown;(function(){function u(t,r,u){u=u||"*";var e=t.getElementsByTagName(u),f=[];return i(e,function(t){n(t,r)&&f.push(t)}),f}function y(n){return c[n]||(c[n]=new RegExp("\\b"+n+"\\b")),c[n]}function n(n,t){var i=n.className||"";return y(t).test(i)}function s(t,i){t.className=t.className||"";n(t,i)||(t.className+=" "+i)}function f(n,t){var i=n.className||"",r=y(t);n&&i&&t&&(n.className=n.className.replace(r,"").replace(/\s+/," "))}function t(n){return sj_sp(n),sj_pd(n),!1}function tt(n){return(n=n||_w.event,n.pageX||n.pageY)?{x:n.pageX,y:n.pageY}:{x:n.clientX+_d.body.scrollLeft-_d.body.clientLeft,y:n.clientY+_d.body.scrollTop-_d.body.clientTop}}function r(n){return n.clientHeight||n.innerHeight}function p(n){return n.offsetY||n.layerY}function i(n,t,i){i=i||this;for(var r=0;r<n.length;r++)t.call(i,n[r],r)}function w(n,t){var i=function(){};i.prototype=t.prototype;n.prototype=new i;n.prototype.constructor=n}function h(){var n={};this.emit=function(t){if(n[t]){var r=Array.prototype.slice.call(arguments,1);i(n[t],function(n){n.apply(this,r)},this)}};this.addL=function(t,i){n[t]||(n[t]=[]);n[t].push(i)}}function l(n){return n.keyCode||n.charCode||n.which}function b(r,u){function w(){y=null;i(c,function(t){if(n(t,"ftrCP")){var r=t.childNodes;i(r,function(n){f(n,"ftrVS")})}else f(t,"ftrVS")})}function k(n){var i,r;if(n&&(l(n)===v||p)){i=p;switch(l(n)){case g:e.up();break;case nt:e.down();break;case d:r=sj_et(n);e.setSelected(r);i=!1;break;case a:y?e.emit("enter",y):i=!1;break;case v:e.hide();break;default:i=!1}i&&t(n)}}function tt(){sj_ue(_d,"keydown",k);sj_evt.unbind("ajax.unload",tt)}function rt(n){var t=null,i;if(ft(n))t=c[0],t.tagName!=="A"&&(t=c[1]);else if(t=it(c,n),t||this.colorSelections&&(t=it(this.colorSelections,n)),t&&t.tagName!=="A"){if(t.nextSibling&&t.nextSibling.tagName==="A")return t.nextSibling;i=ut();i.length>0&&(this.colorSelections=i,t=i[0])}return t}function ut(){var n=c[c.length-1];return n.getElementsByTagName("A")}function ft(n){var t=n.getAttribute("delid");return t?!0:b(c,n)>=0?!1:this.colorSelections&&b(this.colorSelections,n)>=0?!1:!0}function it(n,t){var i=b(n,t);return i>=0&&i+1<n.length?n[i+1]:null}function b(n,t){for(var i=0;i<n.length;i++)if(n[i]==t)return i;return-1}h.call(this);var e=this,p=!1,y=null,c=u.childNodes[0].childNodes;c.length!=0&&(sj_be(r,"click",function(n){t(n);p?e.hide():e.show()}),sj_be(r,"keyup",function(n){t(n);l(n)===a&&(p?e.hide():e.show())}),i(c,function(t){sj_be(t,"mouseover",function(){w();n(t,"ftrNR")||n(t,"ftrCP")||e.sel(t)})}),sj_be(_d,"keydown",k),sj_be(u,"focusout",function(){sb_st(function(){p&&!u.contains(_d.activeElement)&&e.hide()},10)}),sj_evt.bind("ajax.unload",tt),this.hide=function(){s(u,"hidden");o&&f(o,"b_scope_dropdown_expanded");r.getAttribute("aria-expanded")==="true"&&r.focus();r.setAttribute("aria-expanded","false");p=!1;w();sj_evt.fire("focusDrop",u);this.emit("close",this)},sj_evt.bind("focusChange",function(n){n[1]!=u&&e.hide()}),this.show=function(){sj_evt.fire("focusChange",u);f(u,"hidden");r.setAttribute("aria-expanded","true");p=!0;this.emit("open",this)},this.up=function(){var t=y?y.previousSibling:c[c.length-1];!t&&n(y,"ftrCPS")&&(t=y.parentNode.previousSibling);t&&(n(t,"ftrCP")&&(t=t.childNodes[t.childNodes.length-1]),this.sel(t),this.emit("up",t),t.focus())},this.down=function(){var t=y?y.nextSibling:c[0];t&&(n(t,"ftrCP")&&(t=t.childNodes[0]),this.sel(t),this.emit("down",t),t.focus())},this.setSelected=function(n){y=rt(n)},this.sel=function(n){w();y=n;s(n,"ftrVS")})}function k(n){function v(n){return t(n),f-=n.wheelDelta?n.wheelDelta/5:-n.detail*10,o.update(),!1}function y(){s&&(s=!1,o.emit("dragend"))}function w(n){if(s){var t=tt(n).y,r=sj_go(i,"Top");f-=r+a-t;o.update()}}function b(n){return s&&t(n),!1}function k(){sj_ue(_d,"mouseup",y);sj_ue(_d,"mousemove",w);sj_ue(_d,"selectstart",b);sj_evt.unbind("ajax.unload",k)}h.call(this);var o=this,u=n.childNodes[0],e=sj_ce("div"),i=sj_ce("div");e.className="ftrSbR";i.className="ftrSb";e.appendChild(i);n.appendChild(e);var f=0,c=0,l=0,s=!1,a=0;this.update=function(){var n=r(u);c=Math.max(n*n/u.scrollHeight,10);i.style.height=c+"px";u.scrollTop=f;f=u.scrollTop;e.style.height=n-10+"px";l=f/(u.scrollHeight-n)*(r(e)-r(i));i.style.top=l+"px"};this.scrollTo=function(n){f=n;this.update()};this.ctr=function(n){var t=sj_go(n,"Top"),i=sj_go(u,"Top"),e=t-i-f,o=t-i;e<0?f=o:e-r(u)+r(n)>0&&(f=o-r(u)+r(n));this.update()};sj_be(e,"mousedown",function(n){t(n);var f=p(n)/r(e)*u.scrollHeight-r(i);o.scrollTo(f)});sj_be(i,"mousedown",t);sj_be(i,"click",t);sj_be(e,"click",t);sj_be(n,"mousewheel",v,!0);sj_be(n,"DOMMouseScroll",v,!0);sj_be(i,"mousedown",function(n){return t(n),s=!0,a=p(n),o.emit("dragstart"),!1});sj_be(_d,"mouseup",y);sj_be(_d,"mousemove",w);sj_be(_d,"selectstart",b);sj_evt.bind("ajax.unload",k)}function it(){function l(n){i(a,function(t){n!==t&&t.hide()})}function p(){sb_ie&&c||l();c=!1}function w(){sj_ue(_d,"click",p);sj_evt.unbind("ajax.unload",w)}var r=u(e,"ftrDC","div"),d=u(e,"ftrH_MmVert","span"),a=[],v=[],h=!1,y,c;i(d,function(t,i){var e=new b(t,r[i]),c=n(r[i],"ftrS")?new k(r[i]):null;a.push(e),function(i,r,e){r.addL("open",function(){var n,f;l(r);s(t,"ftrHh");o&&s(o,"b_scope_dropdown_expanded");n=u(e,"ftrSe");n.length>0&&(r.sel(n[0]),i&&i.ctr(n[0].parentNode));f=e.childNodes[0];t.offsetWidth>f.offsetWidth&&(f.style.width=t.offsetWidth+"px");h=!0});sj_be(t,"mouseover",function(){h&&r.show()});sj_be(t,"focus",function(){h&&l(r)});r.addL("close",function(){f(t,"ftrHh");h=!1});r.addL("enter",function(t){if((!n(t.parentNode.parentNode,"ftrDC")||!n(t.parentNode.parentNode.previousSibling,"ftrHR"))&&(n(t,"ftrCPS")&&(t=t.childNodes[0]),t&&t.tagName==="A")){var i=!1;t.onmousedown?(i=t.onmousedown(),i&&(_w.location.href=t.href)):t.click()}});i&&(r.addL("open",function(){i.update()}),v.push(i),r.addL("up",function(n){i.ctr(n)}),r.addL("down",function(n){i.ctr(n)}))}(c,e,r[i])});y=u(e,"ftrNR");i(y,function(n){sj_be(n,"click",t)});c=!1;i(v,function(n){n.addL("dragend",function(){c=!0})});sj_be(_d,"click",p);sj_evt.bind("ajax.unload",w)}function rt(){var n=u(_d.body,"ftrDC","div"),t=u(e,"ans","div");i(t,function(t,i){t.appendChild(n[i])})}var d=9,a=13,v=27,g=38,nt=40,e=_ge("ftrB"),o=_qs(".b_scopebar"),c={};w(b,h);w(k,h);rt();it()})(MMDropDown||(MMDropDown={})) |