mirror of
https://github.com/Forceu/Gokapi.git
synced 2026-05-03 21:10:50 -05:00
Remove password when unticking checkbox, addded feature to paste text #45
This commit is contained in:
@@ -24,14 +24,26 @@ Dropzone.options.uploaddropzone = {
|
||||
},
|
||||
};
|
||||
|
||||
document.onpaste = function(event){
|
||||
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
||||
for (index in items) {
|
||||
var item = items[index];
|
||||
if (item.kind === 'file') {
|
||||
dropzoneObject.addFile(item.getAsFile())
|
||||
document.onpaste = function(event) {
|
||||
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
||||
for (index in items) {
|
||||
var item = items[index];
|
||||
if (item.kind === 'file') {
|
||||
dropzoneObject.addFile(item.getAsFile());
|
||||
}
|
||||
if (item.kind === 'string') {
|
||||
item.getAsString(function(s) {
|
||||
let blob = new Blob([s], {
|
||||
type: 'text/plain'
|
||||
});
|
||||
let file = new File([blob], "Pasted Text.txt", {
|
||||
type: "text/plain",
|
||||
lastModified: new Date(0)
|
||||
});
|
||||
dropzoneObject.addFile(file);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +55,9 @@ function checkBoxChanged(checkBox, correspondingInput) {
|
||||
} else {
|
||||
document.getElementById(correspondingInput).removeAttribute("disabled");
|
||||
}
|
||||
if (correspondingInput == "password" && disable) {
|
||||
document.getElementById("password").value = "";
|
||||
}
|
||||
}
|
||||
|
||||
function parseData(data) {
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="./js/admin.js?v=7"></script>
|
||||
<script src="./js/admin.js?v=8"></script>
|
||||
<script>
|
||||
Dropzone.options.uploaddropzone["maxFilesize"] = {{ .MaxFileSize }};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user