Page MenuHomePhabricator

D17899.id43057.diff
No OneTemporary

D17899.id43057.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -10,10 +10,10 @@
'conpherence.pkg.css' => 'ff161f2d',
'conpherence.pkg.js' => 'b5b51108',
'core.pkg.css' => 'd1bf3405',
- 'core.pkg.js' => '2ff7879f',
+ 'core.pkg.js' => '115cb4da',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '58712637',
- 'differential.pkg.js' => '5ee318c2',
+ 'differential.pkg.js' => '194476c0',
'diffusion.pkg.css' => 'b93d9b8c',
'diffusion.pkg.js' => '84c8f8fd',
'favicon.ico' => '30672e08',
@@ -391,7 +391,7 @@
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/diff/DiffChangeset.js' => 'f7100923',
- 'rsrc/js/application/diff/DiffChangesetList.js' => 'f10fd7a3',
+ 'rsrc/js/application/diff/DiffChangesetList.js' => 'bd98509d',
'rsrc/js/application/diff/DiffInline.js' => '00db3c3a',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d',
@@ -474,7 +474,7 @@
'rsrc/js/core/FileUpload.js' => '680ea2c8',
'rsrc/js/core/Hovercard.js' => '1bd28176',
'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2',
- 'rsrc/js/core/KeyboardShortcutManager.js' => '4a021c10',
+ 'rsrc/js/core/KeyboardShortcutManager.js' => 'c19dd9b9',
'rsrc/js/core/MultirowRowManager.js' => 'b5d57730',
'rsrc/js/core/Notification.js' => 'ccf1cbf8',
'rsrc/js/core/Prefab.js' => 'c5af80a2',
@@ -782,7 +782,7 @@
'phabricator-darkmessage' => 'c48cccdd',
'phabricator-dashboard-css' => 'fe5b1869',
'phabricator-diff-changeset' => 'f7100923',
- 'phabricator-diff-changeset-list' => 'f10fd7a3',
+ 'phabricator-diff-changeset-list' => 'bd98509d',
'phabricator-diff-inline' => '00db3c3a',
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4',
@@ -793,7 +793,7 @@
'phabricator-filetree-view-css' => 'fccf9f82',
'phabricator-flag-css' => 'bba8f811',
'phabricator-keyboard-shortcut' => '1ae869f2',
- 'phabricator-keyboard-shortcut-manager' => '4a021c10',
+ 'phabricator-keyboard-shortcut-manager' => 'c19dd9b9',
'phabricator-main-menu-view' => '5294060f',
'phabricator-nav-view-css' => 'faf6a6fc',
'phabricator-notification' => 'ccf1cbf8',
@@ -1250,13 +1250,6 @@
'javelin-dom',
'javelin-stratcom',
),
- '4a021c10' => array(
- 'javelin-install',
- 'javelin-util',
- 'javelin-stratcom',
- 'javelin-dom',
- 'javelin-vector',
- ),
'4b3c4443' => array(
'phuix-icon-view',
),
@@ -1880,6 +1873,9 @@
'javelin-vector',
'phui-hovercard',
),
+ 'bd98509d' => array(
+ 'javelin-install',
+ ),
'bdaf4d04' => array(
'javelin-behavior',
'javelin-dom',
@@ -1913,6 +1909,13 @@
'javelin-install',
'javelin-dom',
),
+ 'c19dd9b9' => array(
+ 'javelin-install',
+ 'javelin-util',
+ 'javelin-stratcom',
+ 'javelin-dom',
+ 'javelin-vector',
+ ),
'c420b0b9' => array(
'javelin-behavior',
'javelin-behavior-device',
@@ -2167,9 +2170,6 @@
'javelin-workflow',
'javelin-json',
),
- 'f10fd7a3' => array(
- 'javelin-install',
- ),
'f12cbc9f' => array(
'phui-oi-list-view-css',
),
diff --git a/webroot/rsrc/js/application/diff/DiffChangesetList.js b/webroot/rsrc/js/application/diff/DiffChangesetList.js
--- a/webroot/rsrc/js/application/diff/DiffChangesetList.js
+++ b/webroot/rsrc/js/application/diff/DiffChangesetList.js
@@ -60,7 +60,10 @@
_changesets: null,
_cursorItem: null,
- _lastKeyboardManager: null,
+
+ _focusNode: null,
+ _focusStart: null,
+ _focusEnd: null,
sleep: function() {
this._asleep = true;
@@ -198,7 +201,7 @@
if (cursor.type == 'comment') {
var inline = cursor.inline;
if (inline.canReply()) {
- manager.focusOn(null);
+ this.setFocus(null);
inline.reply();
return;
@@ -217,7 +220,7 @@
if (cursor.type == 'comment') {
var inline = cursor.inline;
if (inline.canEdit()) {
- manager.focusOn(null);
+ this.setFocus(null);
inline.edit();
return;
@@ -310,21 +313,13 @@
},
_redrawSelection: function(manager, scroll) {
- manager = manager || this._lastKeyboardManager;
- this._lastKeyboardManager = manager;
-
- if (this.isAsleep()) {
- manager.focusOn(null);
- return;
- }
-
var cursor = this._cursorItem;
if (!cursor) {
- manager.focusOn(null);
+ this.setFocus(null);
return;
}
- manager.focusOn(cursor.nodes.begin, cursor.nodes.end);
+ this.setFocus(cursor.nodes.begin, cursor.nodes.end);
if (scroll) {
manager.scrollTo(cursor.nodes.begin);
@@ -644,6 +639,47 @@
}
},
+ setFocus: function(node, extended_node) {
+ this._focusStart = node;
+ this._focusEnd = extended_node;
+ this._redrawFocus();
+ },
+
+ _redrawFocus: function() {
+ var node = this._focusStart;
+ var extended_node = this._focusEnd || node;
+
+ var reticle = this._getFocusNode();
+ if (!node) {
+ JX.DOM.remove(reticle);
+ return;
+ }
+
+ // Outset the reticle some pixels away from the element, so there's some
+ // space between the focused element and the outline.
+ var p = JX.Vector.getPos(node);
+ var s = JX.Vector.getAggregateScrollForNode(node);
+
+ p.add(s).add(-4, -4).setPos(reticle);
+ // Compute the size we need to extend to the full extent of the focused
+ // nodes.
+ JX.Vector.getPos(extended_node)
+ .add(-p.x, -p.y)
+ .add(JX.Vector.getDim(extended_node))
+ .add(8, 8)
+ .setDim(reticle);
+
+ JX.DOM.getContentFrame().appendChild(reticle);
+ },
+
+ _getFocusNode: function() {
+ if (!this._focusNode) {
+ var node = JX.$N('div', {className : 'keyboard-focus-focus-reticle'});
+ this._focusNode = node;
+ }
+ return this._focusNode;
+ },
+
_deleteInlineByID: function(id) {
var uri = this.getInlineURI();
var data = {
diff --git a/webroot/rsrc/js/core/KeyboardShortcutManager.js b/webroot/rsrc/js/core/KeyboardShortcutManager.js
--- a/webroot/rsrc/js/core/KeyboardShortcutManager.js
+++ b/webroot/rsrc/js/core/KeyboardShortcutManager.js
@@ -54,7 +54,6 @@
members : {
_shortcuts : null,
- _focusReticle : null,
/**
* Instead of calling this directly, you should call
@@ -83,48 +82,6 @@
JX.DOM.scrollToPosition(0, node_position.y + scroll_distance.y - 60);
},
- /**
- * Move the keyboard shortcut focus to an element.
- *
- * @param Node Node to focus, or pass null to clear the focus.
- * @param Node To focus multiple nodes (like rows in a table), specify the
- * top-left node as the first parameter and the bottom-right
- * node as the focus extension.
- * @return void
- */
- focusOn : function(node, extended_node) {
- this._clearReticle();
-
- if (!node) {
- return;
- }
-
- var r = JX.$N('div', {className : 'keyboard-focus-focus-reticle'});
-
- extended_node = extended_node || node;
-
- // Outset the reticle some pixels away from the element, so there's some
- // space between the focused element and the outline.
- var p = JX.Vector.getPos(node);
- var s = JX.Vector.getAggregateScrollForNode(node);
-
- p.add(s).add(-4, -4).setPos(r);
- // Compute the size we need to extend to the full extent of the focused
- // nodes.
- JX.Vector.getPos(extended_node)
- .add(-p.x, -p.y)
- .add(JX.Vector.getDim(extended_node))
- .add(8, 8)
- .setDim(r);
- JX.DOM.getContentFrame().appendChild(r);
-
- this._focusReticle = r;
- },
-
- _clearReticle : function() {
- this._focusReticle && JX.DOM.remove(this._focusReticle);
- this._focusReticle = null;
- },
_onkeypress : function(e) {
if (!(this._getKey(e) in JX.KeyboardShortcutManager._downkeys)) {
this._onkeyhit(e);

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 22, 3:28 AM (1 d, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7716355
Default Alt Text
D17899.id43057.diff (8 KB)

Event Timeline