function django_admin_links_div() {
// Update these variables for your site
var admin_url = '/admin/';
var div_title = 'Admin';
var div_style = 'position: fixed; top: 0; right: 0; border: solid #008999 1px; padding: 3px 5px 3px 5px; text-align: center; color: #000; background: #EEDEBC; font-size: 11px; z-index:999;';
// end variables to update
if(typeof ActiveXObject != 'undefined') {
var x = new ActiveXObject('Microsoft.XMLHTTP');
}
else if(typeof XMLHttpRequest != 'undefined') {
var x = new XMLHttpRequest();
}
else {
return;
}
x.open('GET', location.href, false);
x.send(null);
try {
var type = x.getResponseHeader('x-object-type');
var id = x.getResponseHeader('x-object-id');
}
catch(e) {
return;
}
var div = document.createElement('div');
div.style.cssText = div_style;
div.innerHTML = ''+div_title+'
Edit '+type.split('.')[1]+' Logout';
document.body.appendChild(div);
}
django_admin_links_div();