UNPKG

dzxstatic

Version:

The static files of Discuz! X

1 lines 1.65 kB
!function(){var e=$("autopbn"),t=e.getAttribute("rel").valueOf(),a=parseInt(e.getAttribute("curpage").valueOf()),n=parseInt(e.getAttribute("totalpage").valueOf()),l=parseInt(e.getAttribute("picstyle").valueOf()),r=parseInt(e.getAttribute("forumdefstyle").valueOf());l=l&&!r;var d=a+0>n?n:a+0,o=0;function s(){if(a+1>n)return window.onscroll=null,void(e.style.display="none");if(2!=o&&a+1>d)return e.innerHTML="下一页 &raquo;",void(a+1>d&&(window.onscroll=null));a++;var r=t+"&t="+parseInt(+new Date/1e3/(1e3*Math.random()));new Ajax("HTML").get(r,(function(r){if(-1==(r=r.replace(/\n|\r/g," ")).indexOf('id="autopbn"')&&($("autopbn").style.display="none",window.onscroll=null),l){s=r.match(/\<li style="width:\d+px;" id="picstylethread_(\d+)"\>(.+?)\<\/li\>/g);for(i in s){c=s[i].match(/id="picstylethread_(\d+)"\>/);$("picstylethread_"+c[1])||($("threadlist_picstyle").innerHTML+=s[i])}}else{var d=$("threadlisttableid"),s=r.match(/\<tbody id="normalthread_(\d+)"\>(.+?)\<\/tbody>/g);for(i in s)if("index"!=i&&"lastIndex"!=i){var c=s[i].match(/<tbody id="normalthread_(\d+)"\>/);if(!$("normalthread_"+c[1])){var p=document.createElement("tbody");d.appendChild(p);var u=document.createElement("div");u.innerHTML="<table>"+s[i]+"</table>",d.replaceChild(u.childNodes[0].childNodes[0],d.lastChild)}}}var f=r.match(/\<span id="fd_page_bottom"\>(.+?)\<\/span\>/);t=t.replace(/&page=\d+/,"&page="+(a+1)),$("fd_page_bottom").innerHTML=f[1],e.style.display="none",a+1<=n&&(e.innerHTML="下一页 &raquo;",setTimeout((function(){e.style.display="block"}),100)),o=0}))}e.onclick=function(){var t=o;o=2,e.innerHTML="正在加载, 请稍后...",s(),o=t}}();