From 99ccd551b6183e9e4fa178ca168ddf12c9aaaa5e Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Sat, 21 Mar 2015 17:23:05 +0100 Subject: [PATCH] Enable by default, except on mobile. Convert by default. --- css/glowingbear.css | 8 ++++---- directives/input.html | 2 +- index.html | 1 + js/glowingbear.js | 18 +----------------- js/inputbar.js | 5 +++++ 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 4b764ef..f90c001 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -541,10 +541,10 @@ li.buffer.indent.private a { .emojione { font-size: inherit; - height: 3ex; - width: 3.1ex; - min-height: 20px; - min-width: 20px; + height: 1em; + width: 1.1em; + min-height: 16px; + min-width: 16px; display: inline-block; margin: -.2ex .15em .2ex; line-height: normal; diff --git a/directives/input.html b/directives/input.html index e373298..afcf580 100644 --- a/directives/input.html +++ b/directives/input.html @@ -1,6 +1,6 @@
- diff --git a/index.html b/index.html index 03aa1f2..b9ce305 100644 --- a/index.html +++ b/index.html @@ -36,6 +36,7 @@ + diff --git a/js/glowingbear.js b/js/glowingbear.js index 210900e..2d1e3f8 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -36,7 +36,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', 'fontsize': '14px', 'fontfamily': (utils.isMobileUi() ? 'sans-serif' : 'Inconsolata, Consolas, Monaco, Ubuntu Mono, monospace'), 'readlineBindings': false, - 'enableJSEmoji': false, + 'enableJSEmoji': (utils.isMobileUi() ? false : true), 'enableMathjax': false, }); $scope.settings = settings; @@ -385,22 +385,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', } }); - // To reduce loading times for users who don't want emojione, - // load it only if the setting is enabled. - // This also fires when the page is loaded. - settings.addCallback('enableJSEmoji', function(enabled) { - if (enabled && !$rootScope.twemoji_init) { - // Load script only once - $rootScope.twemoji_init = true; - (function() { - var script = document.createElement("script"); - script.type = "text/javascript"; - script.src = "//cdn.jsdelivr.net/emojione/1.3.0/lib/js/emojione.min.js"; - document.getElementsByTagName("head")[0].appendChild(script); - })(); - } - }); - // To prevent unnecessary loading times for users who don't // want MathJax, load it only if the setting is enabled. // This also fires when the page is loaded if enabled. diff --git a/js/inputbar.js b/js/inputbar.js index ab4394a..6f6daf0 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -23,6 +23,11 @@ weechat.directive('inputBar', function() { IrcUtils, settings) { + // E.g. Turn :smile: into the unicode equivalent + $scope.inputChanged = function() { + $scope.command = emojione.shortnameToUnicode($scope.command); + }; + /* * Returns the input element */