Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDillon <dillonzq@outlook.com>2020-04-26 21:27:26 +0300
committerGitHub <noreply@github.com>2020-04-26 21:27:26 +0300
commitb46c81053f7a4307945b82bee6944af7e6e13d1c (patch)
treebd571b2331ed6d4215a1fbd0f924eea617e064b0 /src
parentfc46fba6aa1a747d19c9d0b37b0a26e944cfbba3 (diff)
feat(twemoji): add support for twemoji (#264)
Diffstat (limited to 'src')
-rw-r--r--src/js/theme.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/js/theme.js b/src/js/theme.js
index 0f91b24..bf00f1b 100644
--- a/src/js/theme.js
+++ b/src/js/theme.js
@@ -42,7 +42,7 @@ class Theme {
this.clickMaskEventSet = new Set();
}
- initIcon() {
+ initSVGIcon() {
this.util.forEach(document.querySelectorAll('[data-svg-src]'), $icon => {
fetch($icon.getAttribute('data-svg-src'))
.then(response => response.text())
@@ -58,6 +58,10 @@ class Theme {
});
}
+ initTwemoji() {
+ if (this.config.twemoji) twemoji.parse(document.body);
+ }
+
initMenuMobile() {
const $menuToggleMobile = document.getElementById('menu-toggle-mobile');
const $menuMobile = document.getElementById('menu-mobile');
@@ -638,7 +642,8 @@ class Theme {
}
init() {
- this.initIcon();
+ this.initSVGIcon();
+ this.initTwemoji();
this.initMenuMobile();
this.initSwitchTheme();
this.initSearch();