diff options
author | 2021-05-25 09:54:41 +0300 | |
---|---|---|
committer | 2021-05-25 13:54:41 +0700 | |
commit | 2c6cbdf9c84329a06b62461c615f97ef935e5459 (patch) | |
tree | 570f9e3825272c2ae1568709b5fdc5b29fbcaa2c | |
parent | bb1e212200ee4917a964600248a522516bac45ef (diff) | |
download | refined-github-2c6cbdf9c84329a06b62461c615f97ef935e5459.tar.gz refined-github-2c6cbdf9c84329a06b62461c615f97ef935e5459.tar.zst refined-github-2c6cbdf9c84329a06b62461c615f97ef935e5459.zip |
Extend `separate-draft-pr-button` to `one-click-pr-or-gist` (#4382)
-rw-r--r-- | readme.md | 2 | ||||
-rw-r--r-- | source/features/one-click-pr-or-gist.css | 5 | ||||
-rw-r--r-- | source/features/one-click-pr-or-gist.tsx (renamed from source/features/separate-draft-pr-button.tsx) | 6 | ||||
-rw-r--r-- | source/options-storage.ts | 1 | ||||
-rw-r--r-- | source/refined-github.ts | 2 |
5 files changed, 12 insertions, 4 deletions
@@ -269,7 +269,7 @@ Thanks for contributing! π¦π - [](# "warning-for-disallow-edits") [Warns you when unchecking `Allow edits from maintainers`, as itβs maintainer-hostile.](https://user-images.githubusercontent.com/1402241/53151888-24101380-35ef-11e9-8d30-d6315ad97325.gif) - [](# "pull-request-hotkey") [Adds keyboard shortcuts to cycle through PR tabs: <kbd>g</kbd> <kbd>β</kbd> and <kbd>g</kbd> <kbd>β</kbd>, or <kbd>g</kbd> <kbd>1</kbd>, <kbd>g</kbd> <kbd>2</kbd>, <kbd>g</kbd> <kbd>3</kbd> and <kbd>g</kbd> <kbd>4</kbd>](https://user-images.githubusercontent.com/16872793/94634958-7e7b5680-029f-11eb-82ea-1f96cd11e4cd.png). - [](# "pr-branch-auto-delete") Automatically deletes the branch right after merging a PR, if possible. -- [](# "separate-draft-pr-button") [Lets you create draft pull requests in one click.](https://user-images.githubusercontent.com/202916/67269317-cd791300-f4b6-11e9-89d1-392de7ef71e1.png) +- [](# "one-click-pr-or-gist") [Lets you create draft pull requests and public gists in one click.](https://user-images.githubusercontent.com/723651/119256942-cacb2c00-bbcb-11eb-905b-3434e5c2fdcc.jpg) - [](# "clear-pr-merge-commit-message") [Clears the PR merge commit message of clutter, leaving only deduplicated co-authors.](https://user-images.githubusercontent.com/1402241/79257078-62b6fc00-7e89-11ea-8798-c06f33baa94b.png) - [](# "faster-reviews") [Adds a review button to the PR sidebar, automatically focuses the review textarea and adds a keyboard shortcut to open the review popup: <kbd>v</kbd>.](https://user-images.githubusercontent.com/202916/83269671-bb3b2200-a1c7-11ea-90b3-b9457a454162.png) - [](# "use-first-commit-message-for-new-prs") [Uses the first commit for a new PRβs title and description.](https://user-images.githubusercontent.com/16872793/87246205-ccf42400-c419-11ea-86d5-0e6570d99e6e.gif) diff --git a/source/features/one-click-pr-or-gist.css b/source/features/one-click-pr-or-gist.css new file mode 100644 index 00000000..08cad4b4 --- /dev/null +++ b/source/features/one-click-pr-or-gist.css @@ -0,0 +1,5 @@ +/* For the 1st button "Create public Gist" */ +#gists + div button[value='1'] { + margin-left: auto !important; + margin-right: 0; +} diff --git a/source/features/separate-draft-pr-button.tsx b/source/features/one-click-pr-or-gist.tsx index e2f2eaba..806cd53d 100644 --- a/source/features/separate-draft-pr-button.tsx +++ b/source/features/one-click-pr-or-gist.tsx @@ -1,3 +1,4 @@ +import './one-click-pr-or-gist.css'; import React from 'dom-chef'; import select from 'select-dom'; import * as pageDetect from 'github-url-detection'; @@ -5,7 +6,7 @@ import * as pageDetect from 'github-url-detection'; import features from '.'; function init(): void | false { - const draftPROption = select('.new-pr-form [name="draft"]'); + const draftPROption = select('.new-pr-form [name="draft"], #new_gist [name="gist[public]"]'); if (!draftPROption) { // 1. Free accounts can't open Draft PRs in private repos, so this element is missing // 2. PRs can't be created from some comparison pages: Either base is a tag, not a branch; or there already exists a PR. @@ -44,7 +45,8 @@ function init(): void | false { void features.add(__filebasename, { include: [ - pageDetect.isCompare + pageDetect.isCompare, + pageDetect.isGist ], init }); diff --git a/source/options-storage.ts b/source/options-storage.ts index 11eeda31..47d79300 100644 --- a/source/options-storage.ts +++ b/source/options-storage.ts @@ -20,6 +20,7 @@ const defaults = Object.assign({ // TODO[2021-10-01]: Drop classes `muted-link`, `link-gray`, `link-gray-dark`, `text-gray`, `text-gray-light`, `text-gray-dark`, `text-green`, `text-red` `text-blue` #4021 const migrations = [ featureWasRenamed('collapse-markdown-sections', 'collapse-wiki-sections'), // Merged in May + featureWasRenamed('separate-draft-pr-button', 'one-click-pr-or-gist'), // Removed features will be automatically removed from the options as well OptionsSyncPerDomain.migrations.removeUnused diff --git a/source/refined-github.ts b/source/refined-github.ts index 15624681..97275fee 100644 --- a/source/refined-github.ts +++ b/source/refined-github.ts @@ -147,7 +147,7 @@ import './features/reload-failed-proxied-images'; import './features/clean-rich-text-editor'; import './features/highlight-collaborators-and-own-conversations'; import './features/embed-gist-via-iframe'; -import './features/separate-draft-pr-button'; +import './features/one-click-pr-or-gist'; import './features/link-to-prior-blame-line'; import './features/dim-bots'; import './features/conflict-marker'; |