MDL-37125 import latest YUI 3.8.0

This commit is contained in:
Petr Škoda
2012-12-20 22:31:51 +01:00
parent 0dc5a532ec
commit 6846f033a9
1830 changed files with 81661 additions and 75639 deletions
+1 -1
View File
@@ -239,7 +239,7 @@ umask(0000);
// exact version of currently used yui2 and 3 library
$CFG->yui2version = '2.9.0';
$CFG->yui3version = '3.7.3';
$CFG->yui3version = '3.8.0';
// special support for highly optimised scripts that do not need libraries and DB connection
+1 -1
View File
@@ -193,7 +193,7 @@
<location>yui</location>
<name>YUI</name>
<license>BSD</license>
<version>3.7.3</version>
<version>3.8.0</version>
<licenseversion></licenseversion>
</library>
<library>
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("anim-base",function(e,t){var n="running",r="startTime",i="elapsedTime",s="start",o="tween",u="end",a="node",f="paused",l="reverse",c="iterationCount",h=Number,p={},d;e.Anim=function(){e.Anim.superclass.constructor.apply(this,arguments),e.Anim._instances[e.stamp(this)]=this},e.Anim.NAME="anim",e.Anim._instances={},e.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,e.Anim.DEFAULT_UNIT="px",e.Anim.DEFAULT_EASING=function(e,t,n,r){return n*e/r+t},e.Anim._intervalTime=20,e.Anim.behaviors={left:{get:function(e,t){return e._getOffset(t)}}},e.Anim.behaviors.top=e.Anim.behaviors.left,e.Anim.DEFAULT_SETTER=function(t,n,r,i,s,o,u,a){var f=t._node,l=f._node,c=u(s,h(r),h(i)-h(r),o);l?"style"in l&&(n in l.style||n in e.DOM.CUSTOM_STYLES)?(a=a||"",f.setStyle(n,c+a)):"attributes"in l&&n in l.attributes?f.setAttribute(n,c):n in l&&(l[n]=c):f.set?f.set(n,c):n in f&&(f[n]=c)},e.Anim.DEFAULT_GETTER=function(t,n){var r=t._node,i=r._node,s="";return i?"style"in i&&(n in i.style||n in e.DOM.CUSTOM_STYLES)?s=r.getComputedStyle(n):"attributes"in i&&n in i.attributes?s=r.getAttribute(n):n in i&&(s=i[n]):r.get?s=r.get(n):n in r&&(s=r[n]),s},e.Anim.ATTRS={node:{setter:function(t){return t&&(typeof t=="string"||t.nodeType)&&(t=e.one(t)),this._node=t,!t,t}},duration:{value:1},easing:{value:e.Anim.DEFAULT_EASING,setter:function(t){if(typeof t=="string"&&e.Easing)return e.Easing[t]}},from:{},to:{},startTime:{value:0,readOnly:!0},elapsedTime:{value:0,readOnly:!0},running:{getter:function(){return!!p[e.stamp(this)]},value:!1,readOnly:!0},iterations:{value:1},iterationCount:{value:0,readOnly:!0},direction:{value:"normal"},paused:{readOnly:!0,value:!1},reverse:{value:!1}},e.Anim.run=function(){var t=e.Anim._instances;for(var n in t)t[n].run&&t[n].run()},e.Anim.pause=function(){for(var t in p)p[t].pause&&p[t].pause();e.Anim._stopTimer()},e.Anim.stop=function(){for(var t in p)p[t].stop&&p[t].stop();e.Anim._stopTimer()},e.Anim._startTimer=function(){d||(d=setInterval(e.Anim._runFrame,e.Anim._intervalTime))},e.Anim._stopTimer=function(){clearInterval(d),d=0},e.Anim._runFrame=function(){var t=!0;for(var n in p)p[n]._runFrame&&(t=!1,p[n]._runFrame());t&&e.Anim._stopTimer()},e.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var v={run:function(){return this.get(f)?this._resume():this.get(n)||this._start(),this},pause:function(){return this.get(n)&&this._pause(),this},stop:function(e){return(this.get(n)||this.get(f))&&this._end(e),this},_added:!1,_start:function(){this._set(r,new Date-this.get(i)),this._actualFrames=0,this.get(f)||this._initAnimAttr(),p[e.stamp(this)]=this,e.Anim._startTimer(),this.fire(s)},_pause:function(){this._set(r,null),this._set(f,!0),delete p[e.stamp(this)],this.fire("pause")},_resume:function(){this._set(f,!1),p[e.stamp(this)]=this,this._set(r,new Date-this.get(i)),e.Anim._startTimer(),this.fire("resume")},_end:function(t){var n=this.get("duration")*1e3;t&&this._runAttrs(n,n,this.get(l)),this._set(r,null),this._set(i,0),this._set(f,!1),delete p[e.stamp(this)],this.fire(u,{elapsed:this.get(i)})},_runFrame:function(){var e=this._runtimeAttr.duration,t=new Date-this.get(r),n=this.get(l),s=t>=e,u,a;this._runAttrs(t,e,n),this._actualFrames+=1,this._set(i,t),this.fire(o),s&&this._lastFrame()},_runAttrs:function(t,n,r){var i=this._runtimeAttr,s=e.Anim.behaviors,o=i.easing,u=n,a=!1,f,l,c;t>=n&&(a=!0),r&&(t=n-t,u=0);for(c in i)i[c].to&&(f=i[c],l=c in s&&"set"in s[c]?s[c].set:e.Anim.DEFAULT_SETTER,a?l(this,c,f.from,f.to,u,n,o,f.unit):l(this,c,f.from,f.to,t,n,o,f.unit))},_lastFrame:function(){var e=this.get("iterations"),t=this.get(c);t+=1,e==="infinite"||t<e?(this.get("direction")==="alternate"&&this.set(l,!this.get(l)),this.fire("iteration")):(t=0,this._end()),this._set(r,new Date),this._set(c,t)},_initAnimAttr:function(){var t=this.get("from")||{},n=this.get("to")||{},r={duration:this.get("duration")*1e3,easing:this.get("easing")},i=e.Anim.behaviors,s=this.get(a),o,u,f;e.each(n,function(n,a){typeof n=="function"&&(n=n.call(this,s)),u=t[a],u===undefined?u=a in i&&"get"in i[a]?i[a].get(this,a):e.Anim.DEFAULT_GETTER(this,a):typeof u=="function"&&(u=u.call(this,s));var l=e.Anim.RE_UNITS.exec(u),c=e.Anim.RE_UNITS.exec(n);u=l?l[1]:u,f=c?c[1]:n,o=c?c[2]:l?l[2]:"",!o&&e.Anim.RE_DEFAULT_UNIT.test(a)&&(o=e.Anim.DEFAULT_UNIT);if(!u||!f){e.error('invalid "from" or "to" for "'+a+'"',"Anim");return}r[a]={from:e.Lang.isObject(u)?e.clone(u):u,to:f,unit:o}},this),this._runtimeAttr=r},_getOffset:function(e){var t=this._node,n=t.getComputedStyle(e),r=e==="left"?"getX":"getY",i=e==="left"?"setX":"setY";if(n==="auto"){var s=t.getStyle("position");s==="absolute"||s==="fixed"?(n=t[r](),t[i](n)):n=0}return n},destructor:function(){delete e.Anim._instances[e.stamp(this)]}};e.extend(e.Anim,e.Base,v)},"3.7.3",{requires:["base-base","node-style"]});
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("anim-curve",function(e,t){e.Anim.behaviors.curve={set:function(t,n,r,i,s,o,u){r=r.slice.call(r),i=i.slice.call(i);var a=u(s,0,100,o)/100;i.unshift(r),t._node.setXY(e.Anim.getBezier(i,a))},get:function(e,t){return e._node.getXY()}},e.Anim.getBezier=function(e,t){var n=e.length,r=[];for(var i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(var s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]}},"3.7.3",{requires:["anim-xy"]});
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("anim-shape",function(e,t){var n=Number,r,i,s="color",o="stops",u="type",a=function(t,r,i,o,u,a){var f=0,l=e.Anim.getUpdatedColorValue,c,h,p,d=i.length,v,m,g,y,b,w,E,S,x,T=[],N;for(;f<d;f+=1){c=i[f],h=r[f],N={};for(p in c)c.hasOwnProperty(p)&&(p==s?N[p]=e.Color.toHex(l(e.Color.toHex(h[p]),e.Color.toHex(c[p]),o,u,a)):N[p]=a(o,n(h[p]),n(c[p])-n(h[p]),u));T.push(N)}return T},f={set:function(t,r,i,f,l,c,h){var p,d={},v=e.Anim.getUpdatedColorValue,m=a;for(p in f)if(f.hasOwnProperty(p)&&p!=u)switch(p){case s:d[p]=v(i[p],f[p],l,c,h);break;case o:d[p]=m(t,i[p],f[p],l,c,h);break;default:d[p]=h(l,n(i[p]),n(f[p])-n(i[p]),c)}t._node.set(r,d)}};e.Anim.behaviors.fill=f,e.Anim.behaviors.stroke=f,e.Anim.behaviors.transform={set:function(e,t,s,o,u,a,f){var l=e._node,c="",h,p,d,v,m=0,g,y,b;o=r,b=r.length;for(;m<b;++m){d=o[m].concat(),v=s[m].concat(),h=d.shift(),p=v.shift(),y=d.length,c+=h+"(";for(g=0;g<y;++g)c+=f(u,n(v[g]),n(d[g])-n(v[g]),a),g<y-1&&(c+=", ");c+=");"}c&&l.set("transform",c),l._transform=i},get:function(t){var n=t._node,s=n.matrix,o=t.get("to")||{},u=t.get("to").transform,a=n.get("transform"),f=e.MatrixUtil.getTransformArray(u),l=a?e.MatrixUtil.getTransformArray(a):null,c,h,p,d,v;if(f)if(!l||l.length<1){l=[],p=f.length;for(h=0;h<p;++h)d=f[h][0],l[h]=e.MatrixUtil.getTransformFunctionArray(d);r=f,v=l}else if(e.MatrixUtil.compareTransformSequence(f,l))r=f,v=l;else{c=new e.Matrix,p=f.length;for(h=0;h<p;++h)d=f[h].shift(),d=d=="matrix"?"multiply":d,c[d].apply(c,f[h]);r=c.decompose(),v=s.decompose()}return i=u,v}}},"3.7.3",{requires:["anim-base","anim-easing","anim-color","matrix"]});
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-resize,.yui3-resize-wrapper{z-index:0;zoom:1}.yui3-resize-handle{position:absolute;display:block;z-index:100;zoom:1}.yui3-resize-proxy{position:absolute;border:1px dashed #000;position:absolute;z-index:10000}.yui3-resize-hidden-handles .yui3-resize-handle{opacity:0;filter:alpha(opacity=0)}.yui3-resize-handle-t,.yui3-resize-handle-b{width:100%;left:0;height:6px}.yui3-resize-handle-l,.yui3-resize-handle-r{height:100%;top:0;width:6px}.yui3-resize-handle-t{cursor:n-resize;top:0}.yui3-resize-handle-b{cursor:s-resize;bottom:0}.yui3-resize-handle-l{cursor:w-resize;left:0}.yui3-resize-handle-r{cursor:e-resize;right:0}.yui3-resize-handle-inner{position:absolute;zoom:1}@media only screen and (min-device-width :320px) and (max-device-width:480px){.yui3-resize-handle-inner:after{content:"";width:40px;height:40px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-12px;right:0}.yui3-resize-handle-inner-l:after{top:-12px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-12px}.yui3-resize-handle-inner-b:after{bottom:0;left:-12px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}@media only screen and (min-device-width :768px) and (max-device-width:1024px){.yui3-resize-handle-inner:after{content:"";width:30px;height:30px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-6px;right:0}.yui3-resize-handle-inner-l:after{top:-6px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-6px}.yui3-resize-handle-inner-b:after{bottom:0;left:-6px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b{margin-left:-8px;left:50%}.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-r{margin-top:-8px;top:50%}.yui3-resize-handle-inner-t{top:-4px}.yui3-resize-handle-inner-b{bottom:-4px}.yui3-resize-handle-inner-l{left:-4px}.yui3-resize-handle-inner-r{right:-4px}.yui3-resize-handle-tr,.yui3-resize-handle-br,.yui3-resize-handle-tl,.yui3-resize-handle-bl{height:15px;width:15px;z-index:200}.yui3-resize-handle-tr{cursor:ne-resize;top:0;right:0}.yui3-resize-handle-tl{cursor:nw-resize;top:0;left:0}.yui3-resize-handle-br{cursor:se-resize;bottom:0;right:0}.yui3-resize-handle-bl{cursor:sw-resize;bottom:0;left:0}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{background-repeat:no-repeat;background:url(arrows.png) no-repeat 0 0;display:block;height:15px;overflow:hidden;text-indent:-99999em;width:15px}.yui3-resize-handle-inner-br{background-position:-30px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tr{background-position:-58px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-bl{background-position:-75px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tl{background-position:-47px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t{background-position:-15px 0}#yui3-css-stamp.skin-sam-resize-base{display:none}
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("attribute-base",function(e,t){var n=function(){this._ATTR_E_FACADE=null,this._yuievt=null,e.AttributeCore.apply(this,arguments),e.AttributeEvents.apply(this,arguments),e.AttributeExtras.apply(this,arguments)};e.mix(n,e.AttributeCore,!1,null,1),e.mix(n,e.AttributeExtras,!1,null,1),e.mix(n,e.AttributeEvents,!0,null,1),n.INVALID_VALUE=e.AttributeCore.INVALID_VALUE,n._ATTR_CFG=e.AttributeCore._ATTR_CFG.concat(e.AttributeEvents._ATTR_CFG),e.Attribute=n},"3.7.3",{requires:["attribute-core","attribute-events","attribute-extras"]});
@@ -1,214 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/attribute-complex/attribute-complex.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/attribute-complex/attribute-complex.js",
code: []
};
_yuitest_coverage["build/attribute-complex/attribute-complex.js"].code=["YUI.add('attribute-complex', function (Y, NAME) {",""," /**"," * Adds support for attribute providers to handle complex attributes in the constructor"," *"," * @module attribute"," * @submodule attribute-complex"," * @for Attribute"," */",""," var O = Y.Object,"," DOT = \".\";",""," Y.Attribute.Complex = function() {};"," Y.Attribute.Complex.prototype = {",""," /**"," * Utility method to split out simple attribute name/value pairs (\"x\") "," * from complex attribute name/value pairs (\"x.y.z\"), so that complex"," * attributes can be keyed by the top level attribute name."," *"," * @method _normAttrVals"," * @param {Object} valueHash An object with attribute name/value pairs"," *"," * @return {Object} An object literal with 2 properties - \"simple\" and \"complex\","," * containing simple and complex attribute values respectively keyed "," * by the top level attribute name, or null, if valueHash is falsey."," *"," * @private"," */"," _normAttrVals : function(valueHash) {"," var vals = {},"," subvals = {},"," path,"," attr,"," v, k;",""," if (valueHash) {"," for (k in valueHash) {"," if (valueHash.hasOwnProperty(k)) {"," if (k.indexOf(DOT) !== -1) {"," path = k.split(DOT);"," attr = path.shift();"," v = subvals[attr] = subvals[attr] || [];"," v[v.length] = {"," path : path,"," value: valueHash[k]"," };"," } else {"," vals[k] = valueHash[k];"," }"," }"," }"," return { simple:vals, complex:subvals };"," } else {"," return null;"," }"," },",""," /**"," * Returns the initial value of the given attribute from"," * either the default configuration provided, or the "," * over-ridden value if it exists in the set of initValues "," * provided and the attribute is not read-only."," *"," * @param {String} attr The name of the attribute"," * @param {Object} cfg The attribute configuration object"," * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals"," *"," * @return {Any} The initial value of the attribute."," *"," * @method _getAttrInitVal"," * @private"," */"," _getAttrInitVal : function(attr, cfg, initValues) {",""," var val = cfg.value,"," valFn = cfg.valueFn,"," tmpVal,"," initValSet = false,"," simple,"," complex,"," i,"," l,"," path,"," subval,"," subvals;",""," if (!cfg.readOnly && initValues) {"," // Simple Attributes"," simple = initValues.simple;"," if (simple && simple.hasOwnProperty(attr)) {"," val = simple[attr];"," initValSet = true;"," }"," }",""," if (valFn && !initValSet) {"," if (!valFn.call) {"," valFn = this[valFn];"," }"," if (valFn) {"," tmpVal = valFn.call(this, attr);"," val = tmpVal;"," }"," }",""," if (!cfg.readOnly && initValues) {",""," // Complex Attributes (complex values applied, after simple, in case both are set)"," complex = initValues.complex;",""," if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {"," subvals = complex[attr];"," for (i = 0, l = subvals.length; i < l; ++i) {"," path = subvals[i].path;"," subval = subvals[i].value;"," O.setValue(val, path, subval);"," }"," }"," }",""," return val;"," }"," };",""," Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);",""," // Consistency with the rest of the Attribute addons for now. "," Y.AttributeComplex = Y.Attribute.Complex;","","","}, '3.7.3', {\"requires\": [\"attribute-base\"]});"];
_yuitest_coverage["build/attribute-complex/attribute-complex.js"].lines = {"1":0,"11":0,"14":0,"15":0,"32":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"50":0,"54":0,"56":0,"77":0,"89":0,"91":0,"92":0,"93":0,"94":0,"98":0,"99":0,"100":0,"102":0,"103":0,"104":0,"108":0,"111":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"123":0,"127":0,"130":0};
_yuitest_coverage["build/attribute-complex/attribute-complex.js"].functions = {"_normAttrVals:31":0,"_getAttrInitVal:75":0,"(anonymous 1):1":0};
_yuitest_coverage["build/attribute-complex/attribute-complex.js"].coveredLines = 39;
_yuitest_coverage["build/attribute-complex/attribute-complex.js"].coveredFunctions = 3;
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 1);
YUI.add('attribute-complex', function (Y, NAME) {
/**
* Adds support for attribute providers to handle complex attributes in the constructor
*
* @module attribute
* @submodule attribute-complex
* @for Attribute
*/
_yuitest_coverfunc("build/attribute-complex/attribute-complex.js", "(anonymous 1)", 1);
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 11);
var O = Y.Object,
DOT = ".";
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 14);
Y.Attribute.Complex = function() {};
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 15);
Y.Attribute.Complex.prototype = {
/**
* Utility method to split out simple attribute name/value pairs ("x")
* from complex attribute name/value pairs ("x.y.z"), so that complex
* attributes can be keyed by the top level attribute name.
*
* @method _normAttrVals
* @param {Object} valueHash An object with attribute name/value pairs
*
* @return {Object} An object literal with 2 properties - "simple" and "complex",
* containing simple and complex attribute values respectively keyed
* by the top level attribute name, or null, if valueHash is falsey.
*
* @private
*/
_normAttrVals : function(valueHash) {
_yuitest_coverfunc("build/attribute-complex/attribute-complex.js", "_normAttrVals", 31);
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 32);
var vals = {},
subvals = {},
path,
attr,
v, k;
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 38);
if (valueHash) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 39);
for (k in valueHash) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 40);
if (valueHash.hasOwnProperty(k)) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 41);
if (k.indexOf(DOT) !== -1) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 42);
path = k.split(DOT);
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 43);
attr = path.shift();
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 44);
v = subvals[attr] = subvals[attr] || [];
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 45);
v[v.length] = {
path : path,
value: valueHash[k]
};
} else {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 50);
vals[k] = valueHash[k];
}
}
}
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 54);
return { simple:vals, complex:subvals };
} else {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 56);
return null;
}
},
/**
* Returns the initial value of the given attribute from
* either the default configuration provided, or the
* over-ridden value if it exists in the set of initValues
* provided and the attribute is not read-only.
*
* @param {String} attr The name of the attribute
* @param {Object} cfg The attribute configuration object
* @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
*
* @return {Any} The initial value of the attribute.
*
* @method _getAttrInitVal
* @private
*/
_getAttrInitVal : function(attr, cfg, initValues) {
_yuitest_coverfunc("build/attribute-complex/attribute-complex.js", "_getAttrInitVal", 75);
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 77);
var val = cfg.value,
valFn = cfg.valueFn,
tmpVal,
initValSet = false,
simple,
complex,
i,
l,
path,
subval,
subvals;
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 89);
if (!cfg.readOnly && initValues) {
// Simple Attributes
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 91);
simple = initValues.simple;
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 92);
if (simple && simple.hasOwnProperty(attr)) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 93);
val = simple[attr];
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 94);
initValSet = true;
}
}
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 98);
if (valFn && !initValSet) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 99);
if (!valFn.call) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 100);
valFn = this[valFn];
}
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 102);
if (valFn) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 103);
tmpVal = valFn.call(this, attr);
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 104);
val = tmpVal;
}
}
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 108);
if (!cfg.readOnly && initValues) {
// Complex Attributes (complex values applied, after simple, in case both are set)
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 111);
complex = initValues.complex;
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 113);
if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 114);
subvals = complex[attr];
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 115);
for (i = 0, l = subvals.length; i < l; ++i) {
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 116);
path = subvals[i].path;
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 117);
subval = subvals[i].value;
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 118);
O.setValue(val, path, subval);
}
}
}
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 123);
return val;
}
};
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 127);
Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);
// Consistency with the rest of the Attribute addons for now.
_yuitest_coverline("build/attribute-complex/attribute-complex.js", 130);
Y.AttributeComplex = Y.Attribute.Complex;
}, '3.7.3', {"requires": ["attribute-base"]});
@@ -1,139 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('attribute-complex', function (Y, NAME) {
/**
* Adds support for attribute providers to handle complex attributes in the constructor
*
* @module attribute
* @submodule attribute-complex
* @for Attribute
*/
var O = Y.Object,
DOT = ".";
Y.Attribute.Complex = function() {};
Y.Attribute.Complex.prototype = {
/**
* Utility method to split out simple attribute name/value pairs ("x")
* from complex attribute name/value pairs ("x.y.z"), so that complex
* attributes can be keyed by the top level attribute name.
*
* @method _normAttrVals
* @param {Object} valueHash An object with attribute name/value pairs
*
* @return {Object} An object literal with 2 properties - "simple" and "complex",
* containing simple and complex attribute values respectively keyed
* by the top level attribute name, or null, if valueHash is falsey.
*
* @private
*/
_normAttrVals : function(valueHash) {
var vals = {},
subvals = {},
path,
attr,
v, k;
if (valueHash) {
for (k in valueHash) {
if (valueHash.hasOwnProperty(k)) {
if (k.indexOf(DOT) !== -1) {
path = k.split(DOT);
attr = path.shift();
v = subvals[attr] = subvals[attr] || [];
v[v.length] = {
path : path,
value: valueHash[k]
};
} else {
vals[k] = valueHash[k];
}
}
}
return { simple:vals, complex:subvals };
} else {
return null;
}
},
/**
* Returns the initial value of the given attribute from
* either the default configuration provided, or the
* over-ridden value if it exists in the set of initValues
* provided and the attribute is not read-only.
*
* @param {String} attr The name of the attribute
* @param {Object} cfg The attribute configuration object
* @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
*
* @return {Any} The initial value of the attribute.
*
* @method _getAttrInitVal
* @private
*/
_getAttrInitVal : function(attr, cfg, initValues) {
var val = cfg.value,
valFn = cfg.valueFn,
tmpVal,
initValSet = false,
simple,
complex,
i,
l,
path,
subval,
subvals;
if (!cfg.readOnly && initValues) {
// Simple Attributes
simple = initValues.simple;
if (simple && simple.hasOwnProperty(attr)) {
val = simple[attr];
initValSet = true;
}
}
if (valFn && !initValSet) {
if (!valFn.call) {
valFn = this[valFn];
}
if (valFn) {
tmpVal = valFn.call(this, attr);
val = tmpVal;
}
}
if (!cfg.readOnly && initValues) {
// Complex Attributes (complex values applied, after simple, in case both are set)
complex = initValues.complex;
if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {
subvals = complex[attr];
for (i = 0, l = subvals.length; i < l; ++i) {
path = subvals[i].path;
subval = subvals[i].value;
O.setValue(val, path, subval);
}
}
}
return val;
}
};
Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);
// Consistency with the rest of the Attribute addons for now.
Y.AttributeComplex = Y.Attribute.Complex;
}, '3.7.3', {"requires": ["attribute-base"]});
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("attribute-complex",function(e,t){var n=e.Object,r=".";e.Attribute.Complex=function(){},e.Attribute.Complex.prototype={_normAttrVals:function(e){var t={},n={},i,s,o,u;if(e){for(u in e)e.hasOwnProperty(u)&&(u.indexOf(r)!==-1?(i=u.split(r),s=i.shift(),o=n[s]=n[s]||[],o[o.length]={path:i,value:e[u]}):t[u]=e[u]);return{simple:t,complex:n}}return null},_getAttrInitVal:function(e,t,r){var i=t.value,s=t.valueFn,o,u=!1,a,f,l,c,h,p,d;!t.readOnly&&r&&(a=r.simple,a&&a.hasOwnProperty(e)&&(i=a[e],u=!0)),s&&!u&&(s.call||(s=this[s]),s&&(o=s.call(this,e),i=o));if(!t.readOnly&&r){f=r.complex;if(f&&f.hasOwnProperty(e)&&i!==undefined&&i!==null){d=f[e];for(l=0,c=d.length;l<c;++l)h=d[l].path,p=d[l].value,n.setValue(i,h,p)}}return i}},e.mix(e.Attribute,e.Attribute.Complex,!0,null,1),e.AttributeComplex=e.Attribute.Complex},"3.7.3",{requires:["attribute-base"]});
@@ -1,139 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('attribute-complex', function (Y, NAME) {
/**
* Adds support for attribute providers to handle complex attributes in the constructor
*
* @module attribute
* @submodule attribute-complex
* @for Attribute
*/
var O = Y.Object,
DOT = ".";
Y.Attribute.Complex = function() {};
Y.Attribute.Complex.prototype = {
/**
* Utility method to split out simple attribute name/value pairs ("x")
* from complex attribute name/value pairs ("x.y.z"), so that complex
* attributes can be keyed by the top level attribute name.
*
* @method _normAttrVals
* @param {Object} valueHash An object with attribute name/value pairs
*
* @return {Object} An object literal with 2 properties - "simple" and "complex",
* containing simple and complex attribute values respectively keyed
* by the top level attribute name, or null, if valueHash is falsey.
*
* @private
*/
_normAttrVals : function(valueHash) {
var vals = {},
subvals = {},
path,
attr,
v, k;
if (valueHash) {
for (k in valueHash) {
if (valueHash.hasOwnProperty(k)) {
if (k.indexOf(DOT) !== -1) {
path = k.split(DOT);
attr = path.shift();
v = subvals[attr] = subvals[attr] || [];
v[v.length] = {
path : path,
value: valueHash[k]
};
} else {
vals[k] = valueHash[k];
}
}
}
return { simple:vals, complex:subvals };
} else {
return null;
}
},
/**
* Returns the initial value of the given attribute from
* either the default configuration provided, or the
* over-ridden value if it exists in the set of initValues
* provided and the attribute is not read-only.
*
* @param {String} attr The name of the attribute
* @param {Object} cfg The attribute configuration object
* @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
*
* @return {Any} The initial value of the attribute.
*
* @method _getAttrInitVal
* @private
*/
_getAttrInitVal : function(attr, cfg, initValues) {
var val = cfg.value,
valFn = cfg.valueFn,
tmpVal,
initValSet = false,
simple,
complex,
i,
l,
path,
subval,
subvals;
if (!cfg.readOnly && initValues) {
// Simple Attributes
simple = initValues.simple;
if (simple && simple.hasOwnProperty(attr)) {
val = simple[attr];
initValSet = true;
}
}
if (valFn && !initValSet) {
if (!valFn.call) {
valFn = this[valFn];
}
if (valFn) {
tmpVal = valFn.call(this, attr);
val = tmpVal;
}
}
if (!cfg.readOnly && initValues) {
// Complex Attributes (complex values applied, after simple, in case both are set)
complex = initValues.complex;
if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {
subvals = complex[attr];
for (i = 0, l = subvals.length; i < l; ++i) {
path = subvals[i].path;
subval = subvals[i].value;
O.setValue(val, path, subval);
}
}
}
return val;
}
};
Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);
// Consistency with the rest of the Attribute addons for now.
Y.AttributeComplex = Y.Attribute.Complex;
}, '3.7.3', {"requires": ["attribute-base"]});
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("attribute-core",function(e,t){function E(e,t,n){this._initAttrHost(e,t,n)}e.State=function(){this.data={}},e.State.prototype={add:function(e,t,n){var r=this.data[e];r||(r=this.data[e]={}),r[t]=n},addAll:function(e,t){var n=this.data[e],r;n||(n=this.data[e]={});for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r])},remove:function(e,t){var n=this.data[e];n&&delete n[t]},removeAll:function(t,n){var r;n?e.each(n,function(e,n){this.remove(t,typeof n=="string"?n:e)},this):(r=this.data,t in r&&delete r[t])},get:function(e,t){var n=this.data[e];if(n)return n[t]},getAll:function(e,t){var n=this.data[e],r,i;if(t)i=n;else if(n){i={};for(r in n)n.hasOwnProperty(r)&&(i[r]=n[r])}return i}};var n=e.Object,r=e.Lang,i=".",s="getter",o="setter",u="readOnly",a="writeOnce",f="initOnly",l="validator",c="value",h="valueFn",p="lazyAdd",d="added",v="_bypassProxy",m="initializing",g="initValue",y="lazy",b="isLazyAdd",w;E.INVALID_VALUE={},w=E.INVALID_VALUE,E._ATTR_CFG=[o,s,l,c,h,a,u,p,v],E.prototype={_initAttrHost:function(t,n,r){this._state=new e.State,this._initAttrs(t,n,r)},addAttr:function(e,t,n){var r=this,i=r._state,s,o;t=t||{},n=p in t?t[p]:n;if(n&&!r.attrAdded(e))i.addAll(e,{lazy:t,added:!0});else if(!r.attrAdded(e)||i.get(e,b))o=c in t,o&&(s=t.value,delete t.value),t.added=!0,t.initializing=!0,i.addAll(e,t),o&&r.set(e,s),i.remove(e,m);return r},attrAdded:function(e){return!!this._state.get(e,d)},get:function(e){return this._getAttr(e)},_isLazyAttr:function(e){return this._state.get(e,y)},_addLazyAttr:function(e,t){var n=this._state,r=n.get(e,y);n.add(e,b,!0),n.remove(e,y),this.addAttr(e,r)},set:function(e,t){return this._setAttr(e,t)},_set:function(e,t){return this._setAttr(e,t,null,!0)},_setAttr:function(t,r,s,o){var u=!0,a=this._state,l=this._stateProxy,h,p,d,v,m,g,y;return t.indexOf(i)!==-1&&(d=t,v=t.split(i),t=v.shift()),this._isLazyAttr(t)&&this._addLazyAttr(t),h=a.getAll(t,!0)||{},p=!(c in h),l&&t in l&&!h._bypassProxy&&(p=!1),g=h.writeOnce,y=h.initializing,!p&&!o&&(g&&(u=!1),h.readOnly&&(u=!1)),!y&&!o&&g===f&&(u=!1),u&&(p||(m=this.get(t)),v&&(r=n.setValue(e.clone(m),v,r),r===undefined&&(u=!1)),u&&(!this._fireAttrChange||y?this._setAttrVal(t,d,m,r):this._fireAttrChange(t,d,m,r,s))),this},_getAttr:function(e){var t=this,r=e,o=t._state,u,a,f,l;return e.indexOf(i)!==-1&&(u=e.split(i),e=u.shift()),t._tCfgs&&t._tCfgs[e]&&(l={},l[e]=t._tCfgs[e],delete t._tCfgs[e],t._addAttrs(l,t._tVals)),t._isLazyAttr(e)&&t._addLazyAttr(e),f=t._getStateVal(e),a=o.get(e,s),a&&!a.call&&(a=this[a]),f=a?a.call(t,f,r):f,f=u?n.getValue(f,u):f,f},_getStateVal:function(e){var t=this._stateProxy;return t&&e in t&&!this._state.get(e,v)?t[e]:this._state.get(e,c)},_setStateVal:function(e,t){var n=this._stateProxy;n&&e in n&&!this._state.get(e,v)?n[e]=t:this._state.add(e,c,t)},_setAttrVal:function(e,t,n,i){var s=this,o=!0,u=this._state.getAll(e,!0)||{},a=u.validator,f=u.setter,l=u.initializing,c=this._getStateVal(e),h=t||e,p,d;return a&&(a.call||(a=this[a]),a&&(d=a.call(s,i,h),!d&&l&&(i=u.defaultValue,d=!0))),!a||d?(f&&(f.call||(f=this[f]),f&&(p=f.call(s,i,h),p===w?o=!1:p!==undefined&&(i=p))),o&&(!t&&i===c&&!r.isObject(i)?o=!1:(g in u||(u.initValue=i),s._setStateVal(e,i)))):o=!1,o},setAttrs:function(e){return this._setAttrs(e)},_setAttrs:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.set(t,e[t]);return this},getAttrs:function(e){return this._getAttrs(e)},_getAttrs:function(e){var t={},r,i,s,o=e===!0;if(!e||o)e=n.keys(this._state.data);for(i=0,s=e.length;i<s;i++){r=e[i];if(!o||this._getStateVal(r)!=this._state.get(r,g))t[r]=this.get(r)}return t},addAttrs:function(e,t,n){var r=this;return e&&(r._tCfgs=e,r._tVals=r._normAttrVals(t),r._addAttrs(e,r._tVals,n),r._tCfgs=r._tVals=null),r},_addAttrs:function(e,t,n){var r=this,i,s,o;for(i in e)e.hasOwnProperty(i)&&(s=e[i],s.defaultValue=s.value,o=r._getAttrInitVal(i,s,r._tVals),o!==undefined&&(s.value=o),r._tCfgs[i]&&delete r._tCfgs[i],r.addAttr(i,s,n))},_protectAttrs:function(t){if(t){t=e.merge(t);for(var n in t)t.hasOwnProperty(n)&&(t[n]=e.merge(t[n]))}return t},_normAttrVals:function(t){return t?e.merge(t):null},_getAttrInitVal:function(e,t,n){var r,i;return!t.readOnly&&n&&n.hasOwnProperty(e)?r=n[e]:(r=t.value,i=t.valueFn,i&&(i.call||(i=this[i]),i&&(r=i.call(this,e)))),r},_initAttrs:function(t,n,r){t=t||this.constructor.ATTRS;var i=e.Base,s=e.BaseCore,o=i&&e.instanceOf(this,i),u=!o&&s&&e.instanceOf(this,s);t&&!o&&!u&&this.addAttrs(this._protectAttrs(t),n,r)}},e.AttributeCore=E},"3.7.3",{requires:["oop"]});
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("attribute-events",function(e,t){function o(){this._ATTR_E_FACADE={},n.call(this,{emitFacade:!0})}var n=e.EventTarget,r="Change",i="broadcast",s="published";o._ATTR_CFG=[i],o.prototype={set:function(e,t,n){return this._setAttr(e,t,n)},_set:function(e,t,n){return this._setAttr(e,t,n,!0)},setAttrs:function(e,t){return this._setAttrs(e,t)},_setAttrs:function(e,t){var n;for(n in e)e.hasOwnProperty(n)&&this.set(n,e[n],t);return this},_fireAttrChange:function(t,n,o,u,a){var f=this,l=t+r,c=f._state,h,p,d;c.get(t,s)||(d={queuable:!1,defaultTargetOnly:!0,defaultFn:f._defAttrChangeFn,silent:!0},p=c.get(t,i),p!==undefined&&(d.broadcast=p),f.publish(l,d),c.add(t,s,!0)),h=a?e.merge(a):f._ATTR_E_FACADE,h.attrName=t,h.subAttrName=n,h.prevVal=o,h.newVal=u,f.fire(l,h)},_defAttrChangeFn:function(e){this._setAttrVal(e.attrName,e.subAttrName,e.prevVal,e.newVal)?e.newVal=this.get(e.attrName):e.stopImmediatePropagation()}},e.mix(o,n,!1,null,1),e.AttributeEvents=o},"3.7.3",{requires:["event-custom"]});
File diff suppressed because one or more lines are too long
@@ -1,354 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('base-base', function (Y, NAME) {
/**
* The base module provides the Base class, which objects requiring attribute and custom event support can extend.
* The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides
* plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions.
*
* @module base
*/
/**
* The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host,
* and without the extension support provided by BaseCore.build.
*
* @module base
* @submodule base-base
*/
/**
* The base module provides the Base class, which objects requiring attribute and custom event support can extend.
* The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides
* plugin support and also provides the Base.build method which provides a way to build custom classes using extensions.
*
* @module base
*/
/**
* The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host,
* and without the extension support provided by Base.build.
*
* @module base
* @submodule base-base
*/
var L = Y.Lang,
DESTROY = "destroy",
INIT = "init",
BUBBLETARGETS = "bubbleTargets",
_BUBBLETARGETS = "_bubbleTargets",
BaseCore = Y.BaseCore,
AttributeCore = Y.AttributeCore,
Attribute = Y.Attribute;
/**
* <p>
* A base class which objects requiring attributes and custom event support can
* extend. Base also handles the chaining of initializer and destructor methods across
* the hierarchy as part of object construction and destruction. Additionally, attributes configured
* through the static <a href="#property_ATTRS">ATTRS</a> property for each class
* in the hierarchy will be initialized by Base.
* </p>
*
* <p>
* The static <a href="#property_NAME">NAME</a> property of each class extending
* from Base will be used as the identifier for the class, and is used by Base to prefix
* all events fired by instances of that class.
* </p>
*
* @class Base
* @constructor
* @uses BaseCore
* @uses Attribute
* @uses AttributeCore
* @uses AttributeEvents
* @uses AttributeExtras
* @uses EventTarget
*
* @param {Object} config Object with configuration property name/value pairs. The object can be
* used to provide default values for the objects published attributes.
*
* <p>
* The config object can also contain the following non-attribute properties, providing a convenient
* way to configure events listeners and plugins for the instance, as part of the constructor call:
* </p>
*
* <dl>
* <dt>on</dt>
* <dd>An event name to listener function map, to register event listeners for the "on" moment of the event. A constructor convenience property for the <a href="Base.html#method_on">on</a> method.</dd>
* <dt>after</dt>
* <dd>An event name to listener function map, to register event listeners for the "after" moment of the event. A constructor convenience property for the <a href="Base.html#method_after">after</a> method.</dd>
* <dt>bubbleTargets</dt>
* <dd>An object, or array of objects, to register as bubble targets for bubbled events fired by this instance. A constructor convenience property for the <a href="EventTarget.html#method_addTarget">addTarget</a> method.</dd>
* <dt>plugins</dt>
* <dd>A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details). A constructor convenience property for the <a href="Plugin.Host.html#method_plug">plug</a> method.</dd>
* </dl>
*/
function Base() {
BaseCore.apply(this, arguments);
}
/**
* The list of properties which can be configured for
* each attribute (e.g. setter, getter, writeOnce, readOnly etc.)
*
* @property _ATTR_CFG
* @type Array
* @static
* @private
*/
Base._ATTR_CFG = Attribute._ATTR_CFG.concat("cloneDefaultValue");
Base._ATTR_CFG_HASH = Y.Array.hash(Base._ATTR_CFG);
/**
* The array of non-attribute configuration properties supported by this class.
*
* `Base` supports "on", "after", "plugins" and "bubbleTargets" properties,
* which are not set up as attributes.
*
* This property is primarily required so that when
* <a href="#property__allowAdHocAttrs">`_allowAdHocAttrs`</a> is enabled by
* a class, non-attribute configurations don't get added as ad-hoc attributes.
*
* @property _NON_ATTRS_CFG
* @type Array
* @static
* @private
*/
Base._NON_ATTRS_CFG = BaseCore._NON_ATTRS_CFG.concat(["on", "after", "bubbleTargets"]);
/**
* <p>
* The string to be used to identify instances of
* this class, for example in prefixing events.
* </p>
* <p>
* Classes extending Base, should define their own
* static NAME property, which should be camelCase by
* convention (e.g. MyClass.NAME = "myClass";).
* </p>
* @property NAME
* @type String
* @static
*/
Base.NAME = "base";
/**
* The default set of attributes which will be available for instances of this class, and
* their configuration. In addition to the configuration properties listed by
* Attribute's <a href="Attribute.html#method_addAttr">addAttr</a> method, the attribute
* can also be configured with a "cloneDefaultValue" property, which defines how the statically
* defined value field should be protected ("shallow", "deep" and false are supported values).
*
* By default if the value is an object literal or an array it will be "shallow" cloned, to
* protect the default value.
*
* @property ATTRS
* @type Object
* @static
*/
Base.ATTRS = AttributeCore.prototype._protectAttrs(BaseCore.ATTRS);
Base.prototype = {
/**
* Internal construction logic for Base.
*
* @method _initBase
* @param {Object} config The constructor configuration object
* @private
*/
_initBase: function(cfg) {
Y.log('init called', 'life', 'base');
this._eventPrefix = this.constructor.EVENT_PREFIX || this.constructor.NAME;
Y.BaseCore.prototype._initBase.call(this, cfg);
},
/**
* Initializes Attribute
*
* @method _initAttribute
* @private
*/
_initAttribute: function(cfg) {
Attribute.call(this);
this._yuievt.config.prefix = this._eventPrefix;
},
/**
* Utility method to define the attribute hash used to filter/whitelist property mixes for
* this class.
*
* @method _attrCfgHash
* @private
*/
_attrCfgHash: function() {
return Base._ATTR_CFG_HASH;
},
/**
* Init lifecycle method, invoked during construction.
* Fires the init event prior to setting up attributes and
* invoking initializers for the class hierarchy.
*
* @method init
* @chainable
* @param {Object} config Object with configuration property name/value pairs
* @return {Base} A reference to this object
*/
init: function(config) {
/**
* <p>
* Lifecycle event for the init phase, fired prior to initialization.
* Invoking the preventDefault() method on the event object provided
* to subscribers will prevent initialization from occuring.
* </p>
* <p>
* Subscribers to the "after" momemt of this event, will be notified
* after initialization of the object is complete (and therefore
* cannot prevent initialization).
* </p>
*
* @event init
* @preventable _defInitFn
* @param {EventFacade} e Event object, with a cfg property which
* refers to the configuration object passed to the constructor.
*/
this.publish(INIT, {
queuable:false,
fireOnce:true,
defaultTargetOnly:true,
defaultFn:this._defInitFn
});
this._preInitEventCfg(config);
this.fire(INIT, {cfg: config});
return this;
},
/**
* Handles the special on, after and target properties which allow the user to
* easily configure on and after listeners as well as bubble targets during
* construction, prior to init.
*
* @private
* @method _preInitEventCfg
* @param {Object} config The user configuration object
*/
_preInitEventCfg : function(config) {
if (config) {
if (config.on) {
this.on(config.on);
}
if (config.after) {
this.after(config.after);
}
}
var i, l, target,
userTargets = (config && BUBBLETARGETS in config);
if (userTargets || _BUBBLETARGETS in this) {
target = userTargets ? (config && config.bubbleTargets) : this._bubbleTargets;
if (L.isArray(target)) {
for (i = 0, l = target.length; i < l; i++) {
this.addTarget(target[i]);
}
} else if (target) {
this.addTarget(target);
}
}
},
/**
* <p>
* Destroy lifecycle method. Fires the destroy
* event, prior to invoking destructors for the
* class hierarchy.
* </p>
* <p>
* Subscribers to the destroy
* event can invoke preventDefault on the event object, to prevent destruction
* from proceeding.
* </p>
* @method destroy
* @return {Base} A reference to this object
* @chainable
*/
destroy: function() {
Y.log('destroy called', 'life', 'base');
/**
* <p>
* Lifecycle event for the destroy phase,
* fired prior to destruction. Invoking the preventDefault
* method on the event object provided to subscribers will
* prevent destruction from proceeding.
* </p>
* <p>
* Subscribers to the "after" moment of this event, will be notified
* after destruction is complete (and as a result cannot prevent
* destruction).
* </p>
* @event destroy
* @preventable _defDestroyFn
* @param {EventFacade} e Event object
*/
this.publish(DESTROY, {
queuable:false,
fireOnce:true,
defaultTargetOnly:true,
defaultFn: this._defDestroyFn
});
this.fire(DESTROY);
this.detachAll();
return this;
},
/**
* Default init event handler
*
* @method _defInitFn
* @param {EventFacade} e Event object, with a cfg property which
* refers to the configuration object passed to the constructor.
* @protected
*/
_defInitFn : function(e) {
this._baseInit(e.cfg);
},
/**
* Default destroy event handler
*
* @method _defDestroyFn
* @param {EventFacade} e Event object
* @protected
*/
_defDestroyFn : function(e) {
this._baseDestroy(e.cfg);
}
};
Y.mix(Base, Attribute, false, null, 1);
Y.mix(Base, BaseCore, false, null, 1);
// Fix constructor
Base.prototype.constructor = Base;
Y.Base = Base;
}, '3.7.3', {"requires": ["base-core", "attribute-base"]});
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("base-base",function(e,t){function l(){u.apply(this,arguments)}var n=e.Lang,r="destroy",i="init",s="bubbleTargets",o="_bubbleTargets",u=e.BaseCore,a=e.AttributeCore,f=e.Attribute;l._ATTR_CFG=f._ATTR_CFG.concat("cloneDefaultValue"),l._ATTR_CFG_HASH=e.Array.hash(l._ATTR_CFG),l._NON_ATTRS_CFG=u._NON_ATTRS_CFG.concat(["on","after","bubbleTargets"]),l.NAME="base",l.ATTRS=a.prototype._protectAttrs(u.ATTRS),l.prototype={_initBase:function(t){this._eventPrefix=this.constructor.EVENT_PREFIX||this.constructor.NAME,e.BaseCore.prototype._initBase.call(this,t)},_initAttribute:function(e){f.call(this),this._yuievt.config.prefix=this._eventPrefix},_attrCfgHash:function(){return l._ATTR_CFG_HASH},init:function(e){return this.publish(i,{queuable:!1,fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defInitFn}),this._preInitEventCfg(e),this.fire(i,{cfg:e}),this},_preInitEventCfg:function(e){e&&(e.on&&this.on(e.on),e.after&&this.after(e.after));var t,r,i,u=e&&s in e;if(u||o in this){i=u?e&&e.bubbleTargets:this._bubbleTargets;if(n.isArray(i))for(t=0,r=i.length;t<r;t++)this.addTarget(i[t]);else i&&this.addTarget(i)}},destroy:function(){return this.publish(r,{queuable:!1,fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defDestroyFn}),this.fire(r),this.detachAll(),this},_defInitFn:function(e){this._baseInit(e.cfg)},_defDestroyFn:function(e){this._baseDestroy(e.cfg)}},e.mix(l,f,!1,null,1),e.mix(l,u,!1,null,1),l.prototype.constructor=l,e.Base=l},"3.7.3",{requires:["base-core","attribute-base"]});
@@ -1,352 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('base-base', function (Y, NAME) {
/**
* The base module provides the Base class, which objects requiring attribute and custom event support can extend.
* The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides
* plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions.
*
* @module base
*/
/**
* The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host,
* and without the extension support provided by BaseCore.build.
*
* @module base
* @submodule base-base
*/
/**
* The base module provides the Base class, which objects requiring attribute and custom event support can extend.
* The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides
* plugin support and also provides the Base.build method which provides a way to build custom classes using extensions.
*
* @module base
*/
/**
* The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host,
* and without the extension support provided by Base.build.
*
* @module base
* @submodule base-base
*/
var L = Y.Lang,
DESTROY = "destroy",
INIT = "init",
BUBBLETARGETS = "bubbleTargets",
_BUBBLETARGETS = "_bubbleTargets",
BaseCore = Y.BaseCore,
AttributeCore = Y.AttributeCore,
Attribute = Y.Attribute;
/**
* <p>
* A base class which objects requiring attributes and custom event support can
* extend. Base also handles the chaining of initializer and destructor methods across
* the hierarchy as part of object construction and destruction. Additionally, attributes configured
* through the static <a href="#property_ATTRS">ATTRS</a> property for each class
* in the hierarchy will be initialized by Base.
* </p>
*
* <p>
* The static <a href="#property_NAME">NAME</a> property of each class extending
* from Base will be used as the identifier for the class, and is used by Base to prefix
* all events fired by instances of that class.
* </p>
*
* @class Base
* @constructor
* @uses BaseCore
* @uses Attribute
* @uses AttributeCore
* @uses AttributeEvents
* @uses AttributeExtras
* @uses EventTarget
*
* @param {Object} config Object with configuration property name/value pairs. The object can be
* used to provide default values for the objects published attributes.
*
* <p>
* The config object can also contain the following non-attribute properties, providing a convenient
* way to configure events listeners and plugins for the instance, as part of the constructor call:
* </p>
*
* <dl>
* <dt>on</dt>
* <dd>An event name to listener function map, to register event listeners for the "on" moment of the event. A constructor convenience property for the <a href="Base.html#method_on">on</a> method.</dd>
* <dt>after</dt>
* <dd>An event name to listener function map, to register event listeners for the "after" moment of the event. A constructor convenience property for the <a href="Base.html#method_after">after</a> method.</dd>
* <dt>bubbleTargets</dt>
* <dd>An object, or array of objects, to register as bubble targets for bubbled events fired by this instance. A constructor convenience property for the <a href="EventTarget.html#method_addTarget">addTarget</a> method.</dd>
* <dt>plugins</dt>
* <dd>A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details). A constructor convenience property for the <a href="Plugin.Host.html#method_plug">plug</a> method.</dd>
* </dl>
*/
function Base() {
BaseCore.apply(this, arguments);
}
/**
* The list of properties which can be configured for
* each attribute (e.g. setter, getter, writeOnce, readOnly etc.)
*
* @property _ATTR_CFG
* @type Array
* @static
* @private
*/
Base._ATTR_CFG = Attribute._ATTR_CFG.concat("cloneDefaultValue");
Base._ATTR_CFG_HASH = Y.Array.hash(Base._ATTR_CFG);
/**
* The array of non-attribute configuration properties supported by this class.
*
* `Base` supports "on", "after", "plugins" and "bubbleTargets" properties,
* which are not set up as attributes.
*
* This property is primarily required so that when
* <a href="#property__allowAdHocAttrs">`_allowAdHocAttrs`</a> is enabled by
* a class, non-attribute configurations don't get added as ad-hoc attributes.
*
* @property _NON_ATTRS_CFG
* @type Array
* @static
* @private
*/
Base._NON_ATTRS_CFG = BaseCore._NON_ATTRS_CFG.concat(["on", "after", "bubbleTargets"]);
/**
* <p>
* The string to be used to identify instances of
* this class, for example in prefixing events.
* </p>
* <p>
* Classes extending Base, should define their own
* static NAME property, which should be camelCase by
* convention (e.g. MyClass.NAME = "myClass";).
* </p>
* @property NAME
* @type String
* @static
*/
Base.NAME = "base";
/**
* The default set of attributes which will be available for instances of this class, and
* their configuration. In addition to the configuration properties listed by
* Attribute's <a href="Attribute.html#method_addAttr">addAttr</a> method, the attribute
* can also be configured with a "cloneDefaultValue" property, which defines how the statically
* defined value field should be protected ("shallow", "deep" and false are supported values).
*
* By default if the value is an object literal or an array it will be "shallow" cloned, to
* protect the default value.
*
* @property ATTRS
* @type Object
* @static
*/
Base.ATTRS = AttributeCore.prototype._protectAttrs(BaseCore.ATTRS);
Base.prototype = {
/**
* Internal construction logic for Base.
*
* @method _initBase
* @param {Object} config The constructor configuration object
* @private
*/
_initBase: function(cfg) {
this._eventPrefix = this.constructor.EVENT_PREFIX || this.constructor.NAME;
Y.BaseCore.prototype._initBase.call(this, cfg);
},
/**
* Initializes Attribute
*
* @method _initAttribute
* @private
*/
_initAttribute: function(cfg) {
Attribute.call(this);
this._yuievt.config.prefix = this._eventPrefix;
},
/**
* Utility method to define the attribute hash used to filter/whitelist property mixes for
* this class.
*
* @method _attrCfgHash
* @private
*/
_attrCfgHash: function() {
return Base._ATTR_CFG_HASH;
},
/**
* Init lifecycle method, invoked during construction.
* Fires the init event prior to setting up attributes and
* invoking initializers for the class hierarchy.
*
* @method init
* @chainable
* @param {Object} config Object with configuration property name/value pairs
* @return {Base} A reference to this object
*/
init: function(config) {
/**
* <p>
* Lifecycle event for the init phase, fired prior to initialization.
* Invoking the preventDefault() method on the event object provided
* to subscribers will prevent initialization from occuring.
* </p>
* <p>
* Subscribers to the "after" momemt of this event, will be notified
* after initialization of the object is complete (and therefore
* cannot prevent initialization).
* </p>
*
* @event init
* @preventable _defInitFn
* @param {EventFacade} e Event object, with a cfg property which
* refers to the configuration object passed to the constructor.
*/
this.publish(INIT, {
queuable:false,
fireOnce:true,
defaultTargetOnly:true,
defaultFn:this._defInitFn
});
this._preInitEventCfg(config);
this.fire(INIT, {cfg: config});
return this;
},
/**
* Handles the special on, after and target properties which allow the user to
* easily configure on and after listeners as well as bubble targets during
* construction, prior to init.
*
* @private
* @method _preInitEventCfg
* @param {Object} config The user configuration object
*/
_preInitEventCfg : function(config) {
if (config) {
if (config.on) {
this.on(config.on);
}
if (config.after) {
this.after(config.after);
}
}
var i, l, target,
userTargets = (config && BUBBLETARGETS in config);
if (userTargets || _BUBBLETARGETS in this) {
target = userTargets ? (config && config.bubbleTargets) : this._bubbleTargets;
if (L.isArray(target)) {
for (i = 0, l = target.length; i < l; i++) {
this.addTarget(target[i]);
}
} else if (target) {
this.addTarget(target);
}
}
},
/**
* <p>
* Destroy lifecycle method. Fires the destroy
* event, prior to invoking destructors for the
* class hierarchy.
* </p>
* <p>
* Subscribers to the destroy
* event can invoke preventDefault on the event object, to prevent destruction
* from proceeding.
* </p>
* @method destroy
* @return {Base} A reference to this object
* @chainable
*/
destroy: function() {
/**
* <p>
* Lifecycle event for the destroy phase,
* fired prior to destruction. Invoking the preventDefault
* method on the event object provided to subscribers will
* prevent destruction from proceeding.
* </p>
* <p>
* Subscribers to the "after" moment of this event, will be notified
* after destruction is complete (and as a result cannot prevent
* destruction).
* </p>
* @event destroy
* @preventable _defDestroyFn
* @param {EventFacade} e Event object
*/
this.publish(DESTROY, {
queuable:false,
fireOnce:true,
defaultTargetOnly:true,
defaultFn: this._defDestroyFn
});
this.fire(DESTROY);
this.detachAll();
return this;
},
/**
* Default init event handler
*
* @method _defInitFn
* @param {EventFacade} e Event object, with a cfg property which
* refers to the configuration object passed to the constructor.
* @protected
*/
_defInitFn : function(e) {
this._baseInit(e.cfg);
},
/**
* Default destroy event handler
*
* @method _defDestroyFn
* @param {EventFacade} e Event object
* @protected
*/
_defDestroyFn : function(e) {
this._baseDestroy(e.cfg);
}
};
Y.mix(Base, Attribute, false, null, 1);
Y.mix(Base, BaseCore, false, null, 1);
// Fix constructor
Base.prototype.constructor = Base;
Y.Base = Base;
}, '3.7.3', {"requires": ["base-core", "attribute-base"]});
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("base-build",function(e,t){var n=e.Base,r=e.Lang,i="initializer",s="destructor",o,u=function(e,t,n){n[e]&&(t[e]=(t[e]||[]).concat(n[e]))};n._build=function(t,r,o,u,a,f){var l=n._build,c=l._ctor(r,f),h=l._cfg(r,f,o),p=l._mixCust,d=c._yuibuild.dynamic,v,m,g,y,b,w;for(v=0,m=o.length;v<m;v++)g=o[v],y=g.prototype,b=y[i],w=y[s],delete y[i],delete y[s],e.mix(c,g,!0,null,1),p(c,g,h),b&&(y[i]=b),w&&(y[s]=w),c._yuibuild.exts.push(g);return u&&e.mix(c.prototype,u,!0),a&&(e.mix(c,l._clean(a,h),!0),p(c,a,h)),c.prototype.hasImpl=l._impl,d&&(c.NAME=t,c.prototype.constructor=c),c},o=n._build,e.mix(o,{_mixCust:function(t,n,i){var s,o,u,a,f,l;i&&(s=i.aggregates,o=i.custom,u=i.statics),u&&e.mix(t,n,!0,u);if(s)for(l=0,f=s.length;l<f;l++)a=s[l],!t.hasOwnProperty(a)&&n.hasOwnProperty(a)&&(t[a]=r.isArray(n[a])?[]:{}),e.aggregate(t,n,!0,[a]);if(o)for(l in o)o.hasOwnProperty(l)&&o[l](l,t,n)},_tmpl:function(t){function n(){n.superclass.constructor.apply(this,arguments)}return e.extend(n,t),n},_impl:function(e){var t=this._getClasses(),n,r,i,s,o,u;for(n=0,r=t.length;n<r;n++){i=t[n];if(i._yuibuild){s=i._yuibuild.exts,o=s.length;for(u=0;u<o;u++)if(s[u]===e)return!0}}return!1},_ctor:function(e,t){var n=t&&!1===t.dynamic?!1:!0,r=n?o._tmpl(e):e,i=r._yuibuild;return i||(i=r._yuibuild={}),i.id=i.id||null,i.exts=i.exts||[],i.dynamic=n,r},_cfg:function(t,n,r){var i=[],s={},o=[],u,a=n&&n.aggregates,f=n&&n.custom,l=n&&n.statics,c=t,h,p;while(c&&c.prototype)u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics))),c=c.superclass?c.superclass.constructor:null;if(r)for(h=0,p=r.length;h<p;h++)c=r[h],u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics)));return a&&(i=i.concat(a)),f&&e.mix(s,n.cfgBuild,!0),l&&(o=o.concat(l)),{aggregates:i,custom:s,statics:o}},_clean:function(t,n){var r,i,s,o=e.merge(t),u=n.aggregates,a=n.custom;for(r in a)o.hasOwnProperty(r)&&delete o[r];for(i=0,s=u.length;i<s;i++)r=u[i],o.hasOwnProperty(r)&&delete o[r];return o}}),n.build=function(e,t,n,r){return o(e,t,n,null,null,r)},n.create=function(e,t,n,r,i){return o(e,t,n,r,i)},n.mix=function(e,t){return o(null,e,t,null,null,{dynamic:!1})},n._buildCfg={custom:{ATTRS:function(t,n,r){n.ATTRS=n.ATTRS||{};if(r.ATTRS){var i=r.ATTRS,s=n.ATTRS,o;for(o in i)i.hasOwnProperty(o)&&(s[o]=s[o]||{},e.mix(s[o],i[o],!0))}},_NON_ATTRS_CFG:u},aggregates:["_PLUG","_UNPLUG"]}},"3.7.3",{requires:["base-base"]});
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("base-core",function(e,t){function v(e){this._BaseInvoked||(this._BaseInvoked=!0,this._initBase(e))}var n=e.Object,r=e.Lang,i=".",s="initialized",o="destroyed",u="initializer",a="value",f=Object.prototype.constructor,l="deep",c="shallow",h="destructor",p=e.AttributeCore,d=function(e,t,n){var r;for(r in t)n[r]&&(e[r]=t[r]);return e};v._ATTR_CFG=p._ATTR_CFG.concat("cloneDefaultValue"),v._ATTR_CFG_HASH=e.Array.hash(v._ATTR_CFG),v._NON_ATTRS_CFG=["plugins"],v.NAME="baseCore",v.ATTRS={initialized:{readOnly:!0,value:!1},destroyed:{readOnly:!0,value:!1}},v.prototype={_initBase:function(t){e.stamp(this),this._initAttribute(t);var n=e.Plugin&&e.Plugin.Host;this._initPlugins&&n&&n.call(this),this._lazyAddAttrs!==!1&&(this._lazyAddAttrs=!0),this.name=this.constructor.NAME,this.init.apply(this,arguments)},_initAttribute:function(){p.apply(this)},init:function(e){return this._baseInit(e),this},_baseInit:function(e){this._initHierarchy(e),this._initPlugins&&this._initPlugins(e),this._set(s,!0)},destroy:function(){return this._baseDestroy(),this},_baseDestroy:function(){this._destroyPlugins&&this._destroyPlugins(),this._destroyHierarchy(),this._set(o,!0)},_getClasses:function(){return this._classes||this._initHierarchyData(),this._classes},_getAttrCfgs:function(){return this._attrs||this._initHierarchyData(),this._attrs},_filterAttrCfgs:function(e,t){var n=null,r,i=e.ATTRS;if(i)for(r in i)t[r]&&(n=n||{},n[r]=t[r],t[r]=null);return n},_filterAdHocAttrs:function(e,t){var n,r=this._nonAttrs,i;if(t){n={};for(i in t)!e[i]&&!r[i]&&t.hasOwnProperty(i)&&(n[i]={value:t[i]})}return n},_initHierarchyData:function(){var e=this.constructor,t,n,r,i=this._allowAdHocAttrs?{}:null,s=[],o=[];while(e){s[s.length]=e,e.ATTRS&&(o[o.length]=e.ATTRS);if(this._allowAdHocAttrs){r=e._NON_ATTRS_CFG;if(r)for(t=0,n=r.length;t<n;t++)i[r[t]]=!0}e=e.superclass?e.superclass.constructor:null}this._classes=s,this._nonAttrs=i,this._attrs=this._aggregateAttrs(o)},_attrCfgHash:function(){return v._ATTR_CFG_HASH},_aggregateAttrs:function(t){var s,o,u,h,p,v,m,g=this._attrCfgHash(),y,b={};if(t)for(v=t.length-1;v>=0;--v){o=t[v];for(s in o)o.hasOwnProperty(s)&&(u=d({},o[s],g),h=u.value,m=u.cloneDefaultValue,h&&(m===undefined&&(f===h.constructor||r.isArray(h))||m===l||m===!0?u.value=e.clone(h):m===c&&(u.value=e.merge(h))),p=null,s.indexOf(i)!==-1&&(p=s.split(i),s=p.shift()),y=b[s],p&&y&&y.value?n.setValue(y.value,p,h):p||(y?(y.valueFn&&a in u&&(y.valueFn=null),d(y,u,g)):b[s]=u))}return b},_initHierarchy:function(e){var t=this._lazyAddAttrs,n,r,i,s,o,a,f,l=this._getClasses(),c=this._getAttrCfgs(),h=l.length-1;for(i=h;i>=0;i--){n=l[i],r=n.prototype,f=n._yuibuild&&n._yuibuild.exts;if(f)for(s=0,o=f.length;s<o;s++)f[s].apply(this,arguments);this.addAttrs(this._filterAttrCfgs(n,c),e,t),this._allowAdHocAttrs&&i===h&&this.addAttrs(this._filterAdHocAttrs(c,e),e,t),r.hasOwnProperty(u)&&r.initializer.apply(this,arguments);if(f)for(s=0;s<o;s++)a=f[s].prototype,a.hasOwnProperty(u)&&a.initializer.apply(this,arguments)}},_destroyHierarchy:function(){var e,t,n,r,i,s,o,u,a=this._getClasses();for(n=0,r=a.length;n<r;n++){e=a[n],t=e.prototype,o=e._yuibuild&&e._yuibuild.exts;if(o)for(i=0,s=o.length;i<s;i++)u=o[i].prototype,u.hasOwnProperty(h)&&u.destructor.apply(this,arguments);t.hasOwnProperty(h)&&t.destructor.apply(this,arguments)}},toString:function(){return this.name+"["+e.stamp(this,!0)+"]"}},e.mix(v,p,!1,null,1),v.prototype.constructor=v,e.BaseCore=v},"3.7.3",{requires:["attribute-core"]});
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -1,553 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('calendar', function (Y, NAME) {
/**
* The Calendar component is a UI widget that allows users
* to view dates in a two-dimensional month grid, as well as
* to select one or more dates, or ranges of dates. Calendar
* is generated dynamically and relies on the developer to
* provide for a progressive enhancement alternative.
*
*
* @module calendar
*/
var getCN = Y.ClassNameManager.getClassName,
CALENDAR = 'calendar',
KEY_DOWN = 40,
KEY_UP = 38,
KEY_LEFT = 37,
KEY_RIGHT = 39,
KEY_ENTER = 13,
KEY_SPACE = 32,
CAL_HD = getCN(CALENDAR, 'header'),
CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),
CAL_DAY_HILITED = getCN(CALENDAR, 'day-highlighted'),
CAL_DAY = getCN(CALENDAR, 'day'),
CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),
CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),
CAL_GRID = getCN(CALENDAR, 'grid'),
ydate = Y.DataType.Date,
delegate = Y.delegate,
CAL_PANE = getCN(CALENDAR, 'pane'),
os = Y.UA.os;
/** Create a calendar view to represent a single or multiple
* month range of dates, rendered as a grid with date and
* weekday labels.
*
* @class Calendar
* @extends CalendarBase
* @param config {Object} Configuration object (see Configuration attributes)
* @constructor
*/
function Calendar(config) {
Calendar.superclass.constructor.apply ( this, arguments );
}
Y.Calendar = Y.extend(Calendar, Y.CalendarBase, {
_keyEvents: [],
_highlightedDateNode: null,
/**
* A property tracking the last selected date on the calendar, for the
* purposes of multiple selection.
*
* @property _lastSelectedDate
* @type Date
* @default null
* @private
*/
_lastSelectedDate: null,
/**
* Designated initializer. Activates the navigation plugin for the calendar.
*
* @method initializer
*/
initializer : function () {
this.plug(Y.Plugin.CalendarNavigator);
this._keyEvents = [];
this._highlightedDateNode = null;
this._lastSelectedDate = null;
},
/**
* Overrides the _bindCalendarEvents placeholder in CalendarBase
* and binds calendar events during bindUI stage.
* @method _bindCalendarEvents
* @protected
*/
_bindCalendarEvents : function () {
var contentBox = this.get('contentBox'),
pane = contentBox.one("." + CAL_PANE);
pane.on("selectstart", this._preventSelectionStart);
pane.delegate("click", this._clickCalendar, "." + CAL_DAY + ", ." + CAL_PREVMONTH_DAY + ", ." + CAL_NEXTMONTH_DAY, this);
pane.delegate("keydown", this._keydownCalendar, "." + CAL_GRID, this);
pane.delegate("focus", this._focusCalendarGrid, "." + CAL_GRID, this);
pane.delegate("focus", this._focusCalendarCell, "." + CAL_DAY, this);
pane.delegate("blur", this._blurCalendarGrid, "." + CAL_GRID + ",." + CAL_DAY, this);
},
/**
* Prevents text selection if it is started within the calendar pane
* @method _preventSelectionStart
* @param event {Event} The selectstart event
* @protected
*/
_preventSelectionStart : function (event) {
event.preventDefault();
},
/**
* Highlights a specific date node with keyboard highlight class
* @method _highlightDateNode
* @param oDate {Date} Date corresponding the node to be highlighted
* @protected
*/
_highlightDateNode : function (oDate) {
this._unhighlightCurrentDateNode();
var newNode = this._dateToNode(oDate);
newNode.focus();
newNode.addClass(CAL_DAY_HILITED);
},
/**
* Unhighlights a specific date node currently highlighted with keyboard highlight class
* @method _unhighlightCurrentDateNode
* @protected
*/
_unhighlightCurrentDateNode : function () {
var allHilitedNodes = this.get("contentBox").all("." + CAL_DAY_HILITED);
if (allHilitedNodes) {
allHilitedNodes.removeClass(CAL_DAY_HILITED);
}
},
/**
* Returns the grid number for a specific calendar grid (for multi-grid templates)
* @method _getGridNumber
* @param gridNode {Node} Node corresponding to a specific grid
* @protected
*/
_getGridNumber : function (gridNode) {
var idParts = gridNode.get("id").split("_").reverse();
return parseInt(idParts[0], 10);
},
/**
* Handler for loss of focus of calendar grid
* @method _blurCalendarGrid
* @protected
*/
_blurCalendarGrid : function (ev) {
this._unhighlightCurrentDateNode();
},
/**
* Handler for gain of focus of calendar cell
* @method _focusCalendarCell
* @protected
*/
_focusCalendarCell : function (ev) {
this._highlightedDateNode = ev.target;
ev.stopPropagation();
},
/**
* Handler for gain of focus of calendar grid
* @method _focusCalendarGrid
* @protected
*/
_focusCalendarGrid : function (ev) {
this._unhighlightCurrentDateNode();
this._highlightedDateNode = null;
},
/**
* Handler for keyboard press on a calendar grid
* @method _keydownCalendar
* @protected
*/
_keydownCalendar : function (ev) {
var gridNum = this._getGridNumber(ev.target),
curDate = !this._highlightedDateNode ? null : this._nodeToDate(this._highlightedDateNode),
keyCode = ev.keyCode,
dayNum = 0,
dir = '';
switch(keyCode) {
case KEY_DOWN:
dayNum = 7;
dir = 's';
break;
case KEY_UP:
dayNum = -7;
dir = 'n';
break;
case KEY_LEFT:
dayNum = -1;
dir = 'w';
break;
case KEY_RIGHT:
dayNum = 1;
dir = 'e';
break;
case KEY_SPACE: case KEY_ENTER:
ev.preventDefault();
if (this._highlightedDateNode) {
var selMode = this.get("selectionMode");
if (selMode === "single" && !this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {
this._clearSelection(true);
this._addDateToSelection(curDate);
}
else if (selMode === "multiple" || selMode === "multiple-sticky") {
if (this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {
this._removeDateFromSelection(curDate);
}
else {
this._addDateToSelection(curDate);
}
}
}
break;
}
if (keyCode == KEY_DOWN || keyCode == KEY_UP || keyCode == KEY_LEFT || keyCode == KEY_RIGHT) {
if (!curDate) {
curDate = ydate.addMonths(this.get("date"), gridNum);
dayNum = 0;
}
ev.preventDefault();
var newDate = ydate.addDays(curDate, dayNum),
startDate = this.get("date"),
endDate = ydate.addMonths(this.get("date"), this._paneNumber - 1),
lastPaneDate = new Date(endDate);
endDate.setDate(ydate.daysInMonth(endDate));
if (ydate.isInRange(newDate, startDate, endDate)) {
/*
var paneShift = (newDate.getMonth() - curDate.getMonth()) % 10;
if (paneShift != 0) {
var newGridNum = gridNum + paneShift,
contentBox = this.get('contentBox'),
newPane = contentBox.one("#" + this._calendarId + "_pane_" + newGridNum);
newPane.focus();
}
*/
this._highlightDateNode(newDate);
}
else if (ydate.isGreater(startDate, newDate)) {
if (!ydate.isGreaterOrEqual(this.get("minimumDate"), startDate)) {
this.set("date", ydate.addMonths(startDate, -1));
this._highlightDateNode(newDate);
}
}
else if (ydate.isGreater(newDate, endDate)) {
if (!ydate.isGreaterOrEqual(lastPaneDate, this.get("maximumDate"))) {
this.set("date", ydate.addMonths(startDate, 1));
this._highlightDateNode(newDate);
}
}
}
},
/**
* Handles the calendar clicks based on selection mode.
* @method _clickCalendar
* @param {Event} ev A click event
* @private
*/
_clickCalendar : function (ev) {
var clickedCell = ev.currentTarget,
clickedCellIsDay = clickedCell.hasClass(CAL_DAY) &&
!clickedCell.hasClass(CAL_PREVMONTH_DAY) &&
!clickedCell.hasClass(CAL_NEXTMONTH_DAY),
clickedCellIsSelected = clickedCell.hasClass(CAL_DAY_SELECTED);
switch (this.get("selectionMode")) {
case("single"):
if (clickedCellIsDay) {
if (!clickedCellIsSelected) {
this._clearSelection(true);
this._addDateToSelection(this._nodeToDate(clickedCell));
}
}
break;
case("multiple-sticky"):
if (clickedCellIsDay) {
if (clickedCellIsSelected) {
this._removeDateFromSelection(this._nodeToDate(clickedCell));
}
else {
this._addDateToSelection(this._nodeToDate(clickedCell));
}
}
break;
case("multiple"):
if (clickedCellIsDay) {
if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {
this._clearSelection(true);
this._lastSelectedDate = this._nodeToDate(clickedCell);
this._addDateToSelection(this._lastSelectedDate);
}
else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {
if (clickedCellIsSelected) {
this._removeDateFromSelection(this._nodeToDate(clickedCell));
this._lastSelectedDate = null;
}
else {
this._lastSelectedDate = this._nodeToDate(clickedCell);
this._addDateToSelection(this._lastSelectedDate);
}
}
else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) {
if (this._lastSelectedDate) {
var selectedDate = this._nodeToDate(clickedCell);
this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);
this._lastSelectedDate = selectedDate;
}
else {
this._lastSelectedDate = this._nodeToDate(clickedCell);
this._addDateToSelection(this._lastSelectedDate);
}
}
else if (ev.shiftKey) {
if (this._lastSelectedDate) {
var selectedDate = this._nodeToDate(clickedCell);
this._clearSelection(true);
this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);
this._lastSelectedDate = selectedDate;
}
else {
this._clearSelection(true);
this._lastSelectedDate = this._nodeToDate(clickedCell);
this._addDateToSelection(this._lastSelectedDate);
}
}
}
break;
}
if (clickedCellIsDay) {
/**
* Fired when a specific date cell in the calendar is clicked. The event carries a
* payload which includes a `cell` property corresponding to the node of the actual
* date cell, and a `date` property, with the `Date` that was clicked.
*
* @event dateClick
*/
this.fire("dateClick", {cell: clickedCell, date: this._nodeToDate(clickedCell)});
}
else if (clickedCell.hasClass(CAL_PREVMONTH_DAY)) {
/**
* Fired when any of the previous month's days displayed before the calendar grid
* are clicked.
*
* @event prevMonthClick
*/
this.fire("prevMonthClick");
}
else if (clickedCell.hasClass(CAL_NEXTMONTH_DAY)) {
/**
* Fired when any of the next month's days displayed after the calendar grid
* are clicked.
*
* @event nextMonthClick
*/
this.fire("nextMonthClick");
}
},
/**
* Subtracts one month from the current calendar view.
* @method subtractMonth
*/
subtractMonth : function (e) {
this.set("date", ydate.addMonths(this.get("date"), -1));
if (e) {
e.halt();
}
},
/**
* Subtracts one year from the current calendar view.
* @method subtractYear
*/
subtractYear : function (e) {
this.set("date", ydate.addYears(this.get("date"), -1));
if (e) {
e.halt();
}
},
/**
* Adds one month to the current calendar view.
* @method addMonth
*/
addMonth : function (e) {
this.set("date", ydate.addMonths(this.get("date"), 1));
if (e) {
e.halt();
}
},
/**
* Adds one year to the current calendar view.
* @method addYear
*/
addYear : function (e) {
this.set("date", ydate.addYears(this.get("date"), 1));
if (e) {
e.halt();
}
}
},
{
/**
* The identity of the widget.
*
* @property NAME
* @type String
* @default 'calendar'
* @readOnly
* @protected
* @static
*/
NAME: "calendar",
/**
* Static property used to define the default attribute configuration of
* the Widget.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* A setting specifying the type of selection the calendar allows.
* Possible values include:
* <ul>
* <li>`single` - One date at a time</li>
* <li>`multiple-sticky` - Multiple dates, selected one at a time (the dates "stick"). This option
* is appropriate for mobile devices, where function keys from the keyboard are not available.</li>
* <li>`multiple` - Multiple dates, selected with Ctrl/Meta keys for additional single
* dates, and Shift key for date ranges.</li>
*
* @attribute selectionMode
* @type String
* @default single
*/
selectionMode: {
value: "single"
},
/**
* The date corresponding to the current calendar view. Always
* normalized to the first of the month that contains the date
* at assignment time. Used as the first date visible in the
* calendar.
*
* @attribute date
* @type Date
* @default Today's date as set on the user's computer.
*/
date: {
value: new Date(),
lazyAdd: false,
setter: function (val) {
var newDate = this._normalizeDate(val),
newTopDate = ydate.addMonths(newDate, this._paneNumber - 1);
var minDate = this.get("minimumDate");
var maxDate = this.get("maximumDate");
if ((!minDate || ydate.isGreaterOrEqual(newDate, minDate)) &&
(!maxDate || ydate.isGreaterOrEqual(maxDate, newTopDate))) {
return newDate;
}
else if (minDate && ydate.isGreater(minDate, newDate)) {
return minDate;
}
else if (maxDate && ydate.isGreater(newTopDate, maxDate)) {
var actualMaxDate = ydate.addMonths(maxDate, -1*(this._paneNumber - 1));
return actualMaxDate;
}
}
},
/**
* The minimum date that can be displayed by the calendar. The calendar will not
* allow dates earlier than this one to be set, and will reset any earlier date to
* this date. Should be `null` if no minimum date is needed.
*
* @attribute minimumDate
* @type Date
* @default null
*/
minimumDate: {
value: null,
setter: function (val) {
if (val) {
var curDate = this.get('date'),
newMinDate = this._normalizeDate(val);
if (curDate && !ydate.isGreaterOrEqual(curDate, newMinDate)) {
this.set('date', newMinDate);
}
return newMinDate;
}
else {
return this._normalizeDate(val);
}
}
},
/**
* The maximum date that can be displayed by the calendar. The calendar will not
* allow dates later than this one to be set, and will reset any later date to
* this date. Should be `null` if no maximum date is needed.
*
* @attribute maximumDate
* @type Date
* @default null
*/
maximumDate: {
value: null,
setter: function (val) {
if (val) {
var curDate = this.get('date'),
newMaxDate = this._normalizeDate(val);
if (curDate && !ydate.isGreaterOrEqual(val, ydate.addMonths(curDate, this._paneNumber - 1))) {
this.set('date', ydate.addMonths(newMaxDate, -1*(this._paneNumber -1)));
}
return newMaxDate;
}
else {
return val;
}
}
}
}
});
}, '3.7.3', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
File diff suppressed because one or more lines are too long
-553
View File
@@ -1,553 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('calendar', function (Y, NAME) {
/**
* The Calendar component is a UI widget that allows users
* to view dates in a two-dimensional month grid, as well as
* to select one or more dates, or ranges of dates. Calendar
* is generated dynamically and relies on the developer to
* provide for a progressive enhancement alternative.
*
*
* @module calendar
*/
var getCN = Y.ClassNameManager.getClassName,
CALENDAR = 'calendar',
KEY_DOWN = 40,
KEY_UP = 38,
KEY_LEFT = 37,
KEY_RIGHT = 39,
KEY_ENTER = 13,
KEY_SPACE = 32,
CAL_HD = getCN(CALENDAR, 'header'),
CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),
CAL_DAY_HILITED = getCN(CALENDAR, 'day-highlighted'),
CAL_DAY = getCN(CALENDAR, 'day'),
CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),
CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),
CAL_GRID = getCN(CALENDAR, 'grid'),
ydate = Y.DataType.Date,
delegate = Y.delegate,
CAL_PANE = getCN(CALENDAR, 'pane'),
os = Y.UA.os;
/** Create a calendar view to represent a single or multiple
* month range of dates, rendered as a grid with date and
* weekday labels.
*
* @class Calendar
* @extends CalendarBase
* @param config {Object} Configuration object (see Configuration attributes)
* @constructor
*/
function Calendar(config) {
Calendar.superclass.constructor.apply ( this, arguments );
}
Y.Calendar = Y.extend(Calendar, Y.CalendarBase, {
_keyEvents: [],
_highlightedDateNode: null,
/**
* A property tracking the last selected date on the calendar, for the
* purposes of multiple selection.
*
* @property _lastSelectedDate
* @type Date
* @default null
* @private
*/
_lastSelectedDate: null,
/**
* Designated initializer. Activates the navigation plugin for the calendar.
*
* @method initializer
*/
initializer : function () {
this.plug(Y.Plugin.CalendarNavigator);
this._keyEvents = [];
this._highlightedDateNode = null;
this._lastSelectedDate = null;
},
/**
* Overrides the _bindCalendarEvents placeholder in CalendarBase
* and binds calendar events during bindUI stage.
* @method _bindCalendarEvents
* @protected
*/
_bindCalendarEvents : function () {
var contentBox = this.get('contentBox'),
pane = contentBox.one("." + CAL_PANE);
pane.on("selectstart", this._preventSelectionStart);
pane.delegate("click", this._clickCalendar, "." + CAL_DAY + ", ." + CAL_PREVMONTH_DAY + ", ." + CAL_NEXTMONTH_DAY, this);
pane.delegate("keydown", this._keydownCalendar, "." + CAL_GRID, this);
pane.delegate("focus", this._focusCalendarGrid, "." + CAL_GRID, this);
pane.delegate("focus", this._focusCalendarCell, "." + CAL_DAY, this);
pane.delegate("blur", this._blurCalendarGrid, "." + CAL_GRID + ",." + CAL_DAY, this);
},
/**
* Prevents text selection if it is started within the calendar pane
* @method _preventSelectionStart
* @param event {Event} The selectstart event
* @protected
*/
_preventSelectionStart : function (event) {
event.preventDefault();
},
/**
* Highlights a specific date node with keyboard highlight class
* @method _highlightDateNode
* @param oDate {Date} Date corresponding the node to be highlighted
* @protected
*/
_highlightDateNode : function (oDate) {
this._unhighlightCurrentDateNode();
var newNode = this._dateToNode(oDate);
newNode.focus();
newNode.addClass(CAL_DAY_HILITED);
},
/**
* Unhighlights a specific date node currently highlighted with keyboard highlight class
* @method _unhighlightCurrentDateNode
* @protected
*/
_unhighlightCurrentDateNode : function () {
var allHilitedNodes = this.get("contentBox").all("." + CAL_DAY_HILITED);
if (allHilitedNodes) {
allHilitedNodes.removeClass(CAL_DAY_HILITED);
}
},
/**
* Returns the grid number for a specific calendar grid (for multi-grid templates)
* @method _getGridNumber
* @param gridNode {Node} Node corresponding to a specific grid
* @protected
*/
_getGridNumber : function (gridNode) {
var idParts = gridNode.get("id").split("_").reverse();
return parseInt(idParts[0], 10);
},
/**
* Handler for loss of focus of calendar grid
* @method _blurCalendarGrid
* @protected
*/
_blurCalendarGrid : function (ev) {
this._unhighlightCurrentDateNode();
},
/**
* Handler for gain of focus of calendar cell
* @method _focusCalendarCell
* @protected
*/
_focusCalendarCell : function (ev) {
this._highlightedDateNode = ev.target;
ev.stopPropagation();
},
/**
* Handler for gain of focus of calendar grid
* @method _focusCalendarGrid
* @protected
*/
_focusCalendarGrid : function (ev) {
this._unhighlightCurrentDateNode();
this._highlightedDateNode = null;
},
/**
* Handler for keyboard press on a calendar grid
* @method _keydownCalendar
* @protected
*/
_keydownCalendar : function (ev) {
var gridNum = this._getGridNumber(ev.target),
curDate = !this._highlightedDateNode ? null : this._nodeToDate(this._highlightedDateNode),
keyCode = ev.keyCode,
dayNum = 0,
dir = '';
switch(keyCode) {
case KEY_DOWN:
dayNum = 7;
dir = 's';
break;
case KEY_UP:
dayNum = -7;
dir = 'n';
break;
case KEY_LEFT:
dayNum = -1;
dir = 'w';
break;
case KEY_RIGHT:
dayNum = 1;
dir = 'e';
break;
case KEY_SPACE: case KEY_ENTER:
ev.preventDefault();
if (this._highlightedDateNode) {
var selMode = this.get("selectionMode");
if (selMode === "single" && !this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {
this._clearSelection(true);
this._addDateToSelection(curDate);
}
else if (selMode === "multiple" || selMode === "multiple-sticky") {
if (this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {
this._removeDateFromSelection(curDate);
}
else {
this._addDateToSelection(curDate);
}
}
}
break;
}
if (keyCode == KEY_DOWN || keyCode == KEY_UP || keyCode == KEY_LEFT || keyCode == KEY_RIGHT) {
if (!curDate) {
curDate = ydate.addMonths(this.get("date"), gridNum);
dayNum = 0;
}
ev.preventDefault();
var newDate = ydate.addDays(curDate, dayNum),
startDate = this.get("date"),
endDate = ydate.addMonths(this.get("date"), this._paneNumber - 1),
lastPaneDate = new Date(endDate);
endDate.setDate(ydate.daysInMonth(endDate));
if (ydate.isInRange(newDate, startDate, endDate)) {
/*
var paneShift = (newDate.getMonth() - curDate.getMonth()) % 10;
if (paneShift != 0) {
var newGridNum = gridNum + paneShift,
contentBox = this.get('contentBox'),
newPane = contentBox.one("#" + this._calendarId + "_pane_" + newGridNum);
newPane.focus();
}
*/
this._highlightDateNode(newDate);
}
else if (ydate.isGreater(startDate, newDate)) {
if (!ydate.isGreaterOrEqual(this.get("minimumDate"), startDate)) {
this.set("date", ydate.addMonths(startDate, -1));
this._highlightDateNode(newDate);
}
}
else if (ydate.isGreater(newDate, endDate)) {
if (!ydate.isGreaterOrEqual(lastPaneDate, this.get("maximumDate"))) {
this.set("date", ydate.addMonths(startDate, 1));
this._highlightDateNode(newDate);
}
}
}
},
/**
* Handles the calendar clicks based on selection mode.
* @method _clickCalendar
* @param {Event} ev A click event
* @private
*/
_clickCalendar : function (ev) {
var clickedCell = ev.currentTarget,
clickedCellIsDay = clickedCell.hasClass(CAL_DAY) &&
!clickedCell.hasClass(CAL_PREVMONTH_DAY) &&
!clickedCell.hasClass(CAL_NEXTMONTH_DAY),
clickedCellIsSelected = clickedCell.hasClass(CAL_DAY_SELECTED);
switch (this.get("selectionMode")) {
case("single"):
if (clickedCellIsDay) {
if (!clickedCellIsSelected) {
this._clearSelection(true);
this._addDateToSelection(this._nodeToDate(clickedCell));
}
}
break;
case("multiple-sticky"):
if (clickedCellIsDay) {
if (clickedCellIsSelected) {
this._removeDateFromSelection(this._nodeToDate(clickedCell));
}
else {
this._addDateToSelection(this._nodeToDate(clickedCell));
}
}
break;
case("multiple"):
if (clickedCellIsDay) {
if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {
this._clearSelection(true);
this._lastSelectedDate = this._nodeToDate(clickedCell);
this._addDateToSelection(this._lastSelectedDate);
}
else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {
if (clickedCellIsSelected) {
this._removeDateFromSelection(this._nodeToDate(clickedCell));
this._lastSelectedDate = null;
}
else {
this._lastSelectedDate = this._nodeToDate(clickedCell);
this._addDateToSelection(this._lastSelectedDate);
}
}
else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) {
if (this._lastSelectedDate) {
var selectedDate = this._nodeToDate(clickedCell);
this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);
this._lastSelectedDate = selectedDate;
}
else {
this._lastSelectedDate = this._nodeToDate(clickedCell);
this._addDateToSelection(this._lastSelectedDate);
}
}
else if (ev.shiftKey) {
if (this._lastSelectedDate) {
var selectedDate = this._nodeToDate(clickedCell);
this._clearSelection(true);
this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);
this._lastSelectedDate = selectedDate;
}
else {
this._clearSelection(true);
this._lastSelectedDate = this._nodeToDate(clickedCell);
this._addDateToSelection(this._lastSelectedDate);
}
}
}
break;
}
if (clickedCellIsDay) {
/**
* Fired when a specific date cell in the calendar is clicked. The event carries a
* payload which includes a `cell` property corresponding to the node of the actual
* date cell, and a `date` property, with the `Date` that was clicked.
*
* @event dateClick
*/
this.fire("dateClick", {cell: clickedCell, date: this._nodeToDate(clickedCell)});
}
else if (clickedCell.hasClass(CAL_PREVMONTH_DAY)) {
/**
* Fired when any of the previous month's days displayed before the calendar grid
* are clicked.
*
* @event prevMonthClick
*/
this.fire("prevMonthClick");
}
else if (clickedCell.hasClass(CAL_NEXTMONTH_DAY)) {
/**
* Fired when any of the next month's days displayed after the calendar grid
* are clicked.
*
* @event nextMonthClick
*/
this.fire("nextMonthClick");
}
},
/**
* Subtracts one month from the current calendar view.
* @method subtractMonth
*/
subtractMonth : function (e) {
this.set("date", ydate.addMonths(this.get("date"), -1));
if (e) {
e.halt();
}
},
/**
* Subtracts one year from the current calendar view.
* @method subtractYear
*/
subtractYear : function (e) {
this.set("date", ydate.addYears(this.get("date"), -1));
if (e) {
e.halt();
}
},
/**
* Adds one month to the current calendar view.
* @method addMonth
*/
addMonth : function (e) {
this.set("date", ydate.addMonths(this.get("date"), 1));
if (e) {
e.halt();
}
},
/**
* Adds one year to the current calendar view.
* @method addYear
*/
addYear : function (e) {
this.set("date", ydate.addYears(this.get("date"), 1));
if (e) {
e.halt();
}
}
},
{
/**
* The identity of the widget.
*
* @property NAME
* @type String
* @default 'calendar'
* @readOnly
* @protected
* @static
*/
NAME: "calendar",
/**
* Static property used to define the default attribute configuration of
* the Widget.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* A setting specifying the type of selection the calendar allows.
* Possible values include:
* <ul>
* <li>`single` - One date at a time</li>
* <li>`multiple-sticky` - Multiple dates, selected one at a time (the dates "stick"). This option
* is appropriate for mobile devices, where function keys from the keyboard are not available.</li>
* <li>`multiple` - Multiple dates, selected with Ctrl/Meta keys for additional single
* dates, and Shift key for date ranges.</li>
*
* @attribute selectionMode
* @type String
* @default single
*/
selectionMode: {
value: "single"
},
/**
* The date corresponding to the current calendar view. Always
* normalized to the first of the month that contains the date
* at assignment time. Used as the first date visible in the
* calendar.
*
* @attribute date
* @type Date
* @default Today's date as set on the user's computer.
*/
date: {
value: new Date(),
lazyAdd: false,
setter: function (val) {
var newDate = this._normalizeDate(val),
newTopDate = ydate.addMonths(newDate, this._paneNumber - 1);
var minDate = this.get("minimumDate");
var maxDate = this.get("maximumDate");
if ((!minDate || ydate.isGreaterOrEqual(newDate, minDate)) &&
(!maxDate || ydate.isGreaterOrEqual(maxDate, newTopDate))) {
return newDate;
}
else if (minDate && ydate.isGreater(minDate, newDate)) {
return minDate;
}
else if (maxDate && ydate.isGreater(newTopDate, maxDate)) {
var actualMaxDate = ydate.addMonths(maxDate, -1*(this._paneNumber - 1));
return actualMaxDate;
}
}
},
/**
* The minimum date that can be displayed by the calendar. The calendar will not
* allow dates earlier than this one to be set, and will reset any earlier date to
* this date. Should be `null` if no minimum date is needed.
*
* @attribute minimumDate
* @type Date
* @default null
*/
minimumDate: {
value: null,
setter: function (val) {
if (val) {
var curDate = this.get('date'),
newMinDate = this._normalizeDate(val);
if (curDate && !ydate.isGreaterOrEqual(curDate, newMinDate)) {
this.set('date', newMinDate);
}
return newMinDate;
}
else {
return this._normalizeDate(val);
}
}
},
/**
* The maximum date that can be displayed by the calendar. The calendar will not
* allow dates later than this one to be set, and will reset any later date to
* this date. Should be `null` if no maximum date is needed.
*
* @attribute maximumDate
* @type Date
* @default null
*/
maximumDate: {
value: null,
setter: function (val) {
if (val) {
var curDate = this.get('date'),
newMaxDate = this._normalizeDate(val);
if (curDate && !ydate.isGreaterOrEqual(val, ydate.addMonths(curDate, this._paneNumber - 1))) {
this.set('date', ydate.addMonths(newMaxDate, -1*(this._paneNumber -1)));
}
return newMaxDate;
}
else {
return val;
}
}
}
}
});
}, '3.7.3', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("calendarnavigator",function(e,t){function m(e){m.superclass.constructor.apply(this,arguments)}var n="contentBox",r="host",i="rendered",s=e.ClassNameManager.getClassName,o=e.substitute,u=e.Node,a=u.create,f="calendar",l="calendarnav",c=s(f,"header"),h=s(l,"prevmonth"),p=s(l,"nextmonth"),d=s(l,"month-disabled"),v=e.DataType.Date;m.NS="navigator",m.NAME="pluginCalendarNavigator",m.ATTRS={shiftByMonths:{value:1}},m.CALENDARNAV_STRINGS={prev_month_class:h,next_month_class:p},m.PREV_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {prev_month_class}" role="button" aria-label="{prev_month_arialabel}" tabindex="{control_tabindex}"><span>&lt;</span></a>',m.NEXT_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {next_month_class}" role="button" aria-label="{next_month_arialabel}" tabindex="{control_tabindex}"><span>&gt;</span></a>',e.extend(m,e.Plugin.Base,{_eventAttachments:{},_controls:{},initializer:function(e){this._controls={},this._eventAttachments={},this.afterHostMethod("renderUI",this._initNavigationControls)},destructor:function(){},_focusNavigation:function(e){e.currentTarget.focus()},_subtractMonths:function(e){if(e.type==="click"||e.type==="keydown"&&(e.keyCode==13||e.keyCode==32)){var t=this.get(r),n=t.get("date");t.set("date",v.addMonths(n,-1*this.get("shiftByMonths"))),e.preventDefault()}},_addMonths:function(e){if(e.type==="click"||e.type==="keydown"&&(e.keyCode==13||e.keyCode==32)){var t=this.get(r),n=t.get("date");t.set("date",v.addMonths(n,this.get("shiftByMonths"))),e.preventDefault()}},_updateControlState:function(){var e=this.get(r);v.areEqual(e.get("minimumDate"),e.get("date"))?(this._eventAttachments.prevMonth&&(this._eventAttachments.prevMonth.detach(),this._eventAttachments.prevMonth=!1),this._controls.prevMonth.hasClass(d)||this._controls.prevMonth.addClass(d).setAttribute("aria-disabled","true")):(this._eventAttachments.prevMonth||(this._eventAttachments.prevMonth=this._controls.prevMonth.on(["click","keydown"],this._subtractMonths,this)),this._controls.prevMonth.hasClass(d)&&this._controls.prevMonth.removeClass(d).setAttribute("aria-disabled","false")),v.areEqual(e.get("maximumDate"),v.addMonths(e.get("date"),e._paneNumber-1))?(this._eventAttachments.nextMonth&&(this._eventAttachments.nextMonth.detach(),this._eventAttachments.nextMonth=!1),this._controls.nextMonth.hasClass(d)||this._controls.nextMonth.addClass(d).setAttribute("aria-disabled","true")):(this._eventAttachments.nextMonth||(this._eventAttachments.nextMonth=this._controls.nextMonth.on(["click","keydown"],this._addMonths,this)),this._controls.nextMonth.hasClass(d)&&this._controls.nextMonth.removeClass(d).setAttribute("aria-disabled","false")),this._controls.prevMonth.on(["click","keydown"],this._focusNavigation,this),this._controls.nextMonth.on(["click","keydown"],this._focusNavigation,this)},_renderPrevControls:function(){var e=a(o(m.PREV_MONTH_CONTROL_TEMPLATE,m.CALENDARNAV_STRINGS));return e.on("selectstart",this.get(r)._preventSelectionStart),e},_renderNextControls:function(){var e=a(o(m.NEXT_MONTH_CONTROL_TEMPLATE,m.CALENDARNAV_STRINGS));return e.on("selectstart",this.get(r)._preventSelectionStart),e},_initNavigationControls:function(){var e=this.get(r);m.CALENDARNAV_STRINGS.control_tabindex=e.get("tabIndex"),m.CALENDARNAV_STRINGS.prev_month_arialabel="Go to previous month",m.CALENDARNAV_STRINGS.next_month_arialabel="Go to next month";var t=e.get(n).one("."+c);this._controls.prevMonth=this._renderPrevControls(),this._controls.nextMonth=this._renderNextControls(),this._updateControlState(),e.after("dateChange",this._updateControlState,this),t.prepend(this._controls.prevMonth),t.append(this._controls.nextMonth)}}),e.namespace("Plugin").CalendarNavigator=m},"3.7.3",{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0});
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("cookie",function(e,t){function h(e){throw new TypeError(e)}function p(e){(!s(e)||e==="")&&h("Cookie name must be a non-empty string.")}function d(e){(!s(e)||e==="")&&h("Subcookie name must be a non-empty string.")}var n=e.Lang,r=e.Object,i=null,s=n.isString,o=n.isObject,u=n.isUndefined,a=n.isFunction,f=encodeURIComponent,l=decodeURIComponent,c=e.config.doc;e.Cookie={_createCookieString:function(e,t,n,r){r=r||{};var i=f(e)+"="+(n?f(t):t),u=r.expires,a=r.path,l=r.domain;return o(r)&&(u instanceof Date&&(i+="; expires="+u.toUTCString()),s(a)&&a!==""&&(i+="; path="+a),s(l)&&l!==""&&(i+="; domain="+l),r.secure===!0&&(i+="; secure")),i},_createCookieHashString:function(e){o(e)||h("Cookie._createCookieHashString(): Argument must be an object.");var t=[];return r.each(e,function(e,n){!a(e)&&!u(e)&&t.push(f(n)+"="+f(String(e)))}),t.join("&")},_parseCookieHash:function(e){var t=e.split("&"),n=i,r={};if(e.length)for(var s=0,o=t.length;s<o;s++)n=t[s].split("="),r[l(n[0])]=l(n[1]);return r},_parseCookieString:function(e,t){var n={};if(s(e)&&e.length>0){var r=t===!1?function(e){return e}:l,o=e.split(/;\s/g),u=i,a=i,f=i;for(var c=0,h=o.length;c<h;c++){f=o[c].match(/([^=]+)=/i);if(f instanceof Array)try{u=l(f[1]),a=r(o[c].substring(f[1].length+1))}catch(p){}else u=l(o[c]),a="";n[u]=a}}return n},_setDoc:function(e){c=e},exists:function(e){p(e);var t=this._parseCookieString(c.cookie,!0);return t.hasOwnProperty(e)},get:function(e,t){p(e);var n,r,s;return a(t)?(s=t,t={}):o(t)?s=t.converter:t={},n=this._parseCookieString(c.cookie,!t.raw),r=n[e],u(r)?i:a(s)?s(r):r},getSub:function(e,t,n){var r=this.getSubs(e);return r!==i?(d(t),u(r[t])?i:a(n)?n(r[t]):r[t]):i},getSubs:function(e){p(e);var t=this._parseCookieString(c.cookie,!1);return s(t[e])?this._parseCookieHash(t[e]):i},remove:function(t,n){return p(t),n=e.merge(n||{},{expires:new Date(0)}),this.set(t,"",n)},removeSub:function(e,t,n){p(e),d(t),n=n||{};var r=this.getSubs(e);if(o(r)&&r.hasOwnProperty(t)){delete r[t];if(!n.removeIfEmpty)return this.setSubs(e,r,n);for(var i in r)if(r.hasOwnProperty(i)&&!a(r[i])&&!u(r[i]))return this.setSubs(e,r,n);return this.remove(e,n)}return""},set:function(e,t,n){p(e),u(t)&&h("Cookie.set(): Value cannot be undefined."),n=n||{};var r=this._createCookieString(e,t,!n.raw,n);return c.cookie=r,r},setSub:function(e,t,n,r){p(e),d(t),u(n)&&h("Cookie.setSub(): Subcookie value cannot be undefined.");var i=this.getSubs(e);return o(i)||(i={}),i[t]=n,this.setSubs(e,i,r)},setSubs:function(e,t,n){p(e),o(t)||h("Cookie.setSubs(): Cookie value must be an object.");var r=this._createCookieString(e,this._createCookieHashString(t),!1,n);return c.cookie=r,r}}},"3.7.3",{requires:["yui-base"]});
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("datatable-head",function(e,t){var n=e.Lang,r=n.sub,i=n.isArray,s=e.Array;e.namespace("DataTable").HeaderView=e.Base.create("tableHeader",e.View,[],{CELL_TEMPLATE:'<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}>{content}</th>',ROW_TEMPLATE:"<tr>{content}</tr>",THEAD_TEMPLATE:'<thead class="{className}"></thead>',getClassName:function(){var t=this.host,n=t&&t.constructor.NAME||this.constructor.NAME;return t&&t.getClassName?t.getClassName.apply(t,arguments):e.ClassNameManager.getClassName.apply(e.ClassNameManager,[n].concat(s(arguments,0,!0)))},render:function(){var t=this.get("container"),n=this.theadNode||(this.theadNode=this._createTHeadNode()),i=this.columns,s={_colspan:1,_rowspan:1,abbr:""},o,u,a,f,l,c,h,p;if(n&&i){c="";if(i.length)for(o=0,u=i.length;o<u;++o){h="";for(a=0,f=i[o].length;a<f;++a)l=i[o][a],p=e.merge(s,l,{className:this.getClassName("header"),content:l.label||l.key||"Column "+(a+1)}),p._id=l._id?' data-yui3-col-id="'+l._id+'"':"",l.abbr&&(p.abbr=' abbr="'+l.abbr+'"'),l.className&&(p.className+=" "+l.className),l._first&&(p.className+=" "+this.getClassName("first","header")),l._id&&(p.className+=" "+this.getClassName("col",l._id)),h+=r(l.headerTemplate||this.CELL_TEMPLATE,p);c+=r(this.ROW_TEMPLATE,{content:h})}n.setHTML(c),n.get("parentNode")!==t&&t.insertBefore(n,t.one("tfoot, tbody"))}return this.bindUI(),this},_afterColumnsChange:function(e){this.columns=this._parseColumns(e.newVal),this.render()},bindUI:function(){this._eventHandles.columnsChange||(this._eventHandles.columnsChange=this.after("columnsChange",e.bind("_afterColumnsChange",this)))},_createTHeadNode:function(){return e.Node.create(r(this.THEAD_TEMPLATE,{className:this.getClassName("columns")}))},destructor:function(){(new e.EventHandle(e.Object.values(this._eventHandles))).detach()},initializer:function(e){this.host=e.host,this.columns=this._parseColumns(e.columns),this._eventHandles=[]},_parseColumns:function(t){var n=[],r=[],s=1,o,u,a,f,l,c,h,p;if(i(t)&&t.length){t=t.slice(),r.push([t,-1]);while(r.length){o=r[r.length-1],u=o[0],c=o[1]+1;for(h=u.length;c<h;++c){u[c]=a=e.merge(u[c]),f=a.children,e.stamp(a),a.id||(a.id=e.guid());if(i(f)&&f.length){r.push([f,-1]),o[1]=c,s=Math.max(s,r.length);break}a._colspan=1}if(c>=h){if(r.length>1){o=r[r.length-2],l=o[0][o[1]],l._colspan=0;for(c=0,h=u.length;c<h;++c)u[c]._parent=l,l._colspan+=u[c]._colspan}r.pop()}}for(c=0;c<s;++c)n.push([]);r.push([t,-1]);while(r.length){o=r[r.length-1],u=o[0],c=o[1]+1;for(h=u.length;c<h;++c){a=u[c],f=a.children,n[r.length-1].push(a),o[1]=c,a._headers=[a.id];for(p=r.length-2;p>=0;--p)l=r[p][0][r[p][1]],a._headers.unshift(l.id);if(f&&f.length){r.push([f,-1]);break}a._rowspan=s-r.length+1}c>=h&&r.pop()}}for(c=0,h=n.length;c<h;c+=a._rowspan)a=n[c][0],a._first=!0;return n}})},"3.7.3",{requires:["datatable-core","view","classnamemanager"]});
@@ -1,55 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('datatype-date-parse', function (Y, NAME) {
/**
* Parse number submodule.
*
* @module datatype-date
* @submodule datatype-date-parse
* @for Date
*/
var LANG = Y.Lang;
Y.mix(Y.namespace("Date"), {
/**
* Converts data to type Date.
*
* @method parse
* @param data {String | Number} Data to convert. Values supported by the Date constructor are supported.
* @return {Date} A Date, or null.
*/
parse: function(data) {
var date = null;
//Convert to date
if(!(LANG.isDate(data))) {
date = new Date(data);
}
else {
return date;
}
// Validate
if(LANG.isDate(date) && (date != "Invalid Date") && !isNaN(date)) { // Workaround for bug 2527965
return date;
}
else {
Y.log("Could not convert data to type Date", "warn", "date");
return null;
}
}
});
// Add Parsers shortcut
Y.namespace("Parsers").date = Y.Date.parse;
Y.namespace("DataType");
Y.DataType.Date = Y.Date;
}, '3.7.3');
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("datatype-date-parse",function(e,t){var n=e.Lang;e.mix(e.namespace("Date"),{parse:function(e){var t=null;return n.isDate(e)?t:(t=new Date(e),n.isDate(t)&&t!="Invalid Date"&&!isNaN(t)?t:null)}}),e.namespace("Parsers").date=e.Date.parse,e.namespace("DataType"),e.DataType.Date=e.Date},"3.7.3");
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("dd-constrain",function(e,t){var n="dragNode",r="offsetHeight",i="offsetWidth",s="host",o="tickXArray",u="tickYArray",a=e.DD.DDM,f="top",l="right",c="bottom",h="left",p="view",d=null,v="drag:tickAlignX",m="drag:tickAlignY",g=function(){this._lazyAddAttrs=!1,g.superclass.constructor.apply(this,arguments)};g.NAME="ddConstrained",g.NS="con",g.ATTRS={host:{},stickX:{value:!1},stickY:{value:!1},tickX:{value:!1},tickY:{value:!1},tickXArray:{value:!1},tickYArray:{value:!1},gutter:{value:"0",setter:function(t){return e.DD.DDM.cssSizestoObject(t)}},constrain:{value:p,setter:function(t){var n=e.one(t);return n&&(t=n),t}},constrain2region:{setter:function(e){return this.set("constrain",e)}},constrain2node:{setter:function(t){return this.set("constrain",e.one(t))}},constrain2view:{setter:function(){return this.set("constrain",p)}},cacheRegion:{value:!0}},d={_lastTickXFired:null,_lastTickYFired:null,initializer:function(){this._createEvents(),this._eventHandles=[this.get(s).on("drag:end",e.bind(this._handleEnd,this)),this.get(s).on("drag:start",e.bind(this._handleStart,this)),this.get(s).after("drag:align",e.bind(this.align,this)),this.get(s).after("drag:drag",e.bind(this.drag,this))]},destructor:function(){e.each(this._eventHandles,function(e){e.detach()}),this._eventHandles.length=0},_createEvents:function(){var t=[v,m];e.each(t,function(e){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,queuable:!1,prefix:"drag"})},this)},_handleEnd:function(){this._lastTickYFired=null,this._lastTickXFired=null},_handleStart:function(){this.resetCache()},_regionCache:null,_cacheRegion:function(){this._regionCache=this.get("constrain").get("region")},resetCache:function(){this._regionCache=null},_getConstraint:function(){var t=this.get("constrain"),r=this.get("gutter"),i;t&&(t instanceof e.Node?(this._regionCache||(this._eventHandles.push(e.on("resize",e.bind(this._cacheRegion,this),e.config.win)),this._cacheRegion()),i=e.clone(this._regionCache),this.get("cacheRegion")||this.resetCache()):e.Lang.isObject(t)&&(i=e.clone(t)));if(!t||!i)t=p;return t===p&&(i=this.get(s).get(n).get("viewportRegion")),e.each(r,function(e,t){t===l||t===c?i[t]-=e:i[t]+=e}),i},getRegion:function(e){var t={},o=null,u=null,a=this.get(s);return t=this._getConstraint(),e&&(o=a.get(n).get(r),u=a.get(n).get(i),t[l]=t[l]-u,t[c]=t[c]-o),t},_checkRegion:function(e){var t=e,o=this.getRegion(),u=this.get(s),a=u.get(n).get(r),p=u.get(n).get(i);return t[1]>o[c]-a&&(e[1]=o[c]-a),o[f]>t[1]&&(e[1]=o[f]),t[0]>o[l]-p&&(e[0]=o[l]-p),o[h]>t[0]&&(e[0]=o[h]),e},inRegion:function(e){e=e||this.get(s).get(n).getXY();var t=this._checkRegion([e[0],e[1]]),r=!1;return e[0]===t[0]&&e[1]===t[1]&&(r=!0),r},align:function(){var e=this.get(s),t=[e.actXY[0],e.actXY[1]],n=this.getRegion(!0);this.get("stickX")&&(t[1]=e.startXY[1]-e.deltaXY[1]),this.get("stickY")&&(t[0]=e.startXY[0]-e.deltaXY[0]),n&&(t=this._checkRegion(t)),t=this._checkTicks(t,n),e.actXY=t},drag:function(){var t=this.get(s),n=this.get("tickX"),r=this.get("tickY"),i=[t.actXY[0],t.actXY[1]];(e.Lang.isNumber(n)||this.get(o))&&this._lastTickXFired!==i[0]&&(this._tickAlignX(),this._lastTickXFired=i[0]),(e.Lang.isNumber(r)||this.get(u))&&this._lastTickYFired!==i[1]&&(this._tickAlignY(),this._lastTickYFired=i[1])},_checkTicks:function(e,t){var n=this.get(s),r=n.startXY[0]-n.deltaXY[0],i=n.startXY[1]-n.deltaXY[1],p=this.get("tickX"),d=this.get("tickY");return p&&!this.get(o)&&(e[0]=a._calcTicks(e[0],r,p,t[h],t[l])),d&&!this.get(u)&&(e[1]=a._calcTicks(e[1],i,d,t[f],t[c])),this.get(o)&&(e[0]=a._calcTickArray(e[0],this.get(o),t[h],t[l])),this.get(u)&&(e[1]=a._calcTickArray(e[1],this.get(u),t[f],t[c])),e},_tickAlignX:function(){this.fire(v)},_tickAlignY:function(){this.fire(m)}},e.namespace("Plugin"),e.extend(g,e.Base,d),e.Plugin.DDConstrained=g,e.mix(a,{_calcTicks:function(e,t,n,r,i){var s=(e-t)/n,o=Math.floor(s),u=Math.ceil(s);return(o!==0||u!==0)&&s>=o&&s<=u&&(e=t+n*o,r&&i&&(e<r&&(e=t+n*(o+1)),e>i&&(e=t+n*(o-1)))),e},_calcTickArray:function(e,t,n,r){var i=0,s=t.length,o=0,u,a,f;if(!t||t.length===0)return e;if(t[0]>=e)return t[0];for(i=0;i<s;i++){o=i+1;if(t[o]&&t[o]>=e)return u=e-t[i],a=t[o]-e,f=a>u?t[i]:t[o],n&&r&&f>r&&(t[i]?f=t[i]:f=t[s-1]),f}return t[t.length-1]}})},"3.7.3",{requires:["dd-drag"]});
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("dd-ddm-base",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};n.NAME="ddm",n.ATTRS={dragCursor:{value:"move"},clickPixelThresh:{value:3},clickTimeThresh:{value:1e3},throttleTime:{value:-1},dragMode:{value:"point",setter:function(e){return this._setDragMode(e),e}}},e.extend(n,e.Base,{_createPG:function(){},_active:null,_setDragMode:function(t){t===null&&(t=e.DD.DDM.get("dragMode"));switch(t){case 1:case"intersect":return 1;case 2:case"strict":return 2;case 0:case"point":return 0}return 0},CSS_PREFIX:e.ClassNameManager.getClassName("dd"),_activateTargets:function(){},_drags:[],activeDrag:!1,_regDrag:function(e){return this.getDrag(e.get("node"))?!1:(this._active||this._setupListeners(),this._drags.push(e),!0)},_unregDrag:function(t){var n=[];e.each(this._drags,function(e){e!==t&&(n[n.length]=e)}),this._drags=n},_setupListeners:function(){this._createPG(),this._active=!0;var t=e.one(e.config.doc);t.on("mousemove",e.throttle(e.bind(this._docMove,this),this.get("throttleTime"))),t.on("mouseup",e.bind(this._end,this))},_start:function(){this.fire("ddm:start"),this._startDrag()},_startDrag:function(){},_endDrag:function(){},_dropMove:function(){},_end:function(){this.activeDrag&&(this._shimming=!1,this._endDrag(),this.fire("ddm:end"),this.activeDrag.end.call(this.activeDrag),this.activeDrag=null)},stopDrag:function(){return this.activeDrag&&this._end(),this},_shimming:!1,_docMove:function(e){this._shimming||this._move(e)},_move:function(e){this.activeDrag&&(this.activeDrag._move.call(this.activeDrag,e),this._dropMove())},cssSizestoObject:function(e){var t=e.split(" ");switch(t.length){case 1:t[1]=t[2]=t[3]=t[0];break;case 2:t[2]=t[0],t[3]=t[1];break;case 3:t[3]=t[1]}return{top:parseInt(t[0],10),right:parseInt(t[1],10),bottom:parseInt(t[2],10),left:parseInt(t[3],10)}},getDrag:function(t){var n=!1,r=e.one(t);return r instanceof e.Node&&e.each(this._drags,function(e){r.compareTo(e.get("node"))&&(n=e)}),n},swapPosition:function(t,n){t=e.DD.DDM.getNode(t),n=e.DD.DDM.getNode(n);var r=t.getXY(),i=n.getXY();return t.setXY(i),n.setXY(r),t},getNode:function(t){return t instanceof e.Node?t:(t&&t.get?e.Widget&&t instanceof e.Widget?t=t.get("boundingBox"):t=t.get("node"):t=e.one(t),t)},swapNode:function(t,n){t=e.DD.DDM.getNode(t),n=e.DD.DDM.getNode(n);var r=n.get("parentNode"),i=n.get("nextSibling");return i===t?r.insertBefore(t,n):n===t.get("nextSibling")?r.insertBefore(n,t):(t.get("parentNode").replaceChild(n,t),r.insertBefore(t,i)),t}}),e.namespace("DD"),e.DD.DDM=new n},"3.7.3",{requires:["node","base","yui-throttle","classnamemanager"]});
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("dd-ddm-drop",function(e,t){e.mix(e.DD.DDM,{_noShim:!1,_activeShims:[],_hasActiveShim:function(){return this._noShim?!0:this._activeShims.length},_addActiveShim:function(e){this._activeShims[this._activeShims.length]=e},_removeActiveShim:function(t){var n=[];e.each(this._activeShims,function(e){e._yuid!==t._yuid&&(n[n.length]=e)}),this._activeShims=n},syncActiveShims:function(t){e.later(0,this,function(t){var n=t?this.targets:this._lookup();e.each(n,function(e){e.sizeShim.call(e)},this)},t)},mode:0,POINT:0,INTERSECT:1,STRICT:2,useHash:!0,activeDrop:null,validDrops:[],otherDrops:{},targets:[],_addValid:function(e){return this.validDrops[this.validDrops.length]=e,this},_removeValid:function(t){var n=[];return e.each(this.validDrops,function(e){e!==t&&(n[n.length]=e)}),this.validDrops=n,this},isOverTarget:function(e){if(this.activeDrag&&e){var t=this.activeDrag.mouseXY,n,r=this.activeDrag.get("dragMode"),i,s=e.shim;if(t&&this.activeDrag){i=this.activeDrag.region;if(r===this.STRICT)return this.activeDrag.get("dragNode").inRegion(e.region,!0,i);if(e&&e.shim)return r===this.INTERSECT&&this._noShim?(n=i||this.activeDrag.get("node"),e.get("node").intersect(n,e.region).inRegion):(this._noShim&&(s=e.get("node")),s.intersect({top:t[1],bottom:t[1],left:t[0],right:t[0]},e.region).inRegion)}}return!1},clearCache:function(){this.validDrops=[],this.otherDrops={},this._activeShims=[]},_activateTargets:function(){this._noShim=!0,this.clearCache(),e.each(this.targets,function(e){e._activateShim([]),e.get("noShim")===!0&&(this._noShim=!1)},this),this._handleTargetOver()},getBestMatch:function(t,n){var r=null,i=0,s;return e.each(t,function(e){var t=this.activeDrag.get("dragNode").intersect(e.get("node"));e.region.area=t.area,t.inRegion&&t.area>i&&(i=t.area,r=e)},this),n?(s=[],e.each(t,function(e){e!==r&&(s[s.length]=e)},this),[r,s]):r},_deactivateTargets:function(){var t=[],n,r=this.activeDrag,i=this.activeDrop;r&&i&&this.otherDrops[i]?(r.get("dragMode")?(n=this.getBestMatch(this.otherDrops,!0),i=n[0],t=n[1]):(t=this.otherDrops,delete t[i]),r.get("node").removeClass(this.CSS_PREFIX+"-drag-over"),i&&(i.fire("drop:hit",{drag:r,drop:i,others:t}),r.fire("drag:drophit",{drag:r,drop:i,others:t}))):r&&r.get("dragging")&&(r.get("node").removeClass(this.CSS_PREFIX+"-drag-over"),r.fire("drag:dropmiss",{pageX:r.lastXY[0],pageY:r.lastXY[1]})),this.activeDrop=null,e.each(this.targets,function(e){e._deactivateShim([])},this)},_dropMove:function(){this._hasActiveShim()?this._handleTargetOver():e.each(this.otherDrops,function(e){e._handleOut.apply(e,[])})},_lookup:function(){if(!this.useHash||this._noShim)return this.validDrops;var t=[];return e.each(this.validDrops,function(e){e.shim&&e.shim.inViewportRegion(!1,e.region)&&(t[t.length]=e)}),t},_handleTargetOver:function(){var t=this._lookup();e.each(t,function(e){e._handleTargetOver.call(e)},this)},_regTarget:function(e){this.targets[this.targets.length]=e},_unregTarget:function(t){var n=[],r;e.each(this.targets,function(e){e!==t&&(n[n.length]=e)},this),this.targets=n,r=[],e.each(this.validDrops,function(e){e!==t&&(r[r.length]=e)}),this.validDrops=r},getDrop:function(t){var n=!1,r=e.one(t);return r instanceof e.Node&&e.each(this.targets,function(e){r.compareTo(e.get("node"))&&(n=e)}),n}},!0)},"3.7.3",{requires:["dd-ddm"]});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("dd-proxy",function(e,t){var n=e.DD.DDM,r="node",i="dragNode",s="host",o=!0,u,a=function(){a.superclass.constructor.apply(this,arguments)};a.NAME="DDProxy",a.NS="proxy",a.ATTRS={host:{},moveOnEnd:{value:o},hideOnEnd:{value:o},resizeFrame:{value:o},positionProxy:{value:o},borderStyle:{value:"1px solid #808080"},cloneNode:{value:!1}},u={_hands:null,_init:function(){if(!n._proxy){n._createFrame(),e.on("domready",e.bind(this._init,this));return}this._hands||(this._hands=[]);var t,o,u=this.get(s),a=u.get(i);a.compareTo(u.get(r))&&n._proxy&&u.set(i,n._proxy),e.each(this._hands,function(e){e.detach()}),t=n.on("ddm:start",e.bind(function(){n.activeDrag===u&&n._setFrame(u)},this)),o=n.on("ddm:end",e.bind(function(){u.get("dragging")&&(this.get("moveOnEnd")&&u.get(r).setXY(u.lastXY),this.get("hideOnEnd")&&u.get(i).setStyle("display","none"),this.get("cloneNode")&&(u.get(i).remove(),u.set(i,n._proxy)))},this)),this._hands=[t,o]},initializer:function(){this._init()},destructor:function(){var t=this.get(s);e.each(this._hands,function(e){e.detach()}),t.set(i,t.get(r))},clone:function(){var t=this.get(s),n=t.get(r),o=n.cloneNode(!0);return delete o._yuid,o.setAttribute("id",e.guid()),o.setStyle("position","absolute"),n.get("parentNode").appendChild(o),t.set(i,o),o}},e.namespace("Plugin"),e.extend(a,e.Base,u),e.Plugin.DDProxy=a,e.mix(n,{_createFrame:function(){if(!n._proxy){n._proxy=o;var t=e.Node.create("<div></div>"),r=e.one("body");t.setStyles({position:"absolute",display:"none",zIndex:"999",top:"-999px",left:"-999px"}),r.prepend(t),t.set("id",e.guid()),t.addClass(n.CSS_PREFIX+"-proxy"),n._proxy=t}},_setFrame:function(e){var t=e.get(r),s=e.get(i),o,u="auto";o=n.activeDrag.get("activeHandle"),o&&(u=o.getStyle("cursor")),u==="auto"&&(u=n.get("dragCursor")),s.setStyles({visibility:"hidden",display:"block",cursor:u,border:e.proxy.get("borderStyle")}),e.proxy.get("cloneNode")&&(s=e.proxy.clone()),e.proxy.get("resizeFrame")&&s.setStyles({height:t.get("offsetHeight")+"px",width:t.get("offsetWidth")+"px"}),e.proxy.get("positionProxy")&&s.setXY(e.nodeXY),s.setStyle("visibility","visible")}})},"3.7.3",{requires:["dd-drag"]});
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("event-tap",function(e,t){function l(t,n,r,i){n=r?n:[n.START,n.MOVE,n.END,n.CANCEL],e.Array.each(n,function(e,n,r){var i=t[e];i&&(i.detach(),t[e]=null)})}var n=e.config.doc,r=!!n&&!!n.createTouch,i=r?"touchstart":"mousedown",s=r?"touchmove":"mousemove",o=r?"touchend":"mouseup",u=r?"touchcancel":"mousecancel",a="tap",f={START:"Y_TAP_ON_START_HANDLE",MOVE:"Y_TAP_ON_MOVE_HANDLE",END:"Y_TAP_ON_END_HANDLE",CANCEL:"Y_TAP_ON_CANCEL_HANDLE"};e.Event.define(a,{on:function(e,t,n){t[f.START]=e.on(i,this.touchStart,this,e,t,n)},detach:function(e,t,n){l(t,f)},delegate:function(e,t,n,r){t[f.START]=e.delegate(i,function(r){this.touchStart(r,e,t,n,!0)},r,this)},detachDelegate:function(e,t,n){l(t,f)},touchStart:function(e,t,n,i,a){var l={canceled:!1};if(e.button&&e.button===3)return;if(e.touches&&e.touches.length!==1)return;l.node=a?e.currentTarget:t,r&&e.touches?l.startXY=[e.touches[0].pageX,e.touches[0].pageY]:l.startXY=[e.pageX,e.pageY],n[f.MOVE]=t.once(s,this.touchMove,this,t,n,i,a,l),n[f.END]=t.once(o,this.touchEnd,this,t,n,i,a,l),n[f.CANCEL]=t.once(u,this.touchMove,this,t,n,i,a,l)},touchMove:function(e,t,n,r,i,s){l(n,[f.MOVE,f.END,f.CANCEL],!0,s),s.cancelled=!0},touchEnd:function(e,t,n,i,s,o){var u=o.startXY,c,h;r&&e.changedTouches?(c=[e.changedTouches[0].pageX,e.changedTouches[0].pageY],h=[e.changedTouches[0].clientX,e.changedTouches[0].clientY]):(c=[e.pageX,e.pageY],h=[e.clientX,e.clientY]),l(n,[f.MOVE,f.END,f.CANCEL],!0,o),Math.abs(c[0]-u[0])===0&&Math.abs(c[1]-u[1])===0&&(e.type=a,e.pageX=c[0],e.pageY=c[1],e.clientX=h[0],e.clientY=h[1],e.currentTarget=o.node,i.fire(e))}})},"3.7.3",{requires:["node-base","event-base","event-touch","event-synthetic"]});
File diff suppressed because one or more lines are too long
@@ -1,210 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('get', function(Y) {
/**
* NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
* @module get-nodejs
* @class GetNodeJS
*/
var path = require('path'),
vm = require('vm'),
fs = require('fs'),
request = require('request'),
existsSync = fs.existsSync || path.existsSync;
Y.Get = function() {
};
//Setup the default config base path
Y.config.base = path.join(__dirname, '../');
YUI.require = require;
YUI.process = process;
/**
* Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
* @method escapeWinPath
* @protected
* @param {String} p The path to modify
* @return {String} The encoded path
*/
var escapeWinPath = function(p) {
return p.replace(/\\/g, '\\\\');
};
/**
* Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
* into the YUI object
* @method _exec
* @private
* @param {String} data The JS to execute
* @param {String} url The path to the file that was parsed
* @param {Callback} cb The callback to execute when this is completed
* @param {Error} cb.err=null Error object
* @param {String} cb.url The URL that was just parsed
*/
Y.Get._exec = function(data, url, cb) {
var dirName = escapeWinPath(path.dirname(url));
var fileName = escapeWinPath(url);
if (dirName.match(/^https?:\/\//)) {
dirName = '.';
fileName = 'remoteResource';
}
var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
"var __filename = '" + fileName + "'; " +
"var process = YUI.process;" +
"var require = function(file) {" +
" if (file.indexOf('./') === 0) {" +
" file = __dirname + file.replace('./', '/'); }" +
" return YUI.require(file); }; " +
data + " ;return YUI; })";
//var mod = "(function(YUI) { " + data + ";return YUI; })";
var script = vm.createScript(mod, url);
var fn = script.runInThisContext(mod);
YUI = fn(YUI);
cb(null, url);
};
/**
* Fetches the content from a remote URL or a file from disc and passes the content
* off to `_exec` for parsing
* @method _include
* @private
* @param {String} url The URL/File path to fetch the content from
* @param {Callback} cb The callback to fire once the content has been executed via `_exec`
*/
Y.Get._include = function(url, cb) {
var self = this;
if (url.match(/^https?:\/\//)) {
var cfg = {
url: url,
timeout: self.timeout
};
request(cfg, function (err, response, body) {
if (err) {
Y.log(err, 'error', 'get');
cb(err, url);
} else {
Y.Get._exec(body, url, cb);
}
});
} else {
if (Y.config.useSync) {
//Needs to be in useSync
if (existsSync(url)) {
var mod = fs.readFileSync(url,'utf8');
Y.Get._exec(mod, url, cb);
} else {
cb('Path does not exist: ' + url, url);
}
} else {
fs.readFile(url, 'utf8', function(err, mod) {
if (err) {
cb(err, url);
} else {
Y.Get._exec(mod, url, cb);
}
});
}
}
};
var end = function(cb, msg, result) {
//Y.log('Get end: ' + cb.onEnd);
if (Y.Lang.isFunction(cb.onEnd)) {
cb.onEnd.call(Y, msg, result);
}
}, pass = function(cb) {
//Y.log('Get pass: ' + cb.onSuccess);
if (Y.Lang.isFunction(cb.onSuccess)) {
cb.onSuccess.call(Y, cb);
}
end(cb, 'success', 'success');
}, fail = function(cb, er) {
//Y.log('Get fail: ' + er);
er.errors = [er];
if (Y.Lang.isFunction(cb.onFailure)) {
cb.onFailure.call(Y, er, cb);
}
end(cb, er, 'fail');
};
/**
* Override for Get.script for loading local or remote YUI modules.
* @method js
* @param {Array|String} s The URL's to load into this context
* @param {Object} options Transaction options
*/
Y.Get.js = function(s, options) {
var A = Y.Array,
self = this,
urls = A(s), url, i, l = urls.length, c= 0,
check = function() {
if (c === l) {
pass(options);
}
};
for (i=0; i<l; i++) {
url = urls[i];
if (Y.Lang.isObject(url)) {
url = url.url;
}
url = url.replace(/'/g, '%27');
Y.log('URL: ' + url, 'info', 'get');
Y.Get._include(url, function(err, url) {
if (!Y.config) {
Y.config = {
debug: true
};
}
if (options.onProgress) {
options.onProgress.call(options.context || Y, url);
}
Y.log('After Load: ' + url, 'info', 'get');
if (err) {
fail(options, err);
Y.log('----------------------------------------------------------', 'error', 'get');
Y.log(err, 'error', 'get');
Y.log('----------------------------------------------------------', 'error', 'get');
} else {
c++;
check();
}
});
}
};
/**
* Alias for `Y.Get.js`
* @method script
*/
Y.Get.script = Y.Get.js;
//Place holder for SS Dom access
Y.Get.css = function(s, cb) {
Y.log('Y.Get.css is not supported, just reporting that it has loaded but not fetching.', 'warn', 'get');
pass(cb);
};
}, '3.7.3' ,{requires:['yui-base']});
-7
View File
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("get",function(a){var j=require("path"),b=require("vm"),f=require("fs"),e=require("request"),g=f.existsSync||j.existsSync;a.Get=function(){};a.config.base=j.join(__dirname,"../");YUI.require=require;YUI.process=process;var i=function(k){return k.replace(/\\/g,"\\\\");};a.Get._exec=function(q,m,k){var p=i(j.dirname(m));var r=i(m);if(p.match(/^https?:\/\//)){p=".";r="remoteResource";}var n="(function(YUI) { var __dirname = '"+p+"'; "+"var __filename = '"+r+"'; "+"var process = YUI.process;"+"var require = function(file) {"+" if (file.indexOf('./') === 0) {"+" file = __dirname + file.replace('./', '/'); }"+" return YUI.require(file); }; "+q+" ;return YUI; })";var l=b.createScript(n,m);var o=l.runInThisContext(n);YUI=o(YUI);k(null,m);};a.Get._include=function(n,k){var m=this;if(n.match(/^https?:\/\//)){var l={url:n,timeout:m.timeout};e(l,function(r,q,p){if(r){k(r,n);}else{a.Get._exec(p,n,k);}});}else{if(a.config.useSync){if(g(n)){var o=f.readFileSync(n,"utf8");a.Get._exec(o,n,k);}else{k("Path does not exist: "+n,n);}}else{f.readFile(n,"utf8",function(q,p){if(q){k(q,n);}else{a.Get._exec(p,n,k);}});}}};var d=function(l,m,k){if(a.Lang.isFunction(l.onEnd)){l.onEnd.call(a,m,k);}},h=function(k){if(a.Lang.isFunction(k.onSuccess)){k.onSuccess.call(a,k);}d(k,"success","success");},c=function(k,l){l.errors=[l];if(a.Lang.isFunction(k.onFailure)){k.onFailure.call(a,l,k);}d(k,l,"fail");};a.Get.js=function(u,v){var n=a.Array,t=this,r=n(u),k,p,o=r.length,q=0,m=function(){if(q===o){h(v);}};for(p=0;p<o;p++){k=r[p];if(a.Lang.isObject(k)){k=k.url;}k=k.replace(/'/g,"%27");a.Get._include(k,function(s,l){if(!a.config){a.config={debug:true};}if(v.onProgress){v.onProgress.call(v.context||a,l);}if(s){c(v,s);}else{q++;m();}});}};a.Get.script=a.Get.js;a.Get.css=function(l,k){h(k);};},"3.7.3",{requires:["yui-base"]});
-200
View File
@@ -1,200 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('get', function(Y) {
/**
* NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
* @module get-nodejs
* @class GetNodeJS
*/
var path = require('path'),
vm = require('vm'),
fs = require('fs'),
request = require('request'),
existsSync = fs.existsSync || path.existsSync;
Y.Get = function() {
};
//Setup the default config base path
Y.config.base = path.join(__dirname, '../');
YUI.require = require;
YUI.process = process;
/**
* Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
* @method escapeWinPath
* @protected
* @param {String} p The path to modify
* @return {String} The encoded path
*/
var escapeWinPath = function(p) {
return p.replace(/\\/g, '\\\\');
};
/**
* Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
* into the YUI object
* @method _exec
* @private
* @param {String} data The JS to execute
* @param {String} url The path to the file that was parsed
* @param {Callback} cb The callback to execute when this is completed
* @param {Error} cb.err=null Error object
* @param {String} cb.url The URL that was just parsed
*/
Y.Get._exec = function(data, url, cb) {
var dirName = escapeWinPath(path.dirname(url));
var fileName = escapeWinPath(url);
if (dirName.match(/^https?:\/\//)) {
dirName = '.';
fileName = 'remoteResource';
}
var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
"var __filename = '" + fileName + "'; " +
"var process = YUI.process;" +
"var require = function(file) {" +
" if (file.indexOf('./') === 0) {" +
" file = __dirname + file.replace('./', '/'); }" +
" return YUI.require(file); }; " +
data + " ;return YUI; })";
//var mod = "(function(YUI) { " + data + ";return YUI; })";
var script = vm.createScript(mod, url);
var fn = script.runInThisContext(mod);
YUI = fn(YUI);
cb(null, url);
};
/**
* Fetches the content from a remote URL or a file from disc and passes the content
* off to `_exec` for parsing
* @method _include
* @private
* @param {String} url The URL/File path to fetch the content from
* @param {Callback} cb The callback to fire once the content has been executed via `_exec`
*/
Y.Get._include = function(url, cb) {
var self = this;
if (url.match(/^https?:\/\//)) {
var cfg = {
url: url,
timeout: self.timeout
};
request(cfg, function (err, response, body) {
if (err) {
cb(err, url);
} else {
Y.Get._exec(body, url, cb);
}
});
} else {
if (Y.config.useSync) {
//Needs to be in useSync
if (existsSync(url)) {
var mod = fs.readFileSync(url,'utf8');
Y.Get._exec(mod, url, cb);
} else {
cb('Path does not exist: ' + url, url);
}
} else {
fs.readFile(url, 'utf8', function(err, mod) {
if (err) {
cb(err, url);
} else {
Y.Get._exec(mod, url, cb);
}
});
}
}
};
var end = function(cb, msg, result) {
if (Y.Lang.isFunction(cb.onEnd)) {
cb.onEnd.call(Y, msg, result);
}
}, pass = function(cb) {
if (Y.Lang.isFunction(cb.onSuccess)) {
cb.onSuccess.call(Y, cb);
}
end(cb, 'success', 'success');
}, fail = function(cb, er) {
er.errors = [er];
if (Y.Lang.isFunction(cb.onFailure)) {
cb.onFailure.call(Y, er, cb);
}
end(cb, er, 'fail');
};
/**
* Override for Get.script for loading local or remote YUI modules.
* @method js
* @param {Array|String} s The URL's to load into this context
* @param {Object} options Transaction options
*/
Y.Get.js = function(s, options) {
var A = Y.Array,
self = this,
urls = A(s), url, i, l = urls.length, c= 0,
check = function() {
if (c === l) {
pass(options);
}
};
for (i=0; i<l; i++) {
url = urls[i];
if (Y.Lang.isObject(url)) {
url = url.url;
}
url = url.replace(/'/g, '%27');
Y.Get._include(url, function(err, url) {
if (!Y.config) {
Y.config = {
debug: true
};
}
if (options.onProgress) {
options.onProgress.call(options.context || Y, url);
}
if (err) {
fail(options, err);
} else {
c++;
check();
}
});
}
};
/**
* Alias for `Y.Get.js`
* @method script
*/
Y.Get.script = Y.Get.js;
//Place holder for SS Dom access
Y.Get.css = function(s, cb) {
pass(cb);
};
}, '3.7.3' ,{requires:['yui-base']});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("pjax-content",function(e,t){function n(){}n.prototype={getContent:function(t){var n={},r=this.get("contentSelector"),i=e.Node.create(t||""),s=this.get("titleSelector"),o;return r?n.node=i.all(r).toFrag():n.node=i,s&&(o=i.one(s),o&&(n.title=o.get("text"))),n},loadContent:function(t,n,r){var i=t.url;this._request&&this._request.abort(),this.get("addPjaxParam")&&(i=i.replace(/([^#]*)(#.*)?$/,function(e,t,n){return t+=(t.indexOf("?")>-1?"&":"?")+"pjax=1",t+(n||"")})),this._request=e.io(i,{arguments:{route:{req:t,res:n,next:r},url:i},context:this,headers:{"X-PJAX":"true"},timeout:this.get("timeout"),on:{complete:this._onPjaxIOComplete,end:this._onPjaxIOEnd}})},_onPjaxIOComplete:function(e,t,n){var r=this.getContent(t.responseText),i=n.route,s=i.req,o=i.res;s.ioURL=n.url,o.content=r,o.ioResponse=t,i.next()},_onPjaxIOEnd:function(){this._request=null}},n.ATTRS={addPjaxParam:{value:!0},contentSelector:{value:null},titleSelector:{value:"title"},timeout:{value:3e4}},e.PjaxContent=n},"3.7.3",{requires:["io-base","node-base","router"]});
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-resize,.yui3-resize-wrapper{z-index:0;zoom:1}.yui3-resize-handle{position:absolute;display:block;z-index:100;zoom:1}.yui3-resize-proxy{position:absolute;border:1px dashed #000;position:absolute;z-index:10000}.yui3-resize-hidden-handles .yui3-resize-handle{opacity:0;filter:alpha(opacity=0)}.yui3-resize-handle-t,.yui3-resize-handle-b{width:100%;left:0;height:6px}.yui3-resize-handle-l,.yui3-resize-handle-r{height:100%;top:0;width:6px}.yui3-resize-handle-t{cursor:n-resize;top:0}.yui3-resize-handle-b{cursor:s-resize;bottom:0}.yui3-resize-handle-l{cursor:w-resize;left:0}.yui3-resize-handle-r{cursor:e-resize;right:0}.yui3-resize-handle-inner{position:absolute;zoom:1}@media only screen and (min-device-width :320px) and (max-device-width:480px){.yui3-resize-handle-inner:after{content:"";width:40px;height:40px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-12px;right:0}.yui3-resize-handle-inner-l:after{top:-12px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-12px}.yui3-resize-handle-inner-b:after{bottom:0;left:-12px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}@media only screen and (min-device-width :768px) and (max-device-width:1024px){.yui3-resize-handle-inner:after{content:"";width:30px;height:30px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-6px;right:0}.yui3-resize-handle-inner-l:after{top:-6px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-6px}.yui3-resize-handle-inner-b:after{bottom:0;left:-6px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b{margin-left:-8px;left:50%}.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-r{margin-top:-8px;top:50%}.yui3-resize-handle-inner-t{top:-4px}.yui3-resize-handle-inner-b{bottom:-4px}.yui3-resize-handle-inner-l{left:-4px}.yui3-resize-handle-inner-r{right:-4px}.yui3-resize-handle-tr,.yui3-resize-handle-br,.yui3-resize-handle-tl,.yui3-resize-handle-bl{height:15px;width:15px;z-index:200}.yui3-resize-handle-tr{cursor:ne-resize;top:0;right:0}.yui3-resize-handle-tl{cursor:nw-resize;top:0;left:0}.yui3-resize-handle-br{cursor:se-resize;bottom:0;right:0}.yui3-resize-handle-bl{cursor:sw-resize;bottom:0;left:0}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{background-repeat:no-repeat;background:url(arrows.png) no-repeat 0 0;display:block;height:15px;overflow:hidden;text-indent:-99999em;width:15px}.yui3-resize-handle-inner-br{background-position:-30px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tr{background-position:-58px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-bl{background-position:-75px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tl{background-position:-47px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t{background-position:-15px 0}#yui3-css-stamp.skin-night-resize-base{display:none}
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-resize,.yui3-resize-wrapper{z-index:0;zoom:1}.yui3-resize-handle{position:absolute;display:block;z-index:100;zoom:1}.yui3-resize-proxy{position:absolute;border:1px dashed #000;position:absolute;z-index:10000}.yui3-resize-hidden-handles .yui3-resize-handle{opacity:0;filter:alpha(opacity=0)}.yui3-resize-handle-t,.yui3-resize-handle-b{width:100%;left:0;height:6px}.yui3-resize-handle-l,.yui3-resize-handle-r{height:100%;top:0;width:6px}.yui3-resize-handle-t{cursor:n-resize;top:0}.yui3-resize-handle-b{cursor:s-resize;bottom:0}.yui3-resize-handle-l{cursor:w-resize;left:0}.yui3-resize-handle-r{cursor:e-resize;right:0}.yui3-resize-handle-inner{position:absolute;zoom:1}@media only screen and (min-device-width :320px) and (max-device-width:480px){.yui3-resize-handle-inner:after{content:"";width:40px;height:40px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-12px;right:0}.yui3-resize-handle-inner-l:after{top:-12px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-12px}.yui3-resize-handle-inner-b:after{bottom:0;left:-12px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}@media only screen and (min-device-width :768px) and (max-device-width:1024px){.yui3-resize-handle-inner:after{content:"";width:30px;height:30px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-6px;right:0}.yui3-resize-handle-inner-l:after{top:-6px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-6px}.yui3-resize-handle-inner-b:after{bottom:0;left:-6px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b{margin-left:-8px;left:50%}.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-r{margin-top:-8px;top:50%}.yui3-resize-handle-inner-t{top:-4px}.yui3-resize-handle-inner-b{bottom:-4px}.yui3-resize-handle-inner-l{left:-4px}.yui3-resize-handle-inner-r{right:-4px}.yui3-resize-handle-tr,.yui3-resize-handle-br,.yui3-resize-handle-tl,.yui3-resize-handle-bl{height:15px;width:15px;z-index:200}.yui3-resize-handle-tr{cursor:ne-resize;top:0;right:0}.yui3-resize-handle-tl{cursor:nw-resize;top:0;left:0}.yui3-resize-handle-br{cursor:se-resize;bottom:0;right:0}.yui3-resize-handle-bl{cursor:sw-resize;bottom:0;left:0}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{background-repeat:no-repeat;background:url(arrows.png) no-repeat 0 0;display:block;height:15px;overflow:hidden;text-indent:-99999em;width:15px}.yui3-resize-handle-inner-br{background-position:-30px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tr{background-position:-58px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-bl{background-position:-75px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tl{background-position:-47px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t{background-position:-15px 0}#yui3-css-stamp.skin-sam-resize-base{display:none}
@@ -1,52 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-resize-handle-inner-r,
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b,
.yui3-resize-handle-inner-tr,
.yui3-resize-handle-inner-br,
.yui3-resize-handle-inner-tl,
.yui3-resize-handle-inner-bl {
background-repeat: no-repeat;
background: url(arrows.png) no-repeat 0 0;
display: block;
height: 15px;
overflow: hidden;
text-indent: -99999em;
width: 15px;
}
.yui3-resize-handle-inner-br {
background-position: -30px 0;
bottom: -2px;
right: -2px;
}
.yui3-resize-handle-inner-tr {
background-position: -58px 0;
bottom: 0;
right: -2px;
}
.yui3-resize-handle-inner-bl {
background-position: -75px 0;
bottom: -2px;
right: -2px;
}
.yui3-resize-handle-inner-tl {
background-position: -47px 0;
bottom: 0;
right: -2px;
}
.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t {
background-position: -15px 0;
}
@@ -1,52 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-resize-handle-inner-r,
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b,
.yui3-resize-handle-inner-tr,
.yui3-resize-handle-inner-br,
.yui3-resize-handle-inner-tl,
.yui3-resize-handle-inner-bl {
background-repeat: no-repeat;
background: url(arrows.png) no-repeat 0 0;
display: block;
height: 15px;
overflow: hidden;
text-indent: -99999em;
width: 15px;
}
.yui3-resize-handle-inner-br {
background-position: -30px 0;
bottom: -2px;
right: -2px;
}
.yui3-resize-handle-inner-tr {
background-position: -58px 0;
bottom: 0;
right: -2px;
}
.yui3-resize-handle-inner-bl {
background-position: -75px 0;
bottom: -2px;
right: -2px;
}
.yui3-resize-handle-inner-tl {
background-position: -47px 0;
bottom: 0;
right: -2px;
}
.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t {
background-position: -15px 0;
}
@@ -1,52 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-resize-handle-inner-r,
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b,
.yui3-resize-handle-inner-tr,
.yui3-resize-handle-inner-br,
.yui3-resize-handle-inner-tl,
.yui3-resize-handle-inner-bl {
background-repeat: no-repeat;
background: url(arrows.png) no-repeat 0 0;
display: block;
height: 15px;
overflow: hidden;
text-indent: -99999em;
width: 15px;
}
.yui3-resize-handle-inner-br {
background-position: -30px 0;
bottom: -2px;
right: -2px;
}
.yui3-resize-handle-inner-tr {
background-position: -58px 0;
bottom: 0;
right: -2px;
}
.yui3-resize-handle-inner-bl {
background-position: -75px 0;
bottom: -2px;
right: -2px;
}
.yui3-resize-handle-inner-tl {
background-position: -47px 0;
bottom: 0;
right: -2px;
}
.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t {
background-position: -15px 0;
}
@@ -1,52 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-resize-handle-inner-r,
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b,
.yui3-resize-handle-inner-tr,
.yui3-resize-handle-inner-br,
.yui3-resize-handle-inner-tl,
.yui3-resize-handle-inner-bl {
background-repeat: no-repeat;
background: url(arrows.png) no-repeat 0 0;
display: block;
height: 15px;
overflow: hidden;
text-indent: -99999em;
width: 15px;
}
.yui3-resize-handle-inner-br {
background-position: -30px 0;
bottom: -2px;
right: -2px;
}
.yui3-resize-handle-inner-tr {
background-position: -58px 0;
bottom: 0;
right: -2px;
}
.yui3-resize-handle-inner-bl {
background-position: -75px 0;
bottom: -2px;
right: -2px;
}
.yui3-resize-handle-inner-tl {
background-position: -47px 0;
bottom: 0;
right: -2px;
}
.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t {
background-position: -15px 0;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("scrollview-paginator",function(e,t){function w(){w.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="scrollview",i=n(r,"hidden"),s=n(r,"paged"),o=e.ScrollView?e.ScrollView.UI_SRC:"ui",u="index",a="scrollX",f="scrollY",l="total",c="host",h="boundingBox",p="contentBox",d="selector",v="flick",m="drag",g="axis",y="x",b="y";e.extend(w,e.Plugin.Base,{initializer:function(e){var t=this,n=t.get(c);t._pageDims=[],t._pageBuffer=1,t._optimizeMemory=!1,t._host=n,t._bb=n._bb,t._cb=n._cb,t._cIndex=t.get(u),t._cAxis=t.get(g),e._optimizeMemory&&(t._optimizeMemory=e._optimizeMemory),e._pageBuffer&&(t._pageBuffer=e._pageBuffer),t._bindAttrs()},_bindAttrs:function(){var e=this;e.after({indexChange:e._afterIndexChange,axisChange:e._afterAxisChange}),e.beforeHostMethod("scrollTo",e._beforeHostScrollTo),e.beforeHostMethod("_mousewheel",e._beforeHostMousewheel),e.beforeHostMethod("_flick",e._beforeHostFlick),e.afterHostMethod("_onGestureMoveEnd",e._afterHostGestureMoveEnd),e.afterHostMethod("_uiDimensionsChange",e._afterHostUIDimensionsChange),e.afterHostMethod("syncUI",e._afterHostSyncUI),e.afterHostEvent("render",e._afterHostRender),e.afterHostEvent("scrollEnd",e._afterHostScrollEnded)},_afterHostRender:function(e){var t=this,n=t._bb,r=t._host,i=t._cIndex,o=t._cAxis,u=t._getPageNodes(),a=u.size(),f=t._pageDims[i].maxScrollX,c=t._pageDims[i].maxScrollY;o[b]?r._maxScrollX=f:o[y]&&(r._maxScrollY=c),t.set(l,a),i!==0&&t.scrollToIndex(i,0),n.addClass(s),t._optimize()},_afterHostSyncUI:function(e){var t=this,n=t._host,r=n.get(v),i=t._getPageNodes(),s=i.size(),o;t.set(l,s),t._cAxis===undefined&&t._set(g,n.get(g))},_afterHostUIDimensionsChange:function(e){var t=this,n=t._host,r=n._getScrollDims(),i=r.offsetWidth,s=r.offsetHeight,o=t._getPageNodes();o.each(function(e,n){var r=e.get("scrollWidth"),o=e.get("scrollHeight"),u=Math.max(0,r-i),a=Math.max(0,o-s);t._pageDims[n]?(t._pageDims[n].maxScrollX=u,t._pageDims[n].maxScrollY=a):t._pageDims[n]={scrollX:0,scrollY:0,_minScrollX:0,_minScrollY:0,maxScrollX:u,maxScrollY:a}})},_beforeHostScrollTo:function(t,n,r,i,s){var o=this,u=o._host,a=u._gesture,f=o._cIndex,l=o._cAxis,c=this._getPageNodes(),h;return a&&(h=a.axis,h===b?t=null:n=null,l[h]===!1&&(s=c.item(f))),new e.Do.AlterArgs("new args",[t,n,r,i,s])},_afterHostGestureMoveEnd:function(e){var t=this,n=t._host,r=n._gesture,i=t._cAxis,s=r&&r.axis;i[s]&&(r[s===y?"deltaX":"deltaY"]>0?t[n.rtl?"prev":"next"]():t[n.rtl?"next":"prev"]())},_beforeHostMousewheel:function(t){var n=this,r=n._host,i=r._bb,s=t.wheelDelta<0,o=n._cAxis;r._gesture={axis:b};if(i.contains(t.target)&&o[b])return s?n.next():n.prev(),t.preventDefault(),new e.Do.Prevent},_beforeHostFlick:function(t){var n=this,r=n.get(g),i=t.flick.axis||!1;if(r[i])return new e.Do.Prevent},_afterHostScrollEnded:function(e){var t=this,n=t._host,r=t._cIndex,i=n.get(a),s=n.get(f),o=t._cAxis;o[b]?t._pageDims[r].scrollX=i:t._pageDims[r].scrollY=s,t._optimize()},_afterIndexChange:function(e){var t=this,n=t._host,r=e.newVal,i=t._pageDims[r],s=n._cAxis,u=t._cAxis;t._cIndex=r,s[y]&&s[b]&&(u[b]?(n._maxScrollX=i.maxScrollX,n.set(a,i.scrollX,{src:o})):u[y]&&(n._maxScrollY=i.maxScrollY,n.set(f,i.scrollY,{src:o}))),e.src!==o&&t.scrollToIndex(r)},_optimize:function(){if(!this._optimizeMemory)return!1;var e=this,t=e._cIndex,n=e._getStage(t);e._showNodes(n.visible),e._hideNodes(n.hidden)},_getStage:function(e){var t=this._pageBuffer,n=this.get(l),r=this._getPageNodes(),i=Math.max(0,e-t),s=Math.min(n,e+1+t);return{visible:r.splice(i,s-i),hidden:r}},_showNodes:function(e){e&&e.removeClass(i).setStyle("visibility","")},_hideNodes:function(e){e&&e.addClass(i).setStyle("visibility","hidden")},_getPageNodes:function(){var e=this,t=e._host,n=t._cb,r=e.get(d),i=r?n.all(r):n.get("children");return i},next:function(){var e=this,t=e._cIndex,n=t+1,r=this.get(l);if(n>=r)return;e.set(u,n)},prev:function(){var e=this,t=e._cIndex,n=t-1;if(n<0)return;e.set(u,n)},scrollTo:function(){return this.scrollToIndex.apply(this,arguments)},scrollToIndex:function(e,t,n){var r=this,i=r._host,s=r._getPageNodes().item(e),o=r._cAxis[y]?a:f,l=s.get(o===a?"offsetLeft":"offsetTop");t=t!==undefined?t:w.TRANSITION.duration,n=n!==undefined?t:w.TRANSITION.easing,r.set(u,e),r._showNodes(s),i.set(o,l,{duration:t,easing:n})},_axisSetter:function(t,n){if(e.Lang.isString(t))return{x:t.match(/x/i)?!0:!1,y:t.match(/y/i)?!0:!1}},_afterAxisChange:function(e){this._cAxis=e.newVal}},{NAME:"pluginScrollViewPaginator",NS:"pages",ATTRS:{axis:{setter:"_axisSetter",writeOnce:"initOnly"},selector:{value:null},index:{value:0,validator:function(e){return!0}},total:{value:0}},TRANSITION:{duration:300,easing:"ease-out"}}),e.namespace("Plugin").ScrollViewPaginator=w},"3.7.3",{requires:["plugin","classnamemanager"]});
@@ -1,7 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("scrollview-scrollbars",function(e,t){function O(){O.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r,i=e.Transition,s=i.useNative,o="scrollbar",u="scrollview",a="verticalNode",f="horizontalNode",l="childCache",c="top",h="left",p="width",d="height",v="scrollWidth",m="scrollHeight",g="_sbh",y="_sbv",b=e.ScrollView._TRANSITION.PROPERTY,w="transform",E="translateX(",S="translateY(",x="scaleX(",T="scaleY(",N="scrollX",C="scrollY",k="px",L=")",A=k+L;O.CLASS_NAMES={showing:n(u,o,"showing"),scrollbar:n(u,o),scrollbarV:n(u,o,"vert"),scrollbarH:n(u,o,"horiz"),scrollbarVB:n(u,o,"vert","basic"),scrollbarHB:n(u,o,"horiz","basic"),child:n(u,"child"),first:n(u,"first"),middle:n(u,"middle"),last:n(u,"last")},r=O.CLASS_NAMES,O.NAME="pluginScrollViewScrollbars",O.NS="scrollbars",O.SCROLLBAR_TEMPLATE=["<div>",'<span class="'+r.child+" "+r.first+'"></span>','<span class="'+r.child+" "+r.middle+'"></span>','<span class="'+r.child+" "+r.last+'"></span>',"</div>"].join(""),O.ATTRS={verticalNode:{setter:"_setNode",valueFn:"_defaultNode"},horizontalNode:{setter:"_setNode",valueFn:"_defaultNode"}},e.namespace("Plugin").ScrollViewScrollbars=e.extend(O,e.Plugin.Base,{initializer:function(){this._host=this.get("host"),this.afterHostEvent("scrollEnd",this._hostScrollEnd),this.afterHostMethod("scrollTo",this._update),this.afterHostMethod("_uiDimensionsChange",this._hostDimensionsChange)},_hostDimensionsChange:function(){var t=this._host,n=t._cAxis;this._dims=t._getScrollDims(),n&&n.y&&this._renderBar(this.get(a),!0,"vert"),n&&n.x&&this._renderBar(this.get(f),!0,"horiz"),this._update(),e.later(500,this,"flash",!0)},_hostScrollEnd:function(e){this._host._flicking||this.flash()},_renderBar:function(e,t){var n=e.inDoc(),i=this._host._bb,s=e.getData("isHoriz")?r.scrollbarHB:r.scrollbarVB;t&&!n?(i.append(e),e.toggleClass(s,this._basic),this._setChildCache(e)):!t&&n&&(e.remove(),this._clearChildCache(e))},_setChildCache:function(e){var t=e.get("children"),n=t.item(0),r=t.item(1),i=t.item(2),s=e.getData("isHoriz")?"offsetWidth":"offsetHeight";e.setStyle(b,w),r.setStyle(b,w),i.setStyle(b,w),e.setData(l,{fc:n,lc:i,mc:r,fcSize:n&&n.get(s),lcSize:i&&i.get(s)})},_clearChildCache:function(e){e.clearData(l)},_updateBar:function(e,t,n,r){var i=this._host,o=this._basic,u=i._cb,a=0,f=1,v=e.getData(l),m=v.lc,b=v.mc,O=v.fcSize,M=v.lcSize,_,D,P,H,B,j,F,I,q,R;r?(j=p,F=h,I=g,q=this._dims.offsetWidth,R=this._dims.scrollWidth,H=E,B=x,t=t!==undefined?t:i.get(N)):(j=d,F=c,I=y,q=this._dims.offsetHeight,R=this._dims.scrollHeight,H=S,B=T,t=t!==undefined?t:i.get(C)),a=Math.floor(q*(q/R)),f=Math.floor(t/(R-q)*(q-a)),a>q&&(a=1),f>q-a?a-=f-(q-a):f<0&&(a=f+a,f=0),_=a-(O+M),_<0&&(_=0),_===0&&f!==0&&(f=q-(O+M)-1),n!==0?(P={duration:n},s?P.transform=H+f+A:P[F]=f+k,e.transition(P)):s?e.setStyle(w,H+f+A):e.setStyle(F,f+k);if(this[I]!==_){this[I]=_;if(_>0){n!==0?(P={duration:n},s?P.transform=B+_+L:P[j]=_+k,b.transition(P)):s?b.setStyle(w,B+_+L):b.setStyle(j,_+k);if(!r||!o)D=a-M,n!==0?(P={duration:n},s?P.transform=H+D+A:P[F]=D,m.transition(P)):s?m.setStyle(w,H+D+A):m.setStyle(F,D+k)}}},_update:function(e,t,n,r){var i=this.get(a),s=this.get(f),o=this._host,u=o._cAxis;n=(n||0)/1e3,this._showing||this.show(),u&&u.y&&i&&this._updateBar(i,t,n,!1),u&&u.x&&s&&this._updateBar(s,e,n,!0)},show:function(e){this._show(!0,e)},hide:function(e){this._show(!1,e)},_show:function(e,t){var n=this.get(a),r=this.get(f),i=t?.6:0,s=e?1:0,o;this._showing=e,this._flashTimer&&this._flashTimer.cancel(),o={duration:i,opacity:s},n&&n.transition(o),r&&r.transition(o)},flash:function(){var t=this._host;this.show(!0),this._flashTimer=e.later(800,this,"hide",!0)},_setNode:function(t,n){var i=n===f;return t=e.one(t),t&&(t.addClass(r.scrollbar),t.addClass(i?r.scrollbarH:r.scrollbarV),t.setData("isHoriz",i)),t},_defaultNode:function(){return e.Node.create(O.SCROLLBAR_TEMPLATE)},_basic:e.UA.ie&&e.UA.ie<=8})},"3.7.3",{requires:["classnamemanager","transition","plugin"],skinnable:!0});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -1,989 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('uploader-html5', function (Y, NAME) {
/**
* This module provides a UI for file selection and multiple file upload capability using
* HTML5 XMLHTTPRequest Level 2 as a transport engine.
* The supported features include: automatic upload queue management, upload progress
* tracking, drag-and-drop support, server response retrieval and error reporting.
*
* @module uploader-html5
*/
// Shorthands for the external modules
var substitute = Y.substitute,
UploaderQueue = Y.Uploader.Queue;
/**
* This module provides a UI for file selection and multiple file upload capability using
* HTML5 XMLHTTPRequest Level 2 as a transport engine.
* @class UploaderHTML5
* @extends Widget
* @constructor
*/
function UploaderHTML5(config) {
UploaderHTML5.superclass.constructor.apply ( this, arguments );
}
Y.UploaderHTML5 = Y.extend( UploaderHTML5, Y.Widget, {
/**
* Stored reference to the instance of the file input field used to
* initiate the file selection dialog.
*
* @property _fileInputField
* @type {Node}
* @protected
*/
_fileInputField: null,
/**
* Stored reference to the click event binding of the `Select Files`
* button.
*
* @property _buttonBinding
* @type {EventHandle}
* @protected
*/
_buttonBinding: null,
/**
* Stored reference to the instance of Uploader.Queue used to manage
* the upload process. This is a read-only property that only exists
* during an active upload process. Only one queue can be active at
* a time; if an upload start is attempted while a queue is active,
* it will be ignored.
*
* @property queue
* @type {Y.Uploader.Queue}
*/
queue: null,
// Y.UploaderHTML5 prototype
/**
* Construction logic executed during UploaderHTML5 instantiation.
*
* @method initializer
* @protected
*/
initializer : function () {
this._fileInputField = null;
this.queue = null;
this._buttonBinding = null;
this._fileList = [];
// Publish available events
/**
* Signals that files have been selected.
*
* @event fileselect
* @param event {Event} The event object for the `fileselect` with the
* following payload:
* <dl>
* <dt>fileList</dt>
* <dd>An `Array` of files selected by the user, encapsulated
* in Y.FileHTML5 objects.</dd>
* </dl>
*/
this.publish("fileselect");
/**
* Signals that an upload of multiple files has been started.
*
* @event uploadstart
* @param event {Event} The event object for the `uploadstart`.
*/
this.publish("uploadstart");
/**
* Signals that an upload of a specific file has started.
*
* @event fileuploadstart
* @param event {Event} The event object for the `fileuploadstart` with the
* following payload:
* <dl>
* <dt>file</dt>
* <dd>A reference to the Y.File that dispatched the event.</dd>
* <dt>originEvent</dt>
* <dd>The original event dispatched by Y.File.</dd>
* </dl>
*/
this.publish("fileuploadstart");
/**
* Reports on upload progress of a specific file.
*
* @event uploadprogress
* @param event {Event} The event object for the `uploadprogress` with the
* following payload:
* <dl>
* <dt>file</dt>
* <dd>The pointer to the instance of `Y.File` that dispatched the event.</dd>
* <dt>bytesLoaded</dt>
* <dd>The number of bytes of the file that has been uploaded</dd>
* <dt>bytesTotal</dt>
* <dd>The total number of bytes in the file</dd>
* <dt>percentLoaded</dt>
* <dd>The fraction of the file that has been uploaded, out of 100</dd>
* <dt>originEvent</dt>
* <dd>The original event dispatched by the HTML5 uploader</dd>
* </dl>
*/
this.publish("uploadprogress");
/**
* Reports on the total upload progress of the file list.
*
* @event totaluploadprogress
* @param event {Event} The event object for the `totaluploadprogress` with the
* following payload:
* <dl>
* <dt>bytesLoaded</dt>
* <dd>The number of bytes of the file list that has been uploaded</dd>
* <dt>bytesTotal</dt>
* <dd>The total number of bytes in the file list</dd>
* <dt>percentLoaded</dt>
* <dd>The fraction of the file list that has been uploaded, out of 100</dd>
* </dl>
*/
this.publish("totaluploadprogress");
/**
* Signals that a single file upload has been completed.
*
* @event uploadcomplete
* @param event {Event} The event object for the `uploadcomplete` with the
* following payload:
* <dl>
* <dt>file</dt>
* <dd>The pointer to the instance of `Y.File` whose upload has been completed.</dd>
* <dt>originEvent</dt>
* <dd>The original event fired by the SWF Uploader</dd>
* <dt>data</dt>
* <dd>Data returned by the server.</dd>
* </dl>
*/
this.publish("uploadcomplete");
/**
* Signals that the upload process of the entire file list has been completed.
*
* @event alluploadscomplete
* @param event {Event} The event object for the `alluploadscomplete`.
*/
this.publish("alluploadscomplete");
/**
* Signals that a error has occurred in a specific file's upload process.
*
* @event uploaderror
* @param event {Event} The event object for the `uploaderror` with the
* following payload:
* <dl>
* <dt>originEvent</dt>
* <dd>The original error event fired by the HTML5 Uploader. </dd>
* <dt>file</dt>
* <dd>The pointer at the instance of Y.File that returned the error.</dd>
* <dt>status</dt>
* <dd>The status reported by the XMLHttpRequest object.</dd>
* <dt>statusText</dt>
* <dd>The statusText reported by the XMLHttpRequest object.</dd>
* </dl>
*/
this.publish("uploaderror");
/**
* Signals that a dragged object has entered into the uploader's associated drag-and-drop area.
*
* @event dragenter
* @param event {Event} The event object for the `dragenter`.
*/
this.publish("dragenter");
/**
* Signals that an object has been dragged over the uploader's associated drag-and-drop area.
*
* @event dragover
* @param event {Event} The event object for the `dragover`.
*/
this.publish("dragover");
/**
* Signals that an object has been dragged off of the uploader's associated drag-and-drop area.
*
* @event dragleave
* @param event {Event} The event object for the `dragleave`.
*/
this.publish("dragleave");
/**
* Signals that an object has been dropped over the uploader's associated drag-and-drop area.
*
* @event drop
* @param event {Event} The event object for the `drop`.
*/
this.publish("drop");
},
/**
* Create the DOM structure for the UploaderHTML5.
* UploaderHTML5's DOM structure consists of a "Select Files" button that can
* be replaced by the developer's widget of choice; and a hidden file input field
* that is used to instantiate the File Select dialog.
*
* @method renderUI
* @protected
*/
renderUI : function () {
var boundingBox = this.get("boundingBox"),
contentBox = this.get('contentBox'),
selButton = this.get("selectFilesButton");
selButton.setStyles({width:"100%", height:"100%"});
contentBox.append(selButton);
this._fileInputField = Y.Node.create(UploaderHTML5.HTML5FILEFIELD_TEMPLATE);
contentBox.append(this._fileInputField);
},
/**
* Binds to the UploaderHTML5 UI and subscribes to the necessary events.
*
* @method bindUI
* @protected
*/
bindUI : function () {
this._bindSelectButton();
this._setMultipleFiles();
this._setFileFilters();
this._bindDropArea();
this._triggerEnabled();
this.after("multipleFilesChange", this._setMultipleFiles, this);
this.after("fileFiltersChange", this._setFileFilters, this);
this.after("enabledChange", this._triggerEnabled, this);
this.after("selectFilesButtonChange", this._bindSelectButton, this);
this.after("dragAndDropAreaChange", this._bindDropArea, this);
this.after("tabIndexChange", function (ev) {this.get("selectFilesButton").set("tabIndex", this.get("tabIndex"));}, this);
this._fileInputField.on("change", this._updateFileList, this);
this.get("selectFilesButton").set("tabIndex", this.get("tabIndex"));
},
/**
* Recreates the file field to null out the previous list of files and
* thus allow for an identical file list selection.
*
* @method _rebindFileField
* @protected
*/
_rebindFileField : function () {
this._fileInputField.remove(true);
this._fileInputField = Y.Node.create(UploaderHTML5.HTML5FILEFIELD_TEMPLATE);
this.get("contentBox").append(this._fileInputField);
this._fileInputField.on("change", this._updateFileList, this);
this._setMultipleFiles();
this._setFileFilters();
},
/**
* Binds the specified drop area's drag and drop events to the
* uploader's custom handler.
*
* @method _bindDropArea
* @protected
*/
_bindDropArea : function (event) {
var ev = event || {prevVal: null};
if (ev.prevVal !== null) {
ev.prevVal.detach('drop', this._ddEventHandler);
ev.prevVal.detach('dragenter', this._ddEventHandler);
ev.prevVal.detach('dragover', this._ddEventHandler);
ev.prevVal.detach('dragleave', this._ddEventHandler);
}
var ddArea = this.get("dragAndDropArea");
if (ddArea !== null) {
ddArea.on('drop', this._ddEventHandler, this);
ddArea.on('dragenter', this._ddEventHandler, this);
ddArea.on('dragover', this._ddEventHandler, this);
ddArea.on('dragleave', this._ddEventHandler, this);
}
},
/**
* Binds the instantiation of the file select dialog to the current file select
* control.
*
* @method _bindSelectButton
* @protected
*/
_bindSelectButton : function () {
this._buttonBinding = this.get("selectFilesButton").on("click", this.openFileSelectDialog, this);
},
/**
* Handles the drag and drop events from the uploader's specified drop
* area.
*
* @method _ddEventHandler
* @protected
*/
_ddEventHandler : function (event) {
event.stopPropagation();
event.preventDefault();
switch (event.type) {
case "dragenter":
this.fire("dragenter");
break;
case "dragover":
this.fire("dragover");
break;
case "dragleave":
this.fire("dragleave");
break;
case "drop":
var newfiles = event._event.dataTransfer.files,
parsedFiles = [],
filterFunc = this.get("fileFilterFunction");
if (filterFunc) {
Y.each(newfiles, function (value) {
var newfile = new Y.FileHTML5(value);
if (filterFunc(newfile)) {
parsedFiles.push(newfile);
}
});
}
else {
Y.each(newfiles, function (value) {
parsedFiles.push(new Y.FileHTML5(value));
});
}
if (parsedFiles.length > 0) {
var oldfiles = this.get("fileList");
this.set("fileList",
this.get("appendNewFiles") ? oldfiles.concat(parsedFiles) : parsedFiles);
this.fire("fileselect", {fileList: parsedFiles});
}
this.fire("drop");
break;
}
},
/**
* Adds or removes a specified state CSS class to the underlying uploader button.
*
* @method _setButtonClass
* @protected
* @param state {String} The name of the state enumerated in `buttonClassNames` attribute
* from which to derive the needed class name.
* @param add {Boolean} A Boolean indicating whether to add or remove the class.
*/
_setButtonClass : function (state, add) {
if (add) {
this.get("selectFilesButton").addClass(this.get("buttonClassNames")[state]);
}
else {
this.get("selectFilesButton").removeClass(this.get("buttonClassNames")[state]);
}
},
/**
* Syncs the state of the `multipleFiles` attribute between this class
* and the file input field.
*
* @method _setMultipleFiles
* @protected
*/
_setMultipleFiles : function () {
if (this.get("multipleFiles") === true) {
this._fileInputField.set("multiple", "multiple");
}
else {
this._fileInputField.set("multiple", "");
}
},
/**
* Syncs the state of the `fileFilters` attribute between this class
* and the file input field.
*
* @method _setFileFilters
* @protected
*/
_setFileFilters : function () {
if (this.get("fileFilters").length > 0) {
this._fileInputField.set("accept", this.get("fileFilters").join(","));
}
else {
this._fileInputField.set("accept", "");
}
},
/**
* Syncs the state of the `enabled` attribute between this class
* and the underlying button.
*
* @method _triggerEnabled
* @private
*/
_triggerEnabled : function () {
if (this.get("enabled") && this._buttonBinding === null) {
this._bindSelectButton();
this._setButtonClass("disabled", false);
this.get("selectFilesButton").setAttribute("aria-disabled", "false");
}
else if (!this.get("enabled") && this._buttonBinding) {
this._buttonBinding.detach();
this._buttonBinding = null;
this._setButtonClass("disabled", true);
this.get("selectFilesButton").setAttribute("aria-disabled", "true");
}
},
/**
* Getter for the `fileList` attribute
*
* @method _getFileList
* @private
*/
_getFileList : function (arr) {
return this._fileList.concat();
},
/**
* Setter for the `fileList` attribute
*
* @method _setFileList
* @private
*/
_setFileList : function (val) {
this._fileList = val.concat();
return this._fileList.concat();
},
/**
* Adjusts the content of the `fileList` based on the results of file selection
* and the `appendNewFiles` attribute. If the `appendNewFiles` attribute is true,
* then selected files are appended to the existing list; otherwise, the list is
* cleared and populated with the newly selected files.
*
* @method _updateFileList
* @param ev {Event} The file selection event received from the uploader.
* @protected
*/
_updateFileList : function (ev) {
var newfiles = ev.target.getDOMNode().files,
parsedFiles = [],
filterFunc = this.get("fileFilterFunction");
if (filterFunc) {
Y.each(newfiles, function (value) {
var newfile = new Y.FileHTML5(value);
if (filterFunc(newfile)) {
parsedFiles.push(newfile);
}
});
}
else {
Y.each(newfiles, function (value) {
parsedFiles.push(new Y.FileHTML5(value));
});
}
if (parsedFiles.length > 0) {
var oldfiles = this.get("fileList");
this.set("fileList",
this.get("appendNewFiles") ? oldfiles.concat(parsedFiles) : parsedFiles );
this.fire("fileselect", {fileList: parsedFiles});
}
this._rebindFileField();
},
/**
* Handles and retransmits events fired by `Y.File` and `Y.Uploader.Queue`.
*
* @method _uploadEventHandler
* @param event The event dispatched during the upload process.
* @protected
*/
_uploadEventHandler : function (event) {
switch (event.type) {
case "file:uploadstart":
this.fire("fileuploadstart", event);
break;
case "file:uploadprogress":
this.fire("uploadprogress", event);
break;
case "uploaderqueue:totaluploadprogress":
this.fire("totaluploadprogress", event);
break;
case "file:uploadcomplete":
this.fire("uploadcomplete", event);
break;
case "uploaderqueue:alluploadscomplete":
this.queue = null;
this.fire("alluploadscomplete", event);
break;
case "file:uploaderror":
case "uploaderqueue:uploaderror":
this.fire("uploaderror", event);
break;
case "file:uploadcancel":
case "uploaderqueue:uploadcancel":
this.fire("uploadcancel", event);
break;
}
},
/**
* Opens the File Selection dialog by simulating a click on the file input field.
*
* @method openFileSelectDialog
*/
openFileSelectDialog : function () {
var fileDomNode = this._fileInputField.getDOMNode();
if (fileDomNode.click) {
fileDomNode.click();
}
},
/**
* Starts the upload of a specific file.
*
* @method upload
* @param file {Y.File} Reference to the instance of the file to be uploaded.
* @param url {String} The URL to upload the file to.
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* If not specified, the values from the attribute `postVarsPerFile` are used instead.
*/
upload : function (file, url, postvars) {
var uploadURL = url || this.get("uploadURL"),
postVars = postvars || this.get("postVarsPerFile"),
fileId = file.get("id");
postVars = postVars.hasOwnProperty(fileId) ? postVars[fileId] : postVars;
if (file instanceof Y.FileHTML5) {
file.on("uploadstart", this._uploadEventHandler, this);
file.on("uploadprogress", this._uploadEventHandler, this);
file.on("uploadcomplete", this._uploadEventHandler, this);
file.on("uploaderror", this._uploadEventHandler, this);
file.on("uploadcancel", this._uploadEventHandler, this);
file.startUpload(uploadURL, postVars, this.get("fileFieldName"));
}
},
/**
* Starts the upload of all files on the file list, using an automated queue.
*
* @method uploadAll
* @param url {String} The URL to upload the files to.
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* If not specified, the values from the attribute `postVarsPerFile` are used instead.
*/
uploadAll : function (url, postvars) {
this.uploadThese(this.get("fileList"), url, postvars);
},
/**
* Starts the upload of the files specified in the first argument, using an automated queue.
*
* @method uploadThese
* @param files {Array} The list of files to upload.
* @param url {String} The URL to upload the files to.
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* If not specified, the values from the attribute `postVarsPerFile` are used instead.
*/
uploadThese : function (files, url, postvars) {
if (!this.queue) {
var uploadURL = url || this.get("uploadURL"),
postVars = postvars || this.get("postVarsPerFile");
this.queue = new UploaderQueue({simUploads: this.get("simLimit"),
errorAction: this.get("errorAction"),
fileFieldName: this.get("fileFieldName"),
fileList: files,
uploadURL: uploadURL,
perFileParameters: postVars,
retryCount: this.get("retryCount"),
uploadHeaders: this.get("uploadHeaders"),
withCredentials: this.get("withCredentials")
});
this.queue.on("uploadstart", this._uploadEventHandler, this);
this.queue.on("uploadprogress", this._uploadEventHandler, this);
this.queue.on("totaluploadprogress", this._uploadEventHandler, this);
this.queue.on("uploadcomplete", this._uploadEventHandler, this);
this.queue.on("alluploadscomplete", this._uploadEventHandler, this);
this.queue.on("uploadcancel", this._uploadEventHandler, this);
this.queue.on("uploaderror", this._uploadEventHandler, this);
this.queue.startUpload();
this.fire("uploadstart");
}
else if (this.queue._currentState === UploaderQueue.UPLOADING) {
this.queue.set("perFileParameters", this.get("postVarsPerFile"));
Y.each(files, function (file) {
this.queue.addToQueueBottom(file);
}, this);
}
}
},
{
/**
* The template for the hidden file input field container. The file input field will only
* accept clicks if its visibility is set to hidden (and will not if it's `display` value
* is set to `none`)
*
* @property HTML5FILEFIELD_TEMPLATE
* @type {String}
* @static
*/
HTML5FILEFIELD_TEMPLATE: "<input type='file' style='visibility:hidden; width:0px; height: 0px;'>",
/**
* The template for the "Select Files" button.
*
* @property SELECT_FILES_BUTTON
* @type {String}
* @static
* @default "<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>"
*/
SELECT_FILES_BUTTON: "<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>",
/**
* The static property reflecting the type of uploader that `Y.Uploader`
* aliases. The UploaderHTML5 value is `"html5"`.
*
* @property TYPE
* @type {String}
* @static
*/
TYPE: "html5",
/**
* The identity of the widget.
*
* @property NAME
* @type String
* @default 'uploader'
* @readOnly
* @protected
* @static
*/
NAME: "uploader",
/**
* Static property used to define the default attribute configuration of
* the Widget.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* A Boolean indicating whether newly selected files should be appended
* to the existing file list, or whether they should replace it.
*
* @attribute appendNewFiles
* @type {Boolean}
* @default true
*/
appendNewFiles : {
value: true
},
/**
* The names of CSS classes that correspond to different button states
* of the "Select Files" control. These classes are assigned to the
* "Select Files" control based on the configuration of the uploader.
* Currently, the only class name used is that corresponding to the
* `disabled` state of the uploader. Other button states should be managed
* directly via CSS selectors.
* <ul>
* <li> <strong>`disabled`</strong>: the class corresponding to the disabled state
* of the "Select Files" button.</li>
* </ul>
* @attribute buttonClassNames
* @type {Object}
* @default {
* disabled: "yui3-button-disabled"
* }
*/
buttonClassNames: {
value: {
"hover": "yui3-button-hover",
"active": "yui3-button-active",
"disabled": "yui3-button-disabled",
"focus": "yui3-button-selected"
}
},
/**
* The node that serves as the drop target for files.
*
* @attribute dragAndDropArea
* @type {Node}
* @default null
*/
dragAndDropArea: {
value: null,
setter: function (val) {
return Y.one(val);
}
},
/**
* A Boolean indicating whether the uploader is enabled or disabled for user input.
*
* @attribute enabled
* @type {Boolean}
* @default true
*/
enabled : {
value: true
},
/**
* The action performed when an upload error occurs for a specific file being uploaded.
* The possible values are:
* <ul>
* <li> <strong>`UploaderQueue.CONTINUE`</strong>: the error is ignored and the upload process is continued.</li>
* <li> <strong>`UploaderQueue.STOP`</strong>: the upload process is stopped as soon as any other parallel file
* uploads are finished.</li>
* <li> <strong>`UploaderQueue.RESTART_ASAP`</strong>: the file is added back to the front of the queue.</li>
* <li> <strong>`UploaderQueue.RESTART_AFTER`</strong>: the file is added to the back of the queue.</li>
* </ul>
* @attribute errorAction
* @type {String}
* @default UploaderQueue.CONTINUE
*/
errorAction: {
value: "continue",
validator: function (val, name) {
return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER); }
},
/**
* An array indicating what fileFilters should be applied to the file
* selection dialog. Each element in the array should be a string
* indicating the Media (MIME) type for the files that should be supported
* for selection. The Media type strings should be properly formatted
* or this parameter will be ignored. Examples of valid strings include:
* "audio/*", "video/*", "application/pdf", etc. More information
* on valid Media type strings is available here:
* http://www.iana.org/assignments/media-types/index.html
* @attribute fileFilters
* @type {Array}
* @default []
*/
fileFilters: {
value: []
},
/**
* A filtering function that is applied to every file selected by the user.
* The function receives the `Y.File` object and must return a Boolean value.
* If a `false` value is returned, the file in question is not added to the
* list of files to be uploaded.
* Use this function to put limits on file sizes or check the file names for
* correct extension, but make sure that a server-side check is also performed,
* since any client-side restrictions are only advisory and can be circumvented.
*
* @attribute fileFilterFunction
* @type {Function}
* @default null
*/
fileFilterFunction: {
value: null
},
/**
* A String specifying what should be the POST field name for the file
* content in the upload request.
*
* @attribute fileFieldName
* @type {String}
* @default Filedata
*/
fileFieldName: {
value: "Filedata"
},
/**
* The array of files to be uploaded. All elements in the array
* must be instances of `Y.File` and be instantiated with an instance
* of native JavaScript File() class.
*
* @attribute fileList
* @type {Array}
* @default []
*/
fileList: {
value: [],
getter: "_getFileList",
setter: "_setFileList"
},
/**
* A Boolean indicating whether multiple file selection is enabled.
*
* @attribute multipleFiles
* @type {Boolean}
* @default false
*/
multipleFiles: {
value: false
},
/**
* An object, keyed by `fileId`, containing sets of key-value pairs
* that should be passed as POST variables along with each corresponding
* file. This attribute is only used if no POST variables are specifed
* in the upload method call.
*
* @attribute postVarsPerFile
* @type {Object}
* @default {}
*/
postVarsPerFile: {
value: {}
},
/**
* The label for the "Select Files" widget. This is the value that replaces the
* `{selectButtonLabel}` token in the `SELECT_FILES_BUTTON` template.
*
* @attribute selectButtonLabel
* @type {String}
* @default "Select Files"
*/
selectButtonLabel: {
value: "Select Files"
},
/**
* The widget that serves as the "Select Files control for the file uploader
*
*
* @attribute selectFilesButton
* @type {Node | Widget}
* @default A standard HTML button with YUI CSS Button skin.
*/
selectFilesButton : {
valueFn: function () {
return Y.Node.create(substitute(Y.UploaderHTML5.SELECT_FILES_BUTTON, {selectButtonLabel: this.get("selectButtonLabel"),
tabIndex: this.get("tabIndex")}));
}
},
/**
* The number of files that can be uploaded
* simultaneously if the automatic queue management
* is used. This value can be in the range between 2
* and 5.
*
* @attribute simLimit
* @type {Number}
* @default 2
*/
simLimit: {
value: 2,
validator: function (val, name) {
return (val >= 1 && val <= 5);
}
},
/**
* The URL to which file upload requested are POSTed. Only used if a different url is not passed to the upload method call.
*
* @attribute uploadURL
* @type {String}
* @default ""
*/
uploadURL: {
value: ""
},
/**
* Additional HTTP headers that should be included
* in the upload request.
*
*
* @attribute uploadHeaders
* @type {Object}
* @default {}
*/
uploadHeaders: {
value: {}
},
/**
* A Boolean that specifies whether the file should be
* uploaded with the appropriate user credentials for the
* domain.
*
* @attribute withCredentials
* @type {Boolean}
* @default true
*/
withCredentials: {
value: true
},
/**
* The number of times to try re-uploading a file that failed to upload before
* cancelling its upload.
*
* @attribute retryCount
* @type {Number}
* @default 3
*/
retryCount: {
value: 3
}
}
});
Y.UploaderHTML5.Queue = UploaderQueue;
}, '3.7.3', {"requires": ["widget", "node-event-simulate", "substitute", "file-html5", "uploader-queue"]});
File diff suppressed because one or more lines are too long
@@ -1,989 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('uploader-html5', function (Y, NAME) {
/**
* This module provides a UI for file selection and multiple file upload capability using
* HTML5 XMLHTTPRequest Level 2 as a transport engine.
* The supported features include: automatic upload queue management, upload progress
* tracking, drag-and-drop support, server response retrieval and error reporting.
*
* @module uploader-html5
*/
// Shorthands for the external modules
var substitute = Y.substitute,
UploaderQueue = Y.Uploader.Queue;
/**
* This module provides a UI for file selection and multiple file upload capability using
* HTML5 XMLHTTPRequest Level 2 as a transport engine.
* @class UploaderHTML5
* @extends Widget
* @constructor
*/
function UploaderHTML5(config) {
UploaderHTML5.superclass.constructor.apply ( this, arguments );
}
Y.UploaderHTML5 = Y.extend( UploaderHTML5, Y.Widget, {
/**
* Stored reference to the instance of the file input field used to
* initiate the file selection dialog.
*
* @property _fileInputField
* @type {Node}
* @protected
*/
_fileInputField: null,
/**
* Stored reference to the click event binding of the `Select Files`
* button.
*
* @property _buttonBinding
* @type {EventHandle}
* @protected
*/
_buttonBinding: null,
/**
* Stored reference to the instance of Uploader.Queue used to manage
* the upload process. This is a read-only property that only exists
* during an active upload process. Only one queue can be active at
* a time; if an upload start is attempted while a queue is active,
* it will be ignored.
*
* @property queue
* @type {Y.Uploader.Queue}
*/
queue: null,
// Y.UploaderHTML5 prototype
/**
* Construction logic executed during UploaderHTML5 instantiation.
*
* @method initializer
* @protected
*/
initializer : function () {
this._fileInputField = null;
this.queue = null;
this._buttonBinding = null;
this._fileList = [];
// Publish available events
/**
* Signals that files have been selected.
*
* @event fileselect
* @param event {Event} The event object for the `fileselect` with the
* following payload:
* <dl>
* <dt>fileList</dt>
* <dd>An `Array` of files selected by the user, encapsulated
* in Y.FileHTML5 objects.</dd>
* </dl>
*/
this.publish("fileselect");
/**
* Signals that an upload of multiple files has been started.
*
* @event uploadstart
* @param event {Event} The event object for the `uploadstart`.
*/
this.publish("uploadstart");
/**
* Signals that an upload of a specific file has started.
*
* @event fileuploadstart
* @param event {Event} The event object for the `fileuploadstart` with the
* following payload:
* <dl>
* <dt>file</dt>
* <dd>A reference to the Y.File that dispatched the event.</dd>
* <dt>originEvent</dt>
* <dd>The original event dispatched by Y.File.</dd>
* </dl>
*/
this.publish("fileuploadstart");
/**
* Reports on upload progress of a specific file.
*
* @event uploadprogress
* @param event {Event} The event object for the `uploadprogress` with the
* following payload:
* <dl>
* <dt>file</dt>
* <dd>The pointer to the instance of `Y.File` that dispatched the event.</dd>
* <dt>bytesLoaded</dt>
* <dd>The number of bytes of the file that has been uploaded</dd>
* <dt>bytesTotal</dt>
* <dd>The total number of bytes in the file</dd>
* <dt>percentLoaded</dt>
* <dd>The fraction of the file that has been uploaded, out of 100</dd>
* <dt>originEvent</dt>
* <dd>The original event dispatched by the HTML5 uploader</dd>
* </dl>
*/
this.publish("uploadprogress");
/**
* Reports on the total upload progress of the file list.
*
* @event totaluploadprogress
* @param event {Event} The event object for the `totaluploadprogress` with the
* following payload:
* <dl>
* <dt>bytesLoaded</dt>
* <dd>The number of bytes of the file list that has been uploaded</dd>
* <dt>bytesTotal</dt>
* <dd>The total number of bytes in the file list</dd>
* <dt>percentLoaded</dt>
* <dd>The fraction of the file list that has been uploaded, out of 100</dd>
* </dl>
*/
this.publish("totaluploadprogress");
/**
* Signals that a single file upload has been completed.
*
* @event uploadcomplete
* @param event {Event} The event object for the `uploadcomplete` with the
* following payload:
* <dl>
* <dt>file</dt>
* <dd>The pointer to the instance of `Y.File` whose upload has been completed.</dd>
* <dt>originEvent</dt>
* <dd>The original event fired by the SWF Uploader</dd>
* <dt>data</dt>
* <dd>Data returned by the server.</dd>
* </dl>
*/
this.publish("uploadcomplete");
/**
* Signals that the upload process of the entire file list has been completed.
*
* @event alluploadscomplete
* @param event {Event} The event object for the `alluploadscomplete`.
*/
this.publish("alluploadscomplete");
/**
* Signals that a error has occurred in a specific file's upload process.
*
* @event uploaderror
* @param event {Event} The event object for the `uploaderror` with the
* following payload:
* <dl>
* <dt>originEvent</dt>
* <dd>The original error event fired by the HTML5 Uploader. </dd>
* <dt>file</dt>
* <dd>The pointer at the instance of Y.File that returned the error.</dd>
* <dt>status</dt>
* <dd>The status reported by the XMLHttpRequest object.</dd>
* <dt>statusText</dt>
* <dd>The statusText reported by the XMLHttpRequest object.</dd>
* </dl>
*/
this.publish("uploaderror");
/**
* Signals that a dragged object has entered into the uploader's associated drag-and-drop area.
*
* @event dragenter
* @param event {Event} The event object for the `dragenter`.
*/
this.publish("dragenter");
/**
* Signals that an object has been dragged over the uploader's associated drag-and-drop area.
*
* @event dragover
* @param event {Event} The event object for the `dragover`.
*/
this.publish("dragover");
/**
* Signals that an object has been dragged off of the uploader's associated drag-and-drop area.
*
* @event dragleave
* @param event {Event} The event object for the `dragleave`.
*/
this.publish("dragleave");
/**
* Signals that an object has been dropped over the uploader's associated drag-and-drop area.
*
* @event drop
* @param event {Event} The event object for the `drop`.
*/
this.publish("drop");
},
/**
* Create the DOM structure for the UploaderHTML5.
* UploaderHTML5's DOM structure consists of a "Select Files" button that can
* be replaced by the developer's widget of choice; and a hidden file input field
* that is used to instantiate the File Select dialog.
*
* @method renderUI
* @protected
*/
renderUI : function () {
var boundingBox = this.get("boundingBox"),
contentBox = this.get('contentBox'),
selButton = this.get("selectFilesButton");
selButton.setStyles({width:"100%", height:"100%"});
contentBox.append(selButton);
this._fileInputField = Y.Node.create(UploaderHTML5.HTML5FILEFIELD_TEMPLATE);
contentBox.append(this._fileInputField);
},
/**
* Binds to the UploaderHTML5 UI and subscribes to the necessary events.
*
* @method bindUI
* @protected
*/
bindUI : function () {
this._bindSelectButton();
this._setMultipleFiles();
this._setFileFilters();
this._bindDropArea();
this._triggerEnabled();
this.after("multipleFilesChange", this._setMultipleFiles, this);
this.after("fileFiltersChange", this._setFileFilters, this);
this.after("enabledChange", this._triggerEnabled, this);
this.after("selectFilesButtonChange", this._bindSelectButton, this);
this.after("dragAndDropAreaChange", this._bindDropArea, this);
this.after("tabIndexChange", function (ev) {this.get("selectFilesButton").set("tabIndex", this.get("tabIndex"));}, this);
this._fileInputField.on("change", this._updateFileList, this);
this.get("selectFilesButton").set("tabIndex", this.get("tabIndex"));
},
/**
* Recreates the file field to null out the previous list of files and
* thus allow for an identical file list selection.
*
* @method _rebindFileField
* @protected
*/
_rebindFileField : function () {
this._fileInputField.remove(true);
this._fileInputField = Y.Node.create(UploaderHTML5.HTML5FILEFIELD_TEMPLATE);
this.get("contentBox").append(this._fileInputField);
this._fileInputField.on("change", this._updateFileList, this);
this._setMultipleFiles();
this._setFileFilters();
},
/**
* Binds the specified drop area's drag and drop events to the
* uploader's custom handler.
*
* @method _bindDropArea
* @protected
*/
_bindDropArea : function (event) {
var ev = event || {prevVal: null};
if (ev.prevVal !== null) {
ev.prevVal.detach('drop', this._ddEventHandler);
ev.prevVal.detach('dragenter', this._ddEventHandler);
ev.prevVal.detach('dragover', this._ddEventHandler);
ev.prevVal.detach('dragleave', this._ddEventHandler);
}
var ddArea = this.get("dragAndDropArea");
if (ddArea !== null) {
ddArea.on('drop', this._ddEventHandler, this);
ddArea.on('dragenter', this._ddEventHandler, this);
ddArea.on('dragover', this._ddEventHandler, this);
ddArea.on('dragleave', this._ddEventHandler, this);
}
},
/**
* Binds the instantiation of the file select dialog to the current file select
* control.
*
* @method _bindSelectButton
* @protected
*/
_bindSelectButton : function () {
this._buttonBinding = this.get("selectFilesButton").on("click", this.openFileSelectDialog, this);
},
/**
* Handles the drag and drop events from the uploader's specified drop
* area.
*
* @method _ddEventHandler
* @protected
*/
_ddEventHandler : function (event) {
event.stopPropagation();
event.preventDefault();
switch (event.type) {
case "dragenter":
this.fire("dragenter");
break;
case "dragover":
this.fire("dragover");
break;
case "dragleave":
this.fire("dragleave");
break;
case "drop":
var newfiles = event._event.dataTransfer.files,
parsedFiles = [],
filterFunc = this.get("fileFilterFunction");
if (filterFunc) {
Y.each(newfiles, function (value) {
var newfile = new Y.FileHTML5(value);
if (filterFunc(newfile)) {
parsedFiles.push(newfile);
}
});
}
else {
Y.each(newfiles, function (value) {
parsedFiles.push(new Y.FileHTML5(value));
});
}
if (parsedFiles.length > 0) {
var oldfiles = this.get("fileList");
this.set("fileList",
this.get("appendNewFiles") ? oldfiles.concat(parsedFiles) : parsedFiles);
this.fire("fileselect", {fileList: parsedFiles});
}
this.fire("drop");
break;
}
},
/**
* Adds or removes a specified state CSS class to the underlying uploader button.
*
* @method _setButtonClass
* @protected
* @param state {String} The name of the state enumerated in `buttonClassNames` attribute
* from which to derive the needed class name.
* @param add {Boolean} A Boolean indicating whether to add or remove the class.
*/
_setButtonClass : function (state, add) {
if (add) {
this.get("selectFilesButton").addClass(this.get("buttonClassNames")[state]);
}
else {
this.get("selectFilesButton").removeClass(this.get("buttonClassNames")[state]);
}
},
/**
* Syncs the state of the `multipleFiles` attribute between this class
* and the file input field.
*
* @method _setMultipleFiles
* @protected
*/
_setMultipleFiles : function () {
if (this.get("multipleFiles") === true) {
this._fileInputField.set("multiple", "multiple");
}
else {
this._fileInputField.set("multiple", "");
}
},
/**
* Syncs the state of the `fileFilters` attribute between this class
* and the file input field.
*
* @method _setFileFilters
* @protected
*/
_setFileFilters : function () {
if (this.get("fileFilters").length > 0) {
this._fileInputField.set("accept", this.get("fileFilters").join(","));
}
else {
this._fileInputField.set("accept", "");
}
},
/**
* Syncs the state of the `enabled` attribute between this class
* and the underlying button.
*
* @method _triggerEnabled
* @private
*/
_triggerEnabled : function () {
if (this.get("enabled") && this._buttonBinding === null) {
this._bindSelectButton();
this._setButtonClass("disabled", false);
this.get("selectFilesButton").setAttribute("aria-disabled", "false");
}
else if (!this.get("enabled") && this._buttonBinding) {
this._buttonBinding.detach();
this._buttonBinding = null;
this._setButtonClass("disabled", true);
this.get("selectFilesButton").setAttribute("aria-disabled", "true");
}
},
/**
* Getter for the `fileList` attribute
*
* @method _getFileList
* @private
*/
_getFileList : function (arr) {
return this._fileList.concat();
},
/**
* Setter for the `fileList` attribute
*
* @method _setFileList
* @private
*/
_setFileList : function (val) {
this._fileList = val.concat();
return this._fileList.concat();
},
/**
* Adjusts the content of the `fileList` based on the results of file selection
* and the `appendNewFiles` attribute. If the `appendNewFiles` attribute is true,
* then selected files are appended to the existing list; otherwise, the list is
* cleared and populated with the newly selected files.
*
* @method _updateFileList
* @param ev {Event} The file selection event received from the uploader.
* @protected
*/
_updateFileList : function (ev) {
var newfiles = ev.target.getDOMNode().files,
parsedFiles = [],
filterFunc = this.get("fileFilterFunction");
if (filterFunc) {
Y.each(newfiles, function (value) {
var newfile = new Y.FileHTML5(value);
if (filterFunc(newfile)) {
parsedFiles.push(newfile);
}
});
}
else {
Y.each(newfiles, function (value) {
parsedFiles.push(new Y.FileHTML5(value));
});
}
if (parsedFiles.length > 0) {
var oldfiles = this.get("fileList");
this.set("fileList",
this.get("appendNewFiles") ? oldfiles.concat(parsedFiles) : parsedFiles );
this.fire("fileselect", {fileList: parsedFiles});
}
this._rebindFileField();
},
/**
* Handles and retransmits events fired by `Y.File` and `Y.Uploader.Queue`.
*
* @method _uploadEventHandler
* @param event The event dispatched during the upload process.
* @protected
*/
_uploadEventHandler : function (event) {
switch (event.type) {
case "file:uploadstart":
this.fire("fileuploadstart", event);
break;
case "file:uploadprogress":
this.fire("uploadprogress", event);
break;
case "uploaderqueue:totaluploadprogress":
this.fire("totaluploadprogress", event);
break;
case "file:uploadcomplete":
this.fire("uploadcomplete", event);
break;
case "uploaderqueue:alluploadscomplete":
this.queue = null;
this.fire("alluploadscomplete", event);
break;
case "file:uploaderror":
case "uploaderqueue:uploaderror":
this.fire("uploaderror", event);
break;
case "file:uploadcancel":
case "uploaderqueue:uploadcancel":
this.fire("uploadcancel", event);
break;
}
},
/**
* Opens the File Selection dialog by simulating a click on the file input field.
*
* @method openFileSelectDialog
*/
openFileSelectDialog : function () {
var fileDomNode = this._fileInputField.getDOMNode();
if (fileDomNode.click) {
fileDomNode.click();
}
},
/**
* Starts the upload of a specific file.
*
* @method upload
* @param file {Y.File} Reference to the instance of the file to be uploaded.
* @param url {String} The URL to upload the file to.
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* If not specified, the values from the attribute `postVarsPerFile` are used instead.
*/
upload : function (file, url, postvars) {
var uploadURL = url || this.get("uploadURL"),
postVars = postvars || this.get("postVarsPerFile"),
fileId = file.get("id");
postVars = postVars.hasOwnProperty(fileId) ? postVars[fileId] : postVars;
if (file instanceof Y.FileHTML5) {
file.on("uploadstart", this._uploadEventHandler, this);
file.on("uploadprogress", this._uploadEventHandler, this);
file.on("uploadcomplete", this._uploadEventHandler, this);
file.on("uploaderror", this._uploadEventHandler, this);
file.on("uploadcancel", this._uploadEventHandler, this);
file.startUpload(uploadURL, postVars, this.get("fileFieldName"));
}
},
/**
* Starts the upload of all files on the file list, using an automated queue.
*
* @method uploadAll
* @param url {String} The URL to upload the files to.
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* If not specified, the values from the attribute `postVarsPerFile` are used instead.
*/
uploadAll : function (url, postvars) {
this.uploadThese(this.get("fileList"), url, postvars);
},
/**
* Starts the upload of the files specified in the first argument, using an automated queue.
*
* @method uploadThese
* @param files {Array} The list of files to upload.
* @param url {String} The URL to upload the files to.
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* If not specified, the values from the attribute `postVarsPerFile` are used instead.
*/
uploadThese : function (files, url, postvars) {
if (!this.queue) {
var uploadURL = url || this.get("uploadURL"),
postVars = postvars || this.get("postVarsPerFile");
this.queue = new UploaderQueue({simUploads: this.get("simLimit"),
errorAction: this.get("errorAction"),
fileFieldName: this.get("fileFieldName"),
fileList: files,
uploadURL: uploadURL,
perFileParameters: postVars,
retryCount: this.get("retryCount"),
uploadHeaders: this.get("uploadHeaders"),
withCredentials: this.get("withCredentials")
});
this.queue.on("uploadstart", this._uploadEventHandler, this);
this.queue.on("uploadprogress", this._uploadEventHandler, this);
this.queue.on("totaluploadprogress", this._uploadEventHandler, this);
this.queue.on("uploadcomplete", this._uploadEventHandler, this);
this.queue.on("alluploadscomplete", this._uploadEventHandler, this);
this.queue.on("uploadcancel", this._uploadEventHandler, this);
this.queue.on("uploaderror", this._uploadEventHandler, this);
this.queue.startUpload();
this.fire("uploadstart");
}
else if (this.queue._currentState === UploaderQueue.UPLOADING) {
this.queue.set("perFileParameters", this.get("postVarsPerFile"));
Y.each(files, function (file) {
this.queue.addToQueueBottom(file);
}, this);
}
}
},
{
/**
* The template for the hidden file input field container. The file input field will only
* accept clicks if its visibility is set to hidden (and will not if it's `display` value
* is set to `none`)
*
* @property HTML5FILEFIELD_TEMPLATE
* @type {String}
* @static
*/
HTML5FILEFIELD_TEMPLATE: "<input type='file' style='visibility:hidden; width:0px; height: 0px;'>",
/**
* The template for the "Select Files" button.
*
* @property SELECT_FILES_BUTTON
* @type {String}
* @static
* @default "<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>"
*/
SELECT_FILES_BUTTON: "<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>",
/**
* The static property reflecting the type of uploader that `Y.Uploader`
* aliases. The UploaderHTML5 value is `"html5"`.
*
* @property TYPE
* @type {String}
* @static
*/
TYPE: "html5",
/**
* The identity of the widget.
*
* @property NAME
* @type String
* @default 'uploader'
* @readOnly
* @protected
* @static
*/
NAME: "uploader",
/**
* Static property used to define the default attribute configuration of
* the Widget.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* A Boolean indicating whether newly selected files should be appended
* to the existing file list, or whether they should replace it.
*
* @attribute appendNewFiles
* @type {Boolean}
* @default true
*/
appendNewFiles : {
value: true
},
/**
* The names of CSS classes that correspond to different button states
* of the "Select Files" control. These classes are assigned to the
* "Select Files" control based on the configuration of the uploader.
* Currently, the only class name used is that corresponding to the
* `disabled` state of the uploader. Other button states should be managed
* directly via CSS selectors.
* <ul>
* <li> <strong>`disabled`</strong>: the class corresponding to the disabled state
* of the "Select Files" button.</li>
* </ul>
* @attribute buttonClassNames
* @type {Object}
* @default {
* disabled: "yui3-button-disabled"
* }
*/
buttonClassNames: {
value: {
"hover": "yui3-button-hover",
"active": "yui3-button-active",
"disabled": "yui3-button-disabled",
"focus": "yui3-button-selected"
}
},
/**
* The node that serves as the drop target for files.
*
* @attribute dragAndDropArea
* @type {Node}
* @default null
*/
dragAndDropArea: {
value: null,
setter: function (val) {
return Y.one(val);
}
},
/**
* A Boolean indicating whether the uploader is enabled or disabled for user input.
*
* @attribute enabled
* @type {Boolean}
* @default true
*/
enabled : {
value: true
},
/**
* The action performed when an upload error occurs for a specific file being uploaded.
* The possible values are:
* <ul>
* <li> <strong>`UploaderQueue.CONTINUE`</strong>: the error is ignored and the upload process is continued.</li>
* <li> <strong>`UploaderQueue.STOP`</strong>: the upload process is stopped as soon as any other parallel file
* uploads are finished.</li>
* <li> <strong>`UploaderQueue.RESTART_ASAP`</strong>: the file is added back to the front of the queue.</li>
* <li> <strong>`UploaderQueue.RESTART_AFTER`</strong>: the file is added to the back of the queue.</li>
* </ul>
* @attribute errorAction
* @type {String}
* @default UploaderQueue.CONTINUE
*/
errorAction: {
value: "continue",
validator: function (val, name) {
return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER); }
},
/**
* An array indicating what fileFilters should be applied to the file
* selection dialog. Each element in the array should be a string
* indicating the Media (MIME) type for the files that should be supported
* for selection. The Media type strings should be properly formatted
* or this parameter will be ignored. Examples of valid strings include:
* "audio/*", "video/*", "application/pdf", etc. More information
* on valid Media type strings is available here:
* http://www.iana.org/assignments/media-types/index.html
* @attribute fileFilters
* @type {Array}
* @default []
*/
fileFilters: {
value: []
},
/**
* A filtering function that is applied to every file selected by the user.
* The function receives the `Y.File` object and must return a Boolean value.
* If a `false` value is returned, the file in question is not added to the
* list of files to be uploaded.
* Use this function to put limits on file sizes or check the file names for
* correct extension, but make sure that a server-side check is also performed,
* since any client-side restrictions are only advisory and can be circumvented.
*
* @attribute fileFilterFunction
* @type {Function}
* @default null
*/
fileFilterFunction: {
value: null
},
/**
* A String specifying what should be the POST field name for the file
* content in the upload request.
*
* @attribute fileFieldName
* @type {String}
* @default Filedata
*/
fileFieldName: {
value: "Filedata"
},
/**
* The array of files to be uploaded. All elements in the array
* must be instances of `Y.File` and be instantiated with an instance
* of native JavaScript File() class.
*
* @attribute fileList
* @type {Array}
* @default []
*/
fileList: {
value: [],
getter: "_getFileList",
setter: "_setFileList"
},
/**
* A Boolean indicating whether multiple file selection is enabled.
*
* @attribute multipleFiles
* @type {Boolean}
* @default false
*/
multipleFiles: {
value: false
},
/**
* An object, keyed by `fileId`, containing sets of key-value pairs
* that should be passed as POST variables along with each corresponding
* file. This attribute is only used if no POST variables are specifed
* in the upload method call.
*
* @attribute postVarsPerFile
* @type {Object}
* @default {}
*/
postVarsPerFile: {
value: {}
},
/**
* The label for the "Select Files" widget. This is the value that replaces the
* `{selectButtonLabel}` token in the `SELECT_FILES_BUTTON` template.
*
* @attribute selectButtonLabel
* @type {String}
* @default "Select Files"
*/
selectButtonLabel: {
value: "Select Files"
},
/**
* The widget that serves as the "Select Files control for the file uploader
*
*
* @attribute selectFilesButton
* @type {Node | Widget}
* @default A standard HTML button with YUI CSS Button skin.
*/
selectFilesButton : {
valueFn: function () {
return Y.Node.create(substitute(Y.UploaderHTML5.SELECT_FILES_BUTTON, {selectButtonLabel: this.get("selectButtonLabel"),
tabIndex: this.get("tabIndex")}));
}
},
/**
* The number of files that can be uploaded
* simultaneously if the automatic queue management
* is used. This value can be in the range between 2
* and 5.
*
* @attribute simLimit
* @type {Number}
* @default 2
*/
simLimit: {
value: 2,
validator: function (val, name) {
return (val >= 1 && val <= 5);
}
},
/**
* The URL to which file upload requested are POSTed. Only used if a different url is not passed to the upload method call.
*
* @attribute uploadURL
* @type {String}
* @default ""
*/
uploadURL: {
value: ""
},
/**
* Additional HTTP headers that should be included
* in the upload request.
*
*
* @attribute uploadHeaders
* @type {Object}
* @default {}
*/
uploadHeaders: {
value: {}
},
/**
* A Boolean that specifies whether the file should be
* uploaded with the appropriate user credentials for the
* domain.
*
* @attribute withCredentials
* @type {Boolean}
* @default true
*/
withCredentials: {
value: true
},
/**
* The number of times to try re-uploading a file that failed to upload before
* cancelling its upload.
*
* @attribute retryCount
* @type {Number}
* @default 3
*/
retryCount: {
value: 3
}
}
});
Y.UploaderHTML5.Queue = UploaderQueue;
}, '3.7.3', {"requires": ["widget", "node-event-simulate", "substitute", "file-html5", "uploader-queue"]});
File diff suppressed because one or more lines are too long
@@ -1,661 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('uploader-queue', function (Y, NAME) {
/**
* The class manages a queue of files that should be uploaded to the server.
* It initializes the required number of uploads, tracks them as they progress,
* and automatically advances to the next upload when a preceding one has completed.
* @module uploader-queue
*/
var Lang = Y.Lang,
Bind = Y.bind,
Win = Y.config.win,
queuedFiles,
numberOfUploads,
currentUploadedByteValues,
currentFiles,
totalBytesUploaded,
totalBytes;
/**
* This class manages a queue of files to be uploaded to the server.
* @class Uploader.Queue
* @extends Base
* @constructor
* @param {Object} config Configuration object
*/
var UploaderQueue = function(o) {
this.queuedFiles = [];
this.uploadRetries = {};
this.numberOfUploads = 0;
this.currentUploadedByteValues = {};
this.currentFiles = {};
this.totalBytesUploaded = 0;
this.totalBytes = 0;
UploaderQueue.superclass.constructor.apply(this, arguments);
};
Y.extend(UploaderQueue, Y.Base, {
/**
* Stored value of the current queue state
* @property _currentState
* @type {String}
* @protected
* @default UploaderQueue.STOPPED
*/
_currentState: UploaderQueue.STOPPED,
/**
* Construction logic executed during UploaderQueue instantiation.
*
* @method initializer
* @protected
*/
initializer : function (cfg) {
},
/**
* Handles and retransmits upload start event.
*
* @method _uploadStartHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadStartHandler : function (event) {
var updatedEvent = event;
updatedEvent.file = event.target;
updatedEvent.originEvent = event;
this.fire("uploadstart", updatedEvent);
},
/**
* Handles and retransmits upload error event.
*
* @method _uploadErrorHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadErrorHandler : function (event) {
var errorAction = this.get("errorAction");
var updatedEvent = event;
updatedEvent.file = event.target;
updatedEvent.originEvent = event;
this.numberOfUploads-=1;
delete this.currentFiles[event.target.get("id")];
this._detachFileEvents(event.target);
event.target.cancelUpload();
if (errorAction === UploaderQueue.STOP) {
this.pauseUpload();
}
else if (errorAction === UploaderQueue.RESTART_ASAP) {
var fileid = event.target.get("id"),
retries = this.uploadRetries[fileid] || 0;
if (retries < this.get("retryCount")) {
this.uploadRetries[fileid] = retries + 1;
this.addToQueueTop(event.target);
}
this._startNextFile();
}
else if (errorAction === UploaderQueue.RESTART_AFTER) {
var fileid = event.target.get("id"),
retries = this.uploadRetries[fileid] || 0;
if (retries < this.get("retryCount")) {
this.uploadRetries[fileid] = retries + 1;
this.addToQueueBottom(event.target);
}
this._startNextFile();
}
this.fire("uploaderror", updatedEvent);
},
/**
* Launches the upload of the next file in the queue.
*
* @method _startNextFile
* @private
*/
_startNextFile : function () {
if (this.queuedFiles.length > 0) {
var currentFile = this.queuedFiles.shift(),
fileId = currentFile.get("id"),
parameters = this.get("perFileParameters"),
fileParameters = parameters.hasOwnProperty(fileId) ? parameters[fileId] : parameters;
this.currentUploadedByteValues[fileId] = 0;
currentFile.on("uploadstart", this._uploadStartHandler, this);
currentFile.on("uploadprogress", this._uploadProgressHandler, this);
currentFile.on("uploadcomplete", this._uploadCompleteHandler, this);
currentFile.on("uploaderror", this._uploadErrorHandler, this);
currentFile.on("uploadcancel", this._uploadCancelHandler, this);
currentFile.set("xhrHeaders", this.get("uploadHeaders"));
currentFile.set("xhrWithCredentials", this.get("withCredentials"));
currentFile.startUpload(this.get("uploadURL"), fileParameters, this.get("fileFieldName"));
this._registerUpload(currentFile);
}
},
/**
* Register a new upload process.
*
* @method _registerUpload
* @private
*/
_registerUpload : function (file) {
this.numberOfUploads += 1;
this.currentFiles[file.get("id")] = file;
},
/**
* Unregisters a new upload process.
*
* @method _unregisterUpload
* @private
*/
_unregisterUpload : function (file) {
if (this.numberOfUploads > 0) {
this.numberOfUploads -=1;
}
delete this.currentFiles[file.get("id")];
delete this.uploadRetries[file.get("id")];
this._detachFileEvents(file);
},
_detachFileEvents : function (file) {
file.detach("uploadstart", this._uploadStartHandler);
file.detach("uploadprogress", this._uploadProgressHandler);
file.detach("uploadcomplete", this._uploadCompleteHandler);
file.detach("uploaderror", this._uploadErrorHandler);
file.detach("uploadcancel", this._uploadCancelHandler);
},
/**
* Handles and retransmits upload complete event.
*
* @method _uploadCompleteHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadCompleteHandler : function (event) {
this._unregisterUpload(event.target);
this.totalBytesUploaded += event.target.get("size");
delete this.currentUploadedByteValues[event.target.get("id")];
if (this.queuedFiles.length > 0 && this._currentState === UploaderQueue.UPLOADING) {
this._startNextFile();
}
var updatedEvent = event;
updatedEvent.file = event.target;
updatedEvent.originEvent = event;
var uploadedTotal = this.totalBytesUploaded;
Y.each(this.currentUploadedByteValues, function (value) {
uploadedTotal += value;
});
var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);
this.fire("totaluploadprogress", {bytesLoaded: uploadedTotal,
bytesTotal: this.totalBytes,
percentLoaded: percentLoaded});
this.fire("uploadcomplete", updatedEvent);
if (this.queuedFiles.length === 0 && this.numberOfUploads <= 0) {
this.fire("alluploadscomplete");
this._currentState = UploaderQueue.STOPPED;
}
},
/**
* Handles and retransmits upload cancel event.
*
* @method _uploadCancelHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadCancelHandler : function (event) {
var updatedEvent = event;
updatedEvent.originEvent = event;
updatedEvent.file = event.target;
this.fire("uploadcacel", updatedEvent);
},
/**
* Handles and retransmits upload progress event.
*
* @method _uploadProgressHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadProgressHandler : function (event) {
this.currentUploadedByteValues[event.target.get("id")] = event.bytesLoaded;
var updatedEvent = event;
updatedEvent.originEvent = event;
updatedEvent.file = event.target;
this.fire("uploadprogress", updatedEvent);
var uploadedTotal = this.totalBytesUploaded;
Y.each(this.currentUploadedByteValues, function (value) {
uploadedTotal += value;
});
var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);
this.fire("totaluploadprogress", {bytesLoaded: uploadedTotal,
bytesTotal: this.totalBytes,
percentLoaded: percentLoaded});
},
/**
* Starts uploading the queued up file list.
*
* @method startUpload
*/
startUpload: function() {
this.queuedFiles = this.get("fileList").slice(0);
this.numberOfUploads = 0;
this.currentUploadedByteValues = {};
this.currentFiles = {};
this.totalBytesUploaded = 0;
this._currentState = UploaderQueue.UPLOADING;
while (this.numberOfUploads < this.get("simUploads") && this.queuedFiles.length > 0) {
this._startNextFile();
}
},
/**
* Pauses the upload process. The ongoing file uploads
* will complete after this method is called, but no
* new ones will be launched.
*
* @method pauseUpload
*/
pauseUpload: function () {
this._currentState = UploaderQueue.STOPPED;
},
/**
* Restarts a paused upload process.
*
* @method restartUpload
*/
restartUpload: function () {
this._currentState = UploaderQueue.UPLOADING;
while (this.numberOfUploads < this.get("simUploads")) {
this._startNextFile();
}
},
/**
* If a particular file is stuck in an ongoing upload without
* any progress events, this method allows to force its reupload
* by cancelling its upload and immediately relaunching it.
*
* @method forceReupload
* @param file {Y.File} The file to force reupload on.
*/
forceReupload : function (file) {
var id = file.get("id");
if (this.currentFiles.hasOwnProperty(id)) {
file.cancelUpload();
this._unregisterUpload(file);
this.addToQueueTop(file);
this._startNextFile();
}
},
/**
* Add a new file to the top of the queue (the upload will be
* launched as soon as the current number of uploading files
* drops below the maximum permissible value).
*
* @method addToQueueTop
* @param file {Y.File} The file to add to the top of the queue.
*/
addToQueueTop: function (file) {
this.queuedFiles.unshift(file);
},
/**
* Add a new file to the bottom of the queue (the upload will be
* launched after all the other queued files are uploaded.)
*
* @method addToQueueBottom
* @param file {Y.File} The file to add to the bottom of the queue.
*/
addToQueueBottom: function (file) {
this.queuedFiles.push(file);
},
/**
* Cancels a specific file's upload. If no argument is passed,
* all ongoing uploads are cancelled and the upload process is
* stopped.
*
* @method cancelUpload
* @param file {Y.File} An optional parameter - the file whose upload
* should be cancelled.
*/
cancelUpload: function (file) {
if (file) {
var id = file.get("id");
if (this.currentFiles[id]) {
this.currentFiles[id].cancelUpload();
this._unregisterUpload(this.currentFiles[id]);
if (this._currentState === UploaderQueue.UPLOADING) {
this._startNextFile();
}
}
else {
for (var i = 0, len = this.queuedFiles.length; i < len; i++) {
if (this.queuedFiles[i].get("id") === id) {
this.queuedFiles.splice(i, 1);
break;
}
}
}
}
else {
for (var fid in this.currentFiles) {
this.currentFiles[fid].cancelUpload();
this._unregisterUpload(this.currentFiles[fid]);
}
this.currentUploadedByteValues = {};
this.currentFiles = {};
this.totalBytesUploaded = 0;
this.fire("alluploadscancelled");
this._currentState = UploaderQueue.STOPPED;
}
}
},
{
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to continue uploading files in case of
* an error.
* @property CONTINUE
* @readOnly
* @type {String}
* @static
*/
CONTINUE: "continue",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to stop uploading files in case of
* an error.
* @property STOP
* @readOnly
* @type {String}
* @static
*/
STOP: "stop",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to restart a file upload immediately in case of
* an error.
* @property RESTART_ASAP
* @readOnly
* @type {String}
* @static
*/
RESTART_ASAP: "restartasap",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to restart an errored out file upload after
* other files have finished uploading.
* @property RESTART_AFTER
* @readOnly
* @type {String}
* @static
*/
RESTART_AFTER: "restartafter",
/**
* Static constant for the value of the `_currentState` property:
* implies that the queue is currently not uploading files.
* @property STOPPED
* @readOnly
* @type {String}
* @static
*/
STOPPED: "stopped",
/**
* Static constant for the value of the `_currentState` property:
* implies that the queue is currently uploading files.
* @property UPLOADING
* @readOnly
* @type {String}
* @static
*/
UPLOADING: "uploading",
/**
* The identity of the class.
*
* @property NAME
* @type String
* @default 'uploaderqueue'
* @readOnly
* @protected
* @static
*/
NAME: 'uploaderqueue',
/**
* Static property used to define the default attribute configuration of
* the class.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* Maximum number of simultaneous uploads; must be in the
* range between 1 and 5. The value of `2` is default. It
* is recommended that this value does not exceed 3.
* @property simUploads
* @type Number
* @default 2
*/
simUploads: {
value: 2,
validator: function (val, name) {
return (val >= 1 && val <= 5);
}
},
/**
* The action to take in case of error. The valid values for this attribute are:
* `Y.Uploader.Queue.CONTINUE` (the upload process should continue on other files,
* ignoring the error), `Y.Uploader.Queue.STOP` (the upload process
* should stop completely), `Y.Uploader.Queue.RESTART_ASAP` (the upload
* should restart immediately on the errored out file and continue as planned), or
* Y.Uploader.Queue.RESTART_AFTER (the upload of the errored out file should restart
* after all other files have uploaded)
* @property errorAction
* @type String
* @default Y.Uploader.Queue.CONTINUE
*/
errorAction: {
value: "continue",
validator: function (val, name) {
return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER);
}
},
/**
* The total number of bytes that has been uploaded.
* @property bytesUploaded
* @type Number
*/
bytesUploaded: {
readOnly: true,
value: 0
},
/**
* The total number of bytes in the queue.
* @property bytesTotal
* @type Number
*/
bytesTotal: {
readOnly: true,
value: 0
},
/**
* The queue file list. This file list should only be modified
* before the upload has been started; modifying it after starting
* the upload has no effect, and `addToQueueTop` or `addToQueueBottom` methods
* should be used instead.
* @property fileList
* @type Number
*/
fileList: {
value: [],
lazyAdd: false,
setter: function (val) {
var newValue = val;
Y.Array.each(newValue, function (value) {
this.totalBytes += value.get("size");
}, this);
return val;
}
},
/**
* A String specifying what should be the POST field name for the file
* content in the upload request.
*
* @attribute fileFieldName
* @type {String}
* @default Filedata
*/
fileFieldName: {
value: "Filedata"
},
/**
* The URL to POST the file upload requests to.
*
* @attribute uploadURL
* @type {String}
* @default ""
*/
uploadURL: {
value: ""
},
/**
* Additional HTTP headers that should be included
* in the upload request. Due to Flash Player security
* restrictions, this attribute is only honored in the
* HTML5 Uploader.
*
* @attribute uploadHeaders
* @type {Object}
* @default {}
*/
uploadHeaders: {
value: {}
},
/**
* A Boolean that specifies whether the file should be
* uploaded with the appropriate user credentials for the
* domain. Due to Flash Player security restrictions, this
* attribute is only honored in the HTML5 Uploader.
*
* @attribute withCredentials
* @type {Boolean}
* @default true
*/
withCredentials: {
value: true
},
/**
* An object, keyed by `fileId`, containing sets of key-value pairs
* that should be passed as POST variables along with each corresponding
* file.
*
* @attribute perFileParameters
* @type {Object}
* @default {}
*/
perFileParameters: {
value: {}
},
/**
* The number of times to try re-uploading a file that failed to upload before
* cancelling its upload.
*
* @attribute retryCount
* @type {Number}
* @default 3
*/
retryCount: {
value: 3
}
}
});
Y.namespace('Uploader');
Y.Uploader.Queue = UploaderQueue;
}, '3.7.3', {"requires": ["base"]});
File diff suppressed because one or more lines are too long
@@ -1,661 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('uploader-queue', function (Y, NAME) {
/**
* The class manages a queue of files that should be uploaded to the server.
* It initializes the required number of uploads, tracks them as they progress,
* and automatically advances to the next upload when a preceding one has completed.
* @module uploader-queue
*/
var Lang = Y.Lang,
Bind = Y.bind,
Win = Y.config.win,
queuedFiles,
numberOfUploads,
currentUploadedByteValues,
currentFiles,
totalBytesUploaded,
totalBytes;
/**
* This class manages a queue of files to be uploaded to the server.
* @class Uploader.Queue
* @extends Base
* @constructor
* @param {Object} config Configuration object
*/
var UploaderQueue = function(o) {
this.queuedFiles = [];
this.uploadRetries = {};
this.numberOfUploads = 0;
this.currentUploadedByteValues = {};
this.currentFiles = {};
this.totalBytesUploaded = 0;
this.totalBytes = 0;
UploaderQueue.superclass.constructor.apply(this, arguments);
};
Y.extend(UploaderQueue, Y.Base, {
/**
* Stored value of the current queue state
* @property _currentState
* @type {String}
* @protected
* @default UploaderQueue.STOPPED
*/
_currentState: UploaderQueue.STOPPED,
/**
* Construction logic executed during UploaderQueue instantiation.
*
* @method initializer
* @protected
*/
initializer : function (cfg) {
},
/**
* Handles and retransmits upload start event.
*
* @method _uploadStartHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadStartHandler : function (event) {
var updatedEvent = event;
updatedEvent.file = event.target;
updatedEvent.originEvent = event;
this.fire("uploadstart", updatedEvent);
},
/**
* Handles and retransmits upload error event.
*
* @method _uploadErrorHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadErrorHandler : function (event) {
var errorAction = this.get("errorAction");
var updatedEvent = event;
updatedEvent.file = event.target;
updatedEvent.originEvent = event;
this.numberOfUploads-=1;
delete this.currentFiles[event.target.get("id")];
this._detachFileEvents(event.target);
event.target.cancelUpload();
if (errorAction === UploaderQueue.STOP) {
this.pauseUpload();
}
else if (errorAction === UploaderQueue.RESTART_ASAP) {
var fileid = event.target.get("id"),
retries = this.uploadRetries[fileid] || 0;
if (retries < this.get("retryCount")) {
this.uploadRetries[fileid] = retries + 1;
this.addToQueueTop(event.target);
}
this._startNextFile();
}
else if (errorAction === UploaderQueue.RESTART_AFTER) {
var fileid = event.target.get("id"),
retries = this.uploadRetries[fileid] || 0;
if (retries < this.get("retryCount")) {
this.uploadRetries[fileid] = retries + 1;
this.addToQueueBottom(event.target);
}
this._startNextFile();
}
this.fire("uploaderror", updatedEvent);
},
/**
* Launches the upload of the next file in the queue.
*
* @method _startNextFile
* @private
*/
_startNextFile : function () {
if (this.queuedFiles.length > 0) {
var currentFile = this.queuedFiles.shift(),
fileId = currentFile.get("id"),
parameters = this.get("perFileParameters"),
fileParameters = parameters.hasOwnProperty(fileId) ? parameters[fileId] : parameters;
this.currentUploadedByteValues[fileId] = 0;
currentFile.on("uploadstart", this._uploadStartHandler, this);
currentFile.on("uploadprogress", this._uploadProgressHandler, this);
currentFile.on("uploadcomplete", this._uploadCompleteHandler, this);
currentFile.on("uploaderror", this._uploadErrorHandler, this);
currentFile.on("uploadcancel", this._uploadCancelHandler, this);
currentFile.set("xhrHeaders", this.get("uploadHeaders"));
currentFile.set("xhrWithCredentials", this.get("withCredentials"));
currentFile.startUpload(this.get("uploadURL"), fileParameters, this.get("fileFieldName"));
this._registerUpload(currentFile);
}
},
/**
* Register a new upload process.
*
* @method _registerUpload
* @private
*/
_registerUpload : function (file) {
this.numberOfUploads += 1;
this.currentFiles[file.get("id")] = file;
},
/**
* Unregisters a new upload process.
*
* @method _unregisterUpload
* @private
*/
_unregisterUpload : function (file) {
if (this.numberOfUploads > 0) {
this.numberOfUploads -=1;
}
delete this.currentFiles[file.get("id")];
delete this.uploadRetries[file.get("id")];
this._detachFileEvents(file);
},
_detachFileEvents : function (file) {
file.detach("uploadstart", this._uploadStartHandler);
file.detach("uploadprogress", this._uploadProgressHandler);
file.detach("uploadcomplete", this._uploadCompleteHandler);
file.detach("uploaderror", this._uploadErrorHandler);
file.detach("uploadcancel", this._uploadCancelHandler);
},
/**
* Handles and retransmits upload complete event.
*
* @method _uploadCompleteHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadCompleteHandler : function (event) {
this._unregisterUpload(event.target);
this.totalBytesUploaded += event.target.get("size");
delete this.currentUploadedByteValues[event.target.get("id")];
if (this.queuedFiles.length > 0 && this._currentState === UploaderQueue.UPLOADING) {
this._startNextFile();
}
var updatedEvent = event;
updatedEvent.file = event.target;
updatedEvent.originEvent = event;
var uploadedTotal = this.totalBytesUploaded;
Y.each(this.currentUploadedByteValues, function (value) {
uploadedTotal += value;
});
var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);
this.fire("totaluploadprogress", {bytesLoaded: uploadedTotal,
bytesTotal: this.totalBytes,
percentLoaded: percentLoaded});
this.fire("uploadcomplete", updatedEvent);
if (this.queuedFiles.length === 0 && this.numberOfUploads <= 0) {
this.fire("alluploadscomplete");
this._currentState = UploaderQueue.STOPPED;
}
},
/**
* Handles and retransmits upload cancel event.
*
* @method _uploadCancelHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadCancelHandler : function (event) {
var updatedEvent = event;
updatedEvent.originEvent = event;
updatedEvent.file = event.target;
this.fire("uploadcacel", updatedEvent);
},
/**
* Handles and retransmits upload progress event.
*
* @method _uploadProgressHandler
* @param event The event dispatched during the upload process.
* @private
*/
_uploadProgressHandler : function (event) {
this.currentUploadedByteValues[event.target.get("id")] = event.bytesLoaded;
var updatedEvent = event;
updatedEvent.originEvent = event;
updatedEvent.file = event.target;
this.fire("uploadprogress", updatedEvent);
var uploadedTotal = this.totalBytesUploaded;
Y.each(this.currentUploadedByteValues, function (value) {
uploadedTotal += value;
});
var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);
this.fire("totaluploadprogress", {bytesLoaded: uploadedTotal,
bytesTotal: this.totalBytes,
percentLoaded: percentLoaded});
},
/**
* Starts uploading the queued up file list.
*
* @method startUpload
*/
startUpload: function() {
this.queuedFiles = this.get("fileList").slice(0);
this.numberOfUploads = 0;
this.currentUploadedByteValues = {};
this.currentFiles = {};
this.totalBytesUploaded = 0;
this._currentState = UploaderQueue.UPLOADING;
while (this.numberOfUploads < this.get("simUploads") && this.queuedFiles.length > 0) {
this._startNextFile();
}
},
/**
* Pauses the upload process. The ongoing file uploads
* will complete after this method is called, but no
* new ones will be launched.
*
* @method pauseUpload
*/
pauseUpload: function () {
this._currentState = UploaderQueue.STOPPED;
},
/**
* Restarts a paused upload process.
*
* @method restartUpload
*/
restartUpload: function () {
this._currentState = UploaderQueue.UPLOADING;
while (this.numberOfUploads < this.get("simUploads")) {
this._startNextFile();
}
},
/**
* If a particular file is stuck in an ongoing upload without
* any progress events, this method allows to force its reupload
* by cancelling its upload and immediately relaunching it.
*
* @method forceReupload
* @param file {Y.File} The file to force reupload on.
*/
forceReupload : function (file) {
var id = file.get("id");
if (this.currentFiles.hasOwnProperty(id)) {
file.cancelUpload();
this._unregisterUpload(file);
this.addToQueueTop(file);
this._startNextFile();
}
},
/**
* Add a new file to the top of the queue (the upload will be
* launched as soon as the current number of uploading files
* drops below the maximum permissible value).
*
* @method addToQueueTop
* @param file {Y.File} The file to add to the top of the queue.
*/
addToQueueTop: function (file) {
this.queuedFiles.unshift(file);
},
/**
* Add a new file to the bottom of the queue (the upload will be
* launched after all the other queued files are uploaded.)
*
* @method addToQueueBottom
* @param file {Y.File} The file to add to the bottom of the queue.
*/
addToQueueBottom: function (file) {
this.queuedFiles.push(file);
},
/**
* Cancels a specific file's upload. If no argument is passed,
* all ongoing uploads are cancelled and the upload process is
* stopped.
*
* @method cancelUpload
* @param file {Y.File} An optional parameter - the file whose upload
* should be cancelled.
*/
cancelUpload: function (file) {
if (file) {
var id = file.get("id");
if (this.currentFiles[id]) {
this.currentFiles[id].cancelUpload();
this._unregisterUpload(this.currentFiles[id]);
if (this._currentState === UploaderQueue.UPLOADING) {
this._startNextFile();
}
}
else {
for (var i = 0, len = this.queuedFiles.length; i < len; i++) {
if (this.queuedFiles[i].get("id") === id) {
this.queuedFiles.splice(i, 1);
break;
}
}
}
}
else {
for (var fid in this.currentFiles) {
this.currentFiles[fid].cancelUpload();
this._unregisterUpload(this.currentFiles[fid]);
}
this.currentUploadedByteValues = {};
this.currentFiles = {};
this.totalBytesUploaded = 0;
this.fire("alluploadscancelled");
this._currentState = UploaderQueue.STOPPED;
}
}
},
{
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to continue uploading files in case of
* an error.
* @property CONTINUE
* @readOnly
* @type {String}
* @static
*/
CONTINUE: "continue",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to stop uploading files in case of
* an error.
* @property STOP
* @readOnly
* @type {String}
* @static
*/
STOP: "stop",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to restart a file upload immediately in case of
* an error.
* @property RESTART_ASAP
* @readOnly
* @type {String}
* @static
*/
RESTART_ASAP: "restartasap",
/**
* Static constant for the value of the `errorAction` attribute:
* prescribes the queue to restart an errored out file upload after
* other files have finished uploading.
* @property RESTART_AFTER
* @readOnly
* @type {String}
* @static
*/
RESTART_AFTER: "restartafter",
/**
* Static constant for the value of the `_currentState` property:
* implies that the queue is currently not uploading files.
* @property STOPPED
* @readOnly
* @type {String}
* @static
*/
STOPPED: "stopped",
/**
* Static constant for the value of the `_currentState` property:
* implies that the queue is currently uploading files.
* @property UPLOADING
* @readOnly
* @type {String}
* @static
*/
UPLOADING: "uploading",
/**
* The identity of the class.
*
* @property NAME
* @type String
* @default 'uploaderqueue'
* @readOnly
* @protected
* @static
*/
NAME: 'uploaderqueue',
/**
* Static property used to define the default attribute configuration of
* the class.
*
* @property ATTRS
* @type {Object}
* @protected
* @static
*/
ATTRS: {
/**
* Maximum number of simultaneous uploads; must be in the
* range between 1 and 5. The value of `2` is default. It
* is recommended that this value does not exceed 3.
* @property simUploads
* @type Number
* @default 2
*/
simUploads: {
value: 2,
validator: function (val, name) {
return (val >= 1 && val <= 5);
}
},
/**
* The action to take in case of error. The valid values for this attribute are:
* `Y.Uploader.Queue.CONTINUE` (the upload process should continue on other files,
* ignoring the error), `Y.Uploader.Queue.STOP` (the upload process
* should stop completely), `Y.Uploader.Queue.RESTART_ASAP` (the upload
* should restart immediately on the errored out file and continue as planned), or
* Y.Uploader.Queue.RESTART_AFTER (the upload of the errored out file should restart
* after all other files have uploaded)
* @property errorAction
* @type String
* @default Y.Uploader.Queue.CONTINUE
*/
errorAction: {
value: "continue",
validator: function (val, name) {
return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER);
}
},
/**
* The total number of bytes that has been uploaded.
* @property bytesUploaded
* @type Number
*/
bytesUploaded: {
readOnly: true,
value: 0
},
/**
* The total number of bytes in the queue.
* @property bytesTotal
* @type Number
*/
bytesTotal: {
readOnly: true,
value: 0
},
/**
* The queue file list. This file list should only be modified
* before the upload has been started; modifying it after starting
* the upload has no effect, and `addToQueueTop` or `addToQueueBottom` methods
* should be used instead.
* @property fileList
* @type Number
*/
fileList: {
value: [],
lazyAdd: false,
setter: function (val) {
var newValue = val;
Y.Array.each(newValue, function (value) {
this.totalBytes += value.get("size");
}, this);
return val;
}
},
/**
* A String specifying what should be the POST field name for the file
* content in the upload request.
*
* @attribute fileFieldName
* @type {String}
* @default Filedata
*/
fileFieldName: {
value: "Filedata"
},
/**
* The URL to POST the file upload requests to.
*
* @attribute uploadURL
* @type {String}
* @default ""
*/
uploadURL: {
value: ""
},
/**
* Additional HTTP headers that should be included
* in the upload request. Due to Flash Player security
* restrictions, this attribute is only honored in the
* HTML5 Uploader.
*
* @attribute uploadHeaders
* @type {Object}
* @default {}
*/
uploadHeaders: {
value: {}
},
/**
* A Boolean that specifies whether the file should be
* uploaded with the appropriate user credentials for the
* domain. Due to Flash Player security restrictions, this
* attribute is only honored in the HTML5 Uploader.
*
* @attribute withCredentials
* @type {Boolean}
* @default true
*/
withCredentials: {
value: true
},
/**
* An object, keyed by `fileId`, containing sets of key-value pairs
* that should be passed as POST variables along with each corresponding
* file.
*
* @attribute perFileParameters
* @type {Object}
* @default {}
*/
perFileParameters: {
value: {}
},
/**
* The number of times to try re-uploading a file that failed to upload before
* cancelling its upload.
*
* @attribute retryCount
* @type {Number}
* @default 3
*/
retryCount: {
value: 3
}
}
});
Y.namespace('Uploader');
Y.Uploader.Queue = UploaderQueue;
}, '3.7.3', {"requires": ["base"]});
@@ -1,100 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/uploader/uploader.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/uploader/uploader.js",
code: []
};
_yuitest_coverage["build/uploader/uploader.js"].code=["YUI.add('uploader', function (Y, NAME) {","","/**"," * Provides UI for selecting multiple files and functionality for "," * uploading multiple files to the server with support for either"," * html5 or Flash transport mechanisms, automatic queue management,"," * upload progress monitoring, and error events."," * @module uploader"," * @main uploader"," * @since 3.5.0"," */","","/**"," * `Y.Uploader` serves as an alias for either <a href=\"UploaderFlash.html\">`Y.UploaderFlash`</a>"," * or <a href=\"UploaderHTML5.html\">`Y.UploaderHTML5`</a>, depending on the feature set available"," * in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE` "," * static property is set to `\"none\"`."," *"," * @class Uploader"," */",""," /**"," * The static property reflecting the type of uploader that `Y.Uploader`"," * aliases. The possible values are:"," * <ul>"," * <li><strong>`\"html5\"`</strong>: Y.Uploader is an alias for <a href=\"UploaderHTML5.html\">Y.UploaderHTML5</a></li>"," * <li><strong>`\"flash\"`</strong>: Y.Uploader is an alias for <a href=\"UploaderFlash.html\">Y.UploaderFlash</a></li>"," * <li><strong>`\"none\"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does"," * not reference an actual implementation.</li>"," * </ul>"," *"," * @property TYPE"," * @type {String}"," * @static"," */",""," var Win = Y.config.win;",""," if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {"," Y.Uploader = Y.UploaderHTML5;"," }",""," else if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) {"," Y.Uploader = Y.UploaderFlash;"," }",""," else {"," Y.namespace(\"Uploader\");"," Y.Uploader.TYPE = \"none\";"," }","","}, '3.7.3', {\"requires\": [\"uploader-html5\", \"uploader-flash\"]});"];
_yuitest_coverage["build/uploader/uploader.js"].lines = {"1":0,"37":0,"39":0,"40":0,"43":0,"44":0,"48":0,"49":0};
_yuitest_coverage["build/uploader/uploader.js"].functions = {"(anonymous 1):1":0};
_yuitest_coverage["build/uploader/uploader.js"].coveredLines = 8;
_yuitest_coverage["build/uploader/uploader.js"].coveredFunctions = 1;
_yuitest_coverline("build/uploader/uploader.js", 1);
YUI.add('uploader', function (Y, NAME) {
/**
* Provides UI for selecting multiple files and functionality for
* uploading multiple files to the server with support for either
* html5 or Flash transport mechanisms, automatic queue management,
* upload progress monitoring, and error events.
* @module uploader
* @main uploader
* @since 3.5.0
*/
/**
* `Y.Uploader` serves as an alias for either <a href="UploaderFlash.html">`Y.UploaderFlash`</a>
* or <a href="UploaderHTML5.html">`Y.UploaderHTML5`</a>, depending on the feature set available
* in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE`
* static property is set to `"none"`.
*
* @class Uploader
*/
/**
* The static property reflecting the type of uploader that `Y.Uploader`
* aliases. The possible values are:
* <ul>
* <li><strong>`"html5"`</strong>: Y.Uploader is an alias for <a href="UploaderHTML5.html">Y.UploaderHTML5</a></li>
* <li><strong>`"flash"`</strong>: Y.Uploader is an alias for <a href="UploaderFlash.html">Y.UploaderFlash</a></li>
* <li><strong>`"none"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does
* not reference an actual implementation.</li>
* </ul>
*
* @property TYPE
* @type {String}
* @static
*/
_yuitest_coverfunc("build/uploader/uploader.js", "(anonymous 1)", 1);
_yuitest_coverline("build/uploader/uploader.js", 37);
var Win = Y.config.win;
_yuitest_coverline("build/uploader/uploader.js", 39);
if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {
_yuitest_coverline("build/uploader/uploader.js", 40);
Y.Uploader = Y.UploaderHTML5;
}
else {_yuitest_coverline("build/uploader/uploader.js", 43);
if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) {
_yuitest_coverline("build/uploader/uploader.js", 44);
Y.Uploader = Y.UploaderFlash;
}
else {
_yuitest_coverline("build/uploader/uploader.js", 48);
Y.namespace("Uploader");
_yuitest_coverline("build/uploader/uploader.js", 49);
Y.Uploader.TYPE = "none";
}}
}, '3.7.3', {"requires": ["uploader-html5", "uploader-flash"]});
@@ -1,58 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('uploader', function (Y, NAME) {
/**
* Provides UI for selecting multiple files and functionality for
* uploading multiple files to the server with support for either
* html5 or Flash transport mechanisms, automatic queue management,
* upload progress monitoring, and error events.
* @module uploader
* @main uploader
* @since 3.5.0
*/
/**
* `Y.Uploader` serves as an alias for either <a href="UploaderFlash.html">`Y.UploaderFlash`</a>
* or <a href="UploaderHTML5.html">`Y.UploaderHTML5`</a>, depending on the feature set available
* in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE`
* static property is set to `"none"`.
*
* @class Uploader
*/
/**
* The static property reflecting the type of uploader that `Y.Uploader`
* aliases. The possible values are:
* <ul>
* <li><strong>`"html5"`</strong>: Y.Uploader is an alias for <a href="UploaderHTML5.html">Y.UploaderHTML5</a></li>
* <li><strong>`"flash"`</strong>: Y.Uploader is an alias for <a href="UploaderFlash.html">Y.UploaderFlash</a></li>
* <li><strong>`"none"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does
* not reference an actual implementation.</li>
* </ul>
*
* @property TYPE
* @type {String}
* @static
*/
var Win = Y.config.win;
if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {
Y.Uploader = Y.UploaderHTML5;
}
else if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) {
Y.Uploader = Y.UploaderFlash;
}
else {
Y.namespace("Uploader");
Y.Uploader.TYPE = "none";
}
}, '3.7.3', {"requires": ["uploader-html5", "uploader-flash"]});
@@ -1,58 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('uploader', function (Y, NAME) {
/**
* Provides UI for selecting multiple files and functionality for
* uploading multiple files to the server with support for either
* html5 or Flash transport mechanisms, automatic queue management,
* upload progress monitoring, and error events.
* @module uploader
* @main uploader
* @since 3.5.0
*/
/**
* `Y.Uploader` serves as an alias for either <a href="UploaderFlash.html">`Y.UploaderFlash`</a>
* or <a href="UploaderHTML5.html">`Y.UploaderHTML5`</a>, depending on the feature set available
* in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE`
* static property is set to `"none"`.
*
* @class Uploader
*/
/**
* The static property reflecting the type of uploader that `Y.Uploader`
* aliases. The possible values are:
* <ul>
* <li><strong>`"html5"`</strong>: Y.Uploader is an alias for <a href="UploaderHTML5.html">Y.UploaderHTML5</a></li>
* <li><strong>`"flash"`</strong>: Y.Uploader is an alias for <a href="UploaderFlash.html">Y.UploaderFlash</a></li>
* <li><strong>`"none"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does
* not reference an actual implementation.</li>
* </ul>
*
* @property TYPE
* @type {String}
* @static
*/
var Win = Y.config.win;
if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {
Y.Uploader = Y.UploaderHTML5;
}
else if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) {
Y.Uploader = Y.UploaderFlash;
}
else {
Y.namespace("Uploader");
Y.Uploader.TYPE = "none";
}
}, '3.7.3', {"requires": ["uploader-html5", "uploader-flash"]});
@@ -1,26 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-widget-hidden {
display:none;
}
.yui3-widget-content {
overflow:hidden;
}
.yui3-widget-content-expanded {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing:border-box;
height:100%;
}
/* Only used for IE6, to go from a bigger size to a smaller size when using cb.sizeTo(bb) */
.yui3-widget-tmp-forcesize {
overflow:hidden !important;
}
@@ -1,26 +0,0 @@
/*
YUI 3.7.3 (build 5687)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
.yui3-widget-hidden {
display:none;
}
.yui3-widget-content {
overflow:hidden;
}
.yui3-widget-content-expanded {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing:border-box;
height:100%;
}
/* Only used for IE6, to go from a bigger size to a smaller size when using cb.sizeTo(bb) */
.yui3-widget-tmp-forcesize {
overflow:hidden !important;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
/*
YUI 3.7.3 (build 5687)
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
@@ -196,4 +196,4 @@ YUI.add('align-plugin', function (Y, NAME) {
}, '3.7.3', {"requires": ["node-screen", "node-pluginhost"]});
}, '3.8.0', {"requires": ["node-screen", "node-pluginhost"]});
@@ -1,7 +1,7 @@
/*
YUI 3.7.3 (build 5687)
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("align-plugin",function(e,t){function s(e){e.host&&(this._host=e.host)}var n="offsetWidth",r="offsetHeight",i=i;s.prototype={to:function(t,o,u,a){this._syncArgs=e.Array(arguments),t.top===i&&(t=e.one(t).get("region"));if(t){var f=[t.left,t.top],l=[t.width,t.height],c=s.points,h=this._host,p=null,d=h.getAttrs([r,n]),v=[0-d[n],0-d[r]],m=o?c[o.charAt(0)]:p,g=o&&o!=="cc"?c[o.charAt(1)]:p,y=u?c[u.charAt(0)]:p,b=u&&u!=="cc"?c[u.charAt(1)]:p;m&&(f=m(f,l,o)),g&&(f=g(f,l,o)),y&&(f=y(f,v,u)),b&&(f=b(f,v,u)),f&&h&&h.setXY(f),this._resize(a)}return this},sync:function(){return this.to.apply(this,this._syncArgs),this},_resize:function(t){var n=this._handle;t&&!n?this._handle=e.on("resize",this._onresize,window,this):!t&&n&&n.detach()},_onresize:function(){var e=this;setTimeout(function(){e.sync()})},center:function(e,t){return this.to(e,"cc","cc",t),this},destroy:function(){var e=this._handle;e&&e.detach()}},s.points={t:function(e,t){return e},r:function(e,t){return[e[0]+t[0],e[1]]},b:function(e,t){return[e[0],e[1]+t[1]]},l:function(e,t){return e},c:function(e,t,n){var r=n[0]==="t"||n[0]==="b"?0:1,i,s;return n==="cc"?i=[e[0]+t[0]/2,e[1]+t[1]/2]:(s=e[r]+t[r]/2,i=r?[e[0],s]:[s,e[1]]),i}},s.NAME="Align",s.NS="align",s.prototype.constructor=s,e.namespace("Plugin"),e.Plugin.Align=s},"3.7.3",{requires:["node-screen","node-pluginhost"]});
YUI.add("align-plugin",function(e,t){function s(e){e.host&&(this._host=e.host)}var n="offsetWidth",r="offsetHeight",i=i;s.prototype={to:function(t,o,u,a){this._syncArgs=e.Array(arguments),t.top===i&&(t=e.one(t).get("region"));if(t){var f=[t.left,t.top],l=[t.width,t.height],c=s.points,h=this._host,p=null,d=h.getAttrs([r,n]),v=[0-d[n],0-d[r]],m=o?c[o.charAt(0)]:p,g=o&&o!=="cc"?c[o.charAt(1)]:p,y=u?c[u.charAt(0)]:p,b=u&&u!=="cc"?c[u.charAt(1)]:p;m&&(f=m(f,l,o)),g&&(f=g(f,l,o)),y&&(f=y(f,v,u)),b&&(f=b(f,v,u)),f&&h&&h.setXY(f),this._resize(a)}return this},sync:function(){return this.to.apply(this,this._syncArgs),this},_resize:function(t){var n=this._handle;t&&!n?this._handle=e.on("resize",this._onresize,window,this):!t&&n&&n.detach()},_onresize:function(){var e=this;setTimeout(function(){e.sync()})},center:function(e,t){return this.to(e,"cc","cc",t),this},destroy:function(){var e=this._handle;e&&e.detach()}},s.points={t:function(e,t){return e},r:function(e,t){return[e[0]+t[0],e[1]]},b:function(e,t){return[e[0],e[1]+t[1]]},l:function(e,t){return e},c:function(e,t,n){var r=n[0]==="t"||n[0]==="b"?0:1,i,s;return n==="cc"?i=[e[0]+t[0]/2,e[1]+t[1]/2]:(s=e[r]+t[r]/2,i=r?[e[0],s]:[s,e[1]]),i}},s.NAME="Align",s.NS="align",s.prototype.constructor=s,e.namespace("Plugin"),e.Plugin.Align=s},"3.8.0",{requires:["node-screen","node-pluginhost"]});
@@ -1,5 +1,5 @@
/*
YUI 3.7.3 (build 5687)
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
@@ -196,4 +196,4 @@ YUI.add('align-plugin', function (Y, NAME) {
}, '3.7.3', {"requires": ["node-screen", "node-pluginhost"]});
}, '3.8.0', {"requires": ["node-screen", "node-pluginhost"]});
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
/*
YUI 3.7.3 (build 5687)
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
@@ -93,7 +93,7 @@ YUI.add('anim-base', function (Y, NAME) {
};
/**
* Time in milliseconds passed to setInterval for frame processing
* Time in milliseconds passed to setInterval for frame processing
*
* @property intervalTime
* @default 20
@@ -181,7 +181,7 @@ YUI.add('anim-base', function (Y, NAME) {
node: {
setter: function(node) {
if (node) {
if (typeof node == 'string' || node.nodeType) {
if (typeof node === 'string' || node.nodeType) {
node = Y.one(node);
}
}
@@ -204,7 +204,7 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
* The method that will provide values to the attribute(s) during the animation.
* The method that will provide values to the attribute(s) during the animation.
* Defaults to "Easing.easeNone".
* @attribute easing
* @type Function
@@ -257,7 +257,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Date stamp for the first frame of the animation.
* @attribute startTime
* @type Int
* @default 0
* @default 0
* @readOnly
*/
startTime: {
@@ -269,7 +269,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Current time the animation has been running.
* @attribute elapsedTime
* @type Int
* @default 0
* @default 0
* @readOnly
*/
elapsedTime: {
@@ -279,9 +279,9 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* Whether or not the animation is currently running.
* @attribute running
* @attribute running
* @type Boolean
* @default false
* @default false
* @readOnly
*/
running: {
@@ -293,10 +293,10 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
* The number of times the animation should run
* The number of times the animation should run
* @attribute iterations
* @type Int
* @default 1
* @default 1
*/
iterations: {
value: 1
@@ -304,7 +304,7 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* The number of iterations that have occurred.
* Resets when an animation ends (reaches iteration count or stop() called).
* Resets when an animation ends (reaches iteration count or stop() called).
* @attribute iterationCount
* @type Int
* @default 0
@@ -316,7 +316,7 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
* How iterations of the animation should behave.
* How iterations of the animation should behave.
* Possible values are "normal" and "alternate".
* Normal will repeat the animation, alternate will reverse on every other pass.
*
@@ -330,9 +330,9 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* Whether or not the animation is currently paused.
* @attribute paused
* @attribute paused
* @type Boolean
* @default false
* @default false
* @readOnly
*/
paused: {
@@ -344,7 +344,7 @@ YUI.add('anim-base', function (Y, NAME) {
* If true, animation begins from last frame
* @attribute reverse
* @type Boolean
* @default false
* @default false
*/
reverse: {
value: false
@@ -357,10 +357,11 @@ YUI.add('anim-base', function (Y, NAME) {
* Runs all animation instances.
* @method run
* @static
*/
*/
Y.Anim.run = function() {
var instances = Y.Anim._instances;
for (var i in instances) {
var instances = Y.Anim._instances,
i;
for (i in instances) {
if (instances[i].run) {
instances[i].run();
}
@@ -371,7 +372,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Pauses all animation instances.
* @method pause
* @static
*/
*/
Y.Anim.pause = function() {
for (var i in _running) { // stop timer if nothing running
if (_running[i].pause) {
@@ -386,7 +387,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Stops all animation instances.
* @method stop
* @static
*/
*/
Y.Anim.stop = function() {
for (var i in _running) { // stop timer if nothing running
if (_running[i].stop) {
@@ -395,7 +396,7 @@ YUI.add('anim-base', function (Y, NAME) {
}
Y.Anim._stopTimer();
};
Y.Anim._startTimer = function() {
if (!_timer) {
_timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);
@@ -412,10 +413,11 @@ YUI.add('anim-base', function (Y, NAME) {
* @method _runFrame
* @private
* @static
*/
*/
Y.Anim._runFrame = function() {
var done = true;
for (var anim in _running) {
var done = true,
anim;
for (anim in _running) {
if (_running[anim]._runFrame) {
done = false;
_running[anim]._runFrame();
@@ -434,7 +436,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Starts or resumes an animation.
* @method run
* @chainable
*/
*/
run: function() {
if (this.get(PAUSED)) {
this._resume();
@@ -450,7 +452,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Calling run() will continue where it left off.
* @method pause
* @chainable
*/
*/
pause: function() {
if (this.get(RUNNING)) {
this._pause();
@@ -463,7 +465,7 @@ YUI.add('anim-base', function (Y, NAME) {
* @method stop
* @param {Boolean} finish If true, the animation will move to the last frame
* @chainable
*/
*/
stop: function(finish) {
if (this.get(RUNNING) || this.get(PAUSED)) {
this._end(finish);
@@ -532,10 +534,8 @@ YUI.add('anim-base', function (Y, NAME) {
var d = this._runtimeAttr.duration,
t = new Date() - this.get(START_TIME),
reverse = this.get(REVERSE),
done = (t >= d),
attribute,
setter;
done = (t >= d);
this._runAttrs(t, d, reverse);
this._actualFrames += 1;
this._set(ELAPSED_TIME, t);
@@ -572,9 +572,9 @@ YUI.add('anim-base', function (Y, NAME) {
customAttr[i].set : Y.Anim.DEFAULT_SETTER;
if (!done) {
setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
} else {
setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
}
}
}
@@ -631,8 +631,8 @@ YUI.add('anim-base', function (Y, NAME) {
begin = begin.call(this, node);
}
var mFrom = Y.Anim.RE_UNITS.exec(begin);
var mTo = Y.Anim.RE_UNITS.exec(val);
var mFrom = Y.Anim.RE_UNITS.exec(begin),
mTo = Y.Anim.RE_UNITS.exec(val);
begin = mFrom ? mFrom[1] : begin;
end = mTo ? mTo[1] : val;
@@ -664,10 +664,11 @@ YUI.add('anim-base', function (Y, NAME) {
var node = this._node,
val = node.getComputedStyle(attr),
get = (attr === 'left') ? 'getX': 'getY',
set = (attr === 'left') ? 'setX': 'setY';
set = (attr === 'left') ? 'setX': 'setY',
position;
if (val === 'auto') {
var position = node.getStyle('position');
position = node.getStyle('position');
if (position === 'absolute' || position === 'fixed') {
val = node[get]();
node[set](val);
@@ -687,4 +688,4 @@ YUI.add('anim-base', function (Y, NAME) {
Y.extend(Y.Anim, Y.Base, proto);
}, '3.7.3', {"requires": ["base-base", "node-style"]});
}, '3.8.0', {"requires": ["base-base", "node-style"]});
+7
View File
@@ -0,0 +1,7 @@
/*
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("anim-base",function(e,t){var n="running",r="startTime",i="elapsedTime",s="start",o="tween",u="end",a="node",f="paused",l="reverse",c="iterationCount",h=Number,p={},d;e.Anim=function(){e.Anim.superclass.constructor.apply(this,arguments),e.Anim._instances[e.stamp(this)]=this},e.Anim.NAME="anim",e.Anim._instances={},e.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,e.Anim.DEFAULT_UNIT="px",e.Anim.DEFAULT_EASING=function(e,t,n,r){return n*e/r+t},e.Anim._intervalTime=20,e.Anim.behaviors={left:{get:function(e,t){return e._getOffset(t)}}},e.Anim.behaviors.top=e.Anim.behaviors.left,e.Anim.DEFAULT_SETTER=function(t,n,r,i,s,o,u,a){var f=t._node,l=f._node,c=u(s,h(r),h(i)-h(r),o);l?"style"in l&&(n in l.style||n in e.DOM.CUSTOM_STYLES)?(a=a||"",f.setStyle(n,c+a)):"attributes"in l&&n in l.attributes?f.setAttribute(n,c):n in l&&(l[n]=c):f.set?f.set(n,c):n in f&&(f[n]=c)},e.Anim.DEFAULT_GETTER=function(t,n){var r=t._node,i=r._node,s="";return i?"style"in i&&(n in i.style||n in e.DOM.CUSTOM_STYLES)?s=r.getComputedStyle(n):"attributes"in i&&n in i.attributes?s=r.getAttribute(n):n in i&&(s=i[n]):r.get?s=r.get(n):n in r&&(s=r[n]),s},e.Anim.ATTRS={node:{setter:function(t){return t&&(typeof t=="string"||t.nodeType)&&(t=e.one(t)),this._node=t,!t,t}},duration:{value:1},easing:{value:e.Anim.DEFAULT_EASING,setter:function(t){if(typeof t=="string"&&e.Easing)return e.Easing[t]}},from:{},to:{},startTime:{value:0,readOnly:!0},elapsedTime:{value:0,readOnly:!0},running:{getter:function(){return!!p[e.stamp(this)]},value:!1,readOnly:!0},iterations:{value:1},iterationCount:{value:0,readOnly:!0},direction:{value:"normal"},paused:{readOnly:!0,value:!1},reverse:{value:!1}},e.Anim.run=function(){var t=e.Anim._instances,n;for(n in t)t[n].run&&t[n].run()},e.Anim.pause=function(){for(var t in p)p[t].pause&&p[t].pause();e.Anim._stopTimer()},e.Anim.stop=function(){for(var t in p)p[t].stop&&p[t].stop();e.Anim._stopTimer()},e.Anim._startTimer=function(){d||(d=setInterval(e.Anim._runFrame,e.Anim._intervalTime))},e.Anim._stopTimer=function(){clearInterval(d),d=0},e.Anim._runFrame=function(){var t=!0,n;for(n in p)p[n]._runFrame&&(t=!1,p[n]._runFrame());t&&e.Anim._stopTimer()},e.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var v={run:function(){return this.get(f)?this._resume():this.get(n)||this._start(),this},pause:function(){return this.get(n)&&this._pause(),this},stop:function(e){return(this.get(n)||this.get(f))&&this._end(e),this},_added:!1,_start:function(){this._set(r,new Date-this.get(i)),this._actualFrames=0,this.get(f)||this._initAnimAttr(),p[e.stamp(this)]=this,e.Anim._startTimer(),this.fire(s)},_pause:function(){this._set(r,null),this._set(f,!0),delete p[e.stamp(this)],this.fire("pause")},_resume:function(){this._set(f,!1),p[e.stamp(this)]=this,this._set(r,new Date-this.get(i)),e.Anim._startTimer(),this.fire("resume")},_end:function(t){var n=this.get("duration")*1e3;t&&this._runAttrs(n,n,this.get(l)),this._set(r,null),this._set(i,0),this._set(f,!1),delete p[e.stamp(this)],this.fire(u,{elapsed:this.get(i)})},_runFrame:function(){var e=this._runtimeAttr.duration,t=new Date-this.get(r),n=this.get(l),s=t>=e;this._runAttrs(t,e,n),this._actualFrames+=1,this._set(i,t),this.fire(o),s&&this._lastFrame()},_runAttrs:function(t,n,r){var i=this._runtimeAttr,s=e.Anim.behaviors,o=i.easing,u=n,a=!1,f,l,c;t>=n&&(a=!0),r&&(t=n-t,u=0);for(c in i)i[c].to&&(f=i[c],l=c in s&&"set"in s[c]?s[c].set:e.Anim.DEFAULT_SETTER,a?l(this,c,f.from,f.to,u,n,o,f.unit):l(this,c,f.from,f.to,t,n,o,f.unit))},_lastFrame:function(){var e=this.get("iterations"),t=this.get(c);t+=1,e==="infinite"||t<e?(this.get("direction")==="alternate"&&this.set(l,!this.get(l)),this.fire("iteration")):(t=0,this._end()),this._set(r,new Date),this._set(c,t)},_initAnimAttr:function(){var t=this.get("from")||{},n=this.get("to")||{},r={duration:this.get("duration")*1e3,easing:this.get("easing")},i=e.Anim.behaviors,s=this.get(a),o,u,f;e.each(n,function(n,a){typeof n=="function"&&(n=n.call(this,s)),u=t[a],u===undefined?u=a in i&&"get"in i[a]?i[a].get(this,a):e.Anim.DEFAULT_GETTER(this,a):typeof u=="function"&&(u=u.call(this,s));var l=e.Anim.RE_UNITS.exec(u),c=e.Anim.RE_UNITS.exec(n);u=l?l[1]:u,f=c?c[1]:n,o=c?c[2]:l?l[2]:"",!o&&e.Anim.RE_DEFAULT_UNIT.test(a)&&(o=e.Anim.DEFAULT_UNIT);if(!u||!f){e.error('invalid "from" or "to" for "'+a+'"',"Anim");return}r[a]={from:e.Lang.isObject(u)?e.clone(u):u,to:f,unit:o}},this),this._runtimeAttr=r},_getOffset:function(e){var t=this._node,n=t.getComputedStyle(e),r=e==="left"?"getX":"getY",i=e==="left"?"setX":"setY",s;return n==="auto"&&(s=t.getStyle("position"),s==="absolute"||s==="fixed"?(n=t[r](),t[i](n)):n=0),n},destructor:function(){delete e.Anim._instances[e.stamp(this)]}};e.extend(e.Anim,e.Base,v)},"3.8.0",{requires:["base-base","node-style"]});
@@ -1,5 +1,5 @@
/*
YUI 3.7.3 (build 5687)
YUI 3.8.0 (build 5744)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
@@ -93,7 +93,7 @@ YUI.add('anim-base', function (Y, NAME) {
};
/**
* Time in milliseconds passed to setInterval for frame processing
* Time in milliseconds passed to setInterval for frame processing
*
* @property intervalTime
* @default 20
@@ -181,7 +181,7 @@ YUI.add('anim-base', function (Y, NAME) {
node: {
setter: function(node) {
if (node) {
if (typeof node == 'string' || node.nodeType) {
if (typeof node === 'string' || node.nodeType) {
node = Y.one(node);
}
}
@@ -203,7 +203,7 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
* The method that will provide values to the attribute(s) during the animation.
* The method that will provide values to the attribute(s) during the animation.
* Defaults to "Easing.easeNone".
* @attribute easing
* @type Function
@@ -256,7 +256,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Date stamp for the first frame of the animation.
* @attribute startTime
* @type Int
* @default 0
* @default 0
* @readOnly
*/
startTime: {
@@ -268,7 +268,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Current time the animation has been running.
* @attribute elapsedTime
* @type Int
* @default 0
* @default 0
* @readOnly
*/
elapsedTime: {
@@ -278,9 +278,9 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* Whether or not the animation is currently running.
* @attribute running
* @attribute running
* @type Boolean
* @default false
* @default false
* @readOnly
*/
running: {
@@ -292,10 +292,10 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
* The number of times the animation should run
* The number of times the animation should run
* @attribute iterations
* @type Int
* @default 1
* @default 1
*/
iterations: {
value: 1
@@ -303,7 +303,7 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* The number of iterations that have occurred.
* Resets when an animation ends (reaches iteration count or stop() called).
* Resets when an animation ends (reaches iteration count or stop() called).
* @attribute iterationCount
* @type Int
* @default 0
@@ -315,7 +315,7 @@ YUI.add('anim-base', function (Y, NAME) {
},
/**
* How iterations of the animation should behave.
* How iterations of the animation should behave.
* Possible values are "normal" and "alternate".
* Normal will repeat the animation, alternate will reverse on every other pass.
*
@@ -329,9 +329,9 @@ YUI.add('anim-base', function (Y, NAME) {
/**
* Whether or not the animation is currently paused.
* @attribute paused
* @attribute paused
* @type Boolean
* @default false
* @default false
* @readOnly
*/
paused: {
@@ -343,7 +343,7 @@ YUI.add('anim-base', function (Y, NAME) {
* If true, animation begins from last frame
* @attribute reverse
* @type Boolean
* @default false
* @default false
*/
reverse: {
value: false
@@ -356,10 +356,11 @@ YUI.add('anim-base', function (Y, NAME) {
* Runs all animation instances.
* @method run
* @static
*/
*/
Y.Anim.run = function() {
var instances = Y.Anim._instances;
for (var i in instances) {
var instances = Y.Anim._instances,
i;
for (i in instances) {
if (instances[i].run) {
instances[i].run();
}
@@ -370,7 +371,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Pauses all animation instances.
* @method pause
* @static
*/
*/
Y.Anim.pause = function() {
for (var i in _running) { // stop timer if nothing running
if (_running[i].pause) {
@@ -385,7 +386,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Stops all animation instances.
* @method stop
* @static
*/
*/
Y.Anim.stop = function() {
for (var i in _running) { // stop timer if nothing running
if (_running[i].stop) {
@@ -394,7 +395,7 @@ YUI.add('anim-base', function (Y, NAME) {
}
Y.Anim._stopTimer();
};
Y.Anim._startTimer = function() {
if (!_timer) {
_timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);
@@ -411,10 +412,11 @@ YUI.add('anim-base', function (Y, NAME) {
* @method _runFrame
* @private
* @static
*/
*/
Y.Anim._runFrame = function() {
var done = true;
for (var anim in _running) {
var done = true,
anim;
for (anim in _running) {
if (_running[anim]._runFrame) {
done = false;
_running[anim]._runFrame();
@@ -433,7 +435,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Starts or resumes an animation.
* @method run
* @chainable
*/
*/
run: function() {
if (this.get(PAUSED)) {
this._resume();
@@ -449,7 +451,7 @@ YUI.add('anim-base', function (Y, NAME) {
* Calling run() will continue where it left off.
* @method pause
* @chainable
*/
*/
pause: function() {
if (this.get(RUNNING)) {
this._pause();
@@ -462,7 +464,7 @@ YUI.add('anim-base', function (Y, NAME) {
* @method stop
* @param {Boolean} finish If true, the animation will move to the last frame
* @chainable
*/
*/
stop: function(finish) {
if (this.get(RUNNING) || this.get(PAUSED)) {
this._end(finish);
@@ -531,10 +533,8 @@ YUI.add('anim-base', function (Y, NAME) {
var d = this._runtimeAttr.duration,
t = new Date() - this.get(START_TIME),
reverse = this.get(REVERSE),
done = (t >= d),
attribute,
setter;
done = (t >= d);
this._runAttrs(t, d, reverse);
this._actualFrames += 1;
this._set(ELAPSED_TIME, t);
@@ -571,9 +571,9 @@ YUI.add('anim-base', function (Y, NAME) {
customAttr[i].set : Y.Anim.DEFAULT_SETTER;
if (!done) {
setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
} else {
setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
}
}
}
@@ -630,8 +630,8 @@ YUI.add('anim-base', function (Y, NAME) {
begin = begin.call(this, node);
}
var mFrom = Y.Anim.RE_UNITS.exec(begin);
var mTo = Y.Anim.RE_UNITS.exec(val);
var mFrom = Y.Anim.RE_UNITS.exec(begin),
mTo = Y.Anim.RE_UNITS.exec(val);
begin = mFrom ? mFrom[1] : begin;
end = mTo ? mTo[1] : val;
@@ -663,10 +663,11 @@ YUI.add('anim-base', function (Y, NAME) {
var node = this._node,
val = node.getComputedStyle(attr),
get = (attr === 'left') ? 'getX': 'getY',
set = (attr === 'left') ? 'setX': 'setY';
set = (attr === 'left') ? 'setX': 'setY',
position;
if (val === 'auto') {
var position = node.getStyle('position');
position = node.getStyle('position');
if (position === 'absolute' || position === 'fixed') {
val = node[get]();
node[set](val);
@@ -686,4 +687,4 @@ YUI.add('anim-base', function (Y, NAME) {
Y.extend(Y.Anim, Y.Base, proto);
}, '3.7.3', {"requires": ["base-base", "node-style"]});
}, '3.8.0', {"requires": ["base-base", "node-style"]});

Some files were not shown because too many files have changed in this diff Show More