var report_d = $('report_d'); var report_idea = document.createElement('div'); var report_bug = document.createElement('div'); report_idea.id = 're_idea'; report_bug.id = 're_bug'; report_idea.innerHTML = 'Advice'; report_bug.innerHTML = 'Report Bugs'; report_idea.onclick = report_bug.onclick = function() { if(!$('report_win') || $('report_win').style.display == 'none') report_proxy(this); else hide_report_win(); } with(report_bug.style) { report_idea.style.cursor = cursor = 'pointer'; report_idea.style.lineHeight = lineHeight = '20px'; report_idea.style.styleFloat = styleFloat = 'left'; //兼容IE report_idea.style.cssFloat = cssFloat = 'left'; //兼容FireFox paddingLeft = '12px'; } report_d.appendChild(report_idea); report_d.appendChild(report_bug); if(document.location.href.indexOf('head2head') > 0) { var report_tips = document.createElement('div'); report_tips.id = 're_tips'; report_tips.innerText = 'My Tips'; report_tips.onclick = function() { if(!$('report_win') || $('report_win').style.display == 'none') report_proxy(this); else hide_report_win(); } with(report_tips.style) { cursor = 'pointer'; lineHeight = '20px'; styleFloat = 'left'; paddingLeft = '12px'; } report_d.appendChild(report_tips); } function report_proxy(obj) { var p = $('ctl00_ctl00_indexbody_SiteMapPath1_siteMapPath').parentNode.className=='l'?$('ctl00_ctl00_indexbody_SiteMapPath1_siteMapPath').parentNode.parentNode:$('ctl00_ctl00_indexbody_SiteMapPath1_siteMapPath'); p = getOffset(p); show_report_win(obj.id, p.offsetLeft2 + p.offsetWidth, p.offsetTop2 + p.offsetHeight); } function ajax_report_submit(form) { var t; switch(form.name) { case 'form_tips':t = 1;break; case 'form_bug':t = 22;break; case 'form_report':t = 19;break; } var is_tips = form.name=='form_tips'?true:false; var f = is_tips?'':form.is_an.checked; var u = encodeURIComponent(form.username.value); var p = encodeURIComponent(form.password.value); var c = encodeURIComponent(is_tips?tips_format(form):form.context.value); var s = encodeURIComponent(form.title.value); var h = encodeURIComponent(document.location.href); var values = 'u={0}&p={1}&s={2}&c={3}&h={4}&f={5}&t={6}'.format(u,p,s,c,h,f,t); var url = '/report_submit.aspx?action=submit'; ajax(function(rt){ var message = rt.match(/提示信息<\/h1>(\s*)

(.+)<\/p>/i); var post_url = rt.match(/如果您的浏览器没有/); if(post_url == null) $('report_msg').innerHTML = message == null ? rt : message[2]; else { $('report_inner').innerHTML = '
Published success! Click here to visit it.

' flag_text=false; } },url,values,'post'); } function t_s_over(id){ var count = parseInt(id.replace('t_s_','')); for(var i = 1 ; i <= count ; i++){ if($('t_s_' + i).style.color != 'blue') $('t_s_' + i).style.color = 'red'; } } function t_s_out(){ for(var i = 1 ; i <= 5 ; i++){ if($('t_s_' + i).style.color != 'blue') $('t_s_' + i).style.color = 'black'; } } function t_s_click(id){ var count = parseInt(id.replace('t_s_','')); var str_star = ''; var html_star = ''; for(var i = 1 ; i <= 5 ; i++){ $('t_s_' + i).style.color = 'black'; } for(var i = 1 ; i <= count ; i++){ $('t_s_' + i).style.color = 'blue'; html_star += ''; str_star += '★'; } $('t_info').getElementsByTagName('label')[1].innerHTML = html_star; $('t_title').value = $('t_title').value.replace(/信心:(.*)/i,'信心:' + str_star) $('t_star').value = count; } function tips_format(form){ var title = form.t_title.value; var star = form.t_star.value; var teams = form.t_teams.value.split('|'); var time = form.t_time.value; var context = form.context.value; var bgcolor = $('t_info').style.background; var size; for(var i=0;i\

'; if(id == 're_tips') var div_tips ='\ \ '; if($('report_win')) { switch(id){ case 're_idea' : $('report_win').outerHTML = div_idea; show_zoom('report_win'); break; case 're_bug' : $('report_win').outerHTML = div_idea.replace('form_report', 'form_bug').replace(/Advice/g,'Report Bugs').replace(/意见/g,'错误'); show_zoom('report_win'); break; case 're_tips' : $('report_win').outerHTML = div_tips; show_zoom('report_win'); break; } $('report_win').style.display = ''; return; } var div; switch(id){ case 're_idea' : div = div_idea; break; case 're_bug' : div = div_idea.replace('form_report', 'form_bug').replace(/Advice/g,'Report Bugs').replace(/意见/g,'错误'); break; case 're_tips' : div = div_tips; break; } document.body.insertAdjacentHTML("afterBegin",div); //only ie //$('ctl00_ctl00_indexbody_SiteMapPath1_siteMapPath').innerHTML += div; show_zoom('report_win'); } function hide_zoom(id){ $('iframe_bk').style.display = 'none'; var ele = $(id); var height = parseInt(ele.style.height.replace('px',''),10); var width = parseInt(ele.style.width.replace('px',''),10); ele.innerHTML = ''; ele.style.border = '1px solid #000'; var i = setInterval(function(){ height -= height/4; width -= width/4; if(height < 20 && width < 20) { ele.style.display = 'none'; clearInterval(i); } ele.style.height = height; ele.style.width = width; },20); } function show_zoom(id){ var h = 0,w = 0; var ele = $(id); var inner = ele.innerHTML; var height = parseInt(ele.style.height.replace('px',''),10); var width = parseInt(ele.style.width.replace('px',''),10); ele.innerHTML = ''; ele.style.display = ''; ele.style.height = '0px'; ele.style.width = '0px'; var i = setInterval(function(){ h += height/8+1; w += width/8+1; ele.style.height = h > height ? height : h; ele.style.width = w > width ? width : w; if(h > height && w > width) { clearInterval(i); $('iframe_bk').style.display = 'block'; ele.style.borderTop = '1px solid #ccc'; ele.style.borderLeft = '2px solid #ccc'; ele.style.borderBottom = '2px solid #ccc'; ele.style.borderRight = '1px solid #ccc'; ele.innerHTML = inner; //ele.onmouseover = function() {flag_h=true;$('iframe_bk').style.display = '';}; //ele.onmouseout = function() {hide_report_win();}; } },20); } function hide_report_win(){ $('iframe_bk').style.display = 'none'; flag_h = false; setTimeout(function(){ if(!flag_h && !flag_text && document.activeElement.id != 'report_text') { hide_zoom('report_win'); } },100); } var flag_h; var flag_text = false; function anony_select(obj){ var texts = $('report_inner').getElementsByTagName('input'); for(var i = 0 ; i < 2; i++){ if(texts[i].type == 'text'){ texts[i].value = obj.checked ? 'Anonymous' : 'Please input your Username'; texts[i].onfocus = function() { if(this.value == 'Please input your Username') this.value = '' }; texts[i].onblur = function() { if(this.value == '') this.value = 'Please input your Username' }; } texts[i].disabled = (obj.checked ? true : false); texts[i].style.background = obj.checked ? '#ddd' : 'white'; } }