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

Remove Differential "objectives" UI

Summary: Ref T12733. Completely removes the objectives UI.

Test Plan:
- Grepped for `objective`, etc.
- Browsed revisions, no JS errors / broken stuff.
- (If I missed anything, it's likely to turn up in followup changes.)

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12733

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

+44 -556
+43 -66
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => 'ff161f2d', 11 11 'conpherence.pkg.js' => 'b5b51108', 12 - 'core.pkg.css' => '525ecd1c', 12 + 'core.pkg.css' => 'bb7f0446', 13 13 'core.pkg.js' => '1475bd91', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 - 'differential.pkg.css' => '7d4cfa59', 16 - 'differential.pkg.js' => '1d120743', 15 + 'differential.pkg.css' => '9ebe4f44', 16 + 'differential.pkg.js' => '78b8497f', 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' => 'acfd58f6', 67 + 'rsrc/css/application/differential/changeset-view.css' => '2971e2a2', 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', ··· 117 117 'rsrc/css/core/core.css' => '9f4cb463', 118 118 'rsrc/css/core/remarkup.css' => 'd1a5e11e', 119 119 'rsrc/css/core/syntax.css' => 'cae95e89', 120 - 'rsrc/css/core/z-index.css' => '998f3ce1', 120 + 'rsrc/css/core/z-index.css' => '9d8f7c4b', 121 121 'rsrc/css/diviner/diviner-shared.css' => '896f1d43', 122 122 'rsrc/css/font/font-awesome.css' => 'e838e088', 123 123 'rsrc/css/font/font-lato.css' => 'c7ccd872', ··· 391 391 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 392 392 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 393 393 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 394 - 'rsrc/js/application/diff/DiffChangeset.js' => 'cf4e2140', 395 - 'rsrc/js/application/diff/DiffChangesetList.js' => '7a184082', 396 - 'rsrc/js/application/diff/DiffInline.js' => '19582231', 397 - 'rsrc/js/application/diff/ScrollObjective.js' => '7e8877e7', 398 - 'rsrc/js/application/diff/ScrollObjectiveList.js' => '6120e99a', 394 + 'rsrc/js/application/diff/DiffChangeset.js' => '3359ad02', 395 + 'rsrc/js/application/diff/DiffChangesetList.js' => '675f1ca3', 396 + 'rsrc/js/application/diff/DiffInline.js' => '45d37835', 399 397 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 400 398 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 401 399 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 402 - 'rsrc/js/application/differential/behavior-populate.js' => '1de8bf63', 400 + 'rsrc/js/application/differential/behavior-populate.js' => '5e41c819', 403 401 'rsrc/js/application/differential/behavior-user-select.js' => 'a8d8459d', 404 402 'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => 'c93358e3', 405 403 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a', ··· 568 566 'conpherence-thread-manager' => '4d863052', 569 567 'conpherence-transaction-css' => '85129c68', 570 568 'd3' => 'a11a5ff2', 571 - 'differential-changeset-view-css' => 'acfd58f6', 569 + 'differential-changeset-view-css' => '2971e2a2', 572 570 'differential-core-view-css' => '5b7b8ff4', 573 571 'differential-revision-add-comment-css' => 'c47f8c40', 574 572 'differential-revision-comment-css' => '14b8565a', ··· 622 620 'javelin-behavior-diff-preview-link' => '051c7832', 623 621 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 624 622 'javelin-behavior-differential-feedback-preview' => '51c5ad07', 625 - 'javelin-behavior-differential-populate' => '1de8bf63', 623 + 'javelin-behavior-differential-populate' => '5e41c819', 626 624 'javelin-behavior-differential-user-select' => 'a8d8459d', 627 625 'javelin-behavior-diffusion-browse-file' => '054a0f0b', 628 626 'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04', ··· 779 777 'phabricator-darklog' => 'c8e1ffe3', 780 778 'phabricator-darkmessage' => 'c48cccdd', 781 779 'phabricator-dashboard-css' => 'fe5b1869', 782 - 'phabricator-diff-changeset' => 'cf4e2140', 783 - 'phabricator-diff-changeset-list' => '7a184082', 784 - 'phabricator-diff-inline' => '19582231', 780 + 'phabricator-diff-changeset' => '3359ad02', 781 + 'phabricator-diff-changeset-list' => '675f1ca3', 782 + 'phabricator-diff-inline' => '45d37835', 785 783 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 786 784 'phabricator-draggable-list' => 'bea6e7f4', 787 785 'phabricator-fatal-config-template-css' => '8f18fa41', ··· 801 799 'phabricator-phtize' => 'd254d646', 802 800 'phabricator-prefab' => 'c5af80a2', 803 801 'phabricator-remarkup-css' => 'd1a5e11e', 804 - 'phabricator-scroll-objective' => '7e8877e7', 805 - 'phabricator-scroll-objective-list' => '6120e99a', 806 802 'phabricator-search-results-css' => '8f8e08ed', 807 803 'phabricator-shaped-request' => '7cbe244b', 808 804 'phabricator-slowvote-css' => 'a94b7230', ··· 822 818 'phabricator-uiexample-reactor-select' => 'a155550f', 823 819 'phabricator-uiexample-reactor-sendclass' => '1def2711', 824 820 'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee', 825 - 'phabricator-zindex-css' => '998f3ce1', 821 + 'phabricator-zindex-css' => '9d8f7c4b', 826 822 'phame-css' => 'b3a0b3a3', 827 823 'pholio-css' => 'ca89d380', 828 824 'pholio-edit-css' => '07676f51', ··· 1002 998 '185bbd53' => array( 1003 999 'javelin-install', 1004 1000 ), 1005 - 19582231 => array( 1006 - 'javelin-dom', 1007 - ), 1008 1001 '19f9369b' => array( 1009 1002 'phui-oi-list-view-css', 1010 1003 ), ··· 1025 1018 'javelin-vector', 1026 1019 'javelin-request', 1027 1020 'javelin-uri', 1028 - ), 1029 - '1de8bf63' => array( 1030 - 'javelin-behavior', 1031 - 'javelin-dom', 1032 - 'javelin-stratcom', 1033 - 'phabricator-tooltip', 1034 - 'phabricator-diff-changeset-list', 1035 - 'phabricator-diff-changeset', 1036 1021 ), 1037 1022 '1def2711' => array( 1038 1023 'javelin-install', ··· 1087 1072 'javelin-install', 1088 1073 'javelin-util', 1089 1074 ), 1075 + '2971e2a2' => array( 1076 + 'phui-inline-comment-view-css', 1077 + ), 1090 1078 '2ae077e1' => array( 1091 1079 'javelin-behavior', 1092 1080 'javelin-dom', ··· 1122 1110 'javelin-dom', 1123 1111 'javelin-workflow', 1124 1112 ), 1113 + '3359ad02' => array( 1114 + 'javelin-dom', 1115 + 'javelin-util', 1116 + 'javelin-stratcom', 1117 + 'javelin-install', 1118 + 'javelin-workflow', 1119 + 'javelin-router', 1120 + 'javelin-behavior-device', 1121 + 'javelin-vector', 1122 + 'phabricator-diff-inline', 1123 + ), 1125 1124 '358b8c04' => array( 1126 1125 'javelin-install', 1127 1126 'javelin-util', ··· 1202 1201 ), 1203 1202 '453c5375' => array( 1204 1203 'javelin-behavior', 1204 + 'javelin-dom', 1205 + ), 1206 + '45d37835' => array( 1205 1207 'javelin-dom', 1206 1208 ), 1207 1209 '469c0d9e' => array( ··· 1371 1373 'phabricator-phtize', 1372 1374 'javelin-dom', 1373 1375 ), 1376 + '5e41c819' => array( 1377 + 'javelin-behavior', 1378 + 'javelin-dom', 1379 + 'javelin-stratcom', 1380 + 'phabricator-tooltip', 1381 + 'phabricator-diff-changeset-list', 1382 + 'phabricator-diff-changeset', 1383 + ), 1374 1384 '5e9f347c' => array( 1375 1385 'javelin-behavior', 1376 1386 'multirow-row-manager', ··· 1388 1398 'javelin-stratcom', 1389 1399 'javelin-dom', 1390 1400 ), 1391 - '6120e99a' => array( 1392 - 'javelin-dom', 1393 - 'javelin-util', 1394 - 'javelin-stratcom', 1395 - 'javelin-install', 1396 - 'javelin-workflow', 1397 - 'javelin-scrollbar', 1398 - 'phabricator-scroll-objective', 1399 - ), 1400 1401 '61cbc29a' => array( 1401 1402 'javelin-magical-init', 1402 1403 'javelin-util', ··· 1410 1411 'javelin-stratcom', 1411 1412 'javelin-workflow', 1412 1413 'javelin-dom', 1414 + ), 1415 + '675f1ca3' => array( 1416 + 'javelin-install', 1413 1417 ), 1414 1418 '680ea2c8' => array( 1415 1419 'javelin-install', ··· 1496 1500 'javelin-behavior', 1497 1501 'javelin-quicksand', 1498 1502 ), 1499 - '7a184082' => array( 1500 - 'javelin-install', 1501 - 'phabricator-scroll-objective-list', 1502 - ), 1503 1503 '7a68dda3' => array( 1504 1504 'owners-path-editor', 1505 1505 'javelin-behavior', ··· 1512 1512 ), 1513 1513 '7e41274a' => array( 1514 1514 'javelin-install', 1515 - ), 1516 - '7e8877e7' => array( 1517 - 'javelin-dom', 1518 - 'javelin-util', 1519 - 'javelin-stratcom', 1520 - 'javelin-install', 1521 - 'javelin-workflow', 1522 1515 ), 1523 1516 '7ebaeed3' => array( 1524 1517 'herald-rule-editor', ··· 1786 1779 'javelin-vector', 1787 1780 'phuix-autocomplete', 1788 1781 'javelin-mask', 1789 - ), 1790 - 'acfd58f6' => array( 1791 - 'phui-inline-comment-view-css', 1792 1782 ), 1793 1783 'ae95d984' => array( 1794 1784 'javelin-behavior', ··· 2002 1992 'cd2b9b77' => array( 2003 1993 'phui-oi-list-view-css', 2004 1994 ), 2005 - 'cf4e2140' => array( 2006 - 'javelin-dom', 2007 - 'javelin-util', 2008 - 'javelin-stratcom', 2009 - 'javelin-install', 2010 - 'javelin-workflow', 2011 - 'javelin-router', 2012 - 'javelin-behavior-device', 2013 - 'javelin-vector', 2014 - 'phabricator-diff-inline', 2015 - ), 2016 1995 'd0a99ab4' => array( 2017 1996 'javelin-behavior', 2018 1997 'javelin-typeahead-ondemand-source', ··· 2435 2414 'javelin-behavior-load-blame', 2436 2415 'javelin-behavior-differential-user-select', 2437 2416 'javelin-behavior-aphront-more', 2438 - 'phabricator-scroll-objective', 2439 - 'phabricator-scroll-objective-list', 2440 2417 'phabricator-diff-inline', 2441 2418 'phabricator-diff-changeset', 2442 2419 '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 - 209 206 'phabricator-diff-inline', 210 207 'phabricator-diff-changeset', 211 208 'phabricator-diff-changeset-list',
-1
src/applications/differential/view/DifferentialChangesetDetailView.php
··· 204 204 'loaded' => $this->getLoaded(), 205 205 'undoTemplates' => hsprintf('%s', $renderer->renderUndoTemplates()), 206 206 'displayPath' => hsprintf('%s', $display_parts), 207 - 'objectiveName' => basename($display_filename), 208 207 'icon' => $display_icon, 209 208 ), 210 209 'class' => $class,
-4
src/applications/differential/view/DifferentialChangesetListView.php
··· 203 203 204 204 $this->requireResource('aphront-tooltip-css'); 205 205 206 - $show_objectives = 207 - PhabricatorEnv::getEnvConfig('phabricator.show-prototypes'); 208 - 209 206 $this->initBehavior( 210 207 'differential-populate', 211 208 array( 212 209 'changesetViewIDs' => $ids, 213 210 'inlineURI' => $this->inlineURI, 214 - 'showObjectives' => $show_objectives, 215 211 'pht' => array( 216 212 'Open in Editor' => pht('Open in Editor'), 217 213 'Show All Context' => pht('Show All Context'),
-34
webroot/rsrc/css/application/differential/changeset-view.css
··· 408 408 .diff-banner-path { 409 409 color: {$greytext}; 410 410 } 411 - 412 - .scroll-objective-list { 413 - position: fixed; 414 - right: 0; 415 - width: 24px; 416 - top: 48px; 417 - bottom: 48px; 418 - background: rgba(255, 255, 255, 0.50); 419 - border-style: solid; 420 - border-color: rgba(255, 255, 255, 0.95); 421 - border-width: 1px 0 1px 1px; 422 - box-shadow: -1px 0 2px rgba(255, 255, 255, 0.10); 423 - overflow: hidden; 424 - } 425 - 426 - .scroll-objective-list.has-aesthetic-scrollbar { 427 - /* For now, hide this element on systems with aesthetic scrollbars. */ 428 - display: none; 429 - } 430 - 431 - .scroll-objective { 432 - display: block; 433 - position: absolute; 434 - box-sizing: border-box; 435 - cursor: pointer; 436 - text-align: middle; 437 - left: 7px; 438 - } 439 - 440 - .scroll-objective .phui-icon-view { 441 - text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25); 442 - display: block; 443 - height: 14px; 444 - }
-4
webroot/rsrc/css/core/z-index.css
··· 97 97 z-index: 6; 98 98 } 99 99 100 - .scroll-objective-list { 101 - z-index: 6; 102 - } 103 - 104 100 .conpherence-durable-column { 105 101 z-index: 7; 106 102 }
-27
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 32 32 this._rightID = data.right; 33 33 34 34 this._displayPath = JX.$H(data.displayPath); 35 - this._objectiveName = data.objectiveName; 36 35 this._icon = data.icon; 37 36 38 37 this._inlines = []; ··· 62 61 _displayPath: null, 63 62 64 63 _changesetList: null, 65 - _objective: null, 66 - _objectiveName: null, 67 64 _icon: null, 68 65 69 66 getLeftChangesetID: function() { ··· 76 73 77 74 setChangesetList: function(list) { 78 75 this._changesetList = list; 79 - 80 - var objectives = list.getObjectives(); 81 - this._objective = objectives.newObjective() 82 - .setAnchor(this._node); 83 - 84 - this._updateObjective(); 85 - 86 76 return this; 87 77 }, 88 78 89 - _updateObjective: function() { 90 - this._objective 91 - .setIcon(this.getIcon()) 92 - .setColor(this.getColor()) 93 - .setTooltip(this.getObjectiveName()); 94 - }, 95 - 96 79 getIcon: function() { 97 80 if (!this._visible) { 98 81 return 'fa-file-o'; ··· 107 90 } 108 91 109 92 return 'blue'; 110 - }, 111 - 112 - getObjectiveName: function() { 113 - return this._objectiveName; 114 93 }, 115 94 116 95 getChangesetList: function() { ··· 576 555 577 556 JX.Stratcom.invoke('differential-inline-comment-refresh'); 578 557 579 - this._objective.show(); 580 558 this._rebuildAllInlines(); 581 559 582 560 JX.Stratcom.invoke('resize'); ··· 727 705 } else { 728 706 JX.DOM.hide(diff); 729 707 JX.DOM.appendContent(diff.parentNode, undo); 730 - } 731 - 732 - this._updateObjective(); 733 - for (var ii = 0; ii < this._inlines.length; ii++) { 734 - this._inlines[ii].updateObjective(); 735 708 } 736 709 737 710 JX.Stratcom.invoke('resize');
-34
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 5 4 * @javelin 6 5 */ 7 6 ··· 9 8 10 9 construct: function() { 11 10 this._changesets = []; 12 - this._objectives = new JX.ScrollObjectiveList(); 13 11 14 12 var onload = JX.bind(this, this._ifawake, this._onload); 15 13 JX.Stratcom.listen('click', 'differential-load', onload); ··· 102 100 _initialized: false, 103 101 _asleep: true, 104 102 _changesets: null, 105 - _objectives: null, 106 103 107 104 _cursorItem: null, 108 105 ··· 120 117 _rangeTarget: null, 121 118 122 119 _bannerNode: null, 123 - _showObjectives: false, 124 120 125 121 sleep: function() { 126 122 this._asleep = true; ··· 128 124 this._redrawFocus(); 129 125 this._redrawSelection(); 130 126 this.resetHover(); 131 - 132 - this._objectives.hide(); 133 127 }, 134 128 135 129 wake: function() { ··· 137 131 138 132 this._redrawFocus(); 139 133 this._redrawSelection(); 140 - 141 - if (this._showObjectives) { 142 - this._objectives.show(); 143 - } 144 134 145 135 if (this._initialized) { 146 136 return; ··· 198 188 this._installKey('q', label, this._onkeyhide); 199 189 }, 200 190 201 - setShowObjectives: function(show) { 202 - this._showObjectives = show; 203 - return this; 204 - }, 205 - 206 191 isAsleep: function() { 207 192 return this._asleep; 208 - }, 209 - 210 - getObjectives: function() { 211 - return this._objectives; 212 193 }, 213 194 214 195 newChangesetForNode: function(node) { ··· 538 519 }, 539 520 540 521 _setSelectionState: function(item, manager) { 541 - // If we had an inline selected before, we need to update it after 542 - // changing our selection to clear the selected state. Then, update the 543 - // new one to add the selected state. 544 - var old_inline = this.getSelectedInline(); 545 - 546 522 this._cursorItem = item; 547 523 this._redrawSelection(manager, true); 548 - 549 - var new_inline = this.getSelectedInline(); 550 - 551 - if (old_inline) { 552 - old_inline.updateObjective(); 553 - } 554 - 555 - if (new_inline) { 556 - new_inline.updateObjective(); 557 - } 558 524 559 525 return this; 560 526 },
-90
webroot/rsrc/js/application/diff/DiffInline.js
··· 29 29 _isLoading: false, 30 30 31 31 _changeset: null, 32 - _objective: null, 33 32 34 33 _isDraft: null, 35 34 _isFixed: null, ··· 38 37 39 38 bindToRow: function(row) { 40 39 this._row = row; 41 - this._objective.setAnchor(this._row); 42 40 43 41 var row_data = JX.Stratcom.getData(row); 44 42 row_data.inline = this; ··· 79 77 this._snippet = data.snippet; 80 78 81 79 this.setInvisible(false); 82 - 83 - this.updateObjective(); 84 80 85 81 return this; 86 82 }, ··· 171 167 172 168 setChangeset: function(changeset) { 173 169 this._changeset = changeset; 174 - 175 - var objectives = changeset.getChangesetList().getObjectives(); 176 - 177 - // Create this inline's objective, but don't show it yet. 178 - this._objective = objectives.newObjective() 179 - .setCallback(JX.bind(this, this._onobjective)) 180 - .hide(); 181 - 182 170 return this; 183 171 }, 184 172 ··· 188 176 189 177 setEditing: function(editing) { 190 178 this._isEditing = editing; 191 - this.updateObjective(); 192 179 return this; 193 180 }, 194 181 195 - _onobjective: function() { 196 - this.getChangeset().getChangesetList().selectInline(this); 197 - }, 198 - 199 - updateObjective: function() { 200 - var objective = this._objective; 201 - 202 - if (this.isHidden() || this._isDeleted) { 203 - objective.hide(); 204 - return; 205 - } 206 - 207 - // If this is a new comment which we aren't editing, don't show anything: 208 - // the use started a comment or reply, then cancelled it. 209 - if (this._isNew && !this._isEditing) { 210 - objective.hide(); 211 - return; 212 - } 213 - 214 - var changeset = this.getChangeset(); 215 - if (!changeset.isVisible()) { 216 - objective.hide(); 217 - return; 218 - } 219 - 220 - var pht = changeset.getChangesetList().getTranslations(); 221 - 222 - var icon = 'fa-comment'; 223 - var color = 'bluegrey'; 224 - var tooltip = this._snippet; 225 - var anchor = this._row; 226 - var should_stack = false; 227 - 228 - if (this._isEditing) { 229 - icon = 'fa-star'; 230 - color = 'pink'; 231 - tooltip = pht('Editing Comment'); 232 - 233 - // If we're editing, anchor to the row with the editor instead of the 234 - // actual comment row (which is invisible and can have a misleading 235 - // position). 236 - anchor = this._row.nextSibling; 237 - } else if (this._isDraft) { 238 - // This inline is an unsubmitted draft. 239 - icon = 'fa-pencil'; 240 - color = 'indigo'; 241 - } else if (this._isFixed) { 242 - // This inline has been marked done. 243 - icon = 'fa-check'; 244 - color = 'grey'; 245 - } else if (this._isGhost) { 246 - icon = 'fa-comment-o'; 247 - color = 'grey'; 248 - } else if (this._replyToCommentPHID) { 249 - icon = 'fa-reply'; 250 - should_stack = true; 251 - } 252 - 253 - if (changeset.getChangesetList().getSelectedInline() === this) { 254 - // TODO: Maybe add some other kind of effect here, since we're only 255 - // using color to show this? 256 - color = 'yellow'; 257 - } 258 - 259 - 260 - objective 261 - .setAnchor(anchor) 262 - .setIcon(icon) 263 - .setColor(color) 264 - .setTooltip(tooltip) 265 - .setShouldStack(should_stack) 266 - .show(); 267 - }, 268 - 269 182 canReply: function() { 270 183 if (!this._hasAction('reply')) { 271 184 return false; ··· 316 229 317 230 JX.Stratcom.getData(row).inline = this; 318 231 this._row = row; 319 - this._objective.setAnchor(this._row); 320 232 321 233 this._id = null; 322 234 this._phid = null; ··· 758 670 if (!local_only) { 759 671 this.getChangeset().getChangesetList().redrawPreview(); 760 672 } 761 - 762 - this.updateObjective(); 763 673 764 674 this.getChangeset().getChangesetList().redrawCursor(); 765 675 this.getChangeset().getChangesetList().resetHover();
-141
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 - _stack: false, 30 - 31 - getNode: function() { 32 - if (!this._node) { 33 - var attributes = { 34 - className: 'scroll-objective' 35 - }; 36 - 37 - var content = this._getIconObject().getNode(); 38 - 39 - var node = JX.$N('div', attributes, content); 40 - 41 - this._node = node; 42 - } 43 - 44 - return this._node; 45 - }, 46 - 47 - setCallback: function(callback) { 48 - this._callback = callback; 49 - return this; 50 - }, 51 - 52 - setObjectiveList: function(list) { 53 - this._list = list; 54 - return this; 55 - }, 56 - 57 - _getIconObject: function() { 58 - if (!this._iconObject) { 59 - this._iconObject = new JX.PHUIXIconView(); 60 - } 61 - return this._iconObject; 62 - }, 63 - 64 - _onclick: function(e) { 65 - (this._callback && this._callback(e)); 66 - 67 - if (e.getPrevented()) { 68 - return; 69 - } 70 - 71 - e.kill(); 72 - 73 - // This is magic to account for the banner, and should probably be made 74 - // less hard-coded. 75 - var buffer = 48; 76 - 77 - JX.DOM.scrollToPosition(null, JX.$V(this.getAnchor()).y - buffer); 78 - }, 79 - 80 - setAnchor: function(node) { 81 - this._anchor = node; 82 - return this; 83 - }, 84 - 85 - getAnchor: function() { 86 - return this._anchor; 87 - }, 88 - 89 - setIcon: function(icon) { 90 - this._getIconObject().setIcon(icon); 91 - return this; 92 - }, 93 - 94 - setColor: function(color) { 95 - this._getIconObject().setColor(color); 96 - return this; 97 - }, 98 - 99 - setTooltip: function(tip) { 100 - var node = this._getIconObject().getNode(); 101 - JX.Stratcom.addSigil(node, 'has-tooltip'); 102 - JX.Stratcom.getData(node).tip = tip; 103 - JX.Stratcom.getData(node).align = 'W'; 104 - JX.Stratcom.getData(node).size = 'auto'; 105 - return this; 106 - }, 107 - 108 - 109 - /** 110 - * Should this objective always stack immediately under the previous 111 - * objective? 112 - * 113 - * This allows related objectives (like "comment, reply, reply") to be 114 - * rendered in a tight sequence. 115 - */ 116 - setShouldStack: function(stack) { 117 - this._stack = stack; 118 - return this; 119 - }, 120 - 121 - shouldStack: function() { 122 - return this._stack; 123 - }, 124 - 125 - show: function() { 126 - this._visible = true; 127 - return this; 128 - }, 129 - 130 - hide: function() { 131 - this._visible = false; 132 - return this; 133 - }, 134 - 135 - isVisible: function() { 136 - return this._visible; 137 - } 138 - 139 - } 140 - 141 - });
-150
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 - * javelin-scrollbar 9 - * phabricator-scroll-objective 10 - * @javelin 11 - */ 12 - 13 - 14 - JX.install('ScrollObjectiveList', { 15 - 16 - construct : function() { 17 - this._objectives = []; 18 - 19 - var onresize = JX.bind(this, this._dirty); 20 - JX.Stratcom.listen('resize', null, onresize); 21 - }, 22 - 23 - members: { 24 - _objectives: null, 25 - _visible: false, 26 - _trigger: null, 27 - 28 - newObjective: function() { 29 - var objective = new JX.ScrollObjective() 30 - .setObjectiveList(this); 31 - 32 - this._objectives.push(objective); 33 - this._getNode().appendChild(objective.getNode()); 34 - 35 - this._dirty(); 36 - 37 - return objective; 38 - }, 39 - 40 - show: function() { 41 - this._visible = true; 42 - this._dirty(); 43 - return this; 44 - }, 45 - 46 - hide: function() { 47 - this._visible = false; 48 - this._dirty(); 49 - return this; 50 - }, 51 - 52 - _getNode: function() { 53 - if (!this._node) { 54 - var node = new JX.$N('div', {className: 'scroll-objective-list'}); 55 - this._node = node; 56 - } 57 - return this._node; 58 - }, 59 - 60 - _dirty: function() { 61 - if (this._trigger !== null) { 62 - return; 63 - } 64 - 65 - this._trigger = setTimeout(JX.bind(this, this._redraw), 0); 66 - }, 67 - 68 - _redraw: function() { 69 - this._trigger = null; 70 - 71 - var node = this._getNode(); 72 - 73 - var is_visible = 74 - (this._visible) && 75 - (JX.Device.getDevice() == 'desktop') && 76 - (this._objectives.length); 77 - 78 - if (!is_visible) { 79 - JX.DOM.remove(node); 80 - return; 81 - } 82 - 83 - document.body.appendChild(node); 84 - 85 - // If we're on OSX without a mouse or some other system with zero-width 86 - // trackpad-style scrollbars, adjust the display appropriately. 87 - var aesthetic = (JX.Scrollbar.getScrollbarControlWidth() === 0); 88 - JX.DOM.alterClass(node, 'has-aesthetic-scrollbar', aesthetic); 89 - 90 - var d = JX.Vector.getDocument(); 91 - 92 - var list_dimensions = JX.Vector.getDim(node); 93 - var icon_height = 16; 94 - var list_y = (list_dimensions.y - icon_height); 95 - 96 - var ii; 97 - var offset; 98 - 99 - // First, build a list of all the items we're going to show. 100 - var items = []; 101 - for (ii = 0; ii < this._objectives.length; ii++) { 102 - var objective = this._objectives[ii]; 103 - var objective_node = objective.getNode(); 104 - 105 - var anchor = objective.getAnchor(); 106 - if (!anchor || !objective.isVisible()) { 107 - JX.DOM.remove(objective_node); 108 - continue; 109 - } 110 - 111 - offset = (JX.$V(anchor).y / d.y) * (list_y); 112 - 113 - items.push({ 114 - offset: offset, 115 - node: objective_node, 116 - objective: objective 117 - }); 118 - } 119 - 120 - // Now, sort it from top to bottom. 121 - items.sort(function(u, v) { 122 - return u.offset - v.offset; 123 - }); 124 - 125 - // Lay out the items in the objective list, leaving a minimum amount 126 - // of space between them so they do not overlap. 127 - var min = null; 128 - for (ii = 0; ii < items.length; ii++) { 129 - var item = items[ii]; 130 - 131 - offset = item.offset; 132 - 133 - if (min !== null) { 134 - if (item.objective.shouldStack()) { 135 - offset = min; 136 - } else { 137 - offset = Math.max(offset, min); 138 - } 139 - } 140 - min = offset + 15; 141 - 142 - item.node.style.top = offset + 'px'; 143 - node.appendChild(item.node); 144 - } 145 - 146 - } 147 - 148 - } 149 - 150 - });
+1 -2
webroot/rsrc/js/application/differential/behavior-populate.js
··· 60 60 61 61 var changeset_list = new JX.DiffChangesetList() 62 62 .setTranslations(JX.phtize(config.pht)) 63 - .setInlineURI(config.inlineURI) 64 - .setShowObjectives(config.showObjectives); 63 + .setInlineURI(config.inlineURI); 65 64 66 65 // Install and activate the current page. 67 66 var page_id = JX.Quicksand.getCurrentPageID();