modify upload dropzone
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
# gohttpserver
|
||||
Make the best HTTP File Server. Rewrite from https://github.com/codeskyblue/gohttp with golang+vue
|
||||
Make the best HTTP File Server.
|
||||
|
||||
> Rewrite from https://github.com/codeskyblue/gohttp with golang+vue
|
||||
|
||||
## Notes
|
||||
If using go1.5, ensure you set GO15VENDOREXPERIMENT=1
|
||||
|
||||
Upload size now limited to 1G
|
||||
|
||||
## Features
|
||||
1. [x] Support QRCode code generate
|
||||
1. [x] Breadcrumb path quick change
|
||||
@@ -96,6 +100,7 @@ That's all. ^_^
|
||||
* Markdown-JS <https://github.com/showdownjs/showdown>
|
||||
* <https://github.com/sindresorhus/github-markdown-css>
|
||||
* <http://www.gorillatoolkit.org/pkg/handlers>
|
||||
* <http://www.dropzonejs.com/>
|
||||
|
||||
## LICENSE
|
||||
This project is under license [MIT](LICENSE)
|
||||
|
||||
@@ -6,9 +6,10 @@ body {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
/* Not used */
|
||||
div.dropzone {
|
||||
display: block;
|
||||
text-align: center;
|
||||
/*text-align: center;*/
|
||||
border: 2px dashed #666;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="/testdata" class="dropzone"></form>
|
||||
<form action="#" class="dropzone" id="my-dropzone"></form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
|
||||
@@ -194,5 +194,17 @@ function loadFileList() {
|
||||
vm.updateBreadcrumb()
|
||||
}
|
||||
|
||||
loadFileList() // For page first loading
|
||||
$("div.dropzone").dropzone({ url: location.pathname });
|
||||
// For page first loading
|
||||
loadFileList()
|
||||
|
||||
Dropzone.options.myDropzone = {
|
||||
url: location.pathname,
|
||||
paramName: "file",
|
||||
maxFilesize: 1024,
|
||||
addRemoveLinks: true,
|
||||
init: function() {
|
||||
this.on("uploadprogress", function(file, progress) {
|
||||
console.log("File progress", progress);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user