Skip to content

Commit 04de93e

Browse files
committed
Angular & jQuery UI 8.8.2 added
1 parent 9d4ef2e commit 04de93e

File tree

8 files changed

+486
-11
lines changed

8 files changed

+486
-11
lines changed

fileupload/static/js/app.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
(function () {
1616
'use strict';
1717

18+
1819
var isOnGitHub = window.location.hostname === 'blueimp.github.io',
19-
url = isOnGitHub ? '//jquery-file-upload.appspot.com/' : 'server/php/';
20+
url = '/upload/angular/',
21+
urlview = '/upload/view/';
2022

2123
angular.module('demo', [
2224
'blueimp.fileupload'
@@ -29,6 +31,7 @@
2931
/\/[^\/]*$/,
3032
'/cors/result.html?%s'
3133
);
34+
3235
if (isOnGitHub) {
3336
// Demo settings:
3437
angular.extend(fileUploadProvider.defaults, {
@@ -52,7 +55,7 @@
5255
};
5356
if (!isOnGitHub) {
5457
$scope.loadingFiles = true;
55-
$http.get(url)
58+
$http.get(urlview)
5659
.then(
5760
function (response) {
5861
$scope.loadingFiles = false;
@@ -79,7 +82,9 @@
7982
state = 'pending';
8083
return $http({
8184
url: file.deleteUrl,
82-
method: file.deleteType
85+
method: file.deleteType,
86+
xsrfHeaderName: 'X-CSRFToken',
87+
xsrfCookieName: 'csrftoken'
8388
}).then(
8489
function () {
8590
state = 'resolved';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
<!DOCTYPE HTML>
2+
<!--
3+
/*
4+
* jQuery File Upload Plugin AngularJS Demo 1.6.2
5+
* https://github.com/blueimp/jQuery-File-Upload
6+
*
7+
* Copyright 2013, 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+
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
17+
<!--[if IE]>
18+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
19+
<![endif]-->
20+
<meta charset="utf-8">
21+
<title>jQuery File Upload Demo - AngularJS version</title>
22+
<meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for AngularJS. 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.">
23+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
24+
<!-- Bootstrap styles -->
25+
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
26+
<!-- Generic page styles -->
27+
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css">
28+
<!-- blueimp Gallery styles -->
29+
<link rel="stylesheet" href="{{ STATIC_URL }}css/blueimp-gallery.min.css">
30+
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
31+
<link rel="stylesheet" href="{{ STATIC_URL }}css/jquery.fileupload-ui.css">
32+
<!-- CSS adjustments for browsers with JavaScript disabled -->
33+
<noscript><link rel="stylesheet" href="{{ STATIC_URL }}css/jquery.fileupload-ui-noscript.css"></noscript>
34+
<style>
35+
/* Hide Angular JS elements before initializing */
36+
.ng-cloak {
37+
display: none;
38+
}
39+
</style>
40+
</head>
41+
<body>
42+
<div class="navbar navbar-default navbar-fixed-top">
43+
<div class="container">
44+
<div class="navbar-header">
45+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-fixed-top .navbar-collapse">
46+
<span class="icon-bar"></span>
47+
<span class="icon-bar"></span>
48+
<span class="icon-bar"></span>
49+
</button>
50+
<a class="navbar-brand" href="https://github.com/sigurdga/django-jquery-file-upload">Django jQuery File Upload</a>
51+
</div>
52+
<div class="navbar-collapse collapse">
53+
<ul class="nav navbar-nav">
54+
<li><a href="#" class="active">Demo</a></li>
55+
<li><a href="https://github.com/sigurdga/django-jquery-file-upload">Source Code</a></li>
56+
<li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
57+
</ul>
58+
</div>
59+
</div>
60+
</div>
61+
<div class="container">
62+
<h1>Django jQuery File Upload Demo</h1>
63+
<h2 class="lead">AngularJS version</h2>
64+
<ul class="nav nav-tabs">
65+
<li><a href="/upload/basic">Basic</a></li>
66+
<li><a href="/upload/basic/plus">Basic Plus</a></li>
67+
<li><a href="/upload/new">Basic Plus UI</a></li>
68+
<li class="active"><a href="/upload/angular">AngularJS</a></li>
69+
<li><a href="/upload/jquery-ui">jQuery UI</a></li>
70+
</ul>
71+
<br>
72+
<blockquote>
73+
<p>File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for AngularJS.<br>
74+
Supports cross-domain, chunked and resumable file uploads and client-side image resizing.<br>
75+
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
76+
</blockquote>
77+
<br>
78+
<!-- The file upload form used as target for the file upload widget -->
79+
<form id="fileupload" action="." method="POST" enctype="multipart/form-data" data-ng-app="demo" data-ng-controller="DemoFileUploadController" data-file-upload="options" data-ng-class="{'fileupload-processing': processing() || loadingFiles}"> {% csrf_token %}
80+
<!-- Redirect browsers with JavaScript disabled to the origin page -->
81+
<noscript><input type="hidden" name="redirect" value="http://blueimp.github.io/jQuery-File-Upload/"></noscript>
82+
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
83+
<div class="row fileupload-buttonbar">
84+
<div class="col-lg-7">
85+
<!-- The fileinput-button span is used to style the file input field as button -->
86+
<span class="btn btn-success fileinput-button" ng-class="{disabled: disabled}">
87+
<i class="glyphicon glyphicon-plus"></i>
88+
<span>Add files...</span>
89+
<input type="file" name="file" multiple ng-disabled="disabled">
90+
</span>
91+
<button type="button" class="btn btn-primary start" data-ng-click="submit()">
92+
<i class="glyphicon glyphicon-upload"></i>
93+
<span>Start upload</span>
94+
</button>
95+
<button type="button" class="btn btn-warning cancel" data-ng-click="cancel()">
96+
<i class="glyphicon glyphicon-ban-circle"></i>
97+
<span>Cancel upload</span>
98+
</button>
99+
<!-- The loading indicator is shown during file processing -->
100+
<div class="fileupload-loading"></div>
101+
</div>
102+
<!-- The global progress information -->
103+
<div class="col-lg-5 fade" data-ng-class="{in: active()}">
104+
<!-- The global progress bar -->
105+
<div class="progress progress-striped active" data-file-upload-progress="progress()"><div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div></div>
106+
<!-- The extended global progress information -->
107+
<div class="progress-extended">&nbsp;</div>
108+
</div>
109+
</div>
110+
{% verbatim %}
111+
<!-- The table listing the files available for upload/download -->
112+
<table class="table table-striped files ng-cloak">
113+
<tr data-ng-repeat="file in queue">
114+
<td data-ng-switch data-on="!!file.thumbnailUrl">
115+
<div class="preview" data-ng-switch-when="true">
116+
<a data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}" data-gallery><img data-ng-src="{{file.thumbnailUrl}}" alt=""></a>
117+
</div>
118+
<div class="preview" data-ng-switch-default data-file-upload-preview="file"></div>
119+
</td>
120+
<td>
121+
<p class="name" data-ng-switch data-on="!!file.url">
122+
<span data-ng-switch-when="true" data-ng-switch data-on="!!file.thumbnailUrl">
123+
<a data-ng-switch-when="true" data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}" data-gallery>{{file.name}}</a>
124+
<a data-ng-switch-default data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}">{{file.name}}</a>
125+
</span>
126+
<span data-ng-switch-default>{{file.name}}</span>
127+
</p>
128+
<div data-ng-show="file.error"><span class="label label-important">Error</span> {{file.error}}</div>
129+
</td>
130+
<td>
131+
<p class="size">{{file.size | formatFileSize}}</p>
132+
<div class="progress progress-striped active fade" data-ng-class="{pending: 'in'}[file.$state()]" data-file-upload-progress="file.$progress()"><div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div></div>
133+
</td>
134+
<td>
135+
<button type="button" class="btn btn-primary start" data-ng-click="file.$submit()" data-ng-hide="!file.$submit">
136+
<i class="glyphicon glyphicon-upload"></i>
137+
<span>Start</span>
138+
</button>
139+
<button type="button" class="btn btn-warning cancel" data-ng-click="file.$cancel()" data-ng-hide="!file.$cancel">
140+
<i class="glyphicon glyphicon-ban-circle"></i>
141+
<span>Cancel</span>
142+
</button>
143+
<button data-ng-controller="FileDestroyController" type="button" class="btn btn-danger destroy" data-ng-click="file.$destroy()" data-ng-hide="!file.$destroy">
144+
<i class="glyphicon glyphicon-trash"></i>
145+
<span>Delete</span>
146+
</button>
147+
</td>
148+
</tr>
149+
</table>
150+
{% endverbatim %}
151+
</form>
152+
<br>
153+
<div class="panel panel-default">
154+
<div class="panel-heading">
155+
<h3 class="panel-title">Demo Notes</h3>
156+
</div>
157+
<div class="panel-body">
158+
<ul>
159+
<li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
160+
<li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
161+
<li>Built with Twitter's <a href="http://twitter.github.com/bootstrap/">Bootstrap</a> CSS framework and Icons from <a href="http://glyphicons.com/">Glyphicons</a>.</li>
162+
</ul>
163+
</div>
164+
</div>
165+
</div>
166+
<!-- The blueimp Gallery widget -->
167+
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
168+
<div class="slides"></div>
169+
<h3 class="title"></h3>
170+
<a class="prev"></a>
171+
<a class="next"></a>
172+
<a class="close">×</a>
173+
<a class="play-pause"></a>
174+
<ol class="indicator"></ol>
175+
</div>
176+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
177+
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
178+
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
179+
<script src="{{ STATIC_URL }}js/vendor/jquery.ui.widget.js"></script>
180+
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
181+
<script src="{{ STATIC_URL }}js/load-image.min.js"></script>
182+
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
183+
<script src="{{ STATIC_URL }}js/canvas-to-blob.min.js"></script>
184+
<!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
185+
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
186+
<!-- blueimp Gallery script -->
187+
<script src="{{ STATIC_URL }}js/jquery.blueimp-gallery.min.js"></script>
188+
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
189+
<script src="{{ STATIC_URL }}js/jquery.iframe-transport.js"></script>
190+
<!-- The basic File Upload plugin -->
191+
<script src="{{ STATIC_URL }}js/jquery.fileupload.js"></script>
192+
<!-- The File Upload processing plugin -->
193+
<script src="{{ STATIC_URL }}js/jquery.fileupload-process.js"></script>
194+
<!-- The File Upload image preview & resize plugin -->
195+
<script src="{{ STATIC_URL }}js/jquery.fileupload-image.js"></script>
196+
<!-- The File Upload audio preview plugin -->
197+
<script src="{{ STATIC_URL }}js/jquery.fileupload-audio.js"></script>
198+
<!-- The File Upload video preview plugin -->
199+
<script src="{{ STATIC_URL }}js/jquery.fileupload-video.js"></script>
200+
<!-- The File Upload validation plugin -->
201+
<script src="{{ STATIC_URL }}js/jquery.fileupload-validate.js"></script>
202+
<!-- The File Upload Angular JS module -->
203+
<script src="{{ STATIC_URL }}js/jquery.fileupload-angular.js"></script>
204+
<!-- The main application script -->
205+
<script src="{{ STATIC_URL }}js/app.js"></script>
206+
<script src="{{ STATIC_URL }}js/csrf.js"></script>
207+
</body>
208+
</html>

fileupload/templates/fileupload/picture_basic_form.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ <h2 class="lead">Basic version</h2>
4141
<li class="active"><a href="/upload/basic">Basic</a></li>
4242
<li><a href="/upload/basic/plus">Basic Plus</a></li>
4343
<li><a href="/upload/new">Basic Plus UI</a></li>
44-
<li><a href="angularjs.html" style="display:none;">AngularJS</a></li>
45-
<li><a href="jquery-ui.html" style="display:none;">jQuery UI</a></li>
44+
<li><a href="/upload/angular">AngularJS</a></li>
45+
<li><a href="/upload/jquery-ui">jQuery UI</a></li>
4646
</ul>
4747
<br>
4848
<blockquote>

fileupload/templates/fileupload/picture_basicplus_form.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ <h2 class="lead">Basic Plus version</h2>
4141
<li><a href="/upload/basic">Basic</a></li>
4242
<li class="active"><a href="/upload/basic/plus">Basic Plus</a></li>
4343
<li><a href="/upload/new">Basic Plus UI</a></li>
44-
<li><a href="angularjs.html" style="display:none;">AngularJS</a></li>
45-
<li><a href="jquery-ui.html" style="display:none;">jQuery UI</a></li>
44+
<li><a href="/upload/angular">AngularJS</a></li>
45+
<li><a href="/upload/jquery-ui">jQuery UI</a></li>
4646
</ul>
4747
<br>
4848
<blockquote>
@@ -75,7 +75,6 @@ <h3 class="panel-title">Demo Notes</h3>
7575
<ul>
7676
<li>The maximum file size for uploads in this demo is <strong>5 MB</strong> (default file size is unlimited).</li>
7777
<li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
78-
<li>Uploaded files will be deleted automatically after <strong>5 minutes</strong> (demo setting).</li>
7978
<li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
8079
<li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
8180
<li>Built with Twitter's <a href="http://twitter.github.com/bootstrap/">Bootstrap</a> CSS framework and Icons from <a href="http://glyphicons.com/">Glyphicons</a>.</li>

fileupload/templates/fileupload/picture_form.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ <h2 class="lead">Basic Plus UI version</h2>
99
<li><a href="/upload/basic">Basic</a></li>
1010
<li><a href="/upload/basic/plus">Basic Plus</a></li>
1111
<li class="active"><a href="/upload/new/">Basic Plus UI</a></li>
12-
<li><a href="angularjs.html" style="display:none;">AngularJS</a></li>
13-
<li><a href="jquery-ui.html" style="display:none;">jQuery UI</a></li>
12+
<li><a href="/upload/angular">AngularJS</a></li>
13+
<li><a href="/upload/jquery-ui">jQuery UI</a></li>
1414
</ul>
1515
<br>
1616
<blockquote>

0 commit comments

Comments
 (0)