##// END OF EJS Templates
Small progress in getting a sync data from server
Small progress in getting a sync data from server

File last commit:

r1007:17f2694e default
r1138:7246d9ec decentral
Show More
form.js
26 lines | 760 B | application/javascript | JavascriptLexer
$('input[name=image]').wrap($('<div class="file_wrap"></div>'));
$('body').on('change', 'input[name=image]', function(event) {
var file = event.target.files[0];
if(file.type.match('image.*')) {
var fileReader = new FileReader();
fileReader.addEventListener("load", function(event) {
var wrapper = $('.file_wrap');
wrapper.find('.file-thumb').remove();
wrapper.append(
$('<div class="file-thumb" style="background-image: url('+event.target.result+')"></div>')
);
});
fileReader.readAsDataURL(file);
}
});
var form = $('#form');
$('textarea').keypress(function(event) {
if (event.which == 13 && event.ctrlKey) {
form.submit();
}
});