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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "10.3.1",
3
+ "version": "10.3.3",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -226,7 +226,7 @@ define('composer/uploads', [
226
226
  '[[error:parse-error]]';
227
227
 
228
228
  if (xhr && xhr.status === 413) {
229
- msg = xhr.statusText || 'Request Entity Too Large';
229
+ msg = '[[error:api.413]]';
230
230
  }
231
231
  alerts.error(msg);
232
232
  $(window).trigger('action:composer.uploadError', {
@@ -52,16 +52,14 @@ define('composer', [
52
52
  return;
53
53
  }
54
54
 
55
- translator.translate('[[modules:composer.discard]]', function (translated) {
56
- composer.discardConfirm = bootbox.confirm(translated, function (confirm) {
57
- if (confirm) {
58
- composer.discard(composer.active);
59
- } else {
60
- composer.posts[composer.active].modified = true;
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
- var btn = $(this).prop('disabled', true);
382
- translator.translate('[[modules:composer.discard]]', function (translated) {
383
- bootbox.confirm(translated, function (confirm) {
384
- if (confirm) {
385
- composer.discard(post_uuid);
386
- removeComposerHistory();
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 : null;
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(topicTemplate || postData.body)),
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,