Skip to content

Commit

Permalink
allow batch uploads of images
Browse files Browse the repository at this point in the history
  • Loading branch information
nii236 committed Jan 26, 2019
1 parent 8609dbe commit d37d951
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 d37d951

Please sign in to comment.