Browse Source

Fix no-javascript fallback ugliness of index page. Fixes #37

pull/51/head v0.8.4
andreimarcu 9 years ago
parent
commit
37d3e96e22
  1. 33
      static/css/dropzone.css
  2. 2
      static/js/upload.js
  3. 4
      templates/index.html

33
static/css/dropzone.css

@ -1,3 +1,36 @@
#dzone {
display: none;
}
.fallback {
background-color: #FAFBFC;
padding-top: 40px;
padding-bottom: 20px;
text-align: center;
-moz-box-shadow: 1px 1px 1px 1px #ccc;
-webkit-box-shadow: 1px 1px 1px 1px #ccc;
box-shadow: 1px 1px 1px 1px #ccc;
}
#fileinput {
margin-top: 20px;
}
#submitbtn {
margin-top: 30px;
background-color: #FFF;
border: 2px solid #556A7F;
width: 90px;
height: 30px;
}
#submitbtn:hover {
background-color: #556A7F;
color: white;
border: 2px solid #FAFBFC;
}
#dropzone { width: 400px; #dropzone { width: 400px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;

2
static/js/upload.js

@ -2,6 +2,8 @@
Dropzone.options.dropzone = { Dropzone.options.dropzone = {
init: function() { init: function() {
var dzone = document.getElementById("dzone");
dzone.style.display = "block";
}, },
addedfile: function(file) { addedfile: function(file) {
var upload = document.createElement("div"); var upload = document.createElement("div");

4
templates/index.html

@ -8,8 +8,8 @@
<div id="fileupload"> <div id="fileupload">
<form action="/upload" class="dropzone" id="dropzone" method="POST" enctype="multipart/form-data"> <form action="/upload" class="dropzone" id="dropzone" method="POST" enctype="multipart/form-data">
<div class="fallback"> <div class="fallback">
<input name="file" type="file" /><br />
<input type="submit" value="Upload">
<input id="fileinput" name="file" type="file" /><br />
<input id="submitbtn" type="submit" value="Upload">
</div> </div>
<div id="dzone" class="dz-default dz-message"> <div id="dzone" class="dz-default dz-message">

Loading…
Cancel
Save