Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15418864
D8966.id21268.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
28 KB
Referenced Files
None
Subscribers
None
D8966.id21268.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,8 +7,8 @@
return array(
'names' =>
array(
- 'core.pkg.css' => '159b5ecd',
- 'core.pkg.js' => '417722ff',
+ 'core.pkg.css' => '272ce2e8',
+ 'core.pkg.js' => '8dde1b02',
'darkconsole.pkg.js' => 'ca8671ce',
'differential.pkg.css' => '8a064eb7',
'differential.pkg.js' => '11a5b750',
@@ -105,7 +105,7 @@
'rsrc/css/application/subscriptions/subscribers-list.css' => '5bb30c78',
'rsrc/css/application/tokens/tokens.css' => '5f7bca25',
'rsrc/css/application/uiexample/example.css' => '528b19de',
- 'rsrc/css/core/core.css' => '7dff07c3',
+ 'rsrc/css/core/core.css' => '436684a0',
'rsrc/css/core/remarkup.css' => '80c3a48c',
'rsrc/css/core/syntax.css' => '3c18c1cb',
'rsrc/css/core/z-index.css' => '7e4989ed',
@@ -126,7 +126,7 @@
'rsrc/css/phui/calendar/phui-calendar-month.css' => 'a92e47d2',
'rsrc/css/phui/calendar/phui-calendar.css' => '5e1ad989',
'rsrc/css/phui/phui-box.css' => '7b3a2eed',
- 'rsrc/css/phui/phui-button.css' => '653ac588',
+ 'rsrc/css/phui/phui-button.css' => '837760bd',
'rsrc/css/phui/phui-document.css' => '3b078dc0',
'rsrc/css/phui/phui-feed-story.css' => '3a59c2cf',
'rsrc/css/phui/phui-fontkit.css' => 'de84aa4a',
@@ -145,7 +145,7 @@
'rsrc/css/phui/phui-status.css' => '2f562399',
'rsrc/css/phui/phui-tag-view.css' => '295d81c4',
'rsrc/css/phui/phui-text.css' => '23e9b4b7',
- 'rsrc/css/phui/phui-timeline-view.css' => '27b280ca',
+ 'rsrc/css/phui/phui-timeline-view.css' => '1c4cc828',
'rsrc/css/phui/phui-workboard-view.css' => '84f2c272',
'rsrc/css/phui/phui-workpanel-view.css' => '97b69459',
'rsrc/css/sprite-actions.css' => '969ad0e5',
@@ -414,7 +414,7 @@
'rsrc/js/application/search/behavior-reorder-queries.js' => '37871df4',
'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => 'a51fdb2e',
'rsrc/js/application/transactions/behavior-transaction-comment-form.js' => '9084a36f',
- 'rsrc/js/application/transactions/behavior-transaction-list.js' => 'b8e6b76f',
+ 'rsrc/js/application/transactions/behavior-transaction-list.js' => '08798e61',
'rsrc/js/application/uiexample/JavelinViewExample.js' => 'd4a14807',
'rsrc/js/application/uiexample/ReactorButtonExample.js' => '44524435',
'rsrc/js/application/uiexample/ReactorCheckboxExample.js' => '7ba325ee',
@@ -431,8 +431,8 @@
'rsrc/js/core/Busy.js' => '6453c869',
'rsrc/js/core/DragAndDropFileUpload.js' => 'ae6abfba',
'rsrc/js/core/DraggableList.js' => '1681c4d4',
- 'rsrc/js/core/DropdownMenu.js' => 'fb342e18',
- 'rsrc/js/core/DropdownMenuItem.js' => '0f386ef4',
+ 'rsrc/js/core/DropdownMenu.js' => '6f3bb418',
+ 'rsrc/js/core/DropdownMenuItem.js' => '03863f11',
'rsrc/js/core/FileUpload.js' => 'a4ae61bf',
'rsrc/js/core/Hovercard.js' => '4f344388',
'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2',
@@ -481,6 +481,7 @@
'rsrc/js/core/behavior-workflow.js' => 'fee00761',
'rsrc/js/core/phtize.js' => 'd254d646',
'rsrc/js/phui/behavior-phui-object-box-tabs.js' => 'a3e2244e',
+ 'rsrc/js/phui/behavior-phui-timeline-dropdown-menu.js' => 'da931794',
'rsrc/swf/aphlict.swf' => 'abac967d',
),
'symbols' =>
@@ -609,12 +610,13 @@
'javelin-behavior-phabricator-show-all-transactions' => '7c273581',
'javelin-behavior-phabricator-tooltips' => '48db4145',
'javelin-behavior-phabricator-transaction-comment-form' => '9084a36f',
- 'javelin-behavior-phabricator-transaction-list' => 'b8e6b76f',
+ 'javelin-behavior-phabricator-transaction-list' => '08798e61',
'javelin-behavior-phabricator-watch-anchor' => '06e05112',
'javelin-behavior-phame-post-preview' => '61d927ec',
'javelin-behavior-pholio-mock-edit' => '1e1e8bb0',
'javelin-behavior-pholio-mock-view' => '28497740',
'javelin-behavior-phui-object-box-tabs' => 'a3e2244e',
+ 'javelin-behavior-phui-timeline-dropdown-menu' => 'da931794',
'javelin-behavior-policy-control' => 'c01153ea',
'javelin-behavior-policy-rule-editor' => '263aeb8c',
'javelin-behavior-ponder-votebox' => '327dbe61',
@@ -686,12 +688,12 @@
'phabricator-busy' => '6453c869',
'phabricator-chatlog-css' => '852140ff',
'phabricator-content-source-view-css' => '4b8b05d4',
- 'phabricator-core-css' => '7dff07c3',
+ 'phabricator-core-css' => '436684a0',
'phabricator-countdown-css' => '86b7b0a0',
'phabricator-crumbs-view-css' => '0222cbe0',
'phabricator-drag-and-drop-file-upload' => 'ae6abfba',
'phabricator-draggable-list' => '1681c4d4',
- 'phabricator-dropdown-menu' => 'fb342e18',
+ 'phabricator-dropdown-menu' => '6f3bb418',
'phabricator-fatal-config-template-css' => '25d446d6',
'phabricator-feed-css' => '0d17c209',
'phabricator-file-upload' => 'a4ae61bf',
@@ -703,7 +705,7 @@
'phabricator-keyboard-shortcut' => '1ae869f2',
'phabricator-keyboard-shortcut-manager' => 'ad7a69ca',
'phabricator-main-menu-view' => '0a599177',
- 'phabricator-menu-item' => '0f386ef4',
+ 'phabricator-menu-item' => '03863f11',
'phabricator-nav-view-css' => '80e60fc1',
'phabricator-notification' => '0c6946e7',
'phabricator-notification-css' => 'ef2c9b34',
@@ -745,7 +747,7 @@
'phrequent-css' => 'ffc185ad',
'phriction-document-css' => '7d7f0071',
'phui-box-css' => '7b3a2eed',
- 'phui-button-css' => '653ac588',
+ 'phui-button-css' => '837760bd',
'phui-calendar-css' => '5e1ad989',
'phui-calendar-day-css' => 'de035c8a',
'phui-calendar-list-css' => 'c1d0ca59',
@@ -769,7 +771,7 @@
'phui-status-list-view-css' => '2f562399',
'phui-tag-view-css' => '295d81c4',
'phui-text-css' => '23e9b4b7',
- 'phui-timeline-view-css' => '27b280ca',
+ 'phui-timeline-view-css' => '1c4cc828',
'phui-workboard-view-css' => '84f2c272',
'phui-workpanel-view-css' => '97b69459',
'policy-css' => '957ea14c',
@@ -836,6 +838,12 @@
8 => 'javelin-stratcom',
9 => 'javelin-util',
),
+ '03863f11' =>
+ array(
+ 0 => 'javelin-install',
+ 1 => 'javelin-dom',
+ 2 => 'javelin-stratcom',
+ ),
'039fb90d' =>
array(
0 => 'javelin-install',
@@ -856,6 +864,16 @@
2 => 'javelin-stratcom',
3 => 'javelin-workflow',
),
+ '08798e61' =>
+ array(
+ 0 => 'javelin-behavior',
+ 1 => 'javelin-stratcom',
+ 2 => 'javelin-workflow',
+ 3 => 'javelin-dom',
+ 4 => 'javelin-fx',
+ 5 => 'javelin-uri',
+ 6 => 'phabricator-textareautils',
+ ),
'06e05112' =>
array(
0 => 'javelin-behavior',
@@ -887,11 +905,6 @@
1 => 'javelin-stratcom',
2 => 'javelin-dom',
),
- '0f386ef4' =>
- array(
- 0 => 'javelin-install',
- 1 => 'javelin-dom',
- ),
'0f764c35' =>
array(
0 => 'javelin-install',
@@ -1208,6 +1221,13 @@
2 => 'javelin-util',
3 => 'phabricator-shaped-request',
),
+ '62e18640' =>
+ array(
+ 0 => 'javelin-install',
+ 1 => 'javelin-util',
+ 2 => 'javelin-dom',
+ 3 => 'javelin-typeahead-normalizer',
+ ),
'6453c869' =>
array(
0 => 'javelin-install',
@@ -1230,6 +1250,15 @@
0 => 'javelin-install',
1 => 'javelin-util',
),
+ '6f3bb418' =>
+ array(
+ 0 => 'javelin-install',
+ 1 => 'javelin-util',
+ 2 => 'javelin-dom',
+ 3 => 'javelin-vector',
+ 4 => 'javelin-stratcom',
+ 5 => 'phabricator-menu-item',
+ ),
'71755c79' =>
array(
0 => 'javelin-behavior',
@@ -1241,13 +1270,6 @@
0 => 'javelin-behavior',
1 => 'javelin-dom',
),
- '62e18640' =>
- array(
- 0 => 'javelin-install',
- 1 => 'javelin-util',
- 2 => 'javelin-dom',
- 3 => 'javelin-typeahead-normalizer',
- ),
'75903ee1' =>
array(
0 => 'javelin-behavior',
@@ -1573,16 +1595,6 @@
4 => 'javelin-install',
5 => 'javelin-util',
),
- 'b8e6b76f' =>
- array(
- 0 => 'javelin-behavior',
- 1 => 'javelin-stratcom',
- 2 => 'javelin-workflow',
- 3 => 'javelin-dom',
- 4 => 'javelin-fx',
- 5 => 'javelin-util',
- 6 => 'phabricator-textareautils',
- ),
'b98fc918' =>
array(
0 => 'javelin-behavior',
@@ -1796,6 +1808,15 @@
1 => 'javelin-util',
2 => 'javelin-stratcom',
),
+ 'da931794' =>
+ array(
+ 0 => 'javelin-behavior',
+ 1 => 'javelin-stratcom',
+ 2 => 'javelin-dom',
+ 3 => 'javelin-util',
+ 4 => 'phabricator-dropdown-menu',
+ 5 => 'phabricator-menu-item',
+ ),
'dd7e8ef5' =>
array(
0 => 'javelin-behavior',
@@ -1947,15 +1968,6 @@
4 => 'javelin-stratcom',
5 => 'phabricator-shaped-request',
),
- 'fb342e18' =>
- array(
- 0 => 'javelin-install',
- 1 => 'javelin-util',
- 2 => 'javelin-dom',
- 3 => 'javelin-vector',
- 4 => 'javelin-stratcom',
- 5 => 'phabricator-menu-item',
- ),
'fbbce3bf' =>
array(
0 => 'phabricator-busy',
diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
--- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
+++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentEditController.php
@@ -54,12 +54,10 @@
->applyEdit($xaction, $comment);
if ($request->isAjax()) {
- return id(new PhabricatorApplicationTransactionResponse())
- ->setViewer($user)
- ->setTransactions(array($xaction))
- ->setAnchorOffset($request->getStr('anchor'));
+ return id(new AphrontAjaxResponse())->setContent(array());
} else {
- return id(new AphrontReloadResponse())->setURI($obj_handle->getURI());
+ return id(new AphrontReloadResponse())->setURI(
+ $obj_handle->getURI());
}
}
diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php
--- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php
+++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php
@@ -47,10 +47,7 @@
->applyEdit($xaction, $comment);
if ($request->isAjax()) {
- return id(new PhabricatorApplicationTransactionResponse())
- ->setViewer($viewer)
- ->setTransactions(array($xaction))
- ->setAnchorOffset($request->getStr('anchor'));
+ return id(new AphrontAjaxResponse())->setContent(array());
} else {
return id(new AphrontReloadResponse())->setURI($obj_handle->getURI());
}
diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php
--- a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php
+++ b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php
@@ -169,9 +169,6 @@
'listID' => $list_id,
'objectPHID' => $this->getObjectPHID(),
'nextAnchor' => $this->anchorOffset + count($events),
- 'historyLink' => '/transactions/history/',
- 'historyLinkText' => pht('Edited'),
- 'linkDelimiter' => PHUITimelineEventView::DELIMITER,
));
}
diff --git a/src/view/layout/PhabricatorActionView.php b/src/view/layout/PhabricatorActionView.php
--- a/src/view/layout/PhabricatorActionView.php
+++ b/src/view/layout/PhabricatorActionView.php
@@ -12,6 +12,16 @@
private $download;
private $objectURI;
private $sigils = array();
+ private $metadata;
+
+ public function setMetadata($metadata) {
+ $this->metadata = $metadata;
+ return $this;
+ }
+
+ public function getMetadata() {
+ return $this->metadata;
+ }
public function setObjectURI($object_uri) {
$this->objectURI = $object_uri;
@@ -138,6 +148,7 @@
'action' => $this->getHref(),
'method' => 'POST',
'sigil' => $sigils,
+ 'meta' => $this->metadata,
),
$item);
} else {
@@ -147,6 +158,7 @@
'href' => $this->getHref(),
'class' => 'phabricator-action-view-item',
'sigil' => $sigils,
+ 'meta' => $this->metadata,
),
$this->name);
}
diff --git a/src/view/phui/PHUITimelineEventView.php b/src/view/phui/PHUITimelineEventView.php
--- a/src/view/phui/PHUITimelineEventView.php
+++ b/src/view/phui/PHUITimelineEventView.php
@@ -181,7 +181,6 @@
$extra = javelin_tag(
'span',
array(
- 'sigil' => 'timeline-extra',
'class' => 'phui-timeline-extra',
),
phutil_implode_html(self::DELIMITER, $extra));
@@ -189,6 +188,57 @@
$extra = null;
}
+ $menu = null;
+ $items = array();
+ $has_menu = false;
+ if (!$this->getIsPreview()) {
+ foreach ($this->getEventGroup() as $event) {
+ $items[] = $event->getMenuItems();
+ if ($event->hasChildren()) {
+ $has_menu = true;
+ }
+ }
+ $items = array_mergev($items);
+ }
+
+ if ($items || $has_menu) {
+ $icon = id(new PHUIIconView())
+ ->setIconFont('fa-cog');
+ $aural = javelin_tag(
+ 'span',
+ array(
+ 'aural' => true,
+ ),
+ pht('Comment Actions'));
+
+ if ($items) {
+ $sigil = 'phui-timeline-menu';
+ Javelin::initBehavior('phui-timeline-dropdown-menu');
+ } else {
+ $sigil = null;
+ }
+
+ // Render the items to emit metadata.
+ foreach ($items as $key => $value) {
+ $items[$key] = hsprintf('%s', $value);
+ }
+
+ $menu = javelin_tag(
+ $items ? 'a' : 'span',
+ array(
+ 'href' => '#',
+ 'class' => 'phui-timeline-menu',
+ 'sigil' => $sigil,
+ 'meta' => array(
+ 'items' => $items,
+ ),
+ ),
+ array(
+ $aural,
+ $icon,
+ ));
+ }
+
if ($title !== null || $extra) {
$title_classes = array();
$title_classes[] = 'phui-timeline-title';
@@ -198,6 +248,10 @@
$title_classes[] = 'phui-timeline-title-with-icon';
}
+ if ($menu) {
+ $title_classes[] = 'phui-timeline-title-with-menu';
+ }
+
if ($this->icon) {
$fill_classes = array();
$fill_classes[] = 'phui-timeline-icon-fill';
@@ -236,7 +290,7 @@
array($icon, $token, $title, $extra));
}
- return $title;
+ return array($title, $menu);
}
public function render() {
@@ -350,8 +404,8 @@
'div',
array(
'class' => implode(' ', $outer_classes),
- 'id' => $this->anchor ? 'anchor-'.$this->anchor : null,
'sigil' => $sigil,
+ 'id' => $this->anchor ? 'anchor-'.$this->anchor : null,
'meta' => $meta,
),
phutil_tag(
@@ -368,61 +422,9 @@
if ($this->getIsPreview()) {
$extra[] = pht('PREVIEW');
} else {
- $xaction_phid = $this->getTransactionPHID();
-
- if ($this->getQuoteTargetID()) {
-
- $ref = null;
- if ($this->getQuoteRef()) {
- $ref = $this->getQuoteRef();
- if ($this->anchor) {
- $ref = $ref.'#'.$this->anchor;
- }
- }
-
- $extra[] = javelin_tag(
- 'a',
- array(
- 'href' => '#',
- 'sigil' => 'transaction-quote',
- 'mustcapture' => true,
- 'meta' => array(
- 'targetID' => $this->getQuoteTargetID(),
- 'uri' => '/transactions/quote/'.$xaction_phid.'/',
- 'ref' => $ref,
- ),
- ),
- pht('Quote'));
- }
if ($this->getIsEdited()) {
- $extra[] = javelin_tag(
- 'a',
- array(
- 'href' => '/transactions/history/'.$xaction_phid.'/',
- 'sigil' => 'workflow transaction-edit-history',
- ),
- pht('Edited'));
- }
-
- if ($this->getIsEditable()) {
- $extra[] = javelin_tag(
- 'a',
- array(
- 'href' => '/transactions/edit/'.$xaction_phid.'/',
- 'sigil' => 'workflow transaction-edit',
- ),
- pht('Edit'));
- }
-
- if ($this->getIsRemovable()) {
- $extra[] = javelin_tag(
- 'a',
- array(
- 'href' => '/transactions/remove/'.$xaction_phid.'/',
- 'sigil' => 'workflow transaction-remove',
- ),
- pht('Remove'));
+ $extra[] = pht('Edited');
}
if ($is_first_extra) {
@@ -469,9 +471,77 @@
$extra[] = $date;
}
}
+
}
return $extra;
}
+ private function getMenuItems() {
+ $xaction_phid = $this->getTransactionPHID();
+
+ $items = array();
+ if ($this->getQuoteTargetID()) {
+
+ $ref = null;
+ if ($this->getQuoteRef()) {
+ $ref = $this->getQuoteRef();
+ if ($this->anchor) {
+ $ref = $ref.'#'.$this->anchor;
+ }
+ }
+
+ $items[] = id(new PhabricatorActionView())
+ ->setUser($this->getUser())
+ ->setIcon('comment')
+ ->setHref('#')
+ ->setName(pht('Quote'))
+ ->addSigil('transaction-quote')
+ ->setMetadata(
+ array(
+ 'targetID' => $this->getQuoteTargetID(),
+ 'uri' => '/transactions/quote/'.$xaction_phid.'/',
+ 'ref' => $ref,
+ ));
+ }
+
+ if ($this->getIsEditable()) {
+ $items[] = id(new PhabricatorActionView())
+ ->setUser($this->getUser())
+ ->setIcon('edit')
+ ->setHref('/transactions/edit/'.$xaction_phid.'/')
+ ->setName(pht('Edit Comment'))
+ ->addSigil('transaction-edit')
+ ->setMetadata(
+ array(
+ 'anchor' => $this->anchor,
+ ));
+ }
+
+ if ($this->getIsRemovable()) {
+ $items[] = id(new PhabricatorActionView())
+ ->setUser($this->getUser())
+ ->setIcon('delete')
+ ->setHref('/transactions/remove/'.$xaction_phid.'/')
+ ->setName(pht('Remove Comment'))
+ ->addSigil('transaction-remove')
+ ->setMetadata(
+ array(
+ 'anchor' => $this->anchor,
+ ));
+
+ }
+
+ if ($this->getIsEdited()) {
+ $items[] = id(new PhabricatorActionView())
+ ->setUser($this->getUser())
+ ->setIcon('transcript')
+ ->setHref('/transactions/history/'.$xaction_phid.'/')
+ ->setName(pht('View Edit History'))
+ ->setWorkflow(true);
+ }
+
+ return $items;
+ }
+
}
diff --git a/webroot/rsrc/css/core/core.css b/webroot/rsrc/css/core/core.css
--- a/webroot/rsrc/css/core/core.css
+++ b/webroot/rsrc/css/core/core.css
@@ -127,6 +127,13 @@
.aural-only {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
+
+ /* NOTE: Without this, Safari some times lays these elements out at normal
+ size. An example is the label on the comment action menu on timelines. */
+
+ width: 0;
+ height: 0;
+ overflow: hidden;
}
.visual-only {
@@ -135,6 +142,9 @@
.audible .aural-only {
clip: auto;
+ width: auto;
+ height: auto;
+ overflow: auto;
background: #006699;
color: #ffffff;
}
diff --git a/webroot/rsrc/css/phui/phui-button.css b/webroot/rsrc/css/phui/phui-button.css
--- a/webroot/rsrc/css/phui/phui-button.css
+++ b/webroot/rsrc/css/phui/phui-button.css
@@ -179,8 +179,8 @@
.dropdown-menu-frame .dropdown-menu-item {
display: block;
- padding: 2px 10px;
clear: both;
+ padding: 2px 10px;
line-height: 20px;
color: {$darkgreytext};
white-space: nowrap;
@@ -216,13 +216,17 @@
background: {$lightblue};
}
-.dropdown-menu-frame a:hover {
+.dropdown-menu-frame li.dropdown-menu-item-enabled:hover {
+ cursor: pointer;
background: {$blue};
+}
+
+.dropdown-menu-frame li.dropdown-menu-item-enabled:hover a {
color: white;
- cursor: pointer;
text-decoration: none;
}
+
a.toggle {
display: inline-block;
padding: 4px 8px;
diff --git a/webroot/rsrc/css/phui/phui-timeline-view.css b/webroot/rsrc/css/phui/phui-timeline-view.css
--- a/webroot/rsrc/css/phui/phui-timeline-view.css
+++ b/webroot/rsrc/css/phui/phui-timeline-view.css
@@ -125,6 +125,10 @@
padding-left: 38px;
}
+.phui-timeline-title-with-menu {
+ padding-right: 36px;
+}
+
.phui-timeline-view .phui-icon-view.phui-timeline-token {
vertical-align: middle;
margin-right: 4px;
@@ -225,6 +229,7 @@
.device-desktop .phui-timeline-extra {
float: right;
+ overflow: hidden;
}
.device .phui-timeline-extra {
@@ -315,3 +320,44 @@
font-weight: normal;
color: {$bluetext};
}
+
+.phui-timeline-comment-actions .phui-icon-view {
+ width: 16px;
+ height: 16px;
+ font-size: 16px;
+ text-align: center;
+ overflow: hidden;
+}
+
+.phui-timeline-menu {
+ position: absolute;
+ right: 3px;
+ top: 4px;
+ width: 28px;
+ height: 22px;
+ text-align: center;
+ line-height: 22px;
+ font-size: 15px;
+ border-left: 1px solid {$lightblueborder};
+}
+
+.phui-timeline-menu .phui-icon-view {
+ color: {$lightgreytext};
+}
+
+a.phui-timeline-menu .phui-icon-view {
+ color: {$bluetext};
+}
+
+.device-desktop a.phui-timeline-menu:hover .phui-icon-view {
+ color: {$darkgreytext};
+}
+
+.phui-timeline-menu.dropdown-open {
+ background: {$blue};
+}
+
+.phui-timeline-menu.dropdown-open .phui-icon-view,
+.device-desktop a.dropdown-open:hover .phui-icon-view {
+ color: #ffffff;
+}
diff --git a/webroot/rsrc/js/application/transactions/behavior-transaction-list.js b/webroot/rsrc/js/application/transactions/behavior-transaction-list.js
--- a/webroot/rsrc/js/application/transactions/behavior-transaction-list.js
+++ b/webroot/rsrc/js/application/transactions/behavior-transaction-list.js
@@ -5,7 +5,7 @@
* javelin-workflow
* javelin-dom
* javelin-fx
- * javelin-util
+ * javelin-uri
* phabricator-textareautils
*/
@@ -64,64 +64,29 @@
}
}
- function edittransaction(transaction, response) {
- // NOTE: this is for 1 transaction only
- for (var phid in response.xactions) {
- var new_node = JX.$H(response.xactions[phid]).getFragment().firstChild;
- var new_comment = JX.DOM.find(new_node, 'span', 'transaction-comment');
- var old_comments = JX.DOM.scry(
- transaction,
- 'span',
- 'transaction-comment');
- var old_comment = old_comments[0];
- JX.DOM.replace(old_comment, new_comment);
- var edit_history = JX.DOM.scry(
- transaction,
- 'a',
- 'transaction-edit-history');
- if (!edit_history.length) {
- var transaction_phid = JX.Stratcom.getData(new_comment).phid;
- var history_link = JX.$N(
- 'a',
- { sigil : 'transaction-edit-history',
- href : config.historyLink + transaction_phid + '/' },
- config.historyLinkText);
- JX.Stratcom.addSigil(history_link, 'workflow');
- var timeline_extra = JX.DOM.find(transaction, 'span', 'timeline-extra');
- var old_content = JX.$H(timeline_extra.innerHTML);
- JX.DOM.setContent(
- timeline_extra,
- [history_link, config.linkDelimiter, old_content]);
- }
- new JX.FX(transaction).setDuration(500).start({opacity: [0, 1]});
- }
- }
-
- JX.DOM.listen(
- list,
+ JX.Stratcom.listen(
'click',
- ['transaction-edit', 'transaction-remove'],
+ [['transaction-edit'], ['transaction-remove']],
function(e) {
if (!e.isNormalClick()) {
return;
}
- var transaction = e.getNode('transaction');
+ e.prevent();
- JX.Workflow.newFromLink(e.getTarget())
- .setData({anchor: e.getNodeData('transaction').anchor})
- .setHandler(JX.bind(null, edittransaction, transaction))
- .start();
+ var anchor = e.getNodeData('tag:a').anchor;
+ var uri = JX.$U(window.location).setFragment(anchor);
- e.kill();
+ JX.Workflow.newFromLink(e.getNode('tag:a'))
+ .setHandler(function() { uri.go(); window.location.reload(); })
+ .start();
});
- JX.DOM.listen(
- list,
+ JX.Stratcom.listen(
'click',
'transaction-quote',
function(e) {
- e.kill();
+ e.prevent();
var data = e.getNodeData('transaction-quote');
new JX.Workflow(data.uri)
diff --git a/webroot/rsrc/js/core/DropdownMenu.js b/webroot/rsrc/js/core/DropdownMenu.js
--- a/webroot/rsrc/js/core/DropdownMenu.js
+++ b/webroot/rsrc/js/core/DropdownMenu.js
@@ -14,7 +14,7 @@
construct : function(node) {
this._node = node;
this._items = [];
- this._menu = JX.$N('div', { className : 'dropdown-menu-frame' });
+ this._menu = JX.$N('ul', { className : 'dropdown-menu-frame' });
JX.DOM.listen(
this._node,
@@ -118,7 +118,8 @@
},
_onclickitem : function(e) {
- var item = JX.Stratcom.getData(e.getTarget()).item;
+ var data = e.getNodeData('phabricator-menu-item') || {};
+ var item = data.item;
if (!item) {
return;
}
@@ -129,7 +130,11 @@
}
item.select();
- e.prevent();
+
+ // TODO: The item should probably be responsible for this?
+ if (!item.getIsBareItem()) {
+ e.prevent();
+ }
this.close();
},
diff --git a/webroot/rsrc/js/core/DropdownMenuItem.js b/webroot/rsrc/js/core/DropdownMenuItem.js
--- a/webroot/rsrc/js/core/DropdownMenuItem.js
+++ b/webroot/rsrc/js/core/DropdownMenuItem.js
@@ -1,6 +1,7 @@
/**
* @requires javelin-install
* javelin-dom
+ * javelin-stratcom
* @provides phabricator-menu-item
* @javelin
*/
@@ -17,32 +18,36 @@
_action : null,
render : function() {
- var classes = [];
- classes.push('dropdown-menu-item');
+ var li = this._renderListItem();
- if (this.getSelected()) {
- classes.push('dropdown-menu-item-selected');
- }
+ JX.DOM.alterClass(li, 'dropdown-menu-item', true);
+ JX.DOM.alterClass(li, 'dropdown-menu-item-enabled', !this.getDisabled());
+ JX.DOM.alterClass(li, 'dropdown-menu-item-selected', this.getSelected());
+ JX.DOM.alterClass(li, 'dropdown-menu-item-disabled', this.getDisabled());
- if (this.getDisabled()) {
- classes.push('dropdown-menu-item-disabled');
- }
+ JX.Stratcom.getData(li).item = this;
+ JX.Stratcom.addSigil(li, 'phabricator-menu-item');
- var attrs = {
- href: this.getHref(),
- meta: { item: this },
- className: classes.join(' ')
- };
+ return li;
+ },
+ _renderListItem : function() {
+ if (this.getIsBareItem()) {
+ return this.getName();
+ }
+
+ var name;
if (this.getDisabled()) {
- return JX.$N('span', attrs, this.getName());
+ name = JX.$N('span', {}, this.getName());
} else {
- return JX.$N('a', attrs, this.getName());
+ name = JX.$N('a', {href: this.getHref()}, this.getName());
}
+
+ return JX.$N('li', {}, name);
},
select : function() {
- this._action();
+ this._action && this._action();
}
},
@@ -50,7 +55,8 @@
name: '',
href: '',
disabled: false,
- selected: false
+ selected: false,
+ isBareItem: false
}
});
diff --git a/webroot/rsrc/js/phui/behavior-phui-timeline-dropdown-menu.js b/webroot/rsrc/js/phui/behavior-phui-timeline-dropdown-menu.js
new file mode 100644
--- /dev/null
+++ b/webroot/rsrc/js/phui/behavior-phui-timeline-dropdown-menu.js
@@ -0,0 +1,40 @@
+/**
+ * @provides javelin-behavior-phui-timeline-dropdown-menu
+ * @requires javelin-behavior
+ * javelin-stratcom
+ * javelin-dom
+ * javelin-util
+ * phabricator-dropdown-menu
+ * phabricator-menu-item
+ */
+
+JX.behavior('phui-timeline-dropdown-menu', function() {
+
+ var buildmenu = function(node, menu) {
+ menu.clear();
+
+ var data = JX.Stratcom.getData(node);
+ for (var ii = 0; ii < data.items.length; ii++) {
+ var item = JX.$H(data.items[ii]).getFragment().firstChild;
+ menu.addItem(
+ new JX.PhabricatorMenuItem(item)
+ .setIsBareItem(true));
+ }
+ };
+
+
+ JX.Stratcom.listen('click', 'phui-timeline-menu', function(e) {
+ var data = e.getNodeData('phui-timeline-menu');
+ if (data.menu) {
+ return;
+ }
+
+ e.kill();
+
+ var icon = e.getNode('phui-timeline-menu');
+ data.menu = new JX.PhabricatorDropdownMenu(icon);
+ data.menu.listen('open', JX.bind(null, buildmenu, icon, data.menu));
+ data.menu.open();
+ });
+
+});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 22, 1:56 AM (1 h, 55 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704607
Default Alt Text
D8966.id21268.diff (28 KB)
Attached To
Mode
D8966: Move all comment management junk into a dropdown menu
Attached
Detach File
Event Timeline
Log In to Comment