Skip to content

Instantly share code, notes, and snippets.

@PAEz
Last active August 29, 2015 14:27
Show Gist options
  • Save PAEz/886790c8ee15d78b1338 to your computer and use it in GitHub Desktop.
Save PAEz/886790c8ee15d78b1338 to your computer and use it in GitHub Desktop.
Plugin sockets with NodeBB 0.7.x
function callBack(config) {
Katex.dollarInline = config.dollarInline;
deferred.resolve(config);
}
// do the async call to the socket.
socket.emit('plugins.Katex.getConfig', callBack);
The gists to plugin sockets with NodeBB 0.7.x
Getting settings/values from the server to the client.
https://community.nodebb.org/topic/5936/retrieve-setting-value-from-the-client-side
var PluginSocket = require.main.require('./src/socket.io/plugins');
PluginSocket.Katex = {};
PluginSocket.Katex.getConfig = function (socket, callback) {
var data = {
dollarInline: _self.config.dollarInline,
};
callback(data);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment