Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.

Commit

Permalink
Add composer button and add formatting on composer.enhanced event
Browse files Browse the repository at this point in the history
  • Loading branch information
frissdiegurke committed Apr 27, 2016
1 parent d546d34 commit 668d4ca
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .meta.json
@@ -1,3 +1,3 @@
{
"build": 1234
"build": 1238
}
2 changes: 1 addition & 1 deletion lib/composer.js
Expand Up @@ -4,7 +4,7 @@ let settings = require("./settings");
let setsCtrl = require("./sets/controller");

const FORMATTING = [
{name: settings.id, className: "fa fa-smile-o"}
{name: settings.id, className: "fa fa-smile-o", title: "[[" + settings.iD + ":composer.title]]"}
];

let __push = Array.prototype.push;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "nodebb-plugin-emoji-extended",
"version": "1.1.0+@{build}",
"version": "1.1.1+@{build}",
"description": "Adds extended functionality of Emoji into NodeBB",
"main": "lib/controller.js",
"author": "Ole Reglitzki <frissdiegurke@protonmail.com> (https://github.com/frissdiegurke)",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en_US/@{iD}.json
@@ -1,6 +1,7 @@
{
"name": "@{nbbpm.name}",
"version": "@{>version}",
"composer.title": "Emoji",
"modal.title": "Available Emoticons",
"modal.legal": "Legal Information",
"modal.legal.header": "The images used belong to different image <em>sets</em>. Which set an image belongs to is stated within the <code>data-set-id</code> HTML attribute.",
Expand Down
10 changes: 6 additions & 4 deletions public/scripts/composer/button.js
@@ -1,9 +1,11 @@
require(["composer/formatting"], function (composer) {
$(window).on("action:composer.enhanced", function () {
"use strict";

composer.addButtonDispatch("@{id}", function (textarea, selectionStart, selectionEnd) {
require(["@{type.name}/@{id}/composer/modal"], function (modal) {
modal.openAndInsert(textarea, selectionStart, selectionEnd);
require(["composer/formatting"], function (composer) {
composer.addButtonDispatch("@{id}", function (textarea, selectionStart, selectionEnd) {
require(["@{type.name}/@{id}/composer/modal"], function (modal) {
modal.openAndInsert(textarea, selectionStart, selectionEnd);
});
});
});
});

1 comment on commit 668d4ca

@barisusakli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change included in a release? When I disable emoji extended this error seems to go away NodeBB/NodeBB#4709

Please sign in to comment.