Widget:Multi upload bericht: verschil tussen versies
Uit Dorpsbelang Den Hout
(Nieuwe pagina aangemaakt met '<noinclude>{{Managed |Version=1.0 |Version notes=1.0 - First managed version |Short description= }} This is the '''Widget:Multi upload''' page. It should be called...') |
|||
(10 tussenliggende versies door dezelfde gebruiker niet weergegeven) | |||
Regel 14: | Regel 14: | ||
<div id="imgTest" class="upload-preview d-flex flex-wrap"></div> | <div id="imgTest" class="upload-preview d-flex flex-wrap"></div> | ||
− | <label for="files" class="attachment btn btn-default float-right"><i class="fa fa-paperclip "></i><input type="file" id="files" name="files[]" class="hidden" multiple /></label><script> | + | <label for="files" class="attachment btn btn-default float-right"><i class="fa fa-paperclip "></i><input type="file" id="files" name="files[]" class="hidden d-none" multiple /></label><script> |
function uuidv4() { | function uuidv4() { | ||
Regel 24: | Regel 24: | ||
var counter = 0; | var counter = 0; | ||
− | var uuid = uuidv4(); | + | //var uuid = uuidv4(); |
var filedate = Date.now(); | var filedate = Date.now(); | ||
Regel 44: | Regel 44: | ||
console.log(values); | console.log(values); | ||
console.log('done'); | console.log('done'); | ||
− | + | // var codeid = document.createElement('input'); | |
− | + | // codeid.setAttribute('type','hidden') | |
− | + | // codeid.setAttribute('name','uuid') | |
− | + | // codeid.setAttribute('value', uuid) | |
− | + | // document.getElementById('files').closest('form').appendChild(codeid) | |
− | document.getElementById(' | + | document.getElementById('real-submit').click(); |
}); | }); | ||
Regel 101: | Regel 101: | ||
//counter = fname; | //counter = fname; | ||
console.log(fname); | console.log(fname); | ||
− | + | // if(fname.substr( fname.length -3 ) === "pdf"){ | |
− | + | // document.getElementById("imgTest").innerHTML = document.getElementById("imgTest").innerHTML+'<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="file-pdf" class="svg-inline--fa fa-file-pdf fa-w-12" role="img" viewBox="0 0 384 512"><path fill="currentColor" d="M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z"/></svg>'; | |
− | + | // }else{ | |
var fileReader = new FileReader(); | var fileReader = new FileReader(); | ||
Regel 116: | Regel 116: | ||
counter = counter + 1; | counter = counter + 1; | ||
− | document.getElementById("imgTest").innerHTML = document.getElementById("imgTest").innerHTML+'<div class="upload-group">'+newImage.outerHTML+'<input data="'+dt.name+'" type="text" placeholder="caption" class="form-control" /></div>'; | + | document.getElementById("imgTest").innerHTML = document.getElementById("imgTest").innerHTML+'<div class="upload-group">'+newImage.outerHTML+'<div class="d-flex"><input name="exclude" data="'+dt.name+'" type="text" placeholder="caption" class="form-control" /><input id="'+dt.name+'" type="radio" name="Image" class="d-none" value="'+filedate+dt.name+'" ><label for="'+dt.name+'" ><i class="fa fa-star btn ml-0"></i></label></div></div>'; |
// alert("Converted Base64 version is " + document.getElementById("imgTest").innerHTML); | // alert("Converted Base64 version is " + document.getElementById("imgTest").innerHTML); | ||
// console.log("Converted Base64 version is " + document.getElementById("imgTest").innerHTML); | // console.log("Converted Base64 version is " + document.getElementById("imgTest").innerHTML); | ||
Regel 122: | Regel 122: | ||
fileReader.readAsDataURL(fileToLoad); | fileReader.readAsDataURL(fileToLoad); | ||
− | + | // else pdf } | |
} | } | ||
} | } | ||
Regel 134: | Regel 134: | ||
console.log(caption) | console.log(caption) | ||
− | var taskidel = document.querySelector('[name="mwwrite"]').value; | + | //var taskidel = document.querySelector('[name="mwwrite"]').value; |
− | + | // uuid = taskidel; | |
− | var newWikitextEdit = '{{ | + | var newWikitextEdit = '{{Bericht file|Caption='+caption+'|Bericht='+document.querySelector('input[name="Domein"]').value.replace('.','-')+'/'+document.querySelector('input[name="Titel"]').value.replace(' ','-')+'|Domein='+document.querySelector('input[name="Domein"]').value+'|File uploaded by=User:'+mw.user.getName()+'|type='+file.substr( file.length -3 )+'}}'; |
Huidige versie van 19 aug 2020 om 15:22
This is the Widget:Multi upload page. It should be called in the following format:
{{#widget:Multi upload }}