socket logic for #1149 -- handling of help tab in ACP

v1.18.x
Julian Lam 11 years ago
parent f65998f4c2
commit 65dd79c84e

@ -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) {

Loading…
Cancel
Save