Skip to content

Commit 825879e

Browse files
committed
Improved NoScript usability.
1 parent a44bd91 commit 825879e

File tree

3 files changed

+46
-10
lines changed

3 files changed

+46
-10
lines changed

css/jquery.fileupload-ui-noscript.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@charset "UTF-8";
2+
/*
3+
* jQuery File Upload UI Plugin NoScript CSS 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+
.fileinput-button input {
14+
position: static;
15+
opacity: 1;
16+
filter: none;
17+
transform: none;
18+
font-size: inherit;
19+
direction: inherit;
20+
}
21+
22+
.fileinput-button span,
23+
.fileinput-button i,
24+
.fileupload-buttonbar .delete,
25+
.fileupload-buttonbar .toggle {
26+
display: none;
27+
}

index.html

Lines changed: 7 additions & 3 deletions
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.6
4+
* jQuery File Upload Plugin Demo 6.10
55
* https://github.com/blueimp/jQuery-File-Upload
66
*
77
* Copyright 2010, Sebastian Tschan
@@ -31,6 +31,8 @@
3131
<link rel="stylesheet" href="http://blueimp.github.com/Bootstrap-Image-Gallery/css/bootstrap-image-gallery.min.css">
3232
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
3333
<link rel="stylesheet" href="css/jquery.fileupload-ui.css">
34+
<!-- CSS adjustments for browsers with JavaScript disabled -->
35+
<noscript><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"></noscript>
3436
<!-- Shim to make HTML5 elements usable in older Internet Explorer versions -->
3537
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
3638
</head>
@@ -46,7 +48,7 @@
4648
<a class="brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
4749
<div class="nav-collapse">
4850
<ul class="nav">
49-
<li class="active"><a href="#">Demo</a></li>
51+
<li class="active"><a href="http://blueimp.github.com/jQuery-File-Upload/">Demo</a></li>
5052
<li><a href="https://github.com/blueimp/jQuery-File-Upload/downloads">Downloads</a></li>
5153
<li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
5254
<li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
@@ -68,7 +70,9 @@ <h1>jQuery File Upload Demo</h1>
6870
</blockquote>
6971
<br>
7072
<!-- The file upload form used as target for the file upload widget -->
71-
<form id="fileupload" action="server/php/" method="POST" enctype="multipart/form-data">
73+
<form id="fileupload" action="//jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
74+
<!-- Redirect browsers with JavaScript disabled to the origin page -->
75+
<noscript><input type="hidden" name="redirect" value="http://blueimp.github.com/jQuery-File-Upload/"></noscript>
7276
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
7377
<div class="row fileupload-buttonbar">
7478
<div class="span7">

js/main.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin JS Example 6.7
2+
* jQuery File Upload Plugin JS Example 6.10
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -16,7 +16,9 @@ $(function () {
1616
'use strict';
1717

1818
// Initialize the jQuery File Upload widget:
19-
$('#fileupload').fileupload();
19+
$('#fileupload').fileupload({
20+
url: 'server/php/'
21+
});
2022

2123
// Enable iframe cross-domain access via redirect option:
2224
$('#fileupload').fileupload(
@@ -66,12 +68,15 @@ $(function () {
6668
// Load existing files:
6769
$('#fileupload').each(function () {
6870
var that = this;
69-
$.getJSON(this.action, function (result) {
70-
if (result && result.length) {
71-
$(that).fileupload('option', 'done')
72-
.call(that, null, {result: result});
71+
$.getJSON(
72+
$(this).fileupload('option', 'url'),
73+
function (result) {
74+
if (result && result.length) {
75+
$(that).fileupload('option', 'done')
76+
.call(that, null, {result: result});
77+
}
7378
}
74-
});
79+
);
7580
});
7681
}
7782

0 commit comments

Comments
 (0)