0.4.1-12 • Published 11 years ago
nodebb-plugin-emoji-extended-openshift v0.4.1-12
nodebb-plugin-emoji-extended
Features
- Emoticons as defined at Emoji cheat sheet
- Emoticons get updated on each server-startup (and each 24d)
- Mapping of texts like
:),;), etc. - Autocomplete for Textarea of emoticons (not for mapped ones)
- Code-blocks get ignored (markdown-syntax)
- API to add textcomplete to other fields (by default parsing posts and chat)
Installation
The preferred way of installing plugins is via your NodeBB Admin-CP since this ensures the compatibility of plugins with you NodeBB version.
Please ensure you don't have nodebb-plugin-emoji enabled since this causes parsing-conflicts.
Deprecated
npm install nodebb-plugin-emoji-extendedClient-Side API (usable by other plugins)
On client-side you have access to the window.emojiExtended object that provides the following attributes:
[Array] listA list of all available emoji-names.[Boolean] updatedWhetheremoji-extended:updatedhas been triggered yet (see below).[String] pathThe folder-URL that contains all image-files.[String] versionThe version-string of emoji-extended.[String] getPath(name)Returns the URL of the image that shows the emoji of given name (case-insensitive).[Promise] readyA promise that gets resolved once emoji-extended got initialized. Gets passed a functionaddTextComplete(target, callback).[null] addCompletion(target, callback)An alias forreadywith forwarding parameters to resolvedaddTextCompletefunction.
Events called on window:
emoji-extended:initializedEmoji-Extended has been initialized,window.emojiExtendedgot created.emoji-extended:updatedData got retrieved from server (window.emojiExtended.listandwindow.emojiExtended.versiongot updated)
In conclusion to use the API of emoji-extended the client-side code within your plugin may look like this:
function doSth(emojiExtended) {
// emoji-extended is initialized, you may use the API here
}
if (typeof window.emojiExtended !== 'undefined')
doSth(window.emojiExtended);
else
$(window).one('emoji-extended:initialized', doSth);