From 2a4e55dfec03e5521cc7494bafed3c030e6d6952 Mon Sep 17 00:00:00 2001 From: tophf <tophf@gmx.com> Date: Tue, 9 Feb 2021 09:36:34 +0300 Subject: [PATCH] improve linter info popup * show rule id so the user can configure it * add "configure" button to show the linter config UI * add margins between items --- edit/edit.css | 6 ++++++ edit/linter-dialogs.js | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/edit/edit.css b/edit/edit.css index 866d3477..19761ff0 100644 --- a/edit/edit.css +++ b/edit/edit.css @@ -729,6 +729,12 @@ body:not(.find-open) [data-match-highlight-count="1"] .CodeMirror-selection-high #help-popup .rules { padding: 0 15px; } +#help-popup .rules li { + padding-top: .5em; +} +#help-popup .rules p { + margin: .25em 0; +} #help-popup button { margin-right: 3px; } diff --git a/edit/linter-dialogs.js b/edit/linter-dialogs.js index d06ae941..2305fa35 100644 --- a/edit/linter-dialogs.js +++ b/edit/linter-dialogs.js @@ -74,9 +74,9 @@ const rule = RULES.csslint.find(rule => rule.id === ruleID); return rule && $create('li', [ - $create('b', $createLink(rule.url || baseUrl, rule.name)), - $create('br'), - rule.desc, + $create('b', ruleID + ': '), + rule.url ? $createLink(`"${rule.url}"`, rule.name) : $create('span', `"${rule.name}"`), + $create('p', rule.desc), ]); }; } else { @@ -91,6 +91,7 @@ $create([ header[0], headerLink, header[1], $create('ul.rules', [...activeRules].map(template)), + $create('button', {onclick: linterMan.showLintConfig}, t('configureStyle')), ])); };