Normalize paths for display in reviews and notifications.

This makes reviews for Clear Case contain readable filenames.

Tested on team Review Board 1.6.11 installation.
Reviewed at http://reviews.reviewboard.org/r/3302/
Don't allow all users to see a user's unpublished review replies.

Only put public reviews and non-public reviews created by the authenticated
user in the reviews_id_map, so that unpublished replies are not seen by other
users.

1. Created a review request as user A and published it.
2. As user B, made a comment on a portion of the diff and publish it.
3. As user C, replied to the comment made in step 2 but did NOT publish it.
4. Without the patch, all users could see the comment made in step 3.  With the
patch, only user C could see that comment.

Fixes bugs 2710 and 2719
Reviewed at http://reviews.reviewboard.org/r/3317/
Fix ClearCase unextend_path() on Windows.

The ntpath in Python behaves in the following manner:
  >>> ntpath.join('c:', 'dir', 'file')
  'c:dir\\file'

  >>> os.chdir('C:\\Windows')
  >>> ntpath.realpath(ntpath.join('C:', 'dir', 'file'))
  'C:\\Windows\\dir\\file'

  >>> os.chdir('C:\\Windows')
  >>> ntpath.realpath(ntpath.join('C:\\', 'dir', 'file'))
  'C:\\dir\\file'

  >>> ntpath.realpath(ntpath.join('/', 'computer', 'share', 'file'))
  'C:\\computer\\share\file'

  >>> ntpath.realpath(ntpath.join('\\\\', 'computer', 'share', 'file'))
  '\\\\computer\\share\\file'

The unextended_chunks[0] in case of repository on local drive is 'X:' where X
is the drive letter, and in case of UNC path is '/'. Change the
unextended_chunks[0] so the returned realpath is correct.

This both makes the displayed path proper and resolves the "ValueError: Cannot
mix UNC and non-UNC paths" when Clear Case repository is configured with UNC
path.

Tested on production 1.6.11 installation.

Reviewed at http://reviews.reviewboard.org/r/3321/
Fix ClearCase relpath on Windows.

ntpath.relpath() overflows and throws TypeError for paths containing atleast 520
characters (not that hard to encounter in UCM repository). Handle this problem
by falling back to the "approximation method".

Tested on Windows ReviewBoard 1.6.11 installation.

Reviewed at http://reviews.reviewboard.org/r/3323/
Add support for incremental diff expansion.

Review Board has always had the ability to let users expand collapsed
chunks of diffs, but this can produce a lot of content when dealing with
large sections of collapsed code.

This feature introduces incremental expansion. Users can expand the
diffs by 20 lines at a time, before or after the collapsed header. They
can also expand up to the nearest function listed, and of course, can
expand te entire header.

When a diff is expanded, even partially, little floating collapse
buttons will appear near the center column. They'll stay in view,
centered amongst the visible portion of the expanded region. Clicking
them will re-collapse that segment.

This feature was sponsored by NetApp, Inc.

Fixes bugs 342, 603, and 1231.
Add support for ClearCase snapshot views.

This is especially useful for Windows installations due to the pathname
limitation.

Tested on Windows ReviewBoard 1.6.11 installation.
Did some basic tests on Linux.

Reviewed at http://reviews.reviewboard.org/r/3322/
Fix several issues with the new site style.

The dropdown menus at the top of the page should no longer sit below
other UI elements. In fact, the whole z-order of elements is now defined
in one place, so that we're not using random numbers all over.

The borders of the review request action menus are now set correctly.

Primary column contents in the admin UI are no longer inheriting the
column header styling.

The trophies no longer cause the review request action bar to shift
down.
Move our third-party script dependencies into static/lib/js/.

This move makes it easier to separate out our dependencies from the rest
of our code. As our codebase grows, this organization will help
considerably. It will also be easier to grep without including all our
dependencies.
Introduce Backbone.js and Underscore.js as dependencies.

We now provide a 3rdparty.min.js pipeline bundle that includes
Backbone.js and Underscore.js as dependencies. We'll be using this for
parts of the new JavaScript codebase.
Link the new lib/ directory when linking static media for a site.

The new lib/ directory (which sits alongside rb/) is now linked when
creating or updating a site.
Include the 3rdparty static bundle after jquery-ui.

The 3rdparty static bundle is now included after jquery-ui and after the
page has loaded. This was needed because some of the scripts there
needed jquery-ui to even parse.
Tweak a couple styles for the review request box.

The double border between the action bar and the review request contents
is now a 1px border instead.

The right-most action's rounded corner has been fixed. The background
color was sticking out, as it was still a rectangle.
Update to jQuery 1.8.

This change updates us to jQuery 1.8. The main highlights are that we
now use on() for event binding (instead of bind() and live()) and we no
longer use removed methods for content handling in ajax requests.

We also now use the latest upstream of jquery.form.js
(https://github.com/malsup/form). We were using a very old fork that
worked around some bugs in IE and Opera, but these fixes have long been
included in jquery.form.js. This release is needed for jQuery 1.8
compatibility.

The bulk of this work was done by Yazan Medanat, with some small
changes, moving of files to the new lib directory, CSS fixes,
and jquery.form.js updating done by me.

Given how out of date we were before, it's expected that some things may
still be broken. We'll need to dogfood this carefully before release.

Reviewed at http://reviews.reviewboard.org/r/3267/
Fix the administrator add/change repository tool.

The upgrade to the UI / theme introduced a bug where some code expected
jQuery before it was made available. This fixes that bug.

This fixes Issue #2742.
Fix scrolling to diff chunks with jQuery 1.8.

The way selectors worked has changed since jQuery 1.3. This broke our
anchor selection and highlighting. We needed to quote the anchor name,
which seems to work quite well.
Fix the style for the diff section of the review request box.

The diff information section in the review request box was right up
against the border of the box. It now has padding consistent with other
elements of the box.
Fix diff line highlighting on Firefox.

jQuery removed Event.originalTarget, causing our line highlighting to
fail. Event.target seems to be more or less what we want, though, so use
that instead. This fixes it in Firefox, and things still work correctly
in Chrome.
Add Karl Leuschen to AUTHORS.
Replace the Report Bug and Bugs links with Support.

The Report Bug and Bugs links in the top header bar have been replaced
with a link to our Support page. This should provide a better support
mechanism for our users, who sometimes will file bugs for support or
file bugs thinking it's for their own product, and get them to better
content right away.
Fix linking to bug numbers when they contain "#".

Bug numbers, when prefixed with "#", included the "#" as part of the bug
URL. This is now stripped.

Fixes bug #2449