##// END OF EJS Templates
Show reply count in OP along with the images count
Show reply count in OP along with the images count

File last commit:

r686:64d75fce default
r695:865d0253 1.8-dev
Show More
form.js
45 lines | 1.2 KiB | application/javascript | JavascriptLexer
neko259
Added a compact form to the thread.
r676 var isCompact = true;
neko259
Added image preview in the forms
r673
neko259
Updated form to a new style. Fixed mark manel
r680 $('input[name=image]').wrap($('<div class="file_wrap"></div>'));
neko259
Added a compact form to the thread.
r676
$('body').on('change', 'input[name=image]', function(event) {
neko259
Added image preview in the forms
r673 var file = event.target.files[0];
if(file.type.match('image.*')) {
var fileReader = new FileReader();
fileReader.addEventListener("load", function(event) {
neko259
Updated form to a new style. Fixed mark manel
r680 var wrapper = $('.file_wrap');
wrapper.find('.file-thumb').remove();
wrapper.append(
$('<div class="file-thumb" style="background-image: url('+event.target.result+')"></div>')
neko259
Added image preview in the forms
r673 );
});
fileReader.readAsDataURL(file);
}
});
neko259
Added a compact form to the thread.
r676
var compactForm = $('.swappable-form-compact');
var fullForm = $('.swappable-form-full');
function swapForm() {
compactForm.toggle();
fullForm.toggle();
if (isCompact) {
var oldText = compactForm.find('textarea')[0].value;
fullForm.find('textarea')[0].value = oldText;
} else {
var oldText = fullForm.find('textarea')[0].value;
compactForm.find('textarea')[0].value = oldText;
}
isCompact = !isCompact;
neko259
Scroll to bottom when the form mode changes
r686
scrollToBottom();
neko259
Added a compact form to the thread.
r676 }
if (compactForm.length > 0) {
fullForm.toggle();
neko259
Scroll to bottom when the form mode changes
r686 }