diff --git a/boards/static/js/form.js b/boards/static/js/form.js --- a/boards/static/js/form.js +++ b/boards/static/js/form.js @@ -88,6 +88,10 @@ function selectFileChoice() { localStorage.setItem(ITEM_FILE_SOURCE, source); } +function getPostTextarea() { + return $('textarea#id_text'); +} + $(document).ready(function() { var powDifficulty = parseInt($('body').attr('data-pow-difficulty')); if (powDifficulty > 0 && typeof SharedWorker != 'undefined') { diff --git a/boards/static/js/panel.js b/boards/static/js/panel.js --- a/boards/static/js/panel.js +++ b/boards/static/js/panel.js @@ -30,7 +30,7 @@ * @param end End (right) text */ function addMarkToMsg(start, end) { - var textareas = $('textarea#id_text'); + var textareas = getPostTextarea(); for (var i = 0; i < textareas.length; i++) { var textarea = textareas[i]; diff --git a/boards/static/js/thread.js b/boards/static/js/thread.js --- a/boards/static/js/thread.js +++ b/boards/static/js/thread.js @@ -68,7 +68,7 @@ function addQuickReply(postId) { resetFormPosition(); } else { var blockToInsert = null; - var textAreaJq = $('textarea#id_text'); + var textAreaJq = getPostTextarea(); var postLinkRaw = '[post]' + postId + '[/post]' var textToAdd = ''; @@ -101,7 +101,7 @@ function addQuickReply(postId) { } function addQuickQuote() { - var textAreaJq = $('textarea#id_text'); + var textAreaJq = getPostTextarea(); var quoteButton = $("#quote-button"); var postId = quoteButton.attr('data-post-id');