@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement basic transaction detail blocks

Summary:
Some transactions (like editing configuration values, task descriptions, or Conpherence images) can't be simply explained and need an additional larger element to show them fully (like a text diff).

Support change details like this in ApplicationTransactions. Implements the element in Config, so you can see changes.

Test Plan: {F32974}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2213

Differential Revision: https://secure.phabricator.com/D4984

+250 -95
+1 -1
scripts/celerity_mapper.php
··· 57 57 'phabricator-textareautils', 58 58 'phabricator-file-upload', 59 59 'javelin-behavior-global-drag-and-drop', 60 - 'javelin-behavior-phabricator-home-reveal-tiles', 60 + 'javelin-behavior-phabricator-reveal-content', 61 61 ), 62 62 'core.pkg.css' => array( 63 63 'phabricator-core-css',
+49 -49
src/__celerity_resource_map__.php
··· 1686 1686 ), 1687 1687 'disk' => '/rsrc/js/application/core/behavior-file-tree.js', 1688 1688 ), 1689 - 'javelin-behavior-phabricator-home-reveal-tiles' => 1690 - array( 1691 - 'uri' => '/res/b3c5cea9/rsrc/js/application/core/behavior-home-reveal-tiles.js', 1692 - 'type' => 'js', 1693 - 'requires' => 1694 - array( 1695 - 0 => 'javelin-behavior', 1696 - 1 => 'javelin-stratcom', 1697 - 2 => 'javelin-dom', 1698 - ), 1699 - 'disk' => '/rsrc/js/application/core/behavior-home-reveal-tiles.js', 1700 - ), 1701 1689 'javelin-behavior-phabricator-keyboard-pager' => 1702 1690 array( 1703 1691 'uri' => '/res/56d64eff/rsrc/js/application/core/behavior-keyboard-pager.js', ··· 1788 1776 3 => 'phabricator-textareautils', 1789 1777 ), 1790 1778 'disk' => '/rsrc/js/application/core/behavior-phabricator-remarkup-assist.js', 1779 + ), 1780 + 'javelin-behavior-phabricator-reveal-content' => 1781 + array( 1782 + 'uri' => '/res/a4fae14a/rsrc/js/application/core/behavior-reveal-content.js', 1783 + 'type' => 'js', 1784 + 'requires' => 1785 + array( 1786 + 0 => 'javelin-behavior', 1787 + 1 => 'javelin-stratcom', 1788 + 2 => 'javelin-dom', 1789 + ), 1790 + 'disk' => '/rsrc/js/application/core/behavior-reveal-content.js', 1791 1791 ), 1792 1792 'javelin-behavior-phabricator-search-typeahead' => 1793 1793 array( ··· 3017 3017 ), 3018 3018 'phabricator-timeline-view-css' => 3019 3019 array( 3020 - 'uri' => '/res/d87e1d60/rsrc/css/layout/phabricator-timeline-view.css', 3020 + 'uri' => '/res/5517bf1a/rsrc/css/layout/phabricator-timeline-view.css', 3021 3021 'type' => 'css', 3022 3022 'requires' => 3023 3023 array( ··· 3471 3471 'uri' => '/res/pkg/acc46105/core.pkg.css', 3472 3472 'type' => 'css', 3473 3473 ), 3474 - 'bc0774e5' => 3474 + 'd29c1557' => 3475 3475 array( 3476 3476 'name' => 'core.pkg.js', 3477 3477 'symbols' => ··· 3508 3508 29 => 'phabricator-textareautils', 3509 3509 30 => 'phabricator-file-upload', 3510 3510 31 => 'javelin-behavior-global-drag-and-drop', 3511 - 32 => 'javelin-behavior-phabricator-home-reveal-tiles', 3511 + 32 => 'javelin-behavior-phabricator-reveal-content', 3512 3512 ), 3513 - 'uri' => '/res/pkg/bc0774e5/core.pkg.js', 3513 + 'uri' => '/res/pkg/d29c1557/core.pkg.js', 3514 3514 'type' => 'js', 3515 3515 ), 3516 3516 'dca4a03d' => ··· 3682 3682 'diffusion-icons-css' => 'c8ce2d88', 3683 3683 'global-drag-and-drop-css' => 'acc46105', 3684 3684 'inline-comment-summary-css' => '8aaacd1b', 3685 - 'javelin-aphlict' => 'bc0774e5', 3685 + 'javelin-aphlict' => 'd29c1557', 3686 3686 'javelin-behavior' => 'a69b9f1f', 3687 - 'javelin-behavior-aphlict-dropdown' => 'bc0774e5', 3688 - 'javelin-behavior-aphlict-listen' => 'bc0774e5', 3689 - 'javelin-behavior-aphront-basic-tokenizer' => 'bc0774e5', 3687 + 'javelin-behavior-aphlict-dropdown' => 'd29c1557', 3688 + 'javelin-behavior-aphlict-listen' => 'd29c1557', 3689 + 'javelin-behavior-aphront-basic-tokenizer' => 'd29c1557', 3690 3690 'javelin-behavior-aphront-drag-and-drop' => '95d0d865', 3691 3691 'javelin-behavior-aphront-drag-and-drop-textarea' => '95d0d865', 3692 - 'javelin-behavior-aphront-form-disable-on-submit' => 'bc0774e5', 3692 + 'javelin-behavior-aphront-form-disable-on-submit' => 'd29c1557', 3693 3693 'javelin-behavior-audit-preview' => 'f96657b8', 3694 3694 'javelin-behavior-dark-console' => 'dca4a03d', 3695 - 'javelin-behavior-device' => 'bc0774e5', 3695 + 'javelin-behavior-device' => 'd29c1557', 3696 3696 'javelin-behavior-differential-accept-with-errors' => '95d0d865', 3697 3697 'javelin-behavior-differential-add-reviewers-and-ccs' => '95d0d865', 3698 3698 'javelin-behavior-differential-comment-jump' => '95d0d865', ··· 3708 3708 'javelin-behavior-diffusion-commit-graph' => 'f96657b8', 3709 3709 'javelin-behavior-diffusion-pull-lastmodified' => 'f96657b8', 3710 3710 'javelin-behavior-error-log' => 'dca4a03d', 3711 - 'javelin-behavior-global-drag-and-drop' => 'bc0774e5', 3712 - 'javelin-behavior-konami' => 'bc0774e5', 3713 - 'javelin-behavior-lightbox-attachments' => 'bc0774e5', 3711 + 'javelin-behavior-global-drag-and-drop' => 'd29c1557', 3712 + 'javelin-behavior-konami' => 'd29c1557', 3713 + 'javelin-behavior-lightbox-attachments' => 'd29c1557', 3714 3714 'javelin-behavior-maniphest-batch-selector' => '7707de41', 3715 3715 'javelin-behavior-maniphest-subpriority-editor' => '7707de41', 3716 3716 'javelin-behavior-maniphest-transaction-controls' => '7707de41', 3717 3717 'javelin-behavior-maniphest-transaction-expand' => '7707de41', 3718 3718 'javelin-behavior-maniphest-transaction-preview' => '7707de41', 3719 - 'javelin-behavior-phabricator-active-nav' => 'bc0774e5', 3720 - 'javelin-behavior-phabricator-autofocus' => 'bc0774e5', 3721 - 'javelin-behavior-phabricator-home-reveal-tiles' => 'bc0774e5', 3722 - 'javelin-behavior-phabricator-keyboard-shortcuts' => 'bc0774e5', 3723 - 'javelin-behavior-phabricator-nav' => 'bc0774e5', 3719 + 'javelin-behavior-phabricator-active-nav' => 'd29c1557', 3720 + 'javelin-behavior-phabricator-autofocus' => 'd29c1557', 3721 + 'javelin-behavior-phabricator-keyboard-shortcuts' => 'd29c1557', 3722 + 'javelin-behavior-phabricator-nav' => 'd29c1557', 3724 3723 'javelin-behavior-phabricator-object-selector' => '95d0d865', 3725 - 'javelin-behavior-phabricator-oncopy' => 'bc0774e5', 3726 - 'javelin-behavior-phabricator-remarkup-assist' => 'bc0774e5', 3727 - 'javelin-behavior-phabricator-search-typeahead' => 'bc0774e5', 3728 - 'javelin-behavior-phabricator-tooltips' => 'bc0774e5', 3729 - 'javelin-behavior-phabricator-watch-anchor' => 'bc0774e5', 3730 - 'javelin-behavior-refresh-csrf' => 'bc0774e5', 3724 + 'javelin-behavior-phabricator-oncopy' => 'd29c1557', 3725 + 'javelin-behavior-phabricator-remarkup-assist' => 'd29c1557', 3726 + 'javelin-behavior-phabricator-reveal-content' => 'd29c1557', 3727 + 'javelin-behavior-phabricator-search-typeahead' => 'd29c1557', 3728 + 'javelin-behavior-phabricator-tooltips' => 'd29c1557', 3729 + 'javelin-behavior-phabricator-watch-anchor' => 'd29c1557', 3730 + 'javelin-behavior-refresh-csrf' => 'd29c1557', 3731 3731 'javelin-behavior-repository-crossreference' => '95d0d865', 3732 - 'javelin-behavior-toggle-class' => 'bc0774e5', 3733 - 'javelin-behavior-workflow' => 'bc0774e5', 3732 + 'javelin-behavior-toggle-class' => 'd29c1557', 3733 + 'javelin-behavior-workflow' => 'd29c1557', 3734 3734 'javelin-dom' => 'a69b9f1f', 3735 3735 'javelin-event' => 'a69b9f1f', 3736 3736 'javelin-install' => 'a69b9f1f', ··· 3752 3752 'lightbox-attachment-css' => 'acc46105', 3753 3753 'maniphest-task-summary-css' => 'e30a3fa8', 3754 3754 'maniphest-transaction-detail-css' => 'e30a3fa8', 3755 - 'phabricator-busy' => 'bc0774e5', 3755 + 'phabricator-busy' => 'd29c1557', 3756 3756 'phabricator-content-source-view-css' => '8aaacd1b', 3757 3757 'phabricator-core-buttons-css' => 'acc46105', 3758 3758 'phabricator-core-css' => 'acc46105', 3759 3759 'phabricator-crumbs-view-css' => 'acc46105', 3760 3760 'phabricator-directory-css' => 'acc46105', 3761 3761 'phabricator-drag-and-drop-file-upload' => '95d0d865', 3762 - 'phabricator-dropdown-menu' => 'bc0774e5', 3763 - 'phabricator-file-upload' => 'bc0774e5', 3762 + 'phabricator-dropdown-menu' => 'd29c1557', 3763 + 'phabricator-file-upload' => 'd29c1557', 3764 3764 'phabricator-filetree-view-css' => 'acc46105', 3765 3765 'phabricator-flag-css' => 'acc46105', 3766 3766 'phabricator-form-view-css' => 'acc46105', 3767 3767 'phabricator-header-view-css' => 'acc46105', 3768 3768 'phabricator-jump-nav' => 'acc46105', 3769 - 'phabricator-keyboard-shortcut' => 'bc0774e5', 3770 - 'phabricator-keyboard-shortcut-manager' => 'bc0774e5', 3769 + 'phabricator-keyboard-shortcut' => 'd29c1557', 3770 + 'phabricator-keyboard-shortcut-manager' => 'd29c1557', 3771 3771 'phabricator-main-menu-view' => 'acc46105', 3772 - 'phabricator-menu-item' => 'bc0774e5', 3772 + 'phabricator-menu-item' => 'd29c1557', 3773 3773 'phabricator-nav-view-css' => 'acc46105', 3774 - 'phabricator-notification' => 'bc0774e5', 3774 + 'phabricator-notification' => 'd29c1557', 3775 3775 'phabricator-notification-css' => 'acc46105', 3776 3776 'phabricator-notification-menu-css' => 'acc46105', 3777 3777 'phabricator-object-item-list-view-css' => 'acc46105', 3778 3778 'phabricator-object-selector-css' => '8aaacd1b', 3779 - 'phabricator-paste-file-upload' => 'bc0774e5', 3780 - 'phabricator-prefab' => 'bc0774e5', 3779 + 'phabricator-paste-file-upload' => 'd29c1557', 3780 + 'phabricator-prefab' => 'd29c1557', 3781 3781 'phabricator-project-tag-css' => 'e30a3fa8', 3782 3782 'phabricator-remarkup-css' => 'acc46105', 3783 3783 'phabricator-shaped-request' => '95d0d865', 3784 3784 'phabricator-side-menu-view-css' => 'acc46105', 3785 3785 'phabricator-standard-page-view' => 'acc46105', 3786 - 'phabricator-textareautils' => 'bc0774e5', 3787 - 'phabricator-tooltip' => 'bc0774e5', 3786 + 'phabricator-textareautils' => 'd29c1557', 3787 + 'phabricator-tooltip' => 'd29c1557', 3788 3788 'phabricator-transaction-view-css' => 'acc46105', 3789 3789 'phabricator-zindex-css' => 'acc46105', 3790 3790 'sprite-apps-large-css' => 'acc46105',
+3 -1
src/__phutil_library_map__.php
··· 684 684 'PhabricatorApplicationTransactionNoEffectResponse' => 'applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php', 685 685 'PhabricatorApplicationTransactionQuery' => 'applications/transactions/query/PhabricatorApplicationTransactionQuery.php', 686 686 'PhabricatorApplicationTransactionResponse' => 'applications/transactions/response/PhabricatorApplicationTransactionResponse.php', 687 + 'PhabricatorApplicationTransactionTextDiffDetailView' => 'applications/transactions/view/PhabricatorApplicationTransactionTextDiffDetailView.php', 687 688 'PhabricatorApplicationTransactionView' => 'applications/transactions/view/PhabricatorApplicationTransactionView.php', 688 689 'PhabricatorApplicationTransactions' => 'applications/transactions/application/PhabricatorApplicationTransactions.php', 689 690 'PhabricatorApplicationUIExamples' => 'applications/uiexample/application/PhabricatorApplicationUIExamples.php', ··· 2168 2169 'PhabricatorApplicationTransactionNoEffectResponse' => 'AphrontProxyResponse', 2169 2170 'PhabricatorApplicationTransactionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 2170 2171 'PhabricatorApplicationTransactionResponse' => 'AphrontProxyResponse', 2172 + 'PhabricatorApplicationTransactionTextDiffDetailView' => 'AphrontView', 2171 2173 'PhabricatorApplicationTransactionView' => 'AphrontView', 2172 2174 'PhabricatorApplicationTransactions' => 'PhabricatorApplication', 2173 2175 'PhabricatorApplicationUIExamples' => 'PhabricatorApplication', ··· 2222 2224 'PhabricatorCalendarHoliday' => 'PhabricatorCalendarDAO', 2223 2225 'PhabricatorCalendarHolidayTestCase' => 'PhabricatorTestCase', 2224 2226 'PhabricatorCalendarViewStatusController' => 'PhabricatorCalendarController', 2225 - 'PhabricatorCampfireProtocolAdapter' => 'PhabricatorBaseProtocolAdapter', 2227 + 'PhabricatorCampfireProtocolAdapter' => 'PhabricatorBotBaseStreamingProtocolAdapter', 2226 2228 'PhabricatorChangesetResponse' => 'AphrontProxyResponse', 2227 2229 'PhabricatorChatLogChannel' => 2228 2230 array(
+33
src/applications/config/storage/PhabricatorConfigTransaction.php
··· 70 70 return parent::getIcon(); 71 71 } 72 72 73 + public function hasChangeDetails() { 74 + switch ($this->getTransactionType()) { 75 + case self::TYPE_EDIT: 76 + return true; 77 + } 78 + return parent::hasChangeDetails(); 79 + } 80 + 81 + public function renderChangeDetails() { 82 + $old = $this->getOldValue(); 83 + $new = $this->getNewValue(); 84 + 85 + if ($old['deleted']) { 86 + $old_text = ''; 87 + } else { 88 + // NOTE: Here and below, we're adding a synthetic "\n" to prevent the 89 + // differ from complaining about missing trailing newlines. 90 + $old_text = PhabricatorConfigJSON::prettyPrintJSON($old['value'])."\n"; 91 + } 92 + 93 + if ($new['deleted']) { 94 + $new_text = ''; 95 + } else { 96 + $new_text = PhabricatorConfigJSON::prettyPrintJSON($new['value'])."\n"; 97 + } 98 + 99 + $view = id(new PhabricatorApplicationTransactionTextDiffDetailView()) 100 + ->setOldText($old_text) 101 + ->setNewText($new_text); 102 + 103 + return $view->render(); 104 + } 105 + 73 106 public function getColor() { 74 107 $old = $this->getOldValue(); 75 108 $new = $this->getNewValue();
+1 -1
src/applications/differential/__tests__/DifferentialParseRenderTestCase.php
··· 26 26 $actual = $parser->render(null, null, array()); 27 27 28 28 $expect = Filesystem::readFile($dir.$file.'.'.$type.'.expect'); 29 - $this->assertEqual($expect, $actual, $file.'.'.$type); 29 + $this->assertEqual($expect, (string)$actual, $file.'.'.$type); 30 30 } 31 31 } 32 32 }
+1 -1
src/applications/differential/render/DifferentialChangesetRenderer.php
··· 252 252 // TODO: Both these steps should happen earlier. 253 253 $result = str_replace("\t", ' ', $result); 254 254 255 - return $result; 255 + return phutil_safe_html($result); 256 256 } 257 257 258 258 abstract public function isOneUpRenderer();
+14 -6
src/applications/directory/controller/PhabricatorDirectoryController.php
··· 84 84 $show_item = id(new PhabricatorMenuItemView()) 85 85 ->setName(pht('Show More Applications')) 86 86 ->setHref('#') 87 - ->addSigil('home-show-applications') 87 + ->addSigil('reveal-content') 88 88 ->setID($show_item_id); 89 89 90 90 $hide_item = id(new PhabricatorMenuItemView()) ··· 92 92 ->setHref('#') 93 93 ->setStyle('display: none') 94 94 ->setID($hide_item_id) 95 - ->addSigil('home-hide-applications'); 95 + ->addSigil('reveal-content'); 96 96 97 97 $nav->addMenuItem($show_item); 98 98 $tile_ids = array($hide_item_id); ··· 146 146 } 147 147 148 148 if ($is_hide) { 149 - Javelin::initBehavior('phabricator-home-reveal-tiles', array( 150 - 'tileIDs' => $tile_ids, 151 - 'showID' => $show_item_id, 152 - )); 149 + Javelin::initBehavior('phabricator-reveal-content'); 150 + 151 + $show_item->setMetadata( 152 + array( 153 + 'showIDs' => $tile_ids, 154 + 'hideIDs' => array($show_item_id), 155 + )); 156 + $hide_item->setMetadata( 157 + array( 158 + 'showIDs' => array($show_item_id), 159 + 'hideIDs' => $tile_ids, 160 + )); 153 161 $nav->addMenuItem($hide_item); 154 162 } 155 163 }
+7
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 321 321 return array(); 322 322 } 323 323 324 + public function hasChangeDetails() { 325 + return false; 326 + } 327 + 328 + public function renderChangeDetails() { 329 + return null; 330 + } 324 331 325 332 /* -( PhabricatorPolicyInterface Implementation )-------------------------- */ 326 333
+45
src/applications/transactions/view/PhabricatorApplicationTransactionTextDiffDetailView.php
··· 1 + <?php 2 + 3 + final class PhabricatorApplicationTransactionTextDiffDetailView 4 + extends AphrontView { 5 + 6 + private $oldText; 7 + private $newText; 8 + 9 + public function setNewText($new_text) { 10 + $this->newText = $new_text; 11 + return $this; 12 + } 13 + 14 + public function setOldText($old_text) { 15 + $this->oldText = $old_text; 16 + return $this; 17 + } 18 + 19 + public function render() { 20 + $old = $this->oldText; 21 + $new = $this->newText; 22 + 23 + // TODO: On mobile, or perhaps by default, we should switch to 1-up once 24 + // that is built. 25 + 26 + // TODO: This should be utf8-aware, but we don't currently have a plain-text 27 + // utf8 hard-wrap function. See T2554. 28 + $old = wordwrap($old, 80); 29 + $new = wordwrap($new, 80); 30 + 31 + $engine = new PhabricatorDifferenceEngine(); 32 + $changeset = $engine->generateChangesetFromFileContent($old, $new); 33 + 34 + $whitespace_mode = DifferentialChangesetParser::WHITESPACE_SHOW_ALL; 35 + 36 + $parser = new DifferentialChangesetParser(); 37 + $parser->setChangeset($changeset); 38 + $parser->setMarkupEngine(new PhabricatorMarkupEngine()); 39 + $parser->setWhitespaceMode($whitespace_mode); 40 + 41 + return $parser->render(0, PHP_INT_MAX, array()); 42 + } 43 + 44 + } 45 +
+66 -3
src/applications/transactions/view/PhabricatorApplicationTransactionView.php
··· 59 59 ->setTransactionPHID($xaction->getPHID()) 60 60 ->setUserHandle($xaction->getHandle($xaction->getAuthorPHID())) 61 61 ->setIcon($xaction->getIcon()) 62 - ->setColor($xaction->getColor()) 63 - ->setTitle($xaction->getTitle()); 62 + ->setColor($xaction->getColor()); 63 + 64 + $title = $xaction->getTitle(); 65 + if ($xaction->hasChangeDetails()) { 66 + $title = array( 67 + $title, 68 + ' ', 69 + $this->buildChangeDetails($xaction), 70 + ); 71 + } 72 + $event->setTitle($title); 64 73 65 74 if ($this->isPreview) { 66 75 $event->setIsPreview(true); ··· 72 81 73 82 $anchor++; 74 83 } 75 - 76 84 77 85 $has_deleted_comment = $xaction->getComment() && 78 86 $xaction->getComment()->getIsDeleted(); ··· 152 160 153 161 return $engine; 154 162 } 163 + 164 + private function buildChangeDetails( 165 + PhabricatorApplicationTransaction $xaction) { 166 + 167 + Javelin::initBehavior('phabricator-reveal-content'); 168 + 169 + $show_id = celerity_generate_unique_node_id(); 170 + $hide_id = celerity_generate_unique_node_id(); 171 + $content_id = celerity_generate_unique_node_id(); 172 + 173 + $show_more = javelin_tag( 174 + 'a', 175 + array( 176 + 'href' => '#', 177 + 'sigil' => 'reveal-content', 178 + 'mustcapture' => true, 179 + 'id' => $show_id, 180 + 'meta' => array( 181 + 'hideIDs' => array($show_id), 182 + 'showIDs' => array($hide_id, $content_id), 183 + ), 184 + ), 185 + pht('(Show Details)')); 186 + 187 + $hide_more = javelin_tag( 188 + 'a', 189 + array( 190 + 'href' => '#', 191 + 'sigil' => 'reveal-content', 192 + 'mustcapture' => true, 193 + 'id' => $hide_id, 194 + 'style' => 'display: none', 195 + 'meta' => array( 196 + 'hideIDs' => array($hide_id, $content_id), 197 + 'showIDs' => array($show_id), 198 + ), 199 + ), 200 + pht('(Hide Details)')); 201 + 202 + $content = phutil_tag( 203 + 'div', 204 + array( 205 + 'id' => $content_id, 206 + 'style' => 'display: none', 207 + 'class' => 'phabricator-timeline-change-details', 208 + ), 209 + $xaction->renderChangeDetails()); 210 + 211 + return array( 212 + $show_more, 213 + $hide_more, 214 + $content, 215 + ); 216 + } 217 + 155 218 156 219 } 157 220
+7
webroot/rsrc/css/layout/phabricator-timeline-view.css
··· 250 250 padding: 4px 1.25%; 251 251 border: solid #c0c5d1 1px 0; 252 252 } 253 + 254 + .phabricator-timeline-change-details { 255 + padding: 10px 0; 256 + border-style: solid; 257 + border-color: #efefef; 258 + border-width: 1px 0; 259 + }
-33
webroot/rsrc/js/application/core/behavior-home-reveal-tiles.js
··· 1 - /** 2 - * @provides javelin-behavior-phabricator-home-reveal-tiles 3 - * @requires javelin-behavior 4 - * javelin-stratcom 5 - * javelin-dom 6 - * @javelin 7 - */ 8 - 9 - JX.behavior('phabricator-home-reveal-tiles', function(config) { 10 - JX.Stratcom.listen( 11 - 'click', 12 - 'home-show-applications', 13 - function(e) { 14 - e.kill(); 15 - 16 - for (var ii = 0; ii < config.tileIDs.length; ii++) { 17 - JX.DOM.show(JX.$(config.tileIDs[ii])); 18 - } 19 - JX.DOM.hide(JX.$(config.showID)); 20 - }); 21 - 22 - JX.Stratcom.listen( 23 - 'click', 24 - 'home-hide-applications', 25 - function(e) { 26 - e.kill(); 27 - 28 - for (var ii = 0; ii < config.tileIDs.length; ii++) { 29 - JX.DOM.hide(JX.$(config.tileIDs[ii])); 30 - } 31 - JX.DOM.show(JX.$(config.showID)); 32 - }); 33 - });
+23
webroot/rsrc/js/application/core/behavior-reveal-content.js
··· 1 + /** 2 + * @provides javelin-behavior-phabricator-reveal-content 3 + * @requires javelin-behavior 4 + * javelin-stratcom 5 + * javelin-dom 6 + * @javelin 7 + */ 8 + 9 + JX.behavior('phabricator-reveal-content', function(config) { 10 + JX.Stratcom.listen( 11 + 'click', 12 + 'reveal-content', 13 + function(e) { 14 + e.kill(); 15 + var nodes = e.getNodeData('reveal-content'); 16 + for (var ii = 0; ii < nodes.showIDs.length; ii++) { 17 + JX.DOM.show(JX.$(nodes.showIDs[ii])); 18 + } 19 + for (var ii = 0; ii < nodes.hideIDs.length; ii++) { 20 + JX.DOM.hide(JX.$(nodes.hideIDs[ii])); 21 + } 22 + }); 23 + });