Skip to content

Commit 6fe3fb7

Browse files
author
karppa
committed
Copied new client side files
1 parent 4602116 commit 6fe3fb7

28 files changed

+4570
-60
lines changed

WebContent/README.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# jQuery File Upload Plugin
2+
3+
## Demo
4+
[Demo File Upload](http://blueimp.github.com/jQuery-File-Upload/)
5+
6+
## Setup instructions
7+
* [How to setup the plugin on your website](https://github.com/blueimp/jQuery-File-Upload/wiki/Setup)
8+
* [How to use only the basic plugin (minimal setup guide).](https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin)
9+
10+
## Features
11+
* **Multiple file upload:**
12+
Allows to select multiple files at once and upload them simultaneously.
13+
* **Drag & Drop support:**
14+
Allows to upload files by dragging them from your desktop or filemanager and dropping them on your browser window.
15+
* **Upload progress bar:**
16+
Shows a progress bar indicating the upload progress for individual files and for all uploads combined.
17+
* **Cancelable uploads:**
18+
Individual file uploads can be canceled to stop the upload progress.
19+
* **Resumable uploads:**
20+
Aborted uploads can be resumed with browsers supporting the Blob API.
21+
* **Chunked uploads:**
22+
Large files can be uploaded in smaller chunks with browsers supporting the Blob API.
23+
* **Client-side image resizing:**
24+
Images can be automatically resized on client-side with browsers supporting the required JS APIs.
25+
* **Preview images:**
26+
A preview of image files can be displayed before uploading with browsers supporting the required JS APIs.
27+
* **No browser plugins (e.g. Adobe Flash) required:**
28+
The implementation is based on open standards like HTML5 and JavaScript and requires no additional browser plugins.
29+
* **Graceful fallback for legacy browsers:**
30+
Uploads files via XMLHttpRequests if supported and uses iframes as fallback for legacy browsers.
31+
* **HTML file upload form fallback:**
32+
Shows a standard HTML file upload form if JavaScript is disabled.
33+
* **Cross-site file uploads:**
34+
Supports uploading files to a different domain with Cross-site XMLHttpRequests.
35+
* **Multiple plugin instances:**
36+
Allows to use multiple plugin instances on the same webpage.
37+
* **Customizable and extensible:**
38+
Provides an API to set individual options and define callBack methods for various upload events.
39+
* **Multipart and file contents stream uploads:**
40+
Files can be uploaded as standard "multipart/form-data" or file contents stream (HTTP PUT file upload).
41+
* **Compatible with any server-side application platform:**
42+
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.
43+
44+
## Requirements
45+
* [jQuery](http://jquery.com/) v. 1.6+
46+
* [jQuery UI widget factory](http://wiki.jqueryui.com/w/page/12138135/Widget%20factory) v. 1.8+
47+
* [jQuery Iframe Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/jquery.iframe-transport.js) (included)
48+
* [JavaScript Templates engine](https://github.com/blueimp/JavaScript-Templates) v. 2.1.0+ (optional)
49+
* [JavaScript Load Image function](https://github.com/blueimp/JavaScript-Load-Image) v. 1.1.6+ (optional)
50+
* [JavaScript Canvas to Blob function](https://github.com/blueimp/JavaScript-Canvas-to-Blob) v. 2.0.0+ (optional)
51+
* [Bootstrap CSS Toolkit](https://github.com/twitter/bootstrap/) v. 2.0+ (optional)
52+
53+
The jQuery UI widget factory is a requirement for the basic File Upload plugin, but very lightweight without any other dependencies.
54+
The jQuery Iframe Transport is required for [browsers without XHR file upload support](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support).
55+
The UI version of the File Upload plugin also requires the JavaScript Templates engine as well as the JavaScript Load Image and JavaScript Canvas to Blob functions (for the image previews and resizing functionality). These dependencies are marked as optional, as the basic File Upload plugin can be used without them and the UI version of the plugin can be extended to override these dependencies with alternative solutions.
56+
57+
The User Interface is built with Twitter's [Bootstrap](https://github.com/twitter/bootstrap/) Toolkit. This enables a CSS based, responsive layout and fancy transition effects on modern browsers. The demo also includes the [Bootstrap Image Gallery Plugin](https://github.com/blueimp/Bootstrap-Image-Gallery). Both of these components are optional and not required.
58+
59+
The repository also includes the [jQuery XDomainRequest Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/cors/jquery.xdr-transport.js), which enables Cross-domain AJAX requests (GET and POST only) in Microsoft Internet Explorer >= 8. However, the XDomainRequest object doesn't support file uploads and the plugin is only used by the [Demo](http://blueimp.github.com/jQuery-File-Upload/) for Cross-domain requests to delete uploaded files from the demo file upload service.
60+
61+
[Cross-domain File Uploads](https://github.com/blueimp/jQuery-File-Upload/wiki/Cross-domain-uploads) using the [Iframe Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js) require a redirect back to the origin server to retrieve the upload results. The [example implementation](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/main.js) makes use of [result.html](https://github.com/blueimp/jQuery-File-Upload/blob/master/cors/result.html) as a static redirect page for the origin server.
62+
63+
## Browser Support (tested versions)
64+
* Google Chrome - 7.0+
65+
* Apple Safari - 4.0+
66+
* Mozilla Firefox - 3.0+
67+
* Opera - 10.0+
68+
* Microsoft Internet Explorer 6.0+
69+
70+
Drag & Drop is only supported on Google Chrome, Firefox 4.0+, Safari 5.0+ and Opera 12.0+.
71+
Microsoft Internet Explorer has no support for multiple file selection or upload progress.
72+
[Extended browser support information](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support).
73+
74+
## License
75+
Released under the [MIT license](http://www.opensource.org/licenses/MIT).

WebContent/WEB-INF/glassfish-web.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
3+
<glassfish-web-app error-url="">
4+
<context-root>/jQuery-File-Upload-Java</context-root>
5+
<class-loader delegate="true"/>
6+
<jsp-config>
7+
<property name="keepgenerated" value="true">
8+
<description>Keep a copy of the generated servlet class' java code.</description>
9+
</property>
10+
</jsp-config>
11+
</glassfish-web-app>

WebContent/cors/postmessage.html

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!DOCTYPE HTML>
2+
<!--
3+
/*
4+
* jQuery File Upload Plugin postMessage API 1.1.1
5+
* https://github.com/blueimp/jQuery-File-Upload
6+
*
7+
* Copyright 2011, Sebastian Tschan
8+
* https://blueimp.net
9+
*
10+
* Licensed under the MIT license:
11+
* http://www.opensource.org/licenses/MIT
12+
*/
13+
-->
14+
<html lang="en">
15+
<head>
16+
<meta charset="utf-8">
17+
<title>jQuery File Upload Plugin postMessage API</title>
18+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
19+
</head>
20+
<body>
21+
<script>
22+
/*jslint unparam: true, regexp: true */
23+
/*global $, Blob, FormData, location */
24+
'use strict';
25+
var origin = /^http:\/\/example.org/,
26+
target = new RegExp('^(http(s)?:)?\\/\\/' + location.host + '\\/');
27+
$(window).on('message', function (e) {
28+
e = e.originalEvent;
29+
var s = e.data,
30+
xhr = $.ajaxSettings.xhr(),
31+
f;
32+
if (!origin.test(e.origin)) {
33+
throw new Error('Origin "' + e.origin + '" does not match ' + origin);
34+
}
35+
if (!target.test(e.data.url)) {
36+
throw new Error('Target "' + e.data.url + '" does not match ' + target);
37+
}
38+
$(xhr.upload).on('progress', function (ev) {
39+
ev = ev.originalEvent;
40+
e.source.postMessage({
41+
id: s.id,
42+
type: ev.type,
43+
timeStamp: ev.timeStamp,
44+
lengthComputable: ev.lengthComputable,
45+
loaded: ev.loaded,
46+
total: ev.total
47+
}, e.origin);
48+
});
49+
s.xhr = function () {
50+
return xhr;
51+
};
52+
if (!(s.data instanceof Blob)) {
53+
f = new FormData();
54+
$.each(s.data, function (i, v) {
55+
f.append(v.name, v.value);
56+
});
57+
s.data = f;
58+
}
59+
$.ajax(s).always(function (result, statusText, jqXHR) {
60+
if (!jqXHR.done) {
61+
jqXHR = result;
62+
result = null;
63+
}
64+
e.source.postMessage({
65+
id: s.id,
66+
status: jqXHR.status,
67+
statusText: statusText,
68+
result: result,
69+
headers: jqXHR.getAllResponseHeaders()
70+
}, e.origin);
71+
});
72+
});
73+
</script>
74+
</body>
75+
</html>

WebContent/cors/result.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE HTML>
2+
<!--
3+
/*
4+
* jQuery Iframe Transport Plugin Redirect Page 2.0
5+
* https://github.com/blueimp/jQuery-File-Upload
6+
*
7+
* Copyright 2010, Sebastian Tschan
8+
* https://blueimp.net
9+
*
10+
* Licensed under the MIT license:
11+
* http://www.opensource.org/licenses/MIT
12+
*/
13+
-->
14+
<html lang="en">
15+
<head>
16+
<meta charset="utf-8">
17+
<title>jQuery Iframe Transport Plugin Redirect Page</title>
18+
</head>
19+
<body><script>document.body.innerHTML=decodeURIComponent(window.location.search.slice(1));</script></body>
20+
</html>
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
@charset 'UTF-8';
2+
/*
3+
* jQuery File Upload UI Plugin CSS 6.3
4+
* https://github.com/blueimp/jQuery-File-Upload
5+
*
6+
* Copyright 2010, Sebastian Tschan
7+
* https://blueimp.net
8+
*
9+
* Licensed under the MIT license:
10+
* http://www.opensource.org/licenses/MIT
11+
*/
12+
13+
.fileinput-button {
14+
position: relative;
15+
overflow: hidden;
16+
float: left;
17+
margin-right: 4px;
18+
}
19+
.fileinput-button input {
20+
position: absolute;
21+
top: 0;
22+
right: 0;
23+
margin: 0;
24+
border: solid transparent;
25+
border-width: 0 0 100px 200px;
26+
opacity: 0;
27+
filter: alpha(opacity=0);
28+
-moz-transform: translate(-300px, 0) scale(4);
29+
direction: ltr;
30+
cursor: pointer;
31+
}
32+
.fileupload-buttonbar .btn,
33+
.fileupload-buttonbar .toggle {
34+
margin-bottom: 5px;
35+
}
36+
.files .progress {
37+
width: 200px;
38+
}
39+
.progress-animated .bar {
40+
background: url(../img/progressbar.gif) !important;
41+
filter: none;
42+
}
43+
.fileupload-loading {
44+
position: absolute;
45+
left: 50%;
46+
width: 128px;
47+
height: 128px;
48+
background: url(../img/loading.gif) center no-repeat;
49+
display: none;
50+
}
51+
.fileupload-processing .fileupload-loading {
52+
display: block;
53+
}
54+
55+
/* Fix for IE 6: */
56+
*html .fileinput-button {
57+
line-height: 22px;
58+
margin: 1px -3px 0 0;
59+
}
60+
61+
/* Fix for IE 7: */
62+
*+html .fileinput-button {
63+
margin: 1px 0 0 0;
64+
}
65+
66+
@media (max-width: 480px) {
67+
.files .btn span {
68+
display: none;
69+
}
70+
.files .preview * {
71+
width: 40px;
72+
}
73+
.files .name * {
74+
width: 80px;
75+
display: inline-block;
76+
word-wrap: break-word;
77+
}
78+
.files .progress {
79+
width: 20px;
80+
}
81+
.files .delete {
82+
width: 60px;
83+
}
84+
}

WebContent/css/style.css

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@charset 'UTF-8';
2+
/*
3+
* jQuery File Upload Plugin CSS Example 1.0
4+
* https://github.com/blueimp/jQuery-File-Upload
5+
*
6+
* Copyright 2012, Sebastian Tschan
7+
* https://blueimp.net
8+
*
9+
* Licensed under the MIT license:
10+
* http://www.opensource.org/licenses/MIT
11+
*/
12+
13+
body{
14+
padding-top: 60px;
15+
}

WebContent/img/loading.gif

3.81 KB
Loading

WebContent/img/progressbar.gif

3.25 KB
Loading

0 commit comments

Comments
 (0)