Skip to content

Commit b8c8bb6

Browse files
committed
More cleanup
1 parent 4981f24 commit b8c8bb6

File tree

6 files changed

+11
-29
lines changed

6 files changed

+11
-29
lines changed

README

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ A very basic framework around jQueryFileUpload scripts, to host in ASP.Net.
22

33
TODO:
44
=====
5+
- Section divisions by classifications (different targets, like documents, videos etc)
6+
57
- Decouple UI from upload handers & templates a bit more? (less hooks by structure, more by class)
68
- Ability to add placeholders for required dependencies (like the components of a .ism file)
79
- Callbacks for current status (for post-upload processing, like transcodes)
8-
- Section divisions by classifications (different targets, like documents, videos etc)
910
- Look at http://sandbox.knarly.com/js/dropfiles/ for IE9 file drop?

jQueryFileUpload/Default.aspx

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
<span>Add files...</span>
3232
<input type="file" name="files[]" multiple="multiple" />
3333
</label>
34-
<%-- <button type="submit" class="start">Start upload</button>
35-
<button type="reset" class="cancel">Cancel upload</button> --%>
3634
<button type="button" class="delete button">Delete all files</button>
3735
<div class="fileupload-progressbar"></div>
3836
</div>

jQueryFileUpload/FileTransferHandler.ashx.cs

-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
using System.Web.Script.Serialization;
77

88
namespace jQueryUploadTest {
9-
/// <summary>
10-
/// Summary description for ImageUpload
11-
/// </summary>
129
public class FileTransferHandler : IHttpHandler {
1310
private readonly JavaScriptSerializer js = new JavaScriptSerializer();
1411

jQueryFileUpload/FilesStatus.ashx.cs

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using System.IO;
22

33
namespace jQueryUploadTest {
4-
/// <summary>
5-
/// Uploaded Files
6-
/// </summary>
74
public class FilesStatus {
85
public const string HandlerPath = "/";
96

@@ -20,18 +17,18 @@ public class FilesStatus {
2017

2118
public FilesStatus () { }
2219

23-
public FilesStatus (FileInfo fileInfo) { this.SetValues(fileInfo.Name, (int)fileInfo.Length); }
20+
public FilesStatus (FileInfo fileInfo) { SetValues(fileInfo.Name, (int)fileInfo.Length); }
2421

25-
public FilesStatus (string FileName, int FileLength) { this.SetValues(FileName, FileLength); }
22+
public FilesStatus (string fileName, int fileLength) { SetValues(fileName, fileLength); }
2623

27-
private void SetValues (string FileName, int FileLength) {
28-
name = FileName;
24+
private void SetValues (string fileName, int fileLength) {
25+
name = fileName;
2926
type = "image/png";
30-
size = FileLength;
27+
size = fileLength;
3128
progress = "1.0";
32-
url = HandlerPath + "FileTransferHandler.ashx?f=" + FileName;
33-
thumbnail_url = HandlerPath + "Thumbnail.ashx?f=" + FileName;
34-
delete_url = HandlerPath + "FileTransferHandler.ashx?f=" + FileName;
29+
url = HandlerPath + "FileTransferHandler.ashx?f=" + fileName;
30+
thumbnail_url = HandlerPath + "Thumbnail.ashx?f=" + fileName;
31+
delete_url = HandlerPath + "FileTransferHandler.ashx?f=" + fileName;
3532
delete_type = "DELETE";
3633
}
3734
}

jQueryFileUpload/scripts/jquery.fileupload-ui.js

-11
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@
3535
// The regular expression for allowed file types, matches
3636
// against either file type or file name:
3737
acceptFileTypes: /.+$/i,
38-
// The regular expression to define for which files a preview
39-
// image is shown, matched against the file type:
40-
previewFileTypes: /^image\/(gif|jpeg|png)$/,
41-
// The maximum width of the preview images:
42-
previewMaxWidth: 80,
43-
// The maximum height of the preview images:
44-
previewMaxHeight: 80,
45-
// By default, preview images are displayed as canvas elements
46-
// if supported by the browser. Set the following option to false
47-
// to always display preview images as img elements:
48-
previewAsCanvas: true,
4938
// The file upload template that is given as first argument to the
5039
// jQuery.tmpl method to render the file uploads:
5140
uploadTemplate: $('#template-upload'),

jQueryFileUpload/scripts/jquery.fileupload.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
data.submit();
105105
},
106106

107-
// Other callbacks:
107+
// Other callbacks: (uncomment to enable)
108108
// Callback for the start of each file upload request:
109109
// send: function (e, data) {}, // .bind('fileuploadsend', func);
110110
// Callback for successful uploads:

0 commit comments

Comments
 (0)