PageSourceSearch

https://brownsboard.com/assets/forum/topic-fork.9facc34b11329f9a4388.min.js

js brownsboard.com collected 2026-10-09 22:42:42 UTC 13,039 bytes, 1 lines download raw bytes

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

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.