From d3b9e56c92fff60856adb70e85968cc3fac5741e Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 5 Mar 2021 15:39:56 +1100 Subject: [PATCH 1/2] remove unused templates and css --- background.html | 19 ------ background_test.html | 18 ------ libloki/test/index.html | 2 +- stylesheets/_conversation.scss | 8 --- stylesheets/_recorder.scss | 102 --------------------------------- stylesheets/_theme_dark.scss | 33 ----------- stylesheets/manifest.scss | 1 - test/index.html | 11 ---- 8 files changed, 1 insertion(+), 193 deletions(-) delete mode 100644 stylesheets/_recorder.scss diff --git a/background.html b/background.html index 8312a1ba0..74629f9b4 100644 --- a/background.html +++ b/background.html @@ -27,19 +27,7 @@ When making changes to these templates, be sure to update test/index.html as well --> - - - - - - - - - - - - - diff --git a/stylesheets/_conversation.scss b/stylesheets/_conversation.scss index 0aa1ec714..f4665b540 100644 --- a/stylesheets/_conversation.scss +++ b/stylesheets/_conversation.scss @@ -258,12 +258,4 @@ cursor: not-allowed; } } - .capture-audio { - float: right; - height: 36px; - } - .android-length-warning { - padding: 10px; - max-width: 150px; - } } diff --git a/stylesheets/_recorder.scss b/stylesheets/_recorder.scss deleted file mode 100644 index 040fbb9f5..000000000 --- a/stylesheets/_recorder.scss +++ /dev/null @@ -1,102 +0,0 @@ -.capture-audio { - text-align: center; - - .microphone { - height: 36px; - width: 36px; - text-align: center; - opacity: 0.5; - background: transparent; - padding: 0; - border: none; - margin-top: 2px; - - &:focus, - &:hover { - opacity: 1; - } - - &:before { - content: ''; - display: inline-block; - height: 24px; - width: 24px; - @include color-svg('../images/microphone.svg', $grey); - } - } -} -.recorder { - background: $color-white; - - button { - float: right; - width: 36px; - height: 36px; - border-radius: 36px; - margin-inline-start: 5px; - opacity: 0.5; - text-align: center; - padding: 0; - margin-top: 5px; - - &:focus, - &:hover { - opacity: 1; - } - - .icon { - display: inline-block; - width: $button-height; - height: $button-height; - } - } - - .finish { - background: lighten($session-color-green, 20%); - border: 1px solid $session-color-green; - - .icon { - @include color-svg('../images/check.svg', $session-color-green); - } - } - - .close { - background: lighten($session-color-danger, 20%); - border: 1px solid $session-color-danger; - - .icon { - @include color-svg('../images/x.svg', $session-color-danger); - } - } - - .time { - color: $grey; - float: right; - line-height: 36px; - padding: 0 10px; - - @keyframes pulse { - 0% { - opacity: 0; - } - 50% { - opacity: 1; - } - 100% { - opacity: 0; - } - } - - &::before { - content: ''; - display: inline-block; - border-radius: 10px; - width: 10px; - height: 10px; - background: #f00; - margin-inline-end: 10px; - opacity: 0; - animation: pulse 2s infinite; - } - } -} diff --git a/stylesheets/_theme_dark.scss b/stylesheets/_theme_dark.scss index a48008594..54639d58e 100644 --- a/stylesheets/_theme_dark.scss +++ b/stylesheets/_theme_dark.scss @@ -520,37 +520,4 @@ .module-message-search-result__body { color: $color-gray-05; } - - .capture-audio { - .microphone { - &:before { - @include color-svg('../images/microphone.svg', $color-dark-30); - } - } - } - .recorder { - background: $color-black; - - .finish { - background: lighten($session-color-green, 20%); - border: 1px solid $session-color-green; - - .icon { - @include color-svg('../images/check.svg', $session-color-green); - } - } - - .close { - background: lighten($session-color-danger, 20%); - border: 1px solid $session-color-danger; - - .icon { - @include color-svg('../images/x.svg', $session-color-danger); - } - } - - .time { - color: $grey; - } - } } diff --git a/stylesheets/manifest.scss b/stylesheets/manifest.scss index 9691f822c..451fa708a 100644 --- a/stylesheets/manifest.scss +++ b/stylesheets/manifest.scss @@ -19,7 +19,6 @@ @import 'modal'; @import 'debugLog'; @import 'lightbox'; -@import 'recorder'; @import 'emoji'; @import 'mentions'; @import 'avatar'; diff --git a/test/index.html b/test/index.html index 2b3c81d3d..dc6fc9b8a 100644 --- a/test/index.html +++ b/test/index.html @@ -26,11 +26,6 @@ - - - - - - + + \ No newline at end of file diff --git a/libloki/test/service_nodes_test.js b/libloki/test/service_nodes_test.js deleted file mode 100644 index 546c3bd00..000000000 --- a/libloki/test/service_nodes_test.js +++ /dev/null @@ -1,137 +0,0 @@ -/* global libloki, assert */ - -describe('ServiceNodes', () => { - describe('#consolidateLists', () => { - it('should throw when provided a non-iterable list', () => { - assert.throws( - () => libloki.serviceNodes.consolidateLists(null, 1), - Error - ); - }); - - it('should throw when provided a non-iterable item in the list', () => { - assert.throws( - () => libloki.serviceNodes.consolidateLists([1, 2, 3], 1), - Error - ); - }); - - it('should throw when provided a non-number threshold', () => { - assert.throws( - () => libloki.serviceNodes.consolidateLists([], 'a'), - 'Provided threshold is not a number' - ); - }); - - it('should throw when provided a non-function selector', () => { - [1, 'a', 0xffffffff, { really: 'not a function' }].forEach(x => { - assert.throws( - () => libloki.serviceNodes.consolidateLists([], 1, x), - 'Provided selector is not a function' - ); - }); - }); - - it('should return an empty array when the input is an empty array', () => { - const result = libloki.serviceNodes.consolidateLists([], 1); - assert.deepEqual(result, []); - }); - - it('should return the input when only 1 list is provided', () => { - const result = libloki.serviceNodes.consolidateLists( - [['a', 'b', 'c']], - 1 - ); - assert.deepEqual(result, ['a', 'b', 'c']); - }); - - it('should return the union of all lists when threshold is 0', () => { - const result = libloki.serviceNodes.consolidateLists( - [ - ['a', 'b', 'c', 'h'], - ['d', 'e', 'f', 'g'], - ['g', 'h'], - ], - 0 - ); - assert.deepEqual(result.sort(), ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']); - }); - - it('should use the selector to identify the elements', () => { - const result = libloki.serviceNodes.consolidateLists( - [ - [ - { id: 1, val: 'a' }, - { id: 2, val: 'b' }, - { id: 3, val: 'c' }, - { id: 8, val: 'h' }, - ], - [ - { id: 4, val: 'd' }, - { id: 5, val: 'e' }, - { id: 6, val: 'f' }, - { id: 7, val: 'g' }, - ], - [ - { id: 7, val: 'g' }, - { id: 8, val: 'h' }, - ], - ], - 0, - x => x.id - ); - const expected = [ - { id: 1, val: 'a' }, - { id: 2, val: 'b' }, - { id: 3, val: 'c' }, - { id: 4, val: 'd' }, - { id: 5, val: 'e' }, - { id: 6, val: 'f' }, - { id: 7, val: 'g' }, - { id: 8, val: 'h' }, - ]; - assert.deepEqual( - result.sort((a, b) => a.val > b.val), - expected - ); - }); - - it('should return the intersection of all lists when threshold is 1', () => { - const result = libloki.serviceNodes.consolidateLists( - [ - ['a', 'b', 'c', 'd'], - ['a', 'e', 'f', 'g'], - ['a', 'h'], - ], - 1 - ); - assert.deepEqual(result, ['a']); - }); - - it('should return the elements that have an occurence >= the provided threshold', () => { - const result = libloki.serviceNodes.consolidateLists( - [ - ['a', 'b', 'c', 'd', 'e', 'f', 'g'], - ['a', 'b', 'c', 'd', 'e', 'f', 'h'], - ['a', 'b', 'c', 'd', 'e', 'f', 'g'], - ['a', 'b', 'c', 'd', 'e', 'g', 'h'], - ], - 3 / 4 - ); - assert.deepEqual(result, ['a', 'b', 'c', 'd', 'e', 'f', 'g']); - }); - - it('should work with sets as well', () => { - const result = libloki.serviceNodes.consolidateLists( - new Set([ - new Set(['a', 'b', 'c', 'd', 'e', 'f', 'g']), - new Set(['a', 'b', 'c', 'd', 'e', 'f', 'h']), - new Set(['a', 'b', 'c', 'd', 'e', 'f', 'g']), - new Set(['a', 'b', 'c', 'd', 'e', 'g', 'h']), - ]), - 3 / 4 - ); - assert.deepEqual(result, ['a', 'b', 'c', 'd', 'e', 'f', 'g']); - }); - }); -});