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

Hide selection to provide a visual cue about clipboard JS magic in Differential

Summary: Inspired by D2242.

Test Plan:
Select text in left pane.
Select text in right pane.
Select all.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Koolvin

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

vrana 0732f2f9 44bbdec9

+76 -20
+28 -16
src/__celerity_resource_map__.php
··· 533 533 ), 534 534 'differential-core-view-css' => 535 535 array( 536 - 'uri' => '/res/0bc9223a/rsrc/css/application/differential/core.css', 536 + 'uri' => '/res/2303c309/rsrc/css/application/differential/core.css', 537 537 'type' => 'css', 538 538 'requires' => 539 539 array( ··· 993 993 4 => 'javelin-stratcom', 994 994 ), 995 995 'disk' => '/rsrc/js/application/differential/behavior-show-more.js', 996 + ), 997 + 'javelin-behavior-differential-user-select' => 998 + array( 999 + 'uri' => '/res/f0e3b555/rsrc/js/application/differential/behavior-user-select.js', 1000 + 'type' => 'js', 1001 + 'requires' => 1002 + array( 1003 + 0 => 'javelin-behavior', 1004 + 1 => 'javelin-dom', 1005 + 2 => 'javelin-stratcom', 1006 + ), 1007 + 'disk' => '/rsrc/js/application/differential/behavior-user-select.js', 996 1008 ), 997 1009 'javelin-behavior-diffusion-commit-graph' => 998 1010 array( ··· 2472 2484 'uri' => '/res/pkg/0c96375e/core.pkg.js', 2473 2485 'type' => 'js', 2474 2486 ), 2475 - '1138d3d1' => 2487 + 'a841d960' => 2476 2488 array( 2477 2489 'name' => 'differential.pkg.css', 2478 2490 'symbols' => ··· 2491 2503 11 => 'differential-local-commits-view-css', 2492 2504 12 => 'inline-comment-summary-css', 2493 2505 ), 2494 - 'uri' => '/res/pkg/1138d3d1/differential.pkg.css', 2506 + 'uri' => '/res/pkg/a841d960/differential.pkg.css', 2495 2507 'type' => 'css', 2496 2508 ), 2497 2509 'e4ddcab5' => ··· 2614 2626 'aphront-dialog-view-css' => '9c4e265b', 2615 2627 'aphront-error-view-css' => '9c4e265b', 2616 2628 'aphront-form-view-css' => '9c4e265b', 2617 - 'aphront-headsup-action-list-view-css' => '1138d3d1', 2629 + 'aphront-headsup-action-list-view-css' => 'a841d960', 2618 2630 'aphront-headsup-view-css' => '9c4e265b', 2619 2631 'aphront-list-filter-view-css' => '9c4e265b', 2620 2632 'aphront-pager-view-css' => '9c4e265b', ··· 2624 2636 'aphront-tokenizer-control-css' => '9c4e265b', 2625 2637 'aphront-tooltip-css' => '9c4e265b', 2626 2638 'aphront-typeahead-control-css' => '9c4e265b', 2627 - 'differential-changeset-view-css' => '1138d3d1', 2628 - 'differential-core-view-css' => '1138d3d1', 2639 + 'differential-changeset-view-css' => 'a841d960', 2640 + 'differential-core-view-css' => 'a841d960', 2629 2641 'differential-inline-comment-editor' => 'e4ddcab5', 2630 - 'differential-local-commits-view-css' => '1138d3d1', 2631 - 'differential-revision-add-comment-css' => '1138d3d1', 2632 - 'differential-revision-comment-css' => '1138d3d1', 2633 - 'differential-revision-comment-list-css' => '1138d3d1', 2634 - 'differential-revision-detail-css' => '1138d3d1', 2635 - 'differential-revision-history-css' => '1138d3d1', 2636 - 'differential-table-of-contents-css' => '1138d3d1', 2642 + 'differential-local-commits-view-css' => 'a841d960', 2643 + 'differential-revision-add-comment-css' => 'a841d960', 2644 + 'differential-revision-comment-css' => 'a841d960', 2645 + 'differential-revision-comment-list-css' => 'a841d960', 2646 + 'differential-revision-detail-css' => 'a841d960', 2647 + 'differential-revision-history-css' => 'a841d960', 2648 + 'differential-table-of-contents-css' => 'a841d960', 2637 2649 'diffusion-commit-view-css' => 'c8ce2d88', 2638 2650 'diffusion-icons-css' => 'c8ce2d88', 2639 - 'inline-comment-summary-css' => '1138d3d1', 2651 + 'inline-comment-summary-css' => 'a841d960', 2640 2652 'javelin-behavior' => '8a5de8a3', 2641 2653 'javelin-behavior-aphront-basic-tokenizer' => '97f65640', 2642 2654 'javelin-behavior-aphront-drag-and-drop' => 'e4ddcab5', ··· 2690 2702 'maniphest-task-summary-css' => '7839ae2d', 2691 2703 'maniphest-transaction-detail-css' => '7839ae2d', 2692 2704 'phabricator-app-buttons-css' => '9c4e265b', 2693 - 'phabricator-content-source-view-css' => '1138d3d1', 2705 + 'phabricator-content-source-view-css' => 'a841d960', 2694 2706 'phabricator-core-buttons-css' => '9c4e265b', 2695 2707 'phabricator-core-css' => '9c4e265b', 2696 2708 'phabricator-directory-css' => '9c4e265b', ··· 2701 2713 'phabricator-keyboard-shortcut' => '0c96375e', 2702 2714 'phabricator-keyboard-shortcut-manager' => '0c96375e', 2703 2715 'phabricator-menu-item' => '0c96375e', 2704 - 'phabricator-object-selector-css' => '1138d3d1', 2716 + 'phabricator-object-selector-css' => 'a841d960', 2705 2717 'phabricator-paste-file-upload' => '0c96375e', 2706 2718 'phabricator-prefab' => '0c96375e', 2707 2719 'phabricator-project-tag-css' => '7839ae2d',
+1
src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php
··· 324 324 array( 325 325 'haunt' => $pane_id, 326 326 )); 327 + Javelin::initBehavior('differential-user-select'); 327 328 328 329 $page_pane = id(new DifferentialPrimaryPaneView()) 329 330 ->setLineWidthFromChangesets($changesets)
+7 -4
src/applications/differential/parser/changeset/DifferentialChangesetParser.php
··· 1579 1579 $props = $this->renderPropertyChangeHeader($this->changeset); 1580 1580 $table = null; 1581 1581 if ($contents) { 1582 - $table = 1583 - '<table class="differential-diff remarkup-code PhabricatorMonospaced">'. 1584 - $contents. 1585 - '</table>'; 1582 + $table = javelin_render_tag( 1583 + 'table', 1584 + array( 1585 + 'class' => 'differential-diff remarkup-code PhabricatorMonospaced', 1586 + 'sigil' => 'differential-diff', 1587 + ), 1588 + $contents); 1586 1589 } 1587 1590 1588 1591 if (!$table && !$props) {
+8
webroot/rsrc/css/application/differential/core.css
··· 27 27 padding-bottom: 8px; 28 28 margin-bottom: 8px; 29 29 } 30 + 31 + .differential-unselectable tr td:nth-of-type(1) { 32 + -moz-user-select: -moz-none; 33 + -khtml-user-select: none; 34 + -webkit-user-select: none; 35 + -ms-user-select: none; 36 + user-select: none; 37 + }
+32
webroot/rsrc/js/application/differential/behavior-user-select.js
··· 1 + /** 2 + * @provides javelin-behavior-differential-user-select 3 + * @requires javelin-behavior 4 + * javelin-dom 5 + * javelin-stratcom 6 + */ 7 + 8 + JX.behavior('differential-user-select', function() { 9 + 10 + var unselectable; 11 + 12 + function isOnRight(node) { 13 + return node.parentNode.firstChild != node.previousSibling; 14 + } 15 + 16 + JX.Stratcom.listen( 17 + 'mousedown', 18 + null, 19 + function(e) { 20 + var key = 'differential-unselectable'; 21 + if (unselectable) { 22 + JX.DOM.alterClass(unselectable, key, false); 23 + } 24 + var diff = e.getNode('differential-diff'); 25 + var td = e.getNode('tag:td'); 26 + if (diff && td && isOnRight(td)) { 27 + unselectable = diff; 28 + JX.DOM.alterClass(diff, key, true); 29 + } 30 + }); 31 + 32 + });