diff --git a/html/css/GitX.css b/html/css/GitX.css index 1ef5f58..d4b0e48 100644 --- a/html/css/GitX.css +++ b/html/css/GitX.css @@ -1,2 +1,8 @@ @import url("diff.css"); -@import url("notification.css"); \ No newline at end of file +@import url("notification.css"); + +body { + margin: 0; + margin-top: 5px; + width: 100%; +} \ No newline at end of file diff --git a/html/css/diff.css b/html/css/diff.css index 2b6ad3e..bfe75e4 100644 --- a/html/css/diff.css +++ b/html/css/diff.css @@ -1,62 +1,52 @@ -body { - margin: 0; - margin-top: 5px; - width: 100%; +.diff .file { + margin: 10px; + padding: 10px; + -webkit-border-radius: 10px; + border: 1px solid gray; + -webkit-box-shadow: 1px 1px 3px #888; } -.fileHeader { - margin-top: 0px; - padding-top: 2px; +.diff .file .fileHeader { + margin-top: -5px; padding-bottom: 1px; - border-top:0.1em solid #999999; + font-weight: bold; } -.delline, .oldfile { - background-color: #FEE; - color: #B00; +.diff .file .diffContent { + white-space: pre; + font-family: Monaco; } -.addline, .newfile { - background-color: #DFD; - color: #080; -} -.fileline { - font-weight: bold; -} - -.hunkheader { - background-color: #f7f7f7; - color: #bbb; -} - -pre { - width: 100%; -} - -pre code { - width: 100%; -} - -#CurrentHunk { - border-left: 5px solid black; -} - -.whitespace { - background-color: rgba(255,0,0,0.5); -} - - -table.diff { - margin-top: 15px; - margin-left: 5px; - margin-right: 5px; - border-spacing: 0; -} -.lineno { +.diff .file .diffcontent .lineno { + float: left; padding-left: 2px; padding-right: 2px; background-color: #ECECEC; color: #A9A9A9; border: 1px solid #DDDDDD; text-align: right; +} + +.diff .file .diffContent .lines .hunkheader { + background-color: #f7f7f7; + color: #bbb; +} + + +.diff .file .diffcontent .lines .delline { + background-color: #FEE; + color: #B00; +} + +.diff .file .diffcontent .lines .addline { + background-color: #DFD; + color: #080; +} + +.diff .file .diffcontent .lines .whitespace { + background-color: rgba(255,0,0,0.5); +} + +#CurrentHunk { + border-left: 5px solid black; } \ No newline at end of file diff --git a/html/lib/diffHighlighter.js b/html/lib/diffHighlighter.js index f2cc6d0..0f8b00a 100644 --- a/html/lib/diffHighlighter.js +++ b/html/lib/diffHighlighter.js @@ -8,14 +8,16 @@ if (typeof Controller == 'undefined') { var highlightDiff = function(diff, element) { var start = new Date().getTime(); - + element.className = "diff" var content = diff.escapeHTML().replace(/\t/g, " ");; var file_index = 0; + var filename = ""; var line1 = ""; var line2 = ""; var diffContent = ""; + var finalContent = ""; var lines = content.split('\n'); var hunk_start_line_1 = -1; @@ -31,13 +33,26 @@ var highlightDiff = function(diff, element) { if (header) { if (firstChar == "+" || firstChar == "-") continue; - } else if (firstChar == "d") { - ++file_index; + } else if (firstChar == "d") { // New file, we have to reset everything header = true; - line1 += '\n'; - line2 += '\n'; - var match = l.match(/diff --git a\/(\S*)/); - diffContent += '
" + line1 + " | " +
- "" + line2 + " | " +
- "" + diffContent + " |
+
diff --git a/html/views/commit/commit.css b/html/views/commit/commit.css
index a366379..9812db8 100644
--- a/html/views/commit/commit.css
+++ b/html/views/commit/commit.css
@@ -48,7 +48,7 @@ table.diff {
margin-top: 30px;
}
-table.diff tr td a.stagebutton {
+.diff a.stagebutton {
display: block;
width: 40px;
padding: 0 2px 0 2px;