Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/adapter/yui/ext-yui-adapter-debug.js view on Meta::CPAN
// we do a strict check to return the element with only the id attribute
if (e && isIE && strict) {
if (el == e.getAttribute('id')) {
return e;
} else {
return null;
}
}
return e;
} else {
return el;
}
}
},
/**
* Returns the current document body as an {@link Ext.Element}.
* @return Ext.Element The document body
*/
getBody : function(){
return Ext.get(DOC.body || DOC.documentElement);
},
/**
* Returns the current document body as an {@link Ext.Element}.
* @return Ext.Element The document body
* @method
*/
getHead : function() {
var head;
return function() {
if (head == undefined) {
head = Ext.get(DOC.getElementsByTagName("head")[0]);
}
return head;
};
}(),
/**
* <p>Removes this element from the document, removes all DOM event listeners, and deletes the cache reference.
* All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval} is
* <code>true</code>, then DOM event listeners are also removed from all child nodes. The body node
* will be ignored if passed in.</p>
* @param {HTMLElement} node The node to remove
* @method
*/
removeNode : isIE && !isIE8 ? function(){
var d;
return function(n){
if(n && n.tagName != 'BODY'){
(Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
d = d || DOC.createElement('div');
d.appendChild(n);
d.innerHTML = '';
delete Ext.elCache[n.id];
}
};
}() : function(n){
if(n && n.parentNode && n.tagName != 'BODY'){
(Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
n.parentNode.removeChild(n);
delete Ext.elCache[n.id];
}
},
/**
* <p>Returns true if the passed value is empty.</p>
* <p>The value is deemed to be empty if it is<div class="mdetail-params"><ul>
* <li>null</li>
* <li>undefined</li>
* <li>an empty array</li>
* <li>a zero length string (Unless the <tt>allowBlank</tt> parameter is <tt>true</tt>)</li>
* </ul></div>
* @param {Mixed} value The value to test
* @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false)
* @return {Boolean}
*/
isEmpty : function(v, allowBlank){
return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false);
},
/**
* Returns true if the passed value is a JavaScript array, otherwise false.
* @param {Mixed} value The value to test
* @return {Boolean}
*/
isArray : function(v){
return toString.apply(v) === '[object Array]';
},
/**
* Returns true if the passed object is a JavaScript date object, otherwise false.
* @param {Object} object The object to test
* @return {Boolean}
*/
isDate : function(v){
return toString.apply(v) === '[object Date]';
},
/**
* Returns true if the passed value is a JavaScript Object, otherwise false.
* @param {Mixed} value The value to test
* @return {Boolean}
*/
isObject : function(v){
return !!v && Object.prototype.toString.call(v) === '[object Object]';
},
/**
* Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean.
* @param {Mixed} value The value to test
* @return {Boolean}
*/
isPrimitive : function(v){
return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v);
},
/**
* Returns true if the passed value is a JavaScript Function, otherwise false.
* @param {Mixed} value The value to test
* @return {Boolean}
share/adapter/yui/ext-yui-adapter-debug.js view on Meta::CPAN
/**
* Stops an existing running task.
* @method stop
* @param {Object} task The task to stop
* @return {Object} The task
*/
this.stop = function(task){
removeTask(task);
return task;
};
/**
* Stops all tasks that are currently running.
* @method stopAll
*/
this.stopAll = function(){
stopThread();
for(var i = 0, len = tasks.length; i < len; i++){
if(tasks[i].onStop){
tasks[i].onStop();
}
}
tasks = [];
removeQueue = [];
};
};
/**
* @class Ext.TaskMgr
* @extends Ext.util.TaskRunner
* A static {@link Ext.util.TaskRunner} instance that can be used to start and stop arbitrary tasks. See
* {@link Ext.util.TaskRunner} for supported methods and task config properties.
* <pre><code>
// Start a simple clock task that updates a div once per second
var task = {
run: function(){
Ext.fly('clock').update(new Date().format('g:i:s A'));
},
interval: 1000 //1 second
}
Ext.TaskMgr.start(task);
</code></pre>
* <p>See the {@link #start} method for details about how to configure a task object.</p>
* @singleton
*/
Ext.TaskMgr = new Ext.util.TaskRunner();if(typeof YAHOO == "undefined"){
throw "Unable to load Ext, core YUI utilities (yahoo, dom, event) not found.";
}
(function(){
var E = YAHOO.util.Event,
D = YAHOO.util.Dom,
CN = YAHOO.util.Connect,
ES = YAHOO.util.Easing,
A = YAHOO.util.Anim,
libFlyweight,
version = YAHOO.env.getVersion('yahoo').version.split('.'),
mouseEnterSupported = parseInt(version[0], 10) >= 3,
mouseCache = {},
elContains = function(parent, child){
if(parent && parent.firstChild){
while(child){
if(child === parent){
return true;
}
child = child.parentNode;
if(child && (child.nodeType != 1)){
child = null;
}
}
}
return false;
}, checkRelatedTarget = function(e){
return !elContains(e.currentTarget, Ext.lib.Event.getRelatedTarget(e));
};
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 || document.documentElement);
el = Ext.getDom(el);
if(el == bd){
return [0, 0];
}
if (el.getBoundingClientRect) {
b = el.getBoundingClientRect();
scroll = fly(document).getScroll();
return [Math.round(b.left + scroll.left), Math.round(b.top + scroll.top)];
}
var x = 0, y = 0;
p = el;
var hasAbsolute = fly(el).getStyle("position") == "absolute";
while (p) {
x += p.offsetLeft;
y += p.offsetTop;
if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
hasAbsolute = true;
}
if (Ext.isGecko) {
pe = fly(p);
var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
x += bl;
y += bt;
if (p != el && pe.getStyle('overflow') != 'visible') {
x += bl;
y += bt;
}
}
p = p.offsetParent;
}
if (Ext.isSafari && hasAbsolute) {
x -= bd.offsetLeft;
y -= bd.offsetTop;
}
if (Ext.isGecko && !hasAbsolute) {
var dbd = fly(bd);
x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
}
p = el.parentNode;
while (p && p != bd) {
if (!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){
if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){
var item = mouseCache[el.id] || (mouseCache[el.id] = {});
item[eventName] = fn;
fn = fn.createInterceptor(checkRelatedTarget);
eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout';
}
E.on(el, eventName, fn, scope, override);
},
un : function(el, eventName, fn){
if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){
var item = mouseCache[el.id],
ev = item && item[eventName];
( run in 0.471 second using v1.01-cache-2.11-cpan-97f6503c9c8 )