@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.

Add quest objectives to the minimap

Summary:
Add important objectives (like waygates and quest markers) to the minimap.

This also probably fixes @cspeckmim's bug with the {key @} keyboard shortcut.

Test Plan:
(This is probably easier to undestand if you `arc patch` + click around.)

{F4966037}

Reviewers: chad, amckinley

Reviewed By: chad

Subscribers: cspeckmim

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

+540 -55
+67 -45
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => 'ff161f2d', 11 11 'conpherence.pkg.js' => 'b5b51108', 12 12 'core.pkg.css' => 'd6dc3994', 13 - 'core.pkg.js' => 'a0c8fb20', 13 + 'core.pkg.js' => 'e822b496', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 - 'differential.pkg.css' => '52b014e7', 16 - 'differential.pkg.js' => '1efe85bf', 15 + 'differential.pkg.css' => 'deae6388', 16 + 'differential.pkg.js' => 'dedee9c8', 17 17 'diffusion.pkg.css' => 'b93d9b8c', 18 18 'diffusion.pkg.js' => '84c8f8fd', 19 19 'favicon.ico' => '30672e08', ··· 64 64 'rsrc/css/application/dashboard/dashboard.css' => 'fe5b1869', 65 65 'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a', 66 66 'rsrc/css/application/differential/add-comment.css' => 'c47f8c40', 67 - 'rsrc/css/application/differential/changeset-view.css' => 'e7bd2a79', 67 + 'rsrc/css/application/differential/changeset-view.css' => '6b79bdf3', 68 68 'rsrc/css/application/differential/core.css' => '5b7b8ff4', 69 69 'rsrc/css/application/differential/phui-inline-comment.css' => 'ffd1a542', 70 70 'rsrc/css/application/differential/revision-comment.css' => '14b8565a', ··· 390 390 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 391 391 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 392 392 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 393 - 'rsrc/js/application/diff/DiffChangeset.js' => '3268dd83', 394 - 'rsrc/js/application/diff/DiffChangesetList.js' => '0a4f7809', 395 - 'rsrc/js/application/diff/DiffInline.js' => '3337c065', 393 + 'rsrc/js/application/diff/DiffChangeset.js' => '20580ec0', 394 + 'rsrc/js/application/diff/DiffChangesetList.js' => '61086d73', 395 + 'rsrc/js/application/diff/DiffInline.js' => '77e14b60', 396 + 'rsrc/js/application/diff/ScrollObjective.js' => '0eee7a00', 397 + 'rsrc/js/application/diff/ScrollObjectiveList.js' => '1ca4d9db', 396 398 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 397 - 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', 399 + 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 398 400 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 399 401 'rsrc/js/application/differential/behavior-populate.js' => '5e41c819', 400 402 'rsrc/js/application/differential/behavior-user-select.js' => 'a8d8459d', ··· 446 448 'rsrc/js/application/transactions/behavior-comment-actions.js' => '9a6dd75c', 447 449 'rsrc/js/application/transactions/behavior-reorder-configs.js' => 'd7a74243', 448 450 'rsrc/js/application/transactions/behavior-reorder-fields.js' => 'b59e1e96', 449 - 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => '94c65b72', 451 + 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'ae95d984', 450 452 'rsrc/js/application/transactions/behavior-transaction-comment-form.js' => 'b23b49e6', 451 453 'rsrc/js/application/transactions/behavior-transaction-list.js' => '1f6794f6', 452 454 'rsrc/js/application/typeahead/behavior-typeahead-browse.js' => '635de1ec', ··· 565 567 'conpherence-thread-manager' => '4d863052', 566 568 'conpherence-transaction-css' => '85129c68', 567 569 'd3' => 'a11a5ff2', 568 - 'differential-changeset-view-css' => 'e7bd2a79', 570 + 'differential-changeset-view-css' => '6b79bdf3', 569 571 'differential-core-view-css' => '5b7b8ff4', 570 572 'differential-revision-add-comment-css' => 'c47f8c40', 571 573 'differential-revision-comment-css' => '14b8565a', ··· 617 619 'javelin-behavior-device' => 'bb1dd507', 618 620 'javelin-behavior-diff-preview-link' => '051c7832', 619 621 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 620 - 'javelin-behavior-differential-feedback-preview' => 'b064af76', 622 + 'javelin-behavior-differential-feedback-preview' => '51c5ad07', 621 623 'javelin-behavior-differential-populate' => '5e41c819', 622 624 'javelin-behavior-differential-user-select' => 'a8d8459d', 623 625 'javelin-behavior-diffusion-browse-file' => '054a0f0b', ··· 665 667 'javelin-behavior-phabricator-remarkup-assist' => 'acd29eee', 666 668 'javelin-behavior-phabricator-reveal-content' => '60821bc7', 667 669 'javelin-behavior-phabricator-search-typeahead' => 'eded9ee8', 668 - 'javelin-behavior-phabricator-show-older-transactions' => '94c65b72', 670 + 'javelin-behavior-phabricator-show-older-transactions' => 'ae95d984', 669 671 'javelin-behavior-phabricator-tooltips' => 'c420b0b9', 670 672 'javelin-behavior-phabricator-transaction-comment-form' => 'b23b49e6', 671 673 'javelin-behavior-phabricator-transaction-list' => '1f6794f6', ··· 775 777 'phabricator-darklog' => 'c8e1ffe3', 776 778 'phabricator-darkmessage' => 'c48cccdd', 777 779 'phabricator-dashboard-css' => 'fe5b1869', 778 - 'phabricator-diff-changeset' => '3268dd83', 779 - 'phabricator-diff-changeset-list' => '0a4f7809', 780 - 'phabricator-diff-inline' => '3337c065', 780 + 'phabricator-diff-changeset' => '20580ec0', 781 + 'phabricator-diff-changeset-list' => '61086d73', 782 + 'phabricator-diff-inline' => '77e14b60', 781 783 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 782 784 'phabricator-draggable-list' => 'bea6e7f4', 783 785 'phabricator-fatal-config-template-css' => '8f18fa41', ··· 797 799 'phabricator-phtize' => 'd254d646', 798 800 'phabricator-prefab' => 'c5af80a2', 799 801 'phabricator-remarkup-css' => 'd1a5e11e', 802 + 'phabricator-scroll-objective' => '0eee7a00', 803 + 'phabricator-scroll-objective-list' => '1ca4d9db', 800 804 'phabricator-search-results-css' => 'f87d23ad', 801 805 'phabricator-shaped-request' => '7cbe244b', 802 806 'phabricator-slowvote-css' => 'a94b7230', ··· 973 977 'javelin-dom', 974 978 'javelin-router', 975 979 ), 976 - '0a4f7809' => array( 980 + '0eee7a00' => array( 981 + 'javelin-dom', 982 + 'javelin-util', 983 + 'javelin-stratcom', 977 984 'javelin-install', 985 + 'javelin-workflow', 978 986 ), 979 987 '0f764c35' => array( 980 988 'javelin-install', ··· 1026 1034 'javelin-request', 1027 1035 'javelin-uri', 1028 1036 ), 1037 + '1ca4d9db' => array( 1038 + 'javelin-dom', 1039 + 'javelin-util', 1040 + 'javelin-stratcom', 1041 + 'javelin-install', 1042 + 'javelin-workflow', 1043 + 'phabricator-scroll-objective', 1044 + ), 1029 1045 '1def2711' => array( 1030 1046 'javelin-install', 1031 1047 'javelin-dom', ··· 1054 1070 'javelin-install', 1055 1071 'javelin-dom', 1056 1072 ), 1073 + '20580ec0' => array( 1074 + 'javelin-dom', 1075 + 'javelin-util', 1076 + 'javelin-stratcom', 1077 + 'javelin-install', 1078 + 'javelin-workflow', 1079 + 'javelin-router', 1080 + 'javelin-behavior-device', 1081 + 'javelin-vector', 1082 + 'phabricator-diff-inline', 1083 + ), 1057 1084 '21df4ff5' => array( 1058 1085 'javelin-install', 1059 1086 'javelin-workboard-card', ··· 1111 1138 'javelin-install', 1112 1139 'javelin-dom', 1113 1140 'javelin-vector', 1114 - ), 1115 - '3268dd83' => array( 1116 - 'javelin-dom', 1117 - 'javelin-util', 1118 - 'javelin-stratcom', 1119 - 'javelin-install', 1120 - 'javelin-workflow', 1121 - 'javelin-router', 1122 - 'javelin-behavior-device', 1123 - 'javelin-vector', 1124 - 'phabricator-diff-inline', 1125 1141 ), 1126 1142 '327a00d1' => array( 1127 1143 'javelin-behavior', ··· 1129 1145 'javelin-dom', 1130 1146 'javelin-workflow', 1131 1147 ), 1132 - '3337c065' => array( 1133 - 'javelin-dom', 1134 - ), 1135 1148 '3ab51e2c' => array( 1136 1149 'javelin-behavior', 1137 1150 'javelin-behavior-device', ··· 1295 1308 'javelin-dom', 1296 1309 'javelin-reactor-dom', 1297 1310 ), 1311 + '51c5ad07' => array( 1312 + 'javelin-behavior', 1313 + 'javelin-stratcom', 1314 + 'javelin-dom', 1315 + 'javelin-request', 1316 + 'javelin-util', 1317 + 'phabricator-shaped-request', 1318 + ), 1298 1319 '522431f7' => array( 1299 1320 'javelin-behavior', 1300 1321 'javelin-util', ··· 1386 1407 'javelin-stratcom', 1387 1408 'javelin-dom', 1388 1409 ), 1410 + '61086d73' => array( 1411 + 'javelin-install', 1412 + 'phabricator-scroll-objective-list', 1413 + ), 1389 1414 '61cbc29a' => array( 1390 1415 'javelin-magical-init', 1391 1416 'javelin-util', ··· 1416 1441 'javelin-event', 1417 1442 'javelin-util', 1418 1443 'javelin-magical-init', 1444 + ), 1445 + '6b79bdf3' => array( 1446 + 'phui-inline-comment-view-css', 1419 1447 ), 1420 1448 '6b8ef10b' => array( 1421 1449 'javelin-install', ··· 1468 1496 'javelin-install', 1469 1497 'javelin-reactor', 1470 1498 'javelin-util', 1499 + ), 1500 + '77e14b60' => array( 1501 + 'javelin-dom', 1471 1502 ), 1472 1503 '782ab6e7' => array( 1473 1504 'javelin-behavior', ··· 1629 1660 'javelin-resource', 1630 1661 'javelin-routable', 1631 1662 ), 1632 - '94c65b72' => array( 1633 - 'javelin-behavior', 1634 - 'javelin-stratcom', 1635 - 'javelin-dom', 1636 - 'phabricator-busy', 1637 - ), 1638 1663 '960f6a39' => array( 1639 1664 'javelin-behavior', 1640 1665 'javelin-dom', ··· 1776 1801 'phuix-autocomplete', 1777 1802 'javelin-mask', 1778 1803 ), 1779 - 'b003d4fb' => array( 1804 + 'ae95d984' => array( 1780 1805 'javelin-behavior', 1781 1806 'javelin-stratcom', 1782 1807 'javelin-dom', 1783 - 'phuix-dropdown-menu', 1808 + 'phabricator-busy', 1784 1809 ), 1785 - 'b064af76' => array( 1810 + 'b003d4fb' => array( 1786 1811 'javelin-behavior', 1787 1812 'javelin-stratcom', 1788 1813 'javelin-dom', 1789 - 'javelin-request', 1790 - 'javelin-util', 1791 - 'phabricator-shaped-request', 1814 + 'phuix-dropdown-menu', 1792 1815 ), 1793 1816 'b1f0ccee' => array( 1794 1817 'javelin-install', ··· 2124 2147 'javelin-workflow', 2125 2148 'javelin-magical-init', 2126 2149 ), 2127 - 'e7bd2a79' => array( 2128 - 'phui-inline-comment-view-css', 2129 - ), 2130 2150 'e9581f08' => array( 2131 2151 'javelin-behavior', 2132 2152 'javelin-stratcom', ··· 2412 2432 'javelin-behavior-load-blame', 2413 2433 'javelin-behavior-differential-user-select', 2414 2434 'javelin-behavior-aphront-more', 2435 + 'phabricator-scroll-objective', 2436 + 'phabricator-scroll-objective-list', 2415 2437 'phabricator-diff-inline', 2416 2438 'phabricator-diff-changeset', 2417 2439 'phabricator-diff-changeset-list',
+3
resources/celerity/packages.php
··· 203 203 'javelin-behavior-differential-user-select', 204 204 'javelin-behavior-aphront-more', 205 205 206 + 'phabricator-scroll-objective', 207 + 'phabricator-scroll-objective-list', 208 + 206 209 'phabricator-diff-inline', 207 210 'phabricator-diff-changeset', 208 211 'phabricator-diff-changeset-list',
+2
src/applications/differential/view/DifferentialChangesetDetailView.php
··· 184 184 'loaded' => $this->getLoaded(), 185 185 'undoTemplates' => hsprintf('%s', $renderer->renderUndoTemplates()), 186 186 'path' => $display_filename, 187 + 'objectiveName' => basename($display_filename), 188 + 'icon' => 'fa-file-text-o', 187 189 ), 188 190 'class' => $class, 189 191 'id' => $id,
+11
src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
··· 99 99 'differential-inline-comment', 100 100 ); 101 101 102 + $is_fixed = false; 103 + switch ($inline->getFixedState()) { 104 + case PhabricatorInlineCommentInterface::STATE_DONE: 105 + case PhabricatorInlineCommentInterface::STATE_DRAFT: 106 + $is_fixed = true; 107 + break; 108 + } 109 + 102 110 $metadata = array( 103 111 'id' => $inline->getID(), 104 112 'phid' => $inline->getPHID(), ··· 109 117 'on_right' => $this->getIsOnRight(), 110 118 'original' => $inline->getContent(), 111 119 'replyToCommentPHID' => $inline->getReplyToCommentPHID(), 120 + 'isDraft' => $inline->isDraft(), 121 + 'isFixed' => $is_fixed, 122 + 'isGhost' => $inline->getIsGhost(), 112 123 ); 113 124 114 125 $sigil = 'differential-inline-comment';
+29
webroot/rsrc/css/application/differential/changeset-view.css
··· 404 404 .diff-banner .phui-icon-view { 405 405 margin-right: 4px; 406 406 } 407 + 408 + .scroll-objective-list { 409 + position: fixed; 410 + right: 0; 411 + width: 24px; 412 + top: 48px; 413 + bottom: 48px; 414 + z-index: 6; 415 + background: rgba(255, 255, 255, 0.50); 416 + border-style: solid; 417 + border-color: rgba(255, 255, 255, 0.95); 418 + border-width: 1px 0 1px 1px; 419 + box-shadow: -1px 0 2px rgba(255, 255, 255, 0.25); 420 + overflow: hidden; 421 + } 422 + 423 + .scroll-objective { 424 + display: block; 425 + position: absolute; 426 + box-sizing: border-box; 427 + cursor: pointer; 428 + left: 8px; 429 + } 430 + 431 + .scroll-objective .phui-icon-view { 432 + text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25); 433 + display: block; 434 + height: 14px; 435 + }
+64 -4
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 32 32 this._rightID = data.right; 33 33 34 34 this._path = data.path; 35 + this._objectiveName = data.objectiveName; 36 + this._icon = data.icon; 35 37 36 38 this._inlines = []; 37 - }, 38 - 39 - properties: { 40 - changesetList: null 41 39 }, 42 40 43 41 members: { ··· 63 61 _undoNode: null, 64 62 _path: null, 65 63 64 + _changesetList: null, 65 + _objective: null, 66 + _objectiveName: null, 67 + _icon: null, 68 + 66 69 getLeftChangesetID: function() { 67 70 return this._leftID; 68 71 }, 69 72 70 73 getRightChangesetID: function() { 71 74 return this._rightID; 75 + }, 76 + 77 + setChangesetList: function(list) { 78 + this._changesetList = list; 79 + 80 + var objectives = list.getObjectives(); 81 + this._objective = objectives.newObjective() 82 + .setAnchor(this._node); 83 + 84 + this._updateObjective(); 85 + 86 + return this; 87 + }, 88 + 89 + _updateObjective: function() { 90 + this._objective 91 + .setIcon(this.getIcon()) 92 + .setColor(this.getColor()) 93 + .setTooltip(this.getObjectiveName()); 94 + }, 95 + 96 + getIcon: function() { 97 + if (!this._visible) { 98 + return 'fa-file-o'; 99 + } 100 + 101 + return this._icon; 102 + }, 103 + 104 + getColor: function() { 105 + if (!this._visible) { 106 + return 'grey'; 107 + } 108 + 109 + return 'blue'; 110 + }, 111 + 112 + getObjectiveName: function() { 113 + return this._objectiveName; 114 + }, 115 + 116 + getChangesetList: function() { 117 + return this._changesetList; 72 118 }, 73 119 74 120 /** ··· 523 569 } 524 570 525 571 JX.Stratcom.invoke('differential-inline-comment-refresh'); 572 + 573 + this._objective.show(); 574 + this._rebuildAllInlines(); 575 + 576 + JX.Stratcom.invoke('resize'); 526 577 }, 527 578 528 579 _getContentFrame: function() { ··· 672 723 JX.DOM.appendContent(diff.parentNode, undo); 673 724 } 674 725 726 + this._updateObjective(); 727 + for (var ii = 0; ii < this._inlines.length; ii++) { 728 + this._inlines[ii].updateObjective(); 729 + } 730 + 675 731 JX.Stratcom.invoke('resize'); 732 + }, 733 + 734 + isVisible: function() { 735 + return this._visible; 676 736 }, 677 737 678 738 _getUndoNode: function() {
+28 -1
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 1 1 /** 2 2 * @provides phabricator-diff-changeset-list 3 3 * @requires javelin-install 4 + * phabricator-scroll-objective-list 4 5 * @javelin 5 6 */ 6 7 ··· 8 9 9 10 construct: function() { 10 11 this._changesets = []; 12 + this._objectives = new JX.ScrollObjectiveList(); 11 13 12 14 var onload = JX.bind(this, this._ifawake, this._onload); 13 15 JX.Stratcom.listen('click', 'differential-load', onload); ··· 100 102 _initialized: false, 101 103 _asleep: true, 102 104 _changesets: null, 105 + _objectives: null, 103 106 104 107 _cursorItem: null, 105 108 ··· 124 127 this._redrawFocus(); 125 128 this._redrawSelection(); 126 129 this.resetHover(); 130 + 131 + this._objectives.hide(); 127 132 }, 128 133 129 134 wake: function() { ··· 132 137 this._redrawFocus(); 133 138 this._redrawSelection(); 134 139 140 + this._objectives.show(); 141 + 135 142 if (this._initialized) { 136 143 return; 137 144 } ··· 190 197 191 198 isAsleep: function() { 192 199 return this._asleep; 200 + }, 201 + 202 + getObjectives: function() { 203 + return this._objectives; 193 204 }, 194 205 195 206 newChangesetForNode: function(node) { ··· 271 282 _ontoc: function(manager) { 272 283 var toc = JX.$('toc'); 273 284 manager.scrollTo(toc); 285 + }, 286 + 287 + getSelectedInline: function() { 288 + var cursor = this._cursorItem; 289 + 290 + if (cursor) { 291 + if (cursor.type == 'comment') { 292 + return cursor.target; 293 + } 294 + } 295 + 296 + return null; 274 297 }, 275 298 276 299 _onkeyreply: function(is_quote) { ··· 772 795 } else if (diffs.length == 1) { 773 796 var diff = diffs[0]; 774 797 visible_item.setDisabled(false); 775 - if (JX.Stratcom.getData(diff).hidden) { 798 + if (!changeset.isVisible()) { 776 799 visible_item 777 800 .setName(pht('Expand File')) 778 801 .setIcon('fa-expand'); ··· 836 859 // event. 837 860 e.kill(); 838 861 862 + this.selectInline(inline); 863 + }, 864 + 865 + selectInline: function(inline) { 839 866 var selection = this._getSelectionState(); 840 867 var item; 841 868
+73 -5
webroot/rsrc/js/application/diff/DiffInline.js
··· 9 9 construct : function() { 10 10 }, 11 11 12 - properties: { 13 - changeset: null 14 - }, 15 - 16 12 members: { 17 13 _id: null, 18 14 _phid: null, ··· 30 26 _isDeleted: false, 31 27 _isInvisible: false, 32 28 _isLoading: false, 29 + 30 + _changeset: null, 31 + _objective: null, 32 + 33 + _isDraft: null, 34 + _isFixed: null, 33 35 34 36 bindToRow: function(row) { 35 37 this._row = row; 38 + this._objective.setAnchor(this._row); 36 39 37 40 var row_data = JX.Stratcom.getData(row); 38 41 row_data.inline = this; 39 - 40 42 this._hidden = row_data.hidden || false; 41 43 42 44 // TODO: Get smarter about this once we do more editing, this is pretty ··· 65 67 66 68 this._replyToCommentPHID = data.replyToCommentPHID; 67 69 70 + this._isDraft = data.isDraft; 71 + this._isFixed = data.isFixed; 72 + this._isGhost = data.isGhost; 73 + 74 + this._changesetID = data.changesetID; 75 + 76 + this.updateObjective(); 68 77 this.setInvisible(false); 69 78 70 79 return this; ··· 152 161 return this; 153 162 }, 154 163 164 + setChangeset: function(changeset) { 165 + this._changeset = changeset; 166 + 167 + var objectives = changeset.getChangesetList().getObjectives(); 168 + this._objective = objectives.newObjective() 169 + .setCallback(JX.bind(this, this._onobjective)); 170 + this.updateObjective(); 171 + 172 + return this; 173 + }, 174 + 175 + getChangeset: function() { 176 + return this._changeset; 177 + }, 178 + 179 + _onobjective: function() { 180 + this.getChangeset().getChangesetList().selectInline(this); 181 + }, 182 + 183 + updateObjective: function() { 184 + var objective = this._objective; 185 + 186 + if (this.isHidden() || this._isDeleted) { 187 + objective.hide(); 188 + return; 189 + } 190 + 191 + var changeset = this.getChangeset(); 192 + if (!changeset.isVisible()) { 193 + objective.hide(); 194 + return; 195 + } 196 + 197 + var icon = 'fa-comment'; 198 + var color = 'bluegrey'; 199 + 200 + if (this._isDraft) { 201 + // This inline is an unsubmitted draft. 202 + icon = 'fa-pencil'; 203 + } else if (this._isFixed) { 204 + // This inline has been marked done. 205 + icon = 'fa-check'; 206 + color = 'grey'; 207 + } else if (this._isGhost) { 208 + icon = 'fa-comment-o'; 209 + color = 'grey'; 210 + } 211 + 212 + objective 213 + .setIcon(icon) 214 + .setColor(color) 215 + .show(); 216 + }, 217 + 155 218 canReply: function() { 156 219 if (!this._hasAction('reply')) { 157 220 return false; ··· 202 265 203 266 JX.Stratcom.getData(row).inline = this; 204 267 this._row = row; 268 + this._objective.setAnchor(this._row); 205 269 206 270 this._id = null; 207 271 this._phid = null; ··· 271 335 // as opposed to a submitted checkmark. This is different from the 272 336 // top-level "draft" state of unsubmitted comments. 273 337 JX.DOM.alterClass(comment, 'inline-state-is-draft', response.draftState); 338 + 339 + this._isFixed = response.isChecked; 274 340 275 341 this._didUpdate(); 276 342 }, ··· 632 698 if (!local_only) { 633 699 this.getChangeset().getChangesetList().redrawPreview(); 634 700 } 701 + 702 + this.updateObjective(); 635 703 636 704 this.getChangeset().getChangesetList().redrawCursor(); 637 705 this.getChangeset().getChangesetList().resetHover();
+121
webroot/rsrc/js/application/diff/ScrollObjective.js
··· 1 + /** 2 + * @provides phabricator-scroll-objective 3 + * @requires javelin-dom 4 + * javelin-util 5 + * javelin-stratcom 6 + * javelin-install 7 + * javelin-workflow 8 + * @javelin 9 + */ 10 + 11 + 12 + JX.install('ScrollObjective', { 13 + 14 + construct : function() { 15 + var node = this.getNode(); 16 + 17 + var onclick = JX.bind(this, this._onclick); 18 + JX.DOM.listen(node, 'click', null, onclick); 19 + }, 20 + 21 + members: { 22 + _list: null, 23 + 24 + _node: null, 25 + _anchor: null, 26 + 27 + _visible: false, 28 + _callback: false, 29 + 30 + getNode: function() { 31 + if (!this._node) { 32 + var attributes = { 33 + className: 'scroll-objective' 34 + }; 35 + 36 + var content = this._getIconObject().getNode(); 37 + 38 + var node = JX.$N('div', attributes, content); 39 + 40 + this._node = node; 41 + } 42 + 43 + return this._node; 44 + }, 45 + 46 + setCallback: function(callback) { 47 + this._callback = callback; 48 + return this; 49 + }, 50 + 51 + setObjectiveList: function(list) { 52 + this._list = list; 53 + return this; 54 + }, 55 + 56 + _getIconObject: function() { 57 + if (!this._iconObject) { 58 + this._iconObject = new JX.PHUIXIconView(); 59 + } 60 + return this._iconObject; 61 + }, 62 + 63 + _onclick: function(e) { 64 + (this._callback && this._callback(e)); 65 + 66 + if (e.getPrevented()) { 67 + return; 68 + } 69 + 70 + e.kill(); 71 + 72 + // This is magic to account for the banner, and should probably be made 73 + // less hard-coded. 74 + var buffer = 48; 75 + 76 + JX.DOM.scrollToPosition(null, JX.$V(this.getAnchor()).y - buffer); 77 + }, 78 + 79 + setAnchor: function(node) { 80 + this._anchor = node; 81 + return this; 82 + }, 83 + 84 + getAnchor: function() { 85 + return this._anchor; 86 + }, 87 + 88 + setIcon: function(icon) { 89 + this._getIconObject().setIcon(icon); 90 + return this; 91 + }, 92 + 93 + setColor: function(color) { 94 + this._getIconObject().setColor(color); 95 + return this; 96 + }, 97 + 98 + setTooltip: function(tip) { 99 + var node = this._getIconObject().getNode(); 100 + JX.Stratcom.addSigil(node, 'has-tooltip'); 101 + JX.Stratcom.getData(node).tip = tip; 102 + JX.Stratcom.getData(node).align = 'W'; 103 + return this; 104 + }, 105 + 106 + show: function() { 107 + this._visible = true; 108 + return this; 109 + }, 110 + 111 + hide: function() { 112 + this._visible = false; 113 + }, 114 + 115 + isVisible: function() { 116 + return this._visible; 117 + } 118 + 119 + } 120 + 121 + });
+139
webroot/rsrc/js/application/diff/ScrollObjectiveList.js
··· 1 + /** 2 + * @provides phabricator-scroll-objective-list 3 + * @requires javelin-dom 4 + * javelin-util 5 + * javelin-stratcom 6 + * javelin-install 7 + * javelin-workflow 8 + * phabricator-scroll-objective 9 + * @javelin 10 + */ 11 + 12 + 13 + JX.install('ScrollObjectiveList', { 14 + 15 + construct : function() { 16 + this._objectives = []; 17 + 18 + var onresize = JX.bind(this, this._dirty); 19 + JX.Stratcom.listen('resize', null, onresize); 20 + }, 21 + 22 + members: { 23 + _objectives: null, 24 + _visible: false, 25 + _trigger: null, 26 + 27 + newObjective: function() { 28 + var objective = new JX.ScrollObjective() 29 + .setObjectiveList(this); 30 + 31 + this._objectives.push(objective); 32 + this._getNode().appendChild(objective.getNode()); 33 + 34 + this._dirty(); 35 + 36 + return objective; 37 + }, 38 + 39 + show: function() { 40 + this._visible = true; 41 + this._dirty(); 42 + return this; 43 + }, 44 + 45 + hide: function() { 46 + this._visible = false; 47 + this._dirty(); 48 + return this; 49 + }, 50 + 51 + _getNode: function() { 52 + if (!this._node) { 53 + var node = new JX.$N('div', {className: 'scroll-objective-list'}); 54 + this._node = node; 55 + } 56 + return this._node; 57 + }, 58 + 59 + _dirty: function() { 60 + if (this._trigger !== null) { 61 + return; 62 + } 63 + 64 + this._trigger = setTimeout(JX.bind(this, this._redraw), 0); 65 + }, 66 + 67 + _redraw: function() { 68 + this._trigger = null; 69 + 70 + var node = this._getNode(); 71 + 72 + var is_visible = 73 + (this._visible) && 74 + (JX.Device.getDevice() == 'desktop') && 75 + (this._objectives.length); 76 + 77 + if (!is_visible) { 78 + JX.DOM.remove(node); 79 + return; 80 + } 81 + 82 + document.body.appendChild(node); 83 + 84 + var d = JX.Vector.getDocument(); 85 + 86 + var list_dimensions = JX.Vector.getDim(node); 87 + var icon_height = 16; 88 + var list_y = (list_dimensions.y - icon_height); 89 + 90 + var ii; 91 + var offset; 92 + 93 + // First, build a list of all the items we're going to show. 94 + var items = []; 95 + for (ii = 0; ii < this._objectives.length; ii++) { 96 + var objective = this._objectives[ii]; 97 + var objective_node = objective.getNode(); 98 + 99 + var anchor = objective.getAnchor(); 100 + if (!anchor || !objective.isVisible()) { 101 + JX.DOM.remove(objective_node); 102 + continue; 103 + } 104 + 105 + offset = (JX.$V(anchor).y / d.y) * (list_y); 106 + 107 + items.push({ 108 + offset: offset, 109 + node: objective_node 110 + }); 111 + } 112 + 113 + // Now, sort it from top to bottom. 114 + items.sort(function(u, v) { 115 + return u.offset - v.offset; 116 + }); 117 + 118 + // Lay out the items in the objective list, leaving a minimum amount 119 + // of space between them so they do not overlap. 120 + var min = null; 121 + for (ii = 0; ii < items.length; ii++) { 122 + var item = items[ii]; 123 + 124 + offset = item.offset; 125 + 126 + if (min !== null) { 127 + offset = Math.max(offset, min); 128 + } 129 + min = offset + 15; 130 + 131 + item.node.style.top = offset + 'px'; 132 + node.appendChild(item.node); 133 + } 134 + 135 + } 136 + 137 + } 138 + 139 + });
+2
webroot/rsrc/js/application/differential/behavior-comment-preview.js
··· 74 74 }); 75 75 76 76 updateLinks(); 77 + 78 + JX.Stratcom.invoke('resize'); 77 79 }) 78 80 .setTimeout(5000) 79 81 .send();
+1
webroot/rsrc/js/application/transactions/behavior-show-older-transactions.js
··· 60 60 61 61 var show_older = function(swap, r) { 62 62 JX.DOM.replace(swap, JX.$H(r.timeline).getFragment()); 63 + JX.Stratcom.invoke('resize'); 63 64 }; 64 65 65 66 var load_hidden_hash_callback = function(swap, r) {