/* private items-adding method */
self._damnUploaderFilesAddMap = function(files, callback) {
var callbackDefined = $.isFunction(callback);
if (!$.support.fileSelecting) {
if (self._damnUploaderItemsCount === set.limit) {
return $.isFunction(set.onLimitExceeded) ? set.onLimitExceeded.call(self) : false;
}
var file = {
fake: true,
name: files.value,
inputElement: files
};
if (callbackDefined) {
if (!callback.call(self, file)) {
return true;
}
}
self.damnUploader('addItem', file);
return true;
}
if (files instanceof FileList) {
$.each(files, function(i, file) {
if (self._damnUploaderItemsCount === set.limit) {
if (self._damnUploaderItemsCount === set.limit) {
return $.isFunction(set.onLimitExceeded) ? set.onLimitExceeded.call(self) : false;
}
}
if (callbackDefined) {
if (!callback.call(self, file)) {
return true;
}
}
self.damnUploader('addItem', {
file: file
});
});
}
return true;
};