Separate button CSS classes

Summary: Try to dis-ambiguate various button types and colors. Moves `simple` to `phui-button-simple` and moves colors to `button-color`.

Test Plan: Grep for buttons still inline, UIExamples, PHUIX, Herald, and Email Preferences.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18077
This commit is contained in:
Chad Little
2017-06-05 20:14:34 +00:00
committed by chad
parent 9773dc0e6c
commit d3c464a610
43 changed files with 146 additions and 200 deletions

View File

@@ -9,7 +9,7 @@ return array(
'names' => array( 'names' => array(
'conpherence.pkg.css' => 'ff161f2d', 'conpherence.pkg.css' => 'ff161f2d',
'conpherence.pkg.js' => 'b5b51108', 'conpherence.pkg.js' => 'b5b51108',
'core.pkg.css' => '5284a0e0', 'core.pkg.css' => '1a935531',
'core.pkg.js' => '1475bd91', 'core.pkg.js' => '1475bd91',
'darkconsole.pkg.js' => '1f9a31bc', 'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '1ccbf3a9', 'differential.pkg.css' => '1ccbf3a9',
@@ -125,8 +125,8 @@ return array(
'rsrc/css/layout/phabricator-filetree-view.css' => 'fccf9f82', 'rsrc/css/layout/phabricator-filetree-view.css' => 'fccf9f82',
'rsrc/css/layout/phabricator-source-code-view.css' => '4383192f', 'rsrc/css/layout/phabricator-source-code-view.css' => '4383192f',
'rsrc/css/phui/button/phui-button-bar.css' => '39fe680c', 'rsrc/css/phui/button/phui-button-bar.css' => '39fe680c',
'rsrc/css/phui/button/phui-button-simple.css' => '081cfeea', 'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68',
'rsrc/css/phui/button/phui-button.css' => '9f13ddcc', 'rsrc/css/phui/button/phui-button.css' => '022581b4',
'rsrc/css/phui/calendar/phui-calendar-day.css' => '572b1893', 'rsrc/css/phui/calendar/phui-calendar-day.css' => '572b1893',
'rsrc/css/phui/calendar/phui-calendar-list.css' => '576be600', 'rsrc/css/phui/calendar/phui-calendar-list.css' => '576be600',
'rsrc/css/phui/calendar/phui-calendar-month.css' => '8e10e92c', 'rsrc/css/phui/calendar/phui-calendar-month.css' => '8e10e92c',
@@ -526,7 +526,7 @@ return array(
'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8',
'rsrc/js/phuix/PHUIXActionView.js' => 'b3465b9b', 'rsrc/js/phuix/PHUIXActionView.js' => 'b3465b9b',
'rsrc/js/phuix/PHUIXAutocomplete.js' => 'f6699267', 'rsrc/js/phuix/PHUIXAutocomplete.js' => 'f6699267',
'rsrc/js/phuix/PHUIXButtonView.js' => 'b3c515be', 'rsrc/js/phuix/PHUIXButtonView.js' => 'a37126bd',
'rsrc/js/phuix/PHUIXDropdownMenu.js' => '8018ee50', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => '8018ee50',
'rsrc/js/phuix/PHUIXExample.js' => '68af71ca', 'rsrc/js/phuix/PHUIXExample.js' => '68af71ca',
'rsrc/js/phuix/PHUIXFormControl.js' => '83e03671', 'rsrc/js/phuix/PHUIXFormControl.js' => '83e03671',
@@ -820,8 +820,8 @@ return array(
'phui-big-info-view-css' => 'bd903741', 'phui-big-info-view-css' => 'bd903741',
'phui-box-css' => '269cbc99', 'phui-box-css' => '269cbc99',
'phui-button-bar-css' => '39fe680c', 'phui-button-bar-css' => '39fe680c',
'phui-button-css' => '9f13ddcc', 'phui-button-css' => '022581b4',
'phui-button-simple-css' => '081cfeea', 'phui-button-simple-css' => '8e1baf68',
'phui-calendar-css' => '477acfaa', 'phui-calendar-css' => '477acfaa',
'phui-calendar-day-css' => '572b1893', 'phui-calendar-day-css' => '572b1893',
'phui-calendar-list-css' => '576be600', 'phui-calendar-list-css' => '576be600',
@@ -878,7 +878,7 @@ return array(
'phuix-action-list-view' => 'b5c256b8', 'phuix-action-list-view' => 'b5c256b8',
'phuix-action-view' => 'b3465b9b', 'phuix-action-view' => 'b3465b9b',
'phuix-autocomplete' => 'f6699267', 'phuix-autocomplete' => 'f6699267',
'phuix-button-view' => 'b3c515be', 'phuix-button-view' => 'a37126bd',
'phuix-dropdown-menu' => '8018ee50', 'phuix-dropdown-menu' => '8018ee50',
'phuix-form-control-view' => '83e03671', 'phuix-form-control-view' => '83e03671',
'phuix-icon-view' => 'bff6884b', 'phuix-icon-view' => 'bff6884b',
@@ -936,9 +936,6 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-workflow', 'javelin-workflow',
), ),
'081cfeea' => array(
'phui-button-css',
),
'0825c27a' => array( '0825c27a' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@@ -1561,6 +1558,9 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-install', 'javelin-install',
), ),
'8e1baf68' => array(
'phui-button-css',
),
'8ff5e24c' => array( '8ff5e24c' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-stratcom', 'javelin-stratcom',
@@ -1651,6 +1651,10 @@ return array(
'javelin-util', 'javelin-util',
'phabricator-keyboard-shortcut', 'phabricator-keyboard-shortcut',
), ),
'a37126bd' => array(
'javelin-install',
'javelin-dom',
),
'a3a63478' => array( 'a3a63478' => array(
'phui-workcard-view-css', 'phui-workcard-view-css',
), ),
@@ -1768,10 +1772,6 @@ return array(
'javelin-behavior', 'javelin-behavior',
'phabricator-prefab', 'phabricator-prefab',
), ),
'b3c515be' => array(
'javelin-install',
'javelin-dom',
),
'b3e7d692' => array( 'b3e7d692' => array(
'javelin-install', 'javelin-install',
), ),

View File

@@ -84,8 +84,8 @@ abstract class AlmanacController
'a', 'a',
array( array(
'class' => ($can_edit 'class' => ($can_edit
? 'button grey small' ? 'button button-grey small'
: 'button grey small disabled'), : 'button button-grey small disabled'),
'sigil' => 'workflow', 'sigil' => 'workflow',
'href' => $delete_uri, 'href' => $delete_uri,
), ),

View File

@@ -77,7 +77,7 @@ final class AlmanacBindingTableView extends AphrontView {
phutil_tag( phutil_tag(
'a', 'a',
array( array(
'class' => 'small grey button', 'class' => 'small button button-grey',
'href' => '/almanac/binding/'.$binding->getID().'/', 'href' => '/almanac/binding/'.$binding->getID().'/',
), ),
pht('Details')), pht('Details')),

View File

@@ -30,9 +30,9 @@ final class AlmanacInterfaceTableView extends AphrontView {
$can_edit = $this->getCanEdit(); $can_edit = $this->getCanEdit();
if ($can_edit) { if ($can_edit) {
$button_class = 'small grey button'; $button_class = 'small button button-grey';
} else { } else {
$button_class = 'small grey button disabled'; $button_class = 'small button button-grey disabled';
} }
$handles = $viewer->loadHandles(mpull($interfaces, 'getNetworkPHID')); $handles = $viewer->loadHandles(mpull($interfaces, 'getNetworkPHID'));

View File

@@ -60,7 +60,7 @@ final class PhabricatorConduitTokensSettingsPanel
javelin_tag( javelin_tag(
'a', 'a',
array( array(
'class' => 'button small grey', 'class' => 'button small button-grey',
'href' => '/conduit/token/terminate/'.$token->getID().'/', 'href' => '/conduit/token/terminate/'.$token->getID().'/',
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),

View File

@@ -129,7 +129,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
array( array(
'href' => '/config/unignore/'.$issue->getIssueKey().'/', 'href' => '/config/unignore/'.$issue->getIssueKey().'/',
'sigil' => 'workflow', 'sigil' => 'workflow',
'class' => 'button grey', 'class' => 'button button-grey',
), ),
pht('Unignore Setup Issue')); pht('Unignore Setup Issue'));
} else { } else {
@@ -138,7 +138,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
array( array(
'href' => '/config/ignore/'.$issue->getIssueKey().'/', 'href' => '/config/ignore/'.$issue->getIssueKey().'/',
'sigil' => 'workflow', 'sigil' => 'workflow',
'class' => 'button grey', 'class' => 'button button-grey',
), ),
pht('Ignore Setup Issue')); pht('Ignore Setup Issue'));
} }
@@ -147,7 +147,7 @@ final class PhabricatorSetupIssueView extends AphrontView {
'a', 'a',
array( array(
'href' => '/config/issue/'.$issue->getIssueKey().'/', 'href' => '/config/issue/'.$issue->getIssueKey().'/',
'class' => 'button grey', 'class' => 'button button-grey',
'style' => 'float: right', 'style' => 'float: right',
), ),
pht('Reload Page')); pht('Reload Page'));

View File

@@ -140,7 +140,7 @@ abstract class ConpherenceController extends PhabricatorController {
'button', 'button',
array( array(
'type' => 'SUBMIT', 'type' => 'SUBMIT',
'class' => 'button green mlr', 'class' => 'button button-green mlr',
), ),
pht('Join Room')); pht('Join Room'));

View File

@@ -404,7 +404,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
'a', 'a',
array( array(
'href' => '/conpherence/search/', 'href' => '/conpherence/search/',
'class' => 'button grey', 'class' => 'button button-grey',
), ),
pht('Find Rooms')), pht('Find Rooms')),
); );

View File

@@ -170,7 +170,8 @@ final class DarkConsoleServicesPlugin extends DarkConsolePlugin {
'a', 'a',
array( array(
'href' => $data['analyzeURI'], 'href' => $data['analyzeURI'],
'class' => $data['didAnalyze'] ? 'disabled button' : 'green button', 'class' => $data['didAnalyze'] ?
'disabled button' : 'button button-green',
), ),
pht('Analyze Query Plans')), pht('Analyze Query Plans')),
phutil_tag('h1', array(), pht('Calls to External Services')), phutil_tag('h1', array(), pht('Calls to External Services')),

View File

@@ -67,7 +67,7 @@ final class DarkConsoleXHProfPlugin extends DarkConsolePlugin {
'a', 'a',
array( array(
'href' => $profile_uri, 'href' => $profile_uri,
'class' => $run ? 'disabled button' : 'green button', 'class' => $run ? 'disabled button' : 'button button-green',
), ),
pht('Profile Page')), pht('Profile Page')),
phutil_tag('h1', array(), pht('XHProf Profiler')), phutil_tag('h1', array(), pht('XHProf Profiler')),

View File

@@ -41,7 +41,7 @@ final class PhabricatorDaemonTasksTableView extends AphrontView {
'a', 'a',
array( array(
'href' => '/daemon/task/'.$task->getID().'/', 'href' => '/daemon/task/'.$task->getID().'/',
'class' => 'button small grey', 'class' => 'button small button-grey',
), ),
pht('View Task')), pht('View Task')),
); );

View File

@@ -156,7 +156,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
phutil_tag( phutil_tag(
'a', 'a',
array( array(
'class' => 'button grey', 'class' => 'button button-grey',
'href' => $request_uri 'href' => $request_uri
->alter('large', 'true') ->alter('large', 'true')
->setFragment('toc'), ->setFragment('toc'),

View File

@@ -174,7 +174,7 @@ final class DifferentialChangesetListView extends AphrontView {
$load = javelin_tag( $load = javelin_tag(
'a', 'a',
array( array(
'class' => 'button grey', 'class' => 'button button-grey',
'href' => '#'.$uniq_id, 'href' => '#'.$uniq_id,
'sigil' => 'differential-load', 'sigil' => 'differential-load',
'meta' => array( 'meta' => array(

View File

@@ -68,7 +68,7 @@ final class PhabricatorFileTransformListController
$view_link = phutil_tag( $view_link = phutil_tag(
'a', 'a',
array( array(
'class' => 'small grey button', 'class' => 'small button button-grey',
'href' => $view_href, 'href' => $view_href,
), ),
$view_text); $view_text);

View File

@@ -191,7 +191,7 @@ final class HeraldRuleController extends HeraldController {
'a', 'a',
array( array(
'href' => '#', 'href' => '#',
'class' => 'button green', 'class' => 'button button-green',
'sigil' => 'create-condition', 'sigil' => 'create-condition',
'mustcapture' => true, 'mustcapture' => true,
), ),
@@ -212,7 +212,7 @@ final class HeraldRuleController extends HeraldController {
'a', 'a',
array( array(
'href' => '#', 'href' => '#',
'class' => 'button green', 'class' => 'button button-green',
'sigil' => 'create-action', 'sigil' => 'create-action',
'mustcapture' => true, 'mustcapture' => true,
), ),

View File

@@ -173,7 +173,7 @@ final class ManiphestBatchEditController extends ManiphestController {
'a', 'a',
array( array(
'href' => '#', 'href' => '#',
'class' => 'button green', 'class' => 'button button-green',
'sigil' => 'add-action', 'sigil' => 'add-action',
'mustcapture' => true, 'mustcapture' => true,
), ),

View File

@@ -196,7 +196,7 @@ final class ManiphestTaskResultListView extends ManiphestView {
array( array(
'href' => '#', 'href' => '#',
'mustcapture' => true, 'mustcapture' => true,
'class' => 'grey button', 'class' => 'button button-grey',
'id' => 'batch-select-all', 'id' => 'batch-select-all',
), ),
pht('Select All')); pht('Select All'));
@@ -206,7 +206,7 @@ final class ManiphestTaskResultListView extends ManiphestView {
array( array(
'href' => '#', 'href' => '#',
'mustcapture' => true, 'mustcapture' => true,
'class' => 'grey button', 'class' => 'button button-grey',
'id' => 'batch-select-none', 'id' => 'batch-select-none',
), ),
pht('Clear Selection')); pht('Clear Selection'));
@@ -224,7 +224,7 @@ final class ManiphestTaskResultListView extends ManiphestView {
'a', 'a',
array( array(
'href' => '/maniphest/export/'.$saved_query->getQueryKey().'/', 'href' => '/maniphest/export/'.$saved_query->getQueryKey().'/',
'class' => 'grey button', 'class' => 'button button-grey',
), ),
pht('Export to Excel')); pht('Export to Excel'));

View File

@@ -341,7 +341,7 @@ final class PhabricatorMetaMTAApplicationEmailPanel
$button_edit = javelin_tag( $button_edit = javelin_tag(
'a', 'a',
array( array(
'class' => 'button small grey', 'class' => 'button small button-grey',
'href' => $uri->alter('edit', $email->getID()), 'href' => $uri->alter('edit', $email->getID()),
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),
@@ -350,7 +350,7 @@ final class PhabricatorMetaMTAApplicationEmailPanel
$button_remove = javelin_tag( $button_remove = javelin_tag(
'a', 'a',
array( array(
'class' => 'button small grey', 'class' => 'button small button-grey',
'href' => $uri->alter('delete', $email->getID()), 'href' => $uri->alter('delete', $email->getID()),
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),

View File

@@ -87,7 +87,7 @@ final class PhabricatorOAuthServerAuthorizationsSettingsPanel
'a', 'a',
array( array(
'href' => $this->getPanelURI('?revoke='.$authorization->getID()), 'href' => $this->getPanelURI('?revoke='.$authorization->getID()),
'class' => 'small grey button', 'class' => 'small button button-grey',
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),
pht('Revoke')); pht('Revoke'));

View File

@@ -124,7 +124,7 @@ final class PhabricatorOwnersPathsController
'a', 'a',
array( array(
'href' => '#', 'href' => '#',
'class' => 'button green', 'class' => 'button button-green',
'sigil' => 'addpath', 'sigil' => 'addpath',
'mustcapture' => true, 'mustcapture' => true,
), ),

View File

@@ -113,7 +113,7 @@ final class PassphraseCredentialControl extends AphrontFormControl {
'a', 'a',
array( array(
'href' => '#', 'href' => '#',
'class' => 'button grey', 'class' => 'button button-grey',
'sigil' => 'passphrase-credential-add', 'sigil' => 'passphrase-credential-add',
'mustcapture' => true, 'mustcapture' => true,
), ),

View File

@@ -120,7 +120,7 @@ final class PholioUploadedImageView extends AphrontView {
return javelin_tag( return javelin_tag(
'a', 'a',
array( array(
'class' => 'button grey', 'class' => 'button button-grey',
'sigil' => 'pholio-drop-remove', 'sigil' => 'pholio-drop-remove',
), ),
'X'); 'X');

View File

@@ -152,7 +152,7 @@ final class PhortuneCartCheckoutController
$new_method = javelin_tag( $new_method = javelin_tag(
'a', 'a',
array( array(
'class' => 'button grey', 'class' => 'button button-grey',
'href' => $payment_method_uri, 'href' => $payment_method_uri,
), ),
pht('Add New Payment Method')); pht('Add New Payment Method'));

View File

@@ -123,7 +123,7 @@ final class PhortuneSubscriptionEditController extends PhortuneController {
'a', 'a',
array( array(
'href' => $uri, 'href' => $uri,
'class' => 'button grey', 'class' => 'button button-grey',
), ),
pht('Add Payment Method...')); pht('Add Payment Method...'));

View File

@@ -101,7 +101,7 @@ final class PhortuneOrderTableView extends AphrontView {
'a', 'a',
array( array(
'href' => $cart->getCheckoutURI(), 'href' => $cart->getCheckoutURI(),
'class' => 'small green button', 'class' => 'small button button-green',
), ),
pht('Pay Now')), pht('Pay Now')),
); );

View File

@@ -103,7 +103,7 @@ final class PhrictionDiffController extends PhrictionController {
'a', 'a',
array( array(
'href' => $uri->alter('l', $l - 1)->alter('r', $r - 1), 'href' => $uri->alter('l', $l - 1)->alter('r', $r - 1),
'class' => 'button grey', 'class' => 'button button-grey',
), ),
pht("\xC2\xAB Previous Change")); pht("\xC2\xAB Previous Change"));
} else { } else {
@@ -111,7 +111,7 @@ final class PhrictionDiffController extends PhrictionController {
'a', 'a',
array( array(
'href' => '#', 'href' => '#',
'class' => 'button grey disabled', 'class' => 'button button-grey disabled',
), ),
pht('Original Change')); pht('Original Change'));
} }
@@ -122,7 +122,7 @@ final class PhrictionDiffController extends PhrictionController {
'a', 'a',
array( array(
'href' => $uri->alter('l', $l + 1)->alter('r', $r + 1), 'href' => $uri->alter('l', $l + 1)->alter('r', $r + 1),
'class' => 'button grey', 'class' => 'button button-grey',
), ),
pht("Next Change \xC2\xBB")); pht("Next Change \xC2\xBB"));
} else { } else {
@@ -130,7 +130,7 @@ final class PhrictionDiffController extends PhrictionController {
'a', 'a',
array( array(
'href' => '#', 'href' => '#',
'class' => 'button grey disabled', 'class' => 'button button-grey disabled',
), ),
pht('Most Recent Change')); pht('Most Recent Change'));
} }
@@ -200,7 +200,7 @@ final class PhrictionDiffController extends PhrictionController {
'a', 'a',
array( array(
'href' => '/phriction/edit/'.$document_id.'/', 'href' => '/phriction/edit/'.$document_id.'/',
'class' => 'button grey', 'class' => 'button button-grey',
), ),
pht('Edit Current Version')); pht('Edit Current Version'));
} }
@@ -210,7 +210,7 @@ final class PhrictionDiffController extends PhrictionController {
'a', 'a',
array( array(
'href' => '/phriction/edit/'.$document_id.'/?revert='.$version, 'href' => '/phriction/edit/'.$document_id.'/?revert='.$version,
'class' => 'button grey', 'class' => 'button button-grey',
), ),
pht('Revert to Version %s...', $version)); pht('Revert to Version %s...', $version));
} }

View File

@@ -199,7 +199,7 @@ final class PhabricatorPolicyEditController
'a', 'a',
array( array(
'href' => '#', 'href' => '#',
'class' => 'button green', 'class' => 'button button-green',
'sigil' => 'create-rule', 'sigil' => 'create-rule',
'mustcapture' => true, 'mustcapture' => true,
), ),

View File

@@ -63,7 +63,7 @@ final class PhabricatorEmailAddressesSettingsPanel
$button_verify = javelin_tag( $button_verify = javelin_tag(
'a', 'a',
array( array(
'class' => 'button small grey', 'class' => 'button small button-grey',
'href' => $uri->alter('verify', $email->getID()), 'href' => $uri->alter('verify', $email->getID()),
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),
@@ -72,7 +72,7 @@ final class PhabricatorEmailAddressesSettingsPanel
$button_make_primary = javelin_tag( $button_make_primary = javelin_tag(
'a', 'a',
array( array(
'class' => 'button small grey', 'class' => 'button small button-grey',
'href' => $uri->alter('primary', $email->getID()), 'href' => $uri->alter('primary', $email->getID()),
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),
@@ -81,7 +81,7 @@ final class PhabricatorEmailAddressesSettingsPanel
$button_remove = javelin_tag( $button_remove = javelin_tag(
'a', 'a',
array( array(
'class' => 'button small grey', 'class' => 'button small button-grey',
'href' => $uri->alter('delete', $email->getID()), 'href' => $uri->alter('delete', $email->getID()),
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),

View File

@@ -69,7 +69,7 @@ final class PhabricatorMultiFactorSettingsPanel
array( array(
'href' => $this->getPanelURI('?delete='.$factor->getID()), 'href' => $this->getPanelURI('?delete='.$factor->getID()),
'sigil' => 'workflow', 'sigil' => 'workflow',
'class' => 'small grey button', 'class' => 'small button button-grey',
), ),
pht('Remove')), pht('Remove')),
); );

View File

@@ -58,7 +58,7 @@ final class PhabricatorSessionsSettingsPanel extends PhabricatorSettingsPanel {
$button = phutil_tag( $button = phutil_tag(
'a', 'a',
array( array(
'class' => 'small grey button disabled', 'class' => 'small button button-grey disabled',
), ),
pht('Current')); pht('Current'));
} else { } else {
@@ -67,7 +67,7 @@ final class PhabricatorSessionsSettingsPanel extends PhabricatorSettingsPanel {
'a', 'a',
array( array(
'href' => '/auth/session/terminate/'.$session->getID().'/', 'href' => '/auth/session/terminate/'.$session->getID().'/',
'class' => 'small grey button', 'class' => 'small button button-grey',
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),
pht('Terminate')); pht('Terminate'));

View File

@@ -30,7 +30,7 @@ final class PhabricatorTokensSettingsPanel extends PhabricatorSettingsPanel {
'a', 'a',
array( array(
'href' => '/auth/token/revoke/'.$token->getID().'/', 'href' => '/auth/token/revoke/'.$token->getID().'/',
'class' => 'small grey button', 'class' => 'small button button-grey',
'sigil' => 'workflow', 'sigil' => 'workflow',
), ),
pht('Revoke')); pht('Revoke'));
@@ -38,7 +38,7 @@ final class PhabricatorTokensSettingsPanel extends PhabricatorSettingsPanel {
$button = javelin_tag( $button = javelin_tag(
'a', 'a',
array( array(
'class' => 'small grey button disabled', 'class' => 'small button button-grey disabled',
), ),
pht('Revoke')); pht('Revoke'));
} }

View File

@@ -16,63 +16,11 @@ final class PHUIButtonExample extends PhabricatorUIExample {
$request = $this->getRequest(); $request = $this->getRequest();
$user = $request->getUser(); $user = $request->getUser();
$colors = array('', 'green', 'grey', 'disabled');
$sizes = array('', 'small');
$tags = array('a', 'button');
// phutil_tag
$column = array();
foreach ($tags as $tag) {
foreach ($colors as $color) {
foreach ($sizes as $key => $size) {
$class = implode(' ', array($color, $size));
if ($tag == 'a') {
$class .= ' button';
}
$column[$key][] = phutil_tag(
$tag,
array(
'class' => $class,
),
phutil_utf8_ucwords($size.' '.$color.' '.$tag));
$column[$key][] = hsprintf('<br /><br />');
}
}
}
$column3 = array();
foreach ($colors as $color) {
$caret = phutil_tag('span', array('class' => 'caret'), '');
$column3[] = phutil_tag(
'a',
array(
'class' => $color.' button dropdown',
),
array(
phutil_utf8_ucwords($color.' Dropdown'),
$caret,
));
$column3[] = hsprintf('<br /><br />');
}
$layout1 = id(new AphrontMultiColumnView())
->addColumn($column[0])
->addColumn($column[1])
->addColumn($column3)
->setFluidLayout(true)
->setGutter(AphrontMultiColumnView::GUTTER_MEDIUM);
// PHUIButtonView // PHUIButtonView
$colors = array( $colors = array(
null, null,
PHUIButtonView::GREEN, PHUIButtonView::GREEN,
PHUIButtonView::GREY, PHUIButtonView::GREY,
PHUIButtonView::DISABLED,
); );
$sizes = array(null, PHUIButtonView::SMALL); $sizes = array(null, PHUIButtonView::SMALL);
$column = array(); $column = array();
@@ -223,24 +171,21 @@ final class PHUIButtonExample extends PhabricatorUIExample {
// Set it and forget it // Set it and forget it
$head1 = id(new PHUIHeaderView())
->setHeader('phutil_tag');
$head2 = id(new PHUIHeaderView()) $head2 = id(new PHUIHeaderView())
->setHeader('PHUIButtonView'); ->setHeader('PHUIButtonView')
->addClass('ml');
$head3 = id(new PHUIHeaderView()) $head3 = id(new PHUIHeaderView())
->setHeader(pht('Icon Buttons')); ->setHeader(pht('Icon Buttons'))
->addClass('ml');
$head4 = id(new PHUIHeaderView()) $head4 = id(new PHUIHeaderView())
->setHeader(pht('Simple Buttons')); ->setHeader(pht('Simple Buttons'))
->addClass('ml');
$head5 = id(new PHUIHeaderView()) $head5 = id(new PHUIHeaderView())
->setHeader(pht('Big Icon Buttons')); ->setHeader(pht('Big Icon Buttons'))
->addClass('ml');
$wrap1 = id(new PHUIBoxView())
->appendChild($layout1)
->addMargin(PHUI::MARGIN_LARGE);
$wrap2 = id(new PHUIBoxView()) $wrap2 = id(new PHUIBoxView())
->appendChild($layout2) ->appendChild($layout2)
@@ -259,8 +204,6 @@ final class PHUIButtonExample extends PhabricatorUIExample {
->addMargin(PHUI::MARGIN_LARGE); ->addMargin(PHUI::MARGIN_LARGE);
return array( return array(
$head1,
$wrap1,
$head2, $head2,
$wrap2, $wrap2,
$head3, $head3,

View File

@@ -101,7 +101,7 @@ final class PHUIColorPalletteExample extends PhabricatorUIExample {
'a', 'a',
array( array(
'href' => 'http://color.hailpixel.com/#'.implode(',', $url), 'href' => 'http://color.hailpixel.com/#'.implode(',', $url),
'class' => 'button grey mlb', 'class' => 'button button-grey mlb',
), ),
pht('Color Palette')); pht('Color Palette'));

View File

@@ -24,7 +24,7 @@ final class PhabricatorNotificationUIExample extends PhabricatorUIExample {
'a', 'a',
array( array(
'sigil' => 'notification-example', 'sigil' => 'notification-example',
'class' => 'button green', 'class' => 'button button-green',
), ),
pht('Show Notification')); pht('Show Notification'));

View File

@@ -248,7 +248,7 @@ final class AphrontDialogView
'a', 'a',
array( array(
'href' => $this->cancelURI, 'href' => $this->cancelURI,
'class' => 'button grey', 'class' => 'button button-grey',
'name' => '__cancel__', 'name' => '__cancel__',
'sigil' => 'jx-workflow-button', 'sigil' => 'jx-workflow-button',
'meta' => $meta, 'meta' => $meta,

View File

@@ -324,7 +324,8 @@ final class AphrontFormPolicyControl extends AphrontFormControl {
javelin_tag( javelin_tag(
'a', 'a',
array( array(
'class' => 'grey button dropdown has-icon has-text policy-control', 'class' => 'button button-grey dropdown has-icon has-text '.
'policy-control',
'href' => '#', 'href' => '#',
'mustcapture' => true, 'mustcapture' => true,
'sigil' => 'policy-control', 'sigil' => 'policy-control',

View File

@@ -30,7 +30,7 @@ final class PHUIFormIconSetControl
$classes = array(); $classes = array();
$classes[] = 'button'; $classes[] = 'button';
$classes[] = 'grey'; $classes[] = 'button-grey';
if ($is_disabled) { if ($is_disabled) {
$classes[] = 'disabled'; $classes[] = 'disabled';

View File

@@ -44,7 +44,7 @@ final class AphrontListFilterView extends AphrontView {
$hide_action = javelin_tag( $hide_action = javelin_tag(
'a', 'a',
array( array(
'class' => 'button grey', 'class' => 'button button-grey',
'sigil' => 'reveal-content', 'sigil' => 'reveal-content',
'id' => $hide_action_id, 'id' => $hide_action_id,
'href' => $this->showHideHref, 'href' => $this->showHideHref,
@@ -65,7 +65,7 @@ final class AphrontListFilterView extends AphrontView {
$show_action = javelin_tag( $show_action = javelin_tag(
'a', 'a',
array( array(
'class' => 'button grey', 'class' => 'button button-grey',
'sigil' => 'reveal-content', 'sigil' => 'reveal-content',
'style' => 'display: none;', 'style' => 'display: none;',
'href' => '#', 'href' => '#',

View File

@@ -4,6 +4,7 @@ final class PHUIButtonView extends AphrontTagView {
const GREEN = 'green'; const GREEN = 'green';
const GREY = 'grey'; const GREY = 'grey';
const BLUE = 'blue';
const DISABLED = 'disabled'; const DISABLED = 'disabled';
const SMALL = 'small'; const SMALL = 'small';
@@ -159,7 +160,7 @@ final class PHUIButtonView extends AphrontTagView {
$classes[] = 'button'; $classes[] = 'button';
if ($this->color) { if ($this->color) {
$classes[] = $this->color; $classes[] = 'button-'.$this->color;
} }
if ($this->size) { if ($this->size) {
@@ -188,10 +189,10 @@ final class PHUIButtonView extends AphrontTagView {
switch ($this->getButtonType()) { switch ($this->getButtonType()) {
case self::BUTTONTYPE_DEFAULT: case self::BUTTONTYPE_DEFAULT:
// Nothing special for default buttons. $classes[] = 'phui-button-default';
break; break;
case self::BUTTONTYPE_SIMPLE: case self::BUTTONTYPE_SIMPLE:
$classes[] = 'simple'; $classes[] = 'phui-button-simple';
break; break;
} }

View File

@@ -173,7 +173,7 @@ final class PHUIHovercardView extends AphrontTagView {
foreach ($this->actions as $action) { foreach ($this->actions as $action) {
$options = array( $options = array(
'class' => 'button grey', 'class' => 'button button-grey',
'href' => $action['uri'], 'href' => $action['uri'],
); );

View File

@@ -6,55 +6,55 @@
/* - Basic -------------------------------------------------------------------*/ /* - Basic -------------------------------------------------------------------*/
button.simple, button.phui-button-simple,
input[type="submit"].simple, input[type="submit"].phui-button-simple,
a.simple, a.phui-button-simple,
a.simple:visited { a.phui-button-simple:visited {
background: #fff; background: #fff;
color: {$bluetext}; color: {$bluetext};
border: 1px solid {$lightblueborder}; border: 1px solid {$lightblueborder};
} }
button.simple .phui-icon-view, button.phui-button-simple .phui-icon-view,
input[type="submit"].simple .phui-icon-view, input[type="submit"].phui-button-simple .phui-icon-view,
a.simple .phui-icon-view, a.phui-button-simple .phui-icon-view,
a.simple:visited .phui-icon-view { a.phui-button-simple:visited .phui-icon-view {
color: {$lightbluetext}; color: {$lightbluetext};
} }
a.button.simple:hover, a.button.phui-button-simple:hover,
button.simple:hover { button.phui-button-simple:hover {
border-color: {$blueborder}; border-color: {$blueborder};
background-image: none; background-image: none;
background-color: #fff; background-color: #fff;
transition: 0s; transition: 0s;
} }
a.simple.current { a.phui-button-simple.current {
background: {$lightblue}; background: {$lightblue};
} }
/* - Red --------------------------------------------------------------------*/ /* - Red --------------------------------------------------------------------*/
button.simple.red, button.phui-button-simple.button-red,
input[type="submit"].simple.red, input[type="submit"].phui-button-simple.button-red,
a.simple.red, a.phui-button-simple.button-red,
a.simple.red:visited { a.phui-button-simple.button-red:visited {
background: {$sh-redbackground}; background: {$sh-redbackground};
color: {$redtext}; color: {$redtext};
border: 1px solid {$sh-redborder}; border: 1px solid {$sh-redborder};
} }
button.simple.red .phui-icon-view, button.phui-button-simple.button-red .phui-icon-view,
input[type="submit"].simple.red .phui-icon-view, input[type="submit"].phui-button-simple.button-red .phui-icon-view,
a.simple.red .phui-icon-view, a.phui-button-simple.button-red .phui-icon-view,
a.simple.red:visited .phui-icon-view { a.phui-button-simple.button-red:visited .phui-icon-view {
color: {$redtext}; color: {$redtext};
} }
a.button.simple.red:hover, a.button.phui-button-simple.button-red:hover,
button.simple.red:hover { button.phui-button-simple.button-red:hover {
border-color: {$sh-redtext}; border-color: {$sh-redtext};
background-image: none; background-image: none;
background-color: {$sh-redbackground}; background-color: {$sh-redbackground};
@@ -63,24 +63,24 @@ button.simple.red:hover {
/* - Green ------------------------------------------------------------------*/ /* - Green ------------------------------------------------------------------*/
button.simple.green, button.phui-button-simple.button-green,
input[type="submit"].simple.green, input[type="submit"].phui-button-simple.button-green,
a.simple.green, a.phui-button-simple.button-green,
a.simple.green:visited { a.phui-button-simple.button-green:visited {
background: {$sh-greenbackground}; background: {$sh-greenbackground};
color: {$greentext}; color: {$greentext};
border: 1px solid {$sh-greenborder}; border: 1px solid {$sh-greenborder};
} }
button.simple.green .phui-icon-view, button.phui-button-simple.button-green .phui-icon-view,
input[type="submit"].simple.green .phui-icon-view, input[type="submit"].phui-button-simple.button-green .phui-icon-view,
a.simple.green .phui-icon-view, a.phui-button-simple.button-green .phui-icon-view,
a.simple.green:visited .phui-icon-view { a.phui-button-simple.button-green:visited .phui-icon-view {
color: {$greentext}; color: {$greentext};
} }
a.button.simple.green:hover, a.button.phui-button-simple.button-green:hover,
button.simple.green:hover { button.phui-button-simple.button-green:hover {
border-color: {$sh-greentext}; border-color: {$sh-greentext};
background-image: none; background-image: none;
background-color: {$sh-greenbackground}; background-color: {$sh-greenbackground};
@@ -89,24 +89,24 @@ button.simple.green:hover {
/* - Yellow -----------------------------------------------------------------*/ /* - Yellow -----------------------------------------------------------------*/
button.simple.yellow, button.phui-button-simple.button-yellow,
input[type="submit"].simple.yellow, input[type="submit"].phui-button-simple.button-yellow,
a.simple.yellow, a.phui-button-simple.button-yellow,
a.simple.yellow:visited { a.phui-button-simple.button-yellow:visited {
background-color: {$sh-yellowbackground}; background-color: {$sh-yellowbackground};
color: {$sh-yellowtext}; color: {$sh-yellowtext};
border: 1px solid {$sh-yellowborder}; border: 1px solid {$sh-yellowborder};
} }
button.simple.yellow .phui-icon-view, button.phui-button-simple.button-yellow .phui-icon-view,
input[type="submit"].simple.yellow .phui-icon-view, input[type="submit"].phui-button-simple.button-yellow .phui-icon-view,
a.simple.yellow .phui-icon-view, a.phui-button-simple.button-yellow .phui-icon-view,
a.simple.yellow:visited .phui-icon-view { a.phui-button-simple.button-yellow:visited .phui-icon-view {
color: {$sh-yellowicon}; color: {$sh-yellowicon};
} }
a.button.simple.yellow:hover, a.button.phui-button-simple.button-yellow:hover,
button.simple.yellow:hover { button.phui-button-simple.button-yellow:hover {
border-color: {$sh-yellowtext}; border-color: {$sh-yellowtext};
background-image: none; background-image: none;
background-color: {$sh-yellowbackground}; background-color: {$sh-yellowbackground};
@@ -116,16 +116,16 @@ button.simple.yellow:hover {
/* - Misc -------------------------------------------------------------------*/ /* - Misc -------------------------------------------------------------------*/
a.button.simple .phui-icon-view { a.button.phui-button-simple .phui-icon-view {
border: none; border: none;
} }
a.button.simple.phuix-dropdown-open { a.button.phui-button-simple.phuix-dropdown-open {
background-color: #fff; background-color: #fff;
color: {$blue}; color: {$blue};
box-shadow: none; box-shadow: none;
} }
a.button.simple.phuix-dropdown-open:hover .phui-icon-view { a.button.phui-button-simple.phuix-dropdown-open:hover .phui-icon-view {
color: {$blue}; color: {$blue};
} }

View File

@@ -49,13 +49,13 @@ input[type="submit"] {
button .phui-icon-view, button .phui-icon-view,
a.button .phui-icon-view, a.button .phui-icon-view,
button.green .phui-icon-view, button.button-green .phui-icon-view,
a.button.green .phui-icon-view { a.button.button-green .phui-icon-view {
color: white; color: white;
} }
button.grey .phui-icon-view, button.button-grey .phui-icon-view,
a.button.grey .phui-icon-view { a.button.button-grey .phui-icon-view {
color: {$darkbluetext}; color: {$darkbluetext};
} }
@@ -68,18 +68,18 @@ a.icon:visited {
text-indent: 29px; text-indent: 29px;
} }
button.green, button.button-green,
a.green.button, a.button-green.button,
a.green.button:visited { a.button-green.button:visited {
background-color: {$green}; background-color: {$green};
border-color: {$green}; border-color: {$green};
background-image: linear-gradient(to bottom, #23BB5B, #139543); background-image: linear-gradient(to bottom, #23BB5B, #139543);
} }
button.grey, button.button-grey,
input[type="submit"].grey, input[type="submit"].button-grey,
a.grey, a.button-grey,
a.grey:visited { a.button-grey:visited {
background-color: #F7F7F9; background-color: #F7F7F9;
background-image: linear-gradient(to bottom, #ffffff, #f1f0f1); background-image: linear-gradient(to bottom, #ffffff, #f1f0f1);
border: 1px solid rgba({$alphablue}, 0.3); border: 1px solid rgba({$alphablue}, 0.3);
@@ -108,15 +108,15 @@ button:hover {
transition: 0.1s; transition: 0.1s;
} }
a.button.grey:hover, a.button.button-grey:hover,
button.grey:hover { button.button-grey:hover {
background-image: linear-gradient(to bottom, #ffffff, #eeebec); background-image: linear-gradient(to bottom, #ffffff, #eeebec);
border-color: rgba({$alphablue}, 0.4); border-color: rgba({$alphablue}, 0.4);
transition: 0.1s; transition: 0.1s;
} }
a.button.green:hover, a.button.button-green:hover,
button.green:hover { button.button-green:hover {
border-color: #127336; border-color: #127336;
background-color: #0DAD48; background-color: #0DAD48;
background-image: linear-gradient(to bottom, #23BB5B, #178841); background-image: linear-gradient(to bottom, #23BB5B, #178841);
@@ -244,7 +244,7 @@ a.policy-control .phui-button-text {
margin-top: 6px; margin-top: 6px;
} }
.grey.dropdown .caret { .button-grey.dropdown .caret {
border-top-color: #000; border-top-color: #000;
} }

View File

@@ -35,10 +35,10 @@ JX.install('PHUIXButtonView', {
var node = this.getNode(); var node = this.getNode();
if (this._color) { if (this._color) {
JX.DOM.alterClass(node, this._color, false); JX.DOM.alterClass(node, 'button-' + this._color, false);
} }
this._color = color; this._color = color;
JX.DOM.alterClass(node, this._color, true); JX.DOM.alterClass(node, 'button-' + this._color, true);
return this; return this;
}, },
@@ -50,7 +50,7 @@ JX.install('PHUIXButtonView', {
var node = this.getNode(); var node = this.getNode();
var is_simple = (this._buttonType == self.BUTTONTYPE_SIMPLE); var is_simple = (this._buttonType == self.BUTTONTYPE_SIMPLE);
JX.DOM.alterClass(node, 'simple', is_simple); JX.DOM.alterClass(node, 'phui-button-simple', is_simple);
return this; return this;
}, },