From 7b725ccc58b586795cfd46d84ed27cd693d34d64 Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Sat, 29 May 2021 18:15:14 +0300 Subject: [PATCH] use less saturated color highlighter color scheme --- html_resources/main.css | 16 ++++++++-------- html_resources/selector.js | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/html_resources/main.css b/html_resources/main.css index 4949fef..5fc62f8 100644 --- a/html_resources/main.css +++ b/html_resources/main.css @@ -91,17 +91,17 @@ pre > div{ .categoryList:not(.blurred)+.categoryList, .hidden{ display: none !important } -.comment{ color: rgb(50,180,20) } -.selector{ color: palegoldenrod } +.comment{ color: rgb(50,180,90) } +.selector{ color: silver } .pseudo{ color: silver } -.id{ color: lightcoral } -.class{ color: lightgreen } -.attribute{ color: cyan } -.atrule{ color: mediumslateblue } +.id{ color: rgb(240, 148, 138) } +.class{ color: skyblue } +.attribute{ color: rgb(210,120,190) } +.atrule{ color: lime } .atvalue{ color: lightblue } -.property{ color: orange } +.property{ color: palegoldenrod } .value{ color: skyblue } -.curly{ color: orangered } +.curly{ color: magenta } @keyframes showDelayed{ from{ visibility: hidden } to{ visibility: visibile }} diff --git a/html_resources/selector.js b/html_resources/selector.js index c0aa673..d9cadd1 100644 --- a/html_resources/selector.js +++ b/html_resources/selector.js @@ -35,10 +35,10 @@ function fetchWithType(url){ } if(ext === "json"){ response.json() - .then(r=>resolve(r)) + .then(resolve) }else{ response.text() - .then(r=>resolve(r)) + .then(resolve) } },except => reject(except)) @@ -457,13 +457,15 @@ async function handleSearchQuery(){ return } - const codeBlock = document.querySelector("pre"); - let composedText = ""; - for(let file of files){ - composedText += await fetchWithType(`chrome/${file}`); - composedText += "\n"; - } - Highlighter.parse(codeBlock,composedText) + const codeBlock = document.querySelector("pre"); + const promises = files.map(file=>fetchWithType(`chrome/${file}`).catch(e=>"")); + + Promise.all(promises) + .then(responses => { + + Highlighter.parse(codeBlock,responses.join("\n\n/*************************************/\n\n")) + }); + } }