1var __aspxDragHelper = null; 2ASPxClientDragHelper = _aspxCreateClass(null, { 3 constructor: function(e, root, clone){ 4 if(__aspxDragHelper != null) __aspxDragHelper.cancelDrag(); 5 this.dragArea = 5; 6 this.clickX = _aspxGetEventX(e); 7 this.clickY = _aspxGetEventY(e); 8 this.centerClone = false; 9 this.cachedCloneWidth = -1; 10 this.cachedCloneHeight = -1; 11 this.cachedOriginalX = -1; 12 this.cachedOriginalY = -1; 13 this.canDrag = true; 14 if(typeof(root) == "string") 15 root = _aspxGetParentByTagName(_aspxGetEventSource(e), root); 16 this.obj = root && root != null ? root : _aspxGetEventSource(e); 17 this.clone = clone; 18 this.dragObj = null; 19 this.additionalObj = null; 20 this.onDoClick = null; 21 this.onEndDrag = null; 22 this.onCancelDrag = null; 23 this.onDragDivCreating = null; 24 this.onCloneCreating = null; 25 this.onCloneCreated = null; 26 this.dragDiv = null; 27 __aspxDragHelper = this; 28 this.clearSelectionOnce = false; 29 }, 30 drag: function(e) { 31 if(!this.canDrag) return; 32 if(!this.isDragging()) { 33 if(!this.isOutOfDragArea(e)) 34 return; 35 this.startDragCore(e); 36 } 37 if(__aspxIE && !_aspxGetIsLeftButtonPressed(e)) { 38 this.cancelDrag(e); 39 return; 40 } 41 _aspxClearSelection(); 42 if(!__aspxIE) 43 _aspxSetElementSelectionEnabled(document.body, false); 44 this.dragCore(e); 45 }, 46 startDragCore: function(e) { 47 this.dragObj = this.clone != true ? this.obj : this.createClone(e); 48 }, 49 dragCore: function(e) { 50 this.updateDragDivPosition(e); 51 }, 52 endDrag: function(e) { 53 if(!this.isDragging() && !this.isOutOfDragArea(e)) { 54 if(this.onDoClick) 55 this.onDoClick(this); 56 } else { 57 if(this.onEndDrag) 58 this.onEndDrag(this); 59 } 60 this.cancelDrag(); 61 }, 62 cancelDrag: function() { 63 if(this.dragDiv != null) { 64 document.body.removeChild(this.dragDiv); 65 this.dragDiv = null; 66 } 67 if(this.onCancelDrag) 68 this.onCancelDrag(this); 69 __aspxDragHelper = null; 70 if(!__aspxIE) 71 _aspxSetElementSelectionEnabled(document.body, true); 72 }, 73 isDragging: function() { 74 return this.dragObj != null; 75 }, 76 updateDragDivPosition: function(e) { 77 if(this.centerClone) { 78 this.dragDiv.style.left = _aspxGetEventX(e) - this.cachedCloneWidth / 2 + "px"; 79 this.dragDiv.style.top = _aspxGetEventY(e) - this.cachedCloneHeight / 2 + "px"; 80 } else { 81 this.dragDiv.style.left = this.cachedOriginalX + _aspxGetEventX(e) - this.clickX + "px"; 82 this.dragDiv.style.top = this.cachedOriginalY + _aspxGetEventY(e) - this.clickY + "px"; 83 } 84 }, 85 createClone: function(e) { 86 this.dragDiv = document.createElement("div"); 87 if(this.onDragDivCreating) 88 this.onDragDivCreating(this, this.dragDiv); 89 var clone = this.creatingClone(); 90 this.dragDiv.appendChild(clone); 91 document.body.appendChild(this.dragDiv); 92 this.dragDiv.style.position = "absolute"; 93 this.dragDiv.style.cursor = "move"; 94 this.dragDiv.style.borderStyle = "none"; 95 this.dragDiv.style.padding = "0"; 96 this.dragDiv.style.margin = "0"; 97 this.dragDiv.style.backgroundColor = "transparent"; 98 this.dragDiv.style.zIndex = 20000; 99 if(this.onCloneCreated) 100 this.onCloneCreated(clone); 101 this.cachedCloneWidth = clone.offsetWidth; 102 this.cachedCloneHeight = clone.offsetHeight; 103 if(!this.centerClone) { 104 this.cachedOriginalX = _aspxGetAbsoluteX(this.obj); 105 this.cachedOriginalY = _aspxGetAbsoluteY(this.obj); 106 } 107 this.dragDiv.style.width = this.cachedCloneWidth + "px"; 108 this.dragDiv.style.height = this.cachedCloneHeight + "px"; 109 this.updateDragDivPosition(e); 110 return this.dragDiv; 111 }, 112 creatingClone: function() { 113 var clone = this.obj.cloneNode(true); 114 if(!this.onCloneCreating) return clone; 115 return this.onCloneCreating(clone); 116 }, 117 addElementToDragDiv: function(element) { 118 if(this.dragDiv == null) return; 119 this.additionalObj = element.cloneNode(true); 120 this.additionalObj.style.visibility = "visible"; 121 this.additionalObj.style.display = ""; 122 this.additionalObj.style.top = ""; 123 this.dragDiv.appendChild(this.additionalObj); 124 }, 125 removeElementFromDragDiv: function() { 126 if(this.additionalObj == null || this.dragDiv == null) return; 127 this.dragDiv.removeChild(this.additionalObj); 128 this.additionalObj = null; 129 }, 130 isOutOfDragArea: function(e) { 131 return Math.max( 132 Math.abs(_aspxGetEventX(e) - this.clickX), 133 Math.abs(_aspxGetEventY(e) - this.clickY) 134 ) >= this.dragArea; 135 } 136}); 137function DragHelper_onmouseup(e) { 138 if(__aspxDragHelper != null) { 139 __aspxDragHelper.endDrag(e); 140 return true; 141 } 142} 143function DragHelper_onmousemove(e) { 144 if(__aspxDragHelper != null && !(__aspxTouchUI && ASPxClientTouchUI.isGesture)) { 145 __aspxDragHelper.drag(e); 146 if(ASPxClientTouchUI.isTouchEvent(e)) { 147 e.preventDefault(); 148 ASPxClientTouchUI.preventScrollOnEvent(e); 149 } 150 return true; 151 } 152} 153function DragHelper_onkeydown(e) { 154 if(!__aspxDragHelper) return; 155 if(e.keyCode == ASPxKey.Esc) 156 __aspxDragHelper.cancelDrag(); 157 return true; 158} 159function DragHelper_onkeyup(e) { 160 if (!__aspxDragHelper) return; 161 if(e.keyCode == ASPxKey.Esc && __aspxWebKitFamily) 162 __aspxDragHelper.cancelDrag(); 163 return true; 164} 165function DragHelper_onselectstart(e) { 166 var drag = __aspxDragHelper; 167 if(drag && (drag.canDrag || drag.clearSelectionOnce)) { 168 _aspxClearSelection(); 169 drag.clearSelectionOnce = false; 170 return false; 171 } 172} 173_aspxAttachEventToDocument(ASPxClientTouchUI.touchMouseUpEventName, DragHelper_onmouseup); 174_aspxAttachEventToDocument(ASPxClientTouchUI.touchMouseMoveEventName, DragHelper_onmousemove); 175_aspxAttachEventToDocument("keydown", DragHelper_onkeydown); 176_aspxAttachEventToDocument("keyup", DragHelper_onkeyup); 177_aspxAttachEventToDocument("selectstart", DragHelper_onselectstart); 178var __aspxCursorTargets = null; 179ASPxClientCursorTargets = _aspxCreateClass(null, { 180 constructor: function() { 181 this.list = []; 182 this.starttargetElement = null; 183 this.starttargetTag = 0; 184 this.oldtargetElement = null; 185 this.oldtargetTag = 0; 186 this.targetElement = null; 187 this.targetTag = 0; 188 this.x = 0; 189 this.y = 0; 190 this.removedX = 0; 191 this.removedY = 0; 192 this.removedWidth = 0; 193 this.removedHeight = 0; 194 this.onTargetCreated = null; 195 this.onTargetChanging = null; 196 this.onTargetChanged = null; 197 this.onTargetAdding = null; 198 this.onTargetAllowed = null; 199 __aspxCursorTargets = this; 200 }, 201 addElement: function(element) { 202 if(!this.canAddElement(element)) return null; 203 var target = new ASPxClientCursorTarget(element); 204 this.onTargetCreated && this.onTargetCreated(this, target); 205 this.list.push(target); 206 return target; 207 }, 208 removeElement: function(element) { 209 for(var i = 0; i < this.list.length; i++) { 210 if(this.list[i].element == element) { 211 this.list.splice(i, 1); 212 return; 213 } 214 } 215 }, 216 addParentElement: function(parent, child) { 217 var target = this.addElement(parent); 218 if(target != null) { 219 target.targetElement = child; 220 } 221 return target; 222 }, 223 RegisterTargets: function(element, idPrefixArray) { 224 this.addFunc = this.addElement; 225 this.RegisterTargetsCore(element, idPrefixArray);
226 }, 227 UnregisterTargets: function(element, idPrefixArray) { 228 this.addFunc = this.removeElement; 229 this.RegisterTargetsCore(element, idPrefixArray); 230 }, 231 RegisterTargetsCore: function(element, idPrefixArray) { 232 if(element == null) return; 233 for(var i = 0; i < idPrefixArray.length; i++) 234 this.RegisterTargetCore(element, idPrefixArray[i]); 235 }, 236 RegisterTargetCore: function(element, idPrefix) { 237 if(!_aspxIsExists(element.id)) return; 238 if(element.id.indexOf(idPrefix) > -1) 239 this.addFunc(element); 240 for(var i = 0; i < element.childNodes.length; i++) 241 this.RegisterTargetCore(element.childNodes[i], idPrefix); 242 }, 243 canAddElement: function(element) { 244 if(element == null || !_aspxGetElementDisplay(element)) 245 return false; 246 for(var i = 0; i < this.list.length; i++) { 247 if(this.list[i].targetElement == element) return false; 248 } 249 if(this.onTargetAdding != null && !this.onTargetAdding(this, element)) return false; 250 return element.style.visibility != "hidden"; 251 }, 252 removeInitialTarget: function(x, y) { 253 var el = this.getTarget(x + _aspxGetDocumentScrollLeft(), y + _aspxGetDocumentScrollTop()); 254 if(el == null) return; 255 this.removedX = _aspxGetAbsoluteX(el); 256 this.removedY = _aspxGetAbsoluteY(el); 257 this.removedWidth = el.offsetWidth; 258 this.removedHeight = el.offsetHeight; 259 }, 260 getTarget: function(x, y) { 261 for(var i = 0; i < this.list.length; i++) { 262 var record = this.list[i]; 263 if(record.contains(x, y)) { 264 if(!this.onTargetAllowed || this.onTargetAllowed(record.targetElement, x, y)) 265 return record.targetElement; 266 } 267 } 268 return null; 269 }, 270 targetChanged: function(element, tag) { 271 this.targetElement = element; 272 this.targetTag = tag; 273 if(this.onTargetChanging) 274 this.onTargetChanging(this); 275 if(this.oldtargetElement != this.targetElement || this.oldtargetTag != this.targetTag) { 276 if(this.onTargetChanged) 277 this.onTargetChanged(this); 278 this.oldtargetElement = this.targetElement; 279 this.oldtargetTag = this.targetTag; 280 } 281 }, 282 cancelChanging: function() { 283 this.targetElement = this.oldtargetElement; 284 this.targetTag = this.oldtargetTag; 285 }, 286 isLeftPartOfElement: function() { 287 if(this.targetElement == null) return true; 288 var left = this.x - this.targetElementX(); 289 return left < this.targetElement.offsetWidth / 2; 290 }, 291 isTopPartOfElement: function() { 292 if(this.targetElement == null) return true; 293 var top = this.y - this.targetElementY(); 294 return top < this.targetElement.offsetHeight / 2; 295 }, 296 targetElementX: function() { 297 return this.targetElement != null ? _aspxGetAbsoluteX(this.targetElement) : 0; 298 }, 299 targetElementY: function() { 300 return this.targetElement != null ? _aspxGetAbsoluteY(this.targetElement) : 0; 301 }, 302 onmousemove: function(e) { 303 this.doTargetChanged(e); 304 }, 305 onmouseup: function(e) { 306 this.doTargetChanged(e); 307 __aspxCursorTargets = null; 308 }, 309 doTargetChanged: function(e) { 310 this.x = _aspxGetEventX(e); 311 this.y = _aspxGetEventY(e); 312 if(this.inRemovedBounds(this.x, this.y)) return; 313 this.targetChanged(this.getTarget(this.x, this.y), 0); 314 }, 315 inRemovedBounds: function(x, y) { 316 if(this.removedWidth == 0) return false; 317 return x > this.removedX && x < (this.removedX + this.removedWidth) && 318 y > this.removedY && y < (this.removedY + this.removedHeight); 319 } 320}); 321ASPxClientCursorTarget = _aspxCreateClass(null, { 322 constructor: function(element) { 323 this.element = element; 324 this.targetElement = element; 325 this.absoluteX = _aspxGetAbsoluteX(element); 326 this.absoluteY = _aspxGetAbsoluteY(element); 327 }, 328 contains: function(x, y) { 329 return x >= this.absoluteX && x <= this.absoluteX + this.GetElementWidth() && 330 y >= this.absoluteY && y <= this.absoluteY + this.GetElementHeight(); 331 }, 332 GetElementWidth: function() { 333 return this.element.offsetWidth; 334 }, 335 GetElementHeight: function() { 336 return this.element.offsetHeight; 337 } 338}); 339function CursorTarget_onmouseup(e) { 340 if(__aspxCursorTargets != null) { 341 __aspxCursorTargets.onmouseup(e); 342 return true; 343 } 344}
345function CursorTarget_onmousemove(e) { 346 if(__aspxCursorTargets != null) { 347 __aspxCursorTargets.onmousemove(e); 348 return true; 349 } 350} 351_aspxAttachEventToDocument(ASPxClientTouchUI.touchMouseUpEventName, CursorTarget_onmouseup); 352_aspxAttachEventToDocument(ASPxClientTouchUI.touchMouseMoveEventName, CursorTarget_onmousemove); 353
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.