Introduce lightbox view for images

Summary:
images attached to maniphest tasks and mentioned in remarkup anywhere now invoke a lightbox control that lets the user page through all the images.

lightbox includes a download button, next / prev buttons, and if we're not at the tippy toppy of hte page an "X" or close button.

we also respond to left, right, and esc for navigating.

next time we should get non-images working in here...!

Test Plan:
played with maniphest - looks good
made comments with images. looks good.
made sure multiple image comments worked.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, chad

Maniphest Tasks: T1896

Differential Revision: https://secure.phabricator.com/D3705
This commit is contained in:
Bob Trahan
2012-10-22 19:06:56 -07:00
parent ddde99f80c
commit 3ffc764141
24 changed files with 858 additions and 214 deletions

View File

@@ -57,9 +57,10 @@ final class PhabricatorFileDataController extends PhabricatorFileController {
$response->setContent($data);
$response->setCacheDurationInSeconds(60 * 60 * 24 * 30);
$is_view = $file->isViewableInBrowser();
$is_viewable = $file->isViewableInBrowser();
$force_download = $request->getExists('download');
if ($is_view) {
if ($is_viewable && !$force_download) {
$response->setMimeType($file->getViewableMimeType());
} else {
if (!$request->isHTTPPost()) {