nodebb-plugin-composer-default 11.0.1 → 11.0.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": "11.0.1",
3
+ "version": "11.0.3",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -117,7 +117,7 @@ define('composer/formatting', [
117
117
  function generateBadgetHtml(btn) {
118
118
  let badgeHtml = '';
119
119
  if (btn.badge) {
120
- badgeHtml = `<span class="px-1 position-absolute top-0 start-100 translate-middle badge rounded text-bg-info"></span>`;
120
+ badgeHtml = `<span class="px-1 position-absolute top-0 start-100 translate-middle-x badge rounded text-bg-info"></span>`;
121
121
  }
122
122
  return badgeHtml;
123
123
  }
@@ -686,15 +686,15 @@ define('composer', [
686
686
 
687
687
  if (uploads.inProgress[post_uuid] && uploads.inProgress[post_uuid].length) {
688
688
  return composerAlert(post_uuid, '[[error:still-uploading]]');
689
- } else if (checkTitle && payload.titleLen < parseInt(config.minimumTitleLength, 10)) {
689
+ } else if (!app.user.isAdmin && checkTitle && payload.titleLen < parseInt(config.minimumTitleLength, 10)) {
690
690
  return composerAlert(post_uuid, '[[error:title-too-short, ' + config.minimumTitleLength + ']]');
691
- } else if (checkTitle && payload.titleLen > parseInt(config.maximumTitleLength, 10)) {
691
+ } else if (!app.user.isAdmin && checkTitle && payload.titleLen > parseInt(config.maximumTitleLength, 10)) {
692
692
  return composerAlert(post_uuid, '[[error:title-too-long, ' + config.maximumTitleLength + ']]');
693
693
  } else if (action === 'topics.post' && !isCategorySelected) {
694
694
  return composerAlert(post_uuid, '[[error:category-not-selected]]');
695
- } else if (payload.bodyLen < parseInt(config.minimumPostLength, 10)) {
695
+ } else if (!app.user.isAdmin && payload.bodyLen < parseInt(config.minimumPostLength, 10)) {
696
696
  return composerAlert(post_uuid, '[[error:content-too-short, ' + config.minimumPostLength + ']]');
697
- } else if (payload.bodyLen > parseInt(config.maximumPostLength, 10)) {
697
+ } else if (!app.user.isAdmin && payload.bodyLen > parseInt(config.maximumPostLength, 10)) {
698
698
  return composerAlert(post_uuid, '[[error:content-too-long, ' + config.maximumPostLength + ']]');
699
699
  } else if (checkTitle && !tags.isEnoughTags(post_uuid)) {
700
700
  return composerAlert(post_uuid, '[[error:not-enough-tags, ' + tags.minTagCount() + ']]');
@@ -369,12 +369,9 @@
369
369
  }
370
370
  }
371
371
 
372
- @include media-breakpoint-up(md) {
373
- // without this formatting elements that are dropdowns are not visible on desktop.
374
- // on mobile dropdowns use bottom-sheet and overflow is auto
375
- .formatting-group {
376
- overflow: visible!important;
377
- }
372
+ // without this formatting elements that are dropdowns are not visible
373
+ .formatting-group:has([aria-expanded="true"]) {
374
+ overflow:visible!important;
378
375
  }
379
376
 
380
377
  @import './zen-mode';
@@ -1,5 +1,5 @@
1
1
  <div class="d-flex justify-content-between gap-2 align-items-center formatting-bar m-0">
2
- <ul class="list-unstyled mb-0 d-flex formatting-group gap-2 overflow-auto">
2
+ <ul class="list-unstyled mb-0 d-flex formatting-group gap-2 overflow-auto ghost-scrollbar" style="min-width: 0;">
3
3
  {{{ each formatting }}}
4
4
  {{{ if ./spacer }}}
5
5
  <li class="small spacer"></li>
@@ -16,7 +16,7 @@
16
16
  <a href="#" data-format="{./name}" class="dropdown-item rounded-1 position-relative" role="menuitem">
17
17
  <i class="{./className} text-secondary"></i> {tx(./text)}
18
18
  {{{ if ./badge }}}
19
- <span class="px-1 position-absolute top-0 start-100 translate-middle badge rounded text-bg-info"></span>
19
+ <span class="px-1 position-absolute top-0 start-100 translate-middle-x badge rounded text-bg-info"></span>
20
20
  {{{ end }}}
21
21
  </a>
22
22
  </li>
@@ -28,7 +28,7 @@
28
28
  <button data-format="{./name}" class="btn btn-sm btn-link text-reset position-relative" aria-label="{tx(./title)}">
29
29
  <i class="{./className}"></i>
30
30
  {{{ if ./badge }}}
31
- <span class="px-1 position-absolute top-0 start-100 translate-middle badge rounded text-bg-info"></span>
31
+ <span class="px-1 position-absolute top-0 start-100 translate-middle-x badge rounded text-bg-info"></span>
32
32
  {{{ end }}}
33
33
  </button>
34
34
  </li>