From 93a226f1b31f3ad14e1b628b77b89bf7b7ded81d Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 04:42:35 +0200 Subject: [PATCH 01/22] Upgrade dependecies i.e. electron 8.3.0 --- package.json | 2 +- yarn.lock | 126 +++++++++++++++++++++++++-------------------------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/package.json b/package.json index f8cb64b..d9265f5 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,6 @@ } ] }, - "electronVersion": "8.2.5" + "electronVersion": "8.3.0" } } diff --git a/yarn.lock b/yarn.lock index d9bef3f..1b27927 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,9 +16,9 @@ ajv-keywords "^3.4.1" "@electron/get@^1.0.1": - version "1.10.0" - resolved "https://registry.npmjs.org/@electron/get/-/get-1.10.0.tgz#258fdda22bbd5a247e0b663ba9c525dedc1bdfff" - integrity sha512-hlueNXU51c3CwQjBw/i5fwt+VfQgSQVUTdicpCHkhEjNZaa4CXJ5W1GaxSwtLE2dvRmAHjpIjUMHTqJ53uojfg== + version "1.12.2" + resolved "https://registry.npmjs.org/@electron/get/-/get-1.12.2.tgz#6442066afb99be08cefb9a281e4b4692b33764f3" + integrity sha512-vAuHUbfvBQpYTJ5wB7uVIDq5c/Ry0fiTBMs7lnEYAo/qXXppIVcWdfBr57u6eRnKdVso7KSiH6p/LbQAG6Izrg== dependencies: debug "^4.1.1" env-paths "^2.2.0" @@ -54,26 +54,26 @@ integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== "@types/fs-extra@^8.1.0": - version "8.1.0" - resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.0.tgz#1114834b53c3914806cd03b3304b37b3bd221a4d" - integrity sha512-UoOfVEzAUpeSPmjm7h1uk5MH6KZma2z2O7a75onTGjnNvAvMVrPzPL/vBbT65iIGHWj6rokwfmYcmxmlSf2uwg== + version "8.1.1" + resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.1.tgz#1e49f22d09aa46e19b51c0b013cb63d0d923a068" + integrity sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w== dependencies: "@types/node" "*" "@types/node@*": - version "13.13.5" - resolved "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz#96ec3b0afafd64a4ccea9107b75bf8489f0e5765" - integrity sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g== + version "14.0.1" + resolved "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz#5d93e0a099cd0acd5ef3d5bde3c086e1f49ff68c" + integrity sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA== "@types/node@^12.0.12": - version "12.12.38" - resolved "https://registry.npmjs.org/@types/node/-/node-12.12.38.tgz#58841a382f231ad005dbb935c36d44aa1118a26b" - integrity sha512-75eLjX0pFuTcUXnnWmALMzzkYorjND0ezNEycaKesbUBg9eGZp4GHPuDmkRc4mQQvIpe29zrzATNRA6hkYqwmA== + version "12.12.39" + resolved "https://registry.npmjs.org/@types/node/-/node-12.12.39.tgz#532d25c1e639d89dd6f3aa1d7b3962e3e7fa943d" + integrity sha512-pADGfwnDkr6zagDwEiCVE4yQrv7XDkoeVa4OfA9Ju/zRTk6YNDLGtQbkdL4/56mCQQCs4AhNrBIag6jrp7ZuOg== "@types/semver@^7.1.0": - version "7.1.0" - resolved "https://registry.npmjs.org/@types/semver/-/semver-7.1.0.tgz#c8c630d4c18cd326beff77404887596f96408408" - integrity sha512-pOKLaubrAEMUItGNpgwl0HMFPrSAFic8oSVIvfu1UwcgGNmNyK9gyhBHKmBnUTwwVvpZfkzUC0GaMgnL6P86uA== + version "7.2.0" + resolved "https://registry.npmjs.org/@types/semver/-/semver-7.2.0.tgz#0d72066965e910531e1db4621c15d0ca36b8d83b" + integrity sha512-TbB0A8ACUWZt3Y6bQPstW9QNbhNeebdgLX4T/ZfkrswAfUzRiXrgd9seol+X379Wa589Pu4UEx9Uok0D4RjRCQ== dependencies: "@types/node" "*" @@ -82,10 +82,10 @@ resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d" integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw== -"@types/yargs@^15.0.4": - version "15.0.4" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz#7e5d0f8ca25e9d5849f2ea443cf7c402decd8299" - integrity sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg== +"@types/yargs@^15.0.5": + version "15.0.5" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz#947e9a6561483bdee9adffc983e91a6902af8b79" + integrity sha512-Dk/IDOPtOgubt/IaevIUbTgV7doaKkoorvOyYM2CMwuDyP89bekI7H4xLIwunNYiK9jhCkmc6pUrJk3cj2AB9w== dependencies: "@types/yargs-parser" "*" @@ -136,26 +136,26 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: "@types/color-name" "^1.1.1" color-convert "^2.0.1" -app-builder-bin@3.5.8: - version "3.5.8" - resolved "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.5.8.tgz#4b96cf7d114171b20f32138082dc7cf20f16b85d" - integrity sha512-ni3q7QTfQNWHNWuyn5x3FZu6GnQZv+TFnfgk5++svqleKEhHGqS1mIaKsh7x5pBX6NFXU3/+ktk98wA/AW4EXw== +app-builder-bin@3.5.9: + version "3.5.9" + resolved "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.5.9.tgz#a3ac0c25286bac68357321cb2eaf7128b0bc0a4f" + integrity sha512-NSjtqZ3x2kYiDp3Qezsgukx/AUzKPr3Xgf9by4cYt05ILWGAptepeeu0Uv+7MO+41o6ujhLixTou8979JGg2Kg== -app-builder-lib@22.6.0: - version "22.6.0" - resolved "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-22.6.0.tgz#65782fa8fc96180a22c008eb78c1355349bb0b86" - integrity sha512-ky2aLYy92U+Gh6dKq/e8/bNmCotp6/GMhnX8tDZPv9detLg9WuBnWWi1ktBPlpbl1DREusy+TIh+9rgvfduQoA== +app-builder-lib@22.6.1: + version "22.6.1" + resolved "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-22.6.1.tgz#f17bfbde1bbb26ae438e450b66005bf6714feb30" + integrity sha512-ENL7r+H7IBfDb4faeLASgndsXrAT7AV7m7yJjcpbFDXYma6an7ZWGFIvR0HJrsfiC5TIB8kdLJ/aMSImrrSi/Q== dependencies: "7zip-bin" "~5.0.3" "@develar/schema-utils" "~2.6.5" async-exit-hook "^2.0.1" bluebird-lst "^1.0.9" - builder-util "22.6.0" + builder-util "22.6.1" builder-util-runtime "8.7.0" chromium-pickle-js "^0.2.0" debug "^4.1.1" ejs "^3.1.2" - electron-publish "22.6.0" + electron-publish "22.6.1" fs-extra "^9.0.0" hosted-git-info "^3.0.4" is-ci "^2.0.0" @@ -253,15 +253,15 @@ builder-util-runtime@8.7.0: debug "^4.1.1" sax "^1.2.4" -builder-util@22.6.0: - version "22.6.0" - resolved "https://registry.npmjs.org/builder-util/-/builder-util-22.6.0.tgz#25a3aca05d2c44949f0600282264dace8d289ee7" - integrity sha512-jgdES2ExJYkuXC3DEaGAjFctKNA81C4QDy8zdoc+rqdSqheTizuDNtZg02uMFklmUES4V4fggmqds+Y7wraqng== +builder-util@22.6.1: + version "22.6.1" + resolved "https://registry.npmjs.org/builder-util/-/builder-util-22.6.1.tgz#78172c3634da460325277ef798994592e595eff3" + integrity sha512-A9cF+bSHqRTSKIUHEyE92Tl0Uh12N7yZRH9bccIL3gRUwtp6ulF28LsjNIWTSQ1clZo2M895cT5PCrKzjPQFVg== dependencies: "7zip-bin" "~5.0.3" "@types/debug" "^4.1.5" "@types/fs-extra" "^8.1.0" - app-builder-bin "3.5.8" + app-builder-bin "3.5.9" bluebird-lst "^1.0.9" builder-util-runtime "8.7.0" chalk "^4.0.0" @@ -469,13 +469,13 @@ detect-node@^2.0.4: resolved "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== -dmg-builder@22.6.0: - version "22.6.0" - resolved "https://registry.npmjs.org/dmg-builder/-/dmg-builder-22.6.0.tgz#78c3dee24f5713f4844d458949041e31fe7eec30" - integrity sha512-rJxuGhHIpcuDGBtWZMM8aLxkbZNgYO2MO5dUerDIBXebhX1K8DA23iz/uZ8ahcRNgWEv57b8GDqJbXKEfr5T0A== +dmg-builder@22.6.1: + version "22.6.1" + resolved "https://registry.npmjs.org/dmg-builder/-/dmg-builder-22.6.1.tgz#5777a9eb6904db5bf1f4c69addbf462f5f9bf4e4" + integrity sha512-jUTN0acP15puzevtQASj7QEPgUGpedWSuSnOwR/++JbeYRTwU2oro09h/KZnaeMcxgxjdmT3tYLJeY1XUfPbRg== dependencies: - app-builder-lib "22.6.0" - builder-util "22.6.0" + app-builder-lib "22.6.1" + builder-util "22.6.1" fs-extra "^9.0.0" iconv-lite "^0.5.1" js-yaml "^3.13.1" @@ -504,24 +504,24 @@ duplexer3@^0.1.4: integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= ejs@^3.0.1, ejs@^3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/ejs/-/ejs-3.1.2.tgz#a9986e6920a60f2a3229e87d4f0f3c073209874c" - integrity sha512-zFuywxrAWtX5Mk2KAuoJNkXXbfezpNA0v7i+YC971QORguPekpjpAgeOv99YWSdKXwj7JxI2QAWDeDkE8fWtXw== + version "3.1.3" + resolved "https://registry.npmjs.org/ejs/-/ejs-3.1.3.tgz#514d967a8894084d18d3d47bd169a1c0560f093d" + integrity sha512-wmtrUGyfSC23GC/B1SMv2ogAUgbQEtDmTIhfqielrG5ExIM9TP4UoYdi90jLF1aTcsWCJNEO0UrgKzP0y3nTSg== dependencies: jake "^10.6.1" electron-builder@^22.4.0: - version "22.6.0" - resolved "https://registry.npmjs.org/electron-builder/-/electron-builder-22.6.0.tgz#3ac81634e27026892d66f3a52568e65a7d28d26a" - integrity sha512-aLHlB6DTfjJ3MI4AUIFeWnwIozNgNlbOk2c2sTHxB10cAKp0dBVSPZ7xF5NK0uwDhElvRzJQubnHtJD6zKg42Q== + version "22.6.1" + resolved "https://registry.npmjs.org/electron-builder/-/electron-builder-22.6.1.tgz#9cc704356ecba1342ff1c94d610aad1f3c6a8b02" + integrity sha512-3/VNg9GfXKHM53TilFtfF1+bsAR8THK1XHgeqCpsiequa02J9jTPc/DhpCUKQPkrs6/EIGxP7uboop7XYoew0Q== dependencies: - "@types/yargs" "^15.0.4" - app-builder-lib "22.6.0" + "@types/yargs" "^15.0.5" + app-builder-lib "22.6.1" bluebird-lst "^1.0.9" - builder-util "22.6.0" + builder-util "22.6.1" builder-util-runtime "8.7.0" chalk "^4.0.0" - dmg-builder "22.6.0" + dmg-builder "22.6.1" fs-extra "^9.0.0" is-ci "^2.0.0" lazy-val "^1.0.4" @@ -530,19 +530,19 @@ electron-builder@^22.4.0: update-notifier "^4.1.0" yargs "^15.3.1" -electron-publish@22.6.0: - version "22.6.0" - resolved "https://registry.npmjs.org/electron-publish/-/electron-publish-22.6.0.tgz#11dca595cfe3c0fdbc364c28dbb8838a1c6ec799" - integrity sha512-+v05SBf9qR7Os5au+fifloNHy5QxHQkUGudBj68YaTb43Pn37UkwRxSc49Lf13s4wW32ohM45g8BOVInPJEdnA== +electron-publish@22.6.1: + version "22.6.1" + resolved "https://registry.npmjs.org/electron-publish/-/electron-publish-22.6.1.tgz#d5381220d3e0f3bfa869c5a059fd253a561e0f8a" + integrity sha512-/MkS47ospdSfAFW5Jp52OzYou14HhGJpZ51uAc3GJ5rCfACeqpimC/n1ajRLE3hcXxTWfd3t9MCuClq5jrUO5w== dependencies: "@types/fs-extra" "^8.1.0" bluebird-lst "^1.0.9" - builder-util "22.6.0" + builder-util "22.6.1" builder-util-runtime "8.7.0" chalk "^4.0.0" fs-extra "^9.0.0" lazy-val "^1.0.4" - mime "^2.4.4" + mime "^2.4.5" electron-updater@^4.2.4: version "4.3.1" @@ -558,9 +558,9 @@ electron-updater@^4.2.4: semver "^7.1.3" electron@^8.2.0: - version "8.2.5" - resolved "https://registry.npmjs.org/electron/-/electron-8.2.5.tgz#ae3cb23d5517b2189fd35298e487198d65d1a291" - integrity sha512-LxSCUwmlfJtRwthd3ofpYaZ+1C2hQSW8Ep1DD9K3VbnDItO+kb3t1z35daJgAab78j54aOwo9gMxJtvU0Ftj6w== + version "8.3.0" + resolved "https://registry.npmjs.org/electron/-/electron-8.3.0.tgz#c2b565a4c10d6d287d20164bcd5a478468b940a9" + integrity sha512-XRjiIJICZCgUr2vKSUI2PTkfP0gPFqCtqJUaTJSfCTuE3nTrxBKOUNeRMuCzEqspKkpFQU3SB3MdbMSHmZARlQ== dependencies: "@electron/get" "^1.0.1" "@types/node" "^12.0.12" @@ -1004,7 +1004,7 @@ matcher@^2.1.0: dependencies: escape-string-regexp "^2.0.0" -mime@^2.4.4: +mime@^2.4.5: version "2.4.5" resolved "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz#d8de2ecb92982dedbb6541c9b6841d7f218ea009" integrity sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w== @@ -1361,9 +1361,9 @@ spdx-exceptions@^2.1.0: integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + version "3.0.1" + resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" From de3799637077befae5616dd06207de34b855a068 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 04:46:34 +0200 Subject: [PATCH 02/22] Fix loaded service indicator disappearing when modifying navigation --- resources/js/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/js/index.js b/resources/js/index.js index 7a43886..6ecf956 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -555,11 +555,14 @@ function updateNavigation() { // Update active list element for (let i = 0; i < services.length; i++) { const service = services[i]; - if (parseInt(selectedService) === i) { - service.li.classList.add('active'); - } else { - service.li.classList.remove('active'); - } + + // Active? + if (parseInt(selectedService) === i) service.li.classList.add('active'); + else service.li.classList.remove('active'); + + // Loaded? + if (service.viewReady) service.li.classList.add('loaded'); + else service.li.classList.remove('loaded'); } if (selectedService !== null && services[selectedService].viewReady) { From 517f0ef5a46ddc95127acc9ae0d581cb00c1e9e7 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 04:57:52 +0200 Subject: [PATCH 03/22] Fix service nav buttons drag and drop display --- resources/index.html | 6 ++++-- resources/style/index.css | 15 ++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/resources/index.html b/resources/index.html index c151bb2..978164a 100644 --- a/resources/index.html +++ b/resources/index.html @@ -22,8 +22,10 @@ -
    - +
    +
      + +
      diff --git a/resources/style/index.css b/resources/style/index.css index ae1243a..0ac8e42 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -10,13 +10,18 @@ body { width: 48px; } -#service-selector { +#service-buttons { flex-grow: 1; + + overflow: hidden auto; +} + +#service-selector { display: block; margin: 0; padding: 0; - overflow: hidden auto; + list-style: none; } #service-selector::-webkit-scrollbar { @@ -34,14 +39,14 @@ body { } #service-selector .drag-target button { - height: 56px; - padding-top: 88px; + height: 96px; + padding-top: 48px; } #service-selector .drag-target button::after, #service-last-drag-position.drag-target { content: ""; - height: 56px; + height: 48px; border: 1px dashed #fff; box-sizing: border-box; From c503016941d23bf86773841b8e93c245af73d758 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 05:18:15 +0200 Subject: [PATCH 04/22] Fix uncaught promise error --- resources/js/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/js/index.js b/resources/js/index.js index 6ecf956..62503ad 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -619,7 +619,8 @@ function setContextMenu(webContents) { label: 'Open URL in default browser', click: () => { if (props.linkURL.startsWith('https://')) { - shell.openExternal(props.linkURL); + shell.openExternal(props.linkURL) + .catch(console.error); } }, })); From 7dea8d94843ecb40678a37db5fe46e1f9d793388 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 05:28:52 +0200 Subject: [PATCH 05/22] Greatly improve service reordering drag and drop --- resources/js/index.js | 28 +++++++++++++++++++++------- resources/style/index.css | 4 +--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/resources/js/index.js b/resources/js/index.js index 62503ad..f2f266e 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -22,6 +22,7 @@ let addButton; let emptyPage; let urlPreview; +let lastDragPosition; // Service context menu function openServiceContextMenu(event, serviceId) { @@ -146,7 +147,7 @@ ipcRenderer.on('data', (event, appData, brandIcons, solidIcons, actualServices, } // Init drag last position - const lastDragPosition = document.getElementById('service-last-drag-position'); + lastDragPosition = document.getElementById('service-last-drag-position'); lastDragPosition.addEventListener('dragover', () => { const index = services.length; if (draggedId !== index && draggedId !== index - 1) { @@ -311,13 +312,25 @@ function initDrag(index, li) { event.dataTransfer.dropEffect = 'move'; document.getElementById('service-last-drag-position').classList.remove('hidden'); }); - li.addEventListener('dragover', () => { - if (draggedId !== index && draggedId !== index - 1) { - resetDrag(); - lastDragTarget = dragTargetId = index; - document.getElementById('service-last-drag-position').classList.remove('hidden'); - li.classList.add('drag-target'); + li.addEventListener('dragover', (e) => { + let realIndex = index; + let rect = li.getBoundingClientRect(); + + if ((e.clientY - rect.y) / rect.height >= 0.5) { + realIndex++; } + + if (draggedId === realIndex - 1) { + realIndex--; + } + + resetDrag(); + let el = realIndex === services.length ? lastDragPosition : services[realIndex].li; + lastDragTarget = dragTargetId = realIndex; + lastDragPosition.classList.remove('hidden'); + el.classList.add('drag-target'); + + if (draggedId === realIndex || draggedId === realIndex - 1) el.classList.add('drag-target-self'); }); li.addEventListener('dragend', () => { reorderService(draggedId, lastDragTarget); @@ -331,6 +344,7 @@ function resetDrag() { dragTargetCount = 0; document.getElementById('service-selector').querySelectorAll('li').forEach(li => { li.classList.remove('drag-target'); + li.classList.remove('drag-target-self'); }); const lastDragPosition = document.getElementById('service-last-drag-position'); lastDragPosition.classList.remove('drag-target'); diff --git a/resources/style/index.css b/resources/style/index.css index 0ac8e42..639db37 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -38,7 +38,7 @@ body { user-drag: none; } -#service-selector .drag-target button { +#service-selector .drag-target:not(.drag-target-self) button { height: 96px; padding-top: 48px; } @@ -49,8 +49,6 @@ body { height: 48px; border: 1px dashed #fff; box-sizing: border-box; - - background-color: rgb(43, 43, 43); } #service-selector .drag-target button::after { From 27c27f2e0457eed1d1cea1e4e7f5f862d8eeff29 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 05:34:00 +0200 Subject: [PATCH 06/22] Reorder services without switching to the reordered service --- resources/js/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/js/index.js b/resources/js/index.js index f2f266e..046ebc0 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -23,6 +23,7 @@ let emptyPage; let urlPreview; let lastDragPosition; +let oldActiveService; // For service reordering // Service context menu function openServiceContextMenu(event, serviceId) { @@ -216,16 +217,19 @@ ipcRenderer.on('reorderService', (e, serviceId, targetId) => { const oldServices = services; services = []; + let newId = targetId; + for (let i = 0; i < targetId; i++) { if (i !== serviceId) { services.push(oldServices[i]); + if (i === oldActiveService) newId = i; } } services.push(oldServices[serviceId]); - const newId = services.length - 1; for (let i = targetId; i < oldServices.length; i++) { if (i !== serviceId) { services.push(oldServices[i]); + if (i === oldActiveService) newId = i; } } @@ -354,6 +358,7 @@ function resetDrag() { function reorderService(serviceId, targetId) { console.log('Reordering service', serviceId, targetId); if (targetId >= 0) { + oldActiveService = selectedService; setActiveService(null); ipcRenderer.send('reorderService', serviceId, targetId); } From 635339652234d9662a4644801bb9afccf6b40dcb Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 05:40:25 +0200 Subject: [PATCH 07/22] Make service reordering drag and drop display not modify nav height --- resources/style/index.css | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/resources/style/index.css b/resources/style/index.css index 639db37..4534804 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -38,17 +38,20 @@ body { user-drag: none; } -#service-selector .drag-target:not(.drag-target-self) button { - height: 96px; - padding-top: 48px; -} - #service-selector .drag-target button::after, #service-last-drag-position.drag-target { content: ""; + height: 4px; + transform: translateY(-50%); + border: 0; + box-sizing: border-box; + background: #fff9; +} + +#service-selector .drag-target-self button::after { height: 48px; border: 1px dashed #fff; - box-sizing: border-box; + transform: none; } #service-selector .drag-target button::after { @@ -58,18 +61,6 @@ body { width: 100%; } -#service-last-drag-position:not(.hidden):not(.drag-target) { - display: block; - padding: 16px 4px; - background-color: #fff5; -} - -#service-last-drag-position:not(.drag-target)::after { - content: ""; - display: block; - border-bottom: 1px solid #fff; -} - #service-selector .drag-target::after { top: 75% !important; } From 9aba84abf7292df2d0101a859c5c792e9abd915c Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 05:49:50 +0200 Subject: [PATCH 08/22] Fix reordering without switching to the reordered service See 27c27f2e0457eed1d1cea1e4e7f5f862d8eeff29 --- resources/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/index.js b/resources/js/index.js index 046ebc0..e3f7a0f 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -222,14 +222,14 @@ ipcRenderer.on('reorderService', (e, serviceId, targetId) => { for (let i = 0; i < targetId; i++) { if (i !== serviceId) { services.push(oldServices[i]); - if (i === oldActiveService) newId = i; + if (i === oldActiveService) newId = services.length - 1; } } services.push(oldServices[serviceId]); for (let i = targetId; i < oldServices.length; i++) { if (i !== serviceId) { services.push(oldServices[i]); - if (i === oldActiveService) newId = i; + if (i === oldActiveService) newId = services.length - 1; } } From 63229428ca24779791749aa2ea41f6b2bb871742 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 05:50:10 +0200 Subject: [PATCH 09/22] Do not shrink nav childs except service buttons --- resources/style/index.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/style/index.css b/resources/style/index.css index 4534804..2f42e37 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -10,6 +10,10 @@ body { width: 48px; } +#navigation > :not(#service-buttons) { + flex-shrink: 0; +} + #service-buttons { flex-grow: 1; From 13173334bf520b266704c496b4904770b2268e3d Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 05:56:28 +0200 Subject: [PATCH 10/22] Add home history button --- resources/index.html | 1 + resources/js/index.js | 16 +++++++++++++--- resources/style/index.css | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/resources/index.html b/resources/index.html index 978164a..3fe0567 100644 --- a/resources/index.html +++ b/resources/index.html @@ -18,6 +18,7 @@
      diff --git a/resources/js/index.js b/resources/js/index.js index b5aeb05..c60f5d7 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -16,9 +16,7 @@ const icons = []; let services = []; let selectedService = null; -let homeButton; -let forwardButton; -let backButton; +let homeButton, forwardButton, backButton, reloadButton; let addButton; let emptyPage; let urlPreview; @@ -375,6 +373,9 @@ document.addEventListener('DOMContentLoaded', () => { backButton = document.getElementById('back'); backButton.addEventListener('click', () => goBack()); + reloadButton = document.getElementById('reload'); + reloadButton.addEventListener('click', () => reload()); + addButton = document.getElementById('add-button'); addButton.addEventListener('click', () => ipcRenderer.send('openServiceSettings', null)); }); @@ -627,6 +628,10 @@ function goBack() { if (view) remote.webContents.fromId(view.getWebContentsId()).goBack(); } +function reload() { + reloadService(selectedService); +} + function setContextMenu(webContents) { webContents.on('context-menu', (event, props) => { const menu = new Menu(); From afb1c5131e212f6481c3295e14a05cc085e68825 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 07:00:14 +0200 Subject: [PATCH 12/22] Add status icon to inform user about secure/not secure connection --- resources/index.html | 17 ++++++++-- resources/js/index.js | 18 ++++++++++- resources/style/index.css | 67 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 97 insertions(+), 5 deletions(-) diff --git a/resources/index.html b/resources/index.html index e297f01..067ab61 100644 --- a/resources/index.html +++ b/resources/index.html @@ -18,10 +18,21 @@