From f5855e07125efdc388c4e542ca45ba8d35011f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 30 Jun 2014 20:23:53 +0100 Subject: [PATCH 01/68] Revert "Set port variable instead of placeholder" This reverts commit 6b4d2fddbb5859c2ef0ebdcbf133b21006daeffc. ...because it didn't work. I just got an empty box and the variable wasn't set --- index.html | 2 +- js/glowingbear.js | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/index.html b/index.html index bb2b270..5a3ab82 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,7 @@
- +
diff --git a/js/glowingbear.js b/js/glowingbear.js index 4869862..331bfcc 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -523,9 +523,6 @@ function($rootScope, weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', '$log', 'models', 'connection', function ($rootScope, $scope, $store, $timeout, $log, models, connection) { - - $scope.port = 9001; - // From: http://stackoverflow.com/a/18539624 by StackOverflow user "plantian" $rootScope.countWatchers = function () { var q = [$rootScope], watchers = 0, scope; From 9379a53543a4d08beb94fd3464704fcd865fab35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 30 Jun 2014 20:24:37 +0100 Subject: [PATCH 02/68] Set placeholder text to "Port" instead so it is clear what is needed here --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5a3ab82..ad6d8dc 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,7 @@
- +
From 0b8a3eb045ae31e6f8d865814a71402ba470deec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 1 Jul 2014 19:41:27 +0100 Subject: [PATCH 03/68] Don't trim unread lines Also fix read marker after trimming --- js/glowingbear.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 4869862..65104f8 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -87,7 +87,7 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', function var buffer = new models.Buffer(bufferMessage); models.addBuffer(buffer); /* Until we can decide if user asked for this buffer to be opened - * or not we will let user click opened buffers. + * or not we will let user click opened buffers. models.setActiveBuffer(buffer.id); */ }; @@ -699,9 +699,14 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $rootScope.$on('activeBufferChanged', function(event, unreadSum) { var ab = models.getActiveBuffer(); - // trim lines to 2 screenfuls + 10 lines - ab.lines.splice(0, ab.lines.length - (2 * $scope.lines_per_screen + 10)); - ab.requestedLines = ab.lines.length; + // Discard surplus lines. This is done *before* lines are fetched because that saves us the effort of special handling for the + // case where a buffer is opened for the first time ;) + var minRetainUnread = ab.lines.length - unreadSum + 5; // do not discard unread lines and keep 5 additional lines for context + var surplusLines = ab.lines.length - (2 * $scope.lines_per_screen + 10); // retain up to 2*(screenful + 10) + 10 lines because magic numbers + var linesToRemove = Math.max(0, Math.min(minRetainUnread, surplusLines)); + ab.lines.splice(0, linesToRemove); // remove the lines from the buffer + ab.requestedLines = ab.lines.length; // to ensure that the correct amount of lines is fetched should more be requested + ab.lastSeen -= linesToRemove; // adjust readmarker $scope.bufferlines = ab.lines; $scope.nicklist = ab.nicklist; @@ -1239,7 +1244,7 @@ weechat.directive('inputBar', function() { return { templateUrl: 'directives/input.html', - + scope: { inputId: '@inputId' }, From b21662da3ca7e991c8c3b32f00176e5350ff6629 Mon Sep 17 00:00:00 2001 From: Kramer Campbell Date: Tue, 1 Jul 2014 15:07:34 -0700 Subject: [PATCH 04/68] Remove duplicate source of truth with buffers. --- index.html | 2 +- js/glowingbear.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index bb2b270..5bd5bbb 100644 --- a/index.html +++ b/index.html @@ -215,7 +215,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel -
  • +
  • {{ buffer.shortName || buffer.fullName }} diff --git a/js/glowingbear.js b/js/glowingbear.js index 4869862..9c15aa5 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -774,9 +774,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', }); $rootScope.$on('relayDisconnect', function() { - // this reinitialze just breaks the bufferlist upon reconnection. - // Disabled it until it's fully investigated and fixed - //models.reinitialize(); + models.reinitialize(); $rootScope.$emit('notificationChanged'); $scope.connectbutton = 'Connect'; }); @@ -784,7 +782,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.showSidebar = true; - $scope.buffers = models.model.buffers; + $scope.getBuffers = models.getBuffers.bind(models); $scope.bufferlines = {}; $scope.nicklist = {}; @@ -1125,7 +1123,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $rootScope.switchToActivityBuffer = function() { // Find next buffer with activity and switch to it - var sortedBuffers = _.sortBy($scope.buffers, 'number'); + var sortedBuffers = _.sortBy($scope.getBuffers(), 'number'); var i, buffer; // Try to find buffer with notification for (i in sortedBuffers) { From ba74f2a7e5eef94fda40df065e309b224c01fcf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Wed, 2 Jul 2014 08:41:50 +0100 Subject: [PATCH 05/68] Allow a minus sign before a #channel link --- js/glowingbear.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 4869862..040b5b2 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -28,7 +28,7 @@ weechat.filter('irclinky', ['$filter', function($filter) { // However, it matches all *common* IRC channels while trying to minimise false positives. "#1" is much // more likely to be "number 1" than "IRC channel #1". // Thus, we only match channels beginning with a # and having at least one letter in them. - var channelRegex = /(^|[\s,.:;?!"'()+@])(#+[a-z0-9-_]*[a-z][a-z0-9-_]*)/gmi; + var channelRegex = /(^|[\s,.:;?!"'()+@-])(#+[a-z0-9-_]*[a-z][a-z0-9-_]*)/gmi; // This is SUPER nasty, but ng-click does not work inside a filter, as the markup has to be $compiled first, which is not possible in filter afaik. // Therefore, get the scope, fire the method, and $apply. Yuck. I sincerely hope someone finds a better way of doing this. linkiedText = linkiedText.replace(channelRegex, '$1$2'); From 4be8742ac58194448f9873430a3accb4b80319b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Fri, 4 Jul 2014 14:44:40 +0100 Subject: [PATCH 06/68] Focus input bar after pressing the send button This prevents the keyboard from closing on mobile --- js/glowingbear.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/glowingbear.js b/js/glowingbear.js index 3bba9b2..b37c8a9 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -1312,6 +1312,8 @@ weechat.directive('inputBar', function() { // Empty the input after it's sent $scope.command = ''; } + + $scope.getInputNode().focus(); }; $rootScope.addMention = function(prefix) { From 1194b170e5dcf8a510c99cde762db8ff34c3d511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sun, 6 Jul 2014 11:30:38 +0100 Subject: [PATCH 07/68] Fix the initial loading of lines This fixes a bug where the initial line loading would be triggered multiple times, and a bug that incorrectly set requestedLines, causing this behaviour to repeat --- js/glowingbear.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 3bba9b2..b5bb8d1 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -483,6 +483,9 @@ function($rootScope, // Don't do that if we didn't get any more lines than we already had var setReadmarker = (buffer.lastSeen >= 0) && (oldLength !== buffer.lines.length); buffer.lines.length = 0; + // We need to set the number of requested lines to 0 here, because parsing a line + // increments it. This is needed to also count newly arriving lines while we're + // already connected. buffer.requestedLines = 0; // Count number of lines recieved var linesReceivedCount = lineinfo.objects[0].content.length; @@ -702,7 +705,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', var surplusLines = ab.lines.length - (2 * $scope.lines_per_screen + 10); // retain up to 2*(screenful + 10) + 10 lines because magic numbers var linesToRemove = Math.max(0, Math.min(minRetainUnread, surplusLines)); ab.lines.splice(0, linesToRemove); // remove the lines from the buffer - ab.requestedLines = ab.lines.length; // to ensure that the correct amount of lines is fetched should more be requested + ab.requestedLines -= linesToRemove; // to ensure that the correct amount of lines is fetched should more be requested ab.lastSeen -= linesToRemove; // adjust readmarker $scope.bufferlines = ab.lines; @@ -723,8 +726,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', if (ab.requestedLines < $scope.lines_per_screen) { // buffer has not been loaded, but some lines may already be present if they arrived after we connected // try to determine how many lines to fetch - var numLines = $scope.lines_per_screen; // that's a screenful plus 10 lines - unreadSum += 10; // let's just add a 10 line safety margin here again + var numLines = $scope.lines_per_screen + 10; // that's (a screenful plus 10 lines) plus 10 lines, just to be safe if (unreadSum > numLines) { // request up to 4*(screenful + 10 lines) numLines = Math.min(4*numLines, unreadSum); From a2cc3558c3f5b23a1baaafea6484d4525229b232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 7 Jul 2014 18:54:56 +0100 Subject: [PATCH 08/68] Remove ngAnimate for the moment, we're not even using it It does have a very significant performance impact, in my measurements, buffer switching is 30% faster without it! --- index.html | 1 - js/glowingbear.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index c0633b0..bb9e2a7 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,6 @@ - diff --git a/js/glowingbear.js b/js/glowingbear.js index 3bba9b2..e3f590e 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -1,4 +1,4 @@ -var weechat = angular.module('weechat', ['ngRoute', 'localStorage', 'weechatModels', 'plugins', 'ngSanitize', 'ngWebsockets', 'pasvaz.bindonce', 'ngTouch', 'ngAnimate']); +var weechat = angular.module('weechat', ['ngRoute', 'localStorage', 'weechatModels', 'plugins', 'ngSanitize', 'ngWebsockets', 'pasvaz.bindonce', 'ngTouch']); weechat.filter('toArray', function () { 'use strict'; From 39b6d7a179aa21b347acc0277da7270b93997ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 14 Jul 2014 22:49:26 +0100 Subject: [PATCH 09/68] Fix URL regex Old one doesn't match umlauts and other unicode stuff New one is a lot more general and similar to what angular uses --- js/plugins.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/plugins.js b/js/plugins.js index e251a5d..0de3850 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -111,7 +111,7 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) { */ plugins.factory('userPlugins', function() { - var urlRegexp = RegExp(/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/); + var urlRegexp = RegExp(/(ftp|https?):\/\/\S*[^\s.;,(){}<>]/) /* * Spotify Embedded Player From 885b47eaaf1888dbe4d2c3b9c0c22c283d104aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 14 Jul 2014 22:50:08 +0100 Subject: [PATCH 10/68] Add yr.no plugin --- js/plugins.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/js/plugins.js b/js/plugins.js index 0de3850..db21075 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -111,7 +111,7 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) { */ plugins.factory('userPlugins', function() { - var urlRegexp = RegExp(/(ftp|https?):\/\/\S*[^\s.;,(){}<>]/) + var urlRegexp = RegExp(/(ftp|https?):\/\/\S*[^\s.;,(){}<>]/); /* * Spotify Embedded Player @@ -287,8 +287,27 @@ plugins.factory('userPlugins', function() { }); asciinemaPlugin.name = "ascii cast"; + var yrPlugin = new Plugin(function(message) { + var match = message.match(urlRegexp); + + if (match) { + var url = match[0]; + var regexp = /^https?:\/\/(?:www\.)?yr\.no\/(place|stad|sted|sadji)\/([^\s.;,(){}<>\/]+)\/([^\s.;,(){}<>\/]+)\/([^\s.;,(){}<>\/]+)/; + match = url.match(regexp); + if (match) { + var language = match[1]; + var country = match[2]; + var province = match[3]; + var city = match[4]; + url = "http://www.yr.no/" + language + "/" + country + "/" + province + "/" + city + "/avansert_meteogram.png"; + return "Meteogram for " + city + ""; + } + } + }); + yrPlugin.name = "meteogram"; + return { - plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin] + plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin, yrPlugin] }; From 8e1e87141147d601d6c7d0c367eef7d9fbe2f2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 14 Jul 2014 23:17:22 +0100 Subject: [PATCH 11/68] Fix matching (#segments) --- js/plugins.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/js/plugins.js b/js/plugins.js index db21075..eba813d 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -292,14 +292,13 @@ plugins.factory('userPlugins', function() { if (match) { var url = match[0]; - var regexp = /^https?:\/\/(?:www\.)?yr\.no\/(place|stad|sted|sadji)\/([^\s.;,(){}<>\/]+)\/([^\s.;,(){}<>\/]+)\/([^\s.;,(){}<>\/]+)/; + var regexp = /^https?:\/\/(?:www\.)?yr\.no\/(place|stad|sted|sadji|paikka)\/(([^\s.;,(){}<>\/]+\/){3,})/; match = url.match(regexp); if (match) { var language = match[1]; - var country = match[2]; - var province = match[3]; - var city = match[4]; - url = "http://www.yr.no/" + language + "/" + country + "/" + province + "/" + city + "/avansert_meteogram.png"; + var location = match[2]; + var city = match[match.length - 1].slice(0, -1); + url = "http://www.yr.no/" + language + "/" + location + "avansert_meteogram.png"; return "Meteogram for " + city + ""; } } From 1428005d1dc6ce410b6fc2c5b3853dc097608bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 30 Jun 2014 20:20:31 +0100 Subject: [PATCH 12/68] Update app manifests - fix name & image paths - unify version numbers --- manifest.json | 10 +++++----- manifest.webapp | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index 493e83b..4f2683b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,11 +1,11 @@ { - "name": "Weechat", + "name": "Glowing Bear", "description": "WeeChat Web frontend", - "version": "0.0.0.1", + "version": "0.3.0", "manifest_version": 2, "icons": { - "32": "img/favicon.png", - "128": "img/weechat_logo_128x128.png" + "32": "assets/img/favicon.png", + "128": "assets/img/glowing_bear_128x128.png" }, "app": { "urls": [ @@ -20,6 +20,6 @@ "notifications" ], "web_accessible_resources": [ - "img/favicon.png" + "assets/img/favicon.png" ] } diff --git a/manifest.webapp b/manifest.webapp index de03a6d..5af7e05 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -1,5 +1,5 @@ { - "name": "WeeChat", + "name": "Glowing Bear", "description": "WeeChat Web frontend", "launch_path": "/glowing-bear/index.html", "icons": { @@ -16,6 +16,5 @@ "url": "https://github.com/glowing-bear" }, "default_locale": "en", - "version": "2" + "version": "0.3.0" } - From de12755204b893c87d0b1ce354bba29618074408 Mon Sep 17 00:00:00 2001 From: David Cormier Date: Tue, 15 Jul 2014 10:07:11 -0400 Subject: [PATCH 13/68] Only display status of master in readme This way, we won't get "build error" images when a PR branch fails --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee05adb..ac127e0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -A web client for WeeChat [![Build Status](https://api.travis-ci.org/glowing-bear/glowing-bear.png)](https://travis-ci.org/glowing-bear/glowing-bear) +A web client for WeeChat [![Build Status](https://api.travis-ci.org/glowing-bear/glowing-bear.png)](https://travis-ci.org/glowing-bear/glowing-bear?branch=master) ======================== Glowing Bear is an HTML5 web frontend for [WeeChat](http://weechat.org) that strives to be a modern and slick interface. It relies on WeeChat to do all the heavy lifting (connections, servers, history, etc) and then provides some nice features on top of that, like content embedding (images, video) and desktop notifications. The main advantage, though, is that you can access it from any modern internet device without having to worry about ssh connections or terminal emulators. From cffeef030b5c25ef51f95c545b371ec8909530e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 15 Jul 2014 15:50:24 +0100 Subject: [PATCH 14/68] Fix line breaks on mobile by shifting around padding --- css/glowingbear.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 19cb22a..669ecd1 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -466,15 +466,15 @@ h2 span, h2 small { #bufferlines td.prefix { display: inline; - padding-right: 0; + padding-right: 5px; border: 0; font-weight: bold; font-size: 15px; } #bufferlines td.message { - padding-left: 0; display: inline; + padding: 0px !important; } /* a different colour is too irregular on mobile */ From 59040785aaf793457514ba39089e62469794ad60 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Wed, 16 Jul 2014 19:44:42 +0200 Subject: [PATCH 15/68] Clarify option. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index bb9e2a7..23dc4a2 100644 --- a/index.html +++ b/index.html @@ -322,7 +322,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
    From 7f76ed69ddb2056390b1f66143acd5099c3b4ac1 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Wed, 16 Jul 2014 19:47:57 +0200 Subject: [PATCH 16/68] Disable nicklist swipe Behaviour was pretty unintuive with the previous way. This should be a little more consistant --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index bb9e2a7..277605f 100644 --- a/index.html +++ b/index.html @@ -222,7 +222,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
  • -
    +
    • From a7a8d60aeaf4a1cc73e0523488f27c35a4d8815b Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Wed, 16 Jul 2014 20:34:50 +0200 Subject: [PATCH 17/68] localstorage: fix initial value setting --- js/localstorage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/localstorage.js b/js/localstorage.js index cfcf1ce..44893b1 100644 --- a/js/localstorage.js +++ b/js/localstorage.js @@ -1,3 +1,4 @@ +'use strict'; var ls = angular.module('localStorage',[]); @@ -97,8 +98,10 @@ ls.factory("$store",function($parse){ * @returns {*} - returns whatever the stored value is */ bind: function ($scope, key, def) { - def = def || ''; - if (publicMethods.get(key) === undefined) { + if (def === undefined) { + def = ''; + } + if (publicMethods.get(key) === undefined || publicMethods.get(key) === null) { publicMethods.set(key, def); } $parse(key).assign($scope, publicMethods.get(key)); From cdcdcb096b58edc1176dc4e29dd6a272dee6ad07 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 7 Jul 2014 01:48:19 +0200 Subject: [PATCH 18/68] 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 From 16f9897964d89e39710b42a473b87851d8d27ab0 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 7 Jul 2014 16:03:33 +0200 Subject: [PATCH 19/68] use angular.element instead of jquery --- js/glowingbear.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 5453979..42aa45d 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -843,7 +843,7 @@ 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", $('.monospace').css('font-family')); + $store.bind($scope, "fontfamily", angular.element('.monospace').css('font-family')); // Save setting for displaying embeds in rootScope so it can be used from service $rootScope.visible = $scope.noembed === false; @@ -894,7 +894,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // Update font family when changed $scope.$watch('fontfamily', function() { - $('.monospace').css('font-family', $scope.fontfamily); + angular.element('.monospace').css('font-family', $scope.fontfamily); }); $scope.setActiveBuffer = function(bufferId, key) { From 6a3b4a15062d91ed3e21fdcbd7e8c633d7df53db Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 7 Jul 2014 16:09:25 +0200 Subject: [PATCH 20/68] new option for overriding font size --- index.html | 7 ++++++- js/glowingbear.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 1469329..c26a3be 100644 --- a/index.html +++ b/index.html @@ -368,10 +368,15 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
  • - Override font + Override font family
  • +
  • + Override font size (E.g. 16px) +
    + +
  • diff --git a/js/glowingbear.js b/js/glowingbear.js index 42aa45d..e81fa40 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -844,6 +844,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $store.bind($scope, "soundnotification", false); // Save setting for font family $store.bind($scope, "fontfamily", angular.element('.monospace').css('font-family')); + // Save setting for font size + $store.bind($scope, "fontsize", angular.element('.monospace').css('font-size')); // Save setting for displaying embeds in rootScope so it can be used from service $rootScope.visible = $scope.noembed === false; @@ -896,6 +898,10 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.$watch('fontfamily', function() { angular.element('.monospace').css('font-family', $scope.fontfamily); }); + // Update font size when changed + $scope.$watch('fontsize', function() { + angular.element('.monospace').css('font-size', $scope.fontsize); + }); $scope.setActiveBuffer = function(bufferId, key) { // If we are on mobile we need to collapse the menu on sidebar clicks From 6318a941637ab59ad1b5ad2cda92a94abfdf9972 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 7 Jul 2014 16:42:23 +0200 Subject: [PATCH 21/68] Helpers for class styling Implement our own helpers for getting and setting class styles instead of using jquery functions, since we are getting rid of jquery --- js/glowingbear.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index e81fa40..a590bc9 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -14,6 +14,19 @@ weechat.filter('toArray', function () { }; }); +// Helper to change style of a class +var changeClassStyle = function(classSelector, attr, value) { + _.each(document.getElementsByClassName(classSelector), function(e) { + e.style[attr] = value; + }); +}; +// Helper to get style from a class +var getClassStyle = function(classSelector, attr) { + _.each(document.getElementsByClassName(classSelector), function(e) { + return e.style[attr]; + }); +}; + weechat.filter('irclinky', ['$filter', function($filter) { 'use strict'; return function(text, target) { @@ -843,9 +856,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", angular.element('.monospace').css('font-family')); + $store.bind($scope, "fontfamily", getClassStyle('monospace', 'font-family')); // Save setting for font size - $store.bind($scope, "fontsize", angular.element('.monospace').css('font-size')); + $store.bind($scope, "fontsize", getClassStyle('monospace', 'font-size')); // Save setting for displaying embeds in rootScope so it can be used from service $rootScope.visible = $scope.noembed === false; @@ -896,11 +909,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // Update font family when changed $scope.$watch('fontfamily', function() { - angular.element('.monospace').css('font-family', $scope.fontfamily); + changeClassStyle('monospace', 'font-family', $scope.fontfamily); }); // Update font size when changed $scope.$watch('fontsize', function() { - angular.element('.monospace').css('font-size', $scope.fontsize); + changeClassStyle('monospace', 'font-size', $scope.fontsize); }); $scope.setActiveBuffer = function(bufferId, key) { From 836b2940ce7a600d208ecaecc2a8ce4aea99bbf0 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 7 Jul 2014 20:11:14 +0200 Subject: [PATCH 22/68] Use crossbrowser compatible attr. names --- js/glowingbear.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index a590bc9..e8e8a54 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -856,9 +856,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', 'font-family')); + $store.bind($scope, "fontfamily", getClassStyle('monospace', 'fontFamily')); // Save setting for font size - $store.bind($scope, "fontsize", getClassStyle('monospace', 'font-size')); + $store.bind($scope, "fontsize", getClassStyle('monospace', 'fontSize')); // Save setting for displaying embeds in rootScope so it can be used from service $rootScope.visible = $scope.noembed === false; @@ -909,11 +909,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // Update font family when changed $scope.$watch('fontfamily', function() { - changeClassStyle('monospace', 'font-family', $scope.fontfamily); + changeClassStyle('monospace', 'fontFamily', $scope.fontfamily); }); // Update font size when changed $scope.$watch('fontsize', function() { - changeClassStyle('monospace', 'font-size', $scope.fontsize); + changeClassStyle('monospace', 'fontSize', $scope.fontsize); }); $scope.setActiveBuffer = function(bufferId, key) { From fcfd9fce9174c356742924e0095dbf90519614f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Thu, 10 Jul 2014 17:37:39 +0100 Subject: [PATCH 23/68] Make it pretty --- css/glowingbear.css | 6 ++++++ index.html | 27 ++++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 19cb22a..28f6726 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -361,9 +361,15 @@ table.notimestampseconds td.time span.seconds { font-size: medium; } .modal-header { + padding-top: 23px; border-bottom: 0; } +#fontchoice label { + font-weight: normal; + text-align: left; +} + h2 { padding-bottom: 5px; height: 72px; diff --git a/index.html b/index.html index c26a3be..6c360cc 100644 --- a/index.html +++ b/index.html @@ -271,10 +271,25 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
  • -
    +
    - + brand @@ -207,7 +207,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
    -