Add preference for showing exact or relative dates.
Make the showWhitespaceDifferences preference work.
Make the context slider in the diff views work.
This is done with a minimal version of jQuery 1.3.2 being responsible for the animation and
a small cookie storing the last value between page refreshes so that it can be incremented by the HTML sliders
default value.
TODO: Maybe we can also make the default context value into a preference?
NOTE: Using this feature needs cookies enabled, which may sub-optimal in
corporate controlled environments.
TODO: The dependency on jQuery is overkill for something as simple as
updating tracking mouse-ups on a input element.
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>
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>
- display context lines in own <div>.
- Stagebutton no longer is float: left.
This fixes ticket #104
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
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.
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.
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.
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"
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.
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.
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.
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).