@okjavis/nodebb-theme-javis 2.5.2 → 2.5.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": "@okjavis/nodebb-theme-javis",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "Modern, premium NodeBB theme for JAVIS Community - Extends Harmony with custom styling",
5
5
  "main": "theme.js",
6
6
  "scripts": {
@@ -34,6 +34,7 @@
34
34
  "scss/",
35
35
  "static/",
36
36
  "templates/",
37
+ "public/",
37
38
  "theme.js",
38
39
  "theme.scss",
39
40
  "theme.json",
package/plugin.json CHANGED
@@ -9,8 +9,7 @@
9
9
  { "hook": "static:app.load", "method": "init" },
10
10
  { "hook": "filter:widgets.getAreas", "method": "defineWidgetAreas" },
11
11
  { "hook": "filter:admin.header.build", "method": "addAdminNavigation" },
12
- { "hook": "filter:config.get", "method": "getThemeConfig" },
13
- { "hook": "filter:settings.get", "method": "getAdminSettings" }
12
+ { "hook": "filter:config.get", "method": "getThemeConfig" }
14
13
  ],
15
14
  "staticDirs": {
16
15
  "static": "./static"
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ define('admin/plugins/javis', ['settings'], function (Settings) {
4
+ var ACP = {};
5
+
6
+ ACP.init = function () {
7
+ // Load settings from 'harmony' key for compatibility with parent theme
8
+ Settings.load('harmony', $('.javis-settings'));
9
+
10
+ $('#save').on('click', function () {
11
+ // Save to 'harmony' key for compatibility
12
+ Settings.save('harmony', $('.javis-settings'));
13
+ });
14
+ };
15
+
16
+ return ACP;
17
+ });
package/theme.js CHANGED
@@ -9,11 +9,9 @@ const meta = require.main.require('./src/meta');
9
9
  const user = require.main.require('./src/user');
10
10
  const _ = require.main.require('lodash');
11
11
 
12
- const controllers = require('./lib/controllers');
13
-
14
12
  const theme = {};
15
13
 
16
- // JAVIS defaults - openSidebars is 'on' by default
14
+ // Harmony's defaults - we override openSidebars to 'on'
17
15
  const defaults = {
18
16
  enableQuickReply: 'on',
19
17
  enableBreadcrumbs: 'on',
@@ -35,24 +33,24 @@ theme.init = async function (params) {
35
33
  const { router } = params;
36
34
  const routeHelpers = require.main.require('./src/routes/helpers');
37
35
 
38
- // Admin panel route
39
- routeHelpers.setupAdminPageRoute(router, '/admin/plugins/javis', [], controllers.renderAdminPage);
36
+ // Admin panel route - render using Harmony's admin template structure
37
+ routeHelpers.setupAdminPageRoute(router, '/admin/plugins/javis', [], (req, res) => {
38
+ res.render('admin/plugins/javis', {
39
+ title: 'JAVIS Theme',
40
+ });
41
+ });
40
42
  };
41
43
 
42
44
  /**
43
- * Load theme config
45
+ * Load theme config - replaces Harmony's loadThemeConfig
44
46
  * Uses JAVIS defaults (with openSidebars: 'on')
45
47
  */
46
48
  async function loadThemeConfig(uid) {
47
- const [harmonyConfig, javisConfig, userConfig] = await Promise.all([
48
- meta.settings.get('harmony'), // Read from Harmony's settings (parent theme)
49
- meta.settings.get('javis'), // Read from JAVIS-specific settings
49
+ const [themeConfig, userConfig] = await Promise.all([
50
+ meta.settings.get('harmony'),
50
51
  user.getSettings(uid),
51
52
  ]);
52
53
 
53
- // Merge: Harmony settings first, then JAVIS overrides
54
- const themeConfig = { ...harmonyConfig, ...javisConfig };
55
-
56
54
  // 3-tier cascade: JAVIS defaults -> theme settings -> user settings
57
55
  const config = { ...defaults, ...themeConfig, ...(_.pick(userConfig, Object.keys(defaults))) };
58
56
 
@@ -71,9 +69,6 @@ async function loadThemeConfig(uid) {
71
69
  return config;
72
70
  }
73
71
 
74
- // Export loadThemeConfig for potential use by other modules
75
- theme.loadThemeConfig = loadThemeConfig;
76
-
77
72
  /**
78
73
  * Hook: filter:config.get
79
74
  * Sets config.theme with JAVIS-specific defaults
@@ -84,20 +79,6 @@ theme.getThemeConfig = async function (config) {
84
79
  return config;
85
80
  };
86
81
 
87
- /**
88
- * Hook: filter:settings.get
89
- * Provide default values for admin settings
90
- */
91
- theme.getAdminSettings = async function (hookData) {
92
- if (hookData.plugin === 'javis') {
93
- hookData.values = {
94
- ...defaults,
95
- ...hookData.values,
96
- };
97
- }
98
- return hookData;
99
- };
100
-
101
82
  theme.defineWidgetAreas = async (areas) => {
102
83
  // Define widget areas like Harmony does
103
84
  const locations = ['header', 'sidebar', 'footer'];