Browse Source

Optimizes images

Moves settings images into a settings folder
Adds hover setting images
Updates dependencies
main
Eric Amodio 6 years ago
parent
commit
3a3dca8c21
76 changed files with 4933 additions and 431 deletions
  1. +1
    -0
      .gitignore
  2. +1
    -1
      .vscodeignore
  3. BIN
      images/chat-badge.png
  4. BIN
      images/gitlens-preview-full.gif
  5. BIN
      images/gitlens-preview.gif
  6. BIN
      images/gitlens-preview1.gif
  7. BIN
      images/gitlens-preview2.gif
  8. BIN
      images/screenshot-branch-history.png
  9. BIN
      images/screenshot-code-lens.png
  10. BIN
      images/screenshot-commit-details.png
  11. BIN
      images/screenshot-commit-file-details.png
  12. BIN
      images/screenshot-file-blame-annotation.png
  13. BIN
      images/screenshot-file-blame-annotations.png
  14. BIN
      images/screenshot-file-history.png
  15. BIN
      images/screenshot-git-custom-view-history.png
  16. BIN
      images/screenshot-git-custom-view-repository.png
  17. BIN
      images/screenshot-line-blame-annotation.png
  18. BIN
      images/screenshot-line-blame-annotations-changes.png
  19. BIN
      images/screenshot-line-blame-annotations-details.png
  20. BIN
      images/screenshot-line-blame-annotations.png
  21. BIN
      images/screenshot-repo-status.png
  22. BIN
      images/screenshot-stash-details.png
  23. BIN
      images/screenshot-stash-list.png
  24. BIN
      images/screenshot-status-bar.png
  25. BIN
      images/settings-code-lens-authors.png
  26. BIN
      images/settings-code-lens-off.png
  27. BIN
      images/settings-code-lens-recent.png
  28. BIN
      images/settings-code-lens.png
  29. BIN
      images/settings-current-line-blame-off.png
  30. BIN
      images/settings-current-line-blame.png
  31. BIN
      images/settings-gitlens-view-history-avatars.png
  32. BIN
      images/settings-gitlens-view-history.png
  33. BIN
      images/settings-gitlens-view-repository-avatars.png
  34. BIN
      images/settings-gitlens-view-repository.png
  35. BIN
      images/settings-status-bar-left.png
  36. BIN
      images/settings-status-bar-off.png
  37. BIN
      images/settings-status-bar-right.png
  38. +6
    -6
      package.json
  39. +1
    -3
      src/pageProvider.ts
  40. +16
    -0
      src/system/object.ts
  41. BIN
      src/ui/images/settings/code-lens-authors.png
  42. BIN
      src/ui/images/settings/code-lens-off.png
  43. BIN
      src/ui/images/settings/code-lens-recent.png
  44. BIN
      src/ui/images/settings/code-lens.png
  45. BIN
      src/ui/images/settings/current-line-blame-off.png
  46. BIN
      src/ui/images/settings/current-line-blame.png
  47. BIN
      src/ui/images/settings/gitlens-view-history-avatars.png
  48. BIN
      src/ui/images/settings/gitlens-view-history.png
  49. BIN
      src/ui/images/settings/gitlens-view-repository-avatars.png
  50. BIN
      src/ui/images/settings/gitlens-view-repository.png
  51. BIN
      src/ui/images/settings/hovers-annotations-changes.png
  52. BIN
      src/ui/images/settings/hovers-annotations-details.png
  53. BIN
      src/ui/images/settings/hovers-annotations.png
  54. BIN
      src/ui/images/settings/hovers-currentLine-changes.png
  55. BIN
      src/ui/images/settings/hovers-currentLine-details.png
  56. BIN
      src/ui/images/settings/hovers-currentLine-off-whole-changes.png
  57. BIN
      src/ui/images/settings/hovers-currentLine-off-whole-details.png
  58. BIN
      src/ui/images/settings/hovers-currentLine-off-whole.png
  59. BIN
      src/ui/images/settings/hovers-currentLine-whole-changes.png
  60. BIN
      src/ui/images/settings/hovers-currentLine-whole-details.png
  61. BIN
      src/ui/images/settings/hovers-currentLine-whole.png
  62. BIN
      src/ui/images/settings/hovers-currentLine.png
  63. BIN
      src/ui/images/settings/hovers-off-annotations.png
  64. BIN
      src/ui/images/settings/hovers-off-currentLine-off-whole.png
  65. BIN
      src/ui/images/settings/hovers-off-currentLine-whole.png
  66. BIN
      src/ui/images/settings/hovers-off-currentLine.png
  67. BIN
      src/ui/images/settings/status-bar-left.png
  68. BIN
      src/ui/images/settings/status-bar-off.png
  69. BIN
      src/ui/images/settings/status-bar-right.png
  70. +4626
    -272
      src/ui/package-lock.json
  71. +7
    -6
      src/ui/package.json
  72. +49
    -19
      src/ui/scss/main.scss
  73. +34
    -36
      src/ui/settings/app.ts
  74. +153
    -76
      src/ui/settings/index.html
  75. +31
    -7
      src/ui/webpack.config.js
  76. +8
    -5
      src/ui/welcome/index.html

+ 1
- 0
.gitignore View File

@ -2,3 +2,4 @@ out
node_modules node_modules
settings.html settings.html
welcome.html welcome.html
images/settings

+ 1
- 1
.vscodeignore View File

@ -1,7 +1,7 @@
!images/dark/** !images/dark/**
!images/light/** !images/light/**
!images/settings/**
!images/gitlens-icon.png !images/gitlens-icon.png
!images/settings-*.png
images/** images/**
.vscode/** .vscode/**
.vscode-test/** .vscode-test/**

BIN
images/chat-badge.png View File

Before After
Width: 92  |  Height: 20  |  Size: 2.3 KiB Width: 92  |  Height: 20  |  Size: 1.7 KiB

BIN
images/gitlens-preview-full.gif View File

Before After
Width: 1454  |  Height: 1200  |  Size: 5.2 MiB Width: 1454  |  Height: 1200  |  Size: 4.2 MiB

BIN
images/gitlens-preview.gif View File

Before After
Width: 727  |  Height: 600  |  Size: 2.7 MiB Width: 727  |  Height: 600  |  Size: 2.1 MiB

BIN
images/gitlens-preview1.gif View File

Before After
Width: 640  |  Height: 608  |  Size: 4.8 MiB Width: 640  |  Height: 608  |  Size: 2.9 MiB

BIN
images/gitlens-preview2.gif View File

Before After
Width: 640  |  Height: 608  |  Size: 6.6 MiB Width: 640  |  Height: 608  |  Size: 3.9 MiB

BIN
images/screenshot-branch-history.png View File

Before After
Width: 600  |  Height: 483  |  Size: 72 KiB Width: 600  |  Height: 483  |  Size: 20 KiB

BIN
images/screenshot-code-lens.png View File

Before After
Width: 670  |  Height: 80  |  Size: 7.5 KiB Width: 670  |  Height: 80  |  Size: 4.3 KiB

BIN
images/screenshot-commit-details.png View File

Before After
Width: 600  |  Height: 373  |  Size: 54 KiB Width: 600  |  Height: 373  |  Size: 17 KiB

BIN
images/screenshot-commit-file-details.png View File

Before After
Width: 600  |  Height: 307  |  Size: 52 KiB Width: 600  |  Height: 307  |  Size: 16 KiB

BIN
images/screenshot-file-blame-annotation.png View File

Before After
Width: 670  |  Height: 58  |  Size: 12 KiB Width: 670  |  Height: 58  |  Size: 5.6 KiB

BIN
images/screenshot-file-blame-annotations.png View File

Before After
Width: 715  |  Height: 144  |  Size: 23 KiB Width: 715  |  Height: 144  |  Size: 7.9 KiB

BIN
images/screenshot-file-history.png View File

Before After
Width: 600  |  Height: 483  |  Size: 64 KiB Width: 600  |  Height: 483  |  Size: 18 KiB

BIN
images/screenshot-git-custom-view-history.png View File

Before After
Width: 600  |  Height: 177  |  Size: 28 KiB Width: 600  |  Height: 177  |  Size: 9.9 KiB

BIN
images/screenshot-git-custom-view-repository.png View File

Before After
Width: 600  |  Height: 360  |  Size: 20 KiB Width: 600  |  Height: 360  |  Size: 12 KiB

BIN
images/screenshot-line-blame-annotation.png View File

Before After
Width: 670  |  Height: 62  |  Size: 7.5 KiB Width: 670  |  Height: 62  |  Size: 4.6 KiB

BIN
images/screenshot-line-blame-annotations-changes.png View File

Before After
Width: 670  |  Height: 145  |  Size: 14 KiB Width: 670  |  Height: 145  |  Size: 7.1 KiB

BIN
images/screenshot-line-blame-annotations-details.png View File

Before After
Width: 670  |  Height: 145  |  Size: 14 KiB Width: 670  |  Height: 145  |  Size: 7.6 KiB

BIN
images/screenshot-line-blame-annotations.png View File

Before After
Width: 670  |  Height: 217  |  Size: 21 KiB Width: 670  |  Height: 217  |  Size: 9.9 KiB

BIN
images/screenshot-repo-status.png View File

Before After
Width: 600  |  Height: 241  |  Size: 31 KiB Width: 600  |  Height: 241  |  Size: 10 KiB

BIN
images/screenshot-stash-details.png View File

Before After
Width: 600  |  Height: 263  |  Size: 39 KiB Width: 600  |  Height: 263  |  Size: 12 KiB

BIN
images/screenshot-stash-list.png View File

Before After
Width: 600  |  Height: 109  |  Size: 12 KiB Width: 600  |  Height: 109  |  Size: 5.2 KiB

BIN
images/screenshot-status-bar.png View File

Before After
Width: 600  |  Height: 22  |  Size: 5.6 KiB Width: 600  |  Height: 22  |  Size: 3.0 KiB

BIN
images/settings-code-lens-authors.png View File

Before After
Width: 670  |  Height: 80  |  Size: 7.1 KiB

BIN
images/settings-code-lens-off.png View File

Before After
Width: 670  |  Height: 80  |  Size: 5.9 KiB

BIN
images/settings-code-lens-recent.png View File

Before After
Width: 670  |  Height: 80  |  Size: 7.3 KiB

BIN
images/settings-code-lens.png View File

Before After
Width: 670  |  Height: 80  |  Size: 8.3 KiB

BIN
images/settings-current-line-blame-off.png View File

Before After
Width: 670  |  Height: 62  |  Size: 5.9 KiB

BIN
images/settings-current-line-blame.png View File

Before After
Width: 670  |  Height: 62  |  Size: 8.2 KiB

BIN
images/settings-gitlens-view-history-avatars.png View File

Before After
Width: 600  |  Height: 177  |  Size: 27 KiB

BIN
images/settings-gitlens-view-history.png View File

Before After
Width: 600  |  Height: 177  |  Size: 26 KiB

BIN
images/settings-gitlens-view-repository-avatars.png View File

Before After
Width: 600  |  Height: 360  |  Size: 26 KiB

BIN
images/settings-gitlens-view-repository.png View File

Before After
Width: 600  |  Height: 360  |  Size: 26 KiB

BIN
images/settings-status-bar-left.png View File

Before After
Width: 600  |  Height: 22  |  Size: 2.6 KiB

BIN
images/settings-status-bar-off.png View File

Before After
Width: 600  |  Height: 22  |  Size: 1.9 KiB

BIN
images/settings-status-bar-right.png View File

Before After
Width: 600  |  Height: 22  |  Size: 2.6 KiB

+ 6
- 6
package.json View File

@ -10,8 +10,8 @@
"vscode": "^1.19.0" "vscode": "^1.19.0"
}, },
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"displayName": "Git Lens \u2014 git blame annotations, code lens, and more",
"description": "Supercharge Visual Studio Code's Git capabilities \u2014 Visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore the history of a file or branch, gain valuable insights via powerful comparison commands, and so much more",
"displayName": "GitLens \u2014 git supercharged",
"description": "Supercharge Visual Studio Code's Git capabilities \u2014 Visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and so much more",
"badges": [ "badges": [
{ {
"url": "https://img.shields.io/badge/vscode--dev--community-gitlens-blue.svg?logo=slack", "url": "https://img.shields.io/badge/vscode--dev--community-gitlens-blue.svg?logo=slack",
@ -1073,7 +1073,7 @@
} }
], ],
"commands": [ "commands": [
{
{
"command": "gitlens.showSettingsPage", "command": "gitlens.showSettingsPage",
"title": "Open Settings", "title": "Open Settings",
"category": "GitLens" "category": "GitLens"
@ -3241,18 +3241,18 @@
"*" "*"
], ],
"scripts": { "scripts": {
"build": "npm run lint && tsc -m commonjs -p ./ && npm run build-ui",
"build": "npm run lint && tsc -m commonjs -p ./ && npm run build-ui -- --env.quick",
"build-ui": "webpack --context ./src/ui --config ./src/ui/webpack.config.js", "build-ui": "webpack --context ./src/ui --config ./src/ui/webpack.config.js",
"bundle": "npm run lint && webpack --env.production --context ./src/ui --config ./src/ui/webpack.config.js && webpack --env.production", "bundle": "npm run lint && webpack --env.production --context ./src/ui --config ./src/ui/webpack.config.js && webpack --env.production",
"clean": "git clean -Xdf", "clean": "git clean -Xdf",
"lint": "tslint --project tslint.json", "lint": "tslint --project tslint.json",
"pack": "vsce package", "pack": "vsce package",
"pub": "vsce publish", "pub": "vsce publish",
"rebuild": "npm run reset && npm run build",
"rebuild": "npm run reset && npm run lint && tsc -m commonjs -p ./ && npm run build-ui",
"reset": "npm run clean && npm install --no-save", "reset": "npm run clean && npm install --no-save",
"watch": "tsc -watch -p ./", "watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"postinstall": "node ./node_modules/vscode/bin/install && pushd \"./src/ui\" && npm install --no-save && popd",
"prepush": "npm run build", "prepush": "npm run build",
"vscode:prepublish": "npm run reset && npm run bundle" "vscode:prepublish": "npm run reset && npm run bundle"
}, },

+ 1
- 3
src/pageProvider.ts View File

@ -34,9 +34,7 @@ export class PageProvider extends Disposable implements TextDocumentContentProvi
async provideTextDocumentContent(uri: Uri): Promise<string> { async provideTextDocumentContent(uri: Uri): Promise<string> {
const doc = await workspace.openTextDocument(Uri.file(Container.context.asAbsolutePath(`${uri.path}.html`))); const doc = await workspace.openTextDocument(Uri.file(Container.context.asAbsolutePath(`${uri.path}.html`)));
let text = doc.getText()
.replace(/{{root}}/g, Uri.file(Container.context.asAbsolutePath('.')).toString());
let text = doc.getText().replace(/{{root}}/g, Uri.file(Container.context.asAbsolutePath('.')).toString());
if (text.includes('\'{{config}}\'')) { if (text.includes('\'{{config}}\'')) {
text = text.replace(/'{{config}}'/g, JSON.stringify(Container.config)); text = text.replace(/'{{config}}'/g, JSON.stringify(Container.config));
} }

+ 16
- 0
src/system/object.ts View File

@ -53,6 +53,22 @@ export namespace Objects {
} }
} }
export function paths(o: { [key: string]: any }, path?: string): string[] {
const results = [];
for (const key in o) {
const child = o[key];
if (typeof child === 'object') {
results.push(...paths(child, path === undefined ? key : `${path}.${key}`));
}
else {
results.push(path === undefined ? key : `${path}.${key}`);
}
}
return results;
}
export function values<T>(o: { [key: string]: T }): IterableIterator<T>; export function values<T>(o: { [key: string]: T }): IterableIterator<T>;
export function values<T>(o: { [key: number]: T }): IterableIterator<T>; export function values<T>(o: { [key: number]: T }): IterableIterator<T>;
export function* values<T>(o: any): IterableIterator<T> { export function* values<T>(o: any): IterableIterator<T> {

BIN
src/ui/images/settings/code-lens-authors.png View File

Before After
Width: 600  |  Height: 206  |  Size: 7.6 KiB

BIN
src/ui/images/settings/code-lens-off.png View File

Before After
Width: 600  |  Height: 206  |  Size: 6.4 KiB

BIN
src/ui/images/settings/code-lens-recent.png View File

Before After
Width: 600  |  Height: 206  |  Size: 7.9 KiB

BIN
src/ui/images/settings/code-lens.png View File

Before After
Width: 600  |  Height: 206  |  Size: 8.9 KiB

BIN
src/ui/images/settings/current-line-blame-off.png View File

Before After
Width: 600  |  Height: 206  |  Size: 6.5 KiB

BIN
src/ui/images/settings/current-line-blame.png View File

Before After
Width: 600  |  Height: 206  |  Size: 8.3 KiB

BIN
src/ui/images/settings/gitlens-view-history-avatars.png View File

Before After
Width: 600  |  Height: 206  |  Size: 27 KiB

BIN
src/ui/images/settings/gitlens-view-history.png View File

Before After
Width: 600  |  Height: 206  |  Size: 26 KiB

BIN
src/ui/images/settings/gitlens-view-repository-avatars.png View File

Before After
Width: 600  |  Height: 206  |  Size: 18 KiB

BIN
src/ui/images/settings/gitlens-view-repository.png View File

Before After
Width: 600  |  Height: 206  |  Size: 17 KiB

BIN
src/ui/images/settings/hovers-annotations-changes.png View File

Before After
Width: 600  |  Height: 206  |  Size: 10 KiB

BIN
src/ui/images/settings/hovers-annotations-details.png View File

Before After
Width: 600  |  Height: 206  |  Size: 12 KiB

BIN
src/ui/images/settings/hovers-annotations.png View File

Before After
Width: 600  |  Height: 206  |  Size: 16 KiB

BIN
src/ui/images/settings/hovers-currentLine-changes.png View File

Before After
Width: 600  |  Height: 206  |  Size: 11 KiB

BIN
src/ui/images/settings/hovers-currentLine-details.png View File

Before After
Width: 600  |  Height: 206  |  Size: 12 KiB

BIN
src/ui/images/settings/hovers-currentLine-off-whole-changes.png View File

Before After
Width: 600  |  Height: 206  |  Size: 8.0 KiB

BIN
src/ui/images/settings/hovers-currentLine-off-whole-details.png View File

Before After
Width: 600  |  Height: 206  |  Size: 9.4 KiB

BIN
src/ui/images/settings/hovers-currentLine-off-whole.png View File

Before After
Width: 600  |  Height: 206  |  Size: 14 KiB

BIN
src/ui/images/settings/hovers-currentLine-whole-changes.png View File

Before After
Width: 600  |  Height: 206  |  Size: 9.7 KiB

BIN
src/ui/images/settings/hovers-currentLine-whole-details.png View File

Before After
Width: 600  |  Height: 206  |  Size: 11 KiB

BIN
src/ui/images/settings/hovers-currentLine-whole.png View File

Before After
Width: 600  |  Height: 206  |  Size: 15 KiB

BIN
src/ui/images/settings/hovers-currentLine.png View File

Before After
Width: 600  |  Height: 206  |  Size: 16 KiB

BIN
src/ui/images/settings/hovers-off-annotations.png View File

Before After
Width: 600  |  Height: 206  |  Size: 8.2 KiB

BIN
src/ui/images/settings/hovers-off-currentLine-off-whole.png View File

Before After
Width: 600  |  Height: 206  |  Size: 6.5 KiB

BIN
src/ui/images/settings/hovers-off-currentLine-whole.png View File

Before After
Width: 600  |  Height: 206  |  Size: 8.3 KiB

BIN
src/ui/images/settings/hovers-off-currentLine.png View File

Before After
Width: 600  |  Height: 206  |  Size: 7.2 KiB

BIN
src/ui/images/settings/status-bar-left.png View File

Before After
Width: 600  |  Height: 206  |  Size: 4.5 KiB

BIN
src/ui/images/settings/status-bar-off.png View File

Before After
Width: 600  |  Height: 206  |  Size: 3.8 KiB

BIN
src/ui/images/settings/status-bar-right.png View File

Before After
Width: 600  |  Height: 206  |  Size: 4.5 KiB

+ 4626
- 272
src/ui/package-lock.json
File diff suppressed because it is too large
View File


+ 7
- 6
src/ui/package.json View File

@ -24,19 +24,20 @@
"build-dev": "webpack" "build-dev": "webpack"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "9.3.0",
"@types/webpack": "3.8.2",
"css-loader": "0.28.8",
"@types/node": "9.4.0",
"@types/webpack": "3.8.4",
"css-loader": "0.28.9",
"extract-text-webpack-plugin": "3.0.2", "extract-text-webpack-plugin": "3.0.2",
"html-webpack-inline-source-plugin": "0.0.9", "html-webpack-inline-source-plugin": "0.0.9",
"html-webpack-plugin": "2.30.1", "html-webpack-plugin": "2.30.1",
"imagemin-webpack-plugin": "2.0.0",
"node-sass": "4.7.2", "node-sass": "4.7.2",
"sass-loader": "6.0.6", "sass-loader": "6.0.6",
"style-loader": "0.19.1",
"style-loader": "0.20.1",
"tslint": "5.9.1", "tslint": "5.9.1",
"ts-loader": "3.2.0",
"ts-loader": "3.3.1",
"typescript": "2.6.2", "typescript": "2.6.2",
"uglifyjs-webpack-plugin": "1.1.6",
"uglifyjs-webpack-plugin": "1.1.8",
"webpack": "3.10.0" "webpack": "3.10.0"
} }
} }

+ 49
- 19
src/ui/scss/main.scss View File

@ -7,7 +7,7 @@ body {
color: var(--color); color: var(--color);
font-family: var(--font-family); font-family: var(--font-family);
height: 100%; height: 100%;
line-height: 1.4em;
line-height: 1.4;
} }
a { a {
@ -89,10 +89,10 @@ input {
outline: none; outline: none;
} }
&[type="checkbox"] {
margin: -2px .25em 0 .25em;
vertical-align: middle;
}
// &[type="checkbox"] {
// margin: -2px .25em 0 .25em;
// vertical-align: middle;
// }
&[disabled] { &[disabled] {
color: var(--color--75); color: var(--color--75);
@ -122,7 +122,7 @@ section {
select { select {
color: var(--color); color: var(--color);
cursor: pointer; cursor: pointer;
margin: 0.5em 0.25em 0 0.25em;
margin: 0 0.75em;
padding: 2px; padding: 2px;
.vscode-light & { .vscode-light & {
@ -174,7 +174,11 @@ ul {
.features-list { .features-list {
font-weight: 200; font-weight: 200;
list-style: disc; list-style: disc;
margin-left: 2em;
margin: 0 0 2em 2em;
& li {
margin-bottom: 0.5em;
}
} }
.header__blurb { .header__blurb {
@ -182,7 +186,7 @@ ul {
flex: 55% 2 1; flex: 55% 2 1;
font-size: 1.2em; font-size: 1.2em;
font-weight: 200; font-weight: 200;
line-height: 1.3;
// line-height: 1.35;
margin: 0 0 0 6em; margin: 0 0 0 6em;
min-width: 345px; min-width: 345px;
@ -325,7 +329,7 @@ ul {
.section__preview { .section__preview {
flex: 40% 1 1; flex: 40% 1 1;
text-align: end; text-align: end;
margin-left: 1em;
margin-left: 2em;
min-width: 400px; min-width: 400px;
} }
@ -393,7 +397,7 @@ ul {
font-size: 1.1em; font-size: 1.1em;
font-weight: 200; font-weight: 200;
margin: 1em 0.25em; margin: 1em 0.25em;
line-height: 1.275;
// line-height: 1.275;
} }
} }
@ -416,7 +420,25 @@ ul {
} }
.settings-group__setting { .settings-group__setting {
margin-bottom: 1em;
display: flex;
flex: auto 1 1;
align-items: baseline;
flex-wrap: wrap;
margin-bottom: 0.75em;
& input[type="checkbox"] {
flex: 16px 0 0;
margin: 0 0.75em 0 0;
width: 16px;
height: 16px;
top: 3px;
position: relative;
}
& label {
flex: auto 0 1;
margin-bottom: 0.75em;
}
&[disabled] { &[disabled] {
label { label {
@ -426,14 +448,6 @@ ul {
} }
} }
.settings-group__setting--nested {
margin-left: 2em;
}
.settings-group__setting--nested2 {
margin-left: 4em;
}
.sidebar-group { .sidebar-group {
margin-top: 1em; margin-top: 1em;
} }
@ -441,3 +455,19 @@ ul {
.hidden { .hidden {
display: none !important; display: none !important;
} }
.mb-2 {
margin-bottom: 2em !important;
}
.ml-2 {
margin-left: 2em;
}
.ml-4 {
margin-left: 4em;
}
.nowrap {
flex-wrap: nowrap !important;
}

+ 34
- 36
src/ui/settings/app.ts View File

@ -40,7 +40,6 @@ export class App {
} }
this.setAdditionalSettings(element.checked ? element.dataset.addSettingsOn : element.dataset.addSettingsOff); this.setAdditionalSettings(element.checked ? element.dataset.addSettingsOn : element.dataset.addSettingsOff);
this.updateState(this._changes);
this.applyChanges(); this.applyChanges();
} }
@ -51,7 +50,6 @@ export class App {
this._changes[element.name] = ensureIfBoolean(value); this._changes[element.name] = ensureIfBoolean(value);
this.updateState(this._changes);
this.applyChanges(); this.applyChanges();
} }
@ -75,28 +73,23 @@ export class App {
private initializeState() { private initializeState() {
console.log('SettingsApp.initializeState'); console.log('SettingsApp.initializeState');
const changes: { [key: string]: string | boolean } = Object.create(null);
for (const el of document.querySelectorAll<HTMLInputElement>('input[type="checkbox"]')) { for (const el of document.querySelectorAll<HTMLInputElement>('input[type="checkbox"]')) {
const name = el.name; const name = el.name;
const checked = name.startsWith('!') ? false : getSettingValue<boolean>(name); const checked = name.startsWith('!') ? false : getSettingValue<boolean>(name);
el.checked = checked; el.checked = checked;
changes[name] = checked;
} }
for (const el of document.querySelectorAll<HTMLSelectElement>('select')) { for (const el of document.querySelectorAll<HTMLSelectElement>('select')) {
const name = el.name; const name = el.name;
const value = getSettingValue<string>(name); const value = getSettingValue<string>(name);
el.querySelector<HTMLOptionElement>(`option[value='${value}']`)!.selected = true; el.querySelector<HTMLOptionElement>(`option[value='${value}']`)!.selected = true;
changes[name] = value;
} }
this.updateState(changes);
const state = flatten(config);
this.setVisibility(state);
this.setEnablement(state);
} }
private setAdditionalSettings(expression: string | undefined) { private setAdditionalSettings(expression: string | undefined) {
@ -108,44 +101,31 @@ export class App {
} }
} }
private updateState(changes: { [key: string]: string | boolean }) {
this.updateVisibility(changes);
this.updateEnablement(changes);
}
private setEnablement(state: { [key: string]: string | boolean }) {
for (const el of document.querySelectorAll<HTMLElement>('[data-enablement]')) {
// Since everything starts disabled, kick out if it still is
if (!evaluateStateExpression(el.dataset.enablement!, state)) continue;
private updateEnablement(changes: { [key: string]: string | boolean }) {
const selectors = Object.keys(changes).map(c => `[data-enablement~="${c}"]`).join(',');
for (const el of document.querySelectorAll<HTMLElement>(selectors)) {
const enabled = evaluateStateExpression(el.dataset.enablement!, changes);
if (enabled) {
el.removeAttribute('disabled');
}
else {
el.setAttribute('disabled', '');
}
el.removeAttribute('disabled');
if (el.matches('input,select')) { if (el.matches('input,select')) {
(el as HTMLInputElement | HTMLSelectElement).disabled = !enabled;
(el as HTMLInputElement | HTMLSelectElement).disabled = false;
} }
else { else {
const input = el.querySelector<HTMLInputElement | HTMLSelectElement>('input,select'); const input = el.querySelector<HTMLInputElement | HTMLSelectElement>('input,select');
if (input == null) continue; if (input == null) continue;
input.disabled = !enabled;
input.disabled = false;
} }
} }
} }
private updateVisibility(changes: { [key: string]: string | boolean }) {
const selectors = Object.keys(changes).map(c => `[data-visibility~="${c}"]`).join(',');
for (const el of document.querySelectorAll<HTMLElement>(selectors)) {
const visible = evaluateStateExpression(el.dataset.visibility!, changes);
if (visible) {
el.classList.remove('hidden');
}
else {
el.classList.add('hidden');
}
private setVisibility(state: { [key: string]: string | boolean }) {
for (const el of document.querySelectorAll<HTMLElement>('[data-visibility]')) {
// Since everything starts hidden, kick out if it still is
if (!evaluateStateExpression(el.dataset.visibility!, state)) continue;
el.classList.remove('hidden');
} }
} }
} }
@ -191,4 +171,22 @@ function parseAdditionalSettingsExpression(expression: string): [string, string
function parseStateExpression(expression: string): [string, string | boolean | undefined] { function parseStateExpression(expression: string): [string, string | boolean | undefined] {
const [lhs, rhs] = expression.trim().split('='); const [lhs, rhs] = expression.trim().split('=');
return [lhs.trim(), rhs !== undefined ? rhs.trim() : rhs]; return [lhs.trim(), rhs !== undefined ? rhs.trim() : rhs];
}
function flatten(o: { [key: string]: any }, path?: string): { [key: string]: any } {
const results: { [key: string]: any } = {};
for (const key in o) {
const value = o[key];
if (Array.isArray(value)) continue;
if (typeof value === 'object') {
Object.assign(results, flatten(value, path === undefined ? key : `${path}.${key}`));
}
else {
results[path === undefined ? key : `${path}.${key}`] = value;
}
}
return results;
} }

+ 153
- 76
src/ui/settings/index.html View File

@ -11,7 +11,7 @@
<div class="content"> <div class="content">
<header> <header>
<div class="header__logo"> <div class="header__logo">
<img class="image__logo" src="{{root}}/images/gitlens-icon.png">
<img class="image__logo" src="{{root}}/images/gitlens-icon.png" />
<div> <div>
<h1>GitLens</h1> <h1>GitLens</h1>
<p class="header__subtitle">Git supercharged</p> <p class="header__subtitle">Git supercharged</p>
@ -46,35 +46,40 @@
</div> </div>
<div class="section__settings"> <div class="section__settings">
<div class="settings-group"> <div class="settings-group">
<div class="settings-group__setting">
<input id="gitExplorer.enabled" name="gitExplorer.enabled" type="checkbox" class="p">></span></input>
<div class="settings-group__setting nowrap">
<input id="gitExplorer.enabled" name="gitExplorer.enabled" type="checkbox" />
<label for="gitExplorer.enabled">Show the GitLens view</label> <label for="gitExplorer.enabled">Show the GitLens view</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested" data-enablement="gitExplorer.enabled" disabled>
<label for="gitExplorer.view">Show the </label>
<div class="settings-group__setting ml-2" data-enablement="gitExplorer.enabled" disabled>
<label for="gitExplorer.view">When opening the GitLens view</label>
<select id="gitExplorer.view" name="gitExplorer.view" disabled> <select id="gitExplorer.view" name="gitExplorer.view" disabled>
<option value="auto">last selected view</option>
<option value="repository">repository view</option>
<option value="history">file history view</option>
<option value="auto">show the last selected view</option>
<option value="repository">show the repository view</option>
<option value="history">show the file history view</option>
</select> </select>
<label for="gitExplorer.view"> when the GitLens explorer opens</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested" data-enablement="gitExplorer.enabled" disabled>
<input id="gitExplorer.avatars" name="explorers.avatars" type="checkbox" disabled class="p">></span></input>
<div class="settings-group__setting nowrap ml-2" data-enablement="gitExplorer.enabled" disabled>
<input id="gitExplorer.avatars" name="explorers.avatars" type="checkbox" disabled />
<label for="gitExplorer.avatars">Use author avatars in place of commit icons</label> <label for="gitExplorer.avatars">Use author avatars in place of commit icons</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested" data-enablement="gitExplorer.enabled" disabled>
<input id="gitExplorer.autoRefresh" name="gitExplorer.autoRefresh" type="checkbox" disabled class="p">></span></input>
<label for="gitExplorer.autoRefresh">Automatically refresh the GitLens view when any repository or the file system changes</label>
<div class="settings-group__setting nowrap ml-2" data-enablement="gitExplorer.enabled" disabled>
<input id="gitExplorer.autoRefresh" name="gitExplorer.autoRefresh" type="checkbox" disabled />
<label for="gitExplorer.autoRefresh">Automatically refresh the GitLens view when the file system or any repository changes</label>
</div> </div>
</div> </div>
<div class="section__preview"> <div class="section__preview">
<img class="image__preview hidden" src="{{root}}/images/settings-gitlens-view-repository.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =auto &amp;&amp; gitExplorer.avatars =false"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-gitlens-view-repository-avatars.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =auto &amp;&amp; gitExplorer.avatars"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-gitlens-view-repository.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =repository &amp;&amp; gitExplorer.avatars =false"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-gitlens-view-repository-avatars.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =repository &amp;&amp; gitExplorer.avatars"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-gitlens-view-history.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =history &amp;&amp; gitExplorer.avatars =false"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-gitlens-view-history-avatars.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =history &amp;&amp; gitExplorer.avatars"></img>
<img class="image__preview hidden" src="{{root}}/images/settings/gitlens-view-repository.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =auto &amp;&amp; gitExplorer.avatars =false"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/gitlens-view-repository-avatars.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =auto &amp;&amp; gitExplorer.avatars"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/gitlens-view-repository.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =repository &amp;&amp; gitExplorer.avatars =false"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/gitlens-view-repository-avatars.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =repository &amp;&amp; gitExplorer.avatars"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/gitlens-view-history.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =history &amp;&amp; gitExplorer.avatars =false"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/gitlens-view-history-avatars.png" data-visibility="gitExplorer.enabled &amp;&amp; gitExplorer.view =history &amp;&amp; gitExplorer.avatars"
/>
</div> </div>
</div> </div>
</section> </section>
@ -88,18 +93,18 @@
</h2> </h2>
<p class="section__title-hint">Adds Git authorship code lens to the top of the file and on code blocks</p> <p class="section__title-hint">Adds Git authorship code lens to the top of the file and on code blocks</p>
</div> </div>
<p></p>
<div class="section__settings"> <div class="section__settings">
<div class="settings-group"> <div class="settings-group">
<div class="settings-group__setting">
<input id="codeLens.enabled" name="codeLens.enabled" type="checkbox" class="p">></span></input>
<div class="settings-group__setting nowrap">
<input id="codeLens.enabled" name="codeLens.enabled" type="checkbox" />
<label for="codeLens.enabled">Show the Git authorship code lenses</label> <label for="codeLens.enabled">Show the Git authorship code lenses</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested" data-enablement="codeLens.enabled" disabled>
<input id="codeLens.recentChange.enabled" name="codeLens.recentChange.enabled" type="checkbox"></input>
<div class="settings-group__setting nowrap ml-2" data-enablement="codeLens.enabled" disabled>
<input id="codeLens.recentChange.enabled" name="codeLens.recentChange.enabled" type="checkbox" disabled />
<label for="codeLens.recentChange.enabled">Show the author and date of the most recent change for the file or code block</label> <label for="codeLens.recentChange.enabled">Show the author and date of the most recent change for the file or code block</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested2" data-enablement="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled" disabled>
<div class="settings-group__setting ml-4" data-enablement="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled"
disabled>
<label for="codeLens.recentChange.command">Clicking on the recent change code lens will </label> <label for="codeLens.recentChange.command">Clicking on the recent change code lens will </label>
<select id="codeLens.recentChange.command" name="codeLens.recentChange.command" disabled> <select id="codeLens.recentChange.command" name="codeLens.recentChange.command" disabled>
<option value="gitlens.toggleFileBlame">toggle file blame annotations</option> <option value="gitlens.toggleFileBlame">toggle file blame annotations</option>
@ -110,12 +115,13 @@
<option value="gitlens.showQuickRepoHistory">show the current branch history</option> <option value="gitlens.showQuickRepoHistory">show the current branch history</option>
</select> </select>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested" data-enablement="codeLens.enabled" disabled>
<input id="codeLens.authors.enabled" name="codeLens.authors.enabled" type="checkbox"></input>
<div class="settings-group__setting nowrap ml-2" data-enablement="codeLens.enabled" disabled>
<input id="codeLens.authors.enabled" name="codeLens.authors.enabled" type="checkbox" disabled />
<label for="codeLens.authors.enabled">Show the number of authors of the file or code block and the most prominent author, if <label for="codeLens.authors.enabled">Show the number of authors of the file or code block and the most prominent author, if
there is more than one</label> there is more than one</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested2" data-enablement="codeLens.enabled &amp;&amp; codeLens.authors.enabled" disabled>
<div class="settings-group__setting ml-4" data-enablement="codeLens.enabled &amp;&amp; codeLens.authors.enabled"
disabled>
<label for="codeLens.authors.command">Clicking on the authors code lens will </label> <label for="codeLens.authors.command">Clicking on the authors code lens will </label>
<select id="codeLens.authors.command" name="codeLens.authors.command" disabled> <select id="codeLens.authors.command" name="codeLens.authors.command" disabled>
<option value="gitlens.toggleFileBlame">toggle file blame annotations</option> <option value="gitlens.toggleFileBlame">toggle file blame annotations</option>
@ -128,16 +134,21 @@
</div> </div>
</div> </div>
<div class="section__preview"> <div class="section__preview">
<img class="image__preview hidden" src="{{root}}/images/settings-code-lens.png" data-visibility="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled &amp;&amp; codeLens.authors.enabled"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-code-lens-off.png" data-visibility="codeLens.enabled =false"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-code-lens-off.png" data-visibility="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled =false &amp;&amp; codeLens.authors.enabled =false"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-code-lens-recent.png" data-visibility="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled &amp;&amp; codeLens.authors.enabled =false"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-code-lens-authors.png" data-visibility="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled =false &amp;&amp; codeLens.authors.enabled"></img>
<img class="image__preview hidden" src="{{root}}/images/settings/code-lens.png" data-visibility="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled &amp;&amp; codeLens.authors.enabled"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/code-lens-off.png" data-visibility="codeLens.enabled =false"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/code-lens-off.png" data-visibility="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled =false &amp;&amp; codeLens.authors.enabled =false"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/code-lens-recent.png" data-visibility="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled &amp;&amp; codeLens.authors.enabled =false"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/code-lens-authors.png" data-visibility="codeLens.enabled &amp;&amp; codeLens.recentChange.enabled =false &amp;&amp; codeLens.authors.enabled"
/>
</div> </div>
<p class="settings-group__hint"> <p class="settings-group__hint">
<i class="icon icon--lg icon__info"></i> <i class="icon icon--lg icon__info"></i>
Use the Use the
<a class="command" title="Run Command" href="command:gitlens.toggleCodeLens">GitLens: Toggle Git Code Lens</a> command to override this setting for the current window
<a class="command" title="Run command" href="command:gitlens.toggleCodeLens">GitLens: Toggle Git Code Lens</a> command to override this setting for the current window
</p> </p>
</div> </div>
</section> </section>
@ -153,19 +164,22 @@
</div> </div>
<div class="section__settings"> <div class="section__settings">
<div class="settings-group"> <div class="settings-group">
<div class="settings-group__setting">
<input id="currentLine.enabled" name="currentLine.enabled" type="checkbox" data-add-settings-off="hovers.currentLine.over=line"></input>
<div class="settings-group__setting nowrap">
<input id="currentLine.enabled" name="currentLine.enabled" type="checkbox" data-add-settings-off="hovers.currentLine.over=line"
/>
<label for="currentLine.enabled">Show a Git blame annotation at the end of the current line</label> <label for="currentLine.enabled">Show a Git blame annotation at the end of the current line</label>
</div> </div>
</div> </div>
<div class="section__preview"> <div class="section__preview">
<img class="image__preview hidden" src="{{root}}/images/settings-current-line-blame.png" data-visibility="currentLine.enabled"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-current-line-blame-off.png" data-visibility="currentLine.enabled =false"></img>
<img class="image__preview hidden" src="{{root}}/images/settings/current-line-blame.png" data-visibility="currentLine.enabled"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/current-line-blame-off.png" data-visibility="currentLine.enabled =false"
/>
</div> </div>
<p class="settings-group__hint"> <p class="settings-group__hint">
<i class="icon icon--lg icon__info"></i> <i class="icon icon--lg icon__info"></i>
Use the Use the
<a class="command" title="Run Command" href="command:gitlens.toggleLineBlame" class="command">GitLens: Toggle Line Blame Annotations</a> command to override this setting for the current
<a class="command" title="Run command" href="command:gitlens.toggleLineBlame" class="command">GitLens: Toggle Line Blame Annotations</a> command to override this setting for the current
window window
</p> </p>
</div> </div>
@ -183,54 +197,114 @@
<div class="section__settings"> <div class="section__settings">
<div class="settings-group"> <div class="settings-group">
<div class="settings-group__setting"> <div class="settings-group__setting">
<div class="settings-group__setting">
<input id="hovers.enabled" name="hovers.enabled" type="checkbox" class="p">></span></input>
<div class="settings-group__setting nowrap">
<input id="hovers.enabled" name="hovers.enabled" type="checkbox" />
<label for="hovers.enabled">Show Git hovers</label> <label for="hovers.enabled">Show Git hovers</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested hidden" data-visibility="currentLine.enabled" data-enablement="hovers.enabled" disabled>
<input id="hovers.currentLine.enabled" name="hovers.currentLine.enabled" type="checkbox"></input>
<label for="hovers.currentLine.enabled">Show hovers for the current line over the </label>
<select id="hovers.currentLine.over" name="hovers.currentLine.over" data-enablement="hovers.enabled &amp;&amp; hovers.currentLine.enabled" disabled>
<option value="annotation">annotation only</option>
<option value="line">whole line</option>
<div class="settings-group__setting nowrap ml-2 hidden" data-visibility="currentLine.enabled" data-enablement="hovers.enabled"
disabled>
<input id="hovers.currentLine.enabled" name="hovers.currentLine.enabled" type="checkbox" disabled />
<label for="hovers.currentLine.enabled">Show hovers for the current line when over the </label>
<select id="hovers.currentLine.over" name="hovers.currentLine.over" data-enablement="hovers.enabled &amp;&amp; hovers.currentLine.enabled"
disabled>
<option value="annotation">annotation</option>
<option value="line">line</option>
</select> </select>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested hidden" data-visibility="currentLine.enabled =false" data-enablement="hovers.enabled" disabled>
<input id="hovers.currentLine.enabled-1" name="hovers.currentLine.enabled" type="checkbox" data-add-settings-on="hovers.currentLine.over=line"></input>
<div class="settings-group__setting nowrap ml-2 hidden" data-visibility="currentLine.enabled =false"
data-enablement="hovers.enabled" disabled>
<input id="hovers.currentLine.enabled-1" name="hovers.currentLine.enabled" type="checkbox" data-add-settings-on="hovers.currentLine.over=line" disabled
/>
<label for="hovers.currentLine.enabled-1">Show hovers over the current line</label> <label for="hovers.currentLine.enabled-1">Show hovers over the current line</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested2" data-enablement="hovers.enabled &amp;&amp; hovers.currentLine.enabled" disabled>
<input id="hovers.currentLine.details" name="hovers.currentLine.details" type="checkbox"></input>
<div class="settings-group__setting nowrap ml-4" data-enablement="hovers.enabled &amp;&amp; hovers.currentLine.enabled"
disabled>
<input id="hovers.currentLine.details" name="hovers.currentLine.details" type="checkbox" disabled />
<label for="hovers.currentLine.details">Show Git blame details</label> <label for="hovers.currentLine.details">Show Git blame details</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested2" data-enablement="hovers.enabled &amp;&amp; hovers.currentLine.enabled" disabled>
<input id="hovers.currentLine.changes" name="hovers.currentLine.changes" type="checkbox"></input>
<div class="settings-group__setting nowrap ml-4" data-enablement="hovers.enabled &amp;&amp; hovers.currentLine.enabled"
disabled>
<input id="hovers.currentLine.changes" name="hovers.currentLine.changes" type="checkbox" disabled />
<label for="hovers.currentLine.changes">Show Git changes (diff)</label> <label for="hovers.currentLine.changes">Show Git changes (diff)</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested" data-enablement="hovers.enabled" disabled>
<input id="hovers.annotations.enabled" name="hovers.annotations.enabled" type="checkbox"></input>
<label for="hovers.annotations.enabled">When annotating, show hovers over the </label>
<select id="hovers.annotations.over" name="hovers.annotations.over" data-enablement="hovers.enabled" disabled>
<option value="annotation">annotations only</option>
<option value="line">whole line</option>
</div>
</div>
<div class="section__preview mb-2">
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine.png" data-visibility="hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =annotation"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine.png" data-visibility="hovers.enabled =false &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =annotation"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine.png" data-visibility="hovers.enabled &amp;&amp; hovers.currentLine.enabled =false &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =annotation"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine.png" data-visibility="hovers.enabled =false &amp;&amp; hovers.currentLine.enabled =false &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =annotation"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine-whole.png" data-visibility="currentLine.enabled &amp;&amp; hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine-whole.png" data-visibility="currentLine.enabled &amp;&amp; hovers.enabled =false &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine-whole.png" data-visibility="currentLine.enabled &amp;&amp; hovers.enabled &amp;&amp; hovers.currentLine.enabled =false &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine-whole.png" data-visibility="currentLine.enabled &amp;&amp; hovers.enabled =false &amp;&amp; hovers.currentLine.enabled =false &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine-off-whole.png" data-visibility="currentLine.enabled =false &amp;&amp; hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine-off-whole.png" data-visibility="currentLine.enabled =false &amp;&amp; hovers.enabled =false &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine-off-whole.png" data-visibility="currentLine.enabled =false &amp;&amp; hovers.enabled &amp;&amp; hovers.currentLine.enabled =false &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-currentLine-off-whole.png" data-visibility="currentLine.enabled =false &amp;&amp; hovers.enabled =false &amp;&amp; hovers.currentLine.enabled =false &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine-details.png" data-visibility="hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes =false &amp;&amp; hovers.currentLine.over =annotation"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine-whole-details.png" data-visibility="currentLine.enabled &amp;&amp; hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes =false &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine-off-whole-details.png" data-visibility="currentLine.enabled =false &amp;&amp; hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details &amp;&amp; hovers.currentLine.changes =false &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine-changes.png" data-visibility="hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details =false &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =annotation"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine-whole-changes.png" data-visibility="currentLine.enabled &amp;&amp; hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details =false &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-currentLine-off-whole-changes.png" data-visibility="currentLine.enabled =false &amp;&amp; hovers.enabled &amp;&amp; hovers.currentLine.enabled &amp;&amp; hovers.currentLine.details =false &amp;&amp; hovers.currentLine.changes &amp;&amp; hovers.currentLine.over =line"
/>
</div>
<div class="settings-group">
<div class="settings-group__setting">
<div class="settings-group__setting nowrap ml-2" data-enablement="hovers.enabled" disabled>
<input id="hovers.annotations.enabled" name="hovers.annotations.enabled" type="checkbox" disabled />
<label for="hovers.annotations.enabled">While annotating, show hovers when over the </label>
<select id="hovers.annotations.over" name="hovers.annotations.over" data-enablement="hovers.enabled &amp;&amp; hovers.annotations.enabled" disabled>
<option value="annotation">annotation</option>
<option value="line">line</option>
</select> </select>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested2" data-enablement="hovers.enabled &amp;&amp; hovers.annotations.enabled" disabled>
<input id="hovers.annotations.details" name="hovers.annotations.details" type="checkbox"></input>
<div class="settings-group__setting nowrap ml-4" data-enablement="hovers.enabled &amp;&amp; hovers.annotations.enabled"
disabled>
<input id="hovers.annotations.details" name="hovers.annotations.details" type="checkbox" disabled />
<label for="hovers.annotations.details">Show Git blame details</label> <label for="hovers.annotations.details">Show Git blame details</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested2" data-enablement="hovers.enabled &amp;&amp; hovers.annotations.enabled" disabled>
<input id="hovers.annotations.changes" name="hovers.annotations.changes" type="checkbox"></input>
<div class="settings-group__setting nowrap ml-4" data-enablement="hovers.enabled &amp;&amp; hovers.annotations.enabled"
disabled>
<input id="hovers.annotations.changes" name="hovers.annotations.changes" type="checkbox" disabled />
<label for="hovers.annotations.changes">Show Git changes (diff)</label> <label for="hovers.annotations.changes">Show Git changes (diff)</label>
</div> </div>
</div> </div>
</div> </div>
<div class="section__preview"> <div class="section__preview">
<!-- <img class="image__preview" src="{{root}}/images/settings-hover.png"></img> -->
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-annotations.png" data-visibility="hovers.enabled &amp;&amp; hovers.annotations.enabled &amp;&amp; hovers.annotations.details &amp;&amp; hovers.annotations.changes"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-annotations.png" data-visibility="hovers.enabled = false &amp;&amp; hovers.annotations.enabled &amp;&amp; hovers.annotations.details &amp;&amp; hovers.annotations.changes"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-annotations.png" data-visibility="hovers.enabled &amp;&amp; hovers.annotations.enabled =false &amp;&amp; hovers.annotations.details &amp;&amp; hovers.annotations.changes"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-off-annotations.png" data-visibility="hovers.enabled =false &amp;&amp; hovers.annotations.enabled =false &amp;&amp; hovers.annotations.details &amp;&amp; hovers.annotations.changes"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-annotations-details.png" data-visibility="hovers.enabled &amp;&amp; hovers.annotations.enabled &amp;&amp; hovers.annotations.details &amp;&amp; hovers.annotations.changes =false"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/hovers-annotations-changes.png" data-visibility="hovers.enabled &amp;&amp; hovers.annotations.enabled &amp;&amp; hovers.annotations.details =false &amp;&amp; hovers.annotations.changes"
/>
</div> </div>
</div> </div>
</section> </section>
@ -246,11 +320,11 @@
</div> </div>
<div class="section__settings"> <div class="section__settings">
<div class="settings-group"> <div class="settings-group">
<div class="settings-group__setting">
<input id="statusBar.enabled" name="statusBar.enabled" type="checkbox" class="p">></span></input>
<div class="settings-group__setting nowrap">
<input id="statusBar.enabled" name="statusBar.enabled" type="checkbox" />
<label for="statusBar.enabled">Show a Git blame annotation for the current line in the status bar</label> <label for="statusBar.enabled">Show a Git blame annotation for the current line in the status bar</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested" data-enablement="statusBar.enabled" disabled>
<div class="settings-group__setting ml-2" data-enablement="statusBar.enabled" disabled>
<label for="statusBar.alignment">Position the annotation on the </label> <label for="statusBar.alignment">Position the annotation on the </label>
<select id="statusBar.alignment" name="statusBar.alignment" disabled> <select id="statusBar.alignment" name="statusBar.alignment" disabled>
<option value="left">left side</option> <option value="left">left side</option>
@ -258,7 +332,7 @@
</select> </select>
<label for="statusBar.alignment"> of the status bar</label> <label for="statusBar.alignment"> of the status bar</label>
</div> </div>
<div class="settings-group__setting settings-group__setting--nested" data-enablement="statusBar.enabled" disabled>
<div class="settings-group__setting ml-2" data-enablement="statusBar.enabled" disabled>
<label for="statusBar.command">Clicking on the status bar item will </label> <label for="statusBar.command">Clicking on the status bar item will </label>
<select id="statusBar.command" name="statusBar.command" disabled> <select id="statusBar.command" name="statusBar.command" disabled>
<option value="gitlens.toggleFileBlame">toggle file blame annotations</option> <option value="gitlens.toggleFileBlame">toggle file blame annotations</option>
@ -273,14 +347,17 @@
</div> </div>
</div> </div>
<div class="section__preview"> <div class="section__preview">
<img class="image__preview hidden" src="{{root}}/images/settings-status-bar-off.png" data-visibility="statusBar.enabled =false"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-status-bar-left.png" data-visibility="statusBar.enabled &amp;&amp; statusBar.alignment =left"></img>
<img class="image__preview hidden" src="{{root}}/images/settings-status-bar-right.png" data-visibility="statusBar.enabled &amp;&amp; statusBar.alignment =right"></img>
<img class="image__preview hidden" src="{{root}}/images/settings/status-bar-off.png" data-visibility="statusBar.enabled =false"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/status-bar-left.png" data-visibility="statusBar.enabled &amp;&amp; statusBar.alignment =left"
/>
<img class="image__preview hidden" src="{{root}}/images/settings/status-bar-right.png" data-visibility="statusBar.enabled &amp;&amp; statusBar.alignment =right"
/>
</div> </div>
<p class="settings-group__hint"> <p class="settings-group__hint">
<i class="icon icon--lg icon__info"></i> <i class="icon icon--lg icon__info"></i>
Use the Use the
<a class="command" title="Run Command" href="command:gitlens.toggleLineBlame" class="command">GitLens: Toggle Line Blame Annotations</a> command to override this setting for the current
<a class="command" title="Run command" href="command:gitlens.toggleLineBlame" class="command">GitLens: Toggle Line Blame Annotations</a> command to override this setting for the current
window window
</p> </p>
</div> </div>
@ -301,7 +378,7 @@
<select id="keymap" name="keymap"> <select id="keymap" name="keymap">
<option value="standard">the default set of</option> <option value="standard">the default set of</option>
<option value="chorded">a chorded set of</option> <option value="chorded">a chorded set of</option>
<option value="none">no</option>
<option value="none">a custom set of</option>
</select> </select>
<label for="keymap"> keyboard shortcuts</label> <label for="keymap"> keyboard shortcuts</label>
<span class="label__hint hidden" data-visibility="keymap =standard"> <span class="label__hint hidden" data-visibility="keymap =standard">
@ -357,7 +434,7 @@
<li> <li>
<a href="https://twitter.com/eamodio">Follow me on Twitter</a> <a href="https://twitter.com/eamodio">Follow me on Twitter</a>
</li> </li>
<!-- <li><a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#review-details">Become a Patron</a></li> -->
<!-- <li><a href="#">Become a Patron</a></li> -->
<li> <li>
<a href="http://amod.io">Hire me</a> <a href="http://amod.io">Hire me</a>
</li> </li>

+ 31
- 7
src/ui/webpack.config.js View File

@ -1,19 +1,23 @@
'use strict'; 'use strict';
const webpack = require('webpack'); const webpack = require('webpack');
const glob = require('glob');
const path = require('path'); const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin'); const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = function(env, argv) { module.exports = function(env, argv) {
if (env === undefined) { if (env === undefined) {
env = {}; env = {};
} }
const minify = !!env.production;
const prefixCss = true;
const sourceMaps = !env.production;
const production = !!env.production;
const quick = !production && !!env.quick;
const minify = production;
const sourceMaps = !production;
const plugins = [ const plugins = [
new webpack.optimize.ModuleConcatenationPlugin(), new webpack.optimize.ModuleConcatenationPlugin(),
@ -26,7 +30,7 @@ module.exports = function(env, argv) {
template: 'settings/index.html', template: 'settings/index.html',
filename: path.resolve(__dirname, '../..', 'settings.html'), filename: path.resolve(__dirname, '../..', 'settings.html'),
inject: true, inject: true,
inlineSource: env.production ? '.(js|css)$' : undefined,
inlineSource: production ? '.(js|css)$' : undefined,
// inlineSource: '.(js|css)$', // inlineSource: '.(js|css)$',
minify: minify minify: minify
? { ? {
@ -46,7 +50,7 @@ module.exports = function(env, argv) {
template: 'welcome/index.html', template: 'welcome/index.html',
filename: path.resolve(__dirname, '../..', 'welcome.html'), filename: path.resolve(__dirname, '../..', 'welcome.html'),
inject: true, inject: true,
inlineSource: env.production ? '.(js|css)$' : undefined,
inlineSource: production ? '.(js|css)$' : undefined,
// inlineSource: '.(js|css)$', // inlineSource: '.(js|css)$',
minify: minify minify: minify
? { ? {
@ -73,11 +77,31 @@ module.exports = function(env, argv) {
comments: false, comments: false,
ecma: 5 ecma: 5
}, },
sourceMap: sourceMaps,
sourceMap: sourceMaps
} }
}) })
]; ];
if (!quick) {
plugins.push(
new ImageminPlugin({
disable: false,
externalImages: {
sources: glob.sync(path.resolve(__dirname, 'images/settings/*.png')),
destination: path.resolve(__dirname, '../..')
},
gifsicle: null,
jpegtran: null,
optipng: null,
pngquant: {
quality: '85-100',
speed: minify ? 1 : 10
},
svgo: null
})
);
}
return { return {
// This is ugly having main.scss on both bundles, but if it is added separately it will generate a js bundle :( // This is ugly having main.scss on both bundles, but if it is added separately it will generate a js bundle :(
entry: { entry: {

+ 8
- 5
src/ui/welcome/index.html View File

@ -11,7 +11,7 @@
<div class="content"> <div class="content">
<header> <header>
<div class="header__logo"> <div class="header__logo">
<img class="image__logo" src="{{root}}/images/gitlens-icon.png">
<img class="image__logo" src="{{root}}/images/gitlens-icon.png" />
<div> <div>
<h1>GitLens</h1> <h1>GitLens</h1>
<p class="header__subtitle">Git supercharged</p> <p class="header__subtitle">Git supercharged</p>
@ -35,9 +35,12 @@
<div class="section-group__content"> <div class="section-group__content">
<div class="section-group-section"> <div class="section-group-section">
<p> <p>
GitLens is a free, <a title="Open GitLens on GitHub" href="https://github.com/eamodio/vscode-gitlens">open-source</a> extension for Visual Studio Code created by <a title="About Eric Amodio" href="http://amod.io">Eric Amodio</a>.
GitLens is a free,
<a title="Open GitLens on GitHub" href="https://github.com/eamodio/vscode-gitlens">open-source</a> extension for Visual Studio Code created by
<a title="Learn more about Eric"
href="http://amod.io">Eric Amodio</a>.
</p> </p>
<p>
<p class="mb-2">
GitLens simply helps you understand code better. Quickly glimpse into who, why, and when a line or code block was changed. GitLens simply helps you understand code better. Quickly glimpse into who, why, and when a line or code block was changed.
Jump back through history to gain further insights as to how and why the code evolved. Explore Jump back through history to gain further insights as to how and why the code evolved. Explore
the history and evolution of a codebase. Dive in and see how GitLens can help! the history and evolution of a codebase. Dive in and see how GitLens can help!
@ -56,7 +59,7 @@
revisions, stash access, repository status, and more</li> revisions, stash access, repository status, and more</li>
</ul> </ul>
</p> </p>
<p>GitLens is powerful, feature rich, and highly customizable to meet your specific needs, so please
<p class="mb-2">GitLens is powerful, feature rich, and highly customizable to meet your specific needs, so please
be sure to visit the be sure to visit the
<a title="Open GitLens Settings" href="command:gitlens.showSettingsPage">GitLens settings page</a>.</p> <a title="Open GitLens Settings" href="command:gitlens.showSettingsPage">GitLens settings page</a>.</p>
</div> </div>
@ -117,7 +120,7 @@
<li> <li>
<a href="https://twitter.com/eamodio">Follow me on Twitter</a> <a href="https://twitter.com/eamodio">Follow me on Twitter</a>
</li> </li>
<!-- <li><a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#review-details">Become a Patron</a></li> -->
<!-- <li><a href="#">Become a Patron</a></li> -->
<li> <li>
<a href="http://amod.io">Hire me</a> <a href="http://amod.io">Hire me</a>
</li> </li>

Loading…
Cancel
Save