⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 article.js

📁 用CPLD控制曼彻斯特编解码器
💻 JS
字号:
// JScript File
var FeedBack_Length = 60;

var maxwidth = 600;
IsStat = false; //不统计
//Fix Img
if(document.getElementById("Content") != null)
{
    for (var i = 0; i<document.getElementById("Content").getElementsByTagName("IMG").length;i++)
    {
         var o = document.getElementById("Content").getElementsByTagName("IMG")[i];
         if (o.width>maxwidth)
         {
                o.width = maxwidth;
         }
    }
}

function FillUL(id,titlename,linkname)
{
    try
    {
        var title = eval(titlename);
        var link = eval(linkname);
    }catch(e)
    {
        return;
    }
    oUL = document.getElementById(id); 
    if(oUL == null || title == null || link == null) return;
    if (title.length == 0)
    {
        oUL.parentNode.style.display = "none";
    }else{
        oUL.parentNode.style.display = "block";
        for (var i=0;i<title.length;i++)
        {
            oLI = document.createElement("LI");
            oLI.innerHTML = "- <a href=\""+link[i]+"\">"+title[i]+"</a>";
            oUL.appendChild(oLI);
        }
    }
}

function page_load()
{    
    var oUL;
    var oLI;
    
    var oLeft = document.getElementById("left"); 
    var oRight = document.getElementById("right"); 
    
    //没有条副就缩进 2006-4-7 取消
//    if(oLeft.innerText == "")
//    {
//        oLeft.style.display = "none";
//        oRight.style.width = "100%";
//    }

    //最新杂志
    if(document.getElementById("issue") != null)
    {
        document.getElementById("issue").innerHTML = issue;
    }
    
    //Blog
    FillUL("blog","Blog_Title","Blog_Link");
    
    //解决方案
    FillUL("solution","Solution_Title","Solution_Link");
    
    //热点聚集
    if(document.getElementById("focus") != null)
    {
        document.getElementById("focus").innerHTML = focus;
    }
    //相关文章
    FillUL("RelativeArticle","RelativeArt_Title","RelativeArt_Link");
    
    //作者相关
    FillUL("RelativeEditor","RelativeEditor_Title","RelativeEditor_Link");
    
    //相关厂商
    FillUL("RelativeCorp","RelativeCorp_Title","RelativeCorp_Link");
    
    //相关评论
    oUL = document.getElementById("FeedBack"); 
    FeedBack(oUL, true);
    oUL = document.getElementById("FeedBack_Bottom"); 
    FeedBack(oUL, false);
	
   
    //点击率
    document.getElementById("Info").innerHTML += " 点击:"+PageView;

	//可编辑
	if (IsEditable == true)
	{
		
		if (IsChooseable == true)
		{
			//编辑推荐
			document.getElementById("tools").innerHTML += "<a href=\"/Pagesadmin/Article/admin_EditorChoose.aspx?id="+id+"\"><img height=\"24\" alt=\"编辑推荐\" src=\"/images/old/printICON.gif\" width=\"23\" border=\"0\"></a>【<a href=\"/Pagesadmin/Article/Admin_EditorChoose.aspx?id="+id+"\">编辑推荐</a>】";
		}
		
		//编辑此文章		
		document.getElementById("tools").innerHTML += "<a href=\"/Pagesadmin/Admin_Article_Modify.aspx?id="+id+"\"><img height=\"24\" alt=\"编辑此文\" src=\"/images/old/printICON.gif\" width=\"23\" border=\"0\"></a>【<a href=\"/Pagesadmin/Admin_Article_Modify.aspx?id="+id+"\">编辑此文</a>】";
		
		
	}
	
	//广告
	window.setTimeout("Advertisemant('"+TechList+"')",1);
	
}

//相关评论
/// oUL 评论容器
/// IsIndent 是否缩排
function FeedBack(oUL, IsIndent)
{
    if(oUL == null)return;
    
    if (FeedBack_Content.length == 0)
	{
		oLI = document.createElement("LI");

		oLI.innerHTML = "暂无相关评论";
        oUL.appendChild(oLI);
	}else{
		for (var i=0;i<FeedBack_Content.length;i++)
		{
			oLI = document.createElement("LI");
			
			var postback = FeedBack_Content[i];
			var user = FeedBack_User[i];
			var shortpostback;
			
			if (postback.length > FeedBack_Length && IsIndent == true)
			{
				shortpostback = postback.substring(0,FeedBack_Length) + "……"
			}else{
				shortpostback = postback;
			}
			
			oLI.innerHTML = "- <a title=\""+postback+"\" >"+shortpostback+"</a>-- <span>"+user+"</span>";
			oUL.appendChild(oLI);
		}
	}
}

function onLoad()
{
    window.setTimeout("page_load()",1);
}
window.document.body.onload = new function(){onLoad()};

//document.body.attachEvent("onload", new function(){page_load()}); 

//document.body.attachEvent("onload", function(){page_load();}); 

//window.addEventListener( "load", page_load, false ) 

function PostFeedBack(id)
{
	var oUL;
    var oLI;
    var url = "/article/PostFeedBack.aspx?id="+id+"&temp="+getRandom();
    var postback;
    var b = new BrowserInfo();
    
    if (parseInt(b.version)>=4 && b.name == "Microsoft Internet Explorer")
    {
        postback = window.showModalDialog(url,window,"dialogHeight:250px;dialogWidth:450px;help:no;status:0;");
    }else{
        alert("no")
    }
    
    if (postback != null)
    {
        var user = postback.split("/**/")[1];
        postback = postback.split("/**/")[0];
        var shortpostback;
        
        if (postback.length > FeedBack_Length)
        {
            shortpostback = postback.substring(0,FeedBack_Length) + "……"
        }else{
            shortpostback = postback;
        }

		oLI = document.createElement("LI");
		oUL = document.getElementById("FeedBack"); 

        oLI.innerHTML = "- <a title=\""+postback+"\" >"+shortpostback+"</a>-- <span>"+user+"</span>";

		//审核发布,提交成功增加文字提示,“谢谢您的评论,审核中,请稍后回访...”
		alert("谢谢您的评论,审核中,请稍后回访..");
        //oUL.appendChild(oLI);
    }
    //var opener = window.opener("/article/PostFeedBack.aspx?id="+id);
}
// Example: // var b = new BrowserInfo(); // alert(b.version); 


//查看大图
function show_orginral(o)
{
    if (o.tagName != "IMG")
    {
        o = o.parentElement.parentElement;
        
        if (o.getElementsByTagName("img") == 0)
        {
            return false;
        }else{
            o = o.getElementsByTagName("img")[0];
        }
    }
    
    window.open(o.src);
    
    return false;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -