Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rebuild

  • Loading branch information...
commit 7af0066bb46ba0fc6b909c3a104fb999d20cf36b 1 parent e932a58
@yiminghe yiminghe authored
View
2  build/base-min.js
@@ -1,7 +1,7 @@
/*
Copyright 2012, KISSY UI Library v1.40dev
MIT Licensed
-build time: Dec 6 01:07
+build time: Dec 7 02:50
*/
KISSY.add("base/attribute",function(j,i){function k(a,b){return"string"==typeof b?a[b]:b}function m(a,b,c,d,e,g,f){f=f||c;return a.fire(b+j.ucfirst(c)+"Change",{attrName:f,subAttrName:g,prevVal:d,newVal:e})}function h(a,b,c){var d=a[b]||{};c&&(a[b]=d);return d}function f(a){return h(a,"__attrs",!0)}function n(a){return h(a,"__attrVals",!0)}function q(a,b){for(var c=0,d=b.length;a!=i&&c<d;c++)a=a[b[c]];return a}function r(a,b){var c;!a.hasAttr(b)&&-1!==b.indexOf(".")&&(c=b.split("."),b=c.shift());
return{path:c,name:b}}function s(a,b,c){var d=c;if(b){var a=d=a===i?{}:j.clone(a),e=b.length-1;if(0<=e){for(var g=0;g<e;g++)a=a[b[g]];a!=i&&(a[b[g]]=c)}}return d}function t(a,b,c,d,e){var d=d||{},g,f,l;l=r(a,b);var h=b,b=l.name;g=l.path;l=a.get(b);g&&(f=q(l,g));if(!g&&l===c||g&&f===c)return i;c=s(l,g,c);if(!d.silent&&!1===m(a,"before",b,l,c,h))return!1;c=a.setInternal(b,c,d);if(!1===c)return c;d.silent||(c=n(a)[b],m(a,"after",b,l,c,h),e?e.push({prevVal:l,newVal:c,attrName:b,subAttrName:h}):m(a,"",
View
3  build/base.js
@@ -1,7 +1,7 @@
/*
Copyright 2012, KISSY UI Library v1.40dev
MIT Licensed
-build time: Dec 6 01:07
+build time: Dec 7 02:50
*/
/**
* @ignore
@@ -417,6 +417,7 @@ KISSY.add('base/attribute', function (S, undefined) {
/**
* Gets the current value of the attribute.
* @param {String} name attribute 's name
+ * @return {*}
*/
get: function (name) {
var self = this,
View
7 build/base/base-pkg-min.js
@@ -1,7 +0,0 @@
-KISSY.add("base/attribute",function(j,i){function k(a,b){return"string"==typeof b?a[b]:b}function m(a,b,c,d,e,g,f){f=f||c;return a.fire(b+j.ucfirst(c)+"Change",{attrName:f,subAttrName:g,prevVal:d,newVal:e})}function h(a,b,c){var d=a[b]||{};c&&(a[b]=d);return d}function f(a){return h(a,"__attrs",!0)}function n(a){return h(a,"__attrVals",!0)}function q(a,b){for(var c=0,d=b.length;a!=i&&c<d;c++)a=a[b[c]];return a}function r(a,b){var c;!a.hasAttr(b)&&-1!==b.indexOf(".")&&(c=b.split("."),b=c.shift());
-return{path:c,name:b}}function s(a,b,c){var d=c;if(b){var a=d=a===i?{}:j.clone(a),e=b.length-1;if(0<=e){for(var g=0;g<e;g++)a=a[b[g]];a!=i&&(a[b[g]]=c)}}return d}function t(a,b,c,d,e){var d=d||{},g,f,l;l=r(a,b);var h=b,b=l.name;g=l.path;l=a.get(b);g&&(f=q(l,g));if(!g&&l===c||g&&f===c)return i;c=s(l,g,c);if(!d.silent&&!1===m(a,"before",b,l,c,h))return!1;c=a.setInternal(b,c,d);if(!1===c)return c;d.silent||(c=n(a)[b],m(a,"after",b,l,c,h),e?e.push({prevVal:l,newVal:c,attrName:b,subAttrName:h}):m(a,"",
-"*",[l],[c],[h],[b]));return a}function o(){}function p(a,b){var c=f(a),d=h(c,b),e=d.valueFn;if(e&&(e=k(a,e)))e=e.call(a),e!==i&&(d.value=e),delete d.valueFn,c[b]=d;return d.value}function u(a,b,c,d){var e,g;e=r(a,b);b=e.name;if(e=e.path)g=a.get(b),c=s(g,e,c);if((e=h(f(a),b,!0).validator)&&(e=k(a,e)))if(a=e.call(a,c,b,d),a!==i&&!0!==a)return a;return i}o.INVALID={};var v=o.INVALID;o.prototype={getAttrs:function(){return f(this)},getAttrVals:function(){var a={},b,c=f(this);for(b in c)a[b]=this.get(b);
-return a},addAttr:function(a,b,c){var d=f(this),b=j.clone(b);d[a]?j.mix(d[a],b,c):d[a]=b;return this},addAttrs:function(a,b){var c=this;j.each(a,function(a,b){c.addAttr(b,a)});b&&c.set(b);return c},hasAttr:function(a){return f(this).hasOwnProperty(a)},removeAttr:function(a){this.hasAttr(a)&&(delete f(this)[a],delete n(this)[a]);return this},set:function(a,b,c){if(j.isPlainObject(a)){var c=b,b=Object(a),d=[],e,g=[];for(a in b)(e=u(this,a,b[a],b))!==i&&g.push(e);if(g.length)return c&&c.error&&c.error(g),
-!1;for(a in b)t(this,a,b[a],c,d);var f=[],h=[],n=[],k=[];j.each(d,function(a){h.push(a.prevVal);n.push(a.newVal);f.push(a.attrName);k.push(a.subAttrName)});f.length&&m(this,"","*",h,n,k,f);return this}return t(this,a,b,c)},setInternal:function(a,b,c){var d,e,g=h(f(this),a,!0).setter;e=u(this,a,b);if(e!==i)return c.error&&c.error(e),!1;if(g&&(g=k(this,g)))d=g.call(this,b,a);if(d===v)return!1;d!==i&&(b=d);n(this)[a]=b},get:function(a){var b,c=this.hasAttr(a),d=n(this),e;!c&&-1!==a.indexOf(".")&&(b=
-a.split("."),a=b.shift());c=h(f(this),a).getter;e=a in d?d[a]:p(this,a);if(c&&(c=k(this,c)))e=c.call(this,e,a);!(a in d)&&e!==i&&(d[a]=e);b&&(e=q(e,b));return e},reset:function(a,b){if("string"==typeof a)return this.hasAttr(a)?this.set(a,p(this,a),b):this;var b=a,c=f(this),d={};for(a in c)d[a]=p(this,a);this.set(d,b);return this}};return o});
-KISSY.add("base",function(j,i,k){function m(h){var f=this.constructor;for(this.userConfig=h;f;){var i=f.ATTRS;if(i){var j=void 0;for(j in i)this.addAttr(j,i[j],!1)}f=f.superclass?f.superclass.constructor:null}if(h)for(var k in h)this.setInternal(k,h[k])}j.augment(m,k.Target,i);m.Attribute=i;return j.Base=m},{requires:["base/attribute","event/custom"]});
View
635 build/base/base-pkg.js
@@ -1,635 +0,0 @@
-/**
- * @ignore
- * @fileOverview attribute management
- * @author yiminghe@gmail.com, lifesinger@gmail.com
- */
-KISSY.add('base/attribute', function (S, undefined) {
-
- // atomic flag
- Attribute.INVALID = {};
-
- var INVALID = Attribute.INVALID;
-
- function normalFn(host, method) {
- if (typeof method == 'string') {
- return host[method];
- }
- return method;
- }
-
- // fire attribute value change
- function __fireAttrChange(self, when, name, prevVal, newVal, subAttrName, attrName) {
- attrName = attrName || name;
- return self.fire(when + S.ucfirst(name) + 'Change', {
- attrName: attrName,
- subAttrName: subAttrName,
- prevVal: prevVal,
- newVal: newVal
- });
- }
-
- function ensureNonEmpty(obj, name, create) {
- var ret = obj[name] || {};
- if (create) {
- obj[name] = ret;
- }
- return ret;
- }
-
- function getAttrs(self) {
- /*
- attribute meta information
- {
- attrName: {
- getter: function,
- setter: function,
- // 注意:只能是普通对象以及系统内置类型,而不能是 new Xx(),否则用 valueFn 替代
- value: v, // default value
- valueFn: function
- }
- }
- */
- return ensureNonEmpty(self, '__attrs', true);
- }
-
-
- function getAttrVals(self) {
- /*
- attribute value
- {
- attrName: attrVal
- }
- */
- return ensureNonEmpty(self, '__attrVals', true);
- }
-
- /*
- o, [x,y,z] => o[x][y][z]
- */
- function getValueByPath(o, path) {
- for (var i = 0, len = path.length;
- o != undefined && i < len;
- i++) {
- o = o[path[i]];
- }
- return o;
- }
-
- /*
- o, [x,y,z], val => o[x][y][z]=val
- */
- function setValueByPath(o, path, val) {
- var len = path.length - 1,
- s = o;
- if (len >= 0) {
- for (var i = 0; i < len; i++) {
- o = o[path[i]];
- }
- if (o != undefined) {
- o[path[i]] = val;
- } else {
- s = undefined;
- }
- }
- return s;
- }
-
- function getPathNamePair(self, name) {
- var declared = self.hasAttr(name), path;
-
- if (
- // 声明过,那么 xx.yy 当做普通属性
- !declared &&
- name.indexOf('.') !== -1) {
- path = name.split('.');
- name = path.shift();
- }
-
- return {
- path: path,
- name: name
- };
- }
-
- function getValueBySubValue(prevVal, path, value) {
- var tmp = value;
- if (path) {
- if (prevVal === undefined) {
- tmp = {};
- } else {
- tmp = S.clone(prevVal);
- }
- setValueByPath(tmp, path, value);
- }
- return tmp;
- }
-
- function setInternal(self, name, value, opts, attrs) {
- opts = opts || {};
-
- var ret,
- path,
- subVal,
- prevVal,
- pathNamePair = getPathNamePair(self, name),
- fullName = name;
-
- name = pathNamePair.name;
- path = pathNamePair.path;
- prevVal = self.get(name);
-
- if (path) {
- subVal = getValueByPath(prevVal, path);
- }
-
- // if no change, just return
- if (!path && prevVal === value) {
- return undefined;
- } else if (path && subVal === value) {
- return undefined;
- }
-
- value = getValueBySubValue(prevVal, path, value);
-
- // check before event
- if (!opts['silent']) {
- if (false === __fireAttrChange(self, 'before', name, prevVal, value, fullName)) {
- return false;
- }
- }
- // set it
- ret = self.setInternal(name, value, opts);
-
- if (ret === false) {
- return ret;
- }
-
- // fire after event
- if (!opts['silent']) {
- value = getAttrVals(self)[name];
- __fireAttrChange(self, 'after', name, prevVal, value, fullName);
- if (!attrs) {
- __fireAttrChange(self,
- '', '*',
- [prevVal], [value],
- [fullName], [name]);
- } else {
- attrs.push({
- prevVal: prevVal,
- newVal: value,
- attrName: name,
- subAttrName: fullName
- });
- }
- }
- return self;
- }
-
- /**
- * @class KISSY.Base.Attribute
- * @private
- * Attribute provides configurable attribute support along with attribute change events.
- * It is designed to be augmented on to a host class,
- * and provides the host with the ability to configure attributes to store and retrieve state,
- * along with attribute change events.
- *
- * For example, attributes added to the host can be configured:
- *
- * - With a setter function, which can be used to manipulate
- * values passed to attribute 's {@link #set} method, before they are stored.
- * - With a getter function, which can be used to manipulate stored values,
- * before they are returned by attribute 's {@link #get} method.
- * - With a validator function, to validate values before they are stored.
- *
- * See the {@link #addAttr} method, for the complete set of configuration
- * options available for attributes.
- *
- * NOTE: Most implementations will be better off extending the {@link KISSY.Base} class,
- * instead of augmenting Attribute directly.
- * Base augments Attribute and will handle the initial configuration
- * of attributes for derived classes, accounting for values passed into the constructor.
- */
- function Attribute() {
- }
-
-
- Attribute.prototype = {
-
- /**
- * get un-cloned attr config collections
- * @return {Object}
- * @private
- */
- getAttrs: function () {
- return getAttrs(this);
- },
-
- /**
- * get un-cloned attr value collections
- * @return {Object}
- */
- getAttrVals: function () {
- var self = this,
- o = {},
- a,
- attrs = getAttrs(self);
- for (a in attrs) {
- o[a] = self.get(a);
- }
- return o;
- },
-
- /**
- * Adds an attribute with the provided configuration to the host object.
- * @param {String} name attrName
- * @param {Object} attrConfig The config supports the following properties
- * @param [attrConfig.value] simple object or system native object
- * @param [attrConfig.valueFn] a function which can return current attribute 's default value
- * @param {Function} [attrConfig.setter] call when set attribute 's value
- * pass current attribute 's value as parameter
- * if return value is not undefined,set returned value as real value
- * @param {Function} [attrConfig.getter] call when get attribute 's value
- * pass current attribute 's value as parameter
- * return getter's returned value to invoker
- * @param {Function} [attrConfig.validator] call before set attribute 's value
- * if return false,cancel this set action
- * @param {Boolean} [override] whether override existing attribute config ,default true
- * @chainable
- */
- addAttr: function (name, attrConfig, override) {
- var self = this,
- attrs = getAttrs(self),
- cfg = S.clone(attrConfig);
- if (!attrs[name]) {
- attrs[name] = cfg;
- } else {
- S.mix(attrs[name], cfg, override);
- }
- return self;
- },
-
- /**
- * Configures a group of attributes, and sets initial values.
- * @param {Object} attrConfigs An object with attribute name/configuration pairs.
- * @param {Object} initialValues user defined initial values
- * @chainable
- */
- addAttrs: function (attrConfigs, initialValues) {
- var self = this;
- S.each(attrConfigs, function (attrConfig, name) {
- self.addAttr(name, attrConfig);
- });
- if (initialValues) {
- self.set(initialValues);
- }
- return self;
- },
-
- /**
- * Checks if the given attribute has been added to the host.
- * @param {String} name attribute name
- * @return {Boolean}
- */
- hasAttr: function (name) {
- return getAttrs(this).hasOwnProperty(name);
- },
-
- /**
- * Removes an attribute from the host object.
- * @chainable
- */
- removeAttr: function (name) {
- var self = this;
-
- if (self.hasAttr(name)) {
- delete getAttrs(self)[name];
- delete getAttrVals(self)[name];
- }
-
- return self;
- },
-
-
- /**
- * Sets the value of an attribute.
- * @param {String|Object} name attribute 's name or attribute name and value map
- * @param [value] attribute 's value
- * @param {Object} [opts] some options
- * @param {Boolean} [opts.silent] whether fire change event
- * @return {Boolean} whether pass validator
- */
- set: function (name, value, opts) {
- var self = this;
- if (S.isPlainObject(name)) {
- opts = value;
- var all = Object(name),
- attrs = [],
- e,
- errors = [];
- for (name in all) {
- // bulk validation
- // if any one failed,all values are not set
- if ((e = validate(self, name, all[name], all)) !== undefined) {
- errors.push(e);
- }
- }
- if (errors.length) {
- if (opts && opts.error) {
- opts.error(errors);
- }
- return false;
- }
- for (name in all) {
- setInternal(self, name, all[name], opts, attrs);
- }
- var attrNames = [],
- prevVals = [],
- newVals = [],
- subAttrNames = [];
- S.each(attrs, function (attr) {
- prevVals.push(attr.prevVal);
- newVals.push(attr.newVal);
- attrNames.push(attr.attrName);
- subAttrNames.push(attr.subAttrName);
- });
- if (attrNames.length) {
- __fireAttrChange(self,
- '',
- '*',
- prevVals,
- newVals,
- subAttrNames,
- attrNames);
- }
- return self;
- }
- return setInternal(self, name, value, opts);
- },
-
- /**
- * internal use, no event involved, just set.
- * @protected
- */
- setInternal: function (name, value, opts) {
- var self = this,
- setValue,
- // if host does not have meta info corresponding to (name,value)
- // then register on demand in order to collect all data meta info
- // 一定要注册属性元数据,否则其他模块通过 _attrs 不能枚举到所有有效属性
- // 因为属性在声明注册前可以直接设置值
- e,
- attrConfig = ensureNonEmpty(getAttrs(self), name, true),
- setter = attrConfig['setter'];
-
- // validator check
- e = validate(self, name, value);
-
- if (e !== undefined) {
- if (opts.error) {
- opts.error(e);
- }
- return false;
- }
-
- // if setter has effect
- if (setter && (setter = normalFn(self, setter))) {
- setValue = setter.call(self, value, name);
- }
-
- if (setValue === INVALID) {
- return false;
- }
-
- if (setValue !== undefined) {
- value = setValue;
- }
-
-
- // finally set
- getAttrVals(self)[name] = value;
- },
-
- /**
- * Gets the current value of the attribute.
- * @param {String} name attribute 's name
- * @return {*}
- */
- get: function (name) {
- var self = this,
- dot = '.',
- path,
- declared = self.hasAttr(name),
- attrVals = getAttrVals(self),
- attrConfig,
- getter, ret;
-
- if (!declared && name.indexOf(dot) !== -1) {
- path = name.split(dot);
- name = path.shift();
- }
-
- attrConfig = ensureNonEmpty(getAttrs(self), name);
- getter = attrConfig['getter'];
-
- // get user-set value or default value
- //user-set value takes privilege
- ret = name in attrVals ?
- attrVals[name] :
- getDefAttrVal(self, name);
-
- // invoke getter for this attribute
- if (getter && (getter = normalFn(self, getter))) {
- ret = getter.call(self, ret, name);
- }
-
- if (!(name in attrVals) && ret !== undefined) {
- attrVals[name] = ret;
- }
-
- if (path) {
- ret = getValueByPath(ret, path);
- }
-
- return ret;
- },
-
- /**
- * Resets the value of an attribute.just reset what addAttr set
- * (not what invoker set when call new Xx(cfg))
- * @param {String} name name of attribute
- * @param {Object} [opts] some options
- * @param {Boolean} [opts.silent] whether fire change event
- * @chainable
- */
- reset: function (name, opts) {
- var self = this;
-
- if (typeof name == 'string') {
- if (self.hasAttr(name)) {
- // if attribute does not have default value, then set to undefined
- return self.set(name, getDefAttrVal(self, name), opts);
- }
- else {
- return self;
- }
- }
-
- opts = name;
-
- var attrs = getAttrs(self),
- values = {};
-
- // reset all
- for (name in attrs) {
- values[name] = getDefAttrVal(self, name);
- }
-
- self.set(values, opts);
- return self;
- }
- };
-
-
- // get default attribute value from valueFn/value
- function getDefAttrVal(self, name) {
- var attrs = getAttrs(self),
- attrConfig = ensureNonEmpty(attrs, name),
- valFn = attrConfig.valueFn,
- val;
-
- if (valFn && (valFn = normalFn(self, valFn))) {
- val = valFn.call(self);
- if (val !== undefined) {
- attrConfig.value = val;
- }
- delete attrConfig.valueFn;
- attrs[name] = attrConfig;
- }
-
- return attrConfig.value;
- }
-
- function validate(self, name, value, all) {
- var path, prevVal, pathNamePair;
-
- pathNamePair = getPathNamePair(self, name);
-
- name = pathNamePair.name;
- path = pathNamePair.path;
-
- if (path) {
- prevVal = self.get(name);
- value = getValueBySubValue(prevVal, path, value);
- }
- var attrConfig = ensureNonEmpty(getAttrs(self), name, true),
- e,
- validator = attrConfig['validator'];
- if (validator && (validator = normalFn(self, validator))) {
- e = validator.call(self, value, name, all);
- // undefined and true validate successfully
- if (e !== undefined && e !== true) {
- return e;
- }
- }
- return undefined;
- }
-
- return Attribute;
-});
-
-/*
- 2011-10-18
- get/set sub attribute value ,set('x.y',val) x 最好为 {} ,不要是 new Clz() 出来的
- add validator
- */
-/**
- * @ignore
- * @fileOverview attribute management and event in one
- * @author yiminghe@gmail.com, lifesinger@gmail.com
- */
-KISSY.add('base', function (S, Attribute, Event) {
-
- /**
- * @class KISSY.Base
- * @mixins KISSY.Event.Target
- * @mixins KISSY.Base.Attribute
- *
- * A base class which objects requiring attributes and custom event support can
- * extend. attributes configured
- * through the static {@link KISSY.Base#static-ATTRS} property for each class
- * in the hierarchy will be initialized by Base.
- */
- function Base(config) {
- var self = this,
- c = self.constructor;
- // save user config
- self.userConfig = config;
- // define
- while (c) {
- addAttrs(self, c['ATTRS']);
- c = c.superclass ? c.superclass.constructor : null;
- }
- // initial
- initAttrs(self, config);
- }
-
-
- /**
- * The default set of attributes which will be available for instances of this class, and
- * their configuration
- *
- * By default if the value is an object literal or an array it will be 'shallow' cloned, to
- * protect the default value.
- *
- * for example:
- * @example
- * {
- * x:{
- * value: // default value
- * valueFn: // default function to get value
- * getter: // getter function
- * setter: // setter function
- * }
- * }
- *
- * @property ATTRS
- * @member KISSY.Base
- * @static
- * @type {Object}
- */
-
-
- function addAttrs(host, attrs) {
- if (attrs) {
- for (var attr in attrs) {
- // 子类上的 ATTRS 配置优先
- // 父类后加,父类不覆盖子类的相同设置
- // 属性对象会 merge
- // a: {y: {getter: fn}}, b: {y: {value: 3}}
- // b extends a
- // =>
- // b {y: {value: 3, getter: fn}}
- host.addAttr(attr, attrs[attr], false);
- }
- }
- }
-
- function initAttrs(host, config) {
- if (config) {
- for (var attr in config) {
- // 用户设置会调用 setter/validator 的,但不会触发属性变化事件
- host.setInternal(attr, config[attr]);
- }
- }
- }
-
- S.augment(Base, Event.Target, Attribute);
-
- Base.Attribute = Attribute;
-
- S.Base = Base;
-
- return Base;
-}, {
- requires: ['base/attribute', 'event/custom']
-});
View
2  build/overlay-min.js
@@ -1,7 +1,7 @@
/*
Copyright 2012, KISSY UI Library v1.40dev
MIT Licensed
-build time: Dec 6 01:11
+build time: Dec 7 02:50
*/
KISSY.add("overlay/base",function(d,g,b,a,c,f,e){function k(a){var e=a.get("el"),c=d.all,e=e[0].cloneNode(!0);e.style.visibility="";e.style.overflow="hidden";e.className+=" "+a.get("prefixCls")+"overlay-ghost";var b;if(b=a.get("body"))a=c("."+a.get("prefixCls")+"stdmod-body",e),a.css({height:b.height(),width:b.width()}),a.html("");return c(e)}function h(a,e,c){a.__effectGhost&&a.__effectGhost.stop(1);var b=a.get("el"),f=d.all,i=a.get("effect"),h=f(i.target),f=i.duration,h=d.mix(h.offset(),{width:h.width(),
height:h.height()}),g=d.mix(b.offset(),{width:b.width(),height:b.height()}),j=k(a),i=i.easing;j.insertAfter(b);b.hide();e?(e=h,h=g):e=g;j.css(e);a.__effectGhost=j;j.animate(h,{duration:f,easing:i,complete:function(){a.__effectGhost=null;j.remove();b.show();c()}})}function i(a,e,b){var c=a.get("el"),f=a.get("effect"),i=f.effect||j,d=f.target;if(i==j&&!d)b();else if(d)h(a,e,b);else{var a=f.duration,f=f.easing,g=c.css("visibility"),d=e?1:0;c.stop(1,1);c.css({visibility:"visible",display:e?"none":"block"});
View
4 build/overlay.js
@@ -1,7 +1,7 @@
/*
Copyright 2012, KISSY UI Library v1.40dev
MIT Licensed
-build time: Dec 6 01:11
+build time: Dec 7 02:50
*/
/**
* @ignore
@@ -138,7 +138,6 @@ KISSY.add("overlay/base", function (S, Component,
* @mixins KISSY.Overlay.Extension.Loading
* @mixins KISSY.Component.Extension.Align
* @mixins KISSY.Overlay.Extension.Close
- * @mixins KISSY.Overlay.Extension.Resize
* @mixins KISSY.Overlay.Extension.Mask
*/
var Overlay = Component.Controller.extend([
@@ -321,7 +320,6 @@ KISSY.add('overlay/dialog', function (S, Overlay, DialogRender, Node, StdMod) {
* KISSY Dialog Component. xclass: 'dialog'.
* @extends KISSY.Overlay
* @mixins KISSY.Overlay.Extension.StdMod
- * @mixins KISSY.Overlay.Extension.Drag
*/
var Dialog = Overlay.extend([
StdMod
View
7 build/overlay/assets/dpl-min.css
@@ -1 +1,6 @@
-.ks-overlay{position:absolute;left:-9999px;top:-9999px;visibility:hidden;outline:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ks-ext-close{display:inline-block;*display:inline;*zoom:1;*display:inline;*zoom:1;*display:inline;*zoom:1;display:inline-block;*display:inline;*zoom:1;*display:inline;*zoom:1;*display:inline;*zoom:1;display:inline-block;*display:inline;*zoom:1;*display:inline;*zoom:1;*display:inline;*zoom:1;width:14px;height:14px;vertical-align:text-top;background-image:url(http://img04.taobaocdn.com/tps/i4/T1bxYzXmxeXXcIVv2D-469-159.png);background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;*margin-right:.3em;*margin-right:.3em;background-position:-312px 0;text-shadow:0 1px 0 white;opacity:.2;filter:alpha(opacity=20);*zoom:1;opacity:.2;filter:alpha(opacity=20);*zoom:1;opacity:.2;filter:alpha(opacity=20);*zoom:1;position:absolute;right:15px;top:9px;z-index:99}.ks-ext-close:last-child{*margin-left:0}.ks-ext-close:last-child{*margin-left:0}.ks-ext-close:last-child{*margin-left:0}.ks-ext-close:hover{opacity:1;filter:alpha(opacity=100);*zoom:1;opacity:1;filter:alpha(opacity=100);*zoom:1;opacity:1;filter:alpha(opacity=100);*zoom:1}.ks-ext-close-x{display:none}.ks-ext-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000;opacity:.8;filter:alpha(opacity=80);*zoom:1;opacity:.8;filter:alpha(opacity=80);*zoom:1;opacity:.8;filter:alpha(opacity=80);*zoom:1}.ks-dialog{position:absolute;left:-9999px;top:-9999px;visibility:hidden;z-index:1050;background-color:#fff;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3)}.ks-stdmod-header{padding:9px 15px;border-bottom:1px solid #eee}.ks-stdmod-body{overflow-y:auto;padding:15px}.ks-stdmod-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;*zoom:1;*zoom:1;*zoom:1}.ks-stdmod-footer:before,.ks-stdmod-footer:after{display:table;content:""}.ks-stdmod-footer:after{clear:both}.ks-stdmod-footer:before,.ks-stdmod-footer:after{display:table;content:""}.ks-stdmod-footer:after{clear:both}.ks-stdmod-footer:before,.ks-stdmod-footer:after{display:table;content:""}.ks-stdmod-footer:after{clear:both}.ks-stdmod-footer .ks-button+.ks-button{margin-left:5px;margin-bottom:0}.ks-stdmod-footer .ks-button-group .ks-button+.ks-button{margin-left:-1px}.ks-popup{z-index:1010;padding:5px}.ks-popup.ks-popup-top{margin-top:-5px}.ks-popup.ks-popup-right{margin-left:5px}.ks-popup.ks-popup-bottom{margin-top:5px}.ks-popup.ks-popup-left{margin-left:-5px}.ks-popup.ks-popup-top .ks-popup-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000}.ks-popup.ks-popup-right .ks-popup-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000}.ks-popup.ks-popup-bottom .ks-popup-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000}.ks-popup.ks-popup-left .ks-popup-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000}.ks-popup .ks-popup-arrow{position:absolute;width:0;height:0}.ks-popup-inner{padding:3px;overflow:hidden;background:#000;background:rgba(0,0,0,0.8);border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3)}.ks-popup-title{padding:9px 15px;margin:0;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;border-radius:3px 3px 0 0}.ks-popup-content{padding:14px;background-color:#fff;border-radius:0 0 3px 3px}.ks-tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
+.ks-overlay{position:absolute;left:-9999px;top:-9999px;visibility:hidden;outline:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ks-ext-close{display:inline-block;*display:inline;*zoom:1;*display:inline;*zoom:1;*display:inline;*zoom:1;display:inline-block;*display:inline;*zoom:1;*display:inline;*zoom:1;*display:inline;*zoom:1;display:inline-block;*display:inline;*zoom:1;*display:inline;*zoom:1;*display:inline;*zoom:1;width:14px;height:14px;vertical-align:text-top;background-image:url(http://img04.taobaocdn.com/tps/i4/T1bxYzXmxeXXcIVv2D-469-159.png);background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;*margin-right:.3em;*margin-right:.3em;background-position:-312px 0;text-shadow:0 1px 0 white;opacity:.2;filter:alpha(opacity=20);*zoom:1;opacity:.2;filter:alpha(opacity=20);*zoom:1;opacity:.2;filter:alpha(opacity=20);*zoom:1;position:absolute;right:15px;top:9px;z-index:99}.ks-ext-close:last-child{*margin-left:0}.ks-ext-close:last-child{*margin-left:0}.ks-ext-close:last-child{*margin-left:0}.ks-ext-close:hover{opacity:1;filter:alpha(opacity=100);*zoom:1;opacity:1;filter:alpha(opacity=100);*zoom:1;opacity:1;filter:alpha(opacity=100);*zoom:1}.ks-ext-close-x{display:none}.ks-ext-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000;opacity:.8;filter:alpha(opacity=80);*zoom:1;opacity:.8;filter:alpha(opacity=80);*zoom:1;opacity:.8;filter:alpha(opacity=80);*zoom:1}.ks-dialog{position:absolute;left:-9999px;top:-9999px;visibility:hidden;z-index:1050;background-color:#fff;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3)}.ks-stdmod-header{padding:9px 15px;border-bottom:1px solid #eee}.ks-stdmod-body{overflow-y:auto;padding:15px}.ks-stdmod-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;*zoom:1;*zoom:1;*zoom:1}.ks-stdmod-footer:before,.ks-stdmod-footer:after{display:table;content:""}.ks-stdmod-footer:after{clear:both}.ks-stdmod-footer:before,.ks-stdmod-footer:after{display:table;content:""}.ks-stdmod-footer:after{clear:both}.ks-stdmod-footer:before,.ks-stdmod-footer:after{display:table;content:""}.ks-stdmod-footer:after{clear:both}.ks-stdmod-footer .ks-button+.ks-button{margin-left:5px;margin-bottom:0}.ks-stdmod-footer .ks-button-group .ks-button+.ks-button{margin-left:-1px}.ks-popup{z-index:1010;padding:5px}.ks-popup.ks-popup-top{margin-top:-5px}.ks-popup.ks-popup-right{margin-left:5px}.ks-popup.ks-popup-bottom{margin-top:5px}.ks-popup.ks-popup-left{margin-left:-5px}.ks-popup.ks-popup-top .ks-popup-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000}.ks-popup.ks-popup-right .ks-popup-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000}.ks-popup.ks-popup-bottom .ks-popup-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000}.ks-popup.ks-popup-left .ks-popup-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000}.ks-popup .ks-popup-arrow{position:absolute;width:0;height:0}.ks-popup-inner{padding:3px;overflow:hidden;background:#000;background:rgba(0,0,0,0.8);border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3)}.ks-popup-title{padding:9px 15px;margin:0;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;border-radius:3px 3px 0 0}.ks-popup-content{padding:14px;background-color:#fff;border-radius:0 0 3px 3px}.ks-tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}
View
5 build/overlay/assets/dpl.css
@@ -1,3 +1,8 @@
+/*
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
/**
* Variables to customize the look and feel from Bootstrap.
*
View
7 build/overlay/assets/dpl/dialog-min.css
@@ -1 +1,6 @@
-.ks-ext-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000;opacity:.8;filter:alpha(opacity=80);*zoom:1}.ks-dialog{position:absolute;left:-9999px;top:-9999px;visibility:hidden;z-index:1050;background-color:#fff;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3)}.ks-stdmod-header{padding:9px 15px;border-bottom:1px solid #eee}.ks-stdmod-body{overflow-y:auto;padding:15px}.ks-stdmod-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;*zoom:1}.ks-stdmod-footer:before,.ks-stdmod-footer:after{display:table;content:""}.ks-stdmod-footer:after{clear:both}.ks-stdmod-footer .ks-button+.ks-button{margin-left:5px;margin-bottom:0}.ks-stdmod-footer .ks-button-group .ks-button+.ks-button{margin-left:-1px}
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
+.ks-ext-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000;opacity:.8;filter:alpha(opacity=80);*zoom:1}.ks-dialog{position:absolute;left:-9999px;top:-9999px;visibility:hidden;z-index:1050;background-color:#fff;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3)}.ks-stdmod-header{padding:9px 15px;border-bottom:1px solid #eee}.ks-stdmod-body{overflow-y:auto;padding:15px}.ks-stdmod-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;*zoom:1}.ks-stdmod-footer:before,.ks-stdmod-footer:after{display:table;content:""}.ks-stdmod-footer:after{clear:both}.ks-stdmod-footer .ks-button+.ks-button{margin-left:5px;margin-bottom:0}.ks-stdmod-footer .ks-button-group .ks-button+.ks-button{margin-left:-1px}
View
5 build/overlay/assets/dpl/dialog.css
@@ -1,3 +1,8 @@
+/*
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
/**
* Variables to customize the look and feel from Bootstrap.
*
View
7 build/overlay/assets/dpl/overlay-min.css
@@ -1 +1,6 @@
-.ks-overlay{position:absolute;left:-9999px;top:-9999px;visibility:hidden;outline:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ks-ext-close{display:inline-block;*display:inline;*zoom:1;width:14px;height:14px;vertical-align:text-top;background-image:url(http://img04.taobaocdn.com/tps/i4/T1bxYzXmxeXXcIVv2D-469-159.png);background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;background-position:-312px 0;text-shadow:0 1px 0 white;opacity:.2;filter:alpha(opacity=20);*zoom:1;position:absolute;right:15px;top:9px;z-index:99}.ks-ext-close:last-child{*margin-left:0}.ks-ext-close:hover{opacity:1;filter:alpha(opacity=100);*zoom:1}.ks-ext-close-x{display:none}
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
+.ks-overlay{position:absolute;left:-9999px;top:-9999px;visibility:hidden;outline:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ks-ext-close{display:inline-block;*display:inline;*zoom:1;width:14px;height:14px;vertical-align:text-top;background-image:url(http://img04.taobaocdn.com/tps/i4/T1bxYzXmxeXXcIVv2D-469-159.png);background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;background-position:-312px 0;text-shadow:0 1px 0 white;opacity:.2;filter:alpha(opacity=20);*zoom:1;position:absolute;right:15px;top:9px;z-index:99}.ks-ext-close:last-child{*margin-left:0}.ks-ext-close:hover{opacity:1;filter:alpha(opacity=100);*zoom:1}.ks-ext-close-x{display:none}
View
5 build/overlay/assets/dpl/overlay.css
@@ -1,3 +1,8 @@
+/*
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
/**
* Variables to customize the look and feel from Bootstrap.
*
View
7 build/overlay/assets/dpl/popup-min.css
@@ -1 +1,6 @@
-.ks-popup{z-index:1010;padding:5px}.ks-popup.ks-popup-top{margin-top:-5px}.ks-popup.ks-popup-right{margin-left:5px}.ks-popup.ks-popup-bottom{margin-top:5px}.ks-popup.ks-popup-left{margin-left:-5px}.ks-popup.ks-popup-top .ks-popup-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000}.ks-popup.ks-popup-right .ks-popup-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000}.ks-popup.ks-popup-bottom .ks-popup-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000}.ks-popup.ks-popup-left .ks-popup-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000}.ks-popup .ks-popup-arrow{position:absolute;width:0;height:0}.ks-popup-inner{padding:3px;overflow:hidden;background:#000;background:rgba(0,0,0,0.8);border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3)}.ks-popup-title{padding:9px 15px;margin:0;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;border-radius:3px 3px 0 0}.ks-popup-content{padding:14px;background-color:#fff;border-radius:0 0 3px 3px}.ks-tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
+.ks-popup{z-index:1010;padding:5px}.ks-popup.ks-popup-top{margin-top:-5px}.ks-popup.ks-popup-right{margin-left:5px}.ks-popup.ks-popup-bottom{margin-top:5px}.ks-popup.ks-popup-left{margin-left:-5px}.ks-popup.ks-popup-top .ks-popup-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000}.ks-popup.ks-popup-right .ks-popup-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000}.ks-popup.ks-popup-bottom .ks-popup-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000}.ks-popup.ks-popup-left .ks-popup-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000}.ks-popup .ks-popup-arrow{position:absolute;width:0;height:0}.ks-popup-inner{padding:3px;overflow:hidden;background:#000;background:rgba(0,0,0,0.8);border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3)}.ks-popup-title{padding:9px 15px;margin:0;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;border-radius:3px 3px 0 0}.ks-popup-content{padding:14px;background-color:#fff;border-radius:0 0 3px 3px}.ks-tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}
View
5 build/overlay/assets/dpl/popup.css
@@ -1,3 +1,8 @@
+/*
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
/**
* Variables to customize the look and feel from Bootstrap.
*
View
5 build/overlay/assets/dpl/variables-min.css
@@ -0,0 +1,5 @@
+/*
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
View
5 build/overlay/assets/dpl/variables.css
@@ -1,3 +1,8 @@
+/*
+Copyright 2012, KISSY UI Library v1.40dev
+MIT Licensed
+build time: Dec 7 02:50
+*/
/**
* Variables to customize the look and feel from Bootstrap.
*
View
26 build/overlay/overlay-pkg-min.js
@@ -1,26 +0,0 @@
-KISSY.add("overlay/base",function(d,g,b,a,c,f,e){function k(a){var e=a.get("el"),c=d.all,e=e[0].cloneNode(!0);e.style.visibility="";e.style.overflow="hidden";e.className+=" "+a.get("prefixCls")+"overlay-ghost";var b;if(b=a.get("body"))a=c("."+a.get("prefixCls")+"stdmod-body",e),a.css({height:b.height(),width:b.width()}),a.html("");return c(e)}function h(a,e,c){a.__effectGhost&&a.__effectGhost.stop(1);var b=a.get("el"),f=d.all,i=a.get("effect"),h=f(i.target),f=i.duration,h=d.mix(h.offset(),{width:h.width(),
-height:h.height()}),g=d.mix(b.offset(),{width:b.width(),height:b.height()}),j=k(a),i=i.easing;j.insertAfter(b);b.hide();e?(e=h,h=g):e=g;j.css(e);a.__effectGhost=j;j.animate(h,{duration:f,easing:i,complete:function(){a.__effectGhost=null;j.remove();b.show();c()}})}function i(a,e,b){var c=a.get("el"),f=a.get("effect"),i=f.effect||j,d=f.target;if(i==j&&!d)b();else if(d)h(a,e,b);else{var a=f.duration,f=f.easing,g=c.css("visibility"),d=e?1:0;c.stop(1,1);c.css({visibility:"visible",display:e?"none":"block"});
-c[i+l[i][d]](a,function(){c.css({display:"block",visibility:g});b()},f)}}var j="none",l={fade:["Out","In"],slide:["Up","Down"]};return g.Controller.extend([b.ContentBox,b.Position,a,b.Align,c,f],{_onSetVisible:function(a){var e=this;e.get("rendered")&&i(e,a,function(){e.fire(a?"show":"hide")})}},{ATTRS:{effect:{value:{effect:"",target:null,duration:0.5,easing:"easeOut"},setter:function(a){var e=a.effect;"string"==typeof e&&!l[e]&&(a.effect="")}},focusable:{value:!1},allowTextSelection:{value:!0},
-closable:{value:!1},handleMouseEvents:{value:!1},xrender:{value:e}}},{xclass:"overlay",priority:10})},{requires:"component/base,component/extension,./extension/loading,./extension/close,./extension/mask,./overlay-render".split(",")});
-KISSY.add("overlay/dialog-render",function(d,g,b){return g.extend([b],{createDom:function(){var a=this.get("el"),c,b=this.get("header");if(!(c=b.attr("id")))b.attr("id",c=d.guid("ks-dialog-header"));a.attr("role","dialog").attr("aria-labelledby",c);a.append("<div tabindex='0' style='position:absolute;'></div>")}})},{requires:["./overlay-render","./extension/stdmod-render"]});
-KISSY.add("overlay/dialog",function(d,g,b,a,c){var f=a.all,e=g.extend([c],{handleKeyEventInternal:function(e){if(this.get("escapeToClose")&&e.keyCode===a.KeyCodes.ESC){if("select"!=e.target.nodeName.toLowerCase()||e.target.disabled)this.close(),e.halt()}else a:if(e.keyCode==k){var b=this.get("el"),c=f(e.target),d=b.last();if(c.equals(b)&&e.shiftKey)d[0].focus(),e.halt();else if(c.equals(d)&&!e.shiftKey)b[0].focus(),e.halt();else if(c.equals(b)||b.contains(c))break a;e.halt()}},_onSetVisible:function(a){var b=
-this.get("el");a?(this.__lastActive=b[0].ownerDocument.activeElement,b[0].focus&&b[0].focus(),b.attr("aria-hidden","false")):(b.attr("aria-hidden","true"),this.__lastActive&&this.__lastActive.focus());e.superclass._onSetVisible.apply(this,arguments)}},{ATTRS:{closable:{value:!0},xrender:{value:b},focusable:{value:!0},escapeToClose:{value:!0}}},{xclass:"dialog",priority:20}),k=a.KeyCodes.TAB;return e},{requires:["./base","./dialog-render","node","./extension/stdmod"]});
-KISSY.add("overlay/extension/close-render",function(d,g){function b(a){return new g("<a tabindex='0' href='javascript:void(\"\u5173\u95ed\")' role='button' style='z-index:9' class='"+a+c+"close'><span class='"+a+c+"close-x'>\u5173\u95ed</span></a>")}function a(){}var c="ext-";a.ATTRS={closable:{value:!0},closeBtn:{}};a.HTML_PARSER={closeBtn:function(a){return a.one("."+this.get("prefixCls")+c+"close")}};a.prototype={_onSetClosable:function(a){var e=this.get("closeBtn");a?(e||this.setInternal("closeBtn",e=b(this.get("prefixCls"))),
-this.get("el").prepend(e)):e&&e.remove()}};return a},{requires:["node"]});
-KISSY.add("overlay/extension/close",function(){function d(){}d.ATTRS={closable:{view:1},closeBtn:{view:1},closeAction:{value:"hide"}};var g={hide:"hide",destroy:"destroy"};d.prototype={_onSetClosable:function(b){var a=this;b&&!a.__bindCloseEvent&&(a.__bindCloseEvent=1,a.get("closeBtn").on("click",function(b){a.close();b.preventDefault()}))},close:function(){this[g[this.get("closeAction")]||"hide"]();return this},__destructor:function(){var b=this.get("closeBtn");b&&b.detach()}};return d});
-KISSY.add("overlay/extension/loading-render",function(d,g){function b(){}b.prototype={loading:function(){this._loadingExtEl||(this._loadingExtEl=(new g("<div class='"+this.get("prefixCls")+"ext-loading' style='position: absolute;border: none;width: 100%;top: 0;left: 0;z-index: 99999;height:100%;*height: expression(this.parentNode.offsetHeight);'/>")).appendTo(this.get("el")));this._loadingExtEl.show()},unloading:function(){var a=this._loadingExtEl;a&&a.hide()}};return b},{requires:["node"]});
-KISSY.add("overlay/extension/loading",function(){function d(){}d.prototype={loading:function(){this.get("view").loading();return this},unloading:function(){this.get("view").unloading();return this}};return d});
-KISSY.add("overlay/extension/mask-render",function(d,g){function b(a){a=a.get("prefixCls")+"ext-mask "+a.getCssClassWithState("-mask");a=f("<div style='width:"+(c?"expression(KISSY.DOM.docWidth())":"100%")+";left:0;top:0;height:"+(c?"expression(KISSY.DOM.docHeight())":"100%")+";position:"+(c?"absolute":"fixed")+";' class='"+a+"'>"+(c?"<iframe style='position:absolute;left:0;top:0;background:red;width: expression(this.parentNode.offsetWidth);height: expression(this.parentNode.offsetHeight);filter:alpha(opacity=0);z-index:-1;'></iframe>":
-"")+"</div>").prependTo("body");a.unselectable();a.on("mousedown",function(a){a.preventDefault()});return a}function a(){}var c=6===d.UA.ie,f=g.all;a.ATTRS={mask:{value:!1},maskNode:{}};a.prototype={__renderUI:function(){this.get("mask")&&this.set("maskNode",b(this))},__syncUI:function(){this.get("mask")&&this.ksSetMaskVisible(this.get("visible"),1)},ksSetMaskVisible:function(a,b){var c=this.getCssClassWithState("-mask-shown"),d=this.get("maskNode"),f=this.getCssClassWithState("-mask-hidden");a?d.removeClass(f).addClass(c):
-d.removeClass(c).addClass(f);b||d.css("visibility",a?"visible":"hidden")},__destructor:function(){var a;(a=this.get("maskNode"))&&a.remove()}};return a},{requires:["node"]});
-KISSY.add("overlay/extension/mask",function(d,g){function b(){}b.ATTRS={mask:{view:1},maskNode:{view:1}};var a={fade:["Out","In"],slide:["Up","Down"]};b.prototype={__bindUI:function(){var b=this,d,e,k=b.get("el"),h=b.get("view");if(e=b.get("mask")){d=b.get("maskNode");if(e.hideOnClick)d.on(g.Gesture.tap,function(){b.hide()});b.on("afterVisibleChange",function(b){if(b=b.newVal){var c=parseInt(k.css("z-index"))||1;d.css("z-index",c-1)}c=e.effect||"none";if("none"==c)h.ksSetMaskVisible(b);else{h.ksSetMaskVisible(b,
-1);var g=e.duration,m=e.easing,n=b?1:0;d.stop(1,1);d.css("display",b?"none":"block");d[c+a[c][n]](g,null,m)}})}}};return b},{requires:["event"]});
-KISSY.add("overlay/extension/stdmod-render",function(d,g){function b(){}function a(a,b){var c=a.get("contentEl"),d=a.get(b);d||(d=new g("<div class='"+a.get("prefixCls")+f+b+"' ></div>"),d.appendTo(c),a.setInternal(b,d))}function c(a,b,c){b=a.get(b);"string"==typeof c?b.html(c):b.html("").append(c)}var f="stdmod-";b.ATTRS={header:{},body:{},footer:{},bodyStyle:{},footerStyle:{},headerStyle:{},headerContent:{},bodyContent:{},footerContent:{}};b.HTML_PARSER={header:function(a){return a.one("."+this.get("prefixCls")+
-f+"header")},body:function(a){return a.one("."+this.get("prefixCls")+f+"body")},footer:function(a){return a.one("."+this.get("prefixCls")+f+"footer")}};b.prototype={__createDom:function(){a(this,"header");a(this,"body");a(this,"footer")},_onSetBodyStyle:function(a){this.get("body").css(a)},_onSetHeaderStyle:function(a){this.get("header").css(a)},_onSetFooterStyle:function(a){this.get("footer").css(a)},_onSetBodyContent:function(a){c(this,"body",a)},_onSetHeaderContent:function(a){c(this,"header",
-a)},_onSetFooterContent:function(a){c(this,"footer",a)}};return b},{requires:["node"]});KISSY.add("overlay/extension/stdmod",function(){function d(){}d.ATTRS={header:{view:1},body:{view:1},footer:{view:1},bodyStyle:{view:1},footerStyle:{view:1},headerStyle:{view:1},headerContent:{view:1},bodyContent:{view:1},footerContent:{view:1}};return d});
-KISSY.add("overlay/overlay-render",function(d,g,b,a,c,f){return g.Render.extend([b.ContentBox.Render,b.Position.Render,a,6===d.UA.ie?b.Shim.Render:null,c,f])},{requires:["component/base","component/extension","./extension/loading-render","./extension/close-render","./extension/mask-render"]});
-KISSY.add("overlay",function(d,g,b,a,c,f){g.Render=b;a.Render=c;g.Dialog=a;d.Dialog=a;g.Popup=f;return d.Overlay=g},{requires:["overlay/base","overlay/overlay-render","overlay/dialog","overlay/dialog-render","overlay/popup"]});
-KISSY.add("overlay/popup",function(d,g,b){return g.extend({initializer:function(){var a=this;a.get("trigger")&&("mouse"===a.get("triggerType")?(a._bindTriggerMouse(),a.on("afterRenderUI",function(){a._bindContainerMouse()})):a._bindTriggerClick())},_bindTriggerMouse:function(){var a=this,c=a.get("trigger"),f;a.__mouseEnterPopup=function(c){a._clearHiddenTimer();f=d.later(function(){a._showing(c);f=b},1E3*a.get("mouseDelay"))};c.on("mouseenter",a.__mouseEnterPopup);a._mouseLeavePopup=function(){f&&
-(f.cancel(),f=b);a._setHiddenTimer()};c.on("mouseleave",a._mouseLeavePopup)},_bindContainerMouse:function(){this.get("el").on("mouseleave",this._setHiddenTimer,this).on("mouseenter",this._clearHiddenTimer,this)},_setHiddenTimer:function(){var a=this;a._hiddenTimer=d.later(function(){a._hiding()},1E3*a.get("mouseDelay"))},_clearHiddenTimer:function(){this._hiddenTimer&&(this._hiddenTimer.cancel(),this._hiddenTimer=b)},_bindTriggerClick:function(){var a=this;a.__clickPopup=function(b){b.halt();if(a.get("toggle"))a[a.get("visible")?
-"_hiding":"_showing"](b);else a._showing(b)};a.get("trigger").on("click",a.__clickPopup)},_showing:function(a){this.set("currentTrigger",d.one(a.target));this.show()},_hiding:function(){this.set("currentTrigger",b);this.hide()},destructor:function(){var a,b=this.get("trigger");b&&(this.__clickPopup&&b.detach("click",this.__clickPopup),this.__mouseEnterPopup&&b.detach("mouseenter",this.__mouseEnterPopup),this._mouseLeavePopup&&b.detach("mouseleave",this._mouseLeavePopup));(a=this.get("el"))&&a.detach("mouseleave",
-this._setHiddenTimer,this).detach("mouseenter",this._clearHiddenTimer,this)}},{ATTRS:{trigger:{setter:function(a){return d.all(a)}},triggerType:{value:"click"},currentTrigger:{},mouseDelay:{value:0.1},toggle:{value:!1}}},{xclass:"popup",priority:20})},{requires:["./base"]});
View
1,411 build/overlay/overlay-pkg.js
@@ -1,1411 +0,0 @@
-/**
- * @ignore
- * @fileOverview controller for overlay
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/base", function (S, Component,
- Extension,
- Loading,
- Close,
- Mask,
- OverlayRender) {
-
- var NONE = 'none',
- DURATION = 0.5,
- effects = {fade: ["Out", "In"], slide: ["Up", "Down"]};
-
- function getGhost(self) {
- var el = self.get("el"), $ = S.all;
- var ghost = el[0].cloneNode(true);
- ghost.style.visibility = "";
- ghost.style.overflow = "hidden";
- ghost.className += " " + self.get("prefixCls") + "overlay-ghost";
- var body, elBody;
- if (elBody = self.get("body")) {
- body = $('.' + self.get('prefixCls') + 'stdmod-body', ghost);
- body.css({
- height: elBody.height(),
- width: elBody.width()
- });
- body.html('')
- }
- return $(ghost);
- }
-
- function processTarget(self, show, callback) {
-
- if (self.__effectGhost) {
- self.__effectGhost.stop(1);
- }
-
- var el = self.get("el"),
- $ = S.all,
- effectCfg = self.get("effect"),
- target = $(effectCfg.target),
- duration = effectCfg.duration,
- targetBox = S.mix(target.offset(), {
- width: target.width(),
- height: target.height()
- }),
- elBox = S.mix(el.offset(), {
- width: el.width(),
- height: el.height()
- }),
- from, to,
- ghost = getGhost(self),
- easing = effectCfg.easing;
-
-
- ghost.insertAfter(el);
-
- el.hide();
-
- if (show) {
- from = targetBox;
- to = elBox;
- } else {
- from = elBox;
- to = targetBox;
- }
-
- ghost.css(from);
-
- self.__effectGhost = ghost;
-
- ghost.animate(to, {
- duration: duration,
- easing: easing,
- complete: function () {
- self.__effectGhost = null;
- ghost.remove();
- el.show();
- callback();
- }
- });
-
- }
-
- function processEffect(self, show, callback) {
- var el = self.get("el"),
- effectCfg = self.get("effect"),
- effect = effectCfg.effect || NONE,
- target = effectCfg.target;
- if (effect == NONE && !target) {
- callback();
- return;
- }
- if (target) {
- processTarget(self, show, callback);
- return;
- }
- var duration = effectCfg.duration,
- easing = effectCfg.easing,
- // need to get before stop, in case anim 's complete function change it
- originalVisibility = el.css('visibility'),
- index = show ? 1 : 0;
- // 队列中的也要移去
- // run complete fn to restore window's original height
- el.stop(1, 1);
- el.css({
- // must show, override box-render _onSetVisible
- "visibility": "visible",
- // fadeIn need display none, fadeOut need display block
- "display": show ? 'none' : 'block'
- });
- var m = effect + effects[effect][index];
- el[m](duration, function () {
- el.css({
- // need compute coordinates when show, so do not use display none for hide
- "display": 'block',
- // restore to box-render _onSetVisible
- "visibility": originalVisibility
- });
- callback();
- }, easing);
- }
-
- /**
- * KISSY Overlay Component. xclass: 'overlay'.
- * @class KISSY.Overlay
- * @extends KISSY.Component.Controller
- * @mixins KISSY.Component.Extension.ContentBox
- * @mixins KISSY.Component.Extension.Position
- * @mixins KISSY.Overlay.Extension.Loading
- * @mixins KISSY.Component.Extension.Align
- * @mixins KISSY.Overlay.Extension.Close
- * @mixins KISSY.Overlay.Extension.Mask
- */
- var Overlay = Component.Controller.extend([
- Extension.ContentBox,
- Extension.Position,
- Loading,
- Extension.Align,
- Close,
- Mask
- ],{
- /**
- * For overlay with effect, it should listen show and hide instead of afterVisibleChange.
- * @protected
- */
- _onSetVisible: function (v) {
- var self = this;
- if (self.get('rendered')) {
- // delay show and hide event after anim
- processEffect(self, v, function () {
- self.fire(v ? 'show' : 'hide');
- });
- }
- }
-
- }, {
- ATTRS: {
-
- /**
- * Set v as overlay 's show effect
- *
- * - v.effect (String): Default:none.
- * can be set as "fade" or "slide"
- *
- * - v.target (String|KISS.Node):
- * The target node from which overlay should animate from while showing.
- *
- * - v.duration (Number): in seconds.
- * Default:0.5.
- *
- * - v.easing (String|Function):
- * for string see {@link KISSY.Anim.Easing} 's method name.
- *
- * @cfg {Object} effect
- */
- /**
- * @ignore
- */
- effect: {
- value: {
- effect: '',
- target: null,
- duration: DURATION,
- easing: 'easeOut'
- },
- setter: function (v) {
- var effect = v.effect;
- if (typeof effect == 'string' && !effects[effect]) {
- v.effect = '';
- }
- }
-
- },
-
- /**
- * overlay can not have focus.
- *
- * Defaults to: false.
- *
- * @cfg {boolean} focusable
- * @protected
- */
- /**
- * @ignore
- */
- focusable: {
- value: false
- },
-
- /**
- * overlay can have text selection.
- *
- * Defaults to: true.
- *
- * @cfg {boolean} allowTextSelection
- * @protected
- */
- /**
- * @ignore
- */
- allowTextSelection: {
- value: true
- },
-
- /**
- * whether this component can be closed.
- *
- * Defaults to: false
- *
- * @cfg {Boolean} closable
- */
- /**
- * @ignore
- */
- closable: {
- value: false
- },
-
- /**
- * whether this component can be responsive to mouse.
- *
- * Defaults to: false
- *
- * @cfg {Boolean} handleMouseEvents
- * @protected
- */
- /**
- * @ignore
- */
- handleMouseEvents: {
- value: false
- },
- xrender: {
- value: OverlayRender
- }
- }
- }, {
- xclass: 'overlay',
- priority: 10
- });
-
- return Overlay;
-}, {
- requires: [
- 'component/base',
- 'component/extension',
- "./extension/loading",
- "./extension/close",
- "./extension/mask",
- './overlay-render']
-});/**
- * @ignore
- * @fileOverview render for dialog
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/dialog-render", function (S, OverlayRender,StdMod) {
- return OverlayRender.extend([
- StdMod
- ], {
- createDom: function () {
- var self = this,
- el = self.get("el"),
- id,
- header = self.get("header");
- if (!(id = header.attr("id"))) {
- header.attr("id", id = S.guid("ks-dialog-header"));
- }
- el.attr("role", "dialog")
- .attr("aria-labelledby", id);
- // 哨兵元素,从这里 tab 出去到弹窗根节点
- // 从根节点 shift tab 出去到这里
- // tab catcher
- el.append("<div " + "t" + "ab" + "index='0' " +
- // do not mess with main dialog
- "style='position:absolute;'></div>");
- }
- });
-}, {
- requires: ['./overlay-render','./extension/stdmod-render']
-});/**
- * @ignore
- * @fileOverview KISSY.Dialog
- * @author yiminghe@gmail.com
- */
-KISSY.add('overlay/dialog', function (S, Overlay, DialogRender, Node, StdMod) {
-
- var $ = Node.all;
-
- /**
- * @class KISSY.Overlay.Dialog
- * KISSY Dialog Component. xclass: 'dialog'.
- * @extends KISSY.Overlay
- * @mixins KISSY.Overlay.Extension.StdMod
- */
- var Dialog = Overlay.extend([
- StdMod
- ], {
- handleKeyEventInternal: function (e) {
- if (this.get('escapeToClose') &&
- e.keyCode === Node.KeyCodes.ESC) {
- if (e.target.nodeName.toLowerCase() == 'select' &&
- !e.target.disabled) {
- // escape at select
- } else {
- this.close();
- e.halt();
- }
- return;
- }
- trapFocus.call(this, e);
- },
-
- _onSetVisible: function (v) {
- var self = this, el = self.get('el');
- if (v) {
- self.__lastActive = el[0].ownerDocument.activeElement;
- el[0].focus && el[0].focus();
- el.attr("aria-hidden", "false");
- } else {
- el.attr("aria-hidden", "true");
- self.__lastActive && self.__lastActive.focus();
- }
- // prevent display none for effect
- Dialog.superclass._onSetVisible.apply(self, arguments);
- }
- },
-
- {
- ATTRS: {
-
- /**
- * whether this component can be closed.
- *
- * Defaults to: true
- *
- * @cfg {Boolean} closable
- * @protected
- */
- /**
- * @ignore
- */
- closable: {
- value: true
- },
-
- xrender: {
- value: DialogRender
- },
-
- /**
- * whether this component can be focused.
- *
- * Defaults to: true
- *
- * @cfg {Boolean} focusable
- * @protected
- */
- /**
- * @ignore
- */
- focusable: {
- value: true
- },
-
-
- /**
- * whether this component can be closed by press escape key.
- *
- * Defaults to: true
- *
- * @cfg {Boolean} escapeToClose
- * @since 1.3.0
- */
- /**
- * @ignore
- */
- escapeToClose: {
- value: true
- }
- }
- }, {
-
- // TODO either change to overlay-dialog
- // or move dialog to outer module
- xclass: 'dialog',
- priority: 20
- });
-
-
- var KEY_TAB = Node.KeyCodes.TAB;
-
- // 不完美的方案,窗体末尾空白 tab 占位符,多了 tab 操作一次
- function trapFocus(e) {
-
- var self = this,
- keyCode = e.keyCode;
-
- if (keyCode != KEY_TAB) {
- return;
- }
- var el = self.get("el");
- // summary:
- // Handles the keyboard events for accessibility reasons
-
- var node = $(e.target); // get the target node of the keypress event
-
- // find the first and last tab focusable items in the hierarchy of the dialog container node
- // do this every time if the items may be added / removed from the the dialog may change visibility or state
-
- var lastFocusItem = el.last();
-
- // assumes el and lastFocusItem maintained by dialog object
-
- // see if we are shift-tabbing from first focusable item on dialog
- if (node.equals(el) && e.shiftKey) {
- lastFocusItem[0].focus(); // send focus to last item in dialog
- e.halt(); //stop the tab keypress event
- }
- // see if we are tabbing from the last focusable item
- else if (node.equals(lastFocusItem) && !e.shiftKey) {
- el[0].focus(); // send focus to first item in dialog
- e.halt(); //stop the tab keypress event
- }
- else {
- // see if the key is for the dialog
- if (node.equals(el) || el.contains(node)) {
- return;
- }
- }
- // this key is for the document window
- // allow tabbing into the dialog
- e.halt();//stop the event if not a tab keypress
- } // end of function
- return Dialog;
-
-}, {
- requires: [
- "./base",
- './dialog-render',
- 'node',
- './extension/stdmod'
- ]
-});
-
-/**
- * @ignore
- *
- * 2012-09-06 yiminghe@gmail.com
- * merge aria with dialog
- * http://www.w3.org/TR/wai-aria-practices/#trap_focus
- *
- * 2010-11-10 yiminghe@gmail.com
- * 重构,使用扩展类
- *//**
- * @ignore
- * @fileOverview close extension for kissy dialog
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/extension/close-render", function (S, Node) {
-
- var CLS_PREFIX = 'ext-';
-
- function getCloseRenderBtn(prefixCls) {
- return new Node("<a " +
- "tabindex='0' " +
- "href='javascript:void(\"关闭\")' " +
- "role='button' " +
- "style='z-index:9' " +
- "class='" + prefixCls + CLS_PREFIX + "close" + "'>" +
- "<span class='" +
- prefixCls + CLS_PREFIX + "close-x" +
- "'>关闭<" + "/span>" +
- "<" + "/a>");
- }
-
- function CloseRender() {
- }
-
- CloseRender.ATTRS = {
- closable: {
- value: true
- },
- closeBtn: {
- }
- };
-
- CloseRender.HTML_PARSER = {
- closeBtn: function (el) {
- return el.one("." + this.get('prefixCls') + CLS_PREFIX + 'close');
- }
- };
-
- CloseRender.prototype = {
- _onSetClosable: function (v) {
- var self = this,
- btn = self.get("closeBtn");
- if (v) {
- if (!btn) {
- self.setInternal("closeBtn", btn = getCloseRenderBtn(self.get('prefixCls')));
- }
- self.get("el").prepend(btn);
- } else {
- if (btn) {
- btn.remove();
- }
- }
- }
- };
-
- return CloseRender;
-
-}, {
- requires: ["node"]
-});/**
- * @ignore
- * @fileOverview close extension for kissy dialog
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/extension/close", function () {
-
- /**
- * @class KISSY.Overlay.Extension.Close
- * Close extension class. Represent a close button.
- */
- function Close() {
- }
-
- var HIDE = "hide";
-
- Close.ATTRS = {
- /**
- * Whether close button is visible.
- *
- * Defaults to: true.
- *
- * @cfg {Boolean} closable
- */
- /**
- * Whether close button is visible.
- * @type {Boolean}
- * @property closable
- */
- /**
- * @ignore
- */
- closable:{
- view:1
- },
-
- /**
- * close button element.
- * @type {KISSY.NodeList}
- * @property closeBtn
- * @readonly
- */
- /**
- * @ignore
- */
- closeBtn:{
- view:1
- },
-
- /**
- * Whether to destroy or hide current element when click close button.
- * Can set "destroy" to destroy it when click close button.
- *
- * Defaults to: "hide".
- *
- * @cfg {String} closeAction
- */
- /**
- * @ignore
- */
- closeAction:{
- value:HIDE
- }
- };
-
- var actions = {
- hide:HIDE,
- destroy:"destroy"
- };
-
- Close.prototype = {
- _onSetClosable:function (v) {
- var self = this;
- if (v && !self.__bindCloseEvent) {
- self.__bindCloseEvent = 1;
- self.get("closeBtn").on("click", function (ev) {
- self.close();
- ev.preventDefault();
- });
- }
- },
- /**
- * hide or destroy according to {@link KISSY.Overlay.Extension.Close#closeAction}
- * @chainable
- */
- close:function(){
- var self=this;
- self[actions[self.get("closeAction")] || HIDE]();
- return self;
- },
- __destructor:function () {
- var btn = this.get("closeBtn");
- btn && btn.detach();
- }
- };
- return Close;
-
-});/**
- * @ignore
- * @fileOverview loading mask support for overlay
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/extension/loading-render", function (S, Node) {
-
- function Loading() {
- }
-
- Loading.prototype = {
- loading: function () {
- var self = this;
- if (!self._loadingExtEl) {
- self._loadingExtEl = new Node("<div " +
- "class='" +
- self.get('prefixCls') + "ext-loading'" +
- " style='position: absolute;" +
- "border: none;" +
- "width: 100%;" +
- "top: 0;" +
- "left: 0;" +
- "z-index: 99999;" +
- "height:100%;" +
- "*height: expression(this.parentNode.offsetHeight);" + "'/>")
- .appendTo(self.get("el"));
- }
- self._loadingExtEl.show();
- },
-
- unloading: function () {
- var lel = this._loadingExtEl;
- lel && lel.hide();
- }
- };
-
- return Loading;
-
-}, {
- requires: ['node']
-});/**
- * @ignore
- * @fileOverview loading mask support for overlay
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/extension/loading", function () {
-
- /**
- * @class KISSY.Overlay.Extension.Loading
- * Loading extension class. Make component to be able to mask loading.
- */
- function Loading() {
- }
-
- Loading.prototype = {
- /**
- * mask component as loading
- * @chainable
- */
- loading: function () {
- var self=this;
- self.get("view").loading();
- return self;
- },
-
- /**
- * unmask component as loading
- * @chainable
- */
- unloading: function () {
- this.get("view").unloading();
- return this;
- }
- };
-
- return Loading;
-
-});/**
- * @ignore
- * @fileOverview mask extension for kissy
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/extension/mask-render", function (S, Node) {
-
- var UA = S.UA,
- ie6 = (UA['ie'] === 6),
- $ = Node.all;
-
- function docWidth() {
- return ie6 ? ("expression(KISSY.DOM.docWidth())") : "100%";
- }
-
- function docHeight() {
- return ie6 ? ("expression(KISSY.DOM.docHeight())") : "100%";
- }
-
- function initMask(self) {
- var maskCls = self.get("prefixCls") + "ext-mask " + self.getCssClassWithState('-mask'),
- mask = $("<div " +
- " style='width:" + docWidth() + ";" +
- "left:0;" +
- "top:0;" +
- "height:" + docHeight() + ";" +
- "position:" + (ie6 ? "absolute" : "fixed") + ";'" +
- " class='" +
- maskCls +
- "'>" +
- (ie6 ? "<" + "iframe " +
- "style='position:absolute;" +
- "left:" + "0" + ";" +
- "top:" + "0" + ";" +
- "background:red;" +
- "width: expression(this.parentNode.offsetWidth);" +
- "height: expression(this.parentNode.offsetHeight);" +
- "filter:alpha(opacity=0);" +
- "z-index:-1;'></iframe>" : "") +
- "</div>")
- .prependTo("body");
- /*
- 点 mask 焦点不转移
- */
- mask.unselectable();
- mask.on("mousedown", function (e) {
- e.preventDefault();
- });
- return mask;
- }
-
- function Mask() {
- }
-
- Mask.ATTRS = {
-
- mask: {
- value: false
- },
- maskNode: {
-
- }
-
- };
-
- Mask.prototype = {
-
- __renderUI: function () {
- var self = this;
- if (self.get('mask')) {
- self.set('maskNode', initMask(self));
- }
- },
-
- __syncUI: function () {
- var self = this;
- if (self.get('mask')) {
- self.ksSetMaskVisible(self.get('visible'), 1);
- }
- },
-
- ksSetMaskVisible: function (shown, hideInline) {
- var self = this,
- shownCls = self.getCssClassWithState('-mask-shown'),
- maskNode = self.get('maskNode'),
- hiddenCls = self.getCssClassWithState('-mask-hidden');
- if (shown) {
- maskNode.removeClass(hiddenCls).addClass(shownCls);
- } else {
- maskNode.removeClass(shownCls).addClass(hiddenCls);
-
- }
- if (!hideInline) {
- maskNode.css('visibility', shown ? 'visible' : 'hidden');
- }
- },
-
- __destructor: function () {
- var self = this, mask;
- if (mask = self.get("maskNode")) {
- mask.remove();
- }
- }
-
- };
-
- return Mask;
-}, {
- requires: ["node"]
-});/**
- * @ignore
- * @fileOverview mask extension for kissy
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/extension/mask", function (S, Event) {
-
- /**
- * @class KISSY.Overlay.Extension.Mask
- * Mask extension class. Make component to be able to show with mask.
- */
- function Mask() {
- }
-
- Mask.ATTRS = {
- /**
- * Whether show mask layer when component shows and effect
- *
- * for example:
- *
- * {
- * // whether hide current component when click on mask
- * hideOnClick: false,
- * effect: 'fade', // slide
- * duration: 0.5,
- * easing: 'easingNone'
- * }
- *
- * @cfg {Boolean|Object} mask
- */
- /**
- * @ignore
- */
- mask: {
- view: 1
- },
- /**
- * Mask node of current component.
- * @type {KISSY.NodeList}
- * @property maskNode
- * @readonly
- */
- /**
- * @ignore
- */
- maskNode: {
- view: 1
- }
- };
-
- var NONE = 'none',
- effects = {fade: ["Out", "In"], slide: ["Up", "Down"]};
-
- function processMask(mask, el, show, view) {
-
- var effect = mask.effect || NONE;
-
- if (effect == NONE) {
- view.ksSetMaskVisible(show);
- return;
- }
-
- // no inline style, leave it to anim(fadeIn/Out)
- view.ksSetMaskVisible(show, 1);
-
- var duration = mask.duration,
- easing = mask.easing,
- m,
- index = show ? 1 : 0;
-
- // run complete fn to restore window's original height
- el.stop(1, 1);
-
- el.css('display', show ? 'none' : 'block');
-
- m = effect + effects[effect][index];
-
- el[m](duration, null, easing);
- }
-
- Mask.prototype = {
-
- __bindUI: function () {
- var self = this,
- maskNode,
- mask,
- el = self.get('el'),
- view = self.get("view");
- if (mask = self.get("mask")) {
- maskNode = self.get('maskNode');
- if (mask.hideOnClick) {
- maskNode.on(Event.Gesture.tap, function () {
- self.hide();
- });
- }
- self.on('afterVisibleChange', function (e) {
- var v;
- if (v = e.newVal) {
- var elZIndex = parseInt(el.css('z-index')) || 1;
- maskNode.css('z-index', elZIndex - 1);
- }
- processMask(mask, maskNode, v, view)
- });
- }
- }
- };
-
-
- return Mask;
-}, {requires: ["event"]});/**
- * @ignore
- * @fileOverview support standard mod for component
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/extension/stdmod-render", function (S, Node) {
-
-
- var CLS_PREFIX = "stdmod-";
-
- function StdModRender() {
- }
-
- StdModRender.ATTRS = {
- header: {
- },
- body: {
- },
- footer: {
- },
- bodyStyle: {
- },
- footerStyle: {
- },
- headerStyle: {
- },
- headerContent: {
- },
- bodyContent: {
- },
- footerContent: {
- }
- };
-
- StdModRender.HTML_PARSER = {
- header: function (el) {
- return el.one("." + this.get('prefixCls') + CLS_PREFIX + "header");
- },
- body: function (el) {
- return el.one("." + this.get('prefixCls') + CLS_PREFIX + "body");
- },
- footer: function (el) {
- return el.one("." + this.get('prefixCls') + CLS_PREFIX + "footer");
- }
- };
-
- function createUI(self, part) {
- var el = self.get("contentEl"),
- partEl = self.get(part);
- if (!partEl) {
- partEl = new Node("<div class='" +
- self.get('prefixCls') + CLS_PREFIX + part + "'" +
- " " +
- " >" +
- "</div>");
- partEl.appendTo(el);
- self.setInternal(part, partEl);
- }
- }
-
-
- function _setStdModRenderContent(self, part, v) {
- part = self.get(part);
- if (typeof v == 'string') {
- part.html(v);
- } else {
- part.html("")
- .append(v);
- }
- }
-
- StdModRender.prototype = {
-
- __createDom: function () {
- createUI(this, "header");
- createUI(this, "body");
- createUI(this, "footer");
- },
-
- _onSetBodyStyle: function (v) {
- this.get("body").css(v);
- },
-
- _onSetHeaderStyle: function (v) {
- this.get("header").css(v);
- },
- _onSetFooterStyle: function (v) {
- this.get("footer").css(v);
- },
-
- _onSetBodyContent: function (v) {
- _setStdModRenderContent(this, "body", v);
- },
-
- _onSetHeaderContent: function (v) {
- _setStdModRenderContent(this, "header", v);
- },
-
- _onSetFooterContent: function (v) {
- _setStdModRenderContent(this, "footer", v);
- }
- };
-
- return StdModRender;
-
-}, {
- requires: ['node']
-});/**
- * @ignore
- * @fileOverview support standard mod for component
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/extension/stdmod", function () {
-
-
- /**
- * @class KISSY.Overlay.Extension.StdMod
- * StdMod extension class. Generate head, body, foot for component.
- */
- function StdMod() {
- }
-
- StdMod.ATTRS = {
- /**
- * Header element of dialog.
- * @type {KISSY.NodeList}
- * @property header
- * @readonly
- */
- /**
- * @ignore
- */
- header:{
- view:1
- },
- /**
- * Body element of dialog.
- * @type {KISSY.NodeList}
- * @property body
- * @readonly
- */
- /**
- * @ignore
- */
- body:{
- view:1
- },
- /**
- * Footer element of dialog.
- * @type {KISSY.NodeList}
- * @property footer
- * @readonly
- */
- /**
- * @ignore
- */
- footer:{
- view:1
- },
- /**
- * Key-value map of body element's style.
- * @cfg {Object} bodyStyle
- */
- /**
- * @ignore
- */
- bodyStyle:{
- view:1
- },
- /**
- * Key-value map of footer element's style.
- * @cfg {Object} footerStyle
- */
- /**
- * @ignore
- */
- footerStyle:{
- view:1
- },
- /**
- * Key-value map of header element's style.
- * @cfg {Object} headerStyle
- */
- /**
- * @ignore
- */
- headerStyle:{
- view:1
- },
- /**
- * html content of header element.
- * @cfg {KISSY.NodeList|String} headerContent
- */
- /**
- * @ignore
- */
- headerContent:{
- view:1
- },
- /**
- * html content of body element.
- * @cfg {KISSY.NodeList|String} bodyContent
- */
- /**
- * @ignore
- */
- bodyContent:{
- view:1
- },
- /**
- * html content of footer element.
- * @cfg {KISSY.NodeList|String} footerContent
- */
- /**
- * @ignore
- */
- footerContent:{
- view:1
- }
- };
-
- return StdMod;
-
-});/**
- * @ignore
- * @fileOverview KISSY Overlay
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay/overlay-render", function (S, Component, Extension, Loading, Close, Mask) {
-
- var UA = S.UA;
-
- return Component.Render.extend([
- Extension.ContentBox.Render,
- Extension.Position.Render,
- Loading,
- UA['ie'] === 6 ? Extension.Shim.Render : null,
- Close,
- Mask
- ]);
-
-}, {
- requires: [
- "component/base",
- 'component/extension',
- './extension/loading-render',
- './extension/close-render',
- './extension/mask-render'
- ]
-});
-
-/**
- * @ignore
- * 2010-11-09 2010-11-10 yiminghe@gmail.com重构,attribute-base-uibase-Overlay ,采用 UIBase.create
- */
-/**
- * @ignore
- * @fileOverview overlay
- * @author yiminghe@gmail.com
- */
-KISSY.add("overlay", function (S, O, OR, D, DR, P) {
- O.Render = OR;
- D.Render = DR;
- O.Dialog = D;
- S.Dialog = D;
- O.Popup = P;
- S.Overlay = O;
- return O;
-}, {
- requires:[
- "overlay/base",
- "overlay/overlay-render",
- "overlay/dialog",
- "overlay/dialog-render",
- "overlay/popup"
- ]
-});/**
- * @ignore
- * @fileOverview KISSY.Popup
- * @author qiaohua@taobao.com, yiminghe@gmail.com
- */
-KISSY.add('overlay/popup', function (S, Overlay, undefined) {
-
- /**
- * @class KISSY.Overlay.Popup
- * KISSY Popup Component. xclass: 'popup'.
- * @extends KISSY.Overlay
- */
- var Popup = Overlay.extend({
-
- initializer: function () {
- var self = this,
- // 获取相关联的 DOM 节点
- trigger = self.get("trigger");
- if (trigger) {
- if (self.get("triggerType") === 'mouse') {
- self._bindTriggerMouse();
- self.on('afterRenderUI', function () {
- self._bindContainerMouse();
- });
- } else {
- self._bindTriggerClick();
- }
- }
- },
-
- _bindTriggerMouse: function () {
- var self = this,
- trigger = self.get("trigger"),
- timer;
-
- self.__mouseEnterPopup = function (ev) {
- self._clearHiddenTimer();
- timer = S.later(function () {
- self._showing(ev);
- timer = undefined;
- }, self.get('mouseDelay') * 1000);
- };
-
- trigger.on('mouseenter', self.__mouseEnterPopup);
-
- self._mouseLeavePopup = function () {
- if (timer) {
- timer.cancel();
- timer = undefined;
- }
-
- self._setHiddenTimer();
- };
-
- trigger.on('mouseleave', self._mouseLeavePopup);
- },
-
- _bindContainerMouse: function () {
- var self = this;
- self.get('el')
- .on('mouseleave', self._setHiddenTimer, self)
- .on('mouseenter', self._clearHiddenTimer, self);
- },
-
- _setHiddenTimer: function () {
- var self = this;
- self._hiddenTimer = S.later(function () {
- self._hiding();
- }, self.get('mouseDelay') * 1000);
- },
-
- _clearHiddenTimer: function () {
- var self = this;
- if (self._hiddenTimer) {
- self._hiddenTimer.cancel();
- self._hiddenTimer = undefined;
- }
- },
-
- _bindTriggerClick: function () {
- var self = this;
- self.__clickPopup = function (ev) {
- ev.halt();
- if (self.get('toggle')) {
- self[self.get('visible') ? '_hiding' : '_showing'](ev);
- } else {
- self._showing(ev);
- }
- };
-
- self.get("trigger").on('click', self.__clickPopup);
- },
-
- _showing: function (ev) {
- var self = this;
- self.set('currentTrigger', S.one(ev.target));
- self.show();
- },
-
- _hiding: function () {
- this.set('currentTrigger', undefined);
- this.hide();
- },
-
- destructor: function () {
- var self = this,
- root,
- t = self.get("trigger");
- if (t) {
- if (self.__clickPopup) {
-
- t.detach('click', self.__clickPopup);
-
- }
- if (self.__mouseEnterPopup) {
-
- t.detach('mouseenter', self.__mouseEnterPopup);
-
- }
-
- if (self._mouseLeavePopup) {
-
- t.detach('mouseleave', self._mouseLeavePopup);
-
- }
- }
- if (root = self.get('el')) {
- root.detach('mouseleave', self._setHiddenTimer, self)
- .detach('mouseenter', self._clearHiddenTimer, self);
- }
- }
- }, {
- ATTRS: {
- /**
- * Trigger elements to show popup.
- * @cfg {KISSY.NodeList} trigger
- */
- /**
- * @ignore
- */
- trigger: { // 触发器
- setter: function (v) {
- return S.all(v);
- }
- },
- /**
- * How to activate trigger element, "click" or "mouse".
- *
- * Defaults to: "click".
- *
- * @cfg {String} triggerType
- */
- /**
- * @ignore
- */
- triggerType: {
- // 触发类型
- value: 'click'
- },
- currentTrigger: {},
- /**
- * When trigger type is mouse, the delayed time to show popup.
- *
- * Defaults to: 0.1, in seconds.
- *
- * @cfg {Number} mouseDelay
- */
- /**
- * @ignore
- */
- mouseDelay: {
- // triggerType 为 mouse 时, Popup 显示的延迟时间, 默认为 100ms
- value: 0.1
- },
- /**
- * When trigger type is click, whether support toggle.
- *
- * Defaults to: false
- *
- * @cfg {Boolean} toggle
- */
- /**
- * @ignore
- */
- toggle: {
- // triggerType 为 click 时, Popup 是否有toggle功能
- value: false
- }
- }
- }, {
- // TODO either change to overlay-popup