PageSourceSearch

https://mistarg.cn/assets/modules/navigator.f5872562623cd2b7588c.min.js

js mistarg.cn collected 2026-10-06 13:19:56 UTC 15,929 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[22067,43602,65928,87212,87549],{25967(_,B,I){var x,b;x=[I(65303)],b=(function(d){const m={};return m.init=function(){$("body").on("click",'[component="pagination/select-page"]',function(){return d.prompt("[[global:enter-page-number]]",function(s){m.loadPage(s)}),!1})},m.loadPage=function(s,j){if(j=j||function(){},s=parseInt(s,10),!utils.isNumber(s)||s<1||s>ajaxify.data.pagination.pageCount)return;const U=utils.params();U.page=s;const e=window.location.pathname+"?"+$.param(U);ajaxify.go(e,j)},m.nextPage=function(s){m.loadPage(ajaxify.data.pagination.currentPage+1,s)},m.previousPage=function(s){m.loadPage(ajaxify.data.pagination.currentPage-1,s)},m}).apply(B,x),b!==void 0&&(_.exports=b)},65303(_,B,I){I.r(B),I.d(B,{alert:()=>j,confirm:()=>U,dialog:()=>s,prompt:()=>e,promptPassword:()=>u});var x=I(33530),b=I.n(x),d=I(17459),m=I.n(d);x.setDefaults({locale:config.userLang}),d.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(a=>{x.addLocale(config.userLang,{OK:a[0],CANCEL:a[1],CONFIRM:a[2]}),x.setLocale(config.userLang)});async function s(a){const[f,P,M]=await Promise.all([d.translate(a.title||""),y(a)||"",D(a.buttons)]);return x.dialog({...a,title:f,message:P,buttons:M})}async function j(a,f){const[P,M]=await Promise.all([a&&a.title?d.translate(a.title):null,y(a)]);return f=typeof f=="function"?f:a.callback,x.alert({...a,title:P,message:M,callback:f})}async function U(a,f){const[P,M]=await Promise.all([a&&a.title?d.translate(a.title):null,y(a)]);return f=typeof f=="function"?f:a.callback,x.confirm({...a,title:P,message:M,callback:f})}async function e(a,f){const[P,M]=await Promise.all([d.translate(typeof a=="string"?a:a.title),a&&a.message?y(a):null]);return f=typeof f=="function"?f:a.callback,x.prompt({...a,title:P,message:M,callback:f})}async function u(a){return typeof a=="string"&&(a={title:a}),a=a||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(f=>{e({...a,inputType:"password",required:!0,value:"",callback:f})})}function y(a){const f=a&&a.message?a.message:a;return f instanceof jQuery?f:d.translate(f||"")}async function D(a){if(!Object.keys(a||{}).length)return;const f=Object.values(a);return await Promise.all(f.map(async P=>({...P,label:await d.translateKey(P.label)})))}},96352(_,B,I){var x,b;x=[I(25967),I(52473),I(91749),I(29930),I(68636)],b=(function(d,m,s,j,U){const e={};let u=0,y=0,D=0,a,f,P,M,O,S=!1,k=!0,N="";e.scrollActive=!1;let c=$(".pagination-block"),L=c.find(".pagination-text"),q=c.find("meter"),tt=c.find(".progress-bar"),Y=c.find(".unread"),C;$(window).on("action:ajaxify.start",function(){$(window).off("keydown",Q)}),e.init=function(t,o,i,n,g){u=0,e.selector=t,e.callback=g,e.toTop=i||function(){},e.toBottom=n||function(){},c=$(".pagination-block"),L=c.find(".pagination-text"),q=c.find("meter"),tt=c.find(".progress-bar"),Y=c.find(".unread"),C=$(".scroller-thumb"),N=utils.findBootstrapEnvironment(),$(window).off("scroll",e.delayedUpdate).on("scroll",e.delayedUpdate),c.find(".dropdown-menu").off("click").on("click",function(l){l.stopPropagation()}),c.off("shown.bs.dropdown",".wrapper").on("shown.bs.dropdown",".wrapper",function(){const l=$(this);setTimeout(async function(){["lg","xl","xxl"].includes(utils.findBootstrapEnvironment())&&l.find("input").trigger("focus"),await socket.emit("topics.getPostCountInTopic",ajaxify.data.tid)>0&&c.find("#myNextPostBtn").removeAttr("disabled")},100)}),c.find(".pageup").off("click").on("click",e.scrollUp),c.find(".pagedown").off("click").on("click",e.scrollDown),c.find(".pagetop").off("click").on("click",e.toTop),c.find(".pagebottom").off("click").on("click",e.toBottom),c.find(".pageprev").off("click").on("click",d.previousPage),c.find(".pagenext").off("click").on("click",d.nextPage),c.find("#myNextPostBtn").off("click").on("click",nt),c.find("input").on("keydown",function(l){if(l.which===13){const w=$(this);if(!utils.isNumber(w.val())){w.val("");return}const v=parseInt(w.val(),10),p=K(v);w.val(""),c.find(".dopdown-menu.show").removeClass("show"),ajaxify.go(p)}}),ajaxify.data.template.topic&&(it(),D=ajaxify.data.postcount,ot(ajaxify.data.postIndex)),st(),e.setCount(o),e.update(
1)};let W=0;async function nt(){async function t(o){return await socket.emit("topics.getMyNextPostIndex",{tid:ajaxify.data.tid,index:Math.max(1,o),sort:config.topicPostSort})}if(ajaxify.data.template.topic){let o=await t(u);W===o&&(o=await t(o)),o&&u!==o+1?(W=o,$(window).one("action:ajaxify.end",function(){c.find(".dropdown-menu").is(":hidden")&&c.find(".dropdown-toggle").dropdown("toggle")}),e.scrollToIndex(o,!0,0)):(j.alert({message:"[[topic:no-more-next-post]]",type:"info"}),W=1)}}function H(t,o){const i=t.parent(),n=i.offset(),l=t.find(".scroller-thumb-icon").height();return o<n.top?o=n.top:o>n.top+i.height()-l&&(o=n.top+i.height()-l),o}function F(t){!C||!C.length||!C.is(":visible")||(C.each((o,i)=>{const n=$(i);if(n.is(":hidden"))return;const g=n.parent(),l=g.offset(),v=n.find(".scroller-thumb-icon").height(),p=(g.height()-v)/(ajaxify.data.postcount-1),r={top:H(n,l.top+(t-1)*p),left:n.offset().left};n.offset(r),X(n,t),et(n,t)}),ot(t),z(t))}function X(t,o){N==="xs"||N==="sm"||N==="md"?t.find(".thumb-text").text(`${o}/${ajaxify.data.postcount}`):t.find(".thumb-text").translateText(`[[topic:navigator.index, ${o}, ${ajaxify.data.postcount}]]`)}async function et(t,o){const i=t.find(".thumb-timestamp");if(i.length){const n=ajaxify.data.posts.find(l=>parseInt(l.index,10)===Math.max(0,parseInt(o,10)-1)),g=n?n.timestamp:await at(o);i.attr("title",utils.toISOString(g)).timeago()}}async function at(t){const o=$(`[component="post"][data-index=${t-1}]`);return o.length?parseInt(o.attr("data-timestamp"),10):await socket.emit("posts.getPostTimestampByIndex",{tid:ajaxify.data.tid,index:t-1,sort:ajaxify.data.sortOption})}function it(){if(!C.length)return;C.parent().off("click").on("click",function(p){if($(p.target).hasClass("scroller-container")){const T=$(p.target).find(".scroller-thumb"),r=o(T,p.pageY);return e.scrollToIndex(r-1,!0,0),!1}});function o(p,T){const r=p.parent(),A=p.find(".scroller-thumb-icon").height(),E=H(p,T-A/2),G=r.offset(),J=(E-G.top)/(r.height()-A);return u=Math.max(1,Math.ceil(ajaxify.data.postcount*J)),u>ajaxify.data.postcount?ajaxify.data.postcount:u}let i=!1;s.on("action:ajaxify.end",function(){O=null}),c.find(".dropdown-menu").parent().off("shown.bs.dropdown").on("shown.bs.dropdown",function(){F(u)});let n=null;const g=utils.debounce(et,50);function l(p){if(!n||!n.length)return;const r=n.find(".scroller-thumb-icon").height(),h=H(n,p.pageY-r/2);n.offset({top:h,left:n.offset().left});const A=o(n,p.pageY);return e.updateTextAndProgressBar(),X(n,A),g(n,A),k&&v(),k=!1,p.stopPropagation(),!1}C.off("mousedown").on("mousedown",function(p){p.originalEvent.button===0&&(i=!0,n=$(this),n.addClass("active"),$(window).on("mousemove",l),k=!0)});function w(){$(window).off("mousemove",l),i&&(e.scrollToIndex(u-1,!0,0),c.find(".dropdown-menu.show").removeClass("show")),V(),i=!1,k=!1,n&&n.length&&n.removeClass("active"),n=null}function v(){V(),f=setInterval(function(){z(u)},250)}$(window).off("mousemove",l),$(window).off("mouseup",w).on("mouseup",w),C.each((p,T)=>{const r=$(T);r.off("touchstart").on("touchstart",function(h){S=!0,P=Math.min($(window).width(),Math.max(0,h.touches[0].clientX)),M=Math.min($(window).height(),Math.max(0,h.touches[0].clientY)),k=!0,r.addClass("active")}),r.off("touchmove").on("touchmove",function(h){const A=$(window).width(),E=$(window).height(),G=Math.abs(P-Math.min(A,Math.max(0,h.touches[0].clientX))),J=Math.abs(M-Math.min(E,Math.max(0,h.touches[0].clientY)));if(P=Math.min(A,Math.max(0,h.touches[0].clientX)),M=Math.min(E,Math.max(0,h.touches[0].clientY)),J>=G&&k&&(S=!0,v()),S&&h.cancelable){h.preventDefault(),h.stopPropagation();const rt=r.find(".scroller-thumb-icon").height(),ct=H(r,M+$(window).scrollTop()-rt/2);r.offset({top:ct,left:r.offset().left});const Z=o(r,M+$(window).scrollTop());e.updateTextAndProgressBar(),X(r,Z),g(r,Z),k&&z(Z)}k=!1}),r.off("touchend").on("touchend",function(){V(),S&&(r.removeClass("active"),e.scrollToIndex(u-1,!0,0),S=!1,c.find(".dropdown-menu.show").removeClass("show"))})})}async function ot(t){const{bookmarkThreshold:o}=ajaxify.data;if(!Y.length||ajaxify.data.postcount<=o||!o)return;const i=ajaxify.data.bookmark||U.getItem("topic:"+ajaxify.data.tid+":bookmark");t=Math.max(t,Math.min(i,ajaxify.data.postcount));const n=Y.get(0),g=n.parentNode,l=g.getBoundingClientRect().height,w=1-t/ajaxify.data.postcount;n.style.height=`${l*w}px`;const v=g.querySelector(".scroller-thumb"),p=parseInt(v.style.height,10),T=parseInt(v.style.top||0,10)+p,r=n.querySelector(".meta a");D=Math.min(D,ajaxify.data.postcount-t);function h(E){r.style.display=E?"inline":"none",r.setAttribute("aria-disabled",E?"false":"true"),E?(r.removeAttribute("tabindex"),$(r).translateText(E)):(r.setAttribute("tabindex",-1),r.innerText="")}const A=r.getBoundingClientRect().height;D>0&&l-T>=Math.min(16,A)?(r.href=`${config.relative_path}/topic/${ajaxify.data.slug}/${Math.min(t+1,ajaxify.data.postcount)}
1`,h(`[[topic:navigator.unread, ${D}]]`)):(r.href=ajaxify.data.url,h(""))}function V(){f&&(clearInterval(f),f=0)}async function z(t){if(!t||O===t||!c.find(".post-content").is(":visible"))return;O=t;const o=await socket.emit("posts.getPostSummaryByIndex",{tid:ajaxify.data.tid,index:t-1,sort:ajaxify.data.sortOption}),i=await app.parseAndTranslate("partials/topic/navigation-post",{post:o});c.find(".post-content").html(i).find(".timeago").timeago()}function st(){config.usePagination||$(window).off("keydown",Q).on("keydown",Q)}function Q(t){if(t.target.nodeName==="BODY"){if(t.shiftKey||t.ctrlKey||t.altKey)return;if(t.which===36&&e.toTop)return e.toTop(),!1;if(t.which===35&&e.toBottom)return e.toBottom(),!1}}function K(t){const i=window.location.pathname.replace(config.relative_path,"").split("/");let n=i[1]+"/"+i[2]+"/"+i[3]+(t?"/"+t:"");const{sort:g}=utils.params();g&&(n+=`?sort=${encodeURIComponent(g)}`);const l={newUrl:n,index:t};return s.fire("action:navigator.generateUrl",l),l.newUrl}e.getCount=()=>y,e.setCount=function(t){t=parseInt(t,10),t!==y&&(y=t,e.updateTextAndProgressBar(),R(y>0))},e.show=function(){R(!0)},e.disable=function(){y=0,u=1,e.callback=null,e.selector=null,$(window).off("scroll",e.delayedUpdate),R(!1)};function R(t){t&&!ajaxify.data.template.topic&&!ajaxify.data.template.category||(c.toggleClass("ready",t),c.toggleClass("noreplies",y<=1))}return e.delayedUpdate=function(){a||(a=setTimeout(function(){e.update(),a=void 0},100))},e.update=function(){let t=u;const o=$(e.selector).filter((T,r)=>!r.getAttribute("data-navigator-ignore"));o.length&&(t=parseInt(o.first().attr("data-index"),10)+1);const i=$(window).scrollTop(),n=$(window).height(),g=$(document).height(),l=i+n/2;let w=Number.MAX_VALUE;o.each(function(){const T=$(this),r=parseInt(T.attr("data-index"),10);if(r>=0){const h=Math.abs(l-(T.offset().top+T.outerHeight(!0)/2));if(h>w)return!1;h<w&&(t=r+1,w=h)}});const v=i===0&&parseInt(o.first().attr("data-index"),10)===0,p=i+n>g-100&&parseInt(o.last().attr("data-index"),10)===y-1;v?t=1:p&&(t=y),s.fire("action:navigator.update",{newIndex:t,index:u}),t!==u&&(typeof e.callback=="function"&&e.callback(t,y),u=t,e.updateTextAndProgressBar(),F(u)),R(y>0)},e.getIndex=()=>u,e.setIndex=t=>{u=t+1,typeof e.callback=="function"&&e.callback(u,y),e.updateTextAndProgressBar(),F(u)},e.updateTextAndProgressBar=function(){if(!utils.isNumber(u))return;u=u>y?y:u,config.usePagination?L.html(`<i class="fa fa-file"></i> ${ajaxify.data.pagination.currentPage} / ${ajaxify.data.pagination.pageCount}`):L.translateText(`[[global:pagination.out-of, ${u}, ${y}]]`);const t=(u-1)/(y-1||1);q.val(t),tt.width(t*100+"%")},e.scrollUp=function(){const t=$(window);if(config.usePagination&&t.scrollTop()<=0)return d.previousPage(function(){$("body,html").scrollTop($(document).height()-t.height())});$("body,html").animate({scrollTop:t.scrollTop()-t.height()})},e.scrollDown=function(){const t=$(window);if(config.usePagination&&t.scrollTop()>=$(document).height()-t.height())return d.nextPage();$("body,html").animate({scrollTop:t.scrollTop()+t.height()})},e.scrollTop=function(t){$(`${e.selector}[data-index="${t}"]:not([data-navigator-ignore])`).length?e.scrollToIndex(t,!0):ajaxify.go(K())},e.scrollBottom=function(t){parseInt(t,10)<0||($(`${e.selector}[data-index="${t}"]:not([data-navigator-ignore])`).length?e.scrollToIndex(t,!0):(t=parseInt(t,10)+1,ajaxify.go(K(t))))},e.scrollToIndex=function(t,o,i){const n=ajaxify.data.template.topic,g=ajaxify.data.template.category;if(!utils.isNumber(t)||!n&&!g)return;if(i=i!==void 0?i:400,e.scrollActive=!0,n&&m.get("post/anchor",t).length)return e.scrollToPostIndex(t,o,i);if(g&&$('[component="category/topic"][data-index="'+t+'"]').length)return e.scrollToTopicIndex(t,o,i);if(!config.usePagination){e.scrollActive=!1,t=parseInt(t,10)+1,ajaxify.go(K(t));return}const l=n?e.scrollToPostIndex:e.scrollToTopicIndex,w=1+Math.floor(t/config.postsPerPage);parseInt(w,10)!==ajaxify.data.pagination.currentPage?d.loadPage(w,function(){l(t,o,i)}):l(t,o,i)},e.shouldScrollToPost=function(t){if(!ajaxify.data.template.topic||t<=1)return!1;const o=$('[component="topic"] [component="post"]').first();return parseInt(o.attr("data-index"),10)!==t-1},e.scrollToPostIndex=function(t,o,i){const n=$(`[component="post"][data-index="${t}"]:not([data-navigator-ignore])`);e.scrollToElement(n,o,i,t)},e.scrollToTopicIndex=function(t,o,i){const n=$('[component="category/topic"][data-index="'+t+'"]');e.scrollToElement(n,o,i,t)},e.scrollToElement=async(t,o,i,n=null)=>{if(!t.length){e.scrollActive=!1;return}await s.fire("filter:navigator.scroll",{scrollTo:t,highlight:o,duration:i,newIndex:n+1});const g=t.outerHeight(!0),l=m.get("navbar").outerHeight(!0)||0,w=$(".topic-main-buttons").outerHeight(!0)||0,v=$(window).height();$(window).off("scroll",e.delayedUpdate),i=i!==void 0?i:400,e.scrollActive=!0;let p=!1;function T(){function h(){setTimeout(()=>{$(window).off("scroll",e.delayedUpdate).on("scroll",e.delayedUpdate),s.fire("action:navigator.scrolled",{scrollTo:t,highlight:o,duration:i,newIndex:n+1})},50)}function A(){if(p){h();return}
1p=!0,e.scrollActive=!1,r(),n?e.setIndex(n):e.update()}let E;if(g<v-l-w?E=t.offset().top-v/2+g/2:E=t.offset().top-l-w,i===0){$(window).scrollTop(E),A(),h();return}$("html, body").animate({scrollTop:E+"px"},i,A)}function r(){o&&($('[component="post"],[component="category/topic"]').removeClass("highlight"),t.addClass("highlight"),setTimeout(function(){t.removeClass("highlight")},1e4))}T()},e}).apply(B,x),b!==void 0&&(_.exports=b)},68636(_,B,I){var x;x=(function(){function b(){this._store={},this._keys=[]}b.prototype.isMock=!0,b.prototype.setItem=function(s,j){s=String(s),this._keys.indexOf(s)===-1&&this._keys.push(s),this._store[s]=j},b.prototype.getItem=function(s){return s=String(s),this._keys.indexOf(s)===-1?null:this._store[s]},b.prototype.removeItem=function(s){s=String(s),this._keys=this._keys.filter(function(j){return j!==s}),this._store[s]=null},b.prototype.clear=function(){this._keys=[],this._store={}},b.prototype.key=function(s){return s=parseInt(s,10)||0,this._keys[s]},Object.defineProperty&&Object.defineProperty(b.prototype,"length",{get:function(){return this._keys.length}});let d;const m=Date.now().toString();try{if(d=window.localStorage,d.setItem(m,m),d.getItem(m)!==m)throw Error("localStorage behaved unexpectedly");return d.removeItem(m),d}catch(s){console.warn(s),console.warn("localStorage failed, falling back on sessionStorage");try{if(d=window.sessionStorage,d.setItem(m,m),d.getItem(m)!==m)throw Error("sessionStorage behaved unexpectedly");return d.removeItem(m),d}catch(j){return console.warn(j),console.warn("sessionStorage failed, falling back on memory storage"),new b}}}).call(B,I,B,_),x!==void 0&&(_.exports=x)}}]);

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.