mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 01:10:31 +01:00
socket logic for #1149 -- handling of help tab in ACP
This commit is contained in:
@@ -819,7 +819,7 @@ define(['taskbar'], function(taskbar) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.emit('modules.composer.renderHelp', function(err, html) {
|
socket.emit('modules.composer.renderHelp', function(err, html) {
|
||||||
if (html && html.length > 0) {
|
if (!err && html && html.length > 0) {
|
||||||
postContainer.find('.help').html(html);
|
postContainer.find('.help').html(html);
|
||||||
postContainer.find('[data-pane=".tab-help"]').parent().removeClass('hidden');
|
postContainer.find('[data-pane=".tab-help"]').parent().removeClass('hidden');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,19 @@ SocketModules.composer.renderPreview = function(socket, content, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SocketModules.composer.renderHelp = function(socket, data, callback) {
|
SocketModules.composer.renderHelp = function(socket, data, callback) {
|
||||||
plugins.fireHook('filter:composer.help', '', callback);
|
var helpText = meta.config['composer:customHelpText'] || '';
|
||||||
|
|
||||||
|
if (meta.config['composer:showHelpTab'] === '0') {
|
||||||
|
return callback(new Error('help-hidden'));
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins.fireHook('filter:post.parse', helpText, function(err, helpText) {
|
||||||
|
if (!meta.config['composer:allowPluginHelp'] || meta.config['composer:allowPluginHelp'] === '1') {
|
||||||
|
plugins.fireHook('filter:composer.help', helpText, callback);
|
||||||
|
} else {
|
||||||
|
callback(null, helpText);
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketModules.composer.register = function(socket, data) {
|
SocketModules.composer.register = function(socket, data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user