Skip to content

Commit

Permalink
Merge branch 'update_diff2html'
Browse files Browse the repository at this point in the history
  • Loading branch information
campersau committed Feb 20, 2020
2 parents 5c01beb + af9775d commit 89a1d22
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 218 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
We are following the [Keep a Changelog](https://keepachangelog.com/) format.

## [Unreleased](https://github.com/FredrikNoren/ungit/compare/v1.5.3...master)
## [Unreleased](https://github.com/FredrikNoren/ungit/compare/v1.5.4...master)

## [1.5.3](https://github.com/FredrikNoren/ungit/compare/v1.5.2...v1.5.3)
## [1.5.4](https://github.com/FredrikNoren/ungit/compare/v1.5.3...v1.5.4)

### Fixed
- Git log for merge / empty commits does not work correctly [#1270](https://github.com/FredrikNoren/ungit/issues/1270)
- forcedLaunchPath of null fails to work [#1281](https://github.com/FredrikNoren/ungit/issues/1281)

### Changed
- Update diff2html to version 3 [#1273](https://github.com/FredrikNoren/ungit/pull/1273)

### Removed
- Remove dependency on npm [#1269](https://github.com/FredrikNoren/ungit/pull/1269)

## [1.5.3](https://github.com/FredrikNoren/ungit/compare/v1.5.2...v1.5.3)

### Fixed
- Git log for merge / empty commits does not work correctly [#1270](https://github.com/FredrikNoren/ungit/issues/1270)

## [1.5.2](https://github.com/FredrikNoren/ungit/compare/v1.5.1...v1.5.2)

### Fixed
Expand Down
2 changes: 0 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ module.exports = (grunt) => {
main: {
files: [
// includes files within path
{ expand: true, flatten: true, src: ['node_modules/nprogress/nprogress.css'], dest: 'public/css/' },
{ expand: true, flatten: true, src: ['node_modules/jquery-ui-bundle/jquery-ui.min.css'], dest: 'public/css/'},
{ expand: true, flatten: true, src: ['node_modules/raven-js/dist/raven.min.js'], dest: 'public/js/' },
{ expand: true, flatten: true, src: ['node_modules/raven-js/dist/raven.min.js.map'], dest: 'public/js/' }
]
Expand Down
2 changes: 1 addition & 1 deletion bin/ungit
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const navigate = () => {
let url = config.urlBase + ':' + config.port;
if (config.forcedLaunchPath === undefined) {
url += '/#/repository?path=' + encodeURIComponent(process.cwd());
} else if (config.forcedLaunchPath !== undefined && config.forcedLaunchPath !== '') {
} else if (config.forcedLaunchPath !== null && config.forcedLaunchPath !== '') {
url += '/#/repository?path=' + encodeURIComponent(config.forcedLaunchPath);
}

Expand Down
6 changes: 6 additions & 0 deletions components/staging/staging.less
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
}
}

.d2h-code-line-prefix input[type="checkbox"] {
margin: 0;
margin-right: -6px;
vertical-align: sub;
}

.files {
position: relative;
.file {
Expand Down
15 changes: 6 additions & 9 deletions components/textdiff/textdiff.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

const ko = require('knockout');
const components = require('ungit-components');
const diff2html = require('diff2html').Diff2Html;
const diff2html = require('diff2html');
const programEvents = require('ungit-program-events');
const promise = require("bluebird");
const sideBySideDiff = 'sidebysidediff';
Expand Down Expand Up @@ -120,7 +120,7 @@ class TextDiffViewModel {
--- a/${this.filename}
+++ b/${this.filename}`;
}
this.diffJson = diff2html.getJsonFromDiff(diffs);
this.diffJson = diff2html.parse(diffs);
}).catch(err => {
// The file existed before but has been removed, but we're trying to get a diff for it
// Most likely it will just disappear with the next refresh of the staging area
Expand Down Expand Up @@ -153,13 +153,10 @@ class TextDiffViewModel {

this.loadMoreCount(Math.min(loadLimit, Math.max(0, lineCount - this.loadCount)));

let html;

if (this.textDiffType.value() === sideBySideDiff) {
html = diff2html.getPrettySideBySideHtmlFromJson(this.diffJson);
} else {
html = diff2html.getPrettyHtmlFromJson(this.diffJson);
}
let html = diff2html.html(this.diffJson, {
outputFormat: this.textDiffType.value() === sideBySideDiff ? 'side-by-side' : 'line-by-line',
drawFileList: false
});

this.numberOfSelectedPatchLines = 0;
let index = 0;
Expand Down
31 changes: 13 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ungit",
"author": "Fredrik Norén <[email protected]>",
"description": "Git made easy",
"version": "1.5.3",
"version": "1.5.4",
"ungitPluginApiVersion": "0.2.0",
"scripts": {
"start": "node ./bin/ungit",
Expand Down Expand Up @@ -31,7 +31,7 @@
"cookie-parser": "~1.4.4",
"crossroads": "~0.12.2",
"dedent": "^0.7.0",
"diff2html": "~2.8.0",
"diff2html": "~3.1.2",
"dnd-page-scroll": "0.0.4",
"express": "~4.16.4",
"express-session": "~1.16.1",
Expand Down
2 changes: 0 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0 ">
<link rel="stylesheet" type="text/css" href="__ROOT_PATH__/css/styles.css" />
<link rel="stylesheet" type="text/css" href="__ROOT_PATH__/css/nprogress.css" />
<link rel="stylesheet" type="text/css" href="__ROOT_PATH__/css/jquery-ui.min.css" />
<link rel="shortcut icon" href="__ROOT_PATH__/favicon.ico" >
<link rel="shortcut icon" href="/images/icon.png" >
<title>ungit</title>
Expand Down
Loading

0 comments on commit 89a1d22

Please sign in to comment.