>>
|
No. 395
Файл
140018489547.jpg
- (430.50KB
, 1920x1306
- [Закрыть])
>>394 Ок. Чтото из этой хуйни
var doc=document;var postByNum=[];var ajaxPosts={};var refArr=[];function get_cookie(name){with(document.cookie){var regexp=new RegExp("( |;\\s+)"+name+"=(.?)(;|$)");var hit=regexp.exec(document.cookie);if(hit&&hit.length>2){var unicode_esc=unescape(hit[2]);eval("var ret_val = '"+unicode_esc+"'");return ret_val}else return""}} function $X(a,b){return doc.evaluate(a,b||doc,null,6,null)} function $x(a,b){return doc.evaluate(a,b||doc,null,8,null).singleNodeValue} function $del(a){a&&a.parentNode.removeChild(a)} function $each(a,b){if(a){var c=a.snapshotLength;if(0<c)for(;c--;)b(a.snapshotItem(c),c)}} function $offset(a,c){for(var b=0;a;)b+=a[c],a=a.offsetParent;return b} function $add(a){dummy.innerHTML=a;return dummy.firstChild} function AJAX(b,id,fn){var xhr=new XMLHttpRequest;xhr.onreadystatechange=function(){if(xhr.readyState!=4)return;if(xhr.status==200){var x=xhr.responseText;x=x.split(/<form[ >]+del[ >]+>/)[1].split("</form>")[0];var thrds=x.substring(0,x.lastIndexOf(x.match(/<br[ >]+left/))).split(/<br[ >]+left[ >]>\s <hr[>]>/);for(var i=0,tLen=thrds.length;i<tLen;i++){var tNum=thrds[i].match(/<input[ >]+checkbox[>]+>/i)[0].match(/(\d+)/)[0];var posts=thrds[i].split(/<table[ >]>/);ajaxPosts[tNum]={keys:[]};for(var j=0,pLen=posts.length;j<pLen;j++){var x=posts[j];var pNum=x.match(/<input[>]+checkbox[ >]+>/i)[0].match(/(\d+)/)[0];ajaxPosts[tNum].keys.push(pNum);ajaxPosts[tNum][pNum]=x.substring(!/<td/.test(x)&&/fil esize[>]>/.test(x)?x.search(/filesize[ >]>/)-13:x.indexOf("<label"),/<td/.test(x)?x.lastIndexOf("</td"):/omittedposts[>]>/.test(x)?x.lastIndexOf( "</span")+7:x.lastIndexOf("</blockquote")+13);x=ajaxPosts[tNum][pNum].substr(ajaxPosts[tNum][pNum].indexOf("<blockquote>")+12).match(/>>\d+/g);i f(x)for(var r=0;rLen=x.length,r<rLen;r++)getRefMap(pNum,x[r].replace(/>>/g,""),true)}}fn()}else fn("HTTP "+xhr.status+" "+xhr.statusText)};xhr.open("GET","/"+b+"/res/"+id+remhtml,true);xhr.setRequestHeader("Accept-Encoding","deflate, gzip, x-gzip");xhr.send(false)} function delPostPreview(e){cPrev=$x('ancestor-or-self::div[starts-with(@id,"preview")]',e.relatedTarget);setTimeout(function(){if(!cPrev)$each($X('.//div[start s-with(@id,"preview")]'),function(el){$del(el)});else while(cPrev.nextSibling)$del(cPrev.nextSibling)},800)} function showPostPreview(e){var tNum=this.pathname.substring(this.pathname.lastIndexOf("/")).match(/\d+/);var pNum=this.hash.match(/\d+/)||tNum;var brd=this.pathname.match(/[ \/]+/);var div=doc.createElement("div");div.style.cssText="position:absolute; top:0; left:0; width:100%; height:100%";doc.body.appendChild(div);var scrw=div.offsetWidth,scrh=div.offsetHeight;$del(div);var elm=doc.documentElement;x=$offset(this,"offsetLeft")+this.offsetWidth/2;y=$offset(this,"offsetTop");if(e.clientY<scrh0.75)y+=this.offsetHeight;var cln=doc.createElement("div");cln.id="preview_"+pNum;cln.className="reply";cln.style.cssText="position:absolute; z-index:300;"+(x<scrw/2?"left:"+x:"right:"+parseInt(scrw-x+2))+"px; "+(e.clientY<scrh0.75?"top:"+y:"bottom:"+parseInt(scrh-y-4))+"px";cln.addEventListener("mouseout",delPostPreview,false);cln.addEventListener("mouseov er",function(){if(!cPrev)cPrev=this},false);cPrev=cln;var aj=ajaxPosts[tNum];var functor=function(cln,html){cln.innerHTML=html;$each($X(".//script",cln),function(el){$del(el)});doRefPreview(cln);if(!$x(".//small",cln)&&(ajaxPosts[t Num]&&(ajaxPosts[tNum][pNum]&&refArr[pNum])))showRefMap(cln,pNum,tNum,brd)};cln.innerHTML="<img src=\"/css/images/loading.gif\" style=\"position:relative;top:2px;\" /> Загрузка...";if(postByNum[pNum])functor(cln,postByNum[pNum].innerHTML);else if(aj&&aj[pNum])functor(cln,aj[pNum]);else AJAX(brd,tNum,function(err){functor(cln,err||(ajaxPosts[tNum][pNum]||'Пост не найден'))});$del(doc.getElementById(cln.id));$x('.//form[@id="delform"]').appendChild(cln)}function doRefPreview(node){$each($X('.//a[starts-with(text(),">>")]',node||doc),function(link){link.addEventListener("mouseover",showPostPreview,false);link.a ddEventListener("mouseout",delPostPreview,false)})}function getRefMap(pNum,rNum,dir){if(!refArr[rNum])refArr[rNum]=[];if((","+refArr[rNum].toString()+",").indexOf(","+pNum+",")<0)if(dir)refArr[rNum].push(pNum); else refArr[rNum].unshift(pNum)} function showRefMap(post,pNum,tNum,brd){if(typeof refArr[pNum]!=="object")return;var ref=refArr[pNum].toString().replace(/(\d+)/g,' <a href="'+(tNum?"/"+brd+"/res/"+tNum+remhtml:"")+'#$1">>>$1</a>');var map=doc.createElement("small");map.id="rfmap_"+pNum;map.innerHTML='<i class="abbrev"> Ответы: '+ref+"</i><br>";doRefPreview(map);if(post)post.appendChild(map);else{var el=$x('.//a[@name="'+pNum+'"]');el.parentNode.insertBefore(map,$x("following-sibling::blockquote",el).nextSibling)}}function doRefMap(){$each($X('.//a[starts-with(text(),">>")]'),function(link){if(!/\//.test(link.textContent)){var rNum=link.hash.match(/\d+/);var post=$x("./ancestor::td",link);if((postByNum[rNum]||$x('.//a[@name="'+rNum+'"]'))&&post)getRefMap(post.id.match(/\d+/),rNum)}});for(var rNum in refArr)showRefMap(postByNum[rNum],rNum)}window.onunload=function(e){if(style_cookie){var title=get_active_stylesheet();set_cookie(style_cookie,title,365)}};window.onload=function(e){var match;if(match=/#i([0-9]+)/.exec(document.location.toString()))if(!document.forms.postform.comment.value)insert(">>"+match[1]);if(match=/#([0-9]+)/.ex ec(document.location.toString()))highlight(match[1]);if($x('.//small/i[@class="abbrev"]'))return;$each($X('.//td[@class="reply"]'),function(post){post ByNum[post.id.match(/\d+/)]=post});doRefPreview();doRefMap()};if(style_cookie){var cookie=get_cookie(style_cookie);var title=cookie?cookie:get_preferred_stylesheet();set_stylesheet(title)}; Ломает капчу. Взял вилку и...
|