upgraded yui to 2.2.2 and yui-ext to 1.0.1a
This commit is contained in:
parent
4d9af2c691
commit
547ced6500
1992 changed files with 645731 additions and 0 deletions
398
www/extras/yui-ext/source/adapter/jquery-bridge.js
vendored
Normal file
398
www/extras/yui-ext/source/adapter/jquery-bridge.js
vendored
Normal file
|
|
@ -0,0 +1,398 @@
|
|||
/*
|
||||
* Ext JS Library 1.0.1
|
||||
* Copyright(c) 2006-2007, Ext JS, LLC.
|
||||
* licensing@extjs.com
|
||||
*
|
||||
* http://www.extjs.com/license
|
||||
*/
|
||||
|
||||
if(typeof jQuery == "undefined"){
|
||||
throw "Unable to load Ext, jQuery not found.";
|
||||
}
|
||||
|
||||
(function(){
|
||||
|
||||
Ext.lib.Dom = {
|
||||
getViewWidth : function(full){
|
||||
// jQuery doesn't report full window size on document query, so max both
|
||||
return full ? Math.max(jQuery(document).width(),jQuery(window).width()) : jQuery(window).width();
|
||||
},
|
||||
|
||||
getViewHeight : function(full){
|
||||
// jQuery doesn't report full window size on document query, so max both
|
||||
return full ? Math.max(jQuery(document).height(),jQuery(window).height()) : jQuery(window).height();
|
||||
},
|
||||
|
||||
isAncestor : function(p, c){
|
||||
p = Ext.getDom(p);
|
||||
c = Ext.getDom(c);
|
||||
if (!p || !c) {return false;}
|
||||
|
||||
if(p.contains && !Ext.isSafari) {
|
||||
return p.contains(c);
|
||||
}else if(p.compareDocumentPosition) {
|
||||
return !!(p.compareDocumentPosition(c) & 16);
|
||||
}else{
|
||||
var parent = c.parentNode;
|
||||
while (parent) {
|
||||
if (parent == p) {
|
||||
return true;
|
||||
}
|
||||
else if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {
|
||||
return false;
|
||||
}
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
getRegion : function(el){
|
||||
return Ext.lib.Region.getRegion(el);
|
||||
},
|
||||
|
||||
getY : function(el){
|
||||
return jQuery(el).offset({scroll:false}).top;
|
||||
},
|
||||
|
||||
getX : function(el){
|
||||
return jQuery(el).offset({scroll:false}).left;
|
||||
},
|
||||
|
||||
getXY : function(el){
|
||||
var o = jQuery(el).offset({scroll:false});
|
||||
return [o.left, o.top];
|
||||
},
|
||||
|
||||
setXY : function(el, xy){
|
||||
el = Ext.fly(el, '_setXY');
|
||||
el.position();
|
||||
var pts = el.translatePoints(xy);
|
||||
if(xy[0] !== false){
|
||||
el.dom.style.left = pts.left + "px";
|
||||
}
|
||||
if(xy[1] !== false){
|
||||
el.dom.style.top = pts.top + "px";
|
||||
}
|
||||
},
|
||||
|
||||
setX : function(el, x){
|
||||
this.setXY(el, [x, false]);
|
||||
},
|
||||
|
||||
setY : function(el, y){
|
||||
this.setXY(el, [false, y]);
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Event = {
|
||||
getPageX : function(e){
|
||||
e = e.browserEvent || e;
|
||||
return e.pageX;
|
||||
},
|
||||
|
||||
getPageY : function(e){
|
||||
e = e.browserEvent || e;
|
||||
return e.pageY;
|
||||
},
|
||||
|
||||
getXY : function(e){
|
||||
e = e.browserEvent || e;
|
||||
return [e.pageX, e.pageY];
|
||||
},
|
||||
|
||||
getTarget : function(e){
|
||||
return e.target;
|
||||
},
|
||||
|
||||
// all Ext events will go through event manager which provides scoping
|
||||
on : function(el, eventName, fn, scope, override){
|
||||
jQuery(el).bind(eventName, fn);
|
||||
},
|
||||
|
||||
un : function(el, eventName, fn){
|
||||
jQuery(el).unbind(eventName, fn);
|
||||
},
|
||||
|
||||
purgeElement : function(el){
|
||||
jQuery(el).unbind();
|
||||
},
|
||||
|
||||
preventDefault : function(e){
|
||||
e = e.browserEvent || e;
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
stopPropagation : function(e){
|
||||
e = e.browserEvent || e;
|
||||
e.stopPropagation();
|
||||
},
|
||||
|
||||
stopEvent : function(e){
|
||||
e = e.browserEvent || e;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
},
|
||||
|
||||
onAvailable : function(id, fn, scope){
|
||||
var start = new Date();
|
||||
var f = function(){
|
||||
if(start.getElapsed() > 10000){
|
||||
clearInterval(iid);
|
||||
}
|
||||
var el = document.getElementById(id);
|
||||
if(el){
|
||||
clearInterval(iid);
|
||||
fn.call(scope||window, el);
|
||||
}
|
||||
};
|
||||
var iid = setInterval(f, 50);
|
||||
},
|
||||
|
||||
resolveTextNode: function(node) {
|
||||
if (node && 3 == node.nodeType) {
|
||||
return node.parentNode;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
},
|
||||
|
||||
getRelatedTarget: function(ev) {
|
||||
ev = ev.browserEvent || ev;
|
||||
var t = ev.relatedTarget;
|
||||
if (!t) {
|
||||
if (ev.type == "mouseout") {
|
||||
t = ev.toElement;
|
||||
} else if (ev.type == "mouseover") {
|
||||
t = ev.fromElement;
|
||||
}
|
||||
}
|
||||
|
||||
return this.resolveTextNode(t);
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Ajax = function(){
|
||||
var createComplete = function(cb){
|
||||
return function(xhr, status){
|
||||
if((status == 'error' || status == 'timeout') && cb.failure){
|
||||
cb.failure.call(cb.scope||window, {
|
||||
responseText: xhr.responseText,
|
||||
responseXML : xhr.responseXML,
|
||||
argument: cb.argument
|
||||
});
|
||||
}else if(cb.success){
|
||||
cb.success.call(cb.scope||window, {
|
||||
responseText: xhr.responseText,
|
||||
responseXML : xhr.responseXML,
|
||||
argument: cb.argument
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
return {
|
||||
request : function(method, uri, cb, data){
|
||||
jQuery.ajax({
|
||||
type: method,
|
||||
url: uri,
|
||||
data: data,
|
||||
timeout: cb.timeout,
|
||||
complete: createComplete(cb)
|
||||
});
|
||||
},
|
||||
|
||||
formRequest : function(form, uri, cb, data, isUpload, sslUri){
|
||||
jQuery.ajax({
|
||||
type: Ext.getDom(form).method ||'POST',
|
||||
url: uri,
|
||||
data: jQuery(form).formSerialize()+(data?'&'+data:''),
|
||||
timeout: cb.timeout,
|
||||
complete: createComplete(cb)
|
||||
});
|
||||
},
|
||||
|
||||
isCallInProgress : function(trans){
|
||||
return false;
|
||||
},
|
||||
|
||||
abort : function(trans){
|
||||
return false;
|
||||
},
|
||||
|
||||
serializeForm : function(form){
|
||||
return jQuery(form.dom||form).formSerialize();
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
Ext.lib.Anim = function(){
|
||||
var createAnim = function(cb, scope){
|
||||
var animated = true;
|
||||
return {
|
||||
stop : function(skipToLast){
|
||||
// do nothing
|
||||
},
|
||||
|
||||
isAnimated : function(){
|
||||
return animated;
|
||||
},
|
||||
|
||||
proxyCallback : function(){
|
||||
animated = false;
|
||||
Ext.callback(cb, scope);
|
||||
}
|
||||
};
|
||||
};
|
||||
return {
|
||||
scroll : function(el, args, duration, easing, cb, scope){
|
||||
// scroll anim not supported so just scroll immediately
|
||||
var anim = createAnim(cb, scope);
|
||||
el = Ext.getDom(el);
|
||||
el.scrollLeft = args.scroll.to[0];
|
||||
el.scrollTop = args.scroll.to[1];
|
||||
anim.proxyCallback();
|
||||
return anim;
|
||||
},
|
||||
|
||||
motion : function(el, args, duration, easing, cb, scope){
|
||||
return this.run(el, args, duration, easing, cb, scope);
|
||||
},
|
||||
|
||||
color : function(el, args, duration, easing, cb, scope){
|
||||
// color anim not supported, so execute callback immediately
|
||||
var anim = createAnim(cb, scope);
|
||||
anim.proxyCallback();
|
||||
return anim;
|
||||
},
|
||||
|
||||
run : function(el, args, duration, easing, cb, scope, type){
|
||||
var anim = createAnim(cb, scope);
|
||||
var o = {};
|
||||
for(var k in args){
|
||||
switch(k){ // jquery doesn't support, so convert
|
||||
case 'points':
|
||||
var by, pts, e = Ext.fly(el, '_animrun');
|
||||
e.position();
|
||||
if(by = args.points.by){
|
||||
var xy = e.getXY();
|
||||
pts = e.translatePoints([xy[0]+by[0], xy[1]+by[1]]);
|
||||
}else{
|
||||
pts = e.translatePoints(args.points.to);
|
||||
}
|
||||
o.left = pts.left;
|
||||
o.top = pts.top;
|
||||
if(!parseInt(e.getStyle('left'), 10)){ // auto bug
|
||||
e.setLeft(0);
|
||||
}
|
||||
if(!parseInt(e.getStyle('top'), 10)){
|
||||
e.setTop(0);
|
||||
}
|
||||
break;
|
||||
case 'width':
|
||||
o.width = args.width.to;
|
||||
break;
|
||||
case 'height':
|
||||
o.height = args.height.to;
|
||||
break;
|
||||
case 'opacity':
|
||||
o.opacity = args.opacity.to;
|
||||
break;
|
||||
default:
|
||||
o[k] = args[k].to;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// TODO: find out about easing plug in?
|
||||
jQuery(el).animate(o, duration*1000, undefined, anim.proxyCallback);
|
||||
return anim;
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
|
||||
Ext.lib.Region = function(t, r, b, l) {
|
||||
this.top = t;
|
||||
this[1] = t;
|
||||
this.right = r;
|
||||
this.bottom = b;
|
||||
this.left = l;
|
||||
this[0] = l;
|
||||
};
|
||||
|
||||
Ext.lib.Region.prototype = {
|
||||
contains : function(region) {
|
||||
return ( region.left >= this.left &&
|
||||
region.right <= this.right &&
|
||||
region.top >= this.top &&
|
||||
region.bottom <= this.bottom );
|
||||
|
||||
},
|
||||
|
||||
getArea : function() {
|
||||
return ( (this.bottom - this.top) * (this.right - this.left) );
|
||||
},
|
||||
|
||||
intersect : function(region) {
|
||||
var t = Math.max( this.top, region.top );
|
||||
var r = Math.min( this.right, region.right );
|
||||
var b = Math.min( this.bottom, region.bottom );
|
||||
var l = Math.max( this.left, region.left );
|
||||
|
||||
if (b >= t && r >= l) {
|
||||
return new Ext.lib.Region(t, r, b, l);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
union : function(region) {
|
||||
var t = Math.min( this.top, region.top );
|
||||
var r = Math.max( this.right, region.right );
|
||||
var b = Math.max( this.bottom, region.bottom );
|
||||
var l = Math.min( this.left, region.left );
|
||||
|
||||
return new Ext.lib.Region(t, r, b, l);
|
||||
},
|
||||
|
||||
adjust : function(t, l, b, r){
|
||||
this.top += t;
|
||||
this.left += l;
|
||||
this.right += r;
|
||||
this.bottom += b;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Region.getRegion = function(el) {
|
||||
var p = Ext.lib.Dom.getXY(el);
|
||||
|
||||
var t = p[1];
|
||||
var r = p[0] + el.offsetWidth;
|
||||
var b = p[1] + el.offsetHeight;
|
||||
var l = p[0];
|
||||
|
||||
return new Ext.lib.Region(t, r, b, l);
|
||||
};
|
||||
|
||||
Ext.lib.Point = function(x, y) {
|
||||
if (x instanceof Array) {
|
||||
y = x[1];
|
||||
x = x[0];
|
||||
}
|
||||
this.x = this.right = this.left = this[0] = x;
|
||||
this.y = this.top = this.bottom = this[1] = y;
|
||||
};
|
||||
|
||||
Ext.lib.Point.prototype = new Ext.lib.Region();
|
||||
|
||||
// prevent IE leaks
|
||||
if(Ext.isIE){
|
||||
jQuery(window).unload(function(){
|
||||
var p = Function.prototype;
|
||||
delete p.createSequence;
|
||||
delete p.defer;
|
||||
delete p.createDelegate;
|
||||
delete p.createCallback;
|
||||
delete p.createInterceptor;
|
||||
});
|
||||
}
|
||||
})();
|
||||
506
www/extras/yui-ext/source/adapter/prototype-bridge.js
vendored
Normal file
506
www/extras/yui-ext/source/adapter/prototype-bridge.js
vendored
Normal file
|
|
@ -0,0 +1,506 @@
|
|||
/*
|
||||
* Ext JS Library 1.0.1
|
||||
* Copyright(c) 2006-2007, Ext JS, LLC.
|
||||
* licensing@extjs.com
|
||||
*
|
||||
* http://www.extjs.com/license
|
||||
*/
|
||||
|
||||
(function(){
|
||||
|
||||
var libFlyweight;
|
||||
|
||||
Ext.lib.Dom = {
|
||||
getViewWidth : function(full){
|
||||
return full ? this.getDocumentWidth() : this.getViewportWidth();
|
||||
},
|
||||
|
||||
getViewHeight : function(full){
|
||||
return full ? this.getDocumentHeight() : this.getViewportHeight();
|
||||
},
|
||||
|
||||
getDocumentHeight: function() { // missing from prototype?
|
||||
var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight;
|
||||
return Math.max(scrollHeight, this.getViewportHeight());
|
||||
},
|
||||
|
||||
getDocumentWidth: function() { // missing from prototype?
|
||||
var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth;
|
||||
return Math.max(scrollWidth, this.getViewportWidth());
|
||||
},
|
||||
|
||||
getViewportHeight: function() { // missing from prototype?
|
||||
var height = self.innerHeight;
|
||||
var mode = document.compatMode;
|
||||
|
||||
if ( (mode || Ext.isIE) && !Ext.isOpera ) {
|
||||
height = (mode == "CSS1Compat") ?
|
||||
document.documentElement.clientHeight : // Standards
|
||||
document.body.clientHeight; // Quirks
|
||||
}
|
||||
|
||||
return height;
|
||||
},
|
||||
|
||||
getViewportWidth: function() { // missing from prototype?
|
||||
var width = self.innerWidth; // Safari
|
||||
var mode = document.compatMode;
|
||||
|
||||
if (mode || Ext.isIE) { // IE, Gecko, Opera
|
||||
width = (mode == "CSS1Compat") ?
|
||||
document.documentElement.clientWidth : // Standards
|
||||
document.body.clientWidth; // Quirks
|
||||
}
|
||||
return width;
|
||||
},
|
||||
|
||||
isAncestor : function(p, c){ // missing from prototype?
|
||||
p = Ext.getDom(p);
|
||||
c = Ext.getDom(c);
|
||||
if (!p || !c) {return false;}
|
||||
|
||||
if(p.contains && !Ext.isSafari) {
|
||||
return p.contains(c);
|
||||
}else if(p.compareDocumentPosition) {
|
||||
return !!(p.compareDocumentPosition(c) & 16);
|
||||
}else{
|
||||
var parent = c.parentNode;
|
||||
while (parent) {
|
||||
if (parent == p) {
|
||||
return true;
|
||||
}
|
||||
else if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {
|
||||
return false;
|
||||
}
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
getRegion : function(el){
|
||||
return Ext.lib.Region.getRegion(el);
|
||||
},
|
||||
|
||||
getY : function(el){
|
||||
return this.getXY(el)[1];
|
||||
},
|
||||
|
||||
getX : function(el){
|
||||
return this.getXY(el)[0];
|
||||
},
|
||||
|
||||
getXY : function(el){ // this initially used Position.cumulativeOffset but it is not accurate enough
|
||||
var p, pe, b, scroll, bd = document.body;
|
||||
el = Ext.getDom(el);
|
||||
|
||||
if(el.getBoundingClientRect){ // IE
|
||||
b = el.getBoundingClientRect();
|
||||
scroll = fly(document).getScroll();
|
||||
return [b.left + scroll.left, b.top + scroll.top];
|
||||
} else{
|
||||
var x = el.offsetLeft, y = el.offsetTop;
|
||||
p = el.offsetParent;
|
||||
|
||||
// ** flag if a parent is positioned for Safari
|
||||
var hasAbsolute = false;
|
||||
|
||||
if(p != el){
|
||||
while(p){
|
||||
x += p.offsetLeft;
|
||||
y += p.offsetTop;
|
||||
|
||||
// ** flag Safari abs position bug - only check if needed
|
||||
if(Ext.isSafari && !hasAbsolute && fly(p).getStyle("position") == "absolute"){
|
||||
hasAbsolute = true;
|
||||
}
|
||||
|
||||
// ** Fix gecko borders measurements
|
||||
// Credit jQuery dimensions plugin for the workaround
|
||||
if(Ext.isGecko){
|
||||
pe = fly(p);
|
||||
var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
|
||||
var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
|
||||
|
||||
// add borders to offset
|
||||
x += bl;
|
||||
y += bt;
|
||||
|
||||
// Mozilla removes the border if the parent has overflow property other than visible
|
||||
if(p != el && pe.getStyle('overflow') != 'visible'){
|
||||
x += bl;
|
||||
y += bt;
|
||||
}
|
||||
}
|
||||
p = p.offsetParent;
|
||||
}
|
||||
}
|
||||
// ** safari doubles in some cases, use flag from offsetParent's as well
|
||||
if(Ext.isSafari && (hasAbsolute || fly(el).getStyle("position") == "absolute")){
|
||||
x -= bd.offsetLeft;
|
||||
y -= bd.offsetTop;
|
||||
}
|
||||
}
|
||||
|
||||
p = el.parentNode;
|
||||
|
||||
while(p && p != bd){
|
||||
// ** opera TR has bad scroll values, so filter them jvs
|
||||
if(!Ext.isOpera || (Ext.isOpera && p.tagName != 'TR' && fly(p).getStyle("display") != "inline")){
|
||||
x -= p.scrollLeft;
|
||||
y -= p.scrollTop;
|
||||
}
|
||||
p = p.parentNode;
|
||||
}
|
||||
return [x, y];
|
||||
},
|
||||
|
||||
setXY : function(el, xy){ // this initially used Position.cumulativeOffset but it is not accurate enough
|
||||
el = Ext.fly(el, '_setXY');
|
||||
el.position();
|
||||
var pts = el.translatePoints(xy);
|
||||
if(xy[0] !== false){
|
||||
el.dom.style.left = pts.left + "px";
|
||||
}
|
||||
if(xy[1] !== false){
|
||||
el.dom.style.top = pts.top + "px";
|
||||
}
|
||||
},
|
||||
|
||||
setX : function(el, x){
|
||||
this.setXY(el, [x, false]);
|
||||
},
|
||||
|
||||
setY : function(el, y){
|
||||
this.setXY(el, [false, y]);
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Event = {
|
||||
getPageX : function(e){
|
||||
return Event.pointerX(e.browserEvent || e);
|
||||
},
|
||||
|
||||
getPageY : function(e){
|
||||
return Event.pointerY(e.browserEvent || e);
|
||||
},
|
||||
|
||||
getXY : function(e){
|
||||
e = e.browserEvent || e;
|
||||
return [Event.pointerX(e), Event.pointerY(e)];
|
||||
},
|
||||
|
||||
getTarget : function(e){
|
||||
return Event.element(e.browserEvent || e);
|
||||
},
|
||||
|
||||
resolveTextNode: function(node) {
|
||||
if (node && 3 == node.nodeType) {
|
||||
return node.parentNode;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
},
|
||||
|
||||
getRelatedTarget: function(ev) { // missing from prototype?
|
||||
ev = ev.browserEvent || ev;
|
||||
var t = ev.relatedTarget;
|
||||
if (!t) {
|
||||
if (ev.type == "mouseout") {
|
||||
t = ev.toElement;
|
||||
} else if (ev.type == "mouseover") {
|
||||
t = ev.fromElement;
|
||||
}
|
||||
}
|
||||
|
||||
return this.resolveTextNode(t);
|
||||
},
|
||||
|
||||
on : function(el, eventName, fn){
|
||||
Event.observe(el, eventName, fn, false);
|
||||
},
|
||||
|
||||
un : function(el, eventName, fn){
|
||||
Event.stopObserving(el, eventName, fn, false);
|
||||
},
|
||||
|
||||
purgeElement : function(el){
|
||||
// no equiv?
|
||||
},
|
||||
|
||||
preventDefault : function(e){ // missing from prototype?
|
||||
e = e.browserEvent || e;
|
||||
if(e.preventDefault) {
|
||||
e.preventDefault();
|
||||
} else {
|
||||
e.returnValue = false;
|
||||
}
|
||||
},
|
||||
|
||||
stopPropagation : function(e){ // missing from prototype?
|
||||
e = e.browserEvent || e;
|
||||
if(e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
} else {
|
||||
e.cancelBubble = true;
|
||||
}
|
||||
},
|
||||
|
||||
stopEvent : function(e){
|
||||
Event.stop(e.browserEvent || e);
|
||||
},
|
||||
|
||||
onAvailable : function(el, fn, scope, override){ // no equiv
|
||||
var start = new Date(), iid;
|
||||
var f = function(){
|
||||
if(start.getElapsed() > 10000){
|
||||
clearInterval(iid);
|
||||
}
|
||||
var el = document.getElementById(id);
|
||||
if(el){
|
||||
clearInterval(iid);
|
||||
fn.call(scope||window, el);
|
||||
}
|
||||
};
|
||||
iid = setInterval(f, 50);
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Ajax = function(){
|
||||
var createSuccess = function(cb){
|
||||
return cb.success ? function(xhr){
|
||||
cb.success.call(cb.scope||window, {
|
||||
responseText: xhr.responseText,
|
||||
responseXML : xhr.responseXML,
|
||||
argument: cb.argument
|
||||
});
|
||||
} : Ext.emptyFn;
|
||||
};
|
||||
var createFailure = function(cb){
|
||||
return cb.failure ? function(xhr){
|
||||
cb.failure.call(cb.scope||window, {
|
||||
responseText: xhr.responseText,
|
||||
responseXML : xhr.responseXML,
|
||||
argument: cb.argument
|
||||
});
|
||||
} : Ext.emptyFn;
|
||||
};
|
||||
return {
|
||||
request : function(method, uri, cb, data){
|
||||
new Ajax.Request(uri, {
|
||||
method: method,
|
||||
parameters: data || '',
|
||||
timeout: cb.timeout,
|
||||
onSuccess: createSuccess(cb),
|
||||
onFailure: createFailure(cb)
|
||||
});
|
||||
},
|
||||
|
||||
formRequest : function(form, uri, cb, data, isUpload, sslUri){
|
||||
new Ajax.Request(uri, {
|
||||
method: Ext.getDom(form).method ||'POST',
|
||||
parameters: Form.serialize(form)+(data?'&'+data:''),
|
||||
timeout: cb.timeout,
|
||||
onSuccess: createSuccess(cb),
|
||||
onFailure: createFailure(cb)
|
||||
});
|
||||
},
|
||||
|
||||
isCallInProgress : function(trans){
|
||||
return false;
|
||||
},
|
||||
|
||||
abort : function(trans){
|
||||
return false;
|
||||
},
|
||||
|
||||
serializeForm : function(form){
|
||||
return Form.serialize(form.dom||form, true);
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
|
||||
Ext.lib.Anim = function(){
|
||||
|
||||
var easings = {
|
||||
easeOut: function(pos) {
|
||||
return 1-Math.pow(1-pos,2);
|
||||
},
|
||||
easeIn: function(pos) {
|
||||
return 1-Math.pow(1-pos,2);
|
||||
}
|
||||
};
|
||||
var createAnim = function(cb, scope){
|
||||
return {
|
||||
stop : function(skipToLast){
|
||||
this.effect.cancel();
|
||||
},
|
||||
|
||||
isAnimated : function(){
|
||||
return this.effect.state == 'running';
|
||||
},
|
||||
|
||||
proxyCallback : function(){
|
||||
Ext.callback(cb, scope);
|
||||
}
|
||||
};
|
||||
};
|
||||
return {
|
||||
scroll : function(el, args, duration, easing, cb, scope){
|
||||
// not supported so scroll immediately?
|
||||
var anim = createAnim(cb, scope);
|
||||
el = Ext.getDom(el);
|
||||
el.scrollLeft = args.to[0];
|
||||
el.scrollTop = args.to[1];
|
||||
anim.proxyCallback();
|
||||
return anim;
|
||||
},
|
||||
|
||||
motion : function(el, args, duration, easing, cb, scope){
|
||||
return this.run(el, args, duration, easing, cb, scope);
|
||||
},
|
||||
|
||||
color : function(el, args, duration, easing, cb, scope){
|
||||
return this.run(el, args, duration, easing, cb, scope);
|
||||
},
|
||||
|
||||
run : function(el, args, duration, easing, cb, scope, type){
|
||||
var o = {};
|
||||
for(var k in args){
|
||||
switch(k){ // scriptaculous doesn't support, so convert these
|
||||
case 'points':
|
||||
var by, pts, e = Ext.fly(el, '_animrun');
|
||||
e.position();
|
||||
if(by = args.points.by){
|
||||
var xy = e.getXY();
|
||||
pts = e.translatePoints([xy[0]+by[0], xy[1]+by[1]]);
|
||||
}else{
|
||||
pts = e.translatePoints(args.points.to);
|
||||
}
|
||||
o.left = pts.left+'px';
|
||||
o.top = pts.top+'px';
|
||||
break;
|
||||
case 'width':
|
||||
o.width = args.width.to+'px';
|
||||
break;
|
||||
case 'height':
|
||||
o.height = args.height.to+'px';
|
||||
break;
|
||||
case 'opacity':
|
||||
o.opacity = String(args.opacity.to);
|
||||
break;
|
||||
default:
|
||||
o[k] = String(args[k].to);
|
||||
break;
|
||||
}
|
||||
}
|
||||
var anim = createAnim(cb, scope);
|
||||
anim.effect = new Effect.Morph(Ext.id(el), {
|
||||
duration: duration,
|
||||
afterFinish: anim.proxyCallback,
|
||||
transition: easings[easing] || Effect.Transitions.linear,
|
||||
style: o
|
||||
});
|
||||
return anim;
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
|
||||
// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights
|
||||
function fly(el){
|
||||
if(!libFlyweight){
|
||||
libFlyweight = new Ext.Element.Flyweight();
|
||||
}
|
||||
libFlyweight.dom = el;
|
||||
return libFlyweight;
|
||||
}
|
||||
|
||||
Ext.lib.Region = function(t, r, b, l) {
|
||||
this.top = t;
|
||||
this[1] = t;
|
||||
this.right = r;
|
||||
this.bottom = b;
|
||||
this.left = l;
|
||||
this[0] = l;
|
||||
};
|
||||
|
||||
Ext.lib.Region.prototype = {
|
||||
contains : function(region) {
|
||||
return ( region.left >= this.left &&
|
||||
region.right <= this.right &&
|
||||
region.top >= this.top &&
|
||||
region.bottom <= this.bottom );
|
||||
|
||||
},
|
||||
|
||||
getArea : function() {
|
||||
return ( (this.bottom - this.top) * (this.right - this.left) );
|
||||
},
|
||||
|
||||
intersect : function(region) {
|
||||
var t = Math.max( this.top, region.top );
|
||||
var r = Math.min( this.right, region.right );
|
||||
var b = Math.min( this.bottom, region.bottom );
|
||||
var l = Math.max( this.left, region.left );
|
||||
|
||||
if (b >= t && r >= l) {
|
||||
return new Ext.lib.Region(t, r, b, l);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
union : function(region) {
|
||||
var t = Math.min( this.top, region.top );
|
||||
var r = Math.max( this.right, region.right );
|
||||
var b = Math.max( this.bottom, region.bottom );
|
||||
var l = Math.min( this.left, region.left );
|
||||
|
||||
return new Ext.lib.Region(t, r, b, l);
|
||||
},
|
||||
|
||||
adjust : function(t, l, b, r){
|
||||
this.top += t;
|
||||
this.left += l;
|
||||
this.right += r;
|
||||
this.bottom += b;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Region.getRegion = function(el) {
|
||||
var p = Ext.lib.Dom.getXY(el);
|
||||
|
||||
var t = p[1];
|
||||
var r = p[0] + el.offsetWidth;
|
||||
var b = p[1] + el.offsetHeight;
|
||||
var l = p[0];
|
||||
|
||||
return new Ext.lib.Region(t, r, b, l);
|
||||
};
|
||||
|
||||
Ext.lib.Point = function(x, y) {
|
||||
if (x instanceof Array) {
|
||||
y = x[1];
|
||||
x = x[0];
|
||||
}
|
||||
this.x = this.right = this.left = this[0] = x;
|
||||
this.y = this.top = this.bottom = this[1] = y;
|
||||
};
|
||||
|
||||
Ext.lib.Point.prototype = new Ext.lib.Region();
|
||||
|
||||
|
||||
// prevent IE leaks
|
||||
if(Ext.isIE){
|
||||
Event.observe(window, "unload", function(){
|
||||
var p = Function.prototype;
|
||||
delete p.createSequence;
|
||||
delete p.defer;
|
||||
delete p.createDelegate;
|
||||
delete p.createCallback;
|
||||
delete p.createInterceptor;
|
||||
});
|
||||
}
|
||||
})();
|
||||
304
www/extras/yui-ext/source/adapter/yui-bridge.js
vendored
Normal file
304
www/extras/yui-ext/source/adapter/yui-bridge.js
vendored
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
/*
|
||||
* Ext JS Library 1.0.1
|
||||
* Copyright(c) 2006-2007, Ext JS, LLC.
|
||||
* licensing@extjs.com
|
||||
*
|
||||
* http://www.extjs.com/license
|
||||
*/
|
||||
|
||||
if(typeof YAHOO == "undefined"){
|
||||
throw "Unable to load Ext, core YUI utilities (yahoo, dom, event) not found.";
|
||||
}
|
||||
|
||||
(function(){
|
||||
var E = YAHOO.util.Event;
|
||||
var D = YAHOO.util.Dom;
|
||||
var CN = YAHOO.util.Connect;
|
||||
|
||||
var ES = YAHOO.util.Easing;
|
||||
var A = YAHOO.util.Anim;
|
||||
var libFlyweight;
|
||||
|
||||
Ext.lib.Dom = {
|
||||
getViewWidth : function(full){
|
||||
return full ? D.getDocumentWidth() : D.getViewportWidth();
|
||||
},
|
||||
|
||||
getViewHeight : function(full){
|
||||
return full ? D.getDocumentHeight() : D.getViewportHeight();
|
||||
},
|
||||
|
||||
isAncestor : function(haystack, needle){
|
||||
return D.isAncestor(haystack, needle);
|
||||
},
|
||||
|
||||
getRegion : function(el){
|
||||
return D.getRegion(el);
|
||||
},
|
||||
|
||||
getY : function(el){
|
||||
return this.getXY(el)[1];
|
||||
},
|
||||
|
||||
getX : function(el){
|
||||
return this.getXY(el)[0];
|
||||
},
|
||||
|
||||
// original version based on YahooUI getXY
|
||||
// this version fixes several issues in Safari and FF
|
||||
// and boosts performance by removing the batch overhead, repetitive dom lookups and array index calls
|
||||
getXY : function(el){
|
||||
var p, pe, b, scroll, bd = document.body;
|
||||
el = Ext.getDom(el);
|
||||
|
||||
if(el.getBoundingClientRect){ // IE
|
||||
b = el.getBoundingClientRect();
|
||||
scroll = fly(document).getScroll();
|
||||
return [b.left + scroll.left, b.top + scroll.top];
|
||||
} else{
|
||||
var x = el.offsetLeft, y = el.offsetTop;
|
||||
p = el.offsetParent;
|
||||
|
||||
// ** flag if a parent is positioned for Safari
|
||||
var hasAbsolute = false;
|
||||
|
||||
if(p != el){
|
||||
while(p){
|
||||
x += p.offsetLeft;
|
||||
y += p.offsetTop;
|
||||
|
||||
// ** flag Safari abs position bug - only check if needed
|
||||
if(Ext.isSafari && !hasAbsolute && fly(p).getStyle("position") == "absolute"){
|
||||
hasAbsolute = true;
|
||||
}
|
||||
|
||||
// ** Fix gecko borders measurements
|
||||
// Credit jQuery dimensions plugin for the workaround
|
||||
if(Ext.isGecko){
|
||||
pe = fly(p);
|
||||
var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
|
||||
var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
|
||||
|
||||
// add borders to offset
|
||||
x += bl;
|
||||
y += bt;
|
||||
|
||||
// Mozilla removes the border if the parent has overflow property other than visible
|
||||
if(p != el && pe.getStyle('overflow') != 'visible'){
|
||||
x += bl;
|
||||
y += bt;
|
||||
}
|
||||
}
|
||||
p = p.offsetParent;
|
||||
}
|
||||
}
|
||||
// ** safari doubles in some cases, use flag from offsetParent's as well
|
||||
if(Ext.isSafari && (hasAbsolute || fly(el).getStyle("position") == "absolute")){
|
||||
x -= bd.offsetLeft;
|
||||
y -= bd.offsetTop;
|
||||
}
|
||||
}
|
||||
|
||||
p = el.parentNode;
|
||||
|
||||
while(p && p != bd){
|
||||
// ** opera TR has bad scroll values, so filter them jvs
|
||||
if(!Ext.isOpera || (Ext.isOpera && p.tagName != 'TR' && fly(p).getStyle("display") != "inline")){
|
||||
x -= p.scrollLeft;
|
||||
y -= p.scrollTop;
|
||||
}
|
||||
p = p.parentNode;
|
||||
}
|
||||
return [x, y];
|
||||
},
|
||||
|
||||
setXY : function(el, xy){
|
||||
el = Ext.fly(el, '_setXY');
|
||||
el.position();
|
||||
var pts = el.translatePoints(xy);
|
||||
if(xy[0] !== false){
|
||||
el.dom.style.left = pts.left + "px";
|
||||
}
|
||||
if(xy[1] !== false){
|
||||
el.dom.style.top = pts.top + "px";
|
||||
}
|
||||
},
|
||||
|
||||
setX : function(el, x){
|
||||
this.setXY(el, [x, false]);
|
||||
},
|
||||
|
||||
setY : function(el, y){
|
||||
this.setXY(el, [false, y]);
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Event = {
|
||||
getPageX : function(e){
|
||||
return E.getPageX(e.browserEvent || e);
|
||||
},
|
||||
|
||||
getPageY : function(e){
|
||||
return E.getPageY(e.browserEvent || e);
|
||||
},
|
||||
|
||||
getXY : function(e){
|
||||
return E.getXY(e.browserEvent || e);
|
||||
},
|
||||
|
||||
getTarget : function(e){
|
||||
return E.getTarget(e.browserEvent || e);
|
||||
},
|
||||
|
||||
getRelatedTarget : function(e){
|
||||
return E.getRelatedTarget(e.browserEvent || e);
|
||||
},
|
||||
|
||||
on : function(el, eventName, fn, scope, override){
|
||||
E.on(el, eventName, fn, scope, override);
|
||||
},
|
||||
|
||||
un : function(el, eventName, fn){
|
||||
E.removeListener(el, eventName, fn);
|
||||
},
|
||||
|
||||
purgeElement : function(el){
|
||||
E.purgeElement(el);
|
||||
},
|
||||
|
||||
preventDefault : function(e){
|
||||
E.preventDefault(e.browserEvent || e);
|
||||
},
|
||||
|
||||
stopPropagation : function(e){
|
||||
E.stopPropagation(e.browserEvent || e);
|
||||
},
|
||||
|
||||
stopEvent : function(e){
|
||||
E.stopEvent(e.browserEvent || e);
|
||||
},
|
||||
|
||||
onAvailable : function(el, fn, scope, override){
|
||||
return E.onAvailable(el, fn, scope, override);
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Ajax = {
|
||||
request : function(method, uri, cb, data){
|
||||
return CN.asyncRequest(method, uri, cb, data);
|
||||
},
|
||||
|
||||
formRequest : function(form, uri, cb, data, isUpload, sslUri){
|
||||
CN.setForm(form, isUpload, sslUri);
|
||||
return CN.asyncRequest(Ext.getDom(form).method ||'POST', uri, cb, data);
|
||||
},
|
||||
|
||||
isCallInProgress : function(trans){
|
||||
return CN.isCallInProgress(trans);
|
||||
},
|
||||
|
||||
abort : function(trans){
|
||||
return CN.abort(trans);
|
||||
},
|
||||
|
||||
serializeForm : function(form){
|
||||
var d = CN.setForm(form.dom || form);
|
||||
CN.resetFormState();
|
||||
return d;
|
||||
}
|
||||
};
|
||||
|
||||
Ext.lib.Region = YAHOO.util.Region;
|
||||
Ext.lib.Point = YAHOO.util.Point;
|
||||
|
||||
|
||||
Ext.lib.Anim = {
|
||||
scroll : function(el, args, duration, easing, cb, scope){
|
||||
this.run(el, args, duration, easing, cb, scope, YAHOO.util.Scroll);
|
||||
},
|
||||
|
||||
motion : function(el, args, duration, easing, cb, scope){
|
||||
this.run(el, args, duration, easing, cb, scope, YAHOO.util.Motion);
|
||||
},
|
||||
|
||||
color : function(el, args, duration, easing, cb, scope){
|
||||
this.run(el, args, duration, easing, cb, scope, YAHOO.util.ColorAnim);
|
||||
},
|
||||
|
||||
run : function(el, args, duration, easing, cb, scope, type){
|
||||
type = type || YAHOO.util.Anim;
|
||||
if(typeof easing == "string"){
|
||||
easing = YAHOO.util.Easing[easing];
|
||||
}
|
||||
var anim = new type(el, args, duration, easing);
|
||||
anim.animateX(function(){
|
||||
Ext.callback(cb, scope);
|
||||
});
|
||||
return anim;
|
||||
}
|
||||
};
|
||||
|
||||
// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights
|
||||
function fly(el){
|
||||
if(!libFlyweight){
|
||||
libFlyweight = new Ext.Element.Flyweight();
|
||||
}
|
||||
libFlyweight.dom = el;
|
||||
return libFlyweight;
|
||||
}
|
||||
|
||||
// prevent IE leaks
|
||||
if(Ext.isIE){
|
||||
YAHOO.util.Event.on(window, "unload", function(){
|
||||
var p = Function.prototype;
|
||||
delete p.createSequence;
|
||||
delete p.defer;
|
||||
delete p.createDelegate;
|
||||
delete p.createCallback;
|
||||
delete p.createInterceptor;
|
||||
});
|
||||
}
|
||||
|
||||
// various overrides
|
||||
|
||||
// add ability for callbacks with animations
|
||||
if(YAHOO.util.Anim){
|
||||
YAHOO.util.Anim.prototype.animateX = function(callback, scope){
|
||||
var f = function(){
|
||||
this.onComplete.unsubscribe(f);
|
||||
if(typeof callback == "function"){
|
||||
callback.call(scope || this, this);
|
||||
}
|
||||
};
|
||||
this.onComplete.subscribe(f, this, true);
|
||||
this.animate();
|
||||
};
|
||||
}
|
||||
|
||||
if(YAHOO.util.DragDrop && Ext.dd.DragDrop){
|
||||
YAHOO.util.DragDrop.defaultPadding = Ext.dd.DragDrop.defaultPadding;
|
||||
YAHOO.util.DragDrop.constrainTo = Ext.dd.DragDrop.constrainTo;
|
||||
}
|
||||
|
||||
YAHOO.util.Dom.getXY = function(el) {
|
||||
var f = function(el) {
|
||||
return Ext.lib.Dom.getXY(el);
|
||||
};
|
||||
return YAHOO.util.Dom.batch(el, f, YAHOO.util.Dom, true);
|
||||
};
|
||||
|
||||
|
||||
// workaround for Safari anim duration speed problems
|
||||
if(YAHOO.util.AnimMgr){
|
||||
YAHOO.util.AnimMgr.fps = 1000;
|
||||
}
|
||||
|
||||
YAHOO.util.Region.prototype.adjust = function(t, l, b, r){
|
||||
this.top += t;
|
||||
this.left += l;
|
||||
this.right += r;
|
||||
this.bottom += b;
|
||||
return this;
|
||||
};
|
||||
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue