Skip to content

Commit 4917771

Browse files
committed
Update js/. Update version and release date.
1 parent 9524c99 commit 4917771

File tree

10 files changed

+95
-36
lines changed

10 files changed

+95
-36
lines changed

js/Moxie.swf

19 Bytes
Binary file not shown.

js/Moxie.xap

-34 Bytes
Binary file not shown.

js/jquery.plupload.queue/jquery.plupload.queue.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ used as it is.
7373
@param {Boolean} [settings.rename=false] Enable ability to rename files in the queue.
7474
@param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure.
7575
*/
76-
(function($) {
76+
(function($, o) {
7777
var uploaders = {};
7878

7979
function _(str) {
@@ -198,7 +198,7 @@ used as it is.
198198
$('span.plupload_total_status', target).html(uploader.total.percent + '%');
199199
$('div.plupload_progress_bar', target).css('width', uploader.total.percent + '%');
200200
$('span.plupload_upload_status', target).html(
201-
_('Uploaded %d/%d files').replace(/%d\/%d/, uploader.total.uploaded+'/'+uploader.files.length)
201+
o.sprintf(_('Uploaded %d/%d files'), uploader.total.uploaded, uploader.files.length)
202202
);
203203
}
204204

@@ -247,7 +247,7 @@ used as it is.
247247
if (uploader.total.queued === 0) {
248248
$('span.plupload_add_text', target).html(_('Add Files'));
249249
} else {
250-
$('span.plupload_add_text', target).html(_('%d files queued').replace(/%d/, uploader.total.queued));
250+
$('span.plupload_add_text', target).html(o.sprintf(_('%d files queued'), uploader.total.queued));
251251
}
252252

253253
$('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == (uploader.total.uploaded + uploader.total.failed));
@@ -421,4 +421,4 @@ used as it is.
421421
return uploaders[$(this[0]).attr('id')];
422422
}
423423
};
424-
})(jQuery);
424+
})(jQuery, mOxie);

js/jquery.plupload.queue/jquery.plupload.queue.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/moxie.js

Lines changed: 69 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
3-
* v1.1.0
3+
* v1.2.0
44
*
55
* Copyright 2013, Moxiecode Systems AB
66
* Released under GPL License.
77
*
88
* License: http://www.plupload.com/license
99
* Contributing: http://www.plupload.com/contributing
1010
*
11-
* Date: 2013-12-27
11+
* Date: 2014-01-16
1212
*/
1313
/**
1414
* Compiled inline version. (Library mode)
@@ -252,6 +252,42 @@ define('moxie/core/utils/Basic', [], function() {
252252
}
253253
callNext(i);
254254
};
255+
256+
257+
/**
258+
Recieve an array of functions (usually async) to call in parallel, each function
259+
receives a callback as first argument that it should call, when it completes. After
260+
everything is complete, main callback is called. Passing truthy value to the
261+
callback as a first argument will interrupt the process and invoke main callback
262+
immediately.
263+
264+
@method inParallel
265+
@static
266+
@param {Array} queue Array of functions to call in sequence
267+
@param {Function} cb Main callback that is called in the end, or in case of erro
268+
*/
269+
var inParallel = function(queue, cb) {
270+
var count = 0, num = queue.length, cbArgs = new Array(num);
271+
272+
each(queue, function(fn, i) {
273+
fn(function(error) {
274+
if (error) {
275+
return cb(error);
276+
}
277+
278+
var args = [].slice.call(arguments);
279+
args.shift(); // strip error - undefined or not
280+
281+
cbArgs[i] = args;
282+
count++;
283+
284+
if (count === num) {
285+
cbArgs.unshift(null);
286+
cb.apply(this, cbArgs);
287+
}
288+
});
289+
});
290+
};
255291

256292

257293
/**
@@ -429,6 +465,7 @@ define('moxie/core/utils/Basic', [], function() {
429465
each: each,
430466
isEmptyObj: isEmptyObj,
431467
inSeries: inSeries,
468+
inParallel: inParallel,
432469
inArray: inArray,
433470
arrayDiff: arrayDiff,
434471
arrayIntersect: arrayIntersect,
@@ -496,7 +533,8 @@ define("moxie/core/I18n", [
496533
var args = [].slice.call(arguments, 1);
497534

498535
return str.replace(/%[a-z]/g, function() {
499-
return args.shift() || '';
536+
var value = args.shift();
537+
return Basic.typeOf(value) !== 'undefined' ? value : '';
500538
});
501539
}
502540
};
@@ -6556,11 +6594,7 @@ define("moxie/runtime/html5/file/FileDrop", [
65566594

65576595
// Chrome 21+ accepts folders via Drag'n'Drop
65586596
if (e.dataTransfer.items && e.dataTransfer.items[0].webkitGetAsEntry) {
6559-
var entries = [];
6560-
Basic.each(e.dataTransfer.items, function(item) {
6561-
entries.push(item.webkitGetAsEntry());
6562-
});
6563-
_readEntries(entries, function() {
6597+
_readItems(e.dataTransfer.items, function() {
65646598
comp.trigger("drop");
65656599
});
65666600
} else {
@@ -6612,6 +6646,32 @@ define("moxie/runtime/html5/file/FileDrop", [
66126646
}
66136647

66146648

6649+
function _readItems(items, cb) {
6650+
var entries = [];
6651+
Basic.each(items, function(item) {
6652+
var entry = item.webkitGetAsEntry();
6653+
// Address #998 (https://code.google.com/p/chromium/issues/detail?id=332579)
6654+
if (entry) {
6655+
// file() fails on OSX when the filename contains a special character (e.g. umlaut): see #61
6656+
if (entry.isFile) {
6657+
var file = item.getAsFile();
6658+
if (_isAcceptable(file)) {
6659+
_files.push(file);
6660+
}
6661+
} else {
6662+
entries.push(entry);
6663+
}
6664+
}
6665+
});
6666+
6667+
if (entries.length) {
6668+
_readEntries(entries, cb);
6669+
} else {
6670+
cb();
6671+
}
6672+
}
6673+
6674+
66156675
function _readEntries(entries, cb) {
66166676
var queue = [];
66176677
Basic.each(entries, function(entry) {
@@ -7104,7 +7164,7 @@ define("moxie/runtime/html5/xhr/XMLHttpRequest", [
71047164
// Build RFC2388 blob
71057165
multipart += dashdash + boundary + crlf +
71067166
'Content-Disposition: form-data; name="' + name + '"; filename="' + unescape(encodeURIComponent(value.name || 'blob')) + '"' + crlf +
7107-
'Content-Type: ' + value.type + crlf + crlf +
7167+
'Content-Type: ' + (value.type || 'application/octet-stream') + crlf + crlf +
71087168
value.getSource() + crlf;
71097169
} else {
71107170
multipart += dashdash + boundary + crlf +

js/moxie.min.js

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

js/plupload.dev.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* Plupload - multi-runtime File Uploader
3-
* v2.1.0
3+
* v2.1.1
44
*
55
* Copyright 2013, Moxiecode Systems AB
66
* Released under GPL License.
77
*
88
* License: http://www.plupload.com/license
99
* Contributing: http://www.plupload.com/contributing
1010
*
11-
* Date: 2013-12-27
11+
* Date: 2014-01-16
1212
*/
1313
/**
1414
* Plupload.js
@@ -40,7 +40,6 @@ function normalizeCaps(settings) {
4040
pngresize: 'send_binary_string',
4141
progress: 'report_upload_progress',
4242
multi_selection: 'select_multiple',
43-
max_file_size: 'access_binary',
4443
dragdrop: 'drag_and_drop',
4544
drop_element: 'drag_and_drop',
4645
headers: 'send_custom_headers',
@@ -98,7 +97,7 @@ var plupload = {
9897
* @static
9998
* @final
10099
*/
101-
VERSION : '2.1.0',
100+
VERSION : '2.1.1',
102101

103102
/**
104103
* Inital state of the queue and also the state ones it's finished all it's uploads.
@@ -1588,7 +1587,7 @@ plupload.Uploader = function(options) {
15881587

15891588
preferred_caps = {};
15901589
disabled = false;
1591-
settings = startTime = xhr = null;
1590+
startTime = xhr = null;
15921591
total.reset();
15931592
}
15941593

@@ -2051,7 +2050,7 @@ plupload.Uploader = function(options) {
20512050
*/
20522051
destroy : function() {
20532052
this.trigger('Destroy');
2054-
total = null; // purge this one exclusively
2053+
settings = total = null; // purge these exclusively
20552054
this.unbindAll();
20562055
}
20572056
});

0 commit comments

Comments
 (0)