nodebb-theme-peace
Advanced tools
Comparing version 2.0.6 to 2.0.7
@@ -12,2 +12,5 @@ 'use strict'; | ||
const routeHelpers = require.main.require('./src/routes/helpers'); | ||
routeHelpers.setupAdminPageRoute(params.router, '/admin/plugins/peace', function (req, res, next) { | ||
res.render('admin/plugins/peace', {}); | ||
}); | ||
}; | ||
@@ -46,3 +49,3 @@ | ||
library.addUserToTopic = async function (hookData) { | ||
library.filterTopicBuild = async function (hookData) { | ||
if (hookData.req.user) { | ||
@@ -63,2 +66,17 @@ const userData = await user.getUserData(hookData.req.user.uid); | ||
library.filterConfigGet = async function (config) { | ||
const settings = await meta.settings.get('peace'); | ||
config.enableQuickReply = settings.enableQuickReply === 'on'; | ||
return config; | ||
}; | ||
library.addAdminNavigation = async function (header) { | ||
header.plugins.push({ | ||
route: '/plugins/peace', | ||
icon: 'fa-paint-brush', | ||
name: 'Peace Theme' | ||
}); | ||
return header; | ||
}; | ||
library.filterMiddlewareRenderHeader = async function (hookData) { | ||
@@ -65,0 +83,0 @@ const userSettings = await user.getSettings(hookData.req.uid); |
{ | ||
"name": "nodebb-theme-peace", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"nbbpm": { | ||
@@ -5,0 +5,0 @@ "compatibility": "^3.0.0" |
@@ -6,8 +6,14 @@ { | ||
{ "hook": "filter:widgets.getAreas", "method": "defineWidgetAreas" }, | ||
{ "hook": "filter:topic.build", "method": "addUserToTopic" }, | ||
{ "hook": "filter:middleware.renderHeader", "method": "filterMiddlewareRenderHeader" } | ||
{ "hook": "filter:config.get", "method": "filterConfigGet" }, | ||
{ "hook": "filter:topic.build", "method": "filterTopicBuild" }, | ||
{ "hook": "filter:middleware.renderHeader", "method": "filterMiddlewareRenderHeader" }, | ||
{ "hook": "filter:admin.header.build", "method": "addAdminNavigation" } | ||
], | ||
"scripts": [ | ||
"public/peace.js" | ||
] | ||
], | ||
"modules": { | ||
"../admin/plugins/peace.js": "public/admin.js", | ||
"persona/quickreply.js": "../nodebb-theme-persona/public/modules/quickreply.js" | ||
} | ||
} |
@@ -7,2 +7,4 @@ "use strict"; | ||
setupNProgress(); | ||
setupQuickReply(); | ||
$('[component="skinSwitcher"]').on('click', '.dropdown-item', function () { | ||
@@ -68,2 +70,16 @@ const skin = $(this).attr('data-value'); | ||
} | ||
function setupQuickReply() { | ||
$(window).on('action:ajaxify.end', function (ev, data) { | ||
if (data.url && data.url.match('^topic/')) { | ||
if (config.enableQuickReply) { | ||
require(['persona/quickreply'], function (quickreply) { | ||
if (quickreply) { | ||
quickreply.init(); | ||
} | ||
}); | ||
} | ||
} | ||
}); | ||
} | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7441280
63
201
5