Commit Graph

22 Commits

Author SHA1 Message Date
Johannes Gilger ab870c66a8 keyboardNavigation: Fix keys 'c' and 'v' from webView
This fixes two small bugs:
1. The JavaScript-method is called "showDiff" instead of "showDiffs"
since cfbcfc1f38. That's why the 'v' button didn't work since then.
2. Commit f05d0188fc introduced an error when trying to access
"event" for key-presses from Cocoa, which resulted in an error and
therefore made the following if-statements unreachable.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-06-10 16:46:59 +02:00
Johannes Gilger 51478449ec diffHighlighter: Correctly match unified diff hunks
Hunks in unified diffs are usually in the form of @@ -a,b +x,y @@, but
sometimes the ,b (i.e. the range) can be ommitted, in which case our
code didn't match the hunk-header at all, resulting in line-numbers
off-by-one in commit-view.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-02-21 23:02:14 +01:00
Johannes Gilger 58990fc318 diffHighlighter: Fix indent-after-stagebutton bug
- display context lines in own <div>.
- Stagebutton no longer is float: left.

This fixes ticket #104

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-02-21 22:33:28 +01:00
Johannes Gilger 308a5af02f diffHighlighter: Empty diffs and mode-changes
When there is no diff to display (i.e. empty-file mode-changes, deletion
or creation) we don't draw a diff-box (div) but just list the filename.

Also fixes a bug with mode-changes not displaying new-mode.
2009-02-07 16:31:03 +01:00
Johannes Gilger f23b3c498f diffHighlighter: Display removed, but empty, plain-text files 2009-02-07 15:04:41 +01:00
Johannes Gilger 20b5fa6214 diffHighlighter: Display created, but empty, plain-text files
Plain-text files which have been created are not diffed against
/dev/null, but have a "new file mode" line. This patch catches this case
and also highlights that the control-flow in diffHighlighter is less
than optimal.
2009-02-07 13:47:06 +01:00
Johannes Gilger 8bed6191f5 diffHighlighter.js: Bail out early for deleted binary/image files
If we have an image (png,jpg,...) which was deleted we cant display a
diff or the file itself anymore. In this case the entry in the file-list
is enough.
2009-02-06 21:09:01 +01:00
Johannes Gilger 7cb4930389 diffHighlighter: Fix display for deletion of binary files
When a binary file is deleted the second filename doesn't start with b/
but is "/dev/null". We didn't account for that.
2009-02-06 21:08:01 +01:00
Johannes Gilger bb8a615b22 Recognize file-mode changes correctly and display them
diffHighligher.js: Recognize file-mode changes and mark them
history.js: Extend newfile callback by parameters for mode
history.css: Adjust changed-span to accomodate "mode changed"
2009-02-06 21:07:57 +01:00
Pieter de Bie 1dc649bf09 Diff: also show a binary when it's deleted 2009-01-26 21:18:29 +00:00
Pieter de Bie b44b0df75a DiffHighlighter: Properly show binary changes
Binary changes don't have a +++ / --- line, just like
a 100% rename doesn't show any changes. We work around
this in much the same way -- by reading the filenames
for that specific case.
2009-01-25 21:45:28 +00:00
Pieter de Bie 5482dfe450 Rudimentary support for renames/deletions of files
diffHighlighter.js, history.js: Distinguish created, renamed, changed and deleted files and display them accordingly
2009-01-25 17:46:19 +00:00
Johannes Gilger ed08bf64bd diffHighlighter.js: Off-by-one for last file in diff, resulting in wrong href 2009-01-19 17:00:59 +00:00
Pieter de Bie 0852f6326c DiffHighlighter: Don't display a diff if there's nothing to display 2008-12-01 15:57:21 +01:00
Pieter de Bie 359346a2d3 DiffHighlighter: Add a binary file callback
This allows a caller to return custom code when
a file is marked as binary, such as the option
to display the file
2008-12-01 15:57:18 +01:00
Pieter de Bie 7a3166c0e6 WebHistoryView: Use diff callbacks to display history list
This is the start of a callback system we can use to 
make the diff more interactive
2008-12-01 15:09:48 +01:00
Pieter de Bie 23bb1658d9 WIP: Prettify the diff display by using rounded corners
This wraps each changed file in its own rounded box, making
the diff display easier to the eye :)
2008-11-26 17:44:49 +01:00
Pieter de Bie 07554fbd1f Add toggle function 2008-11-26 17:44:48 +01:00
Pieter de Bie 7e2707d979 DiffHilighter: Specific the div in which to hilight
Previously, the diff hilighter was a bit odd in that it would
just search for elements with a diff and highlight those. While
useful in theory, this wasn't used at all. We change it to
receive the diff to hilight, which makes the code somewhat simpler.
2008-11-25 17:43:11 +01:00
Stephen Bannasch f05d0188fc add commit file links and ctrl-arrow navigation
A list of files included in a commit are listed below the
commit message. The list are links which will take you to
that file in the diff display below.

The title of each fileHeader is now just the path to the file
instead of the full diff command.

While the focus is in the commit ctrl-down_arrow and up_arrow
will navigate to to next and previous file in that commit.
2008-11-25 17:43:11 +01:00
Pieter de Bie b1e3dd2212 WebCommitView: Use a notification to display errors
This should give GitX some more consistency. Also, it will
give us a basis to build further changes on.
2008-10-21 22:48:50 +02:00
Pieter de Bie bd097b0eff HTML: Restructure html folder
This changes the HTML part of GitX to be more consistent -- we
now use a "views" directory where every web view has it's own
directory.

Furthermore, GitX-wide Javascript is added in the "lib" directory.
The same is true for CSS in the "css" directory. Every view can
have its own custom CSS and JS, and those are put in the views
directory (without JS or CSS prefix directories).
2008-10-21 22:48:47 +02:00