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:
@@ -24,11 +24,25 @@ final class PhabricatorFileTransformController
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->transform = $data['transform'];
|
||||
$this->phid = $data['phid'];
|
||||
$this->phid = $data['phid'];
|
||||
$this->key = $data['key'];
|
||||
}
|
||||
|
||||
public function shouldRequireLogin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function processRequest() {
|
||||
|
||||
$file = id(new PhabricatorFile())->loadOneWhere('phid = %s', $this->phid);
|
||||
if (!$file) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
if (!$file->validateSecretKey($this->key)) {
|
||||
return new Aphront403Response();
|
||||
}
|
||||
|
||||
$xform = id(new PhabricatorTransformedFile())
|
||||
->loadOneWhere(
|
||||
'originalPHID = %s AND transform = %s',
|
||||
@@ -39,11 +53,6 @@ final class PhabricatorFileTransformController
|
||||
return $this->buildTransformedFileResponse($xform);
|
||||
}
|
||||
|
||||
$file = id(new PhabricatorFile())->loadOneWhere('phid = %s', $this->phid);
|
||||
if (!$file) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$type = $file->getMimeType();
|
||||
|
||||
if (!$file->isViewableInBrowser() || !$file->isTransformableImage()) {
|
||||
|
||||
Reference in New Issue
Block a user