diff options
author | 2019-08-31 01:56:57 +0800 | |
---|---|---|
committer | 2019-08-31 00:56:57 +0700 | |
commit | 0ca864af6da9cac9f503e4abd0c58b60fbe1abc6 (patch) | |
tree | 54e13e05f1da1bb15bb7432b01b2e14f6e32c307 /source/features/clean-rich-text-editor.ts | |
parent | cd6e8e1b16a016dfea57872c922e95a5878725ab (diff) | |
download | refined-github-0ca864af6da9cac9f503e4abd0c58b60fbe1abc6.tar.gz refined-github-0ca864af6da9cac9f503e4abd0c58b60fbe1abc6.tar.zst refined-github-0ca864af6da9cac9f503e4abd0c58b60fbe1abc6.zip |
Hide unnecessary tip on comment field (#2375)
Diffstat (limited to 'source/features/clean-rich-text-editor.ts')
-rw-r--r-- | source/features/clean-rich-text-editor.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source/features/clean-rich-text-editor.ts b/source/features/clean-rich-text-editor.ts new file mode 100644 index 00000000..cfcea805 --- /dev/null +++ b/source/features/clean-rich-text-editor.ts @@ -0,0 +1,34 @@ +import './clean-rich-text-editor.css'; +import select from 'select-dom'; +import features from '../libs/features'; + +function hideButtons(): void { + document.body.classList.add('rgh-clean-rich-text-editor'); +} + +function hideTextareaTooltip(): void { + for (const textarea of select.all('.comment-form-textarea')) { + textarea.title = ''; + } +} + +features.add({ + id: __featureName__, + description: 'Hides unnecessary comment field tooltips and toolbar items.', + screenshot: 'https://user-images.githubusercontent.com/1402241/53629083-a4fe8900-3c47-11e9-8211-bfe2d254ffcb.png', + include: [ + features.hasRichTextEditor + ], + load: features.onAjaxedPages, + init: hideTextareaTooltip +}); + +features.add({ + id: __featureName__, + description: '', + screenshot: '', + include: [ + features.isRepo + ], + init: hideButtons +}); |