1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Replace 'Embed' hint on Pholio

Summary: Replaces Embed hint with where the heck you are hint.

Test Plan: Tested current and previous mock images.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5384

Differential Revision: https://secure.phabricator.com/D9658
This commit is contained in:
Chad Little 2014-06-22 11:09:05 -07:00
parent fcaeb2aeb6
commit 25db3f44a0
4 changed files with 27 additions and 11 deletions

View file

@ -81,7 +81,7 @@ return array(
'rsrc/css/application/phame/phame.css' => '19ecc703', 'rsrc/css/application/phame/phame.css' => '19ecc703',
'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee', 'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee',
'rsrc/css/application/pholio/pholio-inline-comments.css' => '2703fdb9', 'rsrc/css/application/pholio/pholio-inline-comments.css' => '2703fdb9',
'rsrc/css/application/pholio/pholio.css' => '5591f1e9', 'rsrc/css/application/pholio/pholio.css' => '209b1f08',
'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb', 'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb',
'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad',
'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071', 'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071',
@ -401,7 +401,7 @@ return array(
'rsrc/js/application/passphrase/phame-credential-control.js' => '1e1c8a59', 'rsrc/js/application/passphrase/phame-credential-control.js' => '1e1c8a59',
'rsrc/js/application/phame/phame-post-preview.js' => '61d927ec', 'rsrc/js/application/phame/phame-post-preview.js' => '61d927ec',
'rsrc/js/application/pholio/behavior-pholio-mock-edit.js' => '1e1e8bb0', 'rsrc/js/application/pholio/behavior-pholio-mock-edit.js' => '1e1e8bb0',
'rsrc/js/application/pholio/behavior-pholio-mock-view.js' => '929d95eb', 'rsrc/js/application/pholio/behavior-pholio-mock-view.js' => '91a166c7',
'rsrc/js/application/phortune/behavior-balanced-payment-form.js' => '3b3e1664', 'rsrc/js/application/phortune/behavior-balanced-payment-form.js' => '3b3e1664',
'rsrc/js/application/phortune/behavior-stripe-payment-form.js' => '1693a296', 'rsrc/js/application/phortune/behavior-stripe-payment-form.js' => '1693a296',
'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'b3e5ee60', 'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'b3e5ee60',
@ -626,7 +626,7 @@ return array(
'javelin-behavior-phabricator-watch-anchor' => '06e05112', 'javelin-behavior-phabricator-watch-anchor' => '06e05112',
'javelin-behavior-phame-post-preview' => '61d927ec', 'javelin-behavior-phame-post-preview' => '61d927ec',
'javelin-behavior-pholio-mock-edit' => '1e1e8bb0', 'javelin-behavior-pholio-mock-edit' => '1e1e8bb0',
'javelin-behavior-pholio-mock-view' => '929d95eb', 'javelin-behavior-pholio-mock-view' => '91a166c7',
'javelin-behavior-phui-object-box-tabs' => 'a3e2244e', 'javelin-behavior-phui-object-box-tabs' => 'a3e2244e',
'javelin-behavior-phui-timeline-dropdown-menu' => '4d94d9c3', 'javelin-behavior-phui-timeline-dropdown-menu' => '4d94d9c3',
'javelin-behavior-policy-control' => 'f3fef818', 'javelin-behavior-policy-control' => 'f3fef818',
@ -752,7 +752,7 @@ return array(
'phabricator-uiexample-reactor-sendproperties' => '551add57', 'phabricator-uiexample-reactor-sendproperties' => '551add57',
'phabricator-zindex-css' => 'efb673ac', 'phabricator-zindex-css' => 'efb673ac',
'phame-css' => '19ecc703', 'phame-css' => '19ecc703',
'pholio-css' => '5591f1e9', 'pholio-css' => '209b1f08',
'pholio-edit-css' => '3ad9d1ee', 'pholio-edit-css' => '3ad9d1ee',
'pholio-inline-comments-css' => '2703fdb9', 'pholio-inline-comments-css' => '2703fdb9',
'phortune-credit-card-form' => '2290aeef', 'phortune-credit-card-form' => '2290aeef',
@ -1520,7 +1520,7 @@ return array(
3 => 'javelin-mask', 3 => 'javelin-mask',
4 => 'phabricator-drag-and-drop-file-upload', 4 => 'phabricator-drag-and-drop-file-upload',
), ),
'929d95eb' => '91a166c7' =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',
1 => 'javelin-util', 1 => 'javelin-util',

View file

@ -73,13 +73,18 @@ final class PholioMockImagesView extends AphrontView {
$engine->addObject($image, 'default'); $engine->addObject($image, 'default');
} }
$engine->process(); $engine->process();
$current_set = 0;
foreach ($mock->getAllImages() as $image) { foreach ($mock->getAllImages() as $image) {
$file = $image->getFile(); $file = $image->getFile();
$metadata = $file->getMetadata(); $metadata = $file->getMetadata();
$x = idx($metadata, PhabricatorFile::METADATA_IMAGE_WIDTH); $x = idx($metadata, PhabricatorFile::METADATA_IMAGE_WIDTH);
$y = idx($metadata, PhabricatorFile::METADATA_IMAGE_HEIGHT); $y = idx($metadata, PhabricatorFile::METADATA_IMAGE_HEIGHT);
$is_obs = (bool)$image->getIsObsolete();
if (!$is_obs) {
$current_set++;
}
$history_uri = '/pholio/image/history/'.$image->getID().'/'; $history_uri = '/pholio/image/history/'.$image->getID().'/';
$images[] = array( $images[] = array(
'id' => $image->getID(), 'id' => $image->getID(),
@ -129,6 +134,7 @@ final class PholioMockImagesView extends AphrontView {
'navsequence' => $navsequence, 'navsequence' => $navsequence,
'fullIcon' => hsprintf('%s', $full_icon), 'fullIcon' => hsprintf('%s', $full_icon),
'downloadIcon' => hsprintf('%s', $download_icon), 'downloadIcon' => hsprintf('%s', $download_icon),
'currentSetSize' => $current_set,
); );
Javelin::initBehavior('pholio-mock-view', $config); Javelin::initBehavior('pholio-mock-view', $config);

View file

@ -240,6 +240,10 @@ button.pholio-image-button-link:active {
border-top: 1px solid {$thinblueborder}; border-top: 1px solid {$thinblueborder};
} }
.pholio-image-revision {
color: {$bluetext};
}
.pholio-history-header { .pholio-history-header {
vertical-align: middle; vertical-align: middle;
color: {$lightbluetext}; color: {$lightbluetext};

View file

@ -644,12 +644,18 @@ JX.behavior('pholio-mock-view', function(config) {
info.push(title); info.push(title);
if (!image.isObsolete) { if (!image.isObsolete) {
var embed = JX.$N( var img_len = config.currentSetSize;
var rev = JX.$N(
'div', 'div',
{className: 'pholio-image-embedding'}, {className: 'pholio-image-revision'},
JX.$H('Embed this image: {M' + config.mockID + JX.$H('Current Revision (' + img_len + ' images)'));
', image=' + image.id + '}')); info.push(rev);
info.push(embed); } else {
var prev = JX.$N(
'div',
{className: 'pholio-image-revision'},
JX.$H('(Previous Revision)'));
info.push(prev);
} }
for (var ii = 0; ii < info.length; ii++) { for (var ii = 0; ii < info.length; ii++) {