##// END OF EJS Templates
Moved signatures block to the model block. All the signed content is in the 'content' block now. Removed edit time, previous and next posts links from the XML sync output because they can be computed from the post itself and can be changed locally for foreign posts (which breaks the signature)
Moved signatures block to the model block. All the signed content is in the 'content' block now. Removed edit time, previous and next posts links from the XML sync output because they can be computed from the post itself and can be changed locally for foreign posts (which breaks the signature)

File last commit:

r713:7f2e98f4 default
r838:2b96b9e7 decentral
Show More
form.js
41 lines | 1.3 KiB | application/javascript | JavascriptLexer
var isCompact = false;
$('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 fullForm = $('.swappable-form-full');
function swapForm() {
if (isCompact) {
// TODO Use IDs (change the django form code) instead of absolute numbers
fullForm.find('textarea').appendTo(fullForm.find('.form-row')[4].children[0]);
fullForm.find('.file_wrap').appendTo(fullForm.find('.form-row')[7].children[0]);
fullForm.find('.form-row').show();
scrollToBottom();
} else {
fullForm.find('textarea').appendTo($('.compact-form-text'));
fullForm.find('.file_wrap').insertBefore($('.compact-form-text'));
fullForm.find('.form-row').hide();
fullForm.find('input[type=text]').val('');
}
isCompact = !isCompact;
}