📄 howave_index.js
字号:
}
catch(e){
return null;
}
return newNode;
}
function CreateDragBox(obj){
var divElement=document.createElement("div");
divElement.className="DragBox";
divElement.setAttribute("overClass","OverDragBox");
divElement.setAttribute("dragClass","DragDragBox");
divElement.setAttribute("onmousemove","mouseMove");
divElement.setAttribute("onmouseup","mouseUp");
divElement.setAttribute("onmousedown","mouseDown");
divElement.setAttribute("id","rss_"+obj[0]);
var rss_Id="rss_"+obj[0];
var divHTML= "<table style=\"border:0;\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" id=\""+rss_Id+"_tablehead\">";
divHTML+="<tr><td style=\"width:6px;\"><img src=\"IMS_Img/Index/aiddi_25.gif\"/></td>";
divHTML+="<td style=\"background:url(IMS_Img/Index/aiddi_26.gif) repeat-x;width:100%;\" id=\""+rss_Id+"_table_td\">";
divHTML+="<div id=\""+rss_Id+"_head\" class=\"dragBoxHead\"><div id=\""+rss_Id+"_title\" class=\"dragBoxTitle\" DragObj=\"0\" ><a href=\""+obj[2]+"\">"+obj[1]+"</a></div><div id=\""+rss_Id+"_tool\" class=\"dragBoxTool\"><img src=\"IMS_Img/Index/View.gif\" onClick='top.page.DragBoxMenu.showMenu(\""+rss_Id+"\")' align='middle' onMouseOver=\"this.className='buttonActive';\" onMouseOut=\"this.className='buttonBlur';\"/> <img src=\"IMS_Img/Index/Box_small.gif\" onClick='top.page.DragBoxMenu.showHideContent(\""+rss_Id+"_content\",this)' align='middle' onMouseOver=\"this.className='buttonActive';\" onMouseOut=\"this.className='buttonBlur';\"/> <img src=\"IMS_Img/Index/deleteLink.gif\" onClick='javascript:if(confirm(\"确认要删除此模块?\"))top.page.DragBoxMenu.close(\""+rss_Id+"\");' align='middle' onMouseOver=\"this.className='buttonActive';\" onMouseOut=\"this.className='buttonBlur';\"/></div></div>";
divHTML+="</td>";
divHTML+="<td><img src=\"IMS_Img/Index/aiddi_28.gif\"/></td>";
divHTML+="</tr></table>";
divHTML+="<div id=\""+rss_Id+"_content\" class=\"dragBoxContent\" ResizeObj=\"0\"><img src=\"IMS_Img/Index/Loading.gif\"/>";
if(obj[8]=="Rss")
divHTML+="<script>Delay('"+obj[2]+"','"+rss_Id+"_content');<\/script>";
divHTML+="</div>"
get_callback(divElement,divHTML);
return divElement;
}
function cleanWhiteSpace(element){
for(var i=0;i<element.childNodes.lenght;i++){
var node=element.childNodes[i];
if(node.nodeType==3&&!/\S/.test(node.nodeValue))
node.parentNode.removeChild(node);
}
}
function gE(id) {
if (document.all)
return document.all[id];
else
return document.getElementById(id);
}
function get_callback(obj,innerContent){
reInnerHTML(obj, innerContent);
}
var reInnerHTML=function (ele,innerHtml) {
var nA=navigator.appVersion;
if(nA.indexOf('MSIE')>=0)var curIE=nA.substr(nA.indexOf('MSIE')+5,3);
if (curIE){
innerHtml=innerHtml.replace(/<script([^>]*)>/gi,"<script$1 defer=\"true\">");
var reStartScript=/^(\s*<script)/gi;
if (reStartScript.test(innerHtml)){
innerHtml="<span style=\"display:none;\">Hack IE</span>"+innerHtml;
ele.innerHTML=innerHtml;
ele.removeChild(ele.firstChild);
}else{
ele.innerHTML=innerHtml;
}
}else{
var newObj=document.createElement(ele.tagName);
newObj.id=ele.id;
newObj.className=ele.className;
newObj.innerHTML = innerHtml;
ele.parentNode.replaceChild(newObj,ele);
}
}
function HttpCookie(name, value) {
if (name != null)
this.name = name;
else
this.name = "";
if (value != null)
this.value = value;
else
this.value = "";
this.expires = new Date();
this.path = "";
this.domain = "";
this.toString = function() {
return "HoWave.IMS.DeskTop.HttpCookie";
}
}
function Cookie() {
var __value__ = document.cookie;
if (__value__ == null || __value__ == "")
this.enabled = false;
else
this.enabled = true;
var __cookies__ = new Array();
if (this.enabled) {
var __tempValue = __value__.split(';');
for (var i = 0; i < __tempValue.length; i++) {
var __name = __tempValue[i].split('=')[0];
var __value = unescape(__tempValue[i].split('=')[1]);
var __cookie = new HttpCookie(__name, __value);
__cookies__.push(__cookie);
}
}
this.item = __cookies__;
this.getCookie = function (name) {
for (var i = 0; i < __cookies__.length; i++) {
var __name = __cookies__[i].name;
if (__name.indexOf(" ") > -1)
__name = __name.substring(__name.indexOf(" ") + 1, __name.length);
if (__name.lastIndexOf(" ") > -1)
__name = __name.substring(0, __name.lastIndexOf(" "));
var __value = __cookies__[i].value;
if (__name == name)
return __value;
}
return null;
}
this.setCookie = function() {
if (arguments.length == 0 || arguments.length > 3) {
throw "Invalid arguments.";
}
else {
var __cookie;
if (arguments.length == 1)
__cookie = arguments[0];
else if (arguments.length == 2) {
__cookie = new HttpCookie(arguments[0], arguments[1]);
}
else {
__cookie = new HttpCookie(arguments[0], arguments[1]);
__cookie.expires = arguments[2];
}
var __modified = false;
var __index = -1;
for (var i = 0; i < __cookies__.length; i++) {
var __name = __cookies__[i].name;
var __value = __cookies__[i].value;
if (__name == __cookie.name) {
__cookies__[i].value = __cookie.value;
__cookies__[i].expires = __cookie.expires;
__modified = true;
__index = i;
}
}
if (!__modified) {
__index = __cookies__.length;
__cookies__.push(__cookie);
}
if (document.all) {
document.cookie = __cookies__[__index].name + "=" + __cookies__[__index].value + ";expires=" + __cookies__[__index].expires.toGMTString();
}
else {
var __expiresDate = __cookies__[__index].expires;
var __abbreviatedMonthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var __dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
var __expires = __dayNames[__expiresDate.getUTCDay()] + ", " + (__expiresDate.getUTCDate() > 0 ? "" : "0") + __expiresDate.getUTCDate() + "-" + __abbreviatedMonthNames[__expiresDate.getUTCMonth()] + "-" + __expiresDate.getUTCFullYear() + " " + (__expiresDate.getUTCHours() > 9 ? "" : "0") + __expiresDate.getUTCHours() + ":" + (__expiresDate.getUTCMinutes() > 9 ? "" : "0") + __expiresDate.getUTCMinutes() + ":" + (__expiresDate.getUTCSeconds() > 9 ? "" : "0") + __expiresDate.getUTCSeconds() + " GMT";
document.cookie = __cookie.name + "=" + __cookie.value + ";";
document.cookie += "expires=" + __expires;
}
}
}
}
function HttpAjax() {
var self = this;
this.createXMLHttpRequest = function() {
try {
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
}
try {
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
}
try {
return new XMLHttpRequest();
}
catch(e) {
}
return null;
}
this.toString = function() {
return "Howave.Web.HttpAjax";
}
this.create = function(url, callbackHandler, onErrorHandler) {
var xmlReq = this.createXMLHttpRequest();
if (xmlReq != null) {
xmlReq.open("GET", url, true);
xmlReq.onreadystatechange = function() {
switch(xmlReq.readyState)
{
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
callbackHandler(xmlReq);
break;
default:
onErrorHandler();
break;
}
}
xmlReq.send(null);
return xmlReq;
}
else {
throw "System does not support Ajax.";
}
}
this.setVisible = function(controlId, visible) {
if (document.getElementById(controlId) != null)
document.getElementById(controlId).style.visibility = (visible ? "visible" : "hidden");
}
this.setDisplay = function(controlId, displayMode) {
if (document.getElementById(controlId) != null)
document.getElementById(controlId).style.display = displayMode;
}
this.updateContent = function (url, controlId,rssNum) {
var processingIcon;
var _controlContent=document.getElementById(controlId);
if( _controlContent!=null){
_controlContent.innerHTML="<img src=\"IMS_Img/Index/Loading.gif\"/>";
}
var xmlReq = this.createXMLHttpRequest();
if (xmlReq != null) {
xmlReq.open("GET", url, true);
xmlReq.onreadystatechange = function() {
switch(xmlReq.readyState)
{
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
updateContent_callback(xmlReq, controlId,rssNum);
break;
default:
updateContent_onError(controlId);
break;
}
}
xmlReq.send(null);
}
else {
}
}
this.adjustFrameSize = function(frameId) {
var frame = top.document.getElementById(frameId);
if (frame) {
frame.style.height = "0px";
if (frame.contentDocument) {
frame.style.height = parseInt(frame.contentDocument.documentElement.scrollHeight) + "px";
}
else if (frame.document) {
frame.style.height = parseInt(frame.contentWindow.document.documentElement.scrollHeight) + "px";
}
}
}
function updateContent_callback(rValue, controlId,rssNum) {
var rsp = rValue.responseXML;
var news=rsp.getElementsByTagName("item");
var nums=news.length;
if(rssNum!=null&&rssNum!="")
nums=parseInt(rssNum);
if(news.length<nums)
nums=news.length;
var result="<ul>";
var rss_i=rss_description.length+1;
rss_description[rss_i]=new Array();
for(var i=0;i<nums;i++)
{
if(news[i].getElementsByTagName("description")[0].hasChildNodes()&&news[i].getElementsByTagName("description")[0].firstChild.length>0)
{
rss_description[rss_i][i]=news[i].getElementsByTagName("description")[0].firstChild.nodeValue;
result+="<li><a href='"+news[i].getElementsByTagName("link")[0].firstChild.nodeValue +"' target='_blank'>"+news[i].getElementsByTagName("title")[0].firstChild.nodeValue+"</a><a href='javascript:void(0)' onclick=\"top.page.DragBoxMenu.showRss(this,"+rss_i+","+i+");\"><img src='IMS_Img/Index/rss_detail.gif' border='0'/></a></li>";
}
else
result+="<li><a href='"+news[i].getElementsByTagName("link")[0].firstChild.nodeValue +"' target='_blank'>"+news[i].getElementsByTagName("title")[0].firstChild.nodeValue+"</a></li>";
}
result+="</ul>";
var _control=document.getElementById(controlId);
if(_control!=null)
_control.innerHTML=result;
}
function updateContent_onError(controlId) {
if (document.getElementById(controlId) != null)
document.getElementById(controlId).innerHTML = "Data unavailable. Please try again.";
}
}
function DragBoxMenu(){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -