summaryrefslogtreecommitdiffstats
path: root/templates/base
diff options
context:
space:
mode:
authorJohn Olheiser <42128690+jolheiser@users.noreply.github.com>2019-02-16 11:33:09 -0600
committerLauris BH <lauris@nix.lv>2019-02-16 19:33:09 +0200
commit0b72c00fadcacda920893c991cd858a3d6dd52c7 (patch)
treeb198df05a5d275733f2ff2d6c9d2154c0ac0271d /templates/base
parent8c8ac1a16260c075e854bd370812284e0121613e (diff)
downloadgitea-0b72c00fadcacda920893c991cd858a3d6dd52c7.tar.gz
gitea-0b72c00fadcacda920893c991cd858a3d6dd52c7.zip
Allow labels to contain emoji (#6063)
* Add emoji to labels Minor cleanup of tribute code in footer.tmpl Signed-off-by: jolheiser <john.olheiser@gmail.com> * Quick find/replace in other i18n files containing label translations Signed-off-by: jolheiser <john.olheiser@gmail.com> * Revert "Quick find/replace in other i18n files containing label translations" This reverts commit ec3e1a3a1775989301bb2c1cd08e8871b317688d. * Add style to overwrite emoji height in labels * Revert Makefile change that makes Windows work
Diffstat (limited to 'templates/base')
-rw-r--r--templates/base/footer.tmpl18
1 files changed, 14 insertions, 4 deletions
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl
index 6868b918b6..2481b2187c 100644
--- a/templates/base/footer.tmpl
+++ b/templates/base/footer.tmpl
@@ -68,8 +68,11 @@
}
return itemStr;
}
- })
- issuesTribute.attach(document.getElementById('content'))
+ });
+ var content = document.getElementById('content');
+ if (content != null) {
+ issuesTribute.attach(content);
+ }
</script>
<script>
var emojiTribute = new Tribute({
@@ -93,7 +96,7 @@
return item;
},
selectTemplate: function (item) {
- if (typeof item === 'undefinied') return null;
+ if (typeof item === 'undefined') return null;
return ':' + item.original + ':';
},
menuItemTemplate: function (item) {
@@ -101,7 +104,14 @@
}
}]
});
- emojiTribute.attach(document.getElementById('content'))
+ var emojiInputs = document.querySelectorAll('.emoji-input');
+ if (emojiInputs.length > 0) {
+ emojiTribute.attach(emojiInputs);
+ }
+ var content = document.getElementById('content');
+ if (content != null) {
+ emojiTribute.attach(document.getElementById('content'));
+ }
</script>
{{end}}
<script src="{{AppSubUrl}}/vendor/plugins/emojify/emojify.min.js"></script>