mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Registering emoji via plugin.rb was broken
This commit is contained in:
parent
d7ffbf9c97
commit
c11f7bee99
1 changed files with 23 additions and 0 deletions
|
@ -264,6 +264,29 @@ JS
|
|||
end
|
||||
end
|
||||
|
||||
if emojis.present?
|
||||
emoji_registrations = ""
|
||||
emojis.each do |name, url|
|
||||
emoji_registrations << "emoji.registerEmoji(#{name.inspect}, #{url.inspect});\n"
|
||||
end
|
||||
|
||||
js << <<~JS
|
||||
define("discourse/initializers/custom-emoji",
|
||||
["pretty-text/emoji", "exports"],
|
||||
function(emoji, __exports__) {
|
||||
"use strict";
|
||||
|
||||
__exports__["default"] = {
|
||||
name: "custom-emoji",
|
||||
after: "inject-objects",
|
||||
initialize: function(container) {
|
||||
#{emoji_registrations}
|
||||
}
|
||||
};
|
||||
});
|
||||
JS
|
||||
end
|
||||
|
||||
# Generate an IIFE for the JS
|
||||
js = "(function(){#{js}})();" if js.present?
|
||||
|
||||
|
|
Loading…
Reference in a new issue