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

Don't allow the middle mouse button to start an inline comment

Summary:
Ref T13216. See PHI985. When you click a line number to start an inline comment, we intend to initiate the action only if you used the left mouse button (desktop) or a touch (tablet/device).

We currently have a `not right` condition for doing this, but it only excludes right clicks, not middle clicks (or other nth-button clicks). The `not right` condition was sligthly easier to write, but use an `is left` condition instead of a `not right` condition.

Test Plan:
- In Safari, Firefox and Chrome:
- Used left click to start an inline.
- Used middle click to do nothing (previously: started an inline).

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13216

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

+31 -14
+13 -13
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => 'e68cf1fa', 11 11 'conpherence.pkg.js' => '15191c65', 12 12 'core.pkg.css' => 'cff4ff6f', 13 - 'core.pkg.js' => 'b5a949ca', 13 + 'core.pkg.js' => '4bde473b', 14 14 'differential.pkg.css' => '06dc617c', 15 - 'differential.pkg.js' => 'c1cfa143', 15 + 'differential.pkg.js' => 'ef0b989b', 16 16 'diffusion.pkg.css' => 'a2d17c7d', 17 17 'diffusion.pkg.js' => '6134c5a1', 18 18 'maniphest.pkg.css' => '4845691a', ··· 207 207 'rsrc/externals/font/lato/lato-regular.ttf' => 'e270165b', 208 208 'rsrc/externals/font/lato/lato-regular.woff' => '13d39fe2', 209 209 'rsrc/externals/font/lato/lato-regular.woff2' => '57a9f742', 210 - 'rsrc/externals/javelin/core/Event.js' => '2ee659ce', 210 + 'rsrc/externals/javelin/core/Event.js' => 'ef7e057f', 211 211 'rsrc/externals/javelin/core/Stratcom.js' => '327f418a', 212 212 'rsrc/externals/javelin/core/__tests__/event-stop-and-kill.js' => '717554e4', 213 213 'rsrc/externals/javelin/core/__tests__/install.js' => 'c432ee85', ··· 373 373 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 374 374 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 375 375 'rsrc/js/application/diff/DiffChangeset.js' => 'b49b59d6', 376 - 'rsrc/js/application/diff/DiffChangesetList.js' => 'e0b984b5', 376 + 'rsrc/js/application/diff/DiffChangesetList.js' => '0a84bcc1', 377 377 'rsrc/js/application/diff/DiffInline.js' => 'e83d28f3', 378 378 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 379 379 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', ··· 688 688 'javelin-diffusion-locate-file-source' => '00676f00', 689 689 'javelin-dom' => '4976858c', 690 690 'javelin-dynval' => 'f6555212', 691 - 'javelin-event' => '2ee659ce', 691 + 'javelin-event' => 'ef7e057f', 692 692 'javelin-fx' => '54b612ba', 693 693 'javelin-history' => 'd4505101', 694 694 'javelin-install' => '05270951', ··· 750 750 'phabricator-darkmessage' => 'c48cccdd', 751 751 'phabricator-dashboard-css' => 'fe5b1869', 752 752 'phabricator-diff-changeset' => 'b49b59d6', 753 - 'phabricator-diff-changeset-list' => 'e0b984b5', 753 + 'phabricator-diff-changeset-list' => '0a84bcc1', 754 754 'phabricator-diff-inline' => 'e83d28f3', 755 755 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 756 756 'phabricator-draggable-list' => 'bea6e7f4', ··· 944 944 'javelin-dom', 945 945 'javelin-router', 946 946 ), 947 + '0a84bcc1' => array( 948 + 'javelin-install', 949 + 'phuix-button-view', 950 + ), 947 951 '0f764c35' => array( 948 952 'javelin-install', 949 953 'javelin-util', ··· 1048 1052 '2caa8fb8' => array( 1049 1053 'javelin-install', 1050 1054 'javelin-event', 1051 - ), 1052 - '2ee659ce' => array( 1053 - 'javelin-install', 1054 1055 ), 1055 1056 '31420f77' => array( 1056 1057 'javelin-behavior', ··· 2009 2010 'phuix-icon-view', 2010 2011 'phabricator-prefab', 2011 2012 ), 2012 - 'e0b984b5' => array( 2013 - 'javelin-install', 2014 - 'phuix-button-view', 2015 - ), 2016 2013 'e1d25dfb' => array( 2017 2014 'javelin-behavior', 2018 2015 'javelin-stratcom', ··· 2093 2090 'edf8a145' => array( 2094 2091 'javelin-behavior', 2095 2092 'javelin-uri', 2093 + ), 2094 + 'ef7e057f' => array( 2095 + 'javelin-install', 2096 2096 ), 2097 2097 'efe49472' => array( 2098 2098 'javelin-install',
+14
webroot/rsrc/externals/javelin/core/Event.js
··· 133 133 return r.which == 3 || r.button == 2; 134 134 }, 135 135 136 + 137 + /** 138 + * Get whether the mouse button associated with the mouse event is the 139 + * left-side button in a browser-agnostic way. 140 + * 141 + * @return bool 142 + * @task info 143 + */ 144 + isLeftButton: function() { 145 + var r = this.getRawEvent(); 146 + return (r.which == 1 || r.button == 0); 147 + }, 148 + 149 + 136 150 /** 137 151 * Determine if a mouse event is a normal event (left mouse button, no 138 152 * modifier keys).
+4 -1
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 1261 1261 _onrangedown: function(e) { 1262 1262 // NOTE: We're allowing "mousedown" from a touch event through so users 1263 1263 // can leave inlines on a single line. 1264 - if (e.isRightButton()) { 1264 + 1265 + // See PHI985. We want to exclude both right-mouse and middle-mouse 1266 + // clicks from continuing. 1267 + if (!e.isLeftButton()) { 1265 1268 return; 1266 1269 } 1267 1270