From d37d951dabec98793b07c383a20bcc1492376fff Mon Sep 17 00:00:00 2001 From: John Nguyen Date: Sat, 26 Jan 2019 12:24:30 +0800 Subject: [PATCH] allow batch uploads of images --- .gitignore | 1 + static/js/rwtxt.js | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5ddb6e7..90e2325 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Binaries for programs and plugins +rwtxt *.exe *.exe~ *.dll diff --git a/static/js/rwtxt.js b/static/js/rwtxt.js index 532664a..86ebbf9 100644 --- a/static/js/rwtxt.js +++ b/static/js/rwtxt.js @@ -229,15 +229,18 @@ function onUploadFinished(file) { file.xhr.getResponseHeader("Location") + ')'; + var newLine = "\n" document.getElementById("editable").value = ( textBefore + - extraText + + extraText + + newLine + textAfter ); + console.log("SELECT LINK") // Select the newly-inserted link - document.getElementById("editable").selectionStart = cursorPos; - document.getElementById("editable").selectionEnd = cursorPos + extraText.length; + document.getElementById("editable").selectionStart = cursorPos + extraText.length + newLine.length; + document.getElementById("editable").selectionEnd = cursorPos + extraText.length + newLine.length; // expand textarea autoExpand(document.getElementById("editable")); // trigger a save