mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 18:22:41 +01:00
Use keyboard shortcuts for the "`" darkconsole toggle.
Summary: This simplifies it a lot and prevents it from spazzing out when some control is foucsed. Test Plan: Hit "?", "`". Reviewed By: aran Reviewers: jungejason, aran, tuomaspelkonen CC: aran Differential Revision: 410
This commit is contained in:
parent
49d6854f95
commit
19d0d28089
2 changed files with 44 additions and 52 deletions
|
@ -145,7 +145,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'differential-changeset-view-css' =>
|
'differential-changeset-view-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/d92a2fb5/rsrc/css/application/differential/changeset-view.css',
|
'uri' => '/res/4cb57f5f/rsrc/css/application/differential/changeset-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -330,7 +330,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-dark-console' =>
|
'javelin-behavior-dark-console' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/044c171f/rsrc/js/application/core/behavior-dark-console.js',
|
'uri' => '/res/c80156c4/rsrc/js/application/core/behavior-dark-console.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -339,6 +339,7 @@ celerity_register_resource_map(array(
|
||||||
2 => 'javelin-util',
|
2 => 'javelin-util',
|
||||||
3 => 'javelin-dom',
|
3 => 'javelin-dom',
|
||||||
4 => 'javelin-request',
|
4 => 'javelin-request',
|
||||||
|
5 => 'phabricator-keyboard-shortcut',
|
||||||
),
|
),
|
||||||
'disk' => '/rsrc/js/application/core/behavior-dark-console.js',
|
'disk' => '/rsrc/js/application/core/behavior-dark-console.js',
|
||||||
),
|
),
|
||||||
|
@ -1057,23 +1058,6 @@ celerity_register_resource_map(array(
|
||||||
'uri' => '/res/pkg/33f413ef/typeahead.pkg.js',
|
'uri' => '/res/pkg/33f413ef/typeahead.pkg.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
),
|
),
|
||||||
'3bf80070' =>
|
|
||||||
array (
|
|
||||||
'name' => 'differential.pkg.css',
|
|
||||||
'symbols' =>
|
|
||||||
array (
|
|
||||||
0 => 'differential-core-view-css',
|
|
||||||
1 => 'differential-changeset-view-css',
|
|
||||||
2 => 'differential-revision-detail-css',
|
|
||||||
3 => 'differential-revision-history-css',
|
|
||||||
4 => 'differential-table-of-contents-css',
|
|
||||||
5 => 'differential-revision-comment-css',
|
|
||||||
6 => 'differential-revision-add-comment-css',
|
|
||||||
7 => 'differential-revision-comment-list-css',
|
|
||||||
),
|
|
||||||
'uri' => '/res/pkg/3bf80070/differential.pkg.css',
|
|
||||||
'type' => 'css',
|
|
||||||
),
|
|
||||||
'64383b02' =>
|
'64383b02' =>
|
||||||
array (
|
array (
|
||||||
'name' => 'core.pkg.css',
|
'name' => 'core.pkg.css',
|
||||||
|
@ -1098,6 +1082,23 @@ celerity_register_resource_map(array(
|
||||||
'uri' => '/res/pkg/64383b02/core.pkg.css',
|
'uri' => '/res/pkg/64383b02/core.pkg.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
),
|
),
|
||||||
|
'b1200c80' =>
|
||||||
|
array (
|
||||||
|
'name' => 'differential.pkg.css',
|
||||||
|
'symbols' =>
|
||||||
|
array (
|
||||||
|
0 => 'differential-core-view-css',
|
||||||
|
1 => 'differential-changeset-view-css',
|
||||||
|
2 => 'differential-revision-detail-css',
|
||||||
|
3 => 'differential-revision-history-css',
|
||||||
|
4 => 'differential-table-of-contents-css',
|
||||||
|
5 => 'differential-revision-comment-css',
|
||||||
|
6 => 'differential-revision-add-comment-css',
|
||||||
|
7 => 'differential-revision-comment-list-css',
|
||||||
|
),
|
||||||
|
'uri' => '/res/pkg/b1200c80/differential.pkg.css',
|
||||||
|
'type' => 'css',
|
||||||
|
),
|
||||||
'db95a6d0' =>
|
'db95a6d0' =>
|
||||||
array (
|
array (
|
||||||
'name' => 'javelin.pkg.js',
|
'name' => 'javelin.pkg.js',
|
||||||
|
@ -1159,14 +1160,14 @@ celerity_register_resource_map(array(
|
||||||
'aphront-table-view-css' => '64383b02',
|
'aphront-table-view-css' => '64383b02',
|
||||||
'aphront-tokenizer-control-css' => '64383b02',
|
'aphront-tokenizer-control-css' => '64383b02',
|
||||||
'aphront-typeahead-control-css' => '64383b02',
|
'aphront-typeahead-control-css' => '64383b02',
|
||||||
'differential-changeset-view-css' => '3bf80070',
|
'differential-changeset-view-css' => 'b1200c80',
|
||||||
'differential-core-view-css' => '3bf80070',
|
'differential-core-view-css' => 'b1200c80',
|
||||||
'differential-revision-add-comment-css' => '3bf80070',
|
'differential-revision-add-comment-css' => 'b1200c80',
|
||||||
'differential-revision-comment-css' => '3bf80070',
|
'differential-revision-comment-css' => 'b1200c80',
|
||||||
'differential-revision-comment-list-css' => '3bf80070',
|
'differential-revision-comment-list-css' => 'b1200c80',
|
||||||
'differential-revision-detail-css' => '3bf80070',
|
'differential-revision-detail-css' => 'b1200c80',
|
||||||
'differential-revision-history-css' => '3bf80070',
|
'differential-revision-history-css' => 'b1200c80',
|
||||||
'differential-table-of-contents-css' => '3bf80070',
|
'differential-table-of-contents-css' => 'b1200c80',
|
||||||
'diffusion-commit-view-css' => '03ef179e',
|
'diffusion-commit-view-css' => '03ef179e',
|
||||||
'javelin-behavior' => 'db95a6d0',
|
'javelin-behavior' => 'db95a6d0',
|
||||||
'javelin-behavior-aphront-basic-tokenizer' => '33f413ef',
|
'javelin-behavior-aphront-basic-tokenizer' => '33f413ef',
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* javelin-util
|
* javelin-util
|
||||||
* javelin-dom
|
* javelin-dom
|
||||||
* javelin-request
|
* javelin-request
|
||||||
|
* phabricator-keyboard-shortcut
|
||||||
*/
|
*/
|
||||||
|
|
||||||
JX.behavior('dark-console', function(config) {
|
JX.behavior('dark-console', function(config) {
|
||||||
|
@ -29,31 +30,21 @@ JX.behavior('dark-console', function(config) {
|
||||||
.send();
|
.send();
|
||||||
});
|
});
|
||||||
|
|
||||||
JX.Stratcom.listen(
|
var desc = 'Toggle visibility of DarkConsole.';
|
||||||
'keypress',
|
new JX.KeyboardShortcut('`', desc)
|
||||||
null,
|
.setHandler(function(manager) {
|
||||||
function(e) {
|
var console = JX.DOM.find(document.body, 'table', 'dark-console');
|
||||||
var raw = e.getRawEvent();
|
|
||||||
if ((String.fromCharCode(raw.charCode).charAt(0) == '`') &&
|
|
||||||
!raw.shiftKey &&
|
|
||||||
!raw.metaKey) {
|
|
||||||
|
|
||||||
if (JX.Stratcom.pass()) {
|
config.visible = !config.visible;
|
||||||
return;
|
if (config.visible) {
|
||||||
}
|
JX.DOM.show(console);
|
||||||
|
} else {
|
||||||
var console = JX.DOM.find(document.body, 'table', 'dark-console');
|
JX.DOM.hide(console);
|
||||||
|
|
||||||
config.visible = !config.visible;
|
|
||||||
if (config.visible) {
|
|
||||||
JX.DOM.show(console);
|
|
||||||
} else {
|
|
||||||
JX.DOM.hide(console);
|
|
||||||
}
|
|
||||||
|
|
||||||
new JX.Request(config.uri, JX.bag)
|
|
||||||
.setData({visible: config.visible ? 1 : 0})
|
|
||||||
.send();
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
new JX.Request(config.uri, JX.bag)
|
||||||
|
.setData({visible: config.visible ? 1 : 0})
|
||||||
|
.send();
|
||||||
|
})
|
||||||
|
.register();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue