From 4bf1d92ace50dc177f5eb0833a262990c43d712f Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sun, 12 Apr 2020 17:44:26 +0200 Subject: [PATCH 1/5] Hide time markers for certain buffer types --- index.html | 4 ++-- js/models.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 1928512..7065f59 100644 --- a/index.html +++ b/index.html @@ -407,12 +407,12 @@ npm run build-electron-{windows, darwin, linux} - + - <>
diff --git a/js/models.js b/js/models.js index 1ebc411..1473fd4 100644 --- a/js/models.js +++ b/js/models.js @@ -98,6 +98,9 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo var pinned = message.local_variables.pinned === "true"; + //hide timestamps for certain buffer types + var showTime = type && type !== 'relay'; + // Server buffers have this "irc.server.freenode" naming schema, which // messes the sorting up. We need it to be "irc.freenode" instead. var serverSortKey = plugin + "." + server + @@ -365,6 +368,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo getHistoryDown: getHistoryDown, isNicklistEmpty: isNicklistEmpty, nicklistRequested: nicklistRequested, + showTime: showTime, pinned: pinned, queryNicklist: queryNicklist, }; From cf2e8b8ef23fb0a361a394f0c82ea1b7eaedb92e Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sun, 12 Apr 2020 17:56:14 +0200 Subject: [PATCH 2/5] Set undefined buffer.type as other --- js/models.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/models.js b/js/models.js index 1473fd4..b1ae9f2 100644 --- a/js/models.js +++ b/js/models.js @@ -90,7 +90,13 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo // There are two kinds of types: bufferType (free vs formatted) and // the kind of type that distinguishes queries from channels etc var bufferType = message.type; + + // If type is undefined set it as other to avoid later errors var type = message.local_variables.type; + if (!type) { + type = 'other'; + } + var indent = (['channel', 'private'].indexOf(type) >= 0); var plugin = message.local_variables.plugin; From 3bd23671646379724541f9dced7b83564e6caa4a Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sun, 12 Apr 2020 17:59:55 +0200 Subject: [PATCH 3/5] Rename buffer variable showTimes --- index.html | 4 ++-- js/models.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 7065f59..4edadf2 100644 --- a/index.html +++ b/index.html @@ -407,12 +407,12 @@ npm run build-electron-{windows, darwin, linux} - + - <>
diff --git a/js/models.js b/js/models.js index b1ae9f2..fecfb54 100644 --- a/js/models.js +++ b/js/models.js @@ -90,7 +90,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo // There are two kinds of types: bufferType (free vs formatted) and // the kind of type that distinguishes queries from channels etc var bufferType = message.type; - + // If type is undefined set it as other to avoid later errors var type = message.local_variables.type; if (!type) { @@ -105,7 +105,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo var pinned = message.local_variables.pinned === "true"; //hide timestamps for certain buffer types - var showTime = type && type !== 'relay'; + var showBufferLineTimes = type && type !== 'relay'; // Server buffers have this "irc.server.freenode" naming schema, which // messes the sorting up. We need it to be "irc.freenode" instead. @@ -374,7 +374,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo getHistoryDown: getHistoryDown, isNicklistEmpty: isNicklistEmpty, nicklistRequested: nicklistRequested, - showTime: showTime, + showBufferLineTimes: showBufferLineTimes, pinned: pinned, queryNicklist: queryNicklist, }; From 27134a7f3d542db73bfebe405ffbe607e55c2c88 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Sat, 18 Apr 2020 16:20:40 +0200 Subject: [PATCH 4/5] Change the way times are hidden --- css/glowingbear.css | 8 ++++++++ index.html | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 62a10fb..2541ee4 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -960,3 +960,11 @@ code { color: #444; border: 1pt solid #444; } + +#bufferlines.hideTime td.time { + display:none; +} + +#bufferlines.hideTime td.prefix { + display:none; +} diff --git a/index.html b/index.html index 4edadf2..1d538e8 100644 --- a/index.html +++ b/index.html @@ -395,7 +395,7 @@ npm run build-electron-{windows, darwin, linux} -
+
@@ -407,12 +407,12 @@ npm run build-electron-{windows, darwin, linux} - -
+ <>
From effbaff80427ea734fd8540b5a483017b2a0e8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Wed, 22 Apr 2020 11:44:31 +0200 Subject: [PATCH 5/5] Simplify logic of hiding bufferline times --- index.html | 2 +- js/models.js | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 1d538e8..de02239 100644 --- a/index.html +++ b/index.html @@ -395,7 +395,7 @@ npm run build-electron-{windows, darwin, linux} -
+
diff --git a/js/models.js b/js/models.js index fecfb54..62ed94d 100644 --- a/js/models.js +++ b/js/models.js @@ -92,11 +92,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo var bufferType = message.type; // If type is undefined set it as other to avoid later errors - var type = message.local_variables.type; - if (!type) { - type = 'other'; - } - + var type = message.local_variables.type || 'other'; var indent = (['channel', 'private'].indexOf(type) >= 0); var plugin = message.local_variables.plugin; @@ -104,8 +100,8 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo var pinned = message.local_variables.pinned === "true"; - //hide timestamps for certain buffer types - var showBufferLineTimes = type && type !== 'relay'; + // hide timestamps for certain buffer types + var hideBufferLineTimes = type && type === 'relay'; // Server buffers have this "irc.server.freenode" naming schema, which // messes the sorting up. We need it to be "irc.freenode" instead. @@ -374,7 +370,7 @@ models.service('models', ['$rootScope', '$filter', 'bufferResume', function($roo getHistoryDown: getHistoryDown, isNicklistEmpty: isNicklistEmpty, nicklistRequested: nicklistRequested, - showBufferLineTimes: showBufferLineTimes, + hideBufferLineTimes: hideBufferLineTimes, pinned: pinned, queryNicklist: queryNicklist, };