nodebb-theme-harmony 2.2.69 → 2.2.71

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.
@@ -2,8 +2,8 @@
2
2
 
3
3
  const Controllers = module.exports;
4
4
 
5
- const accountHelpers = require.main.require('./src/controllers/accounts/helpers');
6
- const helpers = require.main.require('./src/controllers/helpers');
5
+ const accountHelpers = nodebb.require('./src/controllers/accounts/helpers');
6
+ const helpers = nodebb.require('./src/controllers/helpers');
7
7
 
8
8
  Controllers.renderAdminPage = (req, res) => {
9
9
  res.render('admin/plugins/harmony', {
package/library.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const nconf = require.main.require('nconf');
4
- const meta = require.main.require('./src/meta');
5
- const _ = require.main.require('lodash');
6
- const user = require.main.require('./src/user');
3
+ const nconf = nodebb.require('nconf');
4
+ const meta = nodebb.require('./src/meta');
5
+ const _ = nodebb.require('lodash');
6
+ const user = nodebb.require('./src/user');
7
7
 
8
8
  const controllers = require('./lib/controllers');
9
9
 
@@ -24,7 +24,7 @@ const defaults = {
24
24
 
25
25
  library.init = async function (params) {
26
26
  const { router, middleware } = params;
27
- const routeHelpers = require.main.require('./src/routes/helpers');
27
+ const routeHelpers = nodebb.require('./src/routes/helpers');
28
28
 
29
29
  routeHelpers.setupAdminPageRoute(router, '/admin/plugins/harmony', [], controllers.renderAdminPage);
30
30
 
@@ -42,13 +42,13 @@ library.init = async function (params) {
42
42
 
43
43
  async function buildSkins() {
44
44
  try {
45
- const plugins = require.main.require('./src/plugins');
45
+ const plugins = nodebb.require('./src/plugins');
46
46
  await plugins.prepareForBuild(['client side styles']);
47
47
  for (const skin of meta.css.supportedSkins) {
48
48
  // eslint-disable-next-line no-await-in-loop
49
49
  await meta.css.buildBundle(`client-${skin}`, true);
50
50
  }
51
- require.main.require('./src/meta/minifier').killAll();
51
+ nodebb.require('./src/meta/minifier').killAll();
52
52
  } catch (err) {
53
53
  console.error(err.stack);
54
54
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "nodebb-theme-harmony",
3
- "version": "2.2.69",
3
+ "version": "2.2.71",
4
4
  "nbbpm": {
5
- "compatibility": "^4.0.0"
5
+ "compatibility": "^4.12.0"
6
6
  },
7
7
  "description": "Harmony theme for NodeBB",
8
8
  "main": "library.js",
@@ -45,7 +45,7 @@
45
45
  "@fontsource/poppins": "5.2.7"
46
46
  },
47
47
  "devDependencies": {
48
- "eslint": "10.4.0",
49
- "eslint-config-nodebb": "^2.0.0"
48
+ "eslint": "10.4.1",
49
+ "eslint-config-nodebb": "^2.0.2"
50
50
  }
51
51
  }
package/public/admin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  define('admin/plugins/harmony', ['settings'], function (Settings) {
4
- var ACP = {};
4
+ const ACP = {};
5
5
 
6
6
  ACP.init = function () {
7
7
  Settings.load('harmony', $('.harmony-settings'));
@@ -36,7 +36,7 @@
36
36
  {{{ end }}}
37
37
  {{{ if ./handleFull }}}
38
38
  <p class="text-secondary text-sm fst-italic mb-0 {{{ if config.theme.centerHeaderElements }}}text-center{{{ end }}}">
39
- [[category:handle.description, {handleFull}]]
39
+ [[category:handle.description, {txEscape(handleFull)}]]
40
40
  <a href="#" class="link-secondary" data-action="copy" data-clipboard-text="{handleFull}"><i class="fa fa-fw fa-copy" aria-hidden="true"></i></a>
41
41
  </p>
42
42
  {{{ end }}}
@@ -1,7 +1,7 @@
1
1
  {{{ each groups }}}
2
2
  <div class="col-xl-4 col-lg-6 col-sm-12 mb-3" component="groups/summary" data-slug="{./slug}">
3
3
  <div class="card h-100 group-hover-bg border p-1">
4
- <a href="{config.relative_path}/groups/{./slug}" class="card-header border-0 rounded-1 pointer d-block list-cover" style="{{{ if ./cover:thumb:url }}}background-image: url({./cover:thumb:url});background-size: cover; min-height: 125px; background-position: {./cover:position}{{{ end }}}" aria-label="[[aria:group-page-link-for, {./displayName}]]"></a>
4
+ <a href="{config.relative_path}/groups/{./slug}" class="card-header border-0 rounded-1 pointer d-block list-cover" style="{{{ if ./cover:thumb:url }}}background-image: url({./cover:thumb:url});background-size: cover; min-height: 125px; background-position: {./cover:position}{{{ end }}}" aria-label="[[aria:group-page-link-for, {txEscape(./displayName)}]]"></a>
5
5
  <a href="{config.relative_path}/groups/{./slug}" class="d-block h-100 text-reset text-decoration-none">
6
6
  <div class="card-body d-flex flex-column gap-2 h-100 pb-2">
7
7
  <div class="d-flex">
@@ -1,5 +1,6 @@
1
1
  {{{ if matchCount }}}
2
- <div class="card card-header text-xs px-2 py-1 fw-semibold border-0 align-self-start">[[search:results-matching, {matchCount}, {search_query}, {time}]] </div>
2
+ <div class="card card-header text-xs px-2 py-1 fw-semibold border-0 align-self-start">[[search:results-matching, {matchCount}, {txEscape(search_query)}, {time}]]
3
+ </div>
3
4
  {{{ else }}}
4
5
  {{{ if search_query }}}
5
6
  <div class="badge text-bg-warning align-self-start">[[search:no-matches]]</div>
@@ -35,11 +35,11 @@
35
35
  {{{ end }}}
36
36
 
37
37
  {{{ if (./action == "posts.reply") }}}
38
- <div class="text text-xs fw-semibold line-clamp-2 text-break">[[topic:composer.replying-to, "{./title}"]]</div>
38
+ <div class="text text-xs fw-semibold line-clamp-2 text-break">[[topic:composer.replying-to, "{txEscape(./title)}"]]</div>
39
39
  {{{ end }}}
40
40
 
41
41
  {{{ if (./action == "posts.edit") }}}
42
- <div class="text text-xs fw-semibold line-clamp-2">[[topic:composer.editing-in, "{./title}"]]</div>
42
+ <div class="text text-xs fw-semibold line-clamp-2">[[topic:composer.editing-in, "{txEscape(./title)}"]]</div>
43
43
  {{{ end }}}
44
44
 
45
45
  {{{ if ./text }}}