$("#bcontent a, .navbar-inner a").unbind("click");
$("#bcontent a, .navbar-inner a").bind("click", function (e) {
url = $(this).attr("href");
if($(this).attr("href") && url.indexOf("javascript") == -1 && url.indexOf("#") == -1 && (url.match(/http:\/\/wiki.eqemulator.org\//i) || (url.match(/p\?|i\?/i) && !url.match(/http:/i)))){
e.preventDefault();
if(history.pushState) {
console.log('LOADING PUSH STATE');
var xmlhttp;
$("#bcontent").hide();
$("#bcontent").fadeIn(300);
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("bcontent").innerHTML=xmlhttp.responseText;
$("#bcontent").find("script").each(function(i) {
eval($(this).text());
});
if($("#bcontent").text().indexOf("brush:")){
DoSyntaxHighlightGM();
}
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
}
//alert($(this).attr("href") + "&v_ajax");
xmlhttp.open("GET", $(this).attr("href") + "&v_ajax", true);
history.pushState("page_pop", $(this).attr("href"), $(this).attr("href"));
xmlhttp.send();
}
return false;
}
});
Raw Paste Data