📄 pagetop.js
字号:
//书窝章节更新提示
var time=0;
function novelupdate()
{
time=time+1;
if(time>=10)
{
time=1;
_pagetop.AddLikeUpdate(resultupdate);
}
setTimeout("novelupdate()",60000);
}
function resultupdate(result)
{
if(result.value=="true")
document.getElementById("novelupdate").style.visibility="visible";
}
//检验登陆输入规范
function login_judge()
{
if(document.getElementById("Text_User").value.replace(/\s/g, "").length<1 || document.getElementById("Text_User").value.replace(/\s/g, "").length>10)
{
alert('用户名输入有误!');
return false;
}
if(document.getElementById("Text_Password").value.replace(/\s/g, "").length<4 || document.getElementById("Text_Password").value.replace(/\s/g, "").length>10)
{
alert('密码输入有误!');
return false;
}
if(document.getElementById("Text_Validate").value.replace(/\s/g, "").length!=3)
{
alert('验证码输入有误!');
return false;
}
return true;
}
//转到搜索页后初始参数
function onloadsearch()
{
if(GetUrlParam('key')!=null)
{
document.getElementById('Text_Search').value=GetUrlParam('key');
document.getElementById('Select_Type').value=GetUrlParam('sort');
search();
}
}
//搜索文本框得到焦点后判断
function judge()
{
if(document.getElementById("Text_Search").value=='请输入')
document.getElementById("Text_Search").value='';
}
//是否切换页面
function searchinfo()
{
if(location.href.indexOf('novelsearch.aspx?key=')==-1)
location="novelsearch.aspx?key="+escape(document.getElementById('Text_Search').value)+"&sort="+document.getElementById('Select_Type').value;
else
search();
return false;
}
//发送搜索请求
function search()
{
if(document.getElementById('Text_Search').value.replace(/\s/g, "")=='' || document.getElementById('Text_Search').value=='请输入')
{
alert('请输入搜索内容!');
return false;
}
if(document.getElementById('Text_Search').value.length>20)
{
alert('搜索内容请不要超出20个字符');
return false;
}
document.getElementById("visibility").style.visibility="visible";
_pagetop.Search(document.getElementById('Text_Search').value,document.getElementById('Select_Type').value,resultsearch);
return false;
}
function resultsearch(result)
{
document.getElementById("visibility").style.visibility="hidden";
document.getElementById("searchresult").innerHTML=result.value;
}
//提取链接串后面的参数
function GetUrlParam( paramName )
{
var sValue = unescape(location.search).match(new RegExp("[\?\&]" + paramName + "=([^\&]*)(\&?)","i"));
return sValue ? sValue[1] : sValue;
}
//检验评论内容
function comment()
{
if(document.getElementById("Text_Content").value.replace(/\s/g, "").length<1 || document.getElementById("Text_Content").value.replace(/\s/g, "").length>2000)
{
alert('评论内容不的为空或超出2000个字符!');
return false;
}
}
//发送清空Cookie书库请求
function clearcookie(topicid,title)
{
if(confirm('您确定要清除本地Cookie书库吗,点击“确定”清空,否则请点“取消”!'))
_pagetop.ClearCookie(resultclear);
return false;
}
function resultclear()
{
location=location;
}
//发送推荐请求
function commend(topicid)
{
alert('谢谢您的推荐');
_pagetop.Commend(topicid);
return false;
}
//加入收藏夹,该书收藏次数增加1
function addfavorite(url,title,topicid)
{
external.AddFavorite(url,title)
_pagetop.Collection(topicid);
return false;
}
//发送添加Cookie书库请求
function addcookie(topicid,title)
{
_pagetop.AddCookie(topicid,title,resultcookie)
return false;
}
function resultcookie(result)
{
if(result.value=="true")
alert('cookie书库添加成功,你可以随时点击页面右上角的链接查看收录');
else
alert('抱歉,添加失败!\r\n可能您的Cookie书库已满,Cookie书库上限50本!');
}
//发送添加书窝请求
function addsql(topicid)
{
_pagetop.AddSql(topicid,resultsql);
return false;
}
function resultsql(result)
{
if(result.value=="success")
alert('添加成功,登陆后可在页面左上方点击链接查看收录');
else if(result.value=="sql>100")
alert('抱歉,你的书窝已满,请删除部分书籍在添加!');
else if(result.value=="repeate")
alert('抱歉,该书您已经添加了!');
else
alert('抱歉,您还未登陆!');
}
//章节浏览与全文阅读
function chapter(topicid,chapterid)
{
document.getElementById("visibility").style.visibility="visible";
if(chapterid==88888888)
_pagetop.ChapterAll(topicid,resultchapter);
else
_pagetop.Chapter(topicid,chapterid,resultchapter);
return false;
}
function resultchapter(result)
{
location="#novel";
document.getElementById("visibility").style.visibility="hidden";
document.getElementById("chaptercontent").innerHTML=result.value;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -