Skip to content

Commit 4e78337

Browse files
authored
Merge pull request #28 from nii236/master
allow batch uploads of images
2 parents 8609dbe + d37d951 commit 4e78337

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Binaries for programs and plugins
2+
rwtxt
23
*.exe
34
*.exe~
45
*.dll

static/js/rwtxt.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,18 @@ function onUploadFinished(file) {
229229
file.xhr.getResponseHeader("Location") +
230230
')';
231231

232+
var newLine = "\n"
232233
document.getElementById("editable").value = (
233234
textBefore +
234-
extraText +
235+
extraText +
236+
newLine +
235237
textAfter
236238
);
237239

240+
console.log("SELECT LINK")
238241
// Select the newly-inserted link
239-
document.getElementById("editable").selectionStart = cursorPos;
240-
document.getElementById("editable").selectionEnd = cursorPos + extraText.length;
242+
document.getElementById("editable").selectionStart = cursorPos + extraText.length + newLine.length;
243+
document.getElementById("editable").selectionEnd = cursorPos + extraText.length + newLine.length;
241244
// expand textarea
242245
autoExpand(document.getElementById("editable"));
243246
// trigger a save

0 commit comments

Comments
 (0)