nodebb-plugin-composer-default 10.3.1 → 10.3.3
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 +1 -1
- package/static/lib/composer/uploads.js +1 -1
- package/static/lib/composer.js +16 -20
package/package.json
CHANGED
|
@@ -226,7 +226,7 @@ define('composer/uploads', [
|
|
|
226
226
|
'[[error:parse-error]]';
|
|
227
227
|
|
|
228
228
|
if (xhr && xhr.status === 413) {
|
|
229
|
-
msg =
|
|
229
|
+
msg = '[[error:api.413]]';
|
|
230
230
|
}
|
|
231
231
|
alerts.error(msg);
|
|
232
232
|
$(window).trigger('action:composer.uploadError', {
|
package/static/lib/composer.js
CHANGED
|
@@ -52,16 +52,14 @@ define('composer', [
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
composer.posts[composer.active].modified = false;
|
|
55
|
+
composer.discardConfirm = bootbox.confirm('[[modules:composer.discard]]', function (confirm) {
|
|
56
|
+
if (confirm) {
|
|
57
|
+
composer.discard(composer.active);
|
|
58
|
+
} else {
|
|
59
|
+
composer.posts[composer.active].modified = true;
|
|
60
|
+
}
|
|
64
61
|
});
|
|
62
|
+
composer.posts[composer.active].modified = false;
|
|
65
63
|
}
|
|
66
64
|
});
|
|
67
65
|
|
|
@@ -378,15 +376,13 @@ define('composer', [
|
|
|
378
376
|
|
|
379
377
|
formatting.exitFullscreen();
|
|
380
378
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
btn.prop('disabled', false);
|
|
389
|
-
});
|
|
379
|
+
const btn = $(this).prop('disabled', true);
|
|
380
|
+
bootbox.confirm('[[modules:composer.discard]]', function (confirm) {
|
|
381
|
+
if (confirm) {
|
|
382
|
+
composer.discard(post_uuid);
|
|
383
|
+
removeComposerHistory();
|
|
384
|
+
}
|
|
385
|
+
btn.prop('disabled', false);
|
|
390
386
|
});
|
|
391
387
|
});
|
|
392
388
|
|
|
@@ -460,11 +456,11 @@ define('composer', [
|
|
|
460
456
|
var title = postData.title.replace(/%/g, '%').replace(/,/g, ',');
|
|
461
457
|
postData.category = await getSelectedCategory(postData);
|
|
462
458
|
const privileges = postData.category ? postData.category.privileges : ajaxify.data.privileges;
|
|
463
|
-
const topicTemplate = isTopic && postData.category ? postData.category.topicTemplate :
|
|
459
|
+
const topicTemplate = isTopic && postData.category ? postData.category.topicTemplate : '';
|
|
464
460
|
var data = {
|
|
465
461
|
topicTitle: title,
|
|
466
462
|
titleLength: title.length,
|
|
467
|
-
body: translator.escape(utils.escapeHTML(
|
|
463
|
+
body: translator.escape(utils.escapeHTML(postData.body || topicTemplate)),
|
|
468
464
|
mobile: composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm',
|
|
469
465
|
resizable: true,
|
|
470
466
|
thumb: postData.thumb,
|