瀏覽代碼

Adds support gitlens command and icon to views

main
Eric Amodio 6 年之前
父節點
當前提交
df07b28065
共有 15 個檔案被更改,包括 141 行新增51 行删除
  1. +2
    -2
      BACKERS.md
  2. +4
    -4
      README.md
  3. +3
    -0
      images/dark/icon-gear.svg
  4. +3
    -0
      images/dark/icon-heart.svg
  5. +3
    -0
      images/light/icon-gear.svg
  6. +3
    -0
      images/light/icon-heart.svg
  7. +51
    -28
      package.json
  8. +1
    -0
      src/commands.ts
  9. +1
    -0
      src/commands/common.ts
  10. +14
    -0
      src/commands/supportGitLens.ts
  11. +1
    -0
      src/constants.ts
  12. +39
    -2
      src/messages.ts
  13. +1
    -0
      src/ui/config.ts
  14. +4
    -4
      src/ui/settings/index.html
  15. +11
    -11
      src/ui/welcome/index.html

+ 2
- 2
BACKERS.md 查看文件

@ -1,8 +1,8 @@
<h1 align="center">Sponsors &amp; Backers</h1>
To my incredible backers &mdash; thank you so much for your contributions. I am truly humbled by your generosity and support. Please know that your support plays a important role in helping me realize GitLens' potential in making developer's lives easier.
To my incredible backers &mdash; thank you so much for your contributions. I am truly humbled by your generosity and support. Please know that your support plays an important role in helping me realize GitLens' potential in making developer's lives easier.
If you'd like to join them in supporting GitLens, please consider:
If you'd like to join in supporting GitLens, please consider:
- [Become a backer or sponsor on Patreon](https://www.patreon.com/eamodio)
- [PayPal donations](https://www.paypal.me/eamodio)

+ 4
- 4
README.md 查看文件

@ -61,13 +61,13 @@ While I enjoy giving my free time and attention to GitLens' development and grow
### Show Your Support &#x2764;
To my incredible backers &mdash; thank you so much for your contributions. I am truly humbled by your generosity and support. Please know that your support plays a important role in helping me realize GitLens' potential in making developer's lives easier.
To my incredible backers &mdash; thank you so much for your contributions. I am truly humbled by your generosity and support. Please know that your support plays an important role in helping me realize GitLens' potential in making developer's lives easier.
If you'd like to join them in supporting GitLens, please consider the following &mdash; feel free to choose more than one. &#x1F609;
If you'd like to join in supporting GitLens, please consider the following &mdash; feel free to choose more than one. &#x1F609;
- [Become a Sponsor](https://www.patreon.com/eamodio 'Become a sponsor on Patreon') &mdash; join the growing group of generous [backers](https://github.com/eamodio/vscode-gitlens/blob/master/BACKERS.md)
- [Donations via PayPal](https://www.paypal.me/eamodio 'One-time donations via PayPal')
- [Donations via Cash App](https://cash.me/$eamodio 'One-time donations via Cash App')
- [Donate via PayPal](https://www.paypal.me/eamodio 'Donate via PayPal')
- [Donate via Cash App](https://cash.me/$eamodio 'Donate via Cash App')
- [Write a Review](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#review-details 'Write a review')
- [Star or Fork me on GitHub](https://github.com/eamodio/vscode-gitlens 'Star or fork me on GitHub')
- [Follow me on Twitter](https://twitter.com/eamodio 'Follow me on Twitter')

+ 3
- 0
images/dark/icon-gear.svg 查看文件

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22">
<path fill="#C5C5C5" d="M15 11.775v-1.6l-1.94-.64-.45-1.09.88-1.84-1.13-1.13-1.81.91-1.09-.45-.69-1.92h-1.6l-.63 1.94-1.11.45-1.84-.88-1.13 1.13.91 1.81-.45 1.09-1.92.68v1.59l1.94.64.45 1.09-.88 1.84 1.13 1.13 1.81-.91 1.09.45.69 1.92h1.59l.63-1.94 1.11-.45 1.84.88 1.13-1.13-.92-1.81.47-1.09 1.92-.69v.02zm-7 2.23c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z"/>
</svg>

+ 3
- 0
images/dark/icon-heart.svg 查看文件

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22">
<path fill="#C5C5C5" d="M11 5.5c-.97 0-1.69.42-2.2 1-.51.58-.78.92-.8 1-.02-.08-.28-.42-.8-1-.52-.58-1.17-1-2.2-1-1.632.086-2.954 1.333-3 3 0 .52.09 1.52.67 2.67.58 1.15 2.34 2.94 5.33 5.33 2.98-2.39 4.77-4.17 5.34-5.33.57-1.16.66-2.17.66-2.67-.047-1.69-1.342-2.913-3-3z"/>
</svg>

+ 3
- 0
images/light/icon-gear.svg 查看文件

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22">
<path fill="#424242" d="M15 11.775v-1.6l-1.94-.64-.45-1.09.88-1.84-1.13-1.13-1.81.91-1.09-.45-.69-1.92h-1.6l-.63 1.94-1.11.45-1.84-.88-1.13 1.13.91 1.81-.45 1.09-1.92.68v1.59l1.94.64.45 1.09-.88 1.84 1.13 1.13 1.81-.91 1.09.45.69 1.92h1.59l.63-1.94 1.11-.45 1.84.88 1.13-1.13-.92-1.81.47-1.09 1.92-.69v.02zm-7 2.23c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z"/>
</svg>

+ 3
- 0
images/light/icon-heart.svg 查看文件

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22">
<path fill="#424242" d="M11 5.5c-.97 0-1.69.42-2.2 1-.51.58-.78.92-.8 1-.02-.08-.28-.42-.8-1-.52-.58-1.17-1-2.2-1-1.632.086-2.954 1.333-3 3 0 .52.09 1.52.67 2.67.58 1.15 2.34 2.94 5.33 5.33 2.98-2.39 4.77-4.17 5.34-5.33.57-1.16.66-2.17.66-2.67-.047-1.69-1.342-2.913-3-3z"/>
</svg>

+ 51
- 28
package.json 查看文件

@ -1448,7 +1448,8 @@
"suppressGitVersionWarning": false,
"suppressLineUncommittedWarning": false,
"suppressNoRepositoryWarning": false,
"suppressShowKeyBindingsNotice": false
"suppressShowKeyBindingsNotice": false,
"suppressSupportGitLensNotification": false
},
"properties": {
"suppressCommitHasNoPreviousCommitWarning": {
@ -1482,6 +1483,10 @@
"suppressShowKeyBindingsNotice": {
"type": "boolean",
"default": false
},
"suppressSupportGitLensNotification": {
"type": "boolean",
"default": false
}
},
"description": "Specifies which messages should be suppressed",
@ -1574,9 +1579,22 @@
],
"commands": [
{
"command": "gitlens.supportGitLens",
"title": "Support GitLens ❤",
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-heart.svg",
"light": "images/light/icon-heart.svg"
}
},
{
"command": "gitlens.showSettingsPage",
"title": "Open Settings",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-gear.svg",
"light": "images/light/icon-gear.svg"
}
},
{
"command": "gitlens.showWelcomePage",
@ -3309,22 +3327,22 @@
{
"command": "gitlens.pushRepositories",
"when": "gitlens:enabled && view =~ /^gitlens\\.views\\.repositories:/",
"group": "navigation@6"
"group": "navigation@10"
},
{
"command": "gitlens.pullRepositories",
"when": "gitlens:enabled && view =~ /^gitlens\\.views\\.repositories:/",
"group": "navigation@7"
"group": "navigation@11"
},
{
"command": "gitlens.fetchRepositories",
"when": "gitlens:enabled && view =~ /^gitlens\\.views\\.repositories:/",
"group": "navigation@8"
"group": "navigation@12"
},
{
"command": "gitlens.views.repositories.refresh",
"when": "view =~ /^gitlens\\.views\\.repositories:/",
"group": "navigation@98"
"group": "navigation@99"
},
{
"command": "gitlens.views.repositories.setFilesLayoutToAuto",
@ -3354,17 +3372,17 @@
{
"command": "gitlens.views.fileHistory.setEditorFollowingOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && !gitlens:views:fileHistory:editorFollowing",
"group": "navigation@1"
"group": "navigation@10"
},
{
"command": "gitlens.views.fileHistory.setEditorFollowingOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && gitlens:views:fileHistory:editorFollowing",
"group": "navigation@1"
"group": "navigation@10"
},
{
"command": "gitlens.views.fileHistory.changeBase",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/",
"group": "navigation@2"
"group": "navigation@11"
},
{
"command": "gitlens.views.fileHistory.refresh",
@ -3384,17 +3402,17 @@
{
"command": "gitlens.views.lineHistory.setEditorFollowingOn",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && !gitlens:views:lineHistory:editorFollowing",
"group": "navigation@1"
"group": "navigation@10"
},
{
"command": "gitlens.views.lineHistory.setEditorFollowingOff",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && gitlens:views:lineHistory:editorFollowing",
"group": "navigation@1"
"group": "navigation@10"
},
{
"command": "gitlens.views.lineHistory.changeBase",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/",
"group": "navigation@2"
"group": "navigation@11"
},
{
"command": "gitlens.views.lineHistory.refresh",
@ -3414,22 +3432,22 @@
{
"command": "gitlens.views.compare.selectForCompare",
"when": "view =~ /^gitlens\\.views\\.compare:/",
"group": "navigation@1"
},
{
"command": "gitlens.views.compare.clear",
"when": "view =~ /^gitlens\\.views\\.compare:/",
"group": "navigation@2"
"group": "navigation@10"
},
{
"command": "gitlens.views.compare.setKeepResultsToOn",
"when": "view =~ /^gitlens\\.views\\.compare:/ && !gitlens:views:compare:keepResults",
"group": "navigation@3"
"group": "navigation@11"
},
{
"command": "gitlens.views.compare.setKeepResultsToOff",
"when": "view =~ /^gitlens\\.views\\.compare:/ && gitlens:views:compare:keepResults",
"group": "navigation@3"
"group": "navigation@11"
},
{
"command": "gitlens.views.compare.clear",
"when": "view =~ /^gitlens\\.views\\.compare:/",
"group": "navigation@98"
},
{
"command": "gitlens.views.compare.refresh",
@ -3454,22 +3472,22 @@
{
"command": "gitlens.views.search.searchCommits",
"when": "view =~ /^gitlens\\.views\\.search:/",
"group": "navigation@1"
},
{
"command": "gitlens.views.search.clear",
"when": "view =~ /^gitlens\\.views\\.search:/",
"group": "navigation@2"
"group": "navigation@10"
},
{
"command": "gitlens.views.search.setKeepResultsToOn",
"when": "view =~ /^gitlens\\.views\\.search:/ && !gitlens:views:search:keepResults",
"group": "navigation@3"
"group": "navigation@11"
},
{
"command": "gitlens.views.search.setKeepResultsToOff",
"when": "view =~ /^gitlens\\.views\\.search:/ && gitlens:views:search:keepResults",
"group": "navigation@3"
"group": "navigation@11"
},
{
"command": "gitlens.views.search.clear",
"when": "view =~ /^gitlens\\.views\\.search:/",
"group": "navigation@98"
},
{
"command": "gitlens.views.search.refresh",
@ -3492,6 +3510,11 @@
"group": "1_gitlens"
},
{
"command": "gitlens.supportGitLens",
"when": "view =~ /^gitlens\\.views\\..*:/ && config.gitlens.advanced.messages.suppressSupportGitLensNotification != true && gitlens:views:supportGitLens:hide != true",
"group": "navigation@1"
},
{
"command": "gitlens.showSettingsPage",
"when": "view =~ /^gitlens\\.views\\..*:/",
"group": "9_gitlens"

+ 1
- 0
src/commands.ts 查看文件

@ -41,5 +41,6 @@ export * from './commands/showView';
export * from './commands/stashApply';
export * from './commands/stashDelete';
export * from './commands/stashSave';
export * from './commands/supportGitLens';
export * from './commands/switchMode';
export * from './commands/toggleCodeLens';

+ 1
- 0
src/commands/common.ts 查看文件

@ -79,6 +79,7 @@ export enum Commands {
StashApply = 'gitlens.stashApply',
StashDelete = 'gitlens.stashDelete',
StashSave = 'gitlens.stashSave',
SupportGitLens = 'gitlens.supportGitLens',
SwitchMode = 'gitlens.switchMode',
ToggleCodeLens = 'gitlens.toggleCodeLens',
ToggleFileBlame = 'gitlens.toggleFileBlame',

+ 14
- 0
src/commands/supportGitLens.ts 查看文件

@ -0,0 +1,14 @@
'use strict';
import { Messages } from '../messages';
import { command, Command, Commands } from './common';
@command()
export class SupportGitLensCommand extends Command {
constructor() {
super(Commands.SupportGitLens);
}
async execute() {
return Messages.showSupportGitLensMessage();
}
}

+ 1
- 0
src/constants.ts 查看文件

@ -36,6 +36,7 @@ export enum CommandContext {
ViewsCanCompare = 'gitlens:views:canCompare',
ViewsCanCompareFile = 'gitlens:views:canCompare:file',
ViewsCompareKeepResults = 'gitlens:views:compare:keepResults',
ViewsHideSupportGitLens = 'gitlens:supportGitLens:hide',
ViewsFileHistoryEditorFollowing = 'gitlens:views:fileHistory:editorFollowing',
ViewsLineHistoryEditorFollowing = 'gitlens:views:lineHistory:editorFollowing',
ViewsRepositoriesAutoRefresh = 'gitlens:views:repositories:autoRefresh',

+ 39
- 2
src/messages.ts 查看文件

@ -1,6 +1,7 @@
'use strict';
import { ConfigurationTarget, MessageItem, window } from 'vscode';
import { commands, ConfigurationTarget, MessageItem, Uri, window } from 'vscode';
import { configuration, KeyMap } from './configuration';
import { BuiltInCommands, CommandContext, setCommandContext } from './constants';
import { Container } from './container';
import { GitCommit } from './git/gitService';
import { Logger } from './logger';
@ -13,7 +14,8 @@ export enum SuppressedMessages {
GitVersionWarning = 'suppressGitVersionWarning',
LineUncommittedWarning = 'suppressLineUncommittedWarning',
NoRepositoryWarning = 'suppressNoRepositoryWarning',
ShowKeyBindingsNotice = 'suppressShowKeyBindingsNotice'
ShowKeyBindingsNotice = 'suppressShowKeyBindingsNotice',
SupportGitLensNotification = 'suppressSupportGitLensNotification'
}
export class Messages {
@ -134,6 +136,41 @@ export class Messages {
);
}
static async showSupportGitLensMessage() {
const actions: MessageItem[] = [
{ title: 'Become a Sponsor' },
{ title: 'Donate via PayPal' },
{ title: 'Donate via Cash App' }
];
const result = await Messages.showMessage(
'info',
`While GitLens is offered to everyone for free, if you find it useful please consider supporting it. Thank you! ❤`,
undefined,
null,
...actions
);
if (result != null) {
let uri;
if (result === actions[0]) {
uri = Uri.parse('https://www.patreon.com/eamodio');
}
else if (result === actions[1]) {
uri = Uri.parse('https://www.paypal.me/eamodio');
}
else if (result === actions[2]) {
uri = Uri.parse('https://cash.me/$eamodio');
}
if (uri !== undefined) {
await setCommandContext(CommandContext.ViewsHideSupportGitLens, true);
await this.suppressedMessage(SuppressedMessages.SupportGitLensNotification!);
await commands.executeCommand(BuiltInCommands.Open, uri);
}
}
}
private static async showMessage<T extends MessageItem>(
type: 'info' | 'warn' | 'error',
message: string,

+ 1
- 0
src/ui/config.ts 查看文件

@ -115,6 +115,7 @@ export interface AdvancedConfig {
suppressLineUncommittedWarning: boolean;
suppressNoRepositoryWarning: boolean;
suppressShowKeyBindingsNotice: boolean;
suppressSupportGitLensNotification: boolean;
};
quickPick: {
closeOnFocusOut: boolean;

+ 4
- 4
src/ui/settings/index.html 查看文件

@ -2792,17 +2792,17 @@
>
<a
class="button button--flat-primary"
title="One-time donations via PayPal"
title="Donate via PayPal"
href="https://www.paypal.me/eamodio"
target="_blank"
>Donations via PayPal</a
>Donate via PayPal</a
>
<a
class="button button--flat-primary"
title="One-time donations via Cash App"
title="Donate via Cash App"
href="https://cash.me/$eamodio"
target="_blank"
>Donations via Cash App</a
>Donate via Cash App</a
>
</div>
<ul>

+ 11
- 11
src/ui/welcome/index.html 查看文件

@ -303,12 +303,12 @@
<h3>Show Your Support &#x2764;</h3>
<p>
To my incredible backers &mdash; thank you so much for your contributions. I am truly
humbled by your generosity and support. Please know that your support plays a important
humbled by your generosity and support. Please know that your support plays an important
role in helping me realize GitLens' potential in making developer's lives easier.
</p>
<p>
If you'd like to join them in supporting GitLens, please consider the following &mdash;
feel free to choose more than one. &#x1F609;
If you'd like to join in supporting GitLens, please consider the following &mdash; feel
free to choose more than one. &#x1F609;
</p>
<div class="button-group button-group--support-gitlens">
<a
@ -320,17 +320,17 @@
>
<a
class="button button--flat-primary"
title="One-time donations via PayPal"
title="Donate via PayPal"
href="https://www.paypal.me/eamodio"
target="_blank"
>Donations via PayPal</a
>Donate via PayPal</a
>
<a
class="button button--flat-primary"
title="One-time donations via Cash App"
title="Donate via Cash App"
href="https://cash.me/$eamodio"
target="_blank"
>Donations via Cash App</a
>Donate via Cash App</a
>
</div>
<ul class="section-list">
@ -420,17 +420,17 @@
>
<a
class="button button--flat-primary"
title="One-time donations via PayPal"
title="Donate via PayPal"
href="https://www.paypal.me/eamodio"
target="_blank"
>Donations via PayPal</a
>Donate via PayPal</a
>
<a
class="button button--flat-primary"
title="One-time donations via Cash App"
title="Donate via Cash App"
href="https://cash.me/$eamodio"
target="_blank"
>Donations via Cash App</a
>Donate via Cash App</a
>
</div>
<ul>

Loading…
取消
儲存