Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Commit

Permalink
优化promise的依赖关系
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop committed Apr 16, 2014
1 parent 2ce722f commit bf7cd1f
Show file tree
Hide file tree
Showing 19 changed files with 228 additions and 164 deletions.
34 changes: 32 additions & 2 deletions dist/webuploader.custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,29 @@
], function( _ ) {
return _;
});
/**
* @fileOverview 使用jQuery的Promise
*/
define('promise-third',[
'dollar'
], function( $ ) {
return {
Deferred: $.Deferred,
when: $.when,

isPromise: function( anything ) {
return anything && typeof anything.then === 'function';
}
};
});
/**
* @fileOverview Promise/A+
*/
define('promise',[
'promise-third'
], function( _ ) {
return _;
});
/**
* @fileOverview 基础类方法。
*/
Expand All @@ -159,8 +182,9 @@
* @title WebUploader API文档
*/
define('base',[
'dollar'
], function( $ ) {
'dollar',
'promise'
], function( $, promise ) {

var noop = function() {},
call = Function.call;
Expand Down Expand Up @@ -208,6 +232,12 @@
*/
$: $,

Deferred: promise.Deferred,

isPromise: promise.isPromise,

when: promise.when,

/**
* @description 简单的浏览器检查结果。
*
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.custom.min.js

Large diffs are not rendered by default.

62 changes: 32 additions & 30 deletions dist/webuploader.flashonly.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,29 @@
], function( _ ) {
return _;
});
/**
* @fileOverview 使用jQuery的Promise
*/
define('promise-third',[
'dollar'
], function( $ ) {
return {
Deferred: $.Deferred,
when: $.when,

isPromise: function( anything ) {
return anything && typeof anything.then === 'function';
}
};
});
/**
* @fileOverview Promise/A+
*/
define('promise',[
'promise-third'
], function( _ ) {
return _;
});
/**
* @fileOverview 基础类方法。
*/
Expand All @@ -159,8 +182,9 @@
* @title WebUploader API文档
*/
define('base',[
'dollar'
], function( $ ) {
'dollar',
'promise'
], function( $, promise ) {

var noop = function() {},
call = Function.call;
Expand Down Expand Up @@ -208,6 +232,12 @@
*/
$: $,

Deferred: promise.Deferred,

isPromise: promise.isPromise,

when: promise.when,

/**
* @description 简单的浏览器检查结果。
*
Expand Down Expand Up @@ -448,32 +478,6 @@
}
};
});
/**
* @fileOverview 使用jQuery的Promise
*/
define('promise-third',[
'base'
], function( Base ) {
var $ = Base.$,
api = {
Deferred: $.Deferred,
when: $.when,

isPromise: function( anything ) {
return anything && typeof anything.then === 'function';
}
};

return $.extend( Base, api ) && api;
});
/**
* @fileOverview Promise/A+
*/
define('promise',[
'promise-third'
], function( _ ) {
return _;
});
/**
* 事件处理类,可以独立使用,也可以扩展给对象使用。
* @fileOverview Mediator
Expand Down Expand Up @@ -4096,8 +4100,6 @@
*/
define('preset/flashonly',[
'base',
'promise',
'uploader',

// widgets
'widgets/filepicker',
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.flashonly.min.js

Large diffs are not rendered by default.

62 changes: 32 additions & 30 deletions dist/webuploader.html5only.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,29 @@
], function( _ ) {
return _;
});
/**
* @fileOverview 使用jQuery的Promise
*/
define('promise-third',[
'dollar'
], function( $ ) {
return {
Deferred: $.Deferred,
when: $.when,

isPromise: function( anything ) {
return anything && typeof anything.then === 'function';
}
};
});
/**
* @fileOverview Promise/A+
*/
define('promise',[
'promise-third'
], function( _ ) {
return _;
});
/**
* @fileOverview 基础类方法。
*/
Expand All @@ -159,8 +182,9 @@
* @title WebUploader API文档
*/
define('base',[
'dollar'
], function( $ ) {
'dollar',
'promise'
], function( $, promise ) {

var noop = function() {},
call = Function.call;
Expand Down Expand Up @@ -208,6 +232,12 @@
*/
$: $,

Deferred: promise.Deferred,

isPromise: promise.isPromise,

when: promise.when,

/**
* @description 简单的浏览器检查结果。
*
Expand Down Expand Up @@ -448,32 +478,6 @@
}
};
});
/**
* @fileOverview 使用jQuery的Promise
*/
define('promise-third',[
'base'
], function( Base ) {
var $ = Base.$,
api = {
Deferred: $.Deferred,
when: $.when,

isPromise: function( anything ) {
return anything && typeof anything.then === 'function';
}
};

return $.extend( Base, api ) && api;
});
/**
* @fileOverview Promise/A+
*/
define('promise',[
'promise-third'
], function( _ ) {
return _;
});
/**
* 事件处理类,可以独立使用,也可以扩展给对象使用。
* @fileOverview Mediator
Expand Down Expand Up @@ -5411,8 +5415,6 @@
*/
define('preset/html5only',[
'base',
'promise',
'uploader',

// widgets
'widgets/filednd',
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.html5only.min.js

Large diffs are not rendered by default.

62 changes: 32 additions & 30 deletions dist/webuploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,29 @@
], function( _ ) {
return _;
});
/**
* @fileOverview 使用jQuery的Promise
*/
define('promise-third',[
'dollar'
], function( $ ) {
return {
Deferred: $.Deferred,
when: $.when,

isPromise: function( anything ) {
return anything && typeof anything.then === 'function';
}
};
});
/**
* @fileOverview Promise/A+
*/
define('promise',[
'promise-third'
], function( _ ) {
return _;
});
/**
* @fileOverview 基础类方法。
*/
Expand All @@ -159,8 +182,9 @@
* @title WebUploader API文档
*/
define('base',[
'dollar'
], function( $ ) {
'dollar',
'promise'
], function( $, promise ) {

var noop = function() {},
call = Function.call;
Expand Down Expand Up @@ -208,6 +232,12 @@
*/
$: $,

Deferred: promise.Deferred,

isPromise: promise.isPromise,

when: promise.when,

/**
* @description 简单的浏览器检查结果。
*
Expand Down Expand Up @@ -448,32 +478,6 @@
}
};
});
/**
* @fileOverview 使用jQuery的Promise
*/
define('promise-third',[
'base'
], function( Base ) {
var $ = Base.$,
api = {
Deferred: $.Deferred,
when: $.when,

isPromise: function( anything ) {
return anything && typeof anything.then === 'function';
}
};

return $.extend( Base, api ) && api;
});
/**
* @fileOverview Promise/A+
*/
define('promise',[
'promise-third'
], function( _ ) {
return _;
});
/**
* 事件处理类,可以独立使用,也可以扩展给对象使用。
* @fileOverview Mediator
Expand Down Expand Up @@ -6554,8 +6558,6 @@
*/
define('preset/all',[
'base',
'promise',
'uploader',

// widgets
'widgets/filednd',
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit bf7cd1f

Please sign in to comment.