Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/adapter/ext/ext-base-debug.js view on Meta::CPAN
/*
This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License Usage
This file may be used under the terms of the GNU General Public License version 3.0 as
published by the Free Software Foundation and appearing in the file LICENSE included in the
packaging of this file.
Please review the following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you are unsure which license is appropriate for your use, please contact the sales department
at http://www.sencha.com/contact.
Build date: 2013-04-03 15:07:25
*/
// for old browsers
window.undefined = window.undefined;
/**
* @class Ext
* Ext core utilities and functions.
* @singleton
*/
Ext = {
/**
* The version of the framework
* @type String
*/
version : '3.4.1.1',
versionDetail : {
major : 3,
minor : 4,
patch : 1.1
}
};
/**
* Copies all the properties of config to obj.
* @param {Object} obj The receiver of the properties
* @param {Object} config The source of the properties
* @param {Object} defaults A different object that will also be applied for default values
* @return {Object} returns obj
* @member Ext apply
*/
Ext.apply = function(o, c, defaults){
// no "this" reference for friendly out of scope calls
if(defaults){
Ext.apply(o, defaults);
}
if(o && c && typeof c == 'object'){
for(var p in c){
o[p] = c[p];
}
}
return o;
};
(function(){
var idSeed = 0,
toString = Object.prototype.toString,
ua = navigator.userAgent.toLowerCase(),
check = function(r){
return r.test(ua);
},
DOC = document,
docMode = DOC.documentMode,
isStrict = DOC.compatMode == "CSS1Compat",
isOpera = check(/opera/),
isChrome = check(/\bchrome\b/),
isWebKit = check(/webkit/),
isSafari = !isChrome && check(/safari/),
isSafari2 = isSafari && check(/applewebkit\/4/), // unique to Safari 2
isSafari3 = isSafari && check(/version\/3/),
isSafari4 = isSafari && check(/version\/4/),
isIE = !isOpera && check(/msie/),
isIE7 = isIE && ((check(/msie 7/) && docMode != 8 && docMode != 9 && docMode != 10) || docMode == 7),
isIE8 = isIE && ((check(/msie 8/) && docMode != 7 && docMode != 9 && docMode != 10) || docMode == 8),
isIE9 = isIE && ((check(/msie 9/) && docMode != 7 && docMode != 8 && docMode != 10) || docMode == 9),
isIE10 = isIE && ((check(/msie 10/) && docMode != 7 && docMode != 8 && docMode != 9) || docMode == 10),
isIE6 = isIE && check(/msie 6/),
isIE9m = isIE && (isIE6 || isIE7 || isIE8 || isIE9),
isGecko = !isWebKit && check(/gecko/),
isGecko2 = isGecko && check(/rv:1\.8/),
isGecko3 = isGecko && check(/rv:1\.9/),
isBorderBox = isIE9m && !isStrict,
isWindows = check(/windows|win32/),
share/adapter/ext/ext-base-debug.js view on Meta::CPAN
return method.$owner.prototype[method.$name].apply(this, arguments);
};
if (t.constructor !== emptyFn) {
nonEnumerables.push('constructor');
}
if (t.toString !== emptyFn) {
nonEnumerables.push('toString');
}
if (t.valueOf !== emptyFn) {
nonEnumerables.push('valueOf');
}
if (!nonEnumerables.length) {
nonEnumerables = null;
}
// Create the abstract Base class to provide an empty constructor and callParent implementations
function Base () {
//
}
Ext.apply(Base, {
$isClass: true,
callParent: function (args) {
var method;
// This code is intentionally inlined for the least number of debugger stepping
return (method = this.callParent.caller) && (method.$previous ||
((method = method.$owner ? method : method.caller) &&
method.$owner.superclass.self[method.$name])).apply(this, args || noArgs);
}
});
Base.prototype = {
constructor: function() {
},
callParent: function(args) {
// NOTE: this code is deliberately as few expressions (and no function calls)
// as possible so that a debugger can skip over this noise with the minimum number
// of steps. Basically, just hit Step Into until you are where you really wanted
// to be.
var method,
superMethod = (method = this.callParent.caller) && (method.$previous ||
((method = method.$owner ? method : method.caller) &&
method.$owner.superclass[method.$name]));
return superMethod.apply(this, args || noArgs);
}
};
// remove css image flicker
if(isIE6){
try{
DOC.execCommand("BackgroundImageCache", false, true);
}catch(e){}
}
Ext.apply(Ext, {
/**
* URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent
* the IE insecure content warning (<tt>'about:blank'</tt>, except for IE in secure mode, which is <tt>'javascript:""'</tt>).
* @type String
*/
SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank',
/**
* True if the browser is in strict (standards-compliant) mode, as opposed to quirks mode
* @type Boolean
*/
isStrict : isStrict,
/**
* True if the page is running over SSL
* @type Boolean
*/
isSecure : isSecure,
/**
* True when the document is fully initialized and ready for action
* @type Boolean
*/
isReady : false,
/**
* True if the {@link Ext.Fx} Class is available
* @type Boolean
* @property enableFx
*/
/**
* HIGHLY EXPERIMENTAL
* True to force css based border-box model override and turning off javascript based adjustments. This is a
* runtime configuration and must be set before onReady.
* @type Boolean
*/
enableForcedBoxModel : false,
/**
* True to automatically uncache orphaned Ext.Elements periodically (defaults to true)
* @type Boolean
*/
enableGarbageCollector : true,
/**
* True to automatically purge event listeners during garbageCollection (defaults to false).
* @type Boolean
*/
enableListenerCollection : false,
/**
* EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed.
* Currently not optimized for performance.
* @type Boolean
*/
enableNestedListenerRemoval : false,
/**
* Indicates whether to use native browser parsing for JSON methods.
* This option is ignored if the browser does not support native JSON methods.
* <b>Note: Native JSON methods will not work with objects that have functions.
* Also, property names must be quoted, otherwise the data will not parse.</b> (Defaults to false)
* @type Boolean
*/
share/adapter/ext/ext-base-debug.js view on Meta::CPAN
var me = this,
d = me.duration;
if(me.isAnimated){
return false;
}
me.curFrame = 0;
me.totalFrames = me.useSec ? Math.ceil(mgr.fps * d) : d;
mgr.registerElement(me);
},
stop: function(finish){
var me = this;
if(finish){
me.curFrame = me.totalFrames;
me._onTween.fire();
}
mgr.stop(me);
}
});
var onStart = function(){
var me = this,
attr;
me.onStart.fire();
me.runAttrs = {};
for(attr in this.attributes){
this.setRunAttr(attr);
}
me.isAnimated = true;
me.startTime = now();
actualFrames = 0;
};
var onTween = function(){
var me = this;
me.onTween.fire({
duration: now() - me.startTime,
curFrame: me.curFrame
});
var ra = me.runAttrs;
for (var attr in ra) {
this.setAttr(attr, me.doMethod(attr, ra[attr].start, ra[attr].end), ra[attr].unit);
}
++actualFrames;
};
var onComplete = function() {
var me = this,
actual = (now() - me.startTime) / 1000,
data = {
duration: actual,
frames: actualFrames,
fps: actualFrames / actual
};
me.isAnimated = false;
actualFrames = 0;
me.onComplete.fire(data);
};
me.onStart = new Ext.util.Event(me);
me.onTween = new Ext.util.Event(me);
me.onComplete = new Ext.util.Event(me);
(me._onStart = new Ext.util.Event(me)).addListener(onStart);
(me._onTween = new Ext.util.Event(me)).addListener(onTween);
(me._onComplete = new Ext.util.Event(me)).addListener(onComplete);
}
};
Ext.lib.AnimMgr = new function() {
var me = this,
thread = null,
queue = [],
tweenCount = 0;
Ext.apply(me, {
fps: 1000,
delay: 1,
registerElement: function(tween){
queue.push(tween);
++tweenCount;
tween._onStart.fire();
me.start();
},
unRegister: function(tween, index){
tween._onComplete.fire();
index = index || getIndex(tween);
if (index != -1) {
queue.splice(index, 1);
}
if (--tweenCount <= 0) {
me.stop();
}
},
start: function(){
if(thread === null){
thread = setInterval(me.run, me.delay);
}
},
stop: function(tween){
if(!tween){
clearInterval(thread);
for(var i = 0, len = queue.length; i < len; ++i){
if(queue[0].isAnimated){
me.unRegister(queue[0], 0);
}
}
queue = [];
thread = null;
tweenCount = 0;
}else{
me.unRegister(tween);
}
},
run: function(){
var tf, i, len, tween;
for(i = 0, len = queue.length; i<len; i++) {
tween = queue[i];
if(tween && tween.isAnimated){
tf = tween.totalFrames;
if(tween.curFrame < tf || tf === null){
++tween.curFrame;
if(tween.useSec){
correctFrame(tween);
}
tween._onTween.fire();
}else{
me.stop(tween);
}
}
}
}
});
var getIndex = function(anim) {
var i, len;
for(i = 0, len = queue.length; i<len; i++) {
if(queue[i] === anim) {
return i;
}
}
return -1;
};
var correctFrame = function(tween) {
var frames = tween.totalFrames,
frame = tween.curFrame,
duration = tween.duration,
expected = (frame * duration * 1000 / frames),
elapsed = (now() - tween.startTime),
tweak = 0;
if(elapsed < duration * 1000){
tweak = Math.round((elapsed / expected - 1) * frame);
}else{
tweak = frames - (frame + 1);
}
if(tweak > 0 && isFinite(tweak)){
if(tween.curFrame + tweak >= frames){
tweak = frames - (frame + 1);
}
tween.curFrame += tweak;
}
};
};
EXTLIB.Bezier = new function() {
this.getPosition = function(points, t) {
var n = points.length,
tmp = [],
c = 1 - t,
i,
j;
for (i = 0; i < n; ++i) {
tmp[i] = [points[i][0], points[i][1]];
}
for (j = 1; j < n; ++j) {
for (i = 0; i < n - j; ++i) {
tmp[i][0] = c * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
tmp[i][1] = c * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
}
}
return [ tmp[0][0], tmp[0][1] ];
};
};
EXTLIB.Easing = {
easeNone: function (t, b, c, d) {
return c * t / d + b;
},
easeIn: function (t, b, c, d) {
return c * (t /= d) * t + b;
},
easeOut: function (t, b, c, d) {
return -c * (t /= d) * (t - 2) + b;
}
};
(function() {
EXTLIB.Motion = function(el, attributes, duration, method) {
if (el) {
EXTLIB.Motion.superclass.constructor.call(this, el, attributes, duration, method);
}
};
Ext.extend(EXTLIB.Motion, Ext.lib.AnimBase);
var superclass = EXTLIB.Motion.superclass,
pointsRe = /^points$/i;
( run in 1.171 second using v1.01-cache-2.11-cpan-df04353d9ac )