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

Commit bf7cd1f

Browse files
committed
优化promise的依赖关系
1 parent 2ce722f commit bf7cd1f

19 files changed

+228
-164
lines changed

dist/webuploader.custom.js

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,29 @@
138138
], function( _ ) {
139139
return _;
140140
});
141+
/**
142+
* @fileOverview 使用jQuery的Promise
143+
*/
144+
define('promise-third',[
145+
'dollar'
146+
], function( $ ) {
147+
return {
148+
Deferred: $.Deferred,
149+
when: $.when,
150+
151+
isPromise: function( anything ) {
152+
return anything && typeof anything.then === 'function';
153+
}
154+
};
155+
});
156+
/**
157+
* @fileOverview Promise/A+
158+
*/
159+
define('promise',[
160+
'promise-third'
161+
], function( _ ) {
162+
return _;
163+
});
141164
/**
142165
* @fileOverview 基础类方法。
143166
*/
@@ -159,8 +182,9 @@
159182
* @title WebUploader API文档
160183
*/
161184
define('base',[
162-
'dollar'
163-
], function( $ ) {
185+
'dollar',
186+
'promise'
187+
], function( $, promise ) {
164188

165189
var noop = function() {},
166190
call = Function.call;
@@ -208,6 +232,12 @@
208232
*/
209233
$: $,
210234

235+
Deferred: promise.Deferred,
236+
237+
isPromise: promise.isPromise,
238+
239+
when: promise.when,
240+
211241
/**
212242
* @description 简单的浏览器检查结果。
213243
*

dist/webuploader.custom.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webuploader.flashonly.js

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,29 @@
138138
], function( _ ) {
139139
return _;
140140
});
141+
/**
142+
* @fileOverview 使用jQuery的Promise
143+
*/
144+
define('promise-third',[
145+
'dollar'
146+
], function( $ ) {
147+
return {
148+
Deferred: $.Deferred,
149+
when: $.when,
150+
151+
isPromise: function( anything ) {
152+
return anything && typeof anything.then === 'function';
153+
}
154+
};
155+
});
156+
/**
157+
* @fileOverview Promise/A+
158+
*/
159+
define('promise',[
160+
'promise-third'
161+
], function( _ ) {
162+
return _;
163+
});
141164
/**
142165
* @fileOverview 基础类方法。
143166
*/
@@ -159,8 +182,9 @@
159182
* @title WebUploader API文档
160183
*/
161184
define('base',[
162-
'dollar'
163-
], function( $ ) {
185+
'dollar',
186+
'promise'
187+
], function( $, promise ) {
164188

165189
var noop = function() {},
166190
call = Function.call;
@@ -208,6 +232,12 @@
208232
*/
209233
$: $,
210234

235+
Deferred: promise.Deferred,
236+
237+
isPromise: promise.isPromise,
238+
239+
when: promise.when,
240+
211241
/**
212242
* @description 简单的浏览器检查结果。
213243
*
@@ -448,32 +478,6 @@
448478
}
449479
};
450480
});
451-
/**
452-
* @fileOverview 使用jQuery的Promise
453-
*/
454-
define('promise-third',[
455-
'base'
456-
], function( Base ) {
457-
var $ = Base.$,
458-
api = {
459-
Deferred: $.Deferred,
460-
when: $.when,
461-
462-
isPromise: function( anything ) {
463-
return anything && typeof anything.then === 'function';
464-
}
465-
};
466-
467-
return $.extend( Base, api ) && api;
468-
});
469-
/**
470-
* @fileOverview Promise/A+
471-
*/
472-
define('promise',[
473-
'promise-third'
474-
], function( _ ) {
475-
return _;
476-
});
477481
/**
478482
* 事件处理类,可以独立使用,也可以扩展给对象使用。
479483
* @fileOverview Mediator
@@ -4096,8 +4100,6 @@
40964100
*/
40974101
define('preset/flashonly',[
40984102
'base',
4099-
'promise',
4100-
'uploader',
41014103

41024104
// widgets
41034105
'widgets/filepicker',

dist/webuploader.flashonly.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webuploader.html5only.js

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,29 @@
138138
], function( _ ) {
139139
return _;
140140
});
141+
/**
142+
* @fileOverview 使用jQuery的Promise
143+
*/
144+
define('promise-third',[
145+
'dollar'
146+
], function( $ ) {
147+
return {
148+
Deferred: $.Deferred,
149+
when: $.when,
150+
151+
isPromise: function( anything ) {
152+
return anything && typeof anything.then === 'function';
153+
}
154+
};
155+
});
156+
/**
157+
* @fileOverview Promise/A+
158+
*/
159+
define('promise',[
160+
'promise-third'
161+
], function( _ ) {
162+
return _;
163+
});
141164
/**
142165
* @fileOverview 基础类方法。
143166
*/
@@ -159,8 +182,9 @@
159182
* @title WebUploader API文档
160183
*/
161184
define('base',[
162-
'dollar'
163-
], function( $ ) {
185+
'dollar',
186+
'promise'
187+
], function( $, promise ) {
164188

165189
var noop = function() {},
166190
call = Function.call;
@@ -208,6 +232,12 @@
208232
*/
209233
$: $,
210234

235+
Deferred: promise.Deferred,
236+
237+
isPromise: promise.isPromise,
238+
239+
when: promise.when,
240+
211241
/**
212242
* @description 简单的浏览器检查结果。
213243
*
@@ -448,32 +478,6 @@
448478
}
449479
};
450480
});
451-
/**
452-
* @fileOverview 使用jQuery的Promise
453-
*/
454-
define('promise-third',[
455-
'base'
456-
], function( Base ) {
457-
var $ = Base.$,
458-
api = {
459-
Deferred: $.Deferred,
460-
when: $.when,
461-
462-
isPromise: function( anything ) {
463-
return anything && typeof anything.then === 'function';
464-
}
465-
};
466-
467-
return $.extend( Base, api ) && api;
468-
});
469-
/**
470-
* @fileOverview Promise/A+
471-
*/
472-
define('promise',[
473-
'promise-third'
474-
], function( _ ) {
475-
return _;
476-
});
477481
/**
478482
* 事件处理类,可以独立使用,也可以扩展给对象使用。
479483
* @fileOverview Mediator
@@ -5411,8 +5415,6 @@
54115415
*/
54125416
define('preset/html5only',[
54135417
'base',
5414-
'promise',
5415-
'uploader',
54165418

54175419
// widgets
54185420
'widgets/filednd',

dist/webuploader.html5only.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webuploader.js

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,29 @@
138138
], function( _ ) {
139139
return _;
140140
});
141+
/**
142+
* @fileOverview 使用jQuery的Promise
143+
*/
144+
define('promise-third',[
145+
'dollar'
146+
], function( $ ) {
147+
return {
148+
Deferred: $.Deferred,
149+
when: $.when,
150+
151+
isPromise: function( anything ) {
152+
return anything && typeof anything.then === 'function';
153+
}
154+
};
155+
});
156+
/**
157+
* @fileOverview Promise/A+
158+
*/
159+
define('promise',[
160+
'promise-third'
161+
], function( _ ) {
162+
return _;
163+
});
141164
/**
142165
* @fileOverview 基础类方法。
143166
*/
@@ -159,8 +182,9 @@
159182
* @title WebUploader API文档
160183
*/
161184
define('base',[
162-
'dollar'
163-
], function( $ ) {
185+
'dollar',
186+
'promise'
187+
], function( $, promise ) {
164188

165189
var noop = function() {},
166190
call = Function.call;
@@ -208,6 +232,12 @@
208232
*/
209233
$: $,
210234

235+
Deferred: promise.Deferred,
236+
237+
isPromise: promise.isPromise,
238+
239+
when: promise.when,
240+
211241
/**
212242
* @description 简单的浏览器检查结果。
213243
*
@@ -448,32 +478,6 @@
448478
}
449479
};
450480
});
451-
/**
452-
* @fileOverview 使用jQuery的Promise
453-
*/
454-
define('promise-third',[
455-
'base'
456-
], function( Base ) {
457-
var $ = Base.$,
458-
api = {
459-
Deferred: $.Deferred,
460-
when: $.when,
461-
462-
isPromise: function( anything ) {
463-
return anything && typeof anything.then === 'function';
464-
}
465-
};
466-
467-
return $.extend( Base, api ) && api;
468-
});
469-
/**
470-
* @fileOverview Promise/A+
471-
*/
472-
define('promise',[
473-
'promise-third'
474-
], function( _ ) {
475-
return _;
476-
});
477481
/**
478482
* 事件处理类,可以独立使用,也可以扩展给对象使用。
479483
* @fileOverview Mediator
@@ -6554,8 +6558,6 @@
65546558
*/
65556559
define('preset/all',[
65566560
'base',
6557-
'promise',
6558-
'uploader',
65596561

65606562
// widgets
65616563
'widgets/filednd',

dist/webuploader.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)