nodebb-plugin-composer-default 10.0.43 → 10.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -130,7 +130,7 @@ define('composer/uploads', [
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
var filenameMapping = [];
|
|
133
|
-
|
|
133
|
+
let filesText = '';
|
|
134
134
|
for (i = 0; i < files.length; ++i) {
|
|
135
135
|
// The filename map has datetime and iterator prepended so that they can be properly tracked even if the
|
|
136
136
|
// filenames are identical.
|
|
@@ -141,9 +141,13 @@ define('composer/uploads', [
|
|
|
141
141
|
uploadForm[0].reset();
|
|
142
142
|
return alerts.error('[[error:file-too-big, ' + config.maximumFileSize + ']]');
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
text = insertText(text, textarea.getCursorPosition(), (isImage ? '!' : '') + '[' + filenameMapping[i] + '](' + uploadingText + ') ');
|
|
144
|
+
filesText += (isImage ? '!' : '') + '[' + filenameMapping[i] + '](' + uploadingText + ') ';
|
|
146
145
|
}
|
|
146
|
+
|
|
147
|
+
const cursorPosition = textarea.getCursorPosition();
|
|
148
|
+
const textLen = text.length;
|
|
149
|
+
text = insertText(text, cursorPosition, filesText);
|
|
150
|
+
|
|
147
151
|
if (uploadForm.length) {
|
|
148
152
|
postContainer.find('[data-action="post"]').prop('disabled', true);
|
|
149
153
|
}
|
|
@@ -225,7 +229,7 @@ define('composer/uploads', [
|
|
|
225
229
|
}
|
|
226
230
|
}
|
|
227
231
|
preview.render(postContainer);
|
|
228
|
-
textarea.
|
|
232
|
+
textarea.selectRange(cursorPosition + textarea.val().length - textLen);
|
|
229
233
|
postContainer.find('[data-action="post"]').prop('disabled', false);
|
|
230
234
|
$(window).trigger('action:composer.upload', {
|
|
231
235
|
post_uuid: post_uuid,
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<span class="sr-only">[[topic:composer.additional-options]]</span>
|
|
34
34
|
</button>
|
|
35
35
|
<ul class="dropdown-menu dropdown-menu-end">
|
|
36
|
-
<li><a class="dropdown-item display-scheduler ">
|
|
36
|
+
<li><a class="dropdown-item display-scheduler ">[[topic:composer.post-later]]</a></li>
|
|
37
37
|
{{{ each submitOptions }}}
|
|
38
38
|
<li><a class="dropdown-item" href="#" data-action="{./action}">{./text}</a></li>
|
|
39
39
|
{{{ end }}}</ul>
|