thread.replyCallback = function(status, data) { if (status === 'ok') { postCommon.storeUsedPostingPassword(api.boardUri, api.threadId, data); api.addYou(api.boardUri, data); document.getElementById('fieldMessage').value = ''; document.getElementById('fieldSubject').value = ''; qr.clearQRAfterPosting(); postCommon.clearSelectedFiles(); document.getElementById('footer').scrollIntoView(); if (!thread.autoRefresh || !thread.socket) { thread.refreshPosts(true); } } else { alert(status + ': ' + JSON.stringify(data)); } }; thread.replyCallback.stop = function() { thread.replyButton.value = thread.originalButtonText; qr.setQRReplyText(thread.originalButtonText); thread.replyButton.disabled = false; qr.setQRReplyEnabled(true); }; thread.replyCallback.progress = function(info) { if (info.lengthComputable) { var newText = 'Uploading ' + Math.floor((info.loaded / info.total) * 100) + '%'; thread.replyButton.value = newText; qr.setQRReplyText(newText); } };