📄 index.aspx
字号:
<%@ page language="C#" autoeventwireup="true" inherits="Index, HoWaveIMSV5.0" %>
<%@ Register Src="Passport/UserControls/CopyRight.ascx" TagName="CopyRight" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>IMS整合桌面---轻松整合个性化资讯网站</title>
<link href="IMS_Img/IndexStyle.css" rel="stylesheet" type="text/css" />
<%--<script type="text/javascript" src="Passport/Js/Howave_Index.js"></script>--%>
<script type="text/javascript">
var mouseOffset = null;
var iMouseDown = false;
var lMouseState = false;
var dragObject = null;
var DragDrops = [];
var curTarget = null;
var lastTarget = null;
var dragHelper = null;
var tempDiv = null;
var rootParent = null;
var rootSibling = null;
var layoutType="normal";
var slectType="Drag";
var rss_description=[];
var now = new Date();
var nextmonth = new Date(now.getYear(),now.getMonth()+1, now.getDate());
var _ContainerArray_=new Array();
var DragBoxArray=new Array();
var userChannel=new Array();
Number.prototype.NaN0=function(){return isNaN(this)?0:this;}
function CreateDragContainer(){
var cDrag = DragDrops.length;
DragDrops[cDrag] = [];
_ContainerArray_=document.getElementsByClassName("DragContainer");
for (var i=0; i<_ContainerArray_.length; i++) {
var cObj = _ContainerArray_[i];
DragDrops[cDrag].push(cObj);
cObj.setAttribute('DropObj', cDrag);
for(var j=0; j<cObj.childNodes.length; j++){
if(cObj.childNodes[j].nodeName=='#text') continue;
cObj.childNodes[j].setAttribute('DragObj', cDrag);
}
}
}
function mouseCoords(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
function getMouseOffset(target, ev){
ev = ev || window.event;
var docPos = getPosition(target);
var mousePos = mouseCoords(ev);
return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
}
function getPosition(e){
var left = 0;
var top = 0;
while (e.offsetParent){
left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
top += e.offsetTop + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);
e = e.offsetParent;
}
left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
top += e.offsetTop + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);
return {x:left, y:top};
}
function mouseMove(ev){
ev = ev || window.event;
var target = ev.target || ev.srcElement;
var mousePos = mouseCoords(ev);
if(lastTarget && (target!==lastTarget)){
var origClass = lastTarget.getAttribute('origClass');
if(origClass) lastTarget.className = origClass;
}
var dragObj = target.getAttribute('DragObj');
if(dragObj!=null){
if(target!=lastTarget){
var oClass = target.getAttribute('overClass');
if(oClass){
target.setAttribute('origClass', target.className);
target.className = oClass;
}
}
if(iMouseDown && !lMouseState){
if((target.id).indexOf("_title")>0){
var __dragBox__Id= (target.id).substring(0,(target.id).indexOf("_title"));
target=document.getElementById(__dragBox__Id);
dragObj= target.getAttribute('DragObj');
}
curTarget = target;
rootParent = curTarget.parentNode;
rootSibling = curTarget.nextSibling;
mouseOffset = getMouseOffset(target, ev);
for(var i=0; i<dragHelper.childNodes.length; i++) dragHelper.removeChild(dragHelper.childNodes[i]);
dragHelper.appendChild(curTarget.cloneNode(true));
dragHelper.style.width=curTarget.clientWidth;
dragHelper.style.display = 'block';
var dragClass = curTarget.getAttribute('dragClass');
if(dragClass){
dragHelper.firstChild.className = dragClass;
}
dragHelper.firstChild.removeAttribute('DragObj');
var dragConts = DragDrops[dragObj];
curTarget.setAttribute('startWidth', parseInt(curTarget.offsetWidth));
curTarget.setAttribute('startHeight', parseInt(curTarget.offsetHeight));
curTarget.style.display = 'block';
if(layoutType=="normal"){
for(var i=0; i<dragConts.length; i++){
with(dragConts[i]){
var pos = getPosition(dragConts[i]);
setAttribute('startWidth', parseInt(offsetWidth));
setAttribute('startHeight', parseInt(offsetHeight));
setAttribute('startLeft', pos.x);
setAttribute('startTop', pos.y);
}
for(var j=0; j<dragConts[i].childNodes.length; j++){
with(dragConts[i].childNodes[j]){
if((nodeName=='#text') || (dragConts[i].childNodes[j]==curTarget)) continue;
var pos = getPosition(dragConts[i].childNodes[j]);
setAttribute('startWidth', parseInt(offsetWidth));
setAttribute('startHeight', parseInt(offsetHeight));
setAttribute('startLeft', pos.x);
setAttribute('startTop', pos.y);
}
}
}
}
}
}
if(curTarget){
dragHelper.style.top = mousePos.y - mouseOffset.y;
dragHelper.style.left = mousePos.x - mouseOffset.x;
var dragConts = DragDrops[curTarget.getAttribute('DragObj')];
var activeCont = null;
var xPos = mousePos.x - mouseOffset.x + (parseInt(curTarget.getAttribute('startWidth')) /2);
var yPos = mousePos.y - mouseOffset.y + (parseInt(curTarget.getAttribute('startHeight'))/2);
for(var i=0; i<dragConts.length; i++){
with(dragConts[i]){
if(((getAttribute('startLeft')) < xPos) &&
((getAttribute('startTop')) < yPos) &&
((getAttribute('startLeft') + getAttribute('startWidth')) > xPos) &&
((getAttribute('startTop') + getAttribute('startHeight')) > yPos)&&layoutType=="normal"){
curTarget.style.border='dashed 1px gray';
for(var m=0;m<curTarget.childNodes.length;m++)
(curTarget.childNodes[m]).style.visibility='hidden';
activeCont = dragConts[i];
break;
}
}
}
if(activeCont){
if(layoutType=="normal"){
var beforeNode = null;
for(var i=activeCont.childNodes.length-1; i>=0; i--){
with(activeCont.childNodes[i]){
if(nodeName=='#text') continue;
if(
( curTarget != activeCont.childNodes[i] &&
((getAttribute('startLeft') + getAttribute('startWidth')) > xPos) )&&
((getAttribute('startTop') + getAttribute('startHeight')) > yPos)){
beforeNode = activeCont.childNodes[i];
}
}
}
if(beforeNode){
if(beforeNode!=curTarget.nextSibling){
activeCont.insertBefore(curTarget, beforeNode);
}
} else {
if((curTarget.nextSibling) || (curTarget.parentNode!=activeCont)){
activeCont.appendChild(curTarget);
}
}
if(curTarget.style.display!=''){
curTarget.style.display = '';
}
}
} else {
if(curTarget.style.display!='none'){
curTarget.style.display = 'none';
}
}
}
lMouseState = iMouseDown;
lastTarget = target;
lMouseState = iMouseDown;
return false;
}
function mouseUp(ev){
if(curTarget){
curTarget.style.top = dragHelper.style.top;
curTarget.style.left = dragHelper.style.left;
dragHelper.style.display = 'none';
dragHelper.removeChild(dragHelper.childNodes[0]);
if(curTarget.style.display == 'none'){
if(rootSibling){
rootParent.insertBefore(curTarget, rootSibling);
} else {
rootParent.appendChild(curTarget);
}
}
curTarget.style.display = '';
curTarget.style.border='0';
for(var m=0;m<curTarget.childNodes.length;m++)
(curTarget.childNodes[m]).style.visibility='visible';
var m_containerObj=curTarget.parentNode;
var m_row=0;
for(var ch=0;ch<m_containerObj.childNodes.length;ch++){
if((m_containerObj.childNodes[ch]).id==curTarget.id)
m_row=ch;
}
SaveCurrnetLayout();
}
curTarget = null;
iMouseDown = false;
}
function SaveCookie(){
var s_cookie_array=new Array();
for(var k=0;k<userChannel.length;k++){
var tempArray=new Array();
for(var l=0;l<=10;l++){
var temp_str=userChannel[k][l].toString();
if(temp_str.indexOf("=")>0){
temp_str=temp_str.replace(/\=/g,"{equ}");
}
tempArray[l]=temp_str;
if(l==1)
temp_str=escape(temp_str);
}
s_cookie_array[k]=tempArray.join("|");
}
var s_cookie=new Cookie();
s_cookie.setCookie("HoWave_ChannelArray", s_cookie_array,nextmonth);
}
function SaveCurrnetLayout(){
//1先保存当前的列布局
//2循环所有容器,保存各容器内的模块的位置
for(var i=0;i<_ContainerArray_.length;i++){
for(var j=0;j<_ContainerArray_[i].childNodes.length;j++){
for(var k=0;k<userChannel.length;k++){
if((_ContainerArray_[i].childNodes[j]).id=="rss_"+userChannel[k][0].toString()){
userChannel[k][4]=i;//col
userChannel[k][5]=j;//row
}
}
//Cookie("ChannelArray")="id|title|rssurl|rssnum|col|row|width|height|type|top|left"
}
}
SaveCookie();
}
function mouseDown(){
var el = getReal(event.srcElement, "className", "dragBoxContent");
if (el == null) {
iMouseDown = true;
if(lastTarget){
return false;
}
}
else{
doDown();
}
}
var theobject = null;
function resizeObject() {
this.el = null;
this.dir = "";
this.grabx = null;
this.graby = null;
this.width = null;
this.height = null;
this.left = null;
this.top = null;
}
function getDirection(el) {
var xPos, yPos, offset, dir;
dir = "";
xPos = window.event.offsetX;
yPos = window.event.offsetY;
offset = 8;
if (yPos<offset) dir += "n";
else if (yPos > el.offsetHeight-offset) dir += "s";
if (xPos<offset) dir += "w";
else if (xPos > el.offsetWidth-offset) dir += "e";
return dir;
}
function doDown() {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -