From cdcdcb096b58edc1176dc4e29dd6a272dee6ad07 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 7 Jul 2014 01:48:19 +0200 Subject: [PATCH] User configurable font choice. Fixes #351 --- index.html | 5 +++++ js/glowingbear.js | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/index.html b/index.html index cd8699f..1469329 100644 --- a/index.html +++ b/index.html @@ -367,6 +367,11 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel +
  • + Override font +
    + +
  • diff --git a/js/glowingbear.js b/js/glowingbear.js index d3e4c58..5453979 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -842,6 +842,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $store.bind($scope, "showtimestampSeconds", false); // Save setting for playing sound on notification $store.bind($scope, "soundnotification", false); + // Save setting for font family + $store.bind($scope, "fontfamily", $('.monospace').css('font-family')); // Save setting for displaying embeds in rootScope so it can be used from service $rootScope.visible = $scope.noembed === false; @@ -890,6 +892,10 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', } }); + // Update font family when changed + $scope.$watch('fontfamily', function() { + $('.monospace').css('font-family', $scope.fontfamily); + }); $scope.setActiveBuffer = function(bufferId, key) { // If we are on mobile we need to collapse the menu on sidebar clicks