Skip to content

Commit

Permalink
Merge pull request #28 from nii236/master
Browse files Browse the repository at this point in the history
allow batch uploads of images
  • Loading branch information
schollz authored Jan 26, 2019
2 parents 8609dbe + d37d951 commit 4e78337
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Binaries for programs and plugins
rwtxt
*.exe
*.exe~
*.dll
Expand Down
9 changes: 6 additions & 3 deletions static/js/rwtxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e78337

Please sign in to comment.