Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
bower_components
demo/config.js
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ install : all

all :
npm install
bower install
grunt
node demo/server.js
File renamed without changes.
20 changes: 15 additions & 5 deletions dist/qiniu.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*!
* qiniu-js-sdk v1.0.9-beta
* qiniu-js-sdk v1.0.10-beta
*
* Copyright 2015 by Qiniu
* Released under GPL V2 License.
*
* GitHub: http://github.com/qiniu/js-sdk
*
* Date: 2015-12-4
* Date: 2015-12-8
*/

/*global plupload ,mOxie*/
Expand Down Expand Up @@ -374,7 +374,7 @@ function QiniuJsSDK() {
// set token to be op.uptoken
var getUpToken = function() {
if (!op.uptoken) {
// TODO: use m0xie
// TODO: use mOxie
var ajax = that.createAjax();
ajax.open('GET', that.uptoken_url, true);
ajax.setRequestHeader("If-Modified-Since", "0");
Expand Down Expand Up @@ -488,16 +488,26 @@ function QiniuJsSDK() {
up.setOption({
'url': qiniuUploadUrl,
'multipart': true,
'chunk_size': undefined,
'chunk_size': is_android_weixin_or_qq() ? op.max_file_size : undefined,
'multipart_params': multipart_params_obj
});
};

// detect is weixin or qq inner browser
var is_android_weixin_or_qq = function (){
var ua = navigator.userAgent.toLowerCase();
if((ua.match(/MicroMessenger/i) || mOxie.Env.browser === "QQBrowser") && mOxie.Env.OS.toLowerCase()==="android") {
return true;
} else {
return false;
}
};

var chunk_size = up.getOption && up.getOption('chunk_size');
chunk_size = chunk_size || (up.settings && up.settings.chunk_size);
// TODO: flash support chunk upload
if (uploader.runtime === 'html5' && chunk_size) {
if (file.size < chunk_size) {
if (file.size < chunk_size || is_android_weixin_or_qq()) {
// direct upload if file size is less then the chunk size
directUpload(up, file, that.key_handler);
} else {
Expand Down
4 changes: 2 additions & 2 deletions dist/qiniu.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/qiniu.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qiniu-js-sdk",
"jsName": "qiniu",
"version": "1.0.9-beta",
"version": "1.0.10-beta",
"private": false,
"scripts": {
"start": "node demo/server.js"
Expand Down
16 changes: 13 additions & 3 deletions src/qiniu.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ function QiniuJsSDK() {
// set token to be op.uptoken
var getUpToken = function() {
if (!op.uptoken) {
// TODO: use m0xie
// TODO: use mOxie
var ajax = that.createAjax();
ajax.open('GET', that.uptoken_url, true);
ajax.setRequestHeader("If-Modified-Since", "0");
Expand Down Expand Up @@ -488,16 +488,26 @@ function QiniuJsSDK() {
up.setOption({
'url': qiniuUploadUrl,
'multipart': true,
'chunk_size': undefined,
'chunk_size': is_android_weixin_or_qq() ? op.max_file_size : undefined,
'multipart_params': multipart_params_obj
});
};

// detect is weixin or qq inner browser
var is_android_weixin_or_qq = function (){
var ua = navigator.userAgent.toLowerCase();
if((ua.match(/MicroMessenger/i) || mOxie.Env.browser === "QQBrowser") && mOxie.Env.OS.toLowerCase()==="android") {
return true;
} else {
return false;
}
};

var chunk_size = up.getOption && up.getOption('chunk_size');
chunk_size = chunk_size || (up.settings && up.settings.chunk_size);
// TODO: flash support chunk upload
if (uploader.runtime === 'html5' && chunk_size) {
if (file.size < chunk_size) {
if (file.size < chunk_size || is_android_weixin_or_qq()) {
// direct upload if file size is less then the chunk size
directUpload(up, file, that.key_handler);
} else {
Expand Down