From 059f3cd3486f8572c2c0a2af1e6250aa0edb3db2 Mon Sep 17 00:00:00 2001 From: TB-96 <63296876+TB-96@users.noreply.github.com> Date: Sat, 31 Jul 2021 14:18:42 +0200 Subject: [PATCH] Update script.js Fix annoying spaces in two letter prefixes --- assets/js/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/script.js b/assets/js/script.js index e72932d..304b138 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -2,7 +2,7 @@ * Evening Startpage * Inspired by https://github.com/jeroenpardon/sui * You can find it at https://github.com/TB-96/Evening-Startpage - * Made by TB-96 2020 + * Made by TB-96 2021 * */ @@ -63,7 +63,7 @@ function engines () { g: ['https://google.com/search?q=', 'Google'], i: ['https://google.com/search?tbm=isch&q=', 'Google Images'], yt: ['https://youtube.com/results?search_query=', 'Youtube'], - s: ['https://stackoverflow.com/search?q=', 'Stackoverflow'], + s: ['https://stackoverflow.com/search?q=', 'Stackoverflow'], a: ['https://web.archive.org/web/*/', 'Archive'], w: ['https://en.wikipedia.org/w/index.php?search=', 'Wikipedia'], }; @@ -99,7 +99,7 @@ document.onkeypress = (e) => { if (e.key == 'Enter') { if (prefix.indexOf('!') == 0) - (engine = engines[prefix.substr(1)][0], str = 3); + (engine = engines[prefix.substr(1)][0], str = prefix.length + 1); window.location = engine + args.join(' ').substr(str).toString().replace(/\s+/m, '%20'); } else if (e.keyCode == 27)