Skip to content

Commit

Permalink
Update js/. Update version and release date.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayarjo committed Jan 16, 2014
1 parent 9524c99 commit 4917771
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 36 deletions.
Binary file modified js/Moxie.swf
Binary file not shown.
Binary file modified js/Moxie.xap
Binary file not shown.
8 changes: 4 additions & 4 deletions js/jquery.plupload.queue/jquery.plupload.queue.js
Expand Up @@ -73,7 +73,7 @@ used as it is.
@param {Boolean} [settings.rename=false] Enable ability to rename files in the queue.
@param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure.
*/
(function($) {
(function($, o) {
var uploaders = {};

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

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

$('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == (uploader.total.uploaded + uploader.total.failed));
Expand Down Expand Up @@ -421,4 +421,4 @@ used as it is.
return uploaders[$(this[0]).attr('id')];
}
};
})(jQuery);
})(jQuery, mOxie);
2 changes: 1 addition & 1 deletion js/jquery.plupload.queue/jquery.plupload.queue.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 69 additions & 9 deletions js/moxie.js
@@ -1,14 +1,14 @@
/**
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.1.0
* v1.2.0
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2013-12-27
* Date: 2014-01-16
*/
/**
* Compiled inline version. (Library mode)
Expand Down Expand Up @@ -252,6 +252,42 @@ define('moxie/core/utils/Basic', [], function() {
}
callNext(i);
};


/**
Recieve an array of functions (usually async) to call in parallel, each function
receives a callback as first argument that it should call, when it completes. After
everything is complete, main callback is called. Passing truthy value to the
callback as a first argument will interrupt the process and invoke main callback
immediately.
@method inParallel
@static
@param {Array} queue Array of functions to call in sequence
@param {Function} cb Main callback that is called in the end, or in case of erro
*/
var inParallel = function(queue, cb) {
var count = 0, num = queue.length, cbArgs = new Array(num);

each(queue, function(fn, i) {
fn(function(error) {
if (error) {
return cb(error);
}

var args = [].slice.call(arguments);
args.shift(); // strip error - undefined or not

cbArgs[i] = args;
count++;

if (count === num) {
cbArgs.unshift(null);
cb.apply(this, cbArgs);
}
});
});
};


/**
Expand Down Expand Up @@ -429,6 +465,7 @@ define('moxie/core/utils/Basic', [], function() {
each: each,
isEmptyObj: isEmptyObj,
inSeries: inSeries,
inParallel: inParallel,
inArray: inArray,
arrayDiff: arrayDiff,
arrayIntersect: arrayIntersect,
Expand Down Expand Up @@ -496,7 +533,8 @@ define("moxie/core/I18n", [
var args = [].slice.call(arguments, 1);

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

// Chrome 21+ accepts folders via Drag'n'Drop
if (e.dataTransfer.items && e.dataTransfer.items[0].webkitGetAsEntry) {
var entries = [];
Basic.each(e.dataTransfer.items, function(item) {
entries.push(item.webkitGetAsEntry());
});
_readEntries(entries, function() {
_readItems(e.dataTransfer.items, function() {
comp.trigger("drop");
});
} else {
Expand Down Expand Up @@ -6612,6 +6646,32 @@ define("moxie/runtime/html5/file/FileDrop", [
}


function _readItems(items, cb) {
var entries = [];
Basic.each(items, function(item) {
var entry = item.webkitGetAsEntry();
// Address #998 (https://code.google.com/p/chromium/issues/detail?id=332579)
if (entry) {
// file() fails on OSX when the filename contains a special character (e.g. umlaut): see #61
if (entry.isFile) {
var file = item.getAsFile();
if (_isAcceptable(file)) {
_files.push(file);
}
} else {
entries.push(entry);
}
}
});

if (entries.length) {
_readEntries(entries, cb);
} else {
cb();
}
}


function _readEntries(entries, cb) {
var queue = [];
Basic.each(entries, function(entry) {
Expand Down Expand Up @@ -7104,7 +7164,7 @@ define("moxie/runtime/html5/xhr/XMLHttpRequest", [
// Build RFC2388 blob
multipart += dashdash + boundary + crlf +
'Content-Disposition: form-data; name="' + name + '"; filename="' + unescape(encodeURIComponent(value.name || 'blob')) + '"' + crlf +
'Content-Type: ' + value.type + crlf + crlf +
'Content-Type: ' + (value.type || 'application/octet-stream') + crlf + crlf +
value.getSource() + crlf;
} else {
multipart += dashdash + boundary + crlf +
Expand Down
8 changes: 4 additions & 4 deletions js/moxie.min.js

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions js/plupload.dev.js
@@ -1,14 +1,14 @@
/**
* Plupload - multi-runtime File Uploader
* v2.1.0
* v2.1.1
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2013-12-27
* Date: 2014-01-16
*/
/**
* Plupload.js
Expand Down Expand Up @@ -40,7 +40,6 @@ function normalizeCaps(settings) {
pngresize: 'send_binary_string',
progress: 'report_upload_progress',
multi_selection: 'select_multiple',
max_file_size: 'access_binary',
dragdrop: 'drag_and_drop',
drop_element: 'drag_and_drop',
headers: 'send_custom_headers',
Expand Down Expand Up @@ -98,7 +97,7 @@ var plupload = {
* @static
* @final
*/
VERSION : '2.1.0',
VERSION : '2.1.1',

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

preferred_caps = {};
disabled = false;
settings = startTime = xhr = null;
startTime = xhr = null;
total.reset();
}

Expand Down Expand Up @@ -2051,7 +2050,7 @@ plupload.Uploader = function(options) {
*/
destroy : function() {
this.trigger('Destroy');
total = null; // purge this one exclusively
settings = total = null; // purge these exclusively
this.unbindAll();
}
});
Expand Down

0 comments on commit 4917771

Please sign in to comment.