This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// List all files in a directory in Node.js recursively in an asynchronous fashion | |
const fs = require('fs').promises; | |
const path = require('path'); | |
const walk = async (dir, filelist = []) => { | |
const files = await fs.readdir(dir); | |
for (file of files) { | |
const filepath = path.join(dir, file); | |
const stat = await fs.stat(filepath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#summernote').summernote({ | |
callbacks: { | |
onImageUpload: function(image) { | |
if((image[0].size/1024/1024) > 1) { | |
alert("Merci de déposer une image inférieure à 1 Mo, sinon uploadez-là sur un site d'hébergement d'image ou sur PETERPAN et utilisez la fonction image."); | |
return false; | |
} else { | |
var file = image[0]; | |
var reader = new FileReader(); | |
reader.onloadend = function() { |
NewerOlder