mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
FIX: Registering emoji via plugin.rb was broken
This commit is contained in:
parent
d7ffbf9c97
commit
c11f7bee99
@ -264,6 +264,29 @@ JS
|
|||||||
end
|
end
|
||||||
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
|
# Generate an IIFE for the JS
|
||||||
js = "(function(){#{js}})();" if js.present?
|
js = "(function(){#{js}})();" if js.present?
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user