From fc5ef0f89ab5242485c95a96dcf34ba9dbb19071 Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Fri, 5 Jun 2020 12:48:42 +0300 Subject: [PATCH] don't show file extension in target items --- html_resources/ext.svg | 5 +++++ html_resources/main.css | 3 ++- html_resources/selector.js | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 html_resources/ext.svg diff --git a/html_resources/ext.svg b/html_resources/ext.svg new file mode 100644 index 0000000..2edf190 --- /dev/null +++ b/html_resources/ext.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/html_resources/main.css b/html_resources/main.css index 16fbef1..6b44cf6 100644 --- a/html_resources/main.css +++ b/html_resources/main.css @@ -28,8 +28,9 @@ pre:empty{ display: none } max-width: 50ch; cursor: pointer } +.target > a::after{ content: ""; width: 1ch; background-image: url("ext.svg") } .target:hover{ background-color: rgb(80,80,90) } -#targets{ display: flex; flex-wrap: wrap } +#targets{ display: grid; grid-template-columns: 1fr 1fr 1fr } pre{ white-space: pre-wrap; diff --git a/html_resources/selector.js b/html_resources/selector.js index 27e45a0..c67350a 100644 --- a/html_resources/selector.js +++ b/html_resources/selector.js @@ -52,7 +52,7 @@ let previousCategory = new (function(){ })() function getText(node){ - return node.childNodes[0].textContent + return `${node.childNodes[0].textContent}.css` } async function onCategoryClicked(categoryNode){ @@ -98,12 +98,12 @@ function createCategories(){ const createNode = function(name,type){ let node = document.createElement("div"); node.classList.add(type); - node.textContent = name; + node.textContent = name.substring(0,name.lastIndexOf(".")); if(type === "target"){ let link = node.appendChild(document.createElement("a")); node.classList.add("hidden"); link.href = `https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/${name}`; - link.textContent = "Github"; + link.title = "See on Github"; } return node;