Skip to content

Commit 5e53fc7

Browse files
author
epriestley
committedMar 23, 2013
Fix some ObjectItemList issues
Summary: Safari has a weird bug with `border-radius` plus border color: {F35865} Move the uncolored borders to an internal div to fix this. Also tweak some positioning on icons for cards, and add a "magenta" color. Test Plan: {F35866} Reviewers: chad, btrahan Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5338
1 parent efe0c13 commit 5e53fc7

File tree

7 files changed

+335
-131
lines changed

7 files changed

+335
-131
lines changed
 

‎src/__celerity_resource_map__.php

+46-39
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,13 @@
581581
'disk' => '/rsrc/image/texture/dust_background.jpg',
582582
'type' => 'jpg',
583583
),
584+
'/rsrc/image/texture/grip.png' =>
585+
array(
586+
'hash' => 'f11bc231d241f1335cfca2933ad234e0',
587+
'uri' => '/res/f11bc231/rsrc/image/texture/grip.png',
588+
'disk' => '/rsrc/image/texture/grip.png',
589+
'type' => 'png',
590+
),
584591
'/rsrc/image/texture/pholio-background.gif' =>
585592
array(
586593
'hash' => 'cf4561af116edf393dc583e5119fb412',
@@ -2988,7 +2995,7 @@
29882995
),
29892996
'phabricator-object-item-list-view-css' =>
29902997
array(
2991-
'uri' => '/res/f3c39d6f/rsrc/css/layout/phabricator-object-item-list-view.css',
2998+
'uri' => '/res/aa09c531/rsrc/css/layout/phabricator-object-item-list-view.css',
29922999
'type' => 'css',
29933000
'requires' =>
29943001
array(
@@ -3686,7 +3693,7 @@
36863693
), array(
36873694
'packages' =>
36883695
array(
3689-
'3f552ecc' =>
3696+
'6c294512' =>
36903697
array(
36913698
'name' => 'core.pkg.css',
36923699
'symbols' =>
@@ -3728,7 +3735,7 @@
37283735
34 => 'phabricator-object-item-list-view-css',
37293736
35 => 'global-drag-and-drop-css',
37303737
),
3731-
'uri' => '/res/pkg/3f552ecc/core.pkg.css',
3738+
'uri' => '/res/pkg/6c294512/core.pkg.css',
37323739
'type' => 'css',
37333740
),
37343741
'95ceba95' =>
@@ -3919,16 +3926,16 @@
39193926
'reverse' =>
39203927
array(
39213928
'aphront-attached-file-view-css' => 'c41b4907',
3922-
'aphront-dialog-view-css' => '3f552ecc',
3923-
'aphront-error-view-css' => '3f552ecc',
3924-
'aphront-form-view-css' => '3f552ecc',
3925-
'aphront-list-filter-view-css' => '3f552ecc',
3926-
'aphront-pager-view-css' => '3f552ecc',
3927-
'aphront-panel-view-css' => '3f552ecc',
3928-
'aphront-table-view-css' => '3f552ecc',
3929-
'aphront-tokenizer-control-css' => '3f552ecc',
3930-
'aphront-tooltip-css' => '3f552ecc',
3931-
'aphront-typeahead-control-css' => '3f552ecc',
3929+
'aphront-dialog-view-css' => '6c294512',
3930+
'aphront-error-view-css' => '6c294512',
3931+
'aphront-form-view-css' => '6c294512',
3932+
'aphront-list-filter-view-css' => '6c294512',
3933+
'aphront-pager-view-css' => '6c294512',
3934+
'aphront-panel-view-css' => '6c294512',
3935+
'aphront-table-view-css' => '6c294512',
3936+
'aphront-tokenizer-control-css' => '6c294512',
3937+
'aphront-tooltip-css' => '6c294512',
3938+
'aphront-typeahead-control-css' => '6c294512',
39323939
'differential-changeset-view-css' => '8aaacd1b',
39333940
'differential-core-view-css' => '8aaacd1b',
39343941
'differential-inline-comment-editor' => '322728f3',
@@ -3942,7 +3949,7 @@
39423949
'differential-table-of-contents-css' => '8aaacd1b',
39433950
'diffusion-commit-view-css' => 'c8ce2d88',
39443951
'diffusion-icons-css' => 'c8ce2d88',
3945-
'global-drag-and-drop-css' => '3f552ecc',
3952+
'global-drag-and-drop-css' => '6c294512',
39463953
'inline-comment-summary-css' => '8aaacd1b',
39473954
'javelin-aphlict' => '95ceba95',
39483955
'javelin-behavior' => 'fe22443b',
@@ -4014,48 +4021,48 @@
40144021
'javelin-util' => 'fe22443b',
40154022
'javelin-vector' => 'fe22443b',
40164023
'javelin-workflow' => 'fe22443b',
4017-
'lightbox-attachment-css' => '3f552ecc',
4024+
'lightbox-attachment-css' => '6c294512',
40184025
'maniphest-task-summary-css' => 'c41b4907',
40194026
'maniphest-transaction-detail-css' => 'c41b4907',
40204027
'phabricator-busy' => '95ceba95',
40214028
'phabricator-content-source-view-css' => '8aaacd1b',
4022-
'phabricator-core-buttons-css' => '3f552ecc',
4023-
'phabricator-core-css' => '3f552ecc',
4024-
'phabricator-crumbs-view-css' => '3f552ecc',
4025-
'phabricator-directory-css' => '3f552ecc',
4029+
'phabricator-core-buttons-css' => '6c294512',
4030+
'phabricator-core-css' => '6c294512',
4031+
'phabricator-crumbs-view-css' => '6c294512',
4032+
'phabricator-directory-css' => '6c294512',
40264033
'phabricator-drag-and-drop-file-upload' => '322728f3',
40274034
'phabricator-dropdown-menu' => '95ceba95',
40284035
'phabricator-file-upload' => '95ceba95',
4029-
'phabricator-filetree-view-css' => '3f552ecc',
4030-
'phabricator-flag-css' => '3f552ecc',
4031-
'phabricator-form-view-css' => '3f552ecc',
4032-
'phabricator-header-view-css' => '3f552ecc',
4033-
'phabricator-jump-nav' => '3f552ecc',
4036+
'phabricator-filetree-view-css' => '6c294512',
4037+
'phabricator-flag-css' => '6c294512',
4038+
'phabricator-form-view-css' => '6c294512',
4039+
'phabricator-header-view-css' => '6c294512',
4040+
'phabricator-jump-nav' => '6c294512',
40344041
'phabricator-keyboard-shortcut' => '95ceba95',
40354042
'phabricator-keyboard-shortcut-manager' => '95ceba95',
4036-
'phabricator-main-menu-view' => '3f552ecc',
4043+
'phabricator-main-menu-view' => '6c294512',
40374044
'phabricator-menu-item' => '95ceba95',
4038-
'phabricator-nav-view-css' => '3f552ecc',
4045+
'phabricator-nav-view-css' => '6c294512',
40394046
'phabricator-notification' => '95ceba95',
4040-
'phabricator-notification-css' => '3f552ecc',
4041-
'phabricator-notification-menu-css' => '3f552ecc',
4042-
'phabricator-object-item-list-view-css' => '3f552ecc',
4047+
'phabricator-notification-css' => '6c294512',
4048+
'phabricator-notification-menu-css' => '6c294512',
4049+
'phabricator-object-item-list-view-css' => '6c294512',
40434050
'phabricator-object-selector-css' => '8aaacd1b',
40444051
'phabricator-paste-file-upload' => '95ceba95',
40454052
'phabricator-prefab' => '95ceba95',
40464053
'phabricator-project-tag-css' => 'c41b4907',
4047-
'phabricator-remarkup-css' => '3f552ecc',
4054+
'phabricator-remarkup-css' => '6c294512',
40484055
'phabricator-shaped-request' => '322728f3',
4049-
'phabricator-side-menu-view-css' => '3f552ecc',
4050-
'phabricator-standard-page-view' => '3f552ecc',
4056+
'phabricator-side-menu-view-css' => '6c294512',
4057+
'phabricator-standard-page-view' => '6c294512',
40514058
'phabricator-textareautils' => '95ceba95',
40524059
'phabricator-tooltip' => '95ceba95',
4053-
'phabricator-transaction-view-css' => '3f552ecc',
4054-
'phabricator-zindex-css' => '3f552ecc',
4055-
'sprite-apps-large-css' => '3f552ecc',
4056-
'sprite-gradient-css' => '3f552ecc',
4057-
'sprite-icon-css' => '3f552ecc',
4058-
'sprite-menu-css' => '3f552ecc',
4059-
'syntax-highlighting-css' => '3f552ecc',
4060+
'phabricator-transaction-view-css' => '6c294512',
4061+
'phabricator-zindex-css' => '6c294512',
4062+
'sprite-apps-large-css' => '6c294512',
4063+
'sprite-gradient-css' => '6c294512',
4064+
'sprite-icon-css' => '6c294512',
4065+
'sprite-menu-css' => '6c294512',
4066+
'syntax-highlighting-css' => '6c294512',
40604067
),
40614068
));

‎src/aphront/response/AphrontAjaxResponse.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,16 @@ public function buildResponseString() {
4545
));
4646
}
4747

48+
// Flatten the response first, so we initialize any behaviors and metadata
49+
// we need to.
50+
$content = array(
51+
'payload' => $this->content,
52+
);
53+
$this->encodeJSONForHTTPResponse($content);
54+
4855
$response = CelerityAPI::getStaticResourceResponse();
4956
$object = $response->buildAjaxResponse(
50-
$this->content,
57+
$content['payload'],
5158
$this->error);
5259

5360
$response_json = $this->encodeJSONForHTTPResponse($object);

‎src/aphront/response/AphrontResponse.php

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ public function setFrameable($frameable) {
5555
}
5656

5757
public static function processValueForJSONEncoding(&$value, $key) {
58+
if ($value instanceof PhutilSafeHTMLProducerInterface) {
59+
// This renders the producer down to PhutilSafeHTML, which will then
60+
// be simplified into a string below.
61+
$value = hsprintf('%s', $value);
62+
}
63+
5864
if ($value instanceof PhutilSafeHTML) {
5965
// TODO: Javelin supports implicity conversion of '__html' objects to
6066
// JX.HTML, but only for Ajax responses, not behaviors. Just leave things

‎src/applications/uiexample/examples/PhabricatorObjectItemListExample.php

+67-6
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,19 @@ public function renderExample() {
2828

2929
$list->addItem(
3030
id(new PhabricatorObjectItemView())
31+
->setObjectName('FRUIT1')
3132
->setHeader(pht('Apple'))
3233
->setHref('#'));
3334

3435
$list->addItem(
3536
id(new PhabricatorObjectItemView())
37+
->setObjectName('FRUIT2')
3638
->setHeader(pht('Banana'))
3739
->setHref('#'));
3840

3941
$list->addItem(
4042
id(new PhabricatorObjectItemView())
43+
->setObjectName('FRUIT3')
4144
->setHeader(pht('Cherry'))
4245
->setHref('#'));
4346

@@ -85,32 +88,68 @@ public function renderExample() {
8588

8689
$list->addItem(
8790
id(new PhabricatorObjectItemView())
88-
->setHeader(pht('Business Card')));
91+
->setHeader(pht('Business Card'))
92+
->setBarColor('red'));
8993
$list->addItem(
9094
id(new PhabricatorObjectItemView())
91-
->setHeader(pht('Playing Card')));
95+
->setHeader(pht('Playing Card'))
96+
->setBarColor('orange')
97+
->addIcon('comment', pht('Royal Flush!')));
9298
$list->addItem(
9399
id(new PhabricatorObjectItemView())
94-
->setHeader(pht('House of Cards')));
100+
->setHeader(pht('House of Cards'))
101+
->setBarColor('yellow'));
95102
$list->addItem(
96103
id(new PhabricatorObjectItemView())
97-
->setHeader(pht('Cardigan')));
104+
->setHeader(pht('Cardigan'))
105+
->setBarColor('green'));
98106
$list->addItem(
99107
id(new PhabricatorObjectItemView())
100108
->setHeader(pht('Cardamom'))
101-
->addFootIcon('highlight-white', 'Spice'));
109+
->addFootIcon('highlight-white', 'Spice')
110+
->setBarColor('blue'));
102111
$list->addItem(
103112
id(new PhabricatorObjectItemView())
104113
->setHeader(pht(
105114
'The human cardiovascular system includes the heart, lungs, and '.
106115
'some other parts; most of these parts are pretty squishy'))
107116
->addFootIcon('search-white', pht('Respiration!'))
108-
->addHandleIcon($handle, pht('You have a cardiovascular system!')));
117+
->addHandleIcon($handle, pht('You have a cardiovascular system!'))
118+
->setBarColor('magenta'));
109119

110120

111121
$out[] = array($head, $list);
112122

113123

124+
$head = id(new PhabricatorHeaderView())
125+
->setHeader(pht('Grippable List'));
126+
$list = new PhabricatorObjectItemListView();
127+
$list->setCards(true);
128+
129+
$list->addItem(
130+
id(new PhabricatorObjectItemView())
131+
->setHeader(pht('Grab ahold!'))
132+
->setHref('#')
133+
->setGrippable(true)
134+
->setBarColor('red'));
135+
136+
$list->addItem(
137+
id(new PhabricatorObjectItemView())
138+
->setHeader(pht('Hold on tight!'))
139+
->setHref('#')
140+
->setGrippable(true)
141+
->setBarColor('yellow'));
142+
143+
$list->addItem(
144+
id(new PhabricatorObjectItemView())
145+
->setHeader(pht("Don't let go!"))
146+
->setHref('#')
147+
->setGrippable(true)
148+
->setBarColor('green'));
149+
150+
$out[] = array($head, $list);
151+
152+
114153
$head = id(new PhabricatorHeaderView())
115154
->setHeader(pht('Extras'));
116155

@@ -129,6 +168,28 @@ public function renderExample() {
129168
->addHandleIcon($handle, pht('You hold all the cards.'))
130169
->addHandleIcon($handle, pht('You make all the rules.')));
131170

171+
$list->addItem(
172+
id(new PhabricatorObjectItemView())
173+
->setHeader(pht('Just A Handle'))
174+
->setHref('#')
175+
->addHandleIcon($handle, pht('Handle Here')));
176+
177+
$list->addItem(
178+
id(new PhabricatorObjectItemView())
179+
->setHeader(pht('Poor Use of Space'))
180+
->setHref('#')
181+
->addAttribute('North West')
182+
->addHandleIcon($handle, pht('South East')));
183+
184+
$list->addItem(
185+
id(new PhabricatorObjectItemView())
186+
->setHeader(pht('Crowded Eastern Edge'))
187+
->setHref('#')
188+
->addIcon('computer', pht('Stuff'))
189+
->addIcon('computer', pht('Stuff'))
190+
->addIcon('computer', pht('Stuff'))
191+
->addHandleIcon($handle, pht('More Stuff')));
192+
132193
$out[] = array($head, $list);
133194

134195

0 commit comments

Comments
 (0)
Failed to load comments.