+++ /dev/null
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-if(typeof YAHOO == "undefined"){\r
- throw "Unable to load Ext, core YUI utilities (yahoo, dom, event) not found.";\r
-}\r
-\r
-(function(){\r
-var E = YAHOO.util.Event;\r
-var D = YAHOO.util.Dom;\r
-var CN = YAHOO.util.Connect;\r
-\r
-var ES = YAHOO.util.Easing;\r
-var A = YAHOO.util.Anim;\r
-var libFlyweight;\r
-\r
-Ext.lib.Dom = {\r
- getViewWidth : function(full){\r
- return full ? D.getDocumentWidth() : D.getViewportWidth();\r
- },\r
-\r
- getViewHeight : function(full){\r
- return full ? D.getDocumentHeight() : D.getViewportHeight();\r
- },\r
-\r
- isAncestor : function(haystack, needle){\r
- return D.isAncestor(haystack, needle);\r
- },\r
-\r
- getRegion : function(el){\r
- return D.getRegion(el);\r
- },\r
-\r
- getY : function(el){\r
- return this.getXY(el)[1];\r
- },\r
-\r
- getX : function(el){\r
- return this.getXY(el)[0];\r
- },\r
-\r
- // original version based on YahooUI getXY\r
- // this version fixes several issues in Safari and FF\r
- // and boosts performance by removing the batch overhead, repetitive dom lookups and array index calls\r
- getXY : function(el){\r
- var p, pe, b, scroll, bd = (document.body || document.documentElement);\r
- el = Ext.getDom(el);\r
-\r
- if(el == bd){\r
- return [0, 0];\r
- }\r
-\r
- if (el.getBoundingClientRect) {\r
- b = el.getBoundingClientRect();\r
- scroll = fly(document).getScroll();\r
- return [b.left + scroll.left, b.top + scroll.top];\r
- }\r
- var x = 0, y = 0;\r
-\r
- p = el;\r
-\r
- var hasAbsolute = fly(el).getStyle("position") == "absolute";\r
-\r
- while (p) {\r
-\r
- x += p.offsetLeft;\r
- y += p.offsetTop;\r
-\r
- if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {\r
- hasAbsolute = true;\r
- }\r
-\r
- if (Ext.isGecko) {\r
- pe = fly(p);\r
-\r
- var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;\r
- var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;\r
-\r
-\r
- x += bl;\r
- y += bt;\r
-\r
-\r
- if (p != el && pe.getStyle('overflow') != 'visible') {\r
- x += bl;\r
- y += bt;\r
- }\r
- }\r
- p = p.offsetParent;\r
- }\r
-\r
- if (Ext.isSafari && hasAbsolute) {\r
- x -= bd.offsetLeft;\r
- y -= bd.offsetTop;\r
- }\r
-\r
- if (Ext.isGecko && !hasAbsolute) {\r
- var dbd = fly(bd);\r
- x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;\r
- y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;\r
- }\r
-\r
- p = el.parentNode;\r
- while (p && p != bd) {\r
- if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {\r
- x -= p.scrollLeft;\r
- y -= p.scrollTop;\r
- }\r
- p = p.parentNode;\r
- }\r
- return [x, y];\r
- },\r
-\r
- setXY : function(el, xy){\r
- el = Ext.fly(el, '_setXY');\r
- el.position();\r
- var pts = el.translatePoints(xy);\r
- if(xy[0] !== false){\r
- el.dom.style.left = pts.left + "px";\r
- }\r
- if(xy[1] !== false){\r
- el.dom.style.top = pts.top + "px";\r
- }\r
- },\r
-\r
- setX : function(el, x){\r
- this.setXY(el, [x, false]);\r
- },\r
-\r
- setY : function(el, y){\r
- this.setXY(el, [false, y]);\r
- }\r
-};\r
-\r
-Ext.lib.Event = {\r
- getPageX : function(e){\r
- return E.getPageX(e.browserEvent || e);\r
- },\r
-\r
- getPageY : function(e){\r
- return E.getPageY(e.browserEvent || e);\r
- },\r
-\r
- getXY : function(e){\r
- return E.getXY(e.browserEvent || e);\r
- },\r
-\r
- getTarget : function(e){\r
- return E.getTarget(e.browserEvent || e);\r
- },\r
-\r
- getRelatedTarget : function(e){\r
- return E.getRelatedTarget(e.browserEvent || e);\r
- },\r
-\r
- on : function(el, eventName, fn, scope, override){\r
- E.on(el, eventName, fn, scope, override);\r
- },\r
-\r
- un : function(el, eventName, fn){\r
- E.removeListener(el, eventName, fn);\r
- },\r
-\r
- purgeElement : function(el){\r
- E.purgeElement(el);\r
- },\r
-\r
- preventDefault : function(e){\r
- E.preventDefault(e.browserEvent || e);\r
- },\r
-\r
- stopPropagation : function(e){\r
- E.stopPropagation(e.browserEvent || e);\r
- },\r
-\r
- stopEvent : function(e){\r
- E.stopEvent(e.browserEvent || e);\r
- },\r
-\r
- onAvailable : function(el, fn, scope, override){\r
- return E.onAvailable(el, fn, scope, override);\r
- }\r
-};\r
-\r
-Ext.lib.Ajax = {\r
- request : function(method, uri, cb, data, options){\r
- if(options){\r
- var hs = options.headers;\r
- if(hs){\r
- for(var h in hs){\r
- if(hs.hasOwnProperty(h)){\r
- CN.initHeader(h, hs[h], false);\r
- }\r
- }\r
- }\r
- if(options.xmlData){\r
- if (!hs || !hs['Content-Type']){\r
- CN.initHeader('Content-Type', 'text/xml', false);\r
- }\r
- method = (method ? method : (options.method ? options.method : 'POST'));\r
- data = options.xmlData;\r
- }else if(options.jsonData){\r
- if (!hs || !hs['Content-Type']){\r
- CN.initHeader('Content-Type', 'application/json', false);\r
- }\r
- method = (method ? method : (options.method ? options.method : 'POST'));\r
- data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;\r
- }\r
- }\r
- return CN.asyncRequest(method, uri, cb, data);\r
- },\r
-\r
- formRequest : function(form, uri, cb, data, isUpload, sslUri){\r
- CN.setForm(form, isUpload, sslUri);\r
- return CN.asyncRequest(Ext.getDom(form).method ||'POST', uri, cb, data);\r
- },\r
-\r
- isCallInProgress : function(trans){\r
- return CN.isCallInProgress(trans);\r
- },\r
-\r
- abort : function(trans){\r
- return CN.abort(trans);\r
- },\r
-\r
- serializeForm : function(form){\r
- var d = CN.setForm(form.dom || form);\r
- CN.resetFormState();\r
- return d;\r
- }\r
-};\r
-\r
-Ext.lib.Region = YAHOO.util.Region;\r
-Ext.lib.Point = YAHOO.util.Point;\r
-\r
-\r
-Ext.lib.Anim = {\r
- scroll : function(el, args, duration, easing, cb, scope){\r
- this.run(el, args, duration, easing, cb, scope, YAHOO.util.Scroll);\r
- },\r
-\r
- motion : function(el, args, duration, easing, cb, scope){\r
- this.run(el, args, duration, easing, cb, scope, YAHOO.util.Motion);\r
- },\r
-\r
- color : function(el, args, duration, easing, cb, scope){\r
- this.run(el, args, duration, easing, cb, scope, YAHOO.util.ColorAnim);\r
- },\r
-\r
- run : function(el, args, duration, easing, cb, scope, type){\r
- type = type || YAHOO.util.Anim;\r
- if(typeof easing == "string"){\r
- easing = YAHOO.util.Easing[easing];\r
- }\r
- var anim = new type(el, args, duration, easing);\r
- anim.animateX(function(){\r
- Ext.callback(cb, scope);\r
- });\r
- return anim;\r
- }\r
-};\r
-\r
-// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights\r
-function fly(el){\r
- if(!libFlyweight){\r
- libFlyweight = new Ext.Element.Flyweight();\r
- }\r
- libFlyweight.dom = el;\r
- return libFlyweight;\r
-}\r
-\r
-// prevent IE leaks\r
-if(Ext.isIE) {\r
- function fnCleanUp() {\r
- var p = Function.prototype;\r
- delete p.createSequence;\r
- delete p.defer;\r
- delete p.createDelegate;\r
- delete p.createCallback;\r
- delete p.createInterceptor;\r
-\r
- window.detachEvent("onunload", fnCleanUp);\r
- }\r
- window.attachEvent("onunload", fnCleanUp);\r
-}\r
-// various overrides\r
-\r
-// add ability for callbacks with animations\r
-if(YAHOO.util.Anim){\r
- YAHOO.util.Anim.prototype.animateX = function(callback, scope){\r
- var f = function(){\r
- this.onComplete.unsubscribe(f);\r
- if(typeof callback == "function"){\r
- callback.call(scope || this, this);\r
- }\r
- };\r
- this.onComplete.subscribe(f, this, true);\r
- this.animate();\r
- };\r
-}\r
-\r
-if(YAHOO.util.DragDrop && Ext.dd.DragDrop){\r
- YAHOO.util.DragDrop.defaultPadding = Ext.dd.DragDrop.defaultPadding;\r
- YAHOO.util.DragDrop.constrainTo = Ext.dd.DragDrop.constrainTo;\r
-}\r
-\r
-YAHOO.util.Dom.getXY = function(el) {\r
- var f = function(el) {\r
- return Ext.lib.Dom.getXY(el);\r
- };\r
- return YAHOO.util.Dom.batch(el, f, YAHOO.util.Dom, true);\r
-};\r
-\r
-\r
-// workaround for Safari anim duration speed problems\r
-if(YAHOO.util.AnimMgr){\r
- YAHOO.util.AnimMgr.fps = 1000;\r
-}\r
-\r
-YAHOO.util.Region.prototype.adjust = function(t, l, b, r){\r
- this.top += t;\r
- this.left += l;\r
- this.right += r;\r
- this.bottom += b;\r
- return this;\r
-};\r
- \r
-YAHOO.util.Region.prototype.constrainTo = function(r) {\r
- this.top = this.top.constrain(r.top, r.bottom);\r
- this.bottom = this.bottom.constrain(r.top, r.bottom);\r
- this.left = this.left.constrain(r.left, r.right);\r
- this.right = this.right.constrain(r.left, r.right);\r
- return this;\r
-};\r
-\r
-\r
-})();
\ No newline at end of file