📄 topic.js
字号:
function setFontSize(uid, n)
{
var element = document.getElementById(uid);
var defaultSize = 14;
var defaultLineheight = 20;
var currentSize = "",cSize = 0;currentLineheight = "";cLineheight = 0;
if(null != element)
{
currentSize = element.style.fontSize;
defaultLineheight = element.style.lineHeight;
cSize = parseInt(currentSize.replace("px",""));
cLineheight = parseInt(defaultLineheight.replace("px",""));
if(0 == n)
{
cSize = cSize - 2;
cLineheight = cLineheight - 2;
}
else if(1 == n)
{
cSize = cSize + 2;
cLineheight = cLineheight + 2;
}
if(cSize > 6 && cSize<50){
try
{
element.style.fontSize = cSize + "px";
element.style.lineHeight = cLineheight + "px";
}
catch(e)
{
element.style.fontSize = defaultSize + "px";
element.style.lineHeight = defaultLineheight + "px";
}
}
}
else
{
return;
}
}
//collapse or expand tablebody
function collapseTables(img)
{
var tables = document.getElementsByTagName("table");
if (img.src.indexOf('open') != -1)
{
img.src = img.src.replace('open', 'close');
for (var i=0; i<tables.length; i++)
{
if (tables[i].name != 'loopedreplies') continue;
tables[i].style.display = 'none';
}
}
else
{
img.src = img.src.replace('close', 'open');
for (var i=0; i<tables.length; i++)
{
if (tables[i].name != 'loopedreplies') continue;
tables[i].style.display = '';
}
}
}
/* disabled by Xu
function chkVote(topicid)
{
var f = document.forms['vote'];
var isvalid = false;
for (i=0; i<f.voteitems.length; i++)
{
if (f.voteitems[i].checked)
{
isvalid = true;
break;
}
}
if (!isvalid)
{
alert('请至少选择一个投票项');
return false;
}
f.action = location.href = 'topic_action.aspx?topicid=' + topicid + '&action=savevote';
return true;
}
*/
function operate(o, topicid)
{
var i = o.options.selectedIndex;
if (i > 0)
{
if (o.options[i].value=='delete')
{
location.href = 'topic_delete.aspx?topicid=' + topicid;
}
else if (o.options[i].value == 'istop')
{
location.href = 'topic_SetTopTime.aspx?action=top&topicid=' + topicid;
}
else if (o.options[i].value =='istopall')
{
location.href = 'topic_SetTopTime.aspx?action=topall&topicid=' + topicid;
}
else if (o.options[i].value=='move')
{
location.href = 'topic_move.aspx?topicid=' + topicid;
}
else
{
if (confirm('确定要' + o.options[i].text + '吗?'))
{
location.href='topic_action.aspx?topicid=' + topicid + '&action=' + o.options[i].value;
}
else
{
o.options[0].selected = true;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -