Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved file API support warnings

  • Loading branch information...
commit b1aecea079bdbdd35378be2d554330f1be71a277 1 parent b71b8f1
@dmfrancisco authored
Showing with 11 additions and 8 deletions.
  1. +11 −8 public/js/script.js
View
19 public/js/script.js
@@ -474,18 +474,21 @@ var escrito = function () {
// When clicking the import button
$('#import-button').click(function (e) {
var importMessage = "";
- if (typeof window.File === 'undefined' && typeof window.FileReader === 'undefined') { /* IE */
- importMessage = "<p style='font-size:20px'>Currently, <strong>we don't support file uploads</strong> " +
- "to our servers.</p><p>Please, copy <em>&amp;</em> paste your file's content or try a "+
- "different browser, such as Chrome or Firefox.</p>";
- } else if (typeof window.FileReader === 'undefined') { /* Opera? */
- importMessage = "<p style='font-size:20px'><strong>Upload a file</strong>, " +
- "from your system: <input type=file></p>";
- } else { /* Chrome & Firefox 4+ */
+ if (typeof window.File !== 'undefined' &&
+ typeof window.FileReader !== 'undefined' &&
+ Modernizr.draganddrop) { /* Chrome & Firefox 4+ */
importMessage = "<p style='font-size:20px'><strong>Drag <em>&amp;</em> drop a file</strong>, " +
"from your system, into this paper sheet.</p><p>Alternatively, you can also " +
"upload it here: <input type=file></p>";
+
+ } else if (typeof window.FileReader !== 'undefined') { /* Opera? */
+ importMessage = "<p style='font-size:20px'><strong>Upload a file</strong>, " +
+ "from your system: <input type=file></p>";
+ } else { /* IE */
+ importMessage = "<p style='font-size:20px'>Currently, <strong>we don't support file uploads</strong> " +
+ "to our servers.</p><p>Please, copy <em>&amp;</em> paste your file's content or try a "+
+ "different browser, such as Chrome or Firefox.</p>";
}
$('#paper').html(importMessage);
Please sign in to comment.
Something went wrong with that request. Please try again.