Skip to content

Commit 5ffa5df

Browse files
committed
Return full error messages.
Removed obsolete localization stub.
1 parent 8bbfb7a commit 5ffa5df

File tree

10 files changed

+31
-62
lines changed

10 files changed

+31
-62
lines changed

index.html

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* jQuery File Upload Plugin Demo 6.9.1
4+
* jQuery File Upload Plugin Demo 6.9.6
55
* https://github.com/blueimp/jQuery-File-Upload
66
*
77
* Copyright 2010, Sebastian Tschan
@@ -155,15 +155,15 @@ <h3 class="modal-title"></h3>
155155
<td class="name"><span>{%=file.name%}</span></td>
156156
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
157157
{% if (file.error) { %}
158-
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
158+
<td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
159159
{% } else if (o.files.valid && !i) { %}
160160
<td>
161161
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
162162
</td>
163163
<td class="start">{% if (!o.options.autoUpload) { %}
164164
<button class="btn btn-primary">
165165
<i class="icon-upload icon-white"></i>
166-
<span>{%=locale.fileupload.start%}</span>
166+
<span>Start</span>
167167
</button>
168168
{% } %}</td>
169169
{% } else { %}
@@ -172,7 +172,7 @@ <h3 class="modal-title"></h3>
172172
<td class="cancel">{% if (!i) { %}
173173
<button class="btn btn-warning">
174174
<i class="icon-ban-circle icon-white"></i>
175-
<span>{%=locale.fileupload.cancel%}</span>
175+
<span>Cancel</span>
176176
</button>
177177
{% } %}</td>
178178
</tr>
@@ -186,7 +186,7 @@ <h3 class="modal-title"></h3>
186186
<td></td>
187187
<td class="name"><span>{%=file.name%}</span></td>
188188
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
189-
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
189+
<td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
190190
{% } else { %}
191191
<td class="preview">{% if (file.thumbnail_url) { %}
192192
<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
@@ -200,7 +200,7 @@ <h3 class="modal-title"></h3>
200200
<td class="delete">
201201
<button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
202202
<i class="icon-trash icon-white"></i>
203-
<span>{%=locale.fileupload.destroy%}</span>
203+
<span>Delete</span>
204204
</button>
205205
<input type="checkbox" name="delete" value="1">
206206
</td>
@@ -227,8 +227,6 @@ <h3 class="modal-title"></h3>
227227
<script src="js/jquery.fileupload-fp.js"></script>
228228
<!-- The File Upload user interface plugin -->
229229
<script src="js/jquery.fileupload-ui.js"></script>
230-
<!-- The localization script -->
231-
<script src="js/locale.js"></script>
232230
<!-- The main application script -->
233231
<script src="js/main.js"></script>
234232
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->

js/jquery.fileupload-ui.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload User Interface Plugin 6.9.5
2+
* jQuery File Upload User Interface Plugin 6.9.6
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -144,7 +144,8 @@
144144
if (data.context) {
145145
data.context.each(function (index) {
146146
var file = ($.isArray(data.result) &&
147-
data.result[index]) || {error: 'emptyResult'};
147+
data.result[index]) ||
148+
{error: 'Empty file upload result'};
148149
if (file.error) {
149150
that._adjustMaxNumberOfFiles(1);
150151
}

js/jquery.fileupload.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin 5.17.5
2+
* jQuery File Upload Plugin 5.17.6
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -516,7 +516,7 @@
516516
return true;
517517
}
518518
if (ub >= fs) {
519-
file.error = 'uploadedBytes';
519+
file.error = 'Uploaded bytes exceed file size';
520520
return this._getXHRPromise(
521521
false,
522522
options.context,

js/locale.js

-29
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blueimp-file-upload",
3-
"version": "6.9.2",
3+
"version": "6.9.6",
44
"title": "jQuery File Upload",
55
"description": "File Upload widget with multiple file selection, drag&drop support, progress bars and preview images for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.",
66
"keywords": [

server/gae-go/app/main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin GAE Go Example 2.1.1
2+
* jQuery File Upload Plugin GAE Go Example 2.1.2
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2011, Sebastian Tschan
@@ -60,15 +60,15 @@ func (fi *FileInfo) ValidateType() (valid bool) {
6060
if acceptFileTypes.MatchString(fi.Type) {
6161
return true
6262
}
63-
fi.Error = "acceptFileTypes"
63+
fi.Error = "Filetype not allowed"
6464
return false
6565
}
6666

6767
func (fi *FileInfo) ValidateSize() (valid bool) {
6868
if fi.Size < MIN_FILE_SIZE {
69-
fi.Error = "minFileSize"
69+
fi.Error = "File is too small"
7070
} else if fi.Size > MAX_FILE_SIZE {
71-
fi.Error = "maxFileSize"
71+
fi.Error = "File is too big"
7272
} else {
7373
return true
7474
}

server/gae-python/main.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# jQuery File Upload Plugin GAE Python Example 1.1.4
3+
# jQuery File Upload Plugin GAE Python Example 1.1.5
44
# https://github.com/blueimp/jQuery-File-Upload
55
#
66
# Copyright 2011, Sebastian Tschan
@@ -38,11 +38,11 @@ def initialize(self, request, response):
3838

3939
def validate(self, file):
4040
if file['size'] < MIN_FILE_SIZE:
41-
file['error'] = 'minFileSize'
41+
file['error'] = 'File is too small'
4242
elif file['size'] > MAX_FILE_SIZE:
43-
file['error'] = 'maxFileSize'
43+
file['error'] = 'File is too big'
4444
elif not ACCEPT_FILE_TYPES.match(file['type']):
45-
file['error'] = 'acceptFileTypes'
45+
file['error'] = 'Filetype not allowed'
4646
else:
4747
return True
4848
return False

server/node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blueimp-file-upload-node",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"title": "jQuery File Upload Node.js example",
55
"description": "Node.js implementation example of a file upload handler for jQuery File Upload.",
66
"keywords": [

server/node/server.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
/*
3-
* jQuery File Upload Plugin Node.js Example 1.0.3
3+
* jQuery File Upload Plugin Node.js Example 1.0.4
44
* https://github.com/blueimp/jQuery-File-Upload
55
*
66
* Copyright 2012, Sebastian Tschan
@@ -152,11 +152,11 @@
152152
};
153153
FileInfo.prototype.validate = function () {
154154
if (options.minFileSize && options.minFileSize > this.size) {
155-
this.error = 'minFileSize';
155+
this.error = 'File is too small';
156156
} else if (options.maxFileSize && options.maxFileSize < this.size) {
157-
this.error = 'maxFileSize';
157+
this.error = 'File is too big';
158158
} else if (!options.acceptFileTypes.test(this.name)) {
159-
this.error = 'acceptFileTypes';
159+
this.error = 'Filetype not allowed';
160160
}
161161
return !this.error;
162162
};

test/index.html

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* jQuery File Upload Plugin Test 6.9.1
4+
* jQuery File Upload Plugin Test 6.9.6
55
* https://github.com/blueimp/jQuery-File-Upload
66
*
77
* Copyright 2010, Sebastian Tschan
@@ -77,15 +77,15 @@ <h2 id="qunit-userAgent"></h2>
7777
<td class="name"><span>{%=file.name%}</span></td>
7878
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
7979
{% if (file.error) { %}
80-
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
80+
<td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
8181
{% } else if (o.files.valid && !i) { %}
8282
<td>
8383
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
8484
</td>
8585
<td class="start">{% if (!o.options.autoUpload) { %}
8686
<button class="btn btn-primary">
8787
<i class="icon-upload icon-white"></i>
88-
<span>{%=locale.fileupload.start%}</span>
88+
<span>Start</span>
8989
</button>
9090
{% } %}</td>
9191
{% } else { %}
@@ -94,7 +94,7 @@ <h2 id="qunit-userAgent"></h2>
9494
<td class="cancel">{% if (!i) { %}
9595
<button class="btn btn-warning">
9696
<i class="icon-ban-circle icon-white"></i>
97-
<span>{%=locale.fileupload.cancel%}</span>
97+
<span>Cancel</span>
9898
</button>
9999
{% } %}</td>
100100
</tr>
@@ -108,7 +108,7 @@ <h2 id="qunit-userAgent"></h2>
108108
<td></td>
109109
<td class="name"><span>{%=file.name%}</span></td>
110110
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
111-
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
111+
<td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
112112
{% } else { %}
113113
<td class="preview">{% if (file.thumbnail_url) { %}
114114
<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
@@ -122,7 +122,7 @@ <h2 id="qunit-userAgent"></h2>
122122
<td class="delete">
123123
<button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
124124
<i class="icon-trash icon-white"></i>
125-
<span>{%=locale.fileupload.destroy%}</span>
125+
<span>Delete</span>
126126
</button>
127127
<input type="checkbox" name="delete" value="1">
128128
</td>
@@ -138,7 +138,6 @@ <h2 id="qunit-userAgent"></h2>
138138
<script src="../js/jquery.fileupload.js"></script>
139139
<script src="../js/jquery.fileupload-fp.js"></script>
140140
<script src="../js/jquery.fileupload-ui.js"></script>
141-
<script src="../js/locale.js"></script>
142141
<script src="http://code.jquery.com/qunit/git/qunit.js"></script>
143142
<script src="test.js"></script>
144143
</body>

0 commit comments

Comments
 (0)