PageSourceSearch

https://nmh.no/cpresources/3f0e6eae/js/verbb-ui.js?v=1790595525

js nmh.no collected 2026-10-02 03:34:31 UTC 3,128 bytes, 2 lines download raw bytes

1"undefined"==typeof Verbb&&(Verbb={}),function($){Verbb.UI=Garnish.Base.extend({init:function(){$("[data-vui-tabs]").each((function(t,e){new Verbb.UI.SimpleTabs($(e))}))}}),Verbb.UI.SimpleTabs=Garnish.Base.extend({$container:null,$ul:null,$tabs:null,$selectedTab:null,$focusableTab:null,init:function(t){this.$container=$(t),this.$ul=this.$container.find("> ul:first"),this.$tabs=this.$ul.find("> li > a"),this.$selectedTab=this.$tabs.filter(".sel:first"),this.$focusableTab=this.$tabs.filter("[tabindex=0]:first"),this.$container.data("tabs")&&(Garnish.log("Double-instantiating a tab manager on an element"),this.$container.data("tabs").destroy()),this.$container.data("tabs",this);for(let t=0;t<this.$tabs.length;t++){const e=this.$tabs.eq(t),s=e.attr("href");s&&"#"===s.charAt(0)&&(this.addListener(e,"keydown",(t=>{[Garnish.SPACE_KEY,Garnish.RETURN_KEY].includes(t.keyCode)&&(t.preventDefault(),this.selectTab(t.currentTarget))})),this.addListener(e,"click",(t=>{t.preventDefault();const e=$(t.currentTarget);this.selectTab(t.currentTarget),this.makeTabFocusable(t.currentTarget)})),s.substr(1)===window.LOCATION_HASH&&($initialTab=e)),this.addListener(e,"keydown",(t=>{if([Garnish.DOWN_KEY,Garnish.UP_KEY].includes(t.keyCode)&&$.contains(this.$ul[0],t.currentTarget)){let a;if(t.keyCode===Garnish.UP_KEY){var e=$(t.currentTarget).parent().prev("li");e.hasClass("heading")&&(e=e.prev("li")),a=e.children("a")}else{var s=$(t.currentTarget).parent().next("li");s.hasClass("heading")&&(s=s.next("li")),a=s.children("a")}a.length&&(t.preventDefault(),this.makeTabFocusable(a),a.focus(),this.scrollToTab(a))}}))}if(window.LOCATION_HASH){const t=this.$tabs.filter(`[href="#${window.LOCATION_HASH}"]`);t.length&&this.selectTab(t)}},selectTab:function(t){const e=this._getTab(t);if(e[0]===this.$selectedTab[0])return;this.deselectTab(),this.$selectedTab=e.addClass("sel"),this.makeTabFocusable(e),this.scrollToTab(e),this.trigger("selectTab",{$tab:e});const s=e.attr("href");s&&"#"===s.charAt(0)&&$(s).removeClass("hidden"),Garnish.$win.trigger("resize"),Garnish.$doc.trigger("scroll"),"undefined"!=typeof history&&Garnish.requestAnimationFrame((()=>{history.replaceState(void 0,void 0,s)}))},deselectTab:function(){const t=this.$selectedTab.removeClass("sel");this.$selectedTab=null,this.trigger("deselectTab",{$tab:t}),t.length&&"#"===t.attr("href").charAt(0)&&$(t.attr("href")).addClass("hidden")},makeTabFocusable:function(t){const e=this._getTab(t);e[0]!==this.$focusableTab[0]&&(this.$focusableTab.attr("tabindex","-1"),this.$focusableTab=e.attr("tabindex","0"))},scrollToTab:function(t){const e=this._getTab(t),s=this.$ul.scrollLeft(),a=undefined,i=e.offset().left-this.$ul.offset().left;let n=!1;if(i<0)n=s+i-24;else{const t=e.outerWidth(),a=this.$ul.prop("clientWidth");i+t>a&&(n=s+(i-(a-t))+24)}!1!==n&&this.$ul.scrollLeft(n)},_getTab:function(t){if(t instanceof jQuery)return t;if(t instanceof HTMLElement)return $(t);if("string"!=typeof t)throw"Invalid tab ID";const e=this.$tabs.filter(`[data-id="${t}"]`);if(!e.length)throw`Invalid tab ID: ${t}`;return e}}),new Verbb.UI}(jQuery);
2//# sourceMappingURL=verbb-ui.js.map

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.