init web ems all
This commit is contained in:
57
wxc2_omc/fault/networkStatus/dragTest/dragIE.js
Executable file
57
wxc2_omc/fault/networkStatus/dragTest/dragIE.js
Executable file
@@ -0,0 +1,57 @@
|
||||
function beginDrag(elementToDrag,event)
|
||||
{
|
||||
var deltaX=event.clientX-parseInt(elementToDrag.style.left);
|
||||
var deltaY=event.clientY-parseInt(elementToDrag.style.top);
|
||||
|
||||
if(document.addEventListener)
|
||||
{
|
||||
document.addEventListener("mousemove",moveHandler,true);
|
||||
document.addEventListener("mouseup",upHandler,true);
|
||||
}
|
||||
else if(document.attachEvent)
|
||||
{
|
||||
document.attachEvent("onmousemove",moveHandler);
|
||||
document.attachEvent("onmouseup",upHandler);
|
||||
}
|
||||
|
||||
if(event.stopPropagation)
|
||||
event.stopPropagation();
|
||||
else
|
||||
event.cancelBubble=true;
|
||||
|
||||
if(event.preventDefault)
|
||||
event.preventDefault();
|
||||
else
|
||||
event.returnValue=false;
|
||||
|
||||
function moveHandler(e)
|
||||
{
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>if (!e) e=window.event; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IE<49><45><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>window.event
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>//ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD><D4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DOM<4F><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BC>Event<6E><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
elementToDrag.style.left=(event.clientX-deltaX)+"px";
|
||||
elementToDrag.style.top=(event.clientY-deltaY)+"px";
|
||||
|
||||
if(event.stopPropagation)
|
||||
event.stopPropagation();
|
||||
else
|
||||
event.cancelBubble=true;
|
||||
}
|
||||
|
||||
function upHandler(e)
|
||||
{
|
||||
if(document.removeEventListener)
|
||||
{
|
||||
document.removeEventListener("mouseup",upHandler,true);
|
||||
document.removeEventListener("mousemove",moveHandler,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
document.detachEvent("onmouseup",upHandler);
|
||||
document.detachEvent("onmousemove",moveHandler);}
|
||||
}
|
||||
if(event.stopPropagation)
|
||||
event.stopPropagation();
|
||||
else
|
||||
event.cancelBubble=true;
|
||||
}
|
||||
|
||||
72
wxc2_omc/fault/networkStatus/dragTest/func.php
Executable file
72
wxc2_omc/fault/networkStatus/dragTest/func.php
Executable file
@@ -0,0 +1,72 @@
|
||||
<style>
|
||||
<!--.drag{position:relative;cursor:hand}
|
||||
-->
|
||||
</style>
|
||||
|
||||
<script language="JavaScript">
|
||||
var dragapproved=false
|
||||
var z,x,y
|
||||
var browser = navigator.appName; //find the browser name
|
||||
if(browser == "Microsoft Internet Explorer"){
|
||||
IE=1
|
||||
}else{
|
||||
IE=0
|
||||
}
|
||||
|
||||
//alert(IE)
|
||||
function move(){
|
||||
|
||||
if (event.button==1&&dragapproved){
|
||||
z.style.pixelLeft=temp1+event.clientX-x
|
||||
z.style.pixelTop=temp2+event.clientY-y
|
||||
return false
|
||||
}
|
||||
}
|
||||
function drags(){
|
||||
//if (!document.all)
|
||||
// return
|
||||
|
||||
dragapproved=true
|
||||
if(IE){
|
||||
z=event.srcElement
|
||||
alert(z)
|
||||
}else{
|
||||
var node=this.parentNode;
|
||||
//node=node.parentNode;
|
||||
alert(node.id);
|
||||
//alert(node.nodeType);
|
||||
//alert(node.id);
|
||||
|
||||
|
||||
//while(node.nodeType!=1){
|
||||
// alert('11')
|
||||
// node=node.parentNode;
|
||||
//}
|
||||
//alert('22')
|
||||
//alert(node);
|
||||
|
||||
|
||||
}
|
||||
|
||||
while (z.id.indexOf("statusLed") == -1) {//check the z if it's led
|
||||
z = z.parentElement;
|
||||
if (z == null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
temp1=z.style.pixelLeft
|
||||
temp2=z.style.pixelTop
|
||||
x=event.clientX
|
||||
y=event.clientY
|
||||
document.onmousemove=move
|
||||
}
|
||||
function dropDrags() {
|
||||
dragapproved=false
|
||||
window.location.href='./mapStatus.php?command=save&drag_x='+z.style.pixelLeft+"&drag_y="+z.style.pixelTop+"&drag_key_led_num="+z.id
|
||||
z = null;
|
||||
return true
|
||||
}
|
||||
document.onmousedown=drags
|
||||
document.onmouseup=dropDrags
|
||||
</script>
|
||||
|
||||
107
wxc2_omc/fault/networkStatus/dragTest/func_other.php
Executable file
107
wxc2_omc/fault/networkStatus/dragTest/func_other.php
Executable file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
<script language=JavaScript>
|
||||
|
||||
self.onError=null;
|
||||
currentX = currentY = 0;
|
||||
whichIt = null;
|
||||
lastScrollX = 0; lastScrollY = 0;
|
||||
NS = (document.layers) ? 1 : 0;
|
||||
IE = (document.all) ? 1: 0;
|
||||
|
||||
function heartBeat() {
|
||||
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
|
||||
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
|
||||
if(diffY != lastScrollY) {
|
||||
percent = .1 * (diffY - lastScrollY);
|
||||
if(percent > 0) percent = Math.ceil(percent);
|
||||
else percent = Math.floor(percent);
|
||||
if(IE) document.all.floater.style.pixelTop += percent;
|
||||
if(NS) document.floater.top += percent;
|
||||
lastScrollY = lastScrollY + percent;
|
||||
}
|
||||
if(diffX != lastScrollX) {
|
||||
percent = .1 * (diffX - lastScrollX);
|
||||
if(percent > 0) percent = Math.ceil(percent);
|
||||
else percent = Math.floor(percent);
|
||||
if(IE) document.all.floater.style.pixelLeft += percent;
|
||||
if(NS) document.floater.left += percent;
|
||||
lastScrollX = lastScrollX + percent;
|
||||
}
|
||||
|
||||
}
|
||||
function checkFocus(x,y) {
|
||||
stalkerx = document.floater.pageX;
|
||||
stalkery = document.floater.pageY;
|
||||
stalkerwidth = document.floater.clip.width;
|
||||
stalkerheight = document.floater.clip.height;
|
||||
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
|
||||
else return false;
|
||||
}
|
||||
function grabIt(e) {
|
||||
if(IE) {
|
||||
whichIt = event.srcElement;
|
||||
while (whichIt.id.indexOf("floater") == -1) {
|
||||
whichIt = whichIt.parentElement;
|
||||
if (whichIt == null) { return true; }
|
||||
}
|
||||
whichIt.style.pixelLeft = whichIt.offsetLeft;
|
||||
whichIt.style.pixelTop = whichIt.offsetTop;
|
||||
currentX = (event.clientX + document.body.scrollLeft);
|
||||
currentY = (event.clientY + document.body.scrollTop);
|
||||
} else {
|
||||
window.captureEvents(Event.MOUSEMOVE);
|
||||
if(checkFocus (e.pageX,e.pageY)) {
|
||||
whichIt = document.floater;
|
||||
StalkerTouchedX = e.pageX-document.floater.pageX;
|
||||
StalkerTouchedY = e.pageY-document.floater.pageY;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function moveIt(e) {
|
||||
if (whichIt == null) { return false; }
|
||||
if(IE) {
|
||||
newX = (event.clientX + document.body.scrollLeft);
|
||||
newY = (event.clientY + document.body.scrollTop);
|
||||
distanceX = (newX - currentX); distanceY = (newY - currentY);
|
||||
currentX = newX; currentY = newY;
|
||||
whichIt.style.pixelLeft += distanceX;
|
||||
whichIt.style.pixelTop += distanceY;
|
||||
if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
|
||||
if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
|
||||
if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
|
||||
if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
|
||||
event.returnValue = false;
|
||||
} else {
|
||||
whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
|
||||
if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
|
||||
if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
|
||||
if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
|
||||
if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function dropIt() {
|
||||
|
||||
whichIt = null;
|
||||
if(NS) window.releaseEvents (Event.MOUSEMOVE);
|
||||
return true;
|
||||
}
|
||||
if(NS) {
|
||||
window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
|
||||
window.onmousedown = grabIt;
|
||||
window.onmousemove = moveIt;
|
||||
window.onmouseup = dropIt;
|
||||
}
|
||||
if(IE) {
|
||||
document.onmousedown = grabIt;
|
||||
document.onmousemove = moveIt;
|
||||
document.onmouseup = dropIt;
|
||||
}
|
||||
if(NS || IE) action = window.setInterval("heartBeat()",1);
|
||||
|
||||
|
||||
</script>
|
||||
758
wxc2_omc/fault/networkStatus/dragTest/func_test.php
Executable file
758
wxc2_omc/fault/networkStatus/dragTest/func_test.php
Executable file
@@ -0,0 +1,758 @@
|
||||
<script language="JavaScript" type="Text/JavaScript">
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
|
||||
if(window.Event){// <20><><EFBFBD><EFBFBD>Event<6E><74>DOM
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
IE5 MacIE5 Mozilla Konqueror2.2 Opera5
|
||||
|
||||
|
||||
event yes yes yes yes yes
|
||||
|
||||
|
||||
event.returnValue yes yes no no no
|
||||
|
||||
|
||||
event.cancelBubble yes yes no no no
|
||||
|
||||
|
||||
event.srcElement yes yes no no no
|
||||
|
||||
|
||||
event.fromElement yes yes no no no
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
Event.prototype.__defineSetter__("returnValue",function(b){//
|
||||
|
||||
|
||||
if(!b)this.preventDefault();
|
||||
|
||||
|
||||
return b;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Event.prototype.__defineSetter__("cancelBubble",function(b){// <20><><EFBFBD>û<EFBFBD><C3BB><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>ð<EFBFBD><C3B0>
|
||||
|
||||
|
||||
if(b)this.stopPropagation();
|
||||
|
||||
|
||||
return b;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Event.prototype.__defineGetter__("srcElement",function(){
|
||||
|
||||
|
||||
var node=this.target;
|
||||
|
||||
|
||||
while(node.nodeType!=1)node=node.parentNode;
|
||||
|
||||
alert(node);
|
||||
return node;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Event.prototype.__defineGetter__("fromElement",function(){// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD>Դ<EFBFBD>ڵ<EFBFBD>
|
||||
|
||||
|
||||
var node;
|
||||
|
||||
|
||||
if(this.type=="mouseover")
|
||||
|
||||
|
||||
node=this.relatedTarget;
|
||||
|
||||
|
||||
else if(this.type=="mouseout")
|
||||
|
||||
|
||||
node=this.target;
|
||||
|
||||
|
||||
if(!node)return;
|
||||
|
||||
|
||||
while(node.nodeType!=1)node=node.parentNode;
|
||||
|
||||
|
||||
return node;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Event.prototype.__defineGetter__("toElement",function(){// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>ڵ<EFBFBD>
|
||||
|
||||
|
||||
var node;
|
||||
|
||||
|
||||
if(this.type=="mouseout")
|
||||
|
||||
|
||||
node=this.relatedTarget;
|
||||
|
||||
|
||||
else if(this.type=="mouseover")
|
||||
|
||||
|
||||
node=this.target;
|
||||
|
||||
|
||||
if(!node)return;
|
||||
|
||||
|
||||
while(node.nodeType!=1)node=node.parentNode;
|
||||
|
||||
|
||||
return node;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Event.prototype.__defineGetter__("offsetX",function(){
|
||||
|
||||
|
||||
return this.layerX;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Event.prototype.__defineGetter__("offsetY",function(){
|
||||
|
||||
|
||||
return this.layerY;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(window.Document){// <20><><EFBFBD><EFBFBD>Document<6E><74>DOM
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
IE5 MacIE5 Mozilla Konqueror2.2 Opera5
|
||||
|
||||
|
||||
document.documentElement yes yes yes yes no
|
||||
|
||||
|
||||
document.activeElement yes null no no no
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(window.Node){// <20><><EFBFBD><EFBFBD>Node<64><65>DOM
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
IE5 MacIE5 Mozilla Konqueror2.2 Opera5
|
||||
|
||||
|
||||
Node.contains yes yes no no yes
|
||||
|
||||
|
||||
Node.replaceNode yes no no no no
|
||||
|
||||
|
||||
Node.removeNode yes no no no no
|
||||
|
||||
|
||||
Node.children yes yes no no no
|
||||
|
||||
|
||||
Node.hasChildNodes yes yes yes yes no
|
||||
|
||||
|
||||
Node.childNodes yes yes yes yes no
|
||||
|
||||
|
||||
Node.swapNode yes no no no no
|
||||
|
||||
|
||||
Node.currentStyle yes yes no no no
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
Node.prototype.replaceNode=function(Node){// <20>滻ָ<E6BBBB><D6B8><EFBFBD>ڵ<EFBFBD>
|
||||
|
||||
|
||||
this.parentNode.replaceChild(Node,this);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Node.prototype.removeNode=function(removeChildren){// ɾ<><C9BE>ָ<EFBFBD><D6B8><EFBFBD>ڵ<EFBFBD>
|
||||
|
||||
|
||||
if(removeChildren)
|
||||
|
||||
|
||||
return this.parentNode.removeChild(this);
|
||||
|
||||
|
||||
else{
|
||||
|
||||
|
||||
var range=document.createRange();
|
||||
|
||||
|
||||
range.selectNodeContents(this);
|
||||
|
||||
|
||||
return this.parentNode.replaceChild(range.extractContents(),this);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Node.prototype.swapNode=function(Node){// <20><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
||||
|
||||
|
||||
var nextSibling=this.nextSibling;
|
||||
|
||||
|
||||
var parentNode=this.parentNode;
|
||||
|
||||
|
||||
node.parentNode.replaceChild(this,Node);
|
||||
|
||||
|
||||
parentNode.insertBefore(node,nextSibling);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(window.HTMLElement){
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineGetter__("all",function(){
|
||||
|
||||
|
||||
var a=this.getElementsByTagName("*");
|
||||
|
||||
|
||||
var node=this;
|
||||
|
||||
|
||||
a.tags=function(sTagName){
|
||||
|
||||
|
||||
return node.getElementsByTagName(sTagName);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return a;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineGetter__("parentElement",function(){
|
||||
|
||||
|
||||
if(this.parentNode==this.ownerDocument)return null;
|
||||
|
||||
|
||||
return this.parentNode;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineGetter__("children",function(){
|
||||
|
||||
|
||||
var tmp=[];
|
||||
|
||||
|
||||
var j=0;
|
||||
|
||||
|
||||
var n;
|
||||
|
||||
|
||||
for(var i=0;i<this.childNodes.length;i++){
|
||||
|
||||
|
||||
n=this.childNodes[i];
|
||||
|
||||
|
||||
if(n.nodeType==1){
|
||||
|
||||
|
||||
tmp[j++]=n;
|
||||
|
||||
|
||||
if(n.name){
|
||||
|
||||
|
||||
if(!tmp[n.name])
|
||||
|
||||
|
||||
tmp[n.name]=[];
|
||||
|
||||
|
||||
tmp[n.name][tmp[n.name].length]=n;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(n.id)
|
||||
|
||||
|
||||
tmp[n.id]=n;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return tmp;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineGetter__("currentStyle", function(){
|
||||
|
||||
|
||||
return this.ownerDocument.defaultView.getComputedStyle(this,null);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineSetter__("outerHTML",function(sHTML){
|
||||
|
||||
|
||||
var r=this.ownerDocument.createRange();
|
||||
|
||||
|
||||
r.setStartBefore(this);
|
||||
|
||||
|
||||
var df=r.createContextualFragment(sHTML);
|
||||
|
||||
|
||||
this.parentNode.replaceChild(df,this);
|
||||
|
||||
|
||||
return sHTML;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineGetter__("outerHTML",function(){
|
||||
|
||||
|
||||
var attr;
|
||||
|
||||
|
||||
var attrs=this.attributes;
|
||||
|
||||
|
||||
var str="<"+this.tagName;
|
||||
|
||||
|
||||
for(var i=0;i<attrs.length;i++){
|
||||
|
||||
|
||||
attr=attrs[i];
|
||||
|
||||
|
||||
if(attr.specified)
|
||||
|
||||
|
||||
str+=" "+attr.name+'="'+attr.value+'"';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(!this.canHaveChildren)
|
||||
|
||||
|
||||
return str+">";
|
||||
|
||||
|
||||
return str+">"+this.innerHTML+"</"+this.tagName+">";
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){
|
||||
|
||||
|
||||
switch(this.tagName.toLowerCase()){
|
||||
|
||||
|
||||
case "area":
|
||||
|
||||
|
||||
case "base":
|
||||
|
||||
|
||||
case "basefont":
|
||||
|
||||
|
||||
case "col":
|
||||
|
||||
|
||||
case "frame":
|
||||
|
||||
|
||||
case "hr":
|
||||
|
||||
|
||||
case "img":
|
||||
|
||||
|
||||
case "br":
|
||||
|
||||
|
||||
case "input":
|
||||
|
||||
|
||||
case "isindex":
|
||||
|
||||
|
||||
case "link":
|
||||
|
||||
|
||||
case "meta":
|
||||
|
||||
|
||||
case "param":
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineSetter__("innerText",function(sText){
|
||||
|
||||
|
||||
var parsedText=document.createTextNode(sText);
|
||||
|
||||
|
||||
this.innerHTML=parsedText;
|
||||
|
||||
|
||||
return parsedText;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineGetter__("innerText",function(){
|
||||
|
||||
|
||||
var r=this.ownerDocument.createRange();
|
||||
|
||||
|
||||
r.selectNodeContents(this);
|
||||
|
||||
|
||||
return r.toString();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineSetter__("outerText",function(sText){
|
||||
|
||||
|
||||
var parsedText=document.createTextNode(sText);
|
||||
|
||||
|
||||
this.outerHTML=parsedText;
|
||||
|
||||
|
||||
return parsedText;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.__defineGetter__("outerText",function(){
|
||||
|
||||
|
||||
var r=this.ownerDocument.createRange();
|
||||
|
||||
|
||||
r.selectNodeContents(this);
|
||||
|
||||
|
||||
return r.toString();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
HTMLElement.prototype.attachEvent=function(sType,fHandler){
|
||||
|
||||
|
||||
var shortTypeName=sType.replace(/on/,"");
|
||||
|
||||
|
||||
fHandler._ieEmuEventHandler=function(e){
|
||||
|
||||
|
||||
window.event=e;
|
||||
|
||||
|
||||
return fHandler();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.addEventListener(shortTypeName,fHandler._ieEmuEventHandler,false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
HTMLElement.prototype.detachEvent=function(sType,fHandler){
|
||||
|
||||
|
||||
var shortTypeName=sType.replace(/on/,"");
|
||||
|
||||
|
||||
if(typeof(fHandler._ieEmuEventHandler)=="function")
|
||||
|
||||
|
||||
this.removeEventListener(shortTypeName,fHandler._ieEmuEventHandler,false);
|
||||
|
||||
|
||||
else
|
||||
|
||||
|
||||
this.removeEventListener(shortTypeName,fHandler,true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
HTMLElement.prototype.contains=function(Node){// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>ڵ<EFBFBD>
|
||||
|
||||
|
||||
do if(Node==this)return true;
|
||||
|
||||
|
||||
while(Node=Node.parentNode);
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode){
|
||||
|
||||
|
||||
switch(where){
|
||||
|
||||
|
||||
case "beforeBegin":
|
||||
|
||||
|
||||
this.parentNode.insertBefore(parsedNode,this);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case "afterBegin":
|
||||
|
||||
|
||||
this.insertBefore(parsedNode,this.firstChild);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case "beforeEnd":
|
||||
|
||||
|
||||
this.appendChild(parsedNode);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case "afterEnd":
|
||||
|
||||
|
||||
if(this.nextSibling)
|
||||
|
||||
|
||||
this.parentNode.insertBefore(parsedNode,this.nextSibling);
|
||||
|
||||
|
||||
else
|
||||
|
||||
|
||||
this.parentNode.appendChild(parsedNode);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
HTMLElement.prototype.insertAdjacentHTML=function(where,htmlStr){
|
||||
|
||||
|
||||
var r=this.ownerDocument.createRange();
|
||||
|
||||
|
||||
r.setStartBefore(this);
|
||||
|
||||
|
||||
var parsedHTML=r.createContextualFragment(htmlStr);
|
||||
|
||||
|
||||
this.insertAdjacentElement(where,parsedHTML);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
HTMLElement.prototype.insertAdjacentText=function(where,txtStr){
|
||||
|
||||
|
||||
var parsedText=document.createTextNode(txtStr);
|
||||
|
||||
|
||||
this.insertAdjacentElement(where,parsedText);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
HTMLElement.prototype.attachEvent=function(sType,fHandler){
|
||||
|
||||
|
||||
var shortTypeName=sType.replace(/on/,"");
|
||||
|
||||
|
||||
fHandler._ieEmuEventHandler=function(e){
|
||||
|
||||
|
||||
window.event=e;
|
||||
|
||||
|
||||
return fHandler();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.addEventListener(shortTypeName,fHandler._ieEmuEventHandler,false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
HTMLElement.prototype.detachEvent=function(sType,fHandler){
|
||||
|
||||
|
||||
var shortTypeName=sType.replace(/on/,"");
|
||||
|
||||
|
||||
if(typeof(fHandler._ieEmuEventHandler)=="function")
|
||||
|
||||
|
||||
this.removeEventListener(shortTypeName,fHandler._ieEmuEventHandler,false);
|
||||
|
||||
|
||||
else
|
||||
|
||||
|
||||
this.removeEventListener(shortTypeName,fHandler,true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-->
|
||||
|
||||
|
||||
</script>
|
||||
14
wxc2_omc/fault/networkStatus/dragTest/tes.php
Executable file
14
wxc2_omc/fault/networkStatus/dragTest/tes.php
Executable file
@@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<EFBFBD><EFBFBD><head>
|
||||
<EFBFBD><EFBFBD> <title>Untitled Page</title>
|
||||
<EFBFBD><EFBFBD> <script type="text/javascript" src="dragIE.js"></script>
|
||||
<EFBFBD><EFBFBD></head>
|
||||
<EFBFBD><EFBFBD><body>
|
||||
<EFBFBD><EFBFBD><div id="2222" style="position:absolute;left:100px;top:100px;background-color:White;border:solid black;">
|
||||
<EFBFBD><EFBFBD> <div style="background-color:Gray;border-bottom:solid black;padding:3px;font-family:Sans-Serif;font-weight:bold;" onmousedown="beginDrag(this.parentNode,event);">
|
||||
<EFBFBD><EFBFBD> <EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD> </div>
|
||||
<EFBFBD><EFBFBD> <div>
|
||||
<EFBFBD><EFBFBD> <p>This is a test.Testing,testing</p></div>
|
||||
<EFBFBD><EFBFBD></div>
|
||||
<EFBFBD><EFBFBD></body>
|
||||
Reference in New Issue
Block a user