UNPKG

painterro

Version:
25 lines (24 loc) 628 B
<html> <head> <script src="http://localhost:8080/painterro.min.js"></script> </head> <body> {% include 'common.html' %} {% include 'images_list.html' %} <script> var ptro = Painterro({ saveHandler: function (image, done) { var formData = new FormData() formData.append('image', image.asBlob()); var xhr = new XMLHttpRequest(); xhr.open('POST', 'http://127.0.0.1:5000/save-as-binary/', true); xhr.onload = xhr.onerror = function () { done(true) window.location.reload() }; xhr.send(formData) } }) </script> </body> </html>