nodebb-theme-harmony 2.2.70 → 2.2.72

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.70",
3
+ "version": "2.2.72",
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",
@@ -46,6 +46,6 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "eslint": "10.4.1",
49
- "eslint-config-nodebb": "^2.0.0"
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'));
@@ -1,5 +1,5 @@
1
1
  <div component="groups/container" class="groups details flex-fill">
2
- <div class="cover position-absolute start-0 top-0" component="groups/cover" style="background-image: url({group.cover:url}?{config.cache-buster}); background-position: {group.cover:position};">
2
+ <div class="cover position-absolute start-0 top-0" component="groups/cover" style="background-image: url({escape(group.cover:url)}?{config.cache-buster}); background-position: {group.cover:position};">
3
3
  <div class="container">
4
4
  {{{ if group.isOwner }}}
5
5
  <div class="controls text-center">
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
  <div class="d-flex gap-2 align-items-start">
30
30
  {{{ if loggedIn }}}
31
- {function.membershipBtn, group}
31
+ {membershipBtn(group)}
32
32
  {{{ end }}}
33
33
  {{{ if isAdmin }}}
34
34
  <a href="{config.relative_path}/admin/manage/groups/{group.slug}" target="_blank" class="btn btn-light text-nowrap"><i class="fa fa-gear"></i> [[user:edit]]</a>
@@ -1,10 +1,10 @@
1
1
  <!DOCTYPE html>
2
- <html lang="{function.localeToHTML, userLang, defaultLang}" {{{if languageDirection}}}data-dir="{languageDirection}" style="direction: {languageDirection};"{{{end}}}>
2
+ <html lang="{localeToHTML(userLang, defaultLang)}" {{{if languageDirection}}}data-dir="{languageDirection}" style="direction: {languageDirection};"{{{end}}}>
3
3
  <head>
4
4
  <title>{browserTitle}</title>
5
- {{{each metaTags}}}{function.buildMetaTag}{{{end}}}
5
+ {{{each metaTags}}}{buildMetaTag(@value)}{{{end}}}
6
6
  <link rel="stylesheet" type="text/css" href="{relative_path}/assets/client{{{if bootswatchSkin}}}-{bootswatchSkin}{{{end}}}{{{ if (languageDirection=="rtl") }}}-rtl{{{ end }}}.css?{config.cache-buster}" />
7
- {{{each linkTags}}}{function.buildLinkTag}{{{end}}}
7
+ {{{each linkTags}}}{buildLinkTag(@value)}{{{end}}}
8
8
 
9
9
  <script>
10
10
  var config = JSON.parse('{{configJSON}}');
@@ -1,8 +1,7 @@
1
1
  <div class="account w-100 mx-auto">
2
- <div class="cover position-absolute start-0 top-0 w-100" component="account/cover" style="background-image: url({cover:url}); background-position: {cover:position};">
2
+ <div class="cover position-absolute start-0 top-0 w-100" component="account/cover" style="background-image: url({escape(cover:url)}); background-position: {cover:position};">
3
3
  <div class="container">
4
- {{{ if allowCoverPicture }}}
5
- {{{ if canEdit }}}
4
+ {{{ if (allowCoverPicture && canEdit) }}}
6
5
  <div class="controls text-center">
7
6
  <a href="#" class="upload p-2 m-2 rounded-1 text-bg-light opacity-75"><i class="fa fa-fw fa-upload"></i></a>
8
7
  <a href="#" class="resize p-2 m-2 rounded-1 text-bg-light opacity-75"><i class="fa fa-fw fa-arrows"></i></a>
@@ -11,7 +10,6 @@
11
10
  <a href="#" class="save btn btn-primary">[[groups:cover-save]] <i class="fa fa-fw fa-floppy-o"></i></a>
12
11
  <div class="indicator text-bg-primary">[[groups:cover-saving]] <i class="fa fa-fw fa-refresh fa-spin"></i></div>
13
12
  {{{ end }}}
14
- {{{ end }}}
15
13
  </div>
16
14
  </div>
17
15
 
@@ -6,13 +6,13 @@
6
6
  <button class="btn btn-sm btn-outline-secondary" type="button" data-action="revokeSession">[[user:revoke-session]]</button>
7
7
  {{{ end }}}
8
8
  {{{ end }}}
9
- {function.userAgentIcons}
9
+ {userAgentIcons(@value)}
10
10
  <i class="fa fa-circle text-{{{ if ./current }}}success{{{ else }}}muted{{{ end }}}"></i>
11
11
  </div>
12
12
  [[user:browser-version-on-platform, {./browser}, {./version}, {./platform}]]<br />
13
- <small class="timeago text-muted" title="{../datetimeISO}"></small>
13
+ <small class="timeago text-muted" title="{./datetimeISO}"></small>
14
14
  <ul>
15
- <li><strong>[[global:ip-address]]</strong>: {../ip}</li>
15
+ <li><strong>[[global:ip-address]]</strong>: {./ip}</li>
16
16
  </ul>
17
17
  </li>
18
18
  {{{ end }}}
@@ -1,9 +1,9 @@
1
1
  <ul component="category" class="topics-list list-unstyled" itemscope itemtype="http://www.schema.org/ItemList" data-nextstart="{nextStart}" data-set="{set}">
2
2
 
3
3
  {{{ each topics }}}
4
- <li component="category/topic" class="category-item hover-parent border-bottom py-3 py-lg-4 d-flex flex-column flex-lg-row align-items-start {function.generateTopicClass}" <!-- IMPORT partials/data/category.tpl -->>
4
+ <li component="category/topic" class="category-item hover-parent border-bottom py-3 py-lg-4 d-flex flex-column flex-lg-row align-items-start {generateTopicClass(@value)}" <!-- IMPORT partials/data/category.tpl -->>
5
5
  <link itemprop="url" content="{config.relative_path}/topic/{./slug}" />
6
- <meta itemprop="name" content="{function.stripTags, ./title}" />
6
+ <meta itemprop="name" content="{stripTags(./title)}" />
7
7
  <meta itemprop="itemListOrder" content="descending" />
8
8
  <meta itemprop="position" content="{increment(./index, "1")}" />
9
9
  <a id="{./index}" data-index="{./index}" component="topic/anchor"></a>