PageSourceSearch

https://brownsboard.com/assets/modules/categorySelector.1332c8252670ad118efc.min.js

js brownsboard.com collected 2026-10-09 22:43:10 UTC 9,577 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,2067,3602,4271,6198,7212,8314,9127,9185,9897],{9897(_,O,s){s.r(O),s.d(O,{del:()=>D,get:()=>u,head:()=>e,patch:()=>i,post:()=>a,put:()=>m});var g=s(1749),y=s.n(g),f=s(5303),E=s(7459),o=s.n(E),w=s(8636),P=s.n(w);const n=config.relative_path+"/api/v3";async function r(t,d){if(t.url=t.url.startsWith("/api")?config.relative_path+t.url:n+t.url,t.headers=t.headers||{},t.headers["x-return-to"]||(t.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof d=="function"){c(t).then(l=>d(null,l),l=>d(l));return}try{return await c(t)}catch(l){if(l.status===401){const{url:C}=await(0,g.fire)("filter:admin.reauth",{url:"login"}),A=await E.translate("[[error:api.reauth-required]]",config.userLang);(0,f.confirm)(A,v=>{v&&(w.setItem("location-hash",window.location.hash),ajaxify.go(C))})}throw l}}async function c(t){const{url:d}=t;delete t.url,t.data&&!(t.data instanceof FormData)&&(t.data=JSON.stringify(t.data||{}),t.headers["content-type"]="application/json; charset=utf-8"),{options:t}=await(0,g.fire)("filter:api.options",{options:t}),t.data&&(t.body=t.data,delete t.data);const l=await fetch(d,t),{headers:C}=l;if(C.get("x-redirect"))return c({url:C.get("x-redirect"),...t});const A=C.get("content-type"),v=A&&A.startsWith("application/json");let p;if(t.method!=="HEAD"&&(v?p=await l.json():p=await l.text()),!l.ok){let S=l.statusText;if(p){const L=v&&(p.status?.message||p.error||""),M=typeof p=="string"?p:l.statusText||`[[error:api.${l.status}]]`;S=v&&L?L:M}const I=new Error(S);throw I.status=l.status,I}return v&&p&&p.hasOwnProperty("status")&&p.hasOwnProperty("response")?p.response:p}function u(t,d,l){return r({url:t+(d&&Object.keys(d).length?"?"+$.param(d):"")},l)}function e(t,d,l){return r({url:t+(d&&Object.keys(d).length?"?"+$.param(d):""),method:"HEAD"},l)}function a(t,d,l,C){return h("POST",t,d,l,C)}function i(t,d,l,C){return h("PATCH",t,d,l,C)}function m(t,d,l,C){return h("PUT",t,d,l,C)}function D(t,d,l,C){return h("DELETE",t,d,l,C)}function h(t,d,l,C,A){return typeof C=="function"&&(A=C,C={}),r({url:d,method:t,data:l,headers:{"x-csrf-token":config.csrf_token,...C}},A)}},6349(_,O,s){var g,y;g=[s(9930),s(9336),s(9897)],y=(function(f,E,o){const w={};return w.init=function(P,n){let r=n.defaultCategories||null;n=n||{},n.privilege=n.privilege||"topics:read",n.states=n.states||["watching","tracking","notwatching","ignoring"],n.cacheList=n.hasOwnProperty("cacheList")?n.cacheList:!0;let c=[];Array.isArray(n.localCategories)&&(c=n.localCategories.map(m=>({...m})),r&&(r=[...c,...r])),n.selectedCids=n.selectedCids||ajaxify.data.selectedCids||[];const u=P.find('[component="category-selector-search"]');if(!u.length)return;const e=u.parents('[component="category/dropdown"]').length>0||u.parents('[component="category-selector"]').length>0;P.on("show.bs.dropdown",function(){e&&u.removeClass("hidden");function m(){const h=u.find("input").val();h.length>1||!h&&!r?a(h,function(t){r=n.cacheList&&(r||t),i(t)}):!h&&r&&i(r)}const D=u.find("input").val("");D.on("keydown",function(h){if(h.key==="ArrowDown"){const t=P.find('[component="category/list"] li[data-cid]:first a');t.length&&(t.focus(),h.stopPropagation(),h.preventDefault())}}),u.on("click",function(h){h.preventDefault(),h.stopPropagation()}),D.on("keyup",utils.debounce(m,300)),m()}),P.on("shown.bs.dropdown",function(){["xs","sm"].includes(utils.findBootstrapEnvironment())||u.find("input").focus()}),P.on("hide.bs.dropdown",function(){e&&u.addClass("hidden"),u.off("click"),u.find("input").off("keyup keydown")});function a(m,D){o.get("/search/categories",{search:m,query:utils.params(),parentCid:n.parentCid||0,selectedCids:n.selectedCids,privilege:n.privilege,states:n.states,showLinks:n.showLinks,localOnly:n.localOnly,hideUncategorized:n.hideUncategorized},function(h,{categories:t}){if(h)return f.error(h);D(c.concat(t))})}function i(m){const D=n.selectedCids.map(String),h=(n.disabledCids||[]).map(String);m.forEach(function(t){t.selected=D.includes(String(t.cid)),h.includes(String(t.cid))&&(t.disabledClass=!0)}),app.parseAndTranslate(n.template,{categoryItems:m.slice(0,200),selectedCategory:ajaxify.data.selectedCategory,allCategoriesUrl:ajaxify.data.allCategoriesUrl,hideAll:n.hideAll},function(t){P.find('[component="category/list"]').html(t.find('[component="category/list"]').html()),P.find('[component="category/list"] [component="category/no-matches"]').toggleClass("hidden",!!m.length);const d=E.Dropdown.getInstance(P.find(".dropdown-toggle").get(0));d&&d.update()})}},w}).apply(O,g),y!==void 0&&(_.exports=y)},5348(_,O,s){var g,y;g=[s(6349),s(5303),s(1749),s(7459),s(1335)],y=(function(f,E,o,w,P){const n={};return n.init=function(r,c){if(!r||!r.length)return;c=c||{};const u=c.onSelect||function(){};c.states=c.states||["watching","tracking","notwatching","ignoring"],c.template=c.template||"partials/category/selector-dropdown-left",o.fire("action:category.selector.options",{el:r,options:c}),f.init(r,c);const e={el:r,selectedCategory:null};r.on("click","[data-cid]",function(){const i=$(this);return i.hasClass("disabled")?!1:(e.selectCategory(i.attr("data-cid")),u({...e.selectedCategory,categoryEl:i}))});let a=e.el.find('[component="category-selector-selected"]').html();return w.translate(a,i=>{a=i}),e.selectCategory=function(i,m=null){const D=m||e.el.find('[data-cid="'+i+'"]');e.selectedCategory={cid:i,name:D.attr("data-name")},D.length?e.el.find('[component="category-selector-selected"]').html(D.find('[component="category-markup"]').html()):e.el.find('[component="category-selector-selected"]').html(a)},e.getSelectedCategory=function(){return e.selectedCategory},e.getSelectedCid=function(){return e.selectedCategory?e.selectedCategory.cid:0},c.hasOwnProperty("selectedCategory")&&app.parseAndTranslate(c.template,{selectedCategory:c.selectedCategory},function(i){e.el.find('[component="category-selector-selected"]').html(i.find('[component="category-selector-selected"]').html())}),e},n.modal=async function(r){r=r||{},r.onSelect=r.onSelect||function(){},r.onSubmit=r.onSubmit||function(){};const c=await P.render("admin/partials/categories/select-category",{message:r.message}),u=await E.dialog({title:r.title||"[[modules:composer.select-category]]",message:c,buttons:{save:{label:"[[global:select]]",className:"btn-primary",callback:a}}}),e=n.init(u.find('[component="category-selector"]'),r);function a(i){return i.preventDefault(),e.selectedCategory&&(r.onSubmit(e.selectedCategory),u.modal("hide")),!1}r.openOnLoad&&u.on("shown.bs.modal",function(){u.find(".dropdown-toggle").dropdown("toggle")}),u.find("form").on("submit",a)},n}).apply(O,g),y!==void 0&&(_.exports=y)},5303(_,O,s){s.r(O),s.d(O,{alert:()=>w,confirm:()=>P,dialog:()=>o,prompt:()=>n,promptPassword:()=>r});var g=s(3530),y=s.n(g),f=s(7459),E=s.n(f);g.setDefaults({locale:config.userLang}),f.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(e=>{g.addLocale(config.userLang,{OK:e[0],CANCEL:e[1],CONFIRM:e[2]}),g.setLocale(config.userLang)});async function o(e){const[a,i,m]=await Promise.all([f.translate(e.title||""),c(e)||"",u(e.buttons)]);return g.dialog({...e,title:a,message:i,buttons:m})}async function w(e,a){const[i,m]=await Promise.all([e&&e.title?f.translate(e.title):null,c(e)]);return a=typeof a=="function"?a:e.callback,g.alert({...e,title:i,message:m,callback:a})}async function P(e,a){const[i,m]=await Promise.all([e&&e.title?f.translate(e.title):null,c(e)]);return a=typeof a=="function"?a:e.callback,g.confirm({...e,title:i,message:m,callback:a})}async function n(e,a){const[i,m]=await Promise.all([f.translate(typeof e=="string"?e:e.title),e&&e.message?c(e):null]);return a=typeof a=="function"?a:e.callback,g.prompt({...e,title:i,message:m,callback:a})}async function r(e){return typeof e=="string"&&(e={title:e}),e=e||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(a=>{n({...e,inputType:"password",required:!0,value:"",callback:a})})}function c(e){const a=e&&e.message?e.message:e;return a instanceof jQuery?a:f.translate(a||"")}async function u(e){if(!Object.keys(e||{}).length)return;const a=Object.values(e);return await Promise.all(a.map(async i=>({...i,label:await f.translateKey(i.label)})))}},8636(_,O,s){var g;g=(function(){function y(){this._store={},this._keys=[]}y.prototype.isMock=!0,y.prototype.setItem=function(o,w){o=String(o),this._keys.indexOf(o)===-1&&this._keys.push(o),this._store[o]=w},y.prototype.getItem=function(o){return o=String(o),this._keys.indexOf(o)===-1?null:this._store[o]},y.prototype.removeItem=function(o){o=String(o),this._keys=this._keys.filter(function(w){return w!==o}),this._store[o]=null},y.prototype.clear=function(){this._keys=[],this._store={}},y.prototype.key=function(o){return o=parseInt(o,10)||0,this._keys[o]},Object.defineProperty&&Object.defineProperty(y.prototype,"length",{get:function(){return this._keys.length}});let f;const E=Date.now().toString();try{if(f=window.localStorage,f.setItem(E,E),f.getItem(E)!==E)throw Error("localStorage behaved unexpectedly");return f.removeItem(E),f}catch(o){console.warn(o),console.warn("localStorage failed, falling back on sessionStorage");try{if(f=window.sessionStorage,f.setItem(E,E),f.getItem(E)!==E)throw Error("sessionStorage behaved unexpectedly");return f.removeItem(E),f}catch(w){return console.warn(w),console.warn("sessionStorage failed, falling back on memory storage"),new y}}}).call(O,s,O,_),g!==void 0&&(_.exports=g)}}]);

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.