From 7c5a396171075fc593344c8538b6b685025e933b Mon Sep 17 00:00:00 2001 From: David Cormier Date: Thu, 24 Jul 2014 21:36:16 -0400 Subject: [PATCH 1/3] Rename 'monospace' class to 'favorite-font' --- css/glowingbear.css | 4 ++-- directives/input.html | 2 +- index.html | 10 +++++----- js/glowingbear.js | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 1efbcbc..96ab9a3 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -257,7 +257,7 @@ input[type=text], input[type=password], #sendMessage, .badge { min-height: 100%; } -.monospace { +.favorite-font { font-family: 'Inconsolata', 'Consolas', 'Monaco', 'Ubuntu Mono', monospace; } @@ -478,7 +478,7 @@ h2 span, h2 small { /* Mobile layout */ /* */ @media (max-width: 968px) { - .monospace { + .favorite-font { /* readability on mobile +9001% */ font-family: sans-serif; } diff --git a/directives/input.html b/directives/input.html index 27eb6be..58a72ed 100644 --- a/directives/input.html +++ b/directives/input.html @@ -1,6 +1,6 @@
- diff --git a/index.html b/index.html index db0816b..6178247 100644 --- a/index.html +++ b/index.html @@ -60,11 +60,11 @@
- - + +
- +
Error: wrong password
@@ -217,7 +217,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
-
+
  • diff --git a/js/glowingbear.js b/js/glowingbear.js index 5078ef6..5c08ca3 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -866,9 +866,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // Save setting for playing sound on notification $store.bind($scope, "soundnotification", false); // Save setting for font family - $store.bind($scope, "fontfamily", getClassStyle('monospace', 'fontFamily')); + $store.bind($scope, "fontfamily", getClassStyle('favorite-font', 'fontFamily')); // Save setting for font size - $store.bind($scope, "fontsize", getClassStyle('monospace', 'fontSize')); + $store.bind($scope, "fontsize", getClassStyle('favorite-font', 'fontSize')); // Save setting for readline keybindings $store.bind($scope, "readlineBindings", false); @@ -947,11 +947,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // Update font family when changed $scope.$watch('fontfamily', function() { - changeClassStyle('monospace', 'fontFamily', $scope.fontfamily); + changeClassStyle('favorite-font', 'fontFamily', $scope.fontfamily); }); // Update font size when changed $scope.$watch('fontsize', function() { - changeClassStyle('monospace', 'fontSize', $scope.fontsize); + changeClassStyle('favorite-font', 'fontSize', $scope.fontsize); }); // Crude scoping hack. The keypress listener does not live in the same scope as // the checkbox, so we need to transfer this between scopes here. From 9b55244f1363e886be2844a5dee6112947c14934 Mon Sep 17 00:00:00 2001 From: David Cormier Date: Thu, 24 Jul 2014 21:41:33 -0400 Subject: [PATCH 2/3] Set and bind font-family if unset Default for desktop is monospace and default for mobile is sans-serif --- js/glowingbear.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/glowingbear.js b/js/glowingbear.js index 5c08ca3..89bbeed 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -872,6 +872,14 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // Save setting for readline keybindings $store.bind($scope, "readlineBindings", false); + if (!$scope.fontfamily) { + if ($rootScope.isMobileUi()) { + $scope.fontfamily = 'sans-serif'; + } else { + $scope.fontfamily = "Inconsolata, Consolas, Monaco, Ubuntu Mono, monospace"; + } + } + // Save setting for displaying embeds in rootScope so it can be used from service $rootScope.visible = $scope.noembed === false; From 01a1d79a54154672730b433dab97c251757fcae1 Mon Sep 17 00:00:00 2001 From: David Cormier Date: Thu, 24 Jul 2014 21:42:52 -0400 Subject: [PATCH 3/3] Remove font definition from css file The font for the .favorite-font class is now set programmatically --- css/glowingbear.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 96ab9a3..9ba74c6 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -257,10 +257,6 @@ input[type=text], input[type=password], #sendMessage, .badge { min-height: 100%; } -.favorite-font { - font-family: 'Inconsolata', 'Consolas', 'Monaco', 'Ubuntu Mono', monospace; -} - #bufferlines { position: relative; height: 100%; @@ -478,10 +474,6 @@ h2 span, h2 small { /* Mobile layout */ /* */ @media (max-width: 968px) { - .favorite-font { - /* readability on mobile +9001% */ - font-family: sans-serif; - } #bufferlines table { border-collapse: separate;