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

Improve mobile/device behaviors for inline comments

Summary: Fixes T1026. Ref T12616. Allows drag-to-select on devices to add inlines on a range of lines, using dark magic that I copy/pasted from StackOverflow.

Test Plan: Left a comment on a range of lines on iPhone simulator.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12616, T1026

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

+50 -14
+6 -6
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '0f87a6eb', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => 'ea471cb0', 16 - 'differential.pkg.js' => '85c19957', 16 + 'differential.pkg.js' => '58457c19', 17 17 'diffusion.pkg.css' => 'b93d9b8c', 18 18 'diffusion.pkg.js' => '84c8f8fd', 19 19 'favicon.ico' => '30672e08', ··· 391 391 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 392 392 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 393 393 'rsrc/js/application/diff/DiffChangeset.js' => '68758d99', 394 - 'rsrc/js/application/diff/DiffChangesetList.js' => '842e2676', 394 + 'rsrc/js/application/diff/DiffChangesetList.js' => '204e4bfc', 395 395 'rsrc/js/application/diff/DiffInline.js' => '1afe9760', 396 396 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 397 397 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', ··· 778 778 'phabricator-darkmessage' => 'c48cccdd', 779 779 'phabricator-dashboard-css' => 'fe5b1869', 780 780 'phabricator-diff-changeset' => '68758d99', 781 - 'phabricator-diff-changeset-list' => '842e2676', 781 + 'phabricator-diff-changeset-list' => '204e4bfc', 782 782 'phabricator-diff-inline' => '1afe9760', 783 783 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 784 784 'phabricator-draggable-list' => 'bea6e7f4', ··· 1066 1066 'javelin-install', 1067 1067 'javelin-dom', 1068 1068 ), 1069 + '204e4bfc' => array( 1070 + 'javelin-install', 1071 + ), 1069 1072 '21df4ff5' => array( 1070 1073 'javelin-install', 1071 1074 'javelin-workboard-card', ··· 1531 1534 '83e03671' => array( 1532 1535 'javelin-install', 1533 1536 'javelin-dom', 1534 - ), 1535 - '842e2676' => array( 1536 - 'javelin-install', 1537 1537 ), 1538 1538 '8499b6ab' => array( 1539 1539 'javelin-behavior',
+44 -8
webroot/rsrc/js/application/diff/DiffChangesetList.js
··· 65 65 66 66 var onrangedown = JX.bind(this, this._ifawake, this._onrangedown); 67 67 JX.Stratcom.listen( 68 - 'mousedown', 68 + ['touchstart', 'mousedown'], 69 69 ['differential-changeset', 'tag:th'], 70 70 onrangedown); 71 71 ··· 75 75 ['differential-changeset', 'tag:th'], 76 76 onrangemove); 77 77 78 + var onrangetouchmove = JX.bind(this, this._ifawake, this._onrangetouchmove); 79 + JX.Stratcom.listen( 80 + 'touchmove', 81 + null, 82 + onrangetouchmove); 83 + 78 84 var onrangeup = JX.bind(this, this._ifawake, this._onrangeup); 79 - JX.Stratcom.listen('mouseup', null, onrangeup); 85 + JX.Stratcom.listen( 86 + ['touchend', 'mouseup'], 87 + null, 88 + onrangeup); 80 89 }, 81 90 82 91 properties: { ··· 1088 1097 }, 1089 1098 1090 1099 _onrangedown: function(e) { 1091 - if (!e.isNormalMouseEvent()) { 1092 - return; 1093 - } 1094 - 1095 - if (e.getIsTouchEvent()) { 1100 + // NOTE: We're allowing touch events through, including "touchstart". We 1101 + // need to kill the "touchstart" event so the page doesn't scroll. 1102 + if (e.isRightButton()) { 1096 1103 return; 1097 1104 } 1098 1105 ··· 1120 1127 return; 1121 1128 } 1122 1129 1130 + var is_out = (e.getType() == 'mouseout'); 1123 1131 var target = e.getTarget(); 1124 1132 1133 + this._updateRange(target, is_out); 1134 + }, 1135 + 1136 + _updateRange: function(target, is_out) { 1125 1137 // Don't update the range if this "<th />" doesn't correspond to a line 1126 1138 // number. For instance, this may be a dead line number, like the empty 1127 1139 // line numbers on the left hand side of a newly added file. ··· 1154 1166 } 1155 1167 } 1156 1168 1157 - var is_out = (e.getType() == 'mouseout'); 1158 1169 if (is_out) { 1159 1170 if (this._rangeActive) { 1160 1171 // If we're dragging a range, just leave the state as it is. This ··· 1175 1186 } 1176 1187 1177 1188 this._setHoverRange(this._rangeOrigin, this._rangeTarget); 1189 + }, 1190 + 1191 + _onrangetouchmove: function(e) { 1192 + if (!this._rangeActive) { 1193 + return; 1194 + } 1195 + 1196 + // NOTE: The target of a "touchmove" event is bogus. Use dark magic to 1197 + // identify the actual target. Some day, this might move into the core 1198 + // libraries. If this doesn't work, just bail. 1199 + 1200 + var target; 1201 + try { 1202 + var raw_event = e.getRawEvent(); 1203 + var touch = raw_event.touches[0]; 1204 + target = document.elementFromPoint(touch.clientX, touch.clientY); 1205 + } catch (ex) { 1206 + return; 1207 + } 1208 + 1209 + if (!JX.DOM.isType(target, 'th')) { 1210 + return; 1211 + } 1212 + 1213 + this._updateRange(target, false); 1178 1214 }, 1179 1215 1180 1216 _onrangeup: function(e) {