首页 新闻 搜索 专区 学院

html移植到vs2010变成模板

0
悬赏园豆:100 [已关闭问题] 关闭于 2012-03-03 15:39
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Discuz! Administrator's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<meta content="Comsenz Inc." name="Copyright" />
<link rel="stylesheet" href="#">">
var headers = new Array('index', 'global', 'style', 'forum', 'user', 'topic', 'extended', 'adv', 'tool', 'uc');
var admincpfilename = 'admincp.php';
function toggleMenu(key, url) {
if(key == 'index' && url == 'home') {
if(is_ie) {
doane(event);
}
parent.location.href = admincpfilename + '?frames=yes';
return false;
}
for(var k in headers) {
if($('menu_' + headers[k])) {
$('menu_' + headers[k]).style.display = headers[k] == key ? '' : 'none';
}
}
var lis = $('topmenu').getElementsByTagName('li');
for(var i = 0; i < lis.length; i++) {
if(lis[i].className == 'navon') lis[i].className = '';
}
$('header_' + key).parentNode.parentNode.className = 'navon';
if(url) {
parent.main.location = admincpfilename + '?action=' + url;
var hrefs = $('menu_' + key).getElementsByTagName('a');
for(var j = 0; j < hrefs.length; j++) {
hrefs[j].className = hrefs[j].href.substr(hrefs[j].href.indexOf(admincpfilename + '?action=') + 19) == url ? 'tabon' : (hrefs[j].className == 'tabon' ? '' : hrefs[j].className);
}
}
return false;
}
function initCpMenus(menuContainerid) {
var key = '';
var hrefs = $(menuContainerid).getElementsByTagName('a');
for(var i = 0; i < hrefs.length; i++) {
if(menuContainerid == 'leftmenu' && !key && 'action=runwizard'.indexOf(hrefs[i].href.substr(hrefs[i].href.indexOf(admincpfilename + '?action=') + 12)) != -1) {
key = hrefs[i].parentNode.parentNode.id.substr(5);
hrefs[i].className = 'tabon';
}
if(!hrefs[i].getAttribute('ajaxtarget')) hrefs[i].onclick = function() {
if(menuContainerid != 'custommenu') {
var lis = $(menuContainerid).getElementsByTagName('li');
for(var k = 0; k < lis.length; k++) {
if(lis[k].firstChild.className != 'menulink') lis[k].firstChild.className = '';
}
if(this.className == '') this.className = menuContainerid == 'leftmenu' ? 'tabon' : 'bold';
}
if(menuContainerid != 'leftmenu') {
var hk, currentkey;
var leftmenus = $('leftmenu').getElementsByTagName('a');
for(var j = 0; j < leftmenus.length; j++) {
hk = leftmenus[j].parentNode.parentNode.id.substr(5);
if(this.href.indexOf(leftmenus[j].href) != -1) {
leftmenus[j].className = 'tabon';
if(hk != 'index') currentkey = hk;
} else {
leftmenus[j].className = '';
}
}
if(currentkey) toggleMenu(currentkey);
hideMenu();
}
}
}
return key;
}
var header_key = initCpMenus('leftmenu');
toggleMenu(header_key ? header_key : 'index');
function initCpMap() {
var ul, hrefs, s;
s = '<ul class="cnote"><li><img src="images/admincp/btn_map.gif" /></li><li> 按 “ ESC ” 键展开 / 关闭此菜单</li></ul><table class="cmlist" id="mapmenu"><tr>';

for(var k in headers) {
if(headers[k] != 'index' && headers[k] != 'uc') {
s += '<td valign="top"><ul class="cmblock"><li><h4>' + $('header_' + headers[k]).innerHTML + '</h4></li>';
ul = $('menu_' + headers[k]);
hrefs = ul.getElementsByTagName('a');
for(var i = 0; i < hrefs.length; i++) {
s += '<li><a href="' + hrefs[i].href + '" target="' + hrefs[i].target + '" k="' + headers[k] + '">' + hrefs[i].innerHTML + '</a></li>';
}
s += '</ul></td>';
}
}
s += '</tr></table>';
return s;
}
$('cmain').innerHTML = initCpMap();
initCpMenus('mapmenu');
var cmcache = false;
function showMap() {
showMenu('cpmap', true, 3, 3);
if(!cmcache) ajaxget(admincpfilename + '?action=misc&operation=custommenu&' + Math.random(), 'custommenu', '');
}
function resetEscAndF5(e) {
e = e ? e : window.event;
actualCode = e.keyCode ? e.keyCode : e.charCode;
if(actualCode == 27) {
if($('cpmap_menu').style.display == 'none') {
showMap();
} else {
hideMenu();
}
}
if(actualCode == 116 && parent.main) {
parent.main.location.reload();
if(document.all) {
e.keyCode = 0;
e.returnValue = false;
} else {
e.cancelBubble = true;
e.preventDefault();
}
}
}
_attachEvent(document.documentElement, 'keydown', resetEscAndF5);


function uc_left_menu(uc_menu_data) {
var leftmenu = $('menu_uc');
leftmenu.innerHTML = '';
var html_str = '';
for(var i=0;i<uc_menu_data.length;i+=2) {
html_str += '<li><a href="'+uc_menu_data[(i+1)]+'" hidefocus="true" onclick="uc_left_switch(this)" target="main">'+uc_menu_data[i]+'</a></li>';
}
leftmenu.innerHTML = html_str;
toggleMenu('uc', '');
$('admincpnav').innerHTML = 'UCenter';
}

var uc_left_last = null;
function uc_left_switch(obj) {
if(uc_left_last) {
uc_left_last.className = '';
}
obj.className = 'tabon';
uc_left_last = obj;
}

function uc_modify_sid(sid) {
$('header_uc').href = 'http://localhost/11/admin.php?m=frame&a=main&iframe=1&sid=' + sid;
}
</script>
</body>
</html>
尘儿的主页 尘儿 | 初学一级 | 园豆:200
提问于:2012-03-03 15:35
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册