PageSourceSearch

https://metodebogen.dk/typo3conf/ext/ungdomssitet_glossary/Resources/Public/Js/glossary.yui2.js?1499282499

js metodebogen.dk collected 2026-10-08 12:01:18 UTC 4,849 bytes, 10 lines download raw bytes

1(function(){var t,a,i,k,h,e,u,l,o,m,j,d,g,q,r,v,s,w,p,n;a=YAHOO.util.Dom;i=YAHOO.util.Event;t=YAHOO.util.CustomEvent;u=function(){if(typeof console!=="undefined"&&typeof console.debug==="function")return console.debug.apply(console,arguments)};p=function(){var c;(c=a.getAttribute(document.getElementsByTagName("html")[0],"xml:lang"))||(c=a.getAttribute(document.getElementsByTagName("html")[0],"lang"));switch(c){case "da":return{"Hide glossary panel":"Skjul ordforklaring","Pin glossary panel":"L\u00e5s ordforklaring",
2"Un-pin glossary panel":"Skjul ordforklaring","Show all items":"Vis alle ordforklaringer"}}}();n=function(a){return p&&p[a]?p[a]:a};k=function(){function a(f,b){b=YAHOO.lang.merge({visible:false,draggable:true,dragOnly:true,close:false,constraintoviewport:true,width:"20em"},b||{});a.superclass.constructor.call(this,f,b)}return a}();YAHOO.lang.extend(k,YAHOO.widget.Panel,{init:function(c,f){var b;k.superclass.init.call(this,c);a.addClass(this.element,"glossary-panel");f&&this.cfg.applyConfig(f,true);
3this.isPinned=false;this.setHeader("");this.setBody("");a.addClass(this.element,"glossary-panel");if(!this.cfg.getProperty("noFooter"))b=document.createElement("span"),a.addClass(b,"action"),a.addClass(b,"show-all-items"),b.innerHTML=n("Show all items"),i.on(b,"click",w,this,true),this.setFooter(b);a.addClass(this.body,"glossary-content");this.cfg.getProperty("pinnable")&&(this.createPin(),this.dragEvent.subscribe(function(){this.isPinned=true;a.addClass(this.element,"pinned");return a.setAttribute(this.pin,
4"title",n("Hide glossary panel"))}));if(this.cfg.getProperty("pinned"))return this.isPinned=true,a.addClass(this.element,"pinned")},initDefaultConfig:function(){k.superclass.initDefaultConfig.call(this);this.cfg.addProperty("pinnable",{value:false,validator:YAHOO.lang.isBoolean});this.cfg.addProperty("pinned",{value:false,validator:YAHOO.lang.isBoolean});return this.cfg.addProperty("noFooter",{value:false,validator:YAHOO.lang.isBoolean})},initEvents:function(){k.superclass.initEvents.call(this);this.unpinEvent=
5this.createEvent("unpin");return this.unpinEvent.signature=t.LIST},createPin:function(){this.pin=document.createElement("a");a.setAttribute(this.pin,"href","#");a.setAttribute(this.pin,"title",n("Pin glossary panel"));a.addClass(this.pin,"panel-pin");this.element.firstChild.appendChild(this.pin);return i.on(this.pin,"click",this.togglePinned,this,true)},togglePinned:function(c){(this.isPinned=!this.isPinned)?(a.addClass(this.element,"pinned"),a.setAttribute(this.pin,"title",n("Un-pin glossary panel"))):
6(this.unpinEvent.fire(),a.removeClass(this.element,"pinned"),a.setAttribute(this.pin,"title",n("Pin glossary panel")));i.preventDefault(c);return false},setGlossaryItem:function(a){this.setHeader(a.term);return this.setBody(a.content)}});d=g=e=h=null;w=function(){h||(h=new k("allGlossaryItemsPanel",{pinned:true,close:true,noFooter:true,zindex:5,xy:[10,10],height:a.getViewportHeight()-40+"px",width:"30em"}),j&&h.setHeader(j.innerHTML),j&&j.textContent&&h.setHeader(j.textContent),o&&h.setBody(o.innerHTML),
7h.render(m.parentNode),h.showEvent.subscribe(function(){var c,f,b,d,e;c=0;e=a.getChildren(this.body);for(b=0,d=e.length;b<d;b++)f=e[b],c+=a.getRegion(f).height;c+=a.getRegion(this.header).height;c+=10;f=a.getViewportHeight()-40;return this.cfg.setProperty("height",Math.min(c,f)+"px")}));return h.show()};r=function(){d.isPinned||d.hide();a.removeClass(e,"current");e=null;if(g)return clearTimeout(g),g=null};q=function(){if(e)return g=setTimeout(r,200)};o=j=m=null;l={};s=0;v=function(){var c,f,b,d,e,
8g;if(m=a.get("glossary"))if(j=a.getFirstChildBy(m,function(b){return a.hasClass(b,"hd")}),o=a.getFirstChildBy(m,function(b){return a.hasClass(b,"bd")})){c=a.getFirstChild(o);g=a.getChildrenBy(c,function(a){return a.nodeName.toLowerCase()==="dt"});for(d=0,e=g.length;d<e;d++)b=g[d],c=a.getNextSibling(b),c.nodeName.toLowerCase()==="dd"&&(f=a.getAttribute(b,"data-key"))&&(l[f]={term:b.innerHTML,content:c.innerHTML});for(b in l)s++}return l};i.on(window,"load",function(){var c,f,b,h;v();if(l&&m)try{d=
9new k("glossaryTermPanel",{pinnable:true,context:[document.body,"tl","bl"],noFooter:s<=1});d.unpinEvent.subscribe(function(){return r()});d.render(m.parentNode);i.on(d.element,"mouseover",function(){if(g)return clearTimeout(g),g=null});i.on(d.element,"mouseout",q);f=a.getElementsByClassName("glossary-term","span");for(b=0,h=f.length;b<h;b++)c=f[b],c.glossaryTerm=a.getAttribute(c,"data-key");i.on(f,"mouseover",function(b){g&&(clearTimeout(g),g=null);e&&a.removeClass(e,"current");
9if((e=i.getTarget(b))&&
10l[e.glossaryTerm])return a.addClass(e,"current"),b=l[e.glossaryTerm],d.setGlossaryItem(b),d.isPinned||(b=d.cfg.getProperty("context"),b[0]=e,d.cfg.setProperty("context",b),d.align()),d.show()});return i.on(f,"mouseout",q)}catch(j){return u(j)}})}).call(this);

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.