diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 0efcc37d..cf34be49 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -539,6 +539,10 @@ "message": "Not saved due to these invalid rules:", "description": "Invalid linter rules will show a message followed by a list of invalid rules" }, + "setLinterResetMessage": { + "message": "To undo accidental reset, press Ctrl-Z (or Cmd-Z) in the text box", + "description": "Reset button tooltip to inform user on how to undo an accidental reset" + }, "showCSSLintSettings": { "message": "(Set rules: 0 = disabled; 1 = warning; 2 = error)", "description": "CSSLint rule settings values" diff --git a/edit/lint.js b/edit/lint.js index c932fd9f..40193cdd 100644 --- a/edit/lint.js +++ b/edit/lint.js @@ -350,8 +350,14 @@ function openStylelintSettings() { function setupLinterPopup(rules) { const linter = prefs.get('editor.linter'); const linterTitle = linter === 'stylelint' ? 'Stylelint' : 'CSSLint'; - function makeButton(className, text) { - return $element({tag: 'button', className, type: 'button', textContent: t(text), dataset: {linter}}); + function makeButton(className, text, options = {}) { + return $element(Object.assign(options, { + tag: 'button', + className, + type: 'button', + textContent: t(text), + dataset: {linter} + })); } function makeLink(url, textContent) { return $element({tag: 'a', target: '_blank', href: url, textContent}); @@ -377,7 +383,7 @@ function setupLinterPopup(rules) { }), makeButton('save', 'styleSaveLabel'), makeButton('cancel', 'confirmCancel'), - makeButton('reset', 'genericResetLabel'), + makeButton('reset', 'genericResetLabel', {title: t('setLinterResetMessage')}), $element({ tag: 'span', className: 'saved-message',