@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 "X / Y Comments" button to Differential persistent header

Summary: Ref M1476.

Test Plan: {F4987991}

Reviewers: chad

Reviewed By: chad

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

+91 -31
+20 -20
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '1475bd91', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '1ccbf3a9', 16 - 'differential.pkg.js' => 'b2c4cbfa', 16 + 'differential.pkg.js' => '889ab0ab', 17 17 'diffusion.pkg.css' => 'b93d9b8c', 18 18 'diffusion.pkg.js' => '84c8f8fd', 19 19 'favicon.ico' => '30672e08', ··· 393 393 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 394 394 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 395 395 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 396 - 'rsrc/js/application/diff/DiffChangeset.js' => 'ee50a0ec', 397 - 'rsrc/js/application/diff/DiffChangesetList.js' => 'b4cf2217', 396 + 'rsrc/js/application/diff/DiffChangeset.js' => 'd498bddb', 397 + 'rsrc/js/application/diff/DiffChangesetList.js' => '0db8cdca', 398 398 'rsrc/js/application/diff/DiffInline.js' => '1d17130f', 399 399 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 400 400 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', ··· 772 772 'phabricator-darklog' => 'c8e1ffe3', 773 773 'phabricator-darkmessage' => 'c48cccdd', 774 774 'phabricator-dashboard-css' => 'fe5b1869', 775 - 'phabricator-diff-changeset' => 'ee50a0ec', 776 - 'phabricator-diff-changeset-list' => 'b4cf2217', 775 + 'phabricator-diff-changeset' => 'd498bddb', 776 + 'phabricator-diff-changeset-list' => '0db8cdca', 777 777 'phabricator-diff-inline' => '1d17130f', 778 778 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 779 779 'phabricator-draggable-list' => 'bea6e7f4', ··· 960 960 'javelin-dom', 961 961 'javelin-router', 962 962 ), 963 + '0db8cdca' => array( 964 + 'javelin-install', 965 + 'phuix-button-view', 966 + ), 963 967 '0f764c35' => array( 964 968 'javelin-install', 965 969 'javelin-util', ··· 1771 1775 'b3e7d692' => array( 1772 1776 'javelin-install', 1773 1777 ), 1774 - 'b4cf2217' => array( 1775 - 'javelin-install', 1776 - 'phuix-button-view', 1777 - ), 1778 1778 'b59e1e96' => array( 1779 1779 'javelin-behavior', 1780 1780 'javelin-stratcom', ··· 1978 1978 'javelin-uri', 1979 1979 'javelin-util', 1980 1980 ), 1981 + 'd498bddb' => array( 1982 + 'javelin-dom', 1983 + 'javelin-util', 1984 + 'javelin-stratcom', 1985 + 'javelin-install', 1986 + 'javelin-workflow', 1987 + 'javelin-router', 1988 + 'javelin-behavior-device', 1989 + 'javelin-vector', 1990 + 'phabricator-diff-inline', 1991 + ), 1981 1992 'd4eecc63' => array( 1982 1993 'javelin-behavior', 1983 1994 'javelin-dom', ··· 2091 2102 'edf8a145' => array( 2092 2103 'javelin-behavior', 2093 2104 'javelin-uri', 2094 - ), 2095 - 'ee50a0ec' => array( 2096 - 'javelin-dom', 2097 - 'javelin-util', 2098 - 'javelin-stratcom', 2099 - 'javelin-install', 2100 - 'javelin-workflow', 2101 - 'javelin-router', 2102 - 'javelin-behavior-device', 2103 - 'javelin-vector', 2104 - 'phabricator-diff-inline', 2105 2105 ), 2106 2106 'efe49472' => array( 2107 2107 'javelin-install',
+5 -1
webroot/rsrc/js/application/diff/DiffChangeset.js
··· 440 440 last_inline = inline; 441 441 } 442 442 443 + var is_saved = (!inline.isDraft() && !inline.isEditing()); 444 + 443 445 last_inline_item = { 444 446 type: block.type, 445 447 changeset: this, ··· 452 454 }, 453 455 attributes: { 454 456 unsaved: inline.isEditing(), 455 - unsubmitted: inline.isDraft() 457 + unsubmitted: inline.isDraft(), 458 + undone: (is_saved && !inline.isDone()), 459 + done: (is_saved && inline.isDone()) 456 460 } 457 461 }; 458 462
+66 -10
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 114 114 _bannerNode: null, 115 115 _unsavedButton: null, 116 116 _unsubmittedButton: null, 117 + _doneButton: null, 118 + _doneMode: null, 117 119 118 120 sleep: function() { 119 121 this._asleep = true; ··· 531 533 break; 532 534 } 533 535 534 - this._setSelectionState(items[cursor]); 536 + this._setSelectionState(items[cursor], true); 535 537 }, 536 538 537 539 _getSelectionState: function() { ··· 554 556 }; 555 557 }, 556 558 557 - _setSelectionState: function(item) { 559 + _setSelectionState: function(item, scroll) { 558 560 this._cursorItem = item; 559 - this._redrawSelection(true); 561 + this._redrawSelection(scroll); 560 562 561 563 return this; 562 564 }, ··· 598 600 599 601 var state = this._getSelectionState(); 600 602 if (state.cursor !== null) { 601 - this._setSelectionState(state.items[state.cursor]); 603 + this._setSelectionState(state.items[state.cursor], false); 602 604 } 603 605 }, 604 606 ··· 910 912 if (selection.cursor !== null) { 911 913 item = selection.items[selection.cursor]; 912 914 if (item.target === inline) { 913 - this._setSelectionState(null); 915 + this._setSelectionState(null, false); 914 916 return; 915 917 } 916 918 } ··· 922 924 for (var ii = 0; ii < items.length; ii++) { 923 925 item = items[ii]; 924 926 if (item.target === inline) { 925 - this._setSelectionState(item); 927 + this._setSelectionState(item, false); 926 928 } 927 929 } 928 930 }, ··· 1339 1341 var unsaved = []; 1340 1342 var unsubmitted = []; 1341 1343 var undone = []; 1342 - var all = []; 1344 + var done = []; 1343 1345 1344 1346 for (var ii = 0; ii < changesets.length; ii++) { 1345 1347 var inlines = changesets[ii].getInlines(); ··· 1350 1352 continue; 1351 1353 } 1352 1354 1353 - all.push(inline); 1354 - 1355 1355 if (inline.isEditing()) { 1356 1356 unsaved.push(inline); 1357 1357 } else if (inline.isDraft()) { 1358 1358 unsubmitted.push(inline); 1359 1359 } else if (!inline.isDone()) { 1360 1360 undone.push(inline); 1361 + } else { 1362 + done.push(inline); 1361 1363 } 1362 1364 } 1363 1365 } ··· 1375 1377 var pht = this.getTranslations(); 1376 1378 var unsaved_button = this._getUnsavedButton(); 1377 1379 var unsubmitted_button = this._getUnsubmittedButton(); 1380 + var done_button = this._getDoneButton(); 1378 1381 1379 1382 if (unsaved.length) { 1380 1383 unsaved_button.setText(unsaved.length + ' ' + pht('Unsaved')); ··· 1391 1394 JX.DOM.hide(unsubmitted_button.getNode()); 1392 1395 } 1393 1396 1397 + if (done.length || undone.length) { 1398 + done_button.setText([ 1399 + done.length, 1400 + ' / ', 1401 + (done.length + undone.length), 1402 + ' ', 1403 + pht('Comments') 1404 + ]); 1405 + 1406 + JX.DOM.show(done_button.getNode()); 1407 + 1408 + // If any comments are not marked "Done", this cycles through the 1409 + // missing comments. Otherwise, it cycles through all the saved 1410 + // comments. 1411 + if (undone.length) { 1412 + this._doneMode = 'undone'; 1413 + } else { 1414 + this._doneMode = 'done'; 1415 + } 1416 + 1417 + } else { 1418 + JX.DOM.hide(done_button.getNode()); 1419 + } 1420 + 1394 1421 var path_view = [icon, ' ', changeset.getDisplayPath()]; 1395 1422 1396 1423 var buttons_attrs = { ··· 1399 1426 1400 1427 var buttons_list = [ 1401 1428 unsaved_button.getNode(), 1402 - unsubmitted_button.getNode() 1429 + unsubmitted_button.getNode(), 1430 + done_button.getNode() 1403 1431 ]; 1404 1432 1405 1433 var buttons_view = JX.$N('div', buttons_attrs, buttons_list); ··· 1446 1474 return this._unsubmittedButton; 1447 1475 }, 1448 1476 1477 + _getDoneButton: function() { 1478 + if (!this._doneButton) { 1479 + var button = new JX.PHUIXButtonView() 1480 + .setIcon('fa-comment') 1481 + .setButtonType(JX.PHUIXButtonView.BUTTONTYPE_SIMPLE); 1482 + 1483 + var node = button.getNode(); 1484 + 1485 + var ondone = JX.bind(this, this._ondoneclick); 1486 + JX.DOM.listen(node, 'click', null, ondone); 1487 + 1488 + this._doneButton = button; 1489 + } 1490 + 1491 + return this._doneButton; 1492 + }, 1449 1493 _onunsavedclick: function(e) { 1450 1494 e.kill(); 1451 1495 ··· 1465 1509 filter: 'comment', 1466 1510 wrap: true, 1467 1511 attribute: 'unsubmitted' 1512 + }; 1513 + 1514 + this._onjumpkey(1, options); 1515 + }, 1516 + 1517 + _ondoneclick: function(e) { 1518 + e.kill(); 1519 + 1520 + var options = { 1521 + filter: 'comment', 1522 + wrap: true, 1523 + attribute: this._doneMode 1468 1524 }; 1469 1525 1470 1526 this._onjumpkey(1, options);