1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Add button to reveal all files in Differential

Summary: D2216 tried to ask the user, this one is explicit.

Test Plan: Click the button

Reviewers: epriestley, lucian

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2600
This commit is contained in:
vrana 2012-05-29 18:20:11 -07:00
parent 5e49de7b35
commit 9c2b67e2dc
4 changed files with 82 additions and 54 deletions

View file

@ -646,7 +646,7 @@ celerity_register_resource_map(array(
),
'differential-table-of-contents-css' =>
array(
'uri' => '/res/2a4137ef/rsrc/css/application/differential/table-of-contents.css',
'uri' => '/res/0ac99a19/rsrc/css/application/differential/table-of-contents.css',
'type' => 'css',
'requires' =>
array(
@ -956,7 +956,7 @@ celerity_register_resource_map(array(
),
'javelin-behavior-differential-dropdown-menus' =>
array(
'uri' => '/res/2549921f/rsrc/js/application/differential/behavior-dropdown-menus.js',
'uri' => '/res/1eb46d36/rsrc/js/application/differential/behavior-dropdown-menus.js',
'type' => 'js',
'requires' =>
array(
@ -2555,7 +2555,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/0c96375e/core.pkg.js',
'type' => 'js',
),
'5ed00902' =>
'32f461a4' =>
array(
'name' => 'differential.pkg.css',
'symbols' =>
@ -2574,10 +2574,10 @@ celerity_register_resource_map(array(
11 => 'differential-local-commits-view-css',
12 => 'inline-comment-summary-css',
),
'uri' => '/res/pkg/5ed00902/differential.pkg.css',
'uri' => '/res/pkg/32f461a4/differential.pkg.css',
'type' => 'css',
),
'5ef7da0b' =>
'86f654e2' =>
array(
'name' => 'differential.pkg.js',
'symbols' =>
@ -2601,7 +2601,7 @@ celerity_register_resource_map(array(
16 => 'javelin-behavior-differential-dropdown-menus',
17 => 'javelin-behavior-buoyant',
),
'uri' => '/res/pkg/5ef7da0b/differential.pkg.js',
'uri' => '/res/pkg/86f654e2/differential.pkg.js',
'type' => 'js',
),
'c8ce2d88' =>
@ -2697,7 +2697,7 @@ celerity_register_resource_map(array(
'aphront-dialog-view-css' => '4984f83f',
'aphront-error-view-css' => '4984f83f',
'aphront-form-view-css' => '4984f83f',
'aphront-headsup-action-list-view-css' => '5ed00902',
'aphront-headsup-action-list-view-css' => '32f461a4',
'aphront-headsup-view-css' => '4984f83f',
'aphront-list-filter-view-css' => '4984f83f',
'aphront-pager-view-css' => '4984f83f',
@ -2707,36 +2707,36 @@ celerity_register_resource_map(array(
'aphront-tokenizer-control-css' => '4984f83f',
'aphront-tooltip-css' => '4984f83f',
'aphront-typeahead-control-css' => '4984f83f',
'differential-changeset-view-css' => '5ed00902',
'differential-core-view-css' => '5ed00902',
'differential-inline-comment-editor' => '5ef7da0b',
'differential-local-commits-view-css' => '5ed00902',
'differential-results-table-css' => '5ed00902',
'differential-revision-add-comment-css' => '5ed00902',
'differential-revision-comment-css' => '5ed00902',
'differential-revision-comment-list-css' => '5ed00902',
'differential-revision-history-css' => '5ed00902',
'differential-table-of-contents-css' => '5ed00902',
'differential-changeset-view-css' => '32f461a4',
'differential-core-view-css' => '32f461a4',
'differential-inline-comment-editor' => '86f654e2',
'differential-local-commits-view-css' => '32f461a4',
'differential-results-table-css' => '32f461a4',
'differential-revision-add-comment-css' => '32f461a4',
'differential-revision-comment-css' => '32f461a4',
'differential-revision-comment-list-css' => '32f461a4',
'differential-revision-history-css' => '32f461a4',
'differential-table-of-contents-css' => '32f461a4',
'diffusion-commit-view-css' => 'c8ce2d88',
'diffusion-icons-css' => 'c8ce2d88',
'inline-comment-summary-css' => '5ed00902',
'inline-comment-summary-css' => '32f461a4',
'javelin-behavior' => '5b44c659',
'javelin-behavior-aphront-basic-tokenizer' => '97f65640',
'javelin-behavior-aphront-drag-and-drop' => '5ef7da0b',
'javelin-behavior-aphront-drag-and-drop-textarea' => '5ef7da0b',
'javelin-behavior-aphront-drag-and-drop' => '86f654e2',
'javelin-behavior-aphront-drag-and-drop-textarea' => '86f654e2',
'javelin-behavior-aphront-form-disable-on-submit' => '0c96375e',
'javelin-behavior-audit-preview' => '5e68be89',
'javelin-behavior-buoyant' => '5ef7da0b',
'javelin-behavior-differential-accept-with-errors' => '5ef7da0b',
'javelin-behavior-differential-add-reviewers-and-ccs' => '5ef7da0b',
'javelin-behavior-differential-comment-jump' => '5ef7da0b',
'javelin-behavior-differential-diff-radios' => '5ef7da0b',
'javelin-behavior-differential-dropdown-menus' => '5ef7da0b',
'javelin-behavior-differential-edit-inline-comments' => '5ef7da0b',
'javelin-behavior-differential-feedback-preview' => '5ef7da0b',
'javelin-behavior-differential-keyboard-navigation' => '5ef7da0b',
'javelin-behavior-differential-populate' => '5ef7da0b',
'javelin-behavior-differential-show-more' => '5ef7da0b',
'javelin-behavior-buoyant' => '86f654e2',
'javelin-behavior-differential-accept-with-errors' => '86f654e2',
'javelin-behavior-differential-add-reviewers-and-ccs' => '86f654e2',
'javelin-behavior-differential-comment-jump' => '86f654e2',
'javelin-behavior-differential-diff-radios' => '86f654e2',
'javelin-behavior-differential-dropdown-menus' => '86f654e2',
'javelin-behavior-differential-edit-inline-comments' => '86f654e2',
'javelin-behavior-differential-feedback-preview' => '86f654e2',
'javelin-behavior-differential-keyboard-navigation' => '86f654e2',
'javelin-behavior-differential-populate' => '86f654e2',
'javelin-behavior-differential-show-more' => '86f654e2',
'javelin-behavior-diffusion-commit-graph' => '5e68be89',
'javelin-behavior-diffusion-pull-lastmodified' => '5e68be89',
'javelin-behavior-maniphest-batch-selector' => '7707de41',
@ -2746,12 +2746,12 @@ celerity_register_resource_map(array(
'javelin-behavior-maniphest-transaction-preview' => '7707de41',
'javelin-behavior-phabricator-autofocus' => '0c96375e',
'javelin-behavior-phabricator-keyboard-shortcuts' => '0c96375e',
'javelin-behavior-phabricator-object-selector' => '5ef7da0b',
'javelin-behavior-phabricator-object-selector' => '86f654e2',
'javelin-behavior-phabricator-oncopy' => '0c96375e',
'javelin-behavior-phabricator-tooltips' => '0c96375e',
'javelin-behavior-phabricator-watch-anchor' => '0c96375e',
'javelin-behavior-refresh-csrf' => '0c96375e',
'javelin-behavior-repository-crossreference' => '5ef7da0b',
'javelin-behavior-repository-crossreference' => '86f654e2',
'javelin-behavior-workflow' => '0c96375e',
'javelin-dom' => '5b44c659',
'javelin-event' => '5b44c659',
@ -2773,23 +2773,23 @@ celerity_register_resource_map(array(
'maniphest-task-summary-css' => '7839ae2d',
'maniphest-transaction-detail-css' => '7839ae2d',
'phabricator-app-buttons-css' => '4984f83f',
'phabricator-content-source-view-css' => '5ed00902',
'phabricator-content-source-view-css' => '32f461a4',
'phabricator-core-buttons-css' => '4984f83f',
'phabricator-core-css' => '4984f83f',
'phabricator-directory-css' => '4984f83f',
'phabricator-drag-and-drop-file-upload' => '5ef7da0b',
'phabricator-drag-and-drop-file-upload' => '86f654e2',
'phabricator-dropdown-menu' => '0c96375e',
'phabricator-flag-css' => '4984f83f',
'phabricator-jump-nav' => '4984f83f',
'phabricator-keyboard-shortcut' => '0c96375e',
'phabricator-keyboard-shortcut-manager' => '0c96375e',
'phabricator-menu-item' => '0c96375e',
'phabricator-object-selector-css' => '5ed00902',
'phabricator-object-selector-css' => '32f461a4',
'phabricator-paste-file-upload' => '0c96375e',
'phabricator-prefab' => '0c96375e',
'phabricator-project-tag-css' => '7839ae2d',
'phabricator-remarkup-css' => '4984f83f',
'phabricator-shaped-request' => '5ef7da0b',
'phabricator-shaped-request' => '86f654e2',
'phabricator-standard-page-view' => '4984f83f',
'phabricator-tooltip' => '0c96375e',
'phabricator-transaction-view-css' => '4984f83f',

View file

@ -213,10 +213,21 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
}
}
$reveal_link = javelin_render_tag(
'a',
array(
'sigil' => 'differential-reveal-all',
'mustcapture' => true,
'class' => 'button differential-toc-reveal-all',
),
'Show All Context'
);
return
'<div id="differential-review-toc" '.
'class="differential-toc differential-panel">'.
$editor_link.
$reveal_link.
'<h1>Table of Contents</h1>'.
'<table>'.
'<tr>'.

View file

@ -24,8 +24,10 @@
color: #444444;
}
.differential-toc-reveal-all,
.differential-toc-edit-all {
float: right;
margin-left: .25em;
}
.diff-star-none {

View file

@ -10,10 +10,7 @@
JX.behavior('differential-dropdown-menus', function(config) {
function build_menu(button, data) {
function show_more() {
var container = JX.$(data.containerID);
function show_more(container) {
var nodes = JX.DOM.scry(container, 'tr', 'context-target');
for (var ii = 0; ii < nodes.length; ii++) {
var show = JX.DOM.scry(nodes[ii], 'a', 'show-more');
@ -30,6 +27,8 @@ JX.behavior('differential-dropdown-menus', function(config) {
}
}
function build_menu(button, data) {
function link_to(name, uri) {
var item = new JX.PhabricatorMenuItem(
name,
@ -39,7 +38,9 @@ JX.behavior('differential-dropdown-menus', function(config) {
return item;
}
var reveal_item = new JX.PhabricatorMenuItem('', show_more);
var reveal_item = new JX.PhabricatorMenuItem('', function () {
show_more(JX.$(data.containerID));
});
var diffusion_item;
if (data.diffusionURI) {
@ -100,4 +101,18 @@ JX.behavior('differential-dropdown-menus', function(config) {
build_menu(buttons[ii], JX.Stratcom.getData(buttons[ii]));
}
JX.Stratcom.listen(
'click',
'differential-reveal-all',
function(e) {
var containers = JX.DOM.scry(
JX.$('differential-review-stage'),
'div',
'differential-changeset');
for (var i=0; i < containers.length; i++) {
show_more(containers[i]);
}
e.kill();
});
});