diff --git a/gulp/res/js/forms.js b/gulp/res/js/forms.js index e6bf8d56..8bc921bc 100644 --- a/gulp/res/js/forms.js +++ b/gulp/res/js/forms.js @@ -176,6 +176,9 @@ class formHandler { } else { if (json.message || json.messages || json.error || json.errors) { doModal(json); + if (json.message === 'Incorrect captcha answer') { + //todo: create captcha form, add method to captcha frontend code + } } else if (socket && socket.connected) { window.myPostId = json.postId; window.location.hash = json.postId diff --git a/gulp/res/js/live.js b/gulp/res/js/live.js index 99a5fbcb..3da8db48 100644 --- a/gulp/res/js/live.js +++ b/gulp/res/js/live.js @@ -30,7 +30,7 @@ window.addEventListener('settingsReady', function(event) { //after domcontentloa lastPostId = data.postId; const postData = data; //create a new post - const postHtml = post({ post: postData, modview:isModView }); + const postHtml = post({ post: postData, modview:isModView, upLevel:isThread }); //add it to the end of the thread thread.insertAdjacentHTML('beforeend', postHtml); for (let j = 0; j < postData.quotes.length; j++) { @@ -42,14 +42,12 @@ window.addEventListener('settingsReady', function(event) { //after domcontentloa const quotedPostData = quotedPost.querySelector('.post-data'); const newRepliesDiv = document.createElement('div'); newRepliesDiv.textContent = 'Replies: '; - ['replies', 'mt-5', 'ml-5'].forEach(c => { - newRepliesDiv.classList.add(c); - }); + newRepliesDiv.classList.add('replies', 'mt-5', 'ml-5'); quotedPostData.appendChild(newRepliesDiv); replies = newRepliesDiv; } if (new RegExp(`>>${postData.postId}(\s|$)`).test(replies.innerText)) { - //reply link already exists (probably from a late catch up + //reply link already exists (probably from a late catch up) continue; } const newReply = document.createElement('a'); diff --git a/gulpfile.js b/gulpfile.js index e197c6c3..648e10ae 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -208,6 +208,8 @@ function scripts() { `${paths.scripts.src}/post.js`, `${paths.scripts.src}/settings.js`, `${paths.scripts.src}/live.js`, + `${paths.scripts.src}/captcha.js`, + `${paths.scripts.src}/forms.js`, `${paths.scripts.src}/*.js`, `!${paths.scripts.src}/dragable.js`, `!${paths.scripts.src}/hide.js`,