PageSourceSearch

https://www.knightmare.com/forum/assets/forum/topic-tag.98102490bfa845f80b4e.min.js

js knightmare.com collected 2026-09-26 08:43:47 UTC 9,057 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[63,1091,13417,18314,22067,27509,34271,43602,49897,87212,99127],{63(M,w,l){var m,p;m=[l(29930),l(34405),l(49897),l(81335)],p=(function(f,h,c,E){const _={};let d,D,y,O;_.init=function(r,s,i){d||(y=r,O=s||[],app.parseAndTranslate("modals/tag-topic",{topics:y,tagWhitelist:O},function(e){d=e,D=d.find("#tag-topic-commit"),$("body").append(d),d.find("#tag-topic-cancel").on("click",u),D.on("click",async()=>{await n(),i&&i()}),d.find(".tags").each((o,a)=>{const g=$(a),A=g.tagsinput({tagClass:"badge bg-info",confirmKeys:[13,44],trimValue:!0}),T=A[0].$input;y[o].tags.forEach(I=>g.tagsinput("add",I.value)),g.on("itemAdded",function(I){O.length&&!O.includes(I.item)&&(g.tagsinput("remove",I.item),f.error("[[error:tag-not-allowed]]")),T.length&&T.autocomplete("close")}),t({input:T,container:A[0].$container})})}))};function t(r){h.init({input:r.input,position:{my:"left bottom",at:"left top",collision:"flip"},appendTo:r.container,source:async(s,i)=>{socket.emit("topics.autocompleteTags",{query:s.term},function(e,o){if(e)return f.error(e);o&&i(o)})}})}async function n(){await Promise.all(d.find(".tags").map(async(r,s)=>{const i=y[r],e=$(s);i.tags=await c.put(`/topics/${i.tid}/tags`,{tags:e.tagsinput("items")}),_.updateTopicTags([i])})),u()}_.updateTopicTags=function(r){r.forEach(s=>{const i=ajaxify.data.template.topic?"partials/topic/tags":"partials/category/tags";E.render(i,{tags:s.tags}).then(function(e){const o=$(`[data-tid="${s.tid}"][component="topic/tags"]`);o.fadeOut(250,function(){o.toggleClass("hidden",s.tags.length===0),o.html(e).fadeIn(250)})})})};function u(){d&&(d.remove(),d=null)}return _}).apply(w,m),p!==void 0&&(M.exports=p)},49897(M,w,l){l.r(w),l.d(w,{del:()=>s,get:()=>O,head:()=>t,patch:()=>u,post:()=>n,put:()=>r});var m=l(91749),p=l.n(m),f=l(65303),h=l(17459),c=l.n(h),E=l(68636),_=l.n(E);const d=config.relative_path+"/api/v3";async function D(e,o){if(e.url=e.url.startsWith("/api")?config.relative_path+e.url:d+e.url,e.headers=e.headers||{},e.headers["x-return-to"]||(e.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof o=="function"){y(e).then(a=>o(null,a),a=>o(a));return}try{return await y(e)}catch(a){if(a.message===await h.translate("[[error:api.401]]",config.userLang)){const{url:g}=await(0,m.fire)("filter:admin.reauth",{url:"login"}),A=await h.translate("[[error:api.reauth-required]]",config.userLang);(0,f.confirm)(A,T=>{T&&(E.setItem("location-hash",window.location.hash),ajaxify.go(g))})}throw a}}async function y(e){const{url:o}=e;delete e.url,e.data&&!(e.data instanceof FormData)&&(e.data=JSON.stringify(e.data||{}),e.headers["content-type"]="application/json; charset=utf-8"),{options:e}=await(0,m.fire)("filter:api.options",{options:e}),e.data&&(e.body=e.data,delete e.data);const a=await fetch(o,e),{headers:g}=a;if(g.get("x-redirect"))return y({url:g.get("x-redirect"),...e});const A=g.get("content-type"),T=A&&A.startsWith("application/json");let P;if(e.method!=="HEAD"&&(T?P=await a.json():P=await a.text()),!a.ok){if(P){const I=T&&(P.status?.message||P.error||""),v=typeof P=="string"?P:a.statusText||`[[error:api.${a.status}]]`;throw new Error(T&&I?I:v)}throw new Error(a.statusText)}return T&&P&&P.hasOwnProperty("status")&&P.hasOwnProperty("response")?P.response:P}function O(e,o,a){return D({url:e+(o&&Object.keys(o).length?"?"+$.param(o):"")},a)}function t(e,o,a){return D({url:e+(o&&Object.keys(o).length?"?"+$.param(o):""),method:"HEAD"},a)}function n(e,o,a,g){return i("POST",e,o,a,g)}function u(e,o,a,g){return i("PATCH",e,o,a,g)}function r(e,o,a,g){return i("PUT",e,o,a,g)}function s(e,o,a,g){return i("DELETE",e,o,a,g)}function i(e,o,a,g,A){return typeof g=="function"&&(A=g,g={}),D({url:o,method:e,data:a,headers:{"x-csrf-token":config.csrf_token,...g}},A)}},34405(M,w,l){var m,p;m=[l(49897),l(29930),l(36e3),l(9787),l(35786)],p=(function(f,h,{Textcomplete:c},{TextareaEditor:E},{ContenteditableEditor:_}){const d={},D={delay:200,appendTo:null};d.init=t=>{const n={...D,...t},{input:u,onSelect:r}=n;app.loadJQueryUI(function(){u.autocomplete({position:y(),...n,open:function(){$(this).autocomplete("widget").css("z-index",100005)},select:function(s,i){O(u,r,s,i)}})})},d.user=function(t,n,u){typeof n=="function"&&(u=n,n={}),n=n||{}
1,d.init({input:t,onSelect:u,source:(r,s)=>{n.query=r.term,f.get("/api/users",n,function(i,e){if(i)return h.error(i);if(e&&e.users){const o=e.users.map(function(a){return a&&{label:a.username,value:a.username,user:{uid:a.uid,name:a.username,slug:a.userslug,username:a.username,userslug:a.userslug,displayname:a.displayname,picture:a.picture,banned:a.banned,"icon:text":a["icon:text"],"icon:bgColor":a["icon:bgColor"]}}});s(o)}$(".ui-autocomplete a").attr("data-ajaxify","false")})}})},d.group=function(t,n){d.init({input:t,onSelect:n,source:(u,r)=>{f.get("/groups",{query:u.term},function(s,i){if(s)return h.error(s);if(i&&i.groups.length){const e=i.groups.map(function(o){return o&&{label:o.name,value:o.name,group:o}});r(e)}$(".ui-autocomplete a").attr("data-ajaxify","false")})}})},d.tag=function(t,n){d.init({input:t,onSelect:n,delay:100,source:(u,r)=>{socket.emit("topics.autocompleteTags",{query:u.term,cid:ajaxify.data.cid||0},function(s,i){if(s)return h.error(s);i&&r(i),$(".ui-autocomplete a").attr("data-ajaxify","false")})}})};function y(){const t=document.querySelector("html").getAttribute("data-dir")==="rtl"?"right":"left";return{my:`${t} top`,at:`${t} bottom`,collision:"none"}}function O(t,n,u,r){n=n||function(){};const s=jQuery.Event("keypress");s.which=13,s.keyCode=13,setTimeout(function(){t.trigger(s)},100),n(u,r)}return d.setup=function({element:t,strategies:n,options:u}){const r=t.get(0);if(!r)return;let s;if(r.nodeName==="TEXTAREA"||r.nodeName==="INPUT"?s=new E(r):r.nodeName==="DIV"&&r.getAttribute("contenteditable")==="true"&&(s=new _(r)),!s)throw new Error("unknown target element type");r.setAttribute("dir",document.querySelector("html").getAttribute("data-dir"));const i=new c(s,n,{dropdown:u});return i.on("rendered",function(){i.dropdown.items.length&&i.dropdown.items[0].activate()}),i},d}).apply(w,m),p!==void 0&&(M.exports=p)},65303(M,w,l){l.r(w),l.d(w,{alert:()=>E,confirm:()=>_,dialog:()=>c,prompt:()=>d,promptPassword:()=>D});var m=l(33530),p=l.n(m),f=l(17459),h=l.n(f);m.setDefaults({locale:config.userLang}),f.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(t=>{m.addLocale(config.userLang,{OK:t[0],CANCEL:t[1],CONFIRM:t[2]}),m.setLocale(config.userLang)});async function c(t){const[n,u,r]=await Promise.all([f.translate(t.title||""),y(t)||"",O(t.buttons)]);return m.dialog({...t,title:n,message:u,buttons:r})}async function E(t,n){const[u,r]=await Promise.all([t&&t.title?f.translate(t.title):null,y(t)]);return n=typeof n=="function"?n:t.callback,m.alert({...t,title:u,message:r,callback:n})}async function _(t,n){const[u,r]=await Promise.all([t&&t.title?f.translate(t.title):null,y(t)]);return n=typeof n=="function"?n:t.callback,m.confirm({...t,title:u,message:r,callback:n})}async function d(t,n){const[u,r]=await Promise.all([f.translate(typeof t=="string"?t:t.title),t&&t.message?y(t):null]);return n=typeof n=="function"?n:t.callback,m.prompt({...t,title:u,message:r,callback:n})}async function D(t){return typeof t=="string"&&(t={title:t}),t=t||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(n=>{d({...t,inputType:"password",required:!0,value:"",callback:n})})}function y(t){const n=t&&t.message?t.message:t;return n instanceof jQuery?n:f.translate(n||"")}async function O(t){if(!Object.keys(t||{}).length)return;const n=Object.values(t);return await Promise.all(n.map(async u=>({...u,label:await f.translateKey(u.label)})))}},68636(M,w,l){var m;m=(function(){function p(){this._store={},this._keys=[]}p.prototype.isMock=!0,p.prototype.setItem=function(c,E){c=String(c),this._keys.indexOf(c)===-1&&this._keys.push(c),this._store[c]=E},p.prototype.getItem=function(c){return c=String(c),this._keys.indexOf(c)===-1?null:this._store[c]},p.prototype.removeItem=function(c){c=String(c),this._keys=this._keys.filter(function(E){return E!==c}),this._store[c]=null},p.prototype.clear=function(){this._keys=[],this._store={}},p.prototype.key=function(c){return c=parseInt(c,10)||0,this._keys[c]},Object.defineProperty&&Object.defineProperty(p.prototype,"length",{get:function(){return this._keys.length}});let f;const h=Date.now().toString();try{if(f=window.localStorage,f.setItem(h,h),f.getItem(h)!==h)throw Error("localStorage behaved unexpectedly");return f.removeItem(h),f}catch(c){console.warn(c),console.warn("localStorage failed, falling back on sessionStorage");try{if(f=window.sessionStorage,f.setItem(h,h),f.getItem(h)!==h)throw Error("sessionStorage behaved unexpectedly");return f.removeItem(h),f}catch(E){return console.warn(E),console.warn("sessionStorage failed, falling back on memory storage"),new p}}}).call(w,l,w,M),m!==void 0&&(M.exports=m)}}]);

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.